Class LogicalNegation
- java.lang.Object
-
- it.unive.lisa.symbolic.value.operator.unary.LogicalNegation
-
- All Implemented Interfaces:
Operator
,LogicalOperator
,NegatableOperator
,UnaryOperator
public class LogicalNegation extends java.lang.Object implements LogicalOperator, UnaryOperator
Given an expression that evaluates to a Boolean value, aUnaryExpression
using this operator computes the logical negation of the expression: if it evaluates totrue
, it is transformed tofalse
, and vice versa.
Argument expression type:BooleanType
Computed expression type:BooleanType
-
-
Field Summary
Fields Modifier and Type Field Description static LogicalNegation
INSTANCE
The singleton instance of this class.
-
Constructor Summary
Constructors Modifier Constructor Description protected
LogicalNegation()
Builds the type.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LogicalNegation
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> argument)
Computes the runtime types of this expression (i.e., of the result of this expression) assuming that the argument of this expression has the given types.
-
-
-
Field Detail
-
INSTANCE
public static final LogicalNegation INSTANCE
The singleton instance of this class.
-
-
Constructor Detail
-
LogicalNegation
protected LogicalNegation()
Builds the type. This constructor is visible to allow subclassing: instances of this class should be unique, and the singleton can be retrieved through fieldINSTANCE
.
-
-
Method Detail
-
opposite
public LogicalNegation 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
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
typeInference
public java.util.Set<Type> typeInference(TypeSystem types, java.util.Set<Type> argument)
Description copied from interface:UnaryOperator
Computes the runtime types of this expression (i.e., of the result of this expression) assuming that the argument of this expression has the given types.- Specified by:
typeInference
in interfaceUnaryOperator
- Parameters:
types
- the type system knowing about the types of the current programargument
- the set of types of the argument of this expression- Returns:
- the runtime types of this expression
-
-