fix(smt): improve theory combination a bit

This commit is contained in:
Simon Cruanes 2022-02-04 16:40:55 -05:00
parent ab74b1a792
commit d11b9d585c
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4
2 changed files with 15 additions and 13 deletions

View file

@ -363,7 +363,6 @@ module Make(A : ARG) : S with module A = A = struct
end
| LRA_op _ | LRA_mult _ ->
let steps = ref [] in
let le = as_linexp t in
(* [t] is [le_comb + le_const], where [le_comb] is a linear expression

View file

@ -304,6 +304,7 @@ module Make(A : ARG)
let[@inline] ty_st t = t.ty_st
let[@inline] proof self = self.proof
let stats t = t.stat
let[@inline] has_delayed_actions self = not (Queue.is_empty self.delayed_actions)
let registry self = self.registry
let simplifier self = self.simp
@ -543,8 +544,6 @@ module Make(A : ARG)
CC.pop_levels (cc self) n;
pop_lvls_ n self.th_states
exception E_loop_exit
(* handle a literal assumed by the SAT solver *)
let assert_lits_ ~final (self:t) (acts:theory_actions) (lits:Lit.t Iter.t) : unit =
Log.debugf 2
@ -558,19 +557,23 @@ module Make(A : ARG)
(* transmit to theories. *)
CC.check cc acts;
if final then (
try
while true do
let continue = ref true in
while !continue do
let fcheck = ref true in
while !fcheck do
(* TODO: theory combination *)
List.iter (fun f -> f self acts lits) self.on_final_check;
if has_delayed_actions self then (
Perform_delayed_th.top self acts;
) else (
fcheck := false
)
done;
CC.check cc acts;
Perform_delayed_th.top self acts;
if not @@ CC.new_merges cc then (
raise_notrace E_loop_exit
if not (CC.new_merges cc) && not (has_delayed_actions self) then (
continue := false;
);
done;
with E_loop_exit ->
()
) else (
List.iter (fun f -> f self acts lits) self.on_partial_check;
Perform_delayed_th.top self acts;