- java.lang.Object
-
- org.logicng.solvers.datastructures.MSVariable
-
public final class MSVariable extends Object
A variable of the SAT solver for MiniSAT-style solvers.- Since:
- 1.0
- Version:
- 2.0.0
-
-
Constructor Summary
Constructors Constructor Description MSVariable(boolean polarity)Constructs a new variable with a given initial polarity.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleactivity()Returns the activity of this variable.voidassign(Tristate assignment)Assigns this variable to a given lifted Boolean.Tristateassignment()Returns the current assignment of this variable.booleandecision()Returnstrueif this variable should be used as a decision variable during solving,falseotherwise.voidincrementActivity(double inc)Increments this variable's activity by a given valueintlevel()Returns the decision level of this variable.booleanpolarity()Returns the polarity of this variable.MSClausereason()Returns the reason for this variable.voidrescaleActivity()Rescales this variable's activity.voidsetDecision(boolean decision)Sets whether this variable can be used as a decision variable during solving or not.voidsetLevel(int level)Sets the decision level of this variable.voidsetPolarity(boolean polarity)Sets the polarity of this variable.voidsetReason(MSClause reason)Sets the reason for this variable.StringtoString()
-
-
-
Method Detail
-
setLevel
public void setLevel(int level)
Sets the decision level of this variable.- Parameters:
level- the decision level
-
level
public int level()
Returns the decision level of this variable.- Returns:
- the decision level of this variable
-
setReason
public void setReason(MSClause reason)
Sets the reason for this variable.- Parameters:
reason- the reason for this variable
-
reason
public MSClause reason()
Returns the reason for this variable.- Returns:
- the reason for this variable
-
assign
public void assign(Tristate assignment)
Assigns this variable to a given lifted Boolean.- Parameters:
assignment- the lifted Boolean
-
assignment
public Tristate assignment()
Returns the current assignment of this variable.- Returns:
- the current assignment of this variable
-
rescaleActivity
public void rescaleActivity()
Rescales this variable's activity.
-
incrementActivity
public void incrementActivity(double inc)
Increments this variable's activity by a given value- Parameters:
inc- the increment value
-
activity
public double activity()
Returns the activity of this variable.- Returns:
- the activity of this variable
-
setPolarity
public void setPolarity(boolean polarity)
Sets the polarity of this variable.- Parameters:
polarity- the polarity of this variable
-
polarity
public boolean polarity()
Returns the polarity of this variable.- Returns:
- the polarity of this variable
-
decision
public boolean decision()
Returnstrueif this variable should be used as a decision variable during solving,falseotherwise.- Returns:
trueif this variable should be used as a decision variable
-
setDecision
public void setDecision(boolean decision)
Sets whether this variable can be used as a decision variable during solving or not.- Parameters:
decision-trueif it can be used as decision variable,falseotherwise
-
-