mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 19:25:36 -05:00
Fix for uip unit clause which conflicts with level0
This commit is contained in:
parent
23a3b3e72d
commit
ccebc8c44a
2 changed files with 14 additions and 10 deletions
4
Makefile
4
Makefile
|
|
@ -23,8 +23,8 @@ build-test:
|
||||||
$(COMP) $(FLAGS) $(DIRS) $(TEST)
|
$(COMP) $(FLAGS) $(DIRS) $(TEST)
|
||||||
|
|
||||||
test: build-test
|
test: build-test
|
||||||
@./tests/run smt
|
@/usr/bin/time -f "%e" ./tests/run smt
|
||||||
@./tests/run mcsat
|
@/usr/bin/time -f "%e" ./tests/run mcsat
|
||||||
|
|
||||||
bench: build-test
|
bench: build-test
|
||||||
cd bench && $(MAKE)
|
cd bench && $(MAKE)
|
||||||
|
|
|
||||||
|
|
@ -415,17 +415,21 @@ module Make (L : Log_intf.S)(E : Expr_intf.S)
|
||||||
List.iter (fun q -> q.var.seen <- false) !seen;
|
List.iter (fun q -> q.var.seen <- false) !seen;
|
||||||
*)
|
*)
|
||||||
|
|
||||||
let record_learnt_clause blevel learnt history is_uip =
|
let record_learnt_clause confl blevel learnt history is_uip =
|
||||||
begin match learnt with
|
begin match learnt with
|
||||||
| [] -> assert false
|
| [] -> assert false
|
||||||
| [fuip] ->
|
| [fuip] ->
|
||||||
assert (blevel = 0);
|
assert (blevel = 0);
|
||||||
|
if fuip.neg.is_true then
|
||||||
|
report_unsat confl
|
||||||
|
else begin
|
||||||
fuip.var.tag.vpremise <- history;
|
fuip.var.tag.vpremise <- history;
|
||||||
let name = fresh_lname () in
|
let name = fresh_lname () in
|
||||||
let uclause = make_clause name learnt (List.length learnt) true history in
|
let uclause = make_clause name learnt (List.length learnt) true history in
|
||||||
L.debug 2 "Unit clause learnt : %a" St.pp_clause uclause;
|
L.debug 2 "Unit clause learnt : %a" St.pp_clause uclause;
|
||||||
Vec.push env.learnts uclause;
|
Vec.push env.learnts uclause;
|
||||||
enqueue_bool fuip 0 (Bcp (Some uclause))
|
enqueue_bool fuip 0 (Bcp (Some uclause))
|
||||||
|
end
|
||||||
| fuip :: _ ->
|
| fuip :: _ ->
|
||||||
let name = fresh_lname () in
|
let name = fresh_lname () in
|
||||||
let lclause = make_clause name learnt (List.length learnt) true history in
|
let lclause = make_clause name learnt (List.length learnt) true history in
|
||||||
|
|
@ -449,7 +453,7 @@ module Make (L : Log_intf.S)(E : Expr_intf.S)
|
||||||
if decision_level() = 0 then report_unsat confl; (* Top-level conflict *)
|
if decision_level() = 0 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 blevel learnt (History history) is_uip
|
record_learnt_clause confl blevel learnt (History history) is_uip
|
||||||
|
|
||||||
(* Add a new clause *)
|
(* Add a new clause *)
|
||||||
exception Trivial
|
exception Trivial
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue