Fix for dependencies during proof computing

This commit is contained in:
Guillaume Bury 2015-03-13 15:03:30 +01:00
parent ee13eb366b
commit 5047882fc7
5 changed files with 25 additions and 26 deletions

View file

@ -141,8 +141,7 @@ module Make(Log : Log_intf.S) = struct
let eval = SatSolver.eval
let get_proof () =
SatSolver.Proof.learn (SatSolver.hyps ());
SatSolver.Proof.learn (SatSolver.history ());
(* SatSolver.Proof.learn (SatSolver.history ()); *)
match SatSolver.unsat_conflict () with
| None -> assert false
| Some c -> SatSolver.Proof.prove_unsat c

View file

@ -135,8 +135,7 @@ module Make(Dummy:sig end) = struct
with SmtSolver.Unsat -> ()
let get_proof () =
SmtSolver.Proof.learn (SmtSolver.hyps ());
SmtSolver.Proof.learn (SmtSolver.history ());
(* SmtSolver.Proof.learn (SmtSolver.history ()); *)
match SmtSolver.unsat_conflict () with
| None -> assert false
| Some c -> SmtSolver.Proof.prove_unsat c

View file

@ -84,8 +84,7 @@ module Make(Dummy:sig end) = struct
with SmtSolver.Unsat -> ()
let get_proof () =
SmtSolver.Proof.learn (SmtSolver.hyps ());
SmtSolver.Proof.learn (SmtSolver.history ());
(* SmtSolver.Proof.learn (SmtSolver.history ()); *)
match SmtSolver.unsat_conflict () with
| None -> assert false
| Some c -> SmtSolver.Proof.prove_unsat c

View file

@ -130,7 +130,15 @@ module Make(L : Log_intf.S)(St : Mcsolver_types.S) = struct
| _ ->
raise (Resolution_error "Could not find a reason needed to resolve")
let add_clause c cl l = (* We assume that all clauses in l are already proved ! *)
let need_clause (c, cl) =
if is_proved (c, cl) then
[]
else
match St.(c.cpremise) with
| St.History l -> l
| St.Lemma _ -> assert false
let rec add_clause c cl l = (* We assume that all clauses in l are already proved ! *)
match l with
| a :: r ->
L.debug 5 "Resolving (with history) %a" St.pp_clause c;
@ -140,21 +148,14 @@ module Make(L : Log_intf.S)(St : Mcsolver_types.S) = struct
while not (equal_cl cl !new_cl) do
let unit_to_use = diff_learnt [] cl !new_cl in
let unit_r = List.map (fun a -> clause_unit a) unit_to_use in
do_clause (List.map fst unit_r);
let temp_c, temp_cl = List.fold_left add_res (!new_c, !new_cl) unit_r in
new_c := temp_c;
new_cl := temp_cl;
done
| _ -> assert false
let need_clause (c, cl) =
if is_proved (c, cl) then
[]
else
match St.(c.cpremise) with
| St.History l -> l
| St.Lemma _ -> assert false
let rec do_clause = function
and do_clause = function
| [] -> ()
| c :: r ->
let cl = to_list c in

View file

@ -129,7 +129,15 @@ module Make(L : Log_intf.S)(St : Solver_types.S) = struct
| _ ->
raise (Resolution_error "Could not find a reason needed to resolve")
let add_clause c cl l = (* We assume that all clauses in l are already proved ! *)
let need_clause (c, cl) =
if is_proved (c, cl) then
[]
else
match St.(c.cpremise) with
| St.History l -> l
| St.Lemma _ -> assert false
let rec add_clause c cl l = (* We assume that all clauses in l are already proved ! *)
match l with
| a :: r ->
L.debug 5 "Resolving (with history) %a" St.pp_clause c;
@ -139,21 +147,14 @@ module Make(L : Log_intf.S)(St : Solver_types.S) = struct
while not (equal_cl cl !new_cl) do
let unit_to_use = diff_learnt [] cl !new_cl in
let unit_r = List.map (fun a -> clause_unit a) unit_to_use in
do_clause (List.map fst unit_r);
let temp_c, temp_cl = List.fold_left add_res (!new_c, !new_cl) unit_r in
new_c := temp_c;
new_cl := temp_cl;
done
| _ -> assert false
let need_clause (c, cl) =
if is_proved (c, cl) then
[]
else
match St.(c.cpremise) with
| St.History l -> l
| St.Lemma _ -> assert false
let rec do_clause = function
and do_clause = function
| [] -> ()
| c :: r ->
let cl = to_list c in