Interface PropagatorBackend
UserPropagator to implement custom user
propagators. It contains functions to interact with the SAT/SMT core during solving, for example,
it provides the ability to propagate conflicts and to influence the decision-making.-
Method Summary
Modifier and TypeMethodDescriptionvoidEnables tracking of decisions made for the associatedUserPropagatorviaUserPropagator.onDecision(BooleanFormula, boolean).voidEnables the final callbackUserPropagator.onFinalCheck()that is invoked when the solver finds a full satisfying assignment.voidEnables tracking of expression values for the associatedUserPropagatorviaUserPropagator.onKnownValue(org.sosy_lab.java_smt.api.BooleanFormula, boolean).voidpropagateConflict(BooleanFormula[] conflictExpressions) Raises a conflict caused by a set of conflicting assignments.voidpropagateConsequence(BooleanFormula[] assignedExpressions, BooleanFormula consequence) Propagates a consequence implied by a set of assigned expressions.booleanpropagateNextDecision(BooleanFormula expr, Optional<Boolean> value) Propagates a decision to be made by the solver.voidregisterExpression(BooleanFormula theoryExpr) Registers an expression to be observed by aUserPropagator.
-
Method Details
-
registerExpression
Registers an expression to be observed by aUserPropagator. SeeUserPropagator.onKnownValue(org.sosy_lab.java_smt.api.BooleanFormula, boolean)andUserPropagator.onDecision(org.sosy_lab.java_smt.api.BooleanFormula, boolean)for more information.- Parameters:
theoryExpr- The expression to observe.
-
propagateConflict
Raises a conflict caused by a set of conflicting assignments. Shall only be called from within a callback byUserPropagatorsuch asUserPropagator.onKnownValue(org.sosy_lab.java_smt.api.BooleanFormula, boolean)andUserPropagator.onFinalCheck().Effectively causes the solver to learn the implication "
conflictExpressions=> false"- Parameters:
conflictExpressions- A set of inconsistent assignments.
-
propagateConsequence
Propagates a consequence implied by a set of assigned expressions. Shall only be called from within a callback byUserPropagatorsuch asUserPropagator.onKnownValue(org.sosy_lab.java_smt.api.BooleanFormula, boolean)andUserPropagator.onFinalCheck().Effectively causes the solver to learn the implication "/\
assignedExpressions=>consequence" It is possible to have an empty set ofassignedExpressionsto generate a theory lemma.- Parameters:
assignedExpressions- A set of assigned expressions.consequence- The consequence implied by the assigned expressions.
-
propagateNextDecision
Propagates a decision to be made by the solver. If called duringUserPropagator.onKnownValue(org.sosy_lab.java_smt.api.BooleanFormula, boolean), will set the next decision to be made. If called duringUserPropagator.onDecision(org.sosy_lab.java_smt.api.BooleanFormula, boolean), will overwrite the current decision to be made.- Parameters:
expr- The expression to assign to next.value- The value to be assigned. If not given, the solver will decide.- Returns:
- False, if the value of
expris already assigned. True, otherwise. Note that the value ofexprmay already be decided before being reported viaUserPropagator.onKnownValue(org.sosy_lab.java_smt.api.BooleanFormula, boolean).
-
notifyOnKnownValue
void notifyOnKnownValue()Enables tracking of expression values for the associatedUserPropagatorviaUserPropagator.onKnownValue(org.sosy_lab.java_smt.api.BooleanFormula, boolean).This function is typically called from
UserPropagator.initializeWithBackend(org.sosy_lab.java_smt.api.PropagatorBackend)if the theory solver needs to listen to the value of expressions registered byregisterExpression(org.sosy_lab.java_smt.api.BooleanFormula). -
notifyOnDecision
void notifyOnDecision()Enables tracking of decisions made for the associatedUserPropagatorviaUserPropagator.onDecision(BooleanFormula, boolean).This function is typically called from
UserPropagator.initializeWithBackend(org.sosy_lab.java_smt.api.PropagatorBackend)if the theory solver needs to listen to and/or modify the decisions made by the solver on expressions registered byregisterExpression(org.sosy_lab.java_smt.api.BooleanFormula). -
notifyOnFinalCheck
void notifyOnFinalCheck()Enables the final callbackUserPropagator.onFinalCheck()that is invoked when the solver finds a full satisfying assignment.This function is typically called from
UserPropagator.initializeWithBackend(org.sosy_lab.java_smt.api.PropagatorBackend)if the theory solver needs to perform final consistency checks.
-