Describes admissible real values as one exact interval.

Details

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 exact rational values or supported real algebraic expressions. Decimal projections of algebraic endpoints are for compatibility and display only. Each instance describes one real interval with exactly comparable endpoints. 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.

Details

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. Comparisons use exact endpoints, not their Decimal projections.

Errors

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

Parameters

NameTypeDescription
startAssumptionValueLower endpoint.
endAssumptionValueUpper 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.

Details

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.

getFiniteLowerBound(): Expression | undefinedMethod

Returns the exact finite lower bound, or undefined for an unbounded interval.

Returns

Expression | undefined

getFiniteUpperBound(): Expression | undefinedMethod

Returns the exact finite upper bound, or undefined for an unbounded interval.

Returns

Expression | undefined

getSingletonValue(): Expression | undefinedMethod

Returns the exact expression represented by a singleton interval.

Returns

Expression | undefined — An exact Expression when this interval is a singleton, otherwise undefined.

intersect(x: Assumption): Assumption | undefinedMethod

Intersects this interval with another interval. Endpoint selection preserves exact values; undecidable ordering is rejected.

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 — false only when the intervals are provably disjoint.

parse(expr: string): ParsedAssumptionMethod

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

Details

The shared parser reads the relationship without evaluating its operands. 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 and property predicates such as integer(x) are outside the string assumption grammar. Simple numeric fractions such as x = 1/2 retain exact rational endpoints. Integer powers are supported; fractional exponents are rejected. Parser assertive calls may still provide already-evaluated Rational bounds directly.

Errors

UnexpectedInputError 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.

Details

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).