Skip to content

Commit

Permalink
Magic fix for disequality simplify exception.
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Lozov authored and Dmitrii.Kosarev a.k.a. Kakadu committed Dec 17, 2024
1 parent 9def363 commit 9e7f582
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core/Subst.ml
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,12 @@ let unify ?(subsume=false) ?(scope=Term.Var.non_local_scope) env subst x y =
~fvar:(fun ((_, subst) as acc) x y ->
match walk env subst x, walk env subst y with
| Var x, Var y ->
if Var.equal x y then acc else extend x (Term.repr y) acc
| Var x, Value y -> extend x y acc
(* if Var.equal x y then acc else extend x (Term.repr y) acc *)
let cmp = Term.Var.compare x y in
if cmp < 0 then extend x (Term.repr y) acc
else if cmp > 0 then extend y (Term.repr x) acc
else acc
| Var x, Value y -> extend x y acc
| Value x, Var y -> extend y x acc
| Value x, Value y -> helper x y acc
)
Expand Down

0 comments on commit 9e7f582

Please sign in to comment.