diff options
| author | Matthieu Sozeau | 2016-07-29 19:41:46 +0200 |
|---|---|---|
| committer | Matthieu Sozeau | 2016-07-29 19:41:46 +0200 |
| commit | dabe6d0e1d1782d3e9647e04aa1bf161765ad882 (patch) | |
| tree | e0ac77d200c301b08e2f0532993de6d6e3ab1862 /ltac | |
| parent | 81c19bdd631fa72afa0cac5c8b915d836e0646df (diff) | |
| parent | 639eecd27e42c7dd646afdcb67b5a4e51a4541c1 (diff) | |
Merge remote-tracking branch 'gforge/v8.5' into v8.6
Diffstat (limited to 'ltac')
| -rw-r--r-- | ltac/rewrite.ml | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/ltac/rewrite.ml b/ltac/rewrite.ml index e327deda02..df96cfcf6c 100644 --- a/ltac/rewrite.ml +++ b/ltac/rewrite.ml @@ -438,14 +438,22 @@ let split_head = function hd :: tl -> hd, tl | [] -> assert(false) +let eq_pb (ty, env, x, y as pb) (ty', env', x', y' as pb') = + pb == pb' || (ty == ty' && Constr.equal x x' && Constr.equal y y') + +let problem_inclusion x y = + List.for_all (fun pb -> List.exists (fun pb' -> eq_pb pb pb') y) x + let evd_convertible env evd x y = try - let evd = Evarconv.the_conv_x env x y evd in (* Unfortunately, the_conv_x might say they are unifiable even if some - unsolvable constraints remain, so we check them here *) - let evd = Evarconv.consider_remaining_unif_problems env evd in - let () = Evarconv.check_problems_are_solved env evd in - Some evd + unsolvable constraints remain, so we check that this unification + does not introduce any new problem. *) + let _, pbs = Evd.extract_all_conv_pbs evd in + let evd' = Evarconv.the_conv_x env x y evd in + let _, pbs' = Evd.extract_all_conv_pbs evd' in + if evd' == evd || problem_inclusion pbs' pbs then Some evd' + else None with e when CErrors.noncritical e -> None let convertible env evd x y = |
