Module logicng

Class 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 Detail

      • MSVariable

        public MSVariable​(boolean polarity)
        Constructs a new variable with a given initial polarity.
        Parameters:
        polarity - the initial polarity
    • 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()
        Returns true if this variable should be used as a decision variable during solving, false otherwise.
        Returns:
        true if 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 - true if it can be used as decision variable, false otherwise