aboutsummaryrefslogtreecommitdiff
path: root/plugins/firstorder/unify.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2019-03-14 19:00:34 +0100
committerPierre-Marie Pédrot2020-05-10 15:03:19 +0200
commit2a79abc613bdf19b53685a40c993f964455904fe (patch)
treec0fd8ab20f683c3141934d060852dcda0d569f00 /plugins/firstorder/unify.ml
parentaab47903fb2d3e0085b03d5ade94f4ae644cd76c (diff)
No more local reduction functions in Reductionops.
This is extracted from #9710, where we need the environment anyway to compute iota rules on inductive types with let-bindings. The commit is self-contained, so I think it could go directly in to save me a few rebases. Furthermore, this is also related to #11707. Assuming we split cbn from the other reduction machine, this allows to merge the "local" machine with the general one, since after this PR they will have the same type. One less reduction machine should make people happy.
Diffstat (limited to 'plugins/firstorder/unify.ml')
-rw-r--r--plugins/firstorder/unify.ml14
1 files changed, 7 insertions, 7 deletions
diff --git a/plugins/firstorder/unify.ml b/plugins/firstorder/unify.ml
index e58e80116d..9c3debe48f 100644
--- a/plugins/firstorder/unify.ml
+++ b/plugins/firstorder/unify.ml
@@ -29,7 +29,7 @@ let subst_meta subst t =
let subst = List.map (fun (m, c) -> (m, EConstr.Unsafe.to_constr c)) subst in
EConstr.of_constr (subst_meta subst (EConstr.Unsafe.to_constr t))
-let unif evd t1 t2=
+let unif env evd t1 t2=
let bige=Queue.create ()
and sigma=ref [] in
let bind i t=
@@ -46,8 +46,8 @@ let unif evd t1 t2=
Queue.add (t1,t2) bige;
try while true do
let t1,t2=Queue.take bige in
- let nt1=head_reduce (whd_betaiotazeta evd t1)
- and nt2=head_reduce (whd_betaiotazeta evd t2) in
+ let nt1=head_reduce (whd_betaiotazeta env evd t1)
+ and nt2=head_reduce (whd_betaiotazeta env evd t2) in
match (EConstr.kind evd nt1),(EConstr.kind evd nt2) with
Meta i,Meta j->
if not (Int.equal i j) then
@@ -123,9 +123,9 @@ let mk_rel_inst evd t=
in
let nt=renum_rec 0 t in (!new_rel - 1,nt)
-let unif_atoms evd i dom t1 t2=
+let unif_atoms env evd i dom t1 t2=
try
- let t=Int.List.assoc i (unif evd t1 t2) in
+ let t=Int.List.assoc i (unif env evd t1 t2) in
if isMeta evd t then Some (Phantom dom)
else Some (Real(mk_rel_inst evd t,value evd i t1))
with
@@ -136,11 +136,11 @@ let renum_metas_from k n t= (* requires n = max (free_rels t) *)
let l=List.init n (fun i->mkMeta (k+i)) in
substl l t
-let more_general evd (m1,t1) (m2,t2)=
+let more_general env evd (m1,t1) (m2,t2)=
let mt1=renum_metas_from 0 m1 t1
and mt2=renum_metas_from m1 m2 t2 in
try
- let sigma=unif evd mt1 mt2 in
+ let sigma=unif env evd mt1 mt2 in
let p (n,t)= n<m1 || isMeta evd t in
List.for_all p sigma
with UFAIL(_,_)->false