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 comparison built-in literal.
E.g. "x < 4
"
-
Constructor Summary
ConstructorsConstructorDescriptionComparisonBuiltInLiteral
(Term leftTerm, Term rightTerm, ComparisonOperator operator) Constructs a newComparisonBuiltInLiteral
. -
Method Summary
Modifier and TypeMethodDescription<T> T
accept
(LogicSchemaVisitor<T> visitor) applySubstitution
(Substitution substitution) Constructs newComparisonBuiltInLiteral
after applying the substitution to the literal terms.This method constructs a new literal that is the negation of this one.Returns the built-in literal operation name.getTerms()
toString()
Methods inherited from class edu.upc.fib.inlab.imp.kse.logics.logicschema.domain.Literal
canBeNegated, getArity, getUsedVariables, isGround
-
Constructor Details
-
ComparisonBuiltInLiteral
Constructs a newComparisonBuiltInLiteral
.- Parameters:
leftTerm
- left term.rightTerm
- right term.operator
- comparison operator.- Throws:
IllegalArgumentException
- if left term, right term or comparison operator arenull
.
-
-
Method Details
-
toString
-
getTerms
-
applySubstitution
Constructs newComparisonBuiltInLiteral
after applying the substitution to the literal terms.- Specified by:
applySubstitution
in classLiteral
- Parameters:
substitution
- substitution to apply.- Returns:
- a comparison built-in literal after applying the given substitution. The literal will be new if some term has changed, otherwise it will be the same.
-
accept
-
buildNegatedLiteral
Description copied from class:Literal
This method constructs 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
"- Overrides:
buildNegatedLiteral
in classLiteral
- Returns:
- a new literal that is the negation of this literal, if this is possible.
-
getLeftTerm
-
getRightTerm
-
getOperator
-
getOperationName
Description copied from class:BuiltInLiteral
Returns the built-in literal operation name.- Specified by:
getOperationName
in classBuiltInLiteral
- Returns:
- the operation name.
-