Skip to content

Commit

Permalink
Normalize ADT in assume
Browse files Browse the repository at this point in the history
Fix issue #1096
  • Loading branch information
Halbaroth committed Apr 29, 2024
1 parent 05e98a4 commit a0815f9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/lib/reasoners/adt_rel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ let assume_literals la uf env =
match lit with
| Eq (r1, r2) as l, _, ex, Th_util.Subst when is_adt r1 ->
Debug.assume l;
let r1, _ = Uf.find_r uf r1 in
let r2, _ = Uf.find_r uf r2 in
(* Needed for models generation because fresh terms are not added with
the function add. *)
let env = add_rec r1 uf env in
Expand All @@ -439,6 +441,8 @@ let assume_literals la uf env =

| Distinct (false, [r1; r2]) as l, _, ex, _ when is_adt r2 ->
Debug.assume l;
let r1, _ = Uf.find_r uf r1 in
let r2, _ = Uf.find_r uf r2 in
(* Needed for models generation because fresh terms are not added with
the function add. *)
let env = add_rec r1 uf env in
Expand All @@ -447,10 +451,12 @@ let assume_literals la uf env =

| Builtin (true, Sy.IsConstr c, [r]) as l, _, ex, _ ->
Debug.assume l;
let r, _ = Uf.find_r uf r in
assume_is_constr ~ex r c env

| Builtin (false, Sy.IsConstr c, [r]) as l, _, ex, _ ->
Debug.assume l;
let r, _ = Uf.find_r uf r in
assume_not_is_constr ~ex r c env

| _ ->
Expand Down

0 comments on commit a0815f9

Please sign in to comment.