Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Ltac unify expressions

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Ltac unify expressions


chronological Thread 
  • From: Adam Chlipala <adamc AT csail.mit.edu>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Ltac unify expressions
  • Date: Fri, 17 Feb 2012 17:26:16 -0500

On 02/17/2012 04:44 PM, Gregory Malecha wrote:
I am wondering if there is a better way to perform semantic equivalence checking in Ltac. Currently, I'm doing the following:

Ltac unifies a b :=
  match a with
    | b => true
    | _ =>
      let a := eval cbv in a in
      let b := eval cbv in b in
      match a with
        | b => true
        | _ => false
      end
  end.

Here's one of those Gallina/Ltac puns that is both horrifying and super-fun IMO:
    (let H := fresh in assert (H : a = b) by reflexivity; clear H; (* call a continuation with [true]) || (* call continuation with [false] *)
This may have side effects if there are unification variables left undetermined beforehand.



Archive powered by MhonArc 2.6.16.

Top of Page