mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 19:25:36 -05:00
Better unsat_core
This commit is contained in:
parent
ea1a360148
commit
ddbedc6606
1 changed files with 11 additions and 8 deletions
|
|
@ -146,16 +146,19 @@ module Make(St : Solver_types.S) = struct
|
||||||
assert (cmp_cl l (to_list conclusion) = 0);
|
assert (cmp_cl l (to_list conclusion) = 0);
|
||||||
{ conclusion; step = Resolution (c', d', a); }
|
{ conclusion; step = Resolution (c', d', a); }
|
||||||
|
|
||||||
(* Compute unsat-core *)
|
(* Compute unsat-core
|
||||||
|
TODO: the uniq sort at the end may be costly, maybe remove it,
|
||||||
|
or compare the clauses faster ? *)
|
||||||
let unsat_core proof =
|
let unsat_core proof =
|
||||||
let rec aux acc proof =
|
let rec aux acc = function
|
||||||
let p = expand proof in
|
| [] -> acc
|
||||||
match p.step with
|
| c :: r ->
|
||||||
| Hypothesis | Lemma _ -> p.conclusion :: acc
|
begin match c.St.cpremise with
|
||||||
| Resolution (proof1, proof2, _) ->
|
| St.History [] | St.Lemma _ -> aux (c :: acc) r
|
||||||
aux (aux acc proof1) proof2
|
| St.History l -> aux acc (l @ r)
|
||||||
|
end
|
||||||
in
|
in
|
||||||
sort_uniq cmp (aux [] proof)
|
sort_uniq cmp (aux [] [proof])
|
||||||
|
|
||||||
(* Iter on proofs *)
|
(* Iter on proofs *)
|
||||||
module H = Hashtbl.Make(struct
|
module H = Hashtbl.Make(struct
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue