Skip to content

Commit 5ab8d7a

Browse files
committed
Delay case splits
1 parent b4bf2ec commit 5ab8d7a

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/lib/reasoners/satml.ml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,9 @@ module Make (Th : Theory.S) : SAT_ML with type th = Th.t = struct
181181
(* si vrai, les contraintes sont deja fausses *)
182182
mutable is_unsat : bool;
183183

184+
mutable is_searching : bool;
185+
mutable delayed_cs : bool;
186+
184187
mutable unsat_core : Atom.clause list option;
185188

186189
(* clauses du probleme *)
@@ -448,6 +451,8 @@ module Make (Th : Theory.S) : SAT_ML with type th = Th.t = struct
448451
hcons_env;
449452

450453
is_unsat = false;
454+
is_searching = false;
455+
delayed_cs = false;
451456

452457
unsat_core = None;
453458

@@ -1159,7 +1164,11 @@ module Make (Th : Theory.S) : SAT_ML with type th = Th.t = struct
11591164
Printer.print_dbg "[satml] Theory_propagate of %d atoms@." !nb_f;
11601165
Queue.clear env.tatoms_queue;
11611166
Queue.clear env.th_tableaux;
1162-
if !facts == [] then C_none
1167+
if !facts == [] then
1168+
if env.delayed_cs then (
1169+
env.delayed_cs <- false;
1170+
do_case_split env Util.AfterTheoryAssume
1171+
) else C_none
11631172
else
11641173
try
11651174
(*let full_model = nb_assigns() = nb_vars () in*)
@@ -1170,7 +1179,8 @@ module Make (Th : Theory.S) : SAT_ML with type th = Th.t = struct
11701179
in
11711180
Steps.incr (Steps.Th_assumed cpt);
11721181
env.tenv <- t;
1173-
do_case_split env Util.AfterTheoryAssume
1182+
if not env.is_searching then (env.delayed_cs <- true; C_none)
1183+
else do_case_split env Util.AfterTheoryAssume
11741184
(*if full_model then expensive_theory_propagate ()
11751185
else None*)
11761186
with Ex.Inconsistent (dep, _terms) ->
@@ -1905,6 +1915,7 @@ module Make (Th : Theory.S) : SAT_ML with type th = Th.t = struct
19051915
let n_of_learnts =
19061916
ref ((Atom.to_float (nb_clauses env)) *. env.learntsize_factor) in
19071917
try
1918+
env.is_searching <- true;
19081919
while true do
19091920
(try search env (ref Auto)
19101921
(Atom.to_int !n_of_conflicts) (Atom.to_int !n_of_learnts);
@@ -1915,6 +1926,7 @@ module Make (Th : Theory.S) : SAT_ML with type th = Th.t = struct
19151926
with
19161927
| Sat ->
19171928
(*check_model ();*)
1929+
env.is_searching <- false;
19181930
remove_satisfied env env.clauses;
19191931
remove_satisfied env env.learnts;
19201932
raise Sat

0 commit comments

Comments
 (0)