aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2020-09-03 17:40:28 +0200
committerPierre-Marie Pédrot2020-09-04 22:48:15 +0200
commit31a9ad12f02c50c04dc9d125863a550f70f84dbb (patch)
tree6b8846cc293310e87837569f45e01126f22be039
parentc50d7aa6537b46aa0b791cdb28f9dbe66327e6ef (diff)
Remove the last use of clenv_fchain in Equality.
Once again, we now statically the type of the argument is the same, so there is no need to call the old unification.
-rw-r--r--tactics/equality.ml17
1 files changed, 5 insertions, 12 deletions
diff --git a/tactics/equality.ml b/tactics/equality.ml
index 88622d153c..26ae35a79d 100644
--- a/tactics/equality.ml
+++ b/tactics/equality.ml
@@ -1394,19 +1394,12 @@ let inject_at_positions env sigma l2r eq posns tac =
let sigma, (injbody,resty) = build_injector e_env !evdref t1' (mkVar e) cpath in
let injfun = mkNamedLambda (make_annot e Sorts.Relevant) t injbody in
let sigma,congr = Evd.fresh_global env sigma eq.congr in
- let pf = applist(congr,[t;resty;injfun;t1;t2]) in
+ (* pf : eq t t1 t2 -> eq resty (injfun t1) (injfun t2) *)
+ let pf = mkApp (congr,[|t; resty; injfun; t1; t2|]) in
let sigma, pf_typ = Typing.type_of env sigma pf in
- let inj_clause =
- let sigma = eq_clause.evd in
- let f_clause = mk_clenv_from_env eq_clause.env sigma None (pf, pf_typ) in
- let argmv =
- (match EConstr.kind sigma (last_arg f_clause.evd f_clause.templval.Evd.rebus) with
- | Meta mv -> mv
- | _ -> user_err (str "Ill-formed clause applicator.")) in
- clenv_fchain ~with_univs:false argmv f_clause eq_clause
- in
- let pf = Clenv.clenv_value_cast_meta inj_clause in
- let ty = simplify_args env sigma (clenv_type inj_clause) in
+ let pf_typ = Vars.subst1 mkProp (pi3 @@ destProd sigma pf_typ) in
+ let pf = mkApp (pf, [| Clenv.clenv_value eq_clause |]) in
+ let ty = simplify_args env sigma pf_typ in
evdref := sigma;
Some (pf, ty)
with Failure _ -> None