Package net.sf.tweety.math.equation
Class Statement
- java.lang.Object
-
- net.sf.tweety.math.equation.Statement
-
- Direct Known Subclasses:
Equation
,Inequation
public abstract class Statement extends java.lang.Object
This class models a mathematical statement, i.e. an equality or an inequality.- Author:
- Matthias Thimm
-
-
Method Summary
Modifier and Type Method Description void
collapseAssociativeOperations()
This method collapses all associative operations appearing in this statement, e.g.void
expandAssociativeOperations()
This method expands all associative operations appearing in this statement, e.g.java.util.Set<AbsoluteValue>
getAbsoluteValues()
Returns all absolute values of this statement.Term
getLeftTerm()
Returns the left term of this statement.java.util.Set<Maximum>
getMaximums()
Returns all maximums of this statement.java.util.Set<Minimum>
getMinimums()
Returns all minimums of this statement.abstract java.lang.String
getRelationSymbol()
Returns the relation symbol of this statement.Term
getRightTerm()
Returns the right term of this statement.abstract boolean
isNormalized()
Checks whether this constraint is of normalized form, i.e.Statement
replaceAllTerms(java.util.Map<? extends Term,? extends Term> substitutes)
Replaces terms according to the given map.abstract Statement
replaceTerm(Term toSubstitute, Term substitution)
Replaces each occurrence of "toSubstitute" by "substitution" and return the new statement.void
setLeftTerm(Term t)
Sets the left term of this statement.void
setRightTerm(Term t)
Sets the right term of this statement.abstract Statement
toLinearForm()
Brings both terms into linear form.abstract Statement
toNormalizedForm()
Normalizes this constraint, i.e.java.lang.String
toString()
-
-
-
Method Detail
-
getLeftTerm
public Term getLeftTerm()
Returns the left term of this statement.- Returns:
- the left term of this statement.
-
getMinimums
public java.util.Set<Minimum> getMinimums()
Returns all minimums of this statement.- Returns:
- all minimums of this statement.
-
getMaximums
public java.util.Set<Maximum> getMaximums()
Returns all maximums of this statement.- Returns:
- all maximums of this statement.
-
getAbsoluteValues
public java.util.Set<AbsoluteValue> getAbsoluteValues()
Returns all absolute values of this statement.- Returns:
- all absolute values of this statement.
-
replaceTerm
public abstract Statement replaceTerm(Term toSubstitute, Term substitution)
Replaces each occurrence of "toSubstitute" by "substitution" and return the new statement.- Parameters:
toSubstitute
- the term to be substitutedsubstitution
- the new term- Returns:
- this statement where "toSubstitute" is replaced by "substitution"
-
replaceAllTerms
public Statement replaceAllTerms(java.util.Map<? extends Term,? extends Term> substitutes)
Replaces terms according to the given map.- Parameters:
substitutes
- a map.- Returns:
- a term.
-
isNormalized
public abstract boolean isNormalized()
Checks whether this constraint is of normalized form, i.e. whether it has the form "T > 0" or "T >= 0", "T = 0" or "T != 0"- Returns:
- "true" iff this constraint is normalized.
-
toNormalizedForm
public abstract Statement toNormalizedForm()
Normalizes this constraint, i.e. brings it into an equivalent form "T > 0" or "T >= 0", "T = 0" or "T != 0".- Returns:
- a statement.
-
toLinearForm
public abstract Statement toLinearForm()
Brings both terms into linear form. If this constraint is normalized (i.e. the right term consists of the constant 0) the right term is not linearized.- Returns:
- a statement.
-
collapseAssociativeOperations
public void collapseAssociativeOperations()
This method collapses all associative operations appearing in this statement, e.g. every min{min{a,b},c} becomes min{a,b,c}
-
expandAssociativeOperations
public void expandAssociativeOperations()
This method expands all associative operations appearing in this statement, e.g. every min{a,b,c} becomes min{min{a,b},c}.
-
getRightTerm
public Term getRightTerm()
Returns the right term of this statement.- Returns:
- the right term of this statement.
-
setLeftTerm
public void setLeftTerm(Term t)
Sets the left term of this statement.- Parameters:
t
- a term
-
setRightTerm
public void setRightTerm(Term t)
Sets the right term of this statement.- Parameters:
t
- a term
-
getRelationSymbol
public abstract java.lang.String getRelationSymbol()
Returns the relation symbol of this statement.- Returns:
- the relation symbol of this statement.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-