fact: Fixpoint match_goal_pattern'@{b+} {B:Type@{b}} (u : Unification) (p : goal_pattern B) : mlist Hyp -> mlist Hyp -> gtactic B := fix go l1 l2 g := match p, l2 with | gbase P t, _ => gT <- M.goal_type g; mif M.cumul u P gT then t g else M.raise DoesNotMatchGoal | gbase_context x t, _ => match g with | Metavar Propₛ gT _ => (fun (A : Prop) => match_goal_context Propₛ x A t g) gT | Metavar Typeₛ gT _ => (fun (A : Type) => match_goal_context Typeₛ x A t g) gT end | @gtele _ C f, @ahyp A a d :m: l2' => oeqCA <- M.unify C A u; match oeqCA with | mSome eqCA => let a' := rcbv match meq_sym eqCA with meq_refl => a end in mtry match_goal_pattern' u (f a') [m:] (mrev_append l1 l2') g with DoesNotMatchGoal => go (ahyp a d :m: l1) l2' g end | mNone => go (ahyp a d :m: l1) l2' g end | @gtele_evar _ C f, _ => e <- M.evar C; match_goal_pattern' u (f e) l1 l2 g | _, _ => M.raise DoesNotMatchGoal end.
imports: Strings.String ssrmatching.ssrmatching Mtac2(Logic Datatypes List Utils Logic intf.Sorts) Strings.String NArith.BinNat NArith.BinNatDef