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] How to handle "invisible" evars created by eapply?
- Date: Fri, 13 Feb 2015 10:49:12 -0500
On 02/13/2015 09:44 AM, Soegtrop,
Michael wrote:
Dear Coq users, trying to write my own "Chlipala style" crush tactic, I came across the effect that eapply creates evars which don't have an existential hypothesis: Require Import Bool. Require Import Vector. Class BooleanEqualityT (T : Type) : Type := { eqb : T -> T -> bool ; eqb_axiom : forall x y, reflect (x = y) (eqb x y) }. Instance BooleanEquality_vector {T : Type} {Beq : BooleanEqualityT T} (n : nat) : BooleanEqualityT (Vector.t T n). eapply Build_BooleanEqualityT. Results in: 1 subgoal T : Type Beq : BooleanEqualityT T n : nat ______________________________________(1/1) forall x y : t T n, reflect (x = y) (?eqb x y) The strange thing is that the evar ?eqb doesn't appear as existential in the hypothesis. This makes it difficult to detect the evar in automation and to set it. I am unclear as to what kind of appearance you were expecting. For example, if you at this point do [set (eqb:=?eqb)], that will generate a local definition that will show up in the hypotheses: 1 subgoal So the question is: how can I detect in automation that I have such an evar and get its type? If you want a tactic that can detect occurrences of free evars in the conclusion and generate such local definition hypotheses from them, that is fairly easy to do: Ltac gen_evar_local_defs := repeat match goal with |- context[?V] => is_evar V; set V end. It is possible to do something like this for evars under binders as well. Or, is there something else you want to occur? -- Jonathan |
- [Coq-Club] How to handle "invisible" evars created by eapply?, Soegtrop, Michael, 02/13/2015
- Re: [Coq-Club] How to handle "invisible" evars created by eapply?, Jonathan Leivent, 02/13/2015
- RE: [Coq-Club] How to handle "invisible" evars created by eapply?, Soegtrop, Michael, 02/13/2015
- Re: [Coq-Club] How to handle "invisible" evars created by eapply?, Jonathan Leivent, 02/13/2015
- Re: [Coq-Club] How to handle "invisible" evars created by eapply?, Jonathan Leivent, 02/13/2015
- Re: [Coq-Club] How to handle "invisible" evars created by eapply?, Matthieu Sozeau, 02/14/2015
- RE: [Coq-Club] How to handle "invisible" evars created by eapply?, Soegtrop, Michael, 02/18/2015
- RE: [Coq-Club] How to handle "invisible" evars created by eapply?, Soegtrop, Michael, 02/13/2015
- Re: [Coq-Club] How to handle "invisible" evars created by eapply?, Jonathan Leivent, 02/13/2015
Archive powered by MHonArc 2.6.18.