Skip to content

Commit

Permalink
feat: pass a sign along with the formula in acts_add_decision_lit
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Nov 14, 2020
1 parent 4097ed9 commit 764695b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/core/Internal.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1700,8 +1700,9 @@ module Make(Plugin : PLUGIN)
Log.debugf info (fun k->k "(@[sat.th.add-clause@ %a@])" Clause.debug c);
Vec.push st.clauses_to_add c

let acts_add_decision_lit (st:t) (f:formula) : unit =
let acts_add_decision_lit (st:t) (f:formula) (sign:bool) : unit =
let a = create_atom st f in
let a = if sign then a else Atom.neg a in
if not (Atom.has_value a) then (
Log.debugf 10 (fun k->k "(@[sat.th.add-decision-lit@ %a@])" Atom.debug a);
st.next_decisions <- a :: st.next_decisions
Expand Down
2 changes: 1 addition & 1 deletion src/core/Msat.ml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ type ('term, 'formula, 'value, 'proof) acts = ('term, 'formula, 'value, 'proof)
acts_add_clause : ?keep:bool -> 'formula list -> 'proof -> unit;
acts_raise_conflict: 'b. 'formula list -> 'proof -> 'b;
acts_propagate : 'formula -> ('term, 'formula, 'proof) reason -> unit;
acts_add_decision_lit: 'formula -> unit;
acts_add_decision_lit: 'formula -> bool -> unit;
}

type negated = Solver_intf.negated = Negated | Same_sign
Expand Down
10 changes: 5 additions & 5 deletions src/core/Solver_intf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ type ('term, 'formula, 'value, 'proof) acts = {
(** Add a clause to the solver.
@param keep if true, the clause will be kept by the solver.
Otherwise the solver is allowed to GC the clause and propose this
partial model again.
partial model again.
*)

acts_raise_conflict: 'b. 'formula list -> 'proof -> 'b;
Expand All @@ -132,10 +132,10 @@ type ('term, 'formula, 'value, 'proof) acts = {
(** Propagate a formula, i.e. the theory can evaluate the formula to be true
(see the definition of {!type:eval_res} *)

acts_add_decision_lit: 'formula -> unit;
(** Ask the SAT solver to decide on the given formula before it can
answer [SAT]. The order of decisions is still unspecified.
Useful for theory combination. *)
acts_add_decision_lit: 'formula -> bool -> unit;
(** Ask the SAT solver to decide on the given formula with given sign
before it can answer [SAT]. The order of decisions is still unspecified.
Useful for theory combination. This will be undone on backtracking. *)
}
(** The type for a slice of assertions to assume/propagate in the theory. *)

Expand Down

0 comments on commit 764695b

Please sign in to comment.