Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Review changes
Browse files Browse the repository at this point in the history
Halbaroth committed Oct 12, 2023

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent e769b7b commit 01feffc
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions src/lib/reasoners/enum_rel.ml
Original file line number Diff line number Diff line change
@@ -136,7 +136,14 @@ let values_of r =
None

(* Update the domains of the semantic values [sm1] and [sm2] according to
the disequality [sm1 <> sm2]. *)
the disequality [sm1 <> sm2]. More precisely, if one of these semantic
values is a constructor, we remove it from the domain of the other one.
In any case, we produce an equality if the domain of one of these semantic
values becomes a singleton.
@raise Ex.Inconsistent if the disequality is inconsistent with the
current environment [env]. *)
let add_diseq hss sm1 sm2 dep env eqs =
match sm1, sm2 with
| Alien r , Cons(h,ty)
@@ -181,7 +188,13 @@ let add_diseq hss sm1 sm2 dep env eqs =
| _ -> env, eqs

(* Update the domains of the semantic values [sm1] and [sm2] according to
the equation [sm1 = sm2]. *)
the equation [sm1 = sm2]. More precisely, we replace their domains by
the intersection of these domains.
In any case, we produce an equality if the domain of these semantic values
becomes a singleton.
@raise Ex.Inconsistent if the domains of [sm1] and [sm2] are disjoint. *)
let add_eq hss sm1 sm2 dep env eqs =
match sm1, sm2 with
| Alien r, Cons(h,_)
@@ -222,7 +235,8 @@ let count_splits env la =
in
{env with size_splits = nb}

(* Add the uninterpreted semantic value [r] to the environment. *)
(* Add the uninterpreted semantic value [r] to the environment [env] with the
total domain. *)
let add_aux env r =
Debug.add r;
match Sh.embed r, values_of r with
@@ -285,9 +299,9 @@ let case_split env uf ~for_model =
value. *)
acc
| _ ->
(* We have to do a case-split, even if the domain of [r] is
of cardinal 1 as we have to put this value in the
equivalence class of [r]. *)
(* We have to perform a case-split, even if the domain of [r] is
of cardinal 1 as we have to let the union-find know this
equality. *)
let sz = HSS.cardinal hss in
match acc with
| Some (n,_,_) when n <= sz -> acc

0 comments on commit 01feffc

Please sign in to comment.