mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-07 19:55:41 -05:00
refactor: remove dead code, some basic simplifications
This commit is contained in:
parent
fdc042aee3
commit
0a3a3b576a
1 changed files with 4 additions and 16 deletions
|
|
@ -1248,10 +1248,11 @@ module Make(Plugin : PLUGIN)
|
||||||
else match Plugin.eval st.th a.lit with
|
else match Plugin.eval st.th a.lit with
|
||||||
| Solver_intf.Unknown -> None
|
| Solver_intf.Unknown -> None
|
||||||
| Solver_intf.Valued (b, l) ->
|
| Solver_intf.Valued (b, l) ->
|
||||||
if l = [] then
|
if l = [] then (
|
||||||
raise (Invalid_argument (
|
raise (Invalid_argument (
|
||||||
Format.asprintf "msat:core/internal.ml: %s"
|
Format.asprintf "msat:core/internal.ml: %s"
|
||||||
"semantic propagation at level 0 are currently forbidden"));
|
"semantic propagation at level 0 are currently forbidden"));
|
||||||
|
);
|
||||||
let atom = if b then a else a.neg in
|
let atom = if b then a else a.neg in
|
||||||
enqueue_semantic st atom l;
|
enqueue_semantic st atom l;
|
||||||
Some b
|
Some b
|
||||||
|
|
@ -1962,11 +1963,7 @@ module Make(Plugin : PLUGIN)
|
||||||
|
|
||||||
(* Check satisfiability *)
|
(* Check satisfiability *)
|
||||||
let check_clause c =
|
let check_clause c =
|
||||||
let tmp = Array.map (fun a ->
|
let res = Array.exists (fun a -> a.is_true) c.atoms in
|
||||||
if a.is_true then true
|
|
||||||
else if a.neg.is_true then false
|
|
||||||
else raise UndecidedLit) c.atoms in
|
|
||||||
let res = Array.exists (fun x -> x) tmp in
|
|
||||||
if not res then (
|
if not res then (
|
||||||
Log.debugf debug
|
Log.debugf debug
|
||||||
(fun k -> k "Clause not satisfied: @[<hov>%a@]" Clause.debug c);
|
(fun k -> k "Clause not satisfied: @[<hov>%a@]" Clause.debug c);
|
||||||
|
|
@ -1974,16 +1971,7 @@ module Make(Plugin : PLUGIN)
|
||||||
) else
|
) else
|
||||||
true
|
true
|
||||||
|
|
||||||
let check_vec v =
|
let check_vec v = Vec.for_all check_clause v
|
||||||
Vec.for_all check_clause v
|
|
||||||
|
|
||||||
let check_stack s =
|
|
||||||
try
|
|
||||||
Stack.iter (fun c -> if not (check_clause c) then raise Exit) s;
|
|
||||||
true
|
|
||||||
with Exit ->
|
|
||||||
false
|
|
||||||
|
|
||||||
let check st : bool =
|
let check st : bool =
|
||||||
Vec.is_empty st.clauses_to_add &&
|
Vec.is_empty st.clauses_to_add &&
|
||||||
check_vec st.clauses_hyps &&
|
check_vec st.clauses_hyps &&
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue