|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.uni_tuebingen.sfb.lichtenstein.formulas.FormulaImpl de.uni_tuebingen.sfb.lichtenstein.formulas.ComposedFormula de.uni_tuebingen.sfb.lichtenstein.formulas.BinaryJunctor
public abstract class BinaryJunctor
A superclass for implication and equivalence, implementing common methods for binary junctors.
Method Summary | |
---|---|
boolean |
containsVariable(Variable var)
Returns whether this formula contains the given variable. |
boolean |
equals(Object other)
An object is equal to a binary junctor if it has the same class (i.e., not only it is a binary junctor, but it really has the same leaf-level class), and the arguments are both equal, respectively. |
Formula |
getFirstArgument()
Returns the first argument. |
int |
getFirstIndexOf(Variable var)
Get the first index at which the given variable occurs. |
int |
getNbBoundVariables()
Returns the number of bound variables in this binary junctor. |
int |
getNbFreeVariables()
Returns the number of free variables in this binary junctor. |
int |
getNbSubformulas()
Returns the number of direct subformulas. |
int |
getNbVariables()
Returns the number of variables in this binary junctor. |
Set<Predicate> |
getPredicates()
Return all predicates that occur in this formula. |
Formula |
getSecondArgument()
Returns the second argument. |
Formula |
getSubformulaAt(int index)
Returns the subformulas this binary junction is built up of. |
Variable |
getVariableAt(int index)
Get the indexth variable. |
int |
hashCode()
Returns a hash code value for the object. |
boolean |
isFreeVariable(Variable variable)
Check whether the given variable is free in this formula. |
String |
toString()
Returns a string representation of the object. |
Methods inherited from class de.uni_tuebingen.sfb.lichtenstein.formulas.ComposedFormula |
---|
getAllSubformulas, getSymbol |
Methods inherited from class de.uni_tuebingen.sfb.lichtenstein.formulas.FormulaImpl |
---|
accept, and, exists, exists, forAll, forAll, getFreeVariables, getVariables, iff, implies, isClosed, not, or |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface de.uni_tuebingen.sfb.lichtenstein.formulas.Formula |
---|
getNormalForm |
Method Detail |
---|
public Formula getFirstArgument()
| result == getSubformulaAt(0)
public Formula getSecondArgument()
| result == getSubformulaAt(1)
public int getNbVariables()
| getFirstArgument().getNbVariables() +
getSecondArgument().getNbVariables()
public int getNbFreeVariables()
| result ==
getFirstArgument().getNbFreeVariables() + getSecondArgument().getNbFreeVariables()
public int getNbBoundVariables()
| getFirstArgument().getNbBoundVariables() +
getSecondArgument().getNbBoundVariables()
public int getFirstIndexOf(Variable var)
var
- The variable of which the index is wanted.public Variable getVariableAt(int index) throws IndexOutOfBoundsException
index
- The index of the wanted variable| if (
getFirstArgument().getNbVariables() > index )
| then result == getFirstArgument().getVariableAt(index) |
else result == getSecondArgument().getVariableAt(index - getFirstArgument().getNbVariables())
public boolean containsVariable(Variable var)
var
- The variable to check.| result ==
getFirstArgument().containsVariable(var)
|| | getSecondArgument().containsVariable(var)
public boolean isFreeVariable(Variable variable)
variable
- The variable to check.| result == getFirstArgument().isFreeVariable(variable) ||
getSecondArgument().isFreeVariable(variable)
public Set<Predicate> getPredicates()
public final int getNbSubformulas()
getNbSubformulas
in class ComposedFormula
| result == 2
public Formula getSubformulaAt(int index)
getSubformulaAt
in class ComposedFormula
index
- The index of the wanted subformula. Indices start from 0.
public boolean equals(Object other)
equals
in class FormulaImpl
| let otherJunctor = (BinaryJunctor) other in | if ( !
getFirstArgument().equals(otherJunctor.getFirstArgument())
|| | !
getSecondArgument().equals(otherJunctor.getSecondArgument()) )
| then result == false
public int hashCode()
This method should be overridden along with equals
. For the reason, see Object.hashCode()
.
hashCode
in class FormulaImpl
| result ==
getFirstArgument().hashCode() + getSymbol().hashCode() + getSecondArgument().hashCode()
public String toString()
formulas have a traditional string representation. No elimination of unnecessary parentheses is performed.
toString
in class FormulaImpl
| result.contains(getFirstArgument().toString() + getSymbol() +
getSecondArgument().toString())
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |