diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2016-11-12 01:52:15 +0100 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2017-02-14 17:28:48 +0100 |
commit | 771be16883c8c47828f278ce49545716918764c4 (patch) | |
tree | f3c0427596d447677c54c23455fcfbe7e3337b49 /plugins | |
parent | 45562afa065aadc207dca4e904e309d835cb66ef (diff) |
Hipattern API using EConstr.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/firstorder/formula.ml | 17 | ||||
-rw-r--r-- | plugins/funind/invfun.ml | 4 |
2 files changed, 11 insertions, 10 deletions
diff --git a/plugins/firstorder/formula.ml b/plugins/firstorder/formula.ml index 60e9196af..96b991e1f 100644 --- a/plugins/firstorder/formula.ml +++ b/plugins/firstorder/formula.ml @@ -79,15 +79,16 @@ type kind_of_formula= let kind_of_formula gl term = let normalize=special_nf gl in let cciterm=special_whd gl term in - match match_with_imp_term (project gl) cciterm with - Some (a,b)-> Arrow(a,(pop (EConstr.of_constr b))) + match match_with_imp_term (project gl) (EConstr.of_constr cciterm) with + Some (a,b)-> Arrow(EConstr.Unsafe.to_constr a,(pop b)) |_-> - match match_with_forall_term (project gl) cciterm with - Some (_,a,b)-> Forall(a,b) + match match_with_forall_term (project gl) (EConstr.of_constr cciterm) with + Some (_,a,b)-> Forall(EConstr.Unsafe.to_constr a,EConstr.Unsafe.to_constr b) |_-> - match match_with_nodep_ind (project gl) cciterm with + match match_with_nodep_ind (project gl) (EConstr.of_constr cciterm) with Some (i,l,n)-> - let ind,u=destInd i in + let l = List.map EConstr.Unsafe.to_constr l in + let ind,u=EConstr.destInd (project gl) i in let (mib,mip) = Global.lookup_inductive ind in let nconstr=Array.length mip.mind_consnames in if Int.equal nconstr 0 then @@ -108,8 +109,8 @@ let kind_of_formula gl term = else Or((ind,u),l,is_trivial) | _ -> - match match_with_sigma_type (project gl) cciterm with - Some (i,l)-> Exists((destInd i),l) + match match_with_sigma_type (project gl) (EConstr.of_constr cciterm) with + Some (i,l)-> Exists((EConstr.destInd (project gl) i),List.map EConstr.Unsafe.to_constr l) |_-> Atom (normalize cciterm) type atoms = {positive:constr list;negative:constr list} diff --git a/plugins/funind/invfun.ml b/plugins/funind/invfun.ml index 635925562..b2419b1a5 100644 --- a/plugins/funind/invfun.ml +++ b/plugins/funind/invfun.ml @@ -598,9 +598,9 @@ let rec reflexivity_with_destruct_cases g = | Some id -> match kind_of_term (pf_unsafe_type_of g (EConstr.mkVar id)) with | App(eq,[|_;t1;t2|]) when eq_constr eq eq_ind -> - if Equality.discriminable (pf_env g) (project g) t1 t2 + if Equality.discriminable (pf_env g) (project g) (EConstr.of_constr t1) (EConstr.of_constr t2) then Proofview.V82.of_tactic (Equality.discrHyp id) g - else if Equality.injectable (pf_env g) (project g) t1 t2 + else if Equality.injectable (pf_env g) (project g) (EConstr.of_constr t1) (EConstr.of_constr t2) then tclTHENSEQ [Proofview.V82.of_tactic (Equality.injHyp None id);thin [id];intros_with_rewrite] g else tclIDTAC g | _ -> tclIDTAC g |