Class ComparisonBuiltInLiteral
java.lang.Object
edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Literal
edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.BuiltInLiteral
edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.ComparisonBuiltInLiteral
- Direct Known Subclasses:
EqualityComparisonBuiltInLiteral
Implementation of the logic ComparisonBuiltInLiteral.
E.g. "x < 4".
-
Constructor Summary
ConstructorDescriptionComparisonBuiltInLiteral
(Term leftTerm, Term rightTerm, ComparisonOperator operator) -
Method Summary
Modifier and TypeMethodDescription<T> T
accept
(LogicSchemaVisitor<T> visitor) applySubstitution
(Substitution substitution) This method builds a new literal that is the negation of this one.getTerms()
toString()
Methods inherited from class edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Literal
canBeNegated, getArity, getUsedVariables, isGround
-
Constructor Details
-
ComparisonBuiltInLiteral
-
-
Method Details
-
getLeftTerm
-
getRightTerm
-
getOperator
-
getTerms
-
applySubstitution
- Specified by:
applySubstitution
in classLiteral
- Parameters:
substitution
- not null- Returns:
- a literal after applying the given substitution. The literal will be new if some term has changed, otherwise it will be the same
-
accept
-
getOperationName
- Specified by:
getOperationName
in classBuiltInLiteral
-
toString
-
buildNegatedLiteral
Description copied from class:Literal
This method builds a new literal that is the negation of this one. E.g.: given an ordinary literal "P(x)" it will return a new literal "not(P(x))", or given a built-in literal"x < y" it will return "x >= y"
Not all built-in literals can be negated. Thus, this function might throw an Exception.
- Overrides:
buildNegatedLiteral
in classLiteral
- Returns:
- a new literal that is the negation of this literal, if this is possible
-