Class NumericComparison
- java.lang.Object
-
- it.unive.lisa.symbolic.value.operator.binary.NumericComparison
-
- All Implemented Interfaces:
Operator,BinaryOperator,ComparisonOperator,NegatableOperator
- Direct Known Subclasses:
ComparisonGe,ComparisonGt,ComparisonLe,ComparisonLt
public abstract class NumericComparison extends java.lang.Object implements ComparisonOperator, BinaryOperator
A common implementation for classes implementingBinaryOperatorandComparisonOperator, providing atypeInference(TypeSystem, Set, Set)implementation that returns an empty set if noNumericTypecan be found in one of the arguments or ifNumericType.commonNumericalType(Set, Set)returns an empty set, and a singleton set containingTypeSystem.getBooleanType()otherwise.
-
-
Constructor Summary
Constructors Constructor Description NumericComparison()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<Type>typeInference(TypeSystem types, java.util.Set<Type> left, java.util.Set<Type> right)Computes the runtime types of this expression (i.e., of the result of this expression) assuming that the arguments of this expression have the given types.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface it.unive.lisa.symbolic.value.operator.NegatableOperator
opposite
-
-
-
-
Method Detail
-
typeInference
public java.util.Set<Type> typeInference(TypeSystem types, java.util.Set<Type> left, java.util.Set<Type> right)
Description copied from interface:BinaryOperatorComputes the runtime types of this expression (i.e., of the result of this expression) assuming that the arguments of this expression have the given types.- Specified by:
typeInferencein interfaceBinaryOperator- Parameters:
types- the type system knowing about the types of the current programleft- the set of types of the left-most argument of this expressionright- the set of types of the right-most argument of this expression- Returns:
- the runtime types of this expression
-
-