Describes the admissible real values of a symbolic variable as one numeric interval.

remarks

An Assumption is an interval constraint, not a symbolic theorem. It can prove relations when the interval bounds force an answer, disprove them when the bounds force the opposite answer, and otherwise reports an unknown result as undefined. Two variables having the same admissible interval therefore does not prove that the variables are equal. Instances are immutable. Repeated assumptions for a variable are intersected by the global assumption registry rather than modifying an existing interval. Finite bounds preserve an exact rational value internally. Decimal inputs therefore retain the exact value represented by their decimal text, while Rational inputs such as 1/3 are not rounded through Decimal precision before comparisons are made. The 2.0 assumption vocabulary covers a single real interval with numeric bounds. Integer, parity, complex-domain, relational (x > y), union, and general predicate assumptions are not represented by this class.

Members

atLeast(x: AssumptionValue, inclusive: boolean): AssumptionMethod

Creates an interval extending upward from x.

Parameters

NameTypeDescription
xAssumptionValueLower endpoint.
inclusivebooleanWhether a finite lower endpoint belongs to the interval.

Returns

Assumption — The interval [x, +∞) when inclusive, otherwise (x, +∞).

atMost(x: AssumptionValue, inclusive: boolean): AssumptionMethod

Creates an interval extending downward from x.

Parameters

NameTypeDescription
xAssumptionValueUpper endpoint.
inclusivebooleanWhether a finite upper endpoint belongs to the interval.

Returns

Assumption — The interval (-∞, x] when inclusive, otherwise (-∞, x).

Assumption(start: AssumptionValue, end: AssumptionValue, startInclusive: boolean, endInclusive: boolean): AssumptionConstructor

Creates a non-empty real interval.

remarks

Infinite endpoints are normalized to open bounds. A zero-width interval is valid only when both endpoints are inclusive, in which case it represents one exact value. Rational inputs retain their exact value even when their Decimal projection is necessarily finite precision.

throws

Error Thrown when a bound is NaN, the bounds are reversed, or the interval is empty.

Parameters

NameTypeDescription
startAssumptionValueLower numeric endpoint.
endAssumptionValueUpper numeric endpoint.
startInclusivebooleanInclude the lower endpoint when it is finite.
endInclusivebooleanInclude the upper endpoint when it is finite.

Returns

Assumption

contains(x: AssumptionValue): booleanMethod

Tests whether a numeric value belongs to this interval.

Parameters

NameTypeDescription
xAssumptionValueNumeric value to test.

Returns

boolean — true when x satisfies both interval bounds.

dataType: "ASSUMPTION"Property

Runtime tag used by Nerdamer's assumption type guard.

end: BoundProperty

Upper endpoint of the admissible interval.

Determines whether values constrained by this interval are equal to x.

remarks

Equality is proved only when both sides identify the same single value. It is disproved when the admissible values are disjoint. Overlapping ranges, including identical non-singleton ranges, return undefined because equality depends on the actual values chosen from those ranges.

Parameters

NameTypeDescription
xExpression | AssumptionAnother interval-constrained value or a numeric expression.

Returns

AssumptionComparison — true when equality is forced, false when inequality is forced, or undefined when the available information permits either outcome.

getSingletonValue(): Expression | undefinedMethod

Returns the exact value represented by a singleton interval.

Returns

Expression | undefined — A numeric Expression when this interval is a singleton, otherwise undefined.

intersect(x: Assumption): Assumption | undefinedMethod

Intersects this interval with another interval. Endpoint selection uses the exact finite representation retained by each interval, so repeated constraints do not lose rational precision while narrowing the range.

Parameters

NameTypeDescription
xAssumptionInterval to intersect with this one.

Returns

Assumption | undefined — The non-empty intersection, or undefined when the intervals are disjoint.

isAssumption(obj: unknown): objMethod

No description is available yet.

Parameters

NameTypeDescription
objunknown—

Returns

obj

isSingleton: booleanProperty

Whether the interval contains exactly one finite value.

overlaps(x: Assumption): booleanMethod

Tests whether this interval and x share at least one admissible value.

Parameters

NameTypeDescription
xAssumptionInterval to test for overlap.

Returns

boolean — true when the intersection is non-empty.

parse(expr: string): ParsedAssumptionMethod

Parses one numeric interval constraint such as x >= 0 or n < 10.

remarks

Whitespace is ignored. Variable names use the ASCII identifier form [A-Za-z_][A-Za-z0-9_]*. Supported operators are =, ==, >, >=, <, and <=. Bounds are Decimal-compatible numeric literals; inf, infinity, +inf, +infinity, -inf, and -infinity are also accepted. Expressions such as x > y, x = 1/2, and property predicates such as integer(x) are outside the string assumption grammar. Parser assertive calls may still provide already-evaluated Rational bounds directly.

throws

Error Thrown when the constraint has an invalid identifier, operator, or numeric bound.

Parameters

NameTypeDescription
exprstringConstraint to parse.

Returns

ParsedAssumption — The parsed symbol and its interval assumption.

sameInterval(x: Assumption): booleanMethod

Tests whether two objects describe the same interval constraint.

remarks

This is structural interval equality and is separate from eq: two different variables may have identical intervals without being known to have the same value.

Parameters

NameTypeDescription
xAssumptionInterval constraint to compare with this one.

Returns

boolean — true when both endpoints and their inclusivity are identical.

start: BoundProperty

Lower endpoint of the admissible interval.

toString(): stringMethod

Formats the interval using mathematical bracket notation.

Returns

string — A representation such as [0, 10) or (-Infinity, Infinity).