UNPKG

@holgerengels/compute-engine

Version:

Symbolic computing and numeric evaluations for JavaScript and Node.js

27 lines (26 loc) 954 B
/* 0.26.0-alpha2 */ import { AssumeResult, BoxedExpression } from './public'; /** * Add an assumption, in the form of a predicate, for example: * * - `x = 5` * - `x ∈ ℕ` * - `x > 3` * - `x + y = 5` * * Assumptions that represent a symbol definition (equality to an expression, * membership to a type, >0, <=0, etc...) are stored directly in the current * scope's symbols dictionary, and an entry for the symbol is created if * necessary. * * Predicates that involve multiple symbols are simplified (for example * `x + y = 5` becomes `x + y - 5 = 0`), then stored in the `assumptions` * record of the current context. * * New assumptions can 'refine' previous assumptions, if they don't contradict * previous assumptions. * * To set new assumptions that contradict previous ones, you must first * `forget` about any symbols in the new assumption. * */ export declare function assume(proposition: BoxedExpression): AssumeResult;