Class PropositionalLogicAssignment

  • All Implemented Interfaces:
    LogicAssignment
    Direct Known Subclasses:
    ModalLogicAssignment

    public class PropositionalLogicAssignment
    extends java.lang.Object
    implements LogicAssignment
    Represents an assignment for propositional logic and its extensions
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.Map<Atom,​java.lang.Boolean> state
      State to evaluate.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean get​(Atom key)
      Gets the associated value of a key.
      boolean getOrDefault​(Atom key, boolean defaultValue)
      Gets the associated value of a key if exists in the state, else the default value.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • state

        protected java.util.Map<Atom,​java.lang.Boolean> state
        State to evaluate.
    • Constructor Detail

      • PropositionalLogicAssignment

        public PropositionalLogicAssignment​(java.util.Map<Atom,​java.lang.Boolean> state)
        Constructor.
        Parameters:
        state - the state to evaluate
    • Method Detail

      • get

        public boolean get​(Atom key)
        Gets the associated value of a key.
        Parameters:
        key - key to gets the value
        Returns:
        the associated value
      • getOrDefault

        public boolean getOrDefault​(Atom key,
                                    boolean defaultValue)
        Gets the associated value of a key if exists in the state, else the default value.
        Parameters:
        key - key to gets the value
        defaultValue - default value to return if the key doesn't exists in the state
        Returns:
        the associated value or default value