mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 11:15:43 -05:00
refactor(sat): improve style of theory propagation handler
This commit is contained in:
parent
324c9d2e36
commit
c1a662e2c8
1 changed files with 15 additions and 14 deletions
|
|
@ -1292,21 +1292,22 @@ module Make (Th : Theory_intf.S) = struct
|
||||||
|
|
||||||
let act_propagate (st:t) f causes proof : unit =
|
let act_propagate (st:t) f causes proof : unit =
|
||||||
let l = List.rev_map (Atom.make st) causes in
|
let l = List.rev_map (Atom.make st) causes in
|
||||||
if List.for_all Atom.is_true l then (
|
assert (
|
||||||
let p = Atom.make st f in
|
if not @@ List.for_all Atom.is_true l then (
|
||||||
let c = Clause.make_l (p :: List.map Atom.neg l) (Lemma proof) in
|
Error.errorf "(@[sat.act_propagate.invalid_guard@ :guard %a@ \
|
||||||
if p.is_true then (
|
:1 all lits are not true@])"
|
||||||
) else if p.neg.is_true then (
|
(Util.pp_list Atom.debug) l
|
||||||
(* propagate other lits in the clause *)
|
); true);
|
||||||
add_clause ~permanent:false st c;
|
let p = Atom.make st f in
|
||||||
) else (
|
if p.is_true then (
|
||||||
insert_var_order st p.var;
|
) else if p.neg.is_true then (
|
||||||
enqueue_bool st p (Bcp c);
|
(* we got ourself a wee conflict clause *)
|
||||||
)
|
let c = Clause.make_l (p :: List.rev_map Atom.neg l) (Lemma proof) in
|
||||||
|
raise (Conflict c)
|
||||||
) else (
|
) else (
|
||||||
Error.errorf "(@[sat.act_propagate.invalid_guard@ :guard %a@ \
|
let c = Clause.make_l (p :: List.rev_map Atom.neg l) (Lemma proof) in
|
||||||
:1 all lits are not true@])"
|
insert_var_order st p.var;
|
||||||
(Util.pp_list Atom.debug) l
|
enqueue_bool st p (Bcp c);
|
||||||
)
|
)
|
||||||
|
|
||||||
let current_slice st head : formula Theory_intf.slice_actions =
|
let current_slice st head : formula Theory_intf.slice_actions =
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue