Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Pattern matching on hypotheses of certain types

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Pattern matching on hypotheses of certain types


Chronological Thread 
  • From: Thomas Braibant <thomas.braibant AT gmail.com>
  • To: Jason Gross <jasongross9 AT gmail.com>
  • Cc: coq-club <coq-club AT inria.fr>
  • Subject: Re: [Coq-Club] Pattern matching on hypotheses of certain types
  • Date: Thu, 9 Aug 2012 13:43:02 -0400

I think the following does what you want:

Goal forall (n m : nat) (n' m' : unit) (f : nat -> nat -> Type) (f' :
unit -> unit -> Type) (P : nat -> Prop) (fn : P n -> f n m -> f' n'
m'), False.
intros.
match goal with
| [ H : unit -> unit -> _, H1 : appcontext[?H' ?a ?b] |- _ ] =>
constr_eq H H'; pose H
end.

Cheers
Thomas


On Thu, Aug 9, 2012 at 3:48 AM, Jason Gross
<jasongross9 AT gmail.com>
wrote:
> Goal forall (n m : nat) (n' m' : unit) (f : nat -> nat -> Type) (f' : unit
> -> unit -> Type) (P : nat -> Prop) (fn : P n -> f n m -> f' n' m'), False.
> intros.
> match goal with
> | [ H : unit -> unit -> _, H1 : appcontext[?H ?a ?b] |- _ ] => pose
> H
> end.



Archive powered by MHonArc 2.6.18.

Top of Page