coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Jonathan Leivent <jonikelee AT gmail.com>
- To: coq-club AT inria.fr
- Subject: Re: [Coq-Club] Axioms reported by coqchk
- Date: Fri, 19 Aug 2016 20:06:21 -0400
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jonikelee AT gmail.com; spf=Pass smtp.mailfrom=jonikelee AT gmail.com; spf=None smtp.helo=postmaster AT mail-qk0-f179.google.com
- Ironport-phdr: 9a23:YGr+wBemODD3hX8s63aXPKzBlGMj4u6mDksu8pMizoh2WeGdxc6/Yx7h7PlgxGXEQZ/co6odzbGH6ua6Bidbut7B6ClEK80UEUddyI0/pE8JOIa9E0r1LfrnPWQRPf9pcxtbxUy9KlVfA83kZlff8TWY5D8WHQjjZ0IufrymUrDbg8n/7e2u4ZqbO1wO32vkJ+ktZ07t5UWJ749N0NMkcv5wgjLy4VJwM9xMwm1pIV/B1z3d3eyXuKBZziJLpvg6/NRBW6ipN44xTLhfESh0ezttvJ6j5lH/Sl6E4WJZWWELmDJJBRLE5Vf0RMTfqCz/48h63iCGPcTwBZQ5WCqv6bsjHB3vjiYEOjo0/UnYj8VxiORQpxf39E83+JLdfIzAbKk2RajaZ95PHWc=
On 08/19/2016 07:18 PM, Jason Gross wrote:
It's quite easy, I believe, to write a tactic that uses an axiom only if
it's been imported, as long as you control both the file the tactic is
written in and the file the axiom is declared in:
$ cat PreAxiomA.v
Ltac get_admitted := constr:(Set).
$ cat AxiomA.v
Require Import PreAxiomA.
Axiom admitted : False.
Ltac get_admitted ::= constr:(admitted).
$ cat Tactic.v
Require Import PreAxiomA.
Ltac stuff :=
let maybe_axiom := get_admitted in
lazymatch type of maybe_axiom with
| False => idtac "axiom exists"
| _ => idtac "no axiom"
end.
(Code not tested, so no promises)
Yes - but as you say, provided one has control over the content of the file that the axiom is declared in. But, if one has control over the content of the files containing axioms, I would think that making them instances of typeclasses would be a better approach than relying on redefined tactics:
(*module1*)
Class Admitted := admitted : False.
Ltac Admit := elim admitted.
(*module2*)
Axiom admitted_axiom : False.
Instance Admitted_instance : Admitted := admitted_axiom.
This has the added benefit of allowing the user to provide an alternative and possibly conditional instance to axioms. That might not be useful for Admitted, but consider proof_irrelevance, and alternative instances that can provide non-axiomatic proofs of the irrelevance of particular Props, such as UIP_dec. That way, the user can use some tactic or plugin that normally uses proof_irrelevance (perhaps Program), and in cases where UIP_dec (which would then search for the appropriate eqdep instance) suffices, that would get used instead.
Although, to be fair, if we were really to consider all parts of Coq that would benefit from a redesign to involve typeclasses, this usage might not be at the top of the list.
-- Jonathan
- Re: [Coq-Club] coqchk safe from plugins? (Was: Axioms reported by coqchk), (continued)
- Re: [Coq-Club] coqchk safe from plugins? (Was: Axioms reported by coqchk), Robbert Krebbers, 08/19/2016
- Re: [Coq-Club] coqchk safe from plugins? (Was: Axioms reported by coqchk), Jonathan Leivent, 08/19/2016
- Re: [Coq-Club] coqchk safe from plugins? (Was: Axioms reported by coqchk), Guillaume Melquiond, 08/19/2016
- Re: [Coq-Club] Axioms reported by coqchk, Jacques-Henri Jourdan, 08/19/2016
- Re: [Coq-Club] Axioms reported by coqchk, Ralf Jung, 08/19/2016
- Re: [Coq-Club] Axioms reported by coqchk, Ade Umut Huxtable, 08/19/2016
- Re: [Coq-Club] Axioms reported by coqchk, Jonathan Leivent, 08/19/2016
- Re: [Coq-Club] Axioms reported by coqchk, Ade Umut Huxtable, 08/19/2016
- Re: [Coq-Club] Axioms reported by coqchk, Jonathan Leivent, 08/19/2016
- Re: [Coq-Club] Axioms reported by coqchk, Jason Gross, 08/20/2016
- Re: [Coq-Club] Axioms reported by coqchk, Jonathan Leivent, 08/20/2016
- Re: [Coq-Club] Axioms reported by coqchk, Jonathan Leivent, 08/20/2016
- Re: [Coq-Club] Axioms reported by coqchk, Jonathan Leivent, 08/20/2016
- Re: [Coq-Club] Axioms reported by coqchk, Jonathan Leivent, 08/20/2016
- RE: [Coq-Club] Axioms reported by coqchk, Soegtrop, Michael, 08/21/2016
- Re: [Coq-Club] Axioms reported by coqchk, Jonathan Leivent, 08/21/2016
- RE: [Coq-Club] Axioms reported by coqchk, Soegtrop, Michael, 08/22/2016
- Re: [Coq-Club] Axioms reported by coqchk, Ralf Jung, 08/22/2016
- Re: [Coq-Club] Axioms reported by coqchk, Jonathan Leivent, 08/20/2016
- Re: [Coq-Club] Axioms reported by coqchk, Jonathan Leivent, 08/20/2016
- Re: [Coq-Club] Axioms reported by coqchk, Jason Gross, 08/20/2016
- Re: [Coq-Club] Axioms reported by coqchk, Jonathan Leivent, 08/19/2016
- Re: [Coq-Club] coqchk safe from plugins? (Was: Axioms reported by coqchk), Robbert Krebbers, 08/19/2016
- Re: [Coq-Club] Axioms reported by coqchk, Ralf Jung, 08/20/2016
- Re: [Coq-Club] Axioms reported by coqchk, Pierre Courtieu, 08/22/2016
Archive powered by MHonArc 2.6.18.