Record Class BottomValue
java.lang.Object
java.lang.Record
org.ek9lang.compiler.phase5.flow.BottomValue
- All Implemented Interfaces:
AbstractValue
Represents an unreachable program point — a contradiction in constraints.
This is the bottom of the lattice. A state becomes BOTTOM after a throw statement or when a condition creates a contradiction (e.g., x == 5 when x is known to be 7).
Key property: BOTTOM join X = X (unreachable paths are ignored at join points).
Singleton — use INSTANCE.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.evaluateCondition(String operator, AbstractValue operand) Evaluate whether this abstract value satisfies a comparison condition.final inthashCode()Returns a hash code value for this object.booleanisBottom()Check if this value represents an unreachable program point.booleanisKnown()Check if this value represents a known state (not TOP and not BOTTOM).join(AbstractValue other) Join this value with another at a branch convergence point.toString()Returns a string representation of this record class.Methods inherited from interface AbstractValue
isKnownSet
-
Field Details
-
INSTANCE
Shared singleton instance.
-
-
Constructor Details
-
BottomValue
public BottomValue()Creates an instance of aBottomValuerecord class.
-
-
Method Details
-
join
Description copied from interface:AbstractValueJoin this value with another at a branch convergence point. Returns the least upper bound of the two values.Key rules:
- BOTTOM join X = X (unreachable path is ignored)
- X join BOTTOM = X
- TOP join X = TOP
- Constant(a) join Constant(a) = Constant(a) (both agree)
- Constant(a) join Constant(b) = TOP (disagreement)
- Specified by:
joinin interfaceAbstractValue
-
evaluateCondition
Description copied from interface:AbstractValueEvaluate whether this abstract value satisfies a comparison condition.- Specified by:
evaluateConditionin interfaceAbstractValue- Parameters:
operator- the comparison operator (==, <>, <, >, etc.)operand- the right-hand side value to compare against- Returns:
- TRUE if condition is always satisfied, FALSE if never satisfied, UNKNOWN if indeterminate
-
isKnown
public boolean isKnown()Description copied from interface:AbstractValueCheck if this value represents a known state (not TOP and not BOTTOM).- Specified by:
isKnownin interfaceAbstractValue
-
isBottom
public boolean isBottom()Description copied from interface:AbstractValueCheck if this value represents an unreachable program point.- Specified by:
isBottomin interfaceAbstractValue
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal.
-