coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Jason -Zhong Sheng- Hu <fdhzs2010 AT hotmail.com>
- To: "coq-club AT inria.fr" <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] Is non-strict positivity ever okay?
- Date: Wed, 15 Apr 2020 02:17:28 +0000
- Accept-language: en-CA, en-US
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OYDQR+fBalSHiIsKJqYNmzoNOO6A6px4dkZdwlienXU=; b=Xn5j4a6lnRIP1pjTnjoRfem09+l6FyC83wJ0tE/NP3RuNJ/QEOISUr3CSWrjIDVksv0sRJ0IRrtvsoKi7b0LvW5d9YSReJmNVd13RNysswo1XLBLd+kO5W57ml3euVKincya3oYN4Gy5lA6hit2NWY/wjb61ImeneomjMXLE8KoOpxlSCeOd0RT8SRpOmcdxdqQaqJia+qFQE2igLuPwtR7kAFexG2Af5Ku9gz1HeSwHj+V0Ka3Qi6Xha3r+cOvPhRMC8AuAG++5qUnTqSlH+40lV/GpZ+sIvzQrbIgTHYDSh3aKXBTf/34gUAhl5TwhUOp+sDWisPJy/VrSvunQgA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QsB7nBuCta4ZO2cNT6HuT+6Z/dMJoWELPrx81iMZST9C3SlAhEr493iEp67NMOhvyl2TNumH4kxD9t09Pl8E21eWQopQ89Vd+pe/1pw5ncUKZJFAPhmk26GHOgLFORcTasgFinnHP96j9JXE48SL2wDWiuY2zM1GxAaAAkABP8WYik/SjhHw8scheqmFJwC5Xak6SXRUQeYXtbZB2BcJW2v+Q1ODW5/isbNJ3Syv7SxyGpk4JLCEaTpaXaxS+qlopVOXmtZOnHB/anbXW9kuDjpdrQ53Hc1s5/6z96B60IpnCl+Eqe8vvZaFdVkj8XOK3mG65DiCbvVNslvC+G2BEA==
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=fdhzs2010 AT hotmail.com; spf=Pass smtp.mailfrom=fdhzs2010 AT hotmail.com; spf=Pass smtp.helo=postmaster AT NAM10-DM6-obe.outbound.protection.outlook.com
- Ironport-phdr: 9a23:N/bnwRfc2r8OLcjafekZmGhNlGMj4u6mDksu8pMizoh2WeGdxc2ybR7h7PlgxGXEQZ/co6odzbGJ4+a9ASQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpW1aJhKqfwFyP6H+HpPYp8WxzeG7vZPJKU0cjz2kJLh2MR+erAPLt8BQj5E0eYgrzR6cgHJTfOIegFFoIlSc1y3868G/udZD7mwEtf4h5dUaCfyiV6Q/UblRDTBgOGcwsp64/SLfRBeCsyNPGl4dlQBFVlCcvUPKG6zpuy6/jdJTnSyTPMn4V7cxAG/w76B3TRbpjGEMMDtrqTiL2Pw1t7pSpVeanzI625TdOdrHNP1ie6rceZURQm8TBp8MBRwEOZu1as40N8REPetcqNWi9X0niELmQCWJWqbowDIOgWLq16on1ehnCRvBwAErA9MJtjLTscnxM6ARF+uyyfuRwA==
what about defining unsat and sat mutually?
Inductive satisfies {A : Type} : list A -> Formula -> Prop :=
| sat_atomic : forall (f : A -> bool) x xs, f x = true
-> satisfies (xs ++ [x]) (FAtomic f)
| sat_neg : forall xs f, notsatisfies xs f
-> satisfies xs (FNeg f)
with
| sat_atomic : forall (f : A -> bool) x xs, f x = true
-> satisfies (xs ++ [x]) (FAtomic f)
| sat_neg : forall xs f, notsatisfies xs f
-> satisfies xs (FNeg f)
with
notsatisfies {A : Type} : list A -> Formula -> Prop :=
| unsat_atomic : forall (f : A -> bool) x xs, f x = false
-> notsatisfies (xs ++ [x]) (FAtomic f)
| unsat_neg : forall xs f, satisfies xs f
-> notsatisfies xs (FNeg f)
| unsat_atomic : forall (f : A -> bool) x xs, f x = false
-> notsatisfies (xs ++ [x]) (FAtomic f)
| unsat_neg : forall xs f, satisfies xs f
-> notsatisfies xs (FNeg f)
I am not sure what's the right notion of unsat in your case but it looks to me now everything occurs positively.
From: coq-club-request AT inria.fr <coq-club-request AT inria.fr> on behalf of Agnishom Chattopadhyay <agnishom AT cmi.ac.in>
Sent: April 14, 2020 9:27 PM
To: coq-club AT inria.fr <coq-club AT inria.fr>
Subject: Re: [Coq-Club] Is non-strict positivity ever okay?
Sent: April 14, 2020 9:27 PM
To: coq-club AT inria.fr <coq-club AT inria.fr>
Subject: Re: [Coq-Club] Is non-strict positivity ever okay?
I think most of this makes sense. Thanks for explaining.
The only issue is that now with the Fixpoint, we don't have a constructor any more. So this means with this definition, I cannot induct on the proof tree of a satisfaction or apply inversion.
On Tue 14 Apr, 2020, 19:44 Adam Chlipala, <adamc AT csail.mit.edu> wrote:
Put another way, we can certainly imagine an alternative "Inductive" that allows arbitrary recursive uses of the same predicate, so long as a designated argument has decreased in size. However, what we've just described is "Fixpoint"! "Inductive" has no such criteria attached to it. It is not clear how to maintain the great expressive power of "Inductive" while combining its validity checking with a rule based on an argument decreasing in size -- without just saying "Inductive" should fold in the behavior of "Fixpoint" as a special case, which doesn't sound useful, if we are going to have both commands anyway.
For concreteness in your example, I think Dominique is suggesting
Fixpoint satisfies {A : Type} (xs : list A) (f : Formula) : Prop :=
match f with
| FAtomic f => exists xs' x, xs = xs' ++ [x] /\ f x = true
| FNeg f => ~satisfies xs f
end.
On 4/14/20 7:09 PM, Dominique Larchey-Wendling wrote:
No problem in defining a Fixpoint to Prop. Fixpoint does not imply computable.
De: "Agnishom Chattopadhyay" <agnishom AT cmi.ac.in>
À: "coq-club" <coq-club AT inria.fr>
Envoyé: Mercredi 15 Avril 2020 01:05:04
Objet: Re: [Coq-Club] Is non-strict positivity ever okay?
Not really. I am trying to define a relation between my models and my formulae. This is a semantic notion and in some cases may even be uncomputable. So, I do not really want a Formula -> Bool, but rather some kind of Prop
On Tue, Apr 14, 2020 at 5:56 PM Dominique Larchey-Wendling <dominique.larchey-wendling AT loria.fr> wrote:
Usually one uses a Fixpoint instead of an inductive definition for formula satisfaction.
D.
De: "Agnishom Chattopadhyay" <agnishom AT cmi.ac.in>
À: "coq-club" <coq-club AT inria.fr>
Envoyé: Mercredi 15 Avril 2020 00:30:39
Objet: [Coq-Club] Is non-strict positivity ever okay?
Sorry for the click-baity title.
I have a situation where I want to define the semantics of some formulae like textbooks usually do:
Inductive Formula {A: Type} : Type :=
| FAtomic: (A -> bool) -> Formula
| FNeg: Formula -> Formula
.
Inductive satisfies {A : Type} : list A -> Formula -> Prop :=
| sat_atomic : forall (f : A -> bool) x xs, f x = true
-> satisfies (xs ++ [x]) (FAtomic f)
| sat_neg : forall xs f, ((satisfies xs f) -> False)
-> satisfies xs (FNeg f)
.
The last clause in the inductive predicate does not go through since it puts `satisfies` in a negative position.
I'd however think that this is not so bad because: (1) This is a standard way to define the semantics of negation and also (2) the second argument of satisfies is structurally bigger in the result.
Is there any chance I can convince Coq of (2) or some other reason that would make it work?
I have tried interchanging the order of the arguments of satisfies but that did not help.
--Agnishom
- [Coq-Club] Is non-strict positivity ever okay?, Agnishom Chattopadhyay, 04/15/2020
- Re: [Coq-Club] Is non-strict positivity ever okay?, Dominique Larchey-Wendling, 04/15/2020
- Re: [Coq-Club] Is non-strict positivity ever okay?, Agnishom Chattopadhyay, 04/15/2020
- Re: [Coq-Club] Is non-strict positivity ever okay?, Dominique Larchey-Wendling, 04/15/2020
- Re: [Coq-Club] Is non-strict positivity ever okay?, Adam Chlipala, 04/15/2020
- Re: [Coq-Club] Is non-strict positivity ever okay?, Agnishom Chattopadhyay, 04/15/2020
- Re: [Coq-Club] Is non-strict positivity ever okay?, Jason -Zhong Sheng- Hu, 04/15/2020
- Re: [Coq-Club] Is non-strict positivity ever okay?, Jason Gross, 04/15/2020
- Re: [Coq-Club] Is non-strict positivity ever okay?, Dominique Larchey-Wendling, 04/15/2020
- Re: [Coq-Club] Is non-strict positivity ever okay?, Thorsten Altenkirch, 04/15/2020
- Re: [Coq-Club] Is non-strict positivity ever okay?, Agnishom Chattopadhyay, 04/15/2020
- Re: [Coq-Club] Is non-strict positivity ever okay?, Adam Chlipala, 04/15/2020
- Re: [Coq-Club] Is non-strict positivity ever okay?, Thorsten Altenkirch, 04/15/2020
- Re: [Coq-Club] Is non-strict positivity ever okay?, Dominique Larchey-Wendling, 04/15/2020
- Re: [Coq-Club] Is non-strict positivity ever okay?, Agnishom Chattopadhyay, 04/15/2020
- Re: [Coq-Club] Is non-strict positivity ever okay?, Dominique Larchey-Wendling, 04/15/2020
Archive powered by MHonArc 2.6.18.