Package MAKBPInterpreter.logic
Class PropositionalLogicAssignment
- java.lang.Object
-
- MAKBPInterpreter.logic.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
-
-
Constructor Summary
Constructors Constructor Description PropositionalLogicAssignment(java.util.Map<Atom,java.lang.Boolean> state)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanget(Atom key)Gets the associated value of a key.booleangetOrDefault(Atom key, boolean defaultValue)Gets the associated value of a key if exists in the state, else the default value.
-
-
-
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 valuedefaultValue- default value to return if the key doesn't exists in the state- Returns:
- the associated value or default value
-
-