Package MAKBPInterpreter.logic
Class Equivalence
- java.lang.Object
-
- MAKBPInterpreter.logic.Equivalence
-
-
Constructor Summary
Constructors Constructor Description Equivalence(Formula leftOperand, Formula rightOperand)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(Formula otherFormula)Returnstrueif this formula contains the specified formula.booleanequals(java.lang.Object other)Checks if the formulas are the same.booleanevaluate(LogicAssignment assignment)Evaluates a state that we passed into arguments.FormulagetLeftOperand()Gets the left operand of the formula.FormulagetNegation()Returns the negation of the current formula.FormulagetRightOperand()Gets the right operand of the formula.inthashCode()Formulasimplify()Simplifies the logic formula.java.lang.StringtoString()
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
Checks if the formulas are the same.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
simplify
public Formula simplify()
Description copied from interface:FormulaSimplifies the logic formula.
-
getNegation
public Formula getNegation()
Description copied from interface:FormulaReturns the negation of the current formula.- Specified by:
getNegationin interfaceFormula- Returns:
- negation of formula
-
contains
public boolean contains(Formula otherFormula)
Description copied from interface:FormulaReturnstrueif this formula contains the specified formula.
-
getLeftOperand
public Formula getLeftOperand()
Gets the left operand of the formula.- Returns:
- condition formula
-
getRightOperand
public Formula getRightOperand()
Gets the right operand of the formula.- Returns:
- new formula implied by the left one
-
evaluate
public boolean evaluate(LogicAssignment assignment) throws java.lang.Exception
Description copied from interface:FormulaEvaluates a state that we passed into arguments.
-
-