Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Axioms reported by coqchk

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Axioms reported by coqchk


Chronological Thread 
  • 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




Archive powered by MHonArc 2.6.18.

Top of Page