mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 19:25:36 -05:00
[bugfix] some late unsat conflicts were not handled correctly
This commit is contained in:
parent
07c62fc5bc
commit
714e0988e3
3 changed files with 13 additions and 1 deletions
|
|
@ -454,7 +454,8 @@ module Make (L : Log_intf.S)(E : Expr_intf.S)
|
||||||
|
|
||||||
let add_boolean_conflict confl =
|
let add_boolean_conflict confl =
|
||||||
env.conflicts <- env.conflicts + 1;
|
env.conflicts <- env.conflicts + 1;
|
||||||
if decision_level() = 0 then report_unsat confl; (* Top-level conflict *)
|
if decision_level() = 0 || Vec.for_all (fun a -> a.var.level = 0) confl.atoms then
|
||||||
|
report_unsat confl; (* Top-level conflict *)
|
||||||
let blevel, learnt, history, is_uip = analyze confl in
|
let blevel, learnt, history, is_uip = analyze confl in
|
||||||
cancel_until blevel;
|
cancel_until blevel;
|
||||||
record_learnt_clause confl blevel learnt (History history) is_uip
|
record_learnt_clause confl blevel learnt (History history) is_uip
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,14 @@ let exists p t =
|
||||||
false
|
false
|
||||||
with ExitVec -> true
|
with ExitVec -> true
|
||||||
|
|
||||||
|
let for_all p t =
|
||||||
|
try
|
||||||
|
for i = 0 to t.sz - 1 do
|
||||||
|
if not (p (Array.unsafe_get t.data i)) then raise ExitVec
|
||||||
|
done;
|
||||||
|
true
|
||||||
|
with ExitVec -> false
|
||||||
|
|
||||||
(*
|
(*
|
||||||
template<class V, class T>
|
template<class V, class T>
|
||||||
static inline void remove(V& ts, const T& t)
|
static inline void remove(V& ts, const T& t)
|
||||||
|
|
|
||||||
|
|
@ -96,3 +96,6 @@ val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b
|
||||||
val exists : ('a -> bool) -> 'a t -> bool
|
val exists : ('a -> bool) -> 'a t -> bool
|
||||||
(** Does there exist an element that satisfies the predicate? *)
|
(** Does there exist an element that satisfies the predicate? *)
|
||||||
|
|
||||||
|
val for_all : ('a -> bool) -> 'a t -> bool
|
||||||
|
(** Do all elements satisfy the predicate? *)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue