- java.lang.Object
-
- org.logicng.solvers.functions.FormulaOnSolverFunction
-
- All Implemented Interfaces:
SolverFunction<Set<Formula>>
public final class FormulaOnSolverFunction extends Object implements SolverFunction<Set<Formula>>
A solver function for getting the current formula on the solver.Note that this formula is usually syntactically different to the formulas which were actually added to the solver, since the formulas are added as CNF and may be simplified or even removed depending on the state of the solver. Furthermore, the solver might add learnt clauses or propagate literals.
If the formula on the solver is known to be unsatisfiable, this function will add
falsumto the returned set of formulas. However, as long asSATSolver.sat()was not called on the current solver state, the absence offalsumdoes not imply that the formula is satisfiable.Also note that formulas are not added to the solver as soon as the solver is known be unsatisfiable.
- Since:
- 2.0.0
- Version:
- 2.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<Formula>apply(MiniSat solver, Consumer<Tristate> resultSetter)Applies this function to the given solver.static FormulaOnSolverFunctionget()Returns the singleton of the function.
-
-
-
Method Detail
-
get
public static FormulaOnSolverFunction get()
Returns the singleton of the function.- Returns:
- the function instance
-
apply
public Set<Formula> apply(MiniSat solver, Consumer<Tristate> resultSetter)
Description copied from interface:SolverFunctionApplies this function to the given solver.- Specified by:
applyin interfaceSolverFunction<Set<Formula>>- Parameters:
solver- the solver on which the function should work onresultSetter- a setter for the result of the solver- Returns:
- the result of the function application
-
-