Class ComparisonNe
- java.lang.Object
-
- it.unive.lisa.symbolic.value.operator.binary.ComparisonNe
-
- All Implemented Interfaces:
Operator
,BinaryOperator
,ComparisonOperator
,NegatableOperator
public class ComparisonNe extends java.lang.Object implements ComparisonOperator, BinaryOperator
Given two expressions, aBinaryExpression
using this operator checks if the values those expressions compute to are different. This operator corresponds to the logical negation ofComparisonEq
.
First argument expression type: anyType
Second argument expression type: anyType
Computed expression type:BooleanType
-
-
Field Summary
Fields Modifier and Type Field Description static ComparisonNe
INSTANCE
The singleton instance of this class.
-
Constructor Summary
Constructors Modifier Constructor Description protected
ComparisonNe()
Builds the operator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ComparisonOperator
opposite()
Yields the opposite operator of this operator (e.g.,ComparisonLe
toComparisonGt
,ComparisonLt
toComparisonGe
).java.lang.String
toString()
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.
-
-
-
Field Detail
-
INSTANCE
public static final ComparisonNe INSTANCE
The singleton instance of this class.
-
-
Constructor Detail
-
ComparisonNe
protected ComparisonNe()
Builds the operator. This constructor is visible to allow subclassing: instances of this class should be unique, and the singleton can be retrieved through fieldINSTANCE
.
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
opposite
public ComparisonOperator opposite()
Description copied from interface:NegatableOperator
Yields the opposite operator of this operator (e.g.,ComparisonLe
toComparisonGt
,ComparisonLt
toComparisonGe
).- Specified by:
opposite
in interfaceNegatableOperator
- Returns:
- the opposite operator of this operator
-
typeInference
public java.util.Set<Type> typeInference(TypeSystem types, java.util.Set<Type> left, java.util.Set<Type> right)
Description copied from interface:BinaryOperator
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.- Specified by:
typeInference
in 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
-
-