Signatures in the WASM / JavaScript view are TypeScript. Where the JavaScript facade wraps an operation its form is listed first; the other calling forms are the raw wasm-bindgen exports.
Optimization
Local symbolic optimization finds critical points of an objective and classifies
them by second-order conditions. The layer is local and exact — it
finds and classifies critical / Lagrange / KKT points, deciding every
classification from exact minor signs (never numerically) and declining whenever
a sign is undecidable or the underlying system solver cannot close the
stationarity equations. These local operations do not claim a global optimum.
The separate global_optimum_on_semialgebraic operation handles its documented
CAD-backed polynomial semialgebraic domain.
Each function returns a structured outcome: a verdict of "points" or
"declined", a complete flag (true only when the critical-point enumeration was
certified exhaustive — typically a quadratic objective whose gradient system is
linear), and a list of points. Each point carries its coordinate assignment, the
introduced Lagrange / KKT multipliers (empty for the unconstrained case), and a
classification string: "local_minimum", "local_maximum", "saddle_point",
or "inconclusive".
Notes on the result shape: Python returns a dict with keys verdict (str),
complete (bool), and points (a list of dicts, each with assignment,
multipliers, and classification); WASM returns an OptimizationOutcome
object whose getters expose the same data.
unconstrained_critical_points#
Not exposed by the WASM / JavaScript bindings. Available as Context.unconstrained_critical_points in Python, UniffiSession.unconstrainedCriticalPoints in Kotlin, UniffiSession.unconstrainedCriticalPoints in Swift, api::solving::Session::unconstrained_critical_points in Rust.
The critical points of objective as the solutions of ∇f=0, each classified
by the definiteness of the Hessian (Sylvester's criterion on the leading principal
minors). A quadratic objective yields a complete outcome; a degenerate Hessian
(det H = 0) classifies as inconclusive.
classify_unconstrained#
Not exposed by the WASM / JavaScript bindings. Available as Context.classify_unconstrained in Python, UniffiSession.classifyUnconstrained in Kotlin, UniffiSession.classifyUnconstrained in Swift, api::solving::Session::classify_unconstrained in Rust.
Classify one given interior point — supplied as the parallel point_variables /
point_values lists — by Hessian definiteness, returning the verdict string.
lagrange_critical_points#
Not exposed by the WASM / JavaScript bindings. Available as Context.lagrange_critical_points in Python, UniffiSession.lagrangeCriticalPoints in Kotlin, UniffiSession.lagrangeCriticalPoints in Swift, api::solving::Session::lagrange_critical_points in Rust.
The equality-constrained critical points via Lagrange multipliers: stationarity of
L=f+∑iλigi together with each constraint = 0, classified by the bordered
Hessian. The solved multiplier values appear in each point's multipliers.
karush_kuhn_tucker_points#
Not exposed by the WASM / JavaScript bindings. Available as Context.karush_kuhn_tucker_points in Python, UniffiSession.karushKuhnTuckerPoints in Kotlin, UniffiSession.karushKuhnTuckerPoints in Swift, api::solving::Session::karush_kuhn_tucker_points in Rust.
The Karush–Kuhn–Tucker points found by active-set enumeration. Each inequality is
read as inequality≤0 and each equality as equality = 0. Only primal- and
dual-feasible candidates are kept; a candidate whose feasibility a sign cannot
settle is retained but classified inconclusive. The enumeration is bounded by a
documented cap on the number of inequalities, above which the layer declines.
Result accessors (WASM)#
On WASM the outcome and its points are objects with the following getters; on
Python the same data is returned as plain dicts.
points#
The list of CriticalPoint objects in an OptimizationOutcome (WASM).
Raw WebAssembly: OptimizationOutcome property
readonly points: CriticalPoint[]
The list of critical_point objects in an optimization_outcome (WASM).
classification#
Raw WebAssembly: CriticalPoint property
readonly classification: string
The verdict string of a critical point: "local_minimum", "local_maximum",
"saddle_point", or "inconclusive".
multiplier_variables#
Not exposed by the WASM / JavaScript bindings. Available as UniffiCriticalPoint.multiplierVariables in Kotlin, UniffiCriticalPoint.multiplierVariables in Swift, api::results::CriticalPoint::multiplier_variables in Rust.
The names of the introduced Lagrange / KKT multipliers at a constrained critical
point (empty for the unconstrained case).
multiplier_values#
Not exposed by the WASM / JavaScript bindings. Available as UniffiCriticalPoint.multiplierValues in Kotlin, UniffiCriticalPoint.multiplierValues in Swift, api::results::CriticalPoint::multiplier_values in Rust.
The solved values of those multipliers, in the same order as multiplier_variables.
Global optimization on semialgebraic sets#
global_optimum_on_semialgebraic#
Not exposed by the WASM / JavaScript bindings. Available as Context.global_optimum_on_semialgebraic in Python, UniffiSession.globalOptimumOnSemialgebraic in Kotlin, UniffiSession.globalOptimumOnSemialgebraic in Swift, api::solving::Session::global_optimum_on_semialgebraic in Rust.
context.global_optimum_on_semialgebraic(objective, constraints, variables: list[VariableLike], direction: str)
Global optimum of a polynomial objective over the semialgebraic feasible set
described by constraints (a Boolean combination of polynomial relations), with
direction either "minimize" or "maximize". Builds the objective-gradient-adapted
cylindrical algebraic decomposition, ranks the objective exactly over the feasible cell
sample points, and certifies the candidate by quantifier elimination
(∀x. feasible(x)→objective(x)⋛value). Returns the same
OptimizationOutcome shape (on Python a dict, on WASM an object): a "points" verdict
with one point and complete = true carries the attained global optimum; a "declined"
verdict reports an unbounded objective or an extremum that is approached but not attained.
This closes the global-optimum-on-semialgebraic-set problem; the returned point and value are
exact rationals (an irrational-algebraic optimum declines).
Example#
This family is not part of the recommended JavaScript facade in this release. Call it through the generated symi.raw layer, whose entries are listed with their wasm-bindgen signatures above, and read Migration for the ownership rules that apply there.
Additional API#
classifyUnconstrained#
Raw WebAssembly: Default context
classifyUnconstrained(
objective: Expression,
variables: string[],
point_variables: string[],
point_values: Expression[],
): string
Classify one given interior point — supplied as the parallel point_variables / point_values lists — by Hessian definiteness, returning the verdict string.
Calling forms
Raw WebAssembly: Explicit context: Context.classifyUnconstrained
classifyUnconstrained(
objective: Expression,
variables: string[],
point_variables: string[],
point_values: Expression[],
): string
globalOptimumOnSemialgebraic#
Raw WebAssembly: Default context
globalOptimumOnSemialgebraic(
objective: Expression,
constraints: Expression,
variables: string[],
direction: string,
): OptimizationOutcome
context.global_optimum_on_semialgebraic(objective, constraints, variables: list[VariableLike], direction: str)
Calling forms
Raw WebAssembly: Explicit context: Context.globalOptimumOnSemialgebraic
globalOptimumOnSemialgebraic(
objective: Expression,
constraints: Expression,
variables: string[],
direction: string,
): OptimizationOutcome
karushKuhnTuckerPoints#
Raw WebAssembly: Default context
karushKuhnTuckerPoints(
objective: Expression,
inequality_constraints: Expression[],
equality_constraints: Expression[],
variables: string[],
): OptimizationOutcome
The Karush–Kuhn–Tucker points found by active-set enumeration. Each inequality is read as inequality≤0 and each equality as equality = 0.
Calling forms
Raw WebAssembly: Explicit context: Context.karushKuhnTuckerPoints
karushKuhnTuckerPoints(
objective: Expression,
inequality_constraints: Expression[],
equality_constraints: Expression[],
variables: string[],
): OptimizationOutcome
lagrangeCriticalPoints#
Raw WebAssembly: Default context
lagrangeCriticalPoints(
objective: Expression,
constraints: Expression[],
variables: string[],
): OptimizationOutcome
The equality-constrained critical points via Lagrange multipliers: stationarity of L=f+∑iλigi together with each constraint = 0, classified by the bordered Hessian. The solved multiplier values appear in each point's multipliers.
Calling forms
Raw WebAssembly: Explicit context: Context.lagrangeCriticalPoints
lagrangeCriticalPoints(
objective: Expression,
constraints: Expression[],
variables: string[],
): OptimizationOutcome
unconstrainedCriticalPoints#
Raw WebAssembly: Default context
unconstrainedCriticalPoints(
objective: Expression,
variables: string[],
): OptimizationOutcome
The critical points of objective as the solutions of ∇f=0, each classified by the definiteness of the Hessian (Sylvester's criterion on the leading principal minors).
Calling forms
Raw WebAssembly: Explicit context: Context.unconstrainedCriticalPoints
unconstrainedCriticalPoints(
objective: Expression,
variables: string[],
): OptimizationOutcome
CriticalPoint#
CriticalPoint.multiplierValues#
Raw WebAssembly: CriticalPoint property
readonly multiplierValues: Expression[]
The solved values of those multipliers, in the same order as multiplier_variables.
CriticalPoint.multiplierVariables#
Raw WebAssembly: CriticalPoint property
readonly multiplierVariables: string[]
The names of the introduced Lagrange / KKT multipliers at a constrained critical point (empty for the unconstrained case).
CriticalPoint.values#
Raw WebAssembly: CriticalPoint property
readonly values: Expression[]
Getter on system_assignment: the assigned value expressions, aligned with variables.
CriticalPoint.variables#
Raw WebAssembly: CriticalPoint property
readonly variables: string[]
Getter on system_assignment: the unknown names, in order.
OptimizationOutcome#
OptimizationOutcome.complete#
Raw WebAssembly: OptimizationOutcome property
readonly complete: boolean
Getter on polynomial_system_solution: whether the solver certified it found every solution.
OptimizationOutcome.verdict#
Raw WebAssembly: OptimizationOutcome property
The optimization result classification.