import { type Equation, type Expr } from "./expr.js"; import { Rational } from "./rational.js"; import { Surd } from "./surd.js"; /** Variable assignment used by the substitution evaluator. */ export type Env = ReadonlyMap; export declare class UnboundVariable extends Error { constructor(name: string); } export declare class NonIntegerExponent extends Error { constructor(); } /** √v has no exact value in the engine's number domain: a NEGATIVE radicand * (complex — deferred) or a NESTED radical that escapes the surd field. A * non-perfect-square like √2 is no longer inexact — it's an exact Surd. */ export declare class InexactSqrt extends Error { constructor(); } /** Exact rational square root, or undefined when irrational/negative. */ export declare function sqrtRational(v: Rational): Rational | undefined; /** Exact rational nth root (n >= 2), or undefined when it is irrational — or, * for even n, when the radicand is negative (no real root). The sign is * carried through for odd n (∛(−8) = −2). Since v is normalized (gcd 1), it * is a perfect nth power iff |num| and den each are. */ export declare function nthRootRational(v: Rational, n: bigint): Rational | undefined; /** * Exact evaluation under a variable assignment, over the surd-closed exact * domain (`Surd`; a Rational is the degenerate element). Throws DivisionByZero * when a denominator vanishes, UnboundVariable for missing assignments, * NonIntegerExponent for non-integer exponents, and InexactSqrt where a root * has no exact value (negative radicand → complex; nested radical → out of the * surd field). These are the engine's UNDEFINED POINTS — never approximated. */ export declare function evalExpr(e: Expr, env: Env): Surd; /** The exact rational value of a constant expression, or undefined when it * holds a variable or hits an undefined/irrational point (a probe with no * variable bindings — never throws). */ export declare function constantRational(e: Expr): Rational | undefined; /** Exact literal for a rational value: an Integer, Neg(Integer), or Fraction. */ export declare function rationalToExpr(r: Rational): Expr; /** Exact-literal Expr for a Surd: the rational part plus each c·√n term, built * through the smart constructors so all structural invariants hold. */ export declare function exactToExpr(s: Surd): Expr; /** * Truth value of an equation or inequality under an assignment, or undefined * when either side is undefined there (division by zero / non-integer * exponent). The solution-set property tests skip undefined sample points. */ export declare function truthValue(eqn: Equation, env: Env): boolean | undefined; //# sourceMappingURL=eval.d.ts.map