Version: dev

Expressions

Parsing, inspecting, substituting into, simplifying and evaluating expressions and equations.

OperationKindBindingsSummary
closed_function_namesfunctionJulia, TypeScript, Rust, GoReturn the v0.3.0 closed function set.
containsfunctionTypeScript, Python, Rust, GoCheck if an expression contains a specific variable
evaluatefunctionPython, Rust, GoEvaluate a scalar AST expression against a dict of float variable bindings.
evaluate_closed_functionfunctionJulia, Rust, GoDispatch a closed function call.
expandfunctionPython, GoPublic alias for expand_document using the spec’s spelling (esm-spec §9.6.4 rule 2).
free_variablesfunctionJulia, TypeScript, Python, Rust, GoExtract all free (unbound) variable names from an expression.
parse_equationfunctionJulia, TypeScript, Python, Rust, GoParse lhs = rhs into an Equation.
parse_expressionfunctionJulia, TypeScript, Python, Rust, GoParse a single expression string in the INFIX TEXT form into an AST expression — the inverse of to_ascii.
simplifyfunctionJulia, TypeScript, Python, Rust, GoPerform constant folding and algebraic simplification on an expression.
substitutefunctionJulia, TypeScript, Python, Rust, GoReplace every variable named in bindings with its replacement expression, throughout expr (including faq bodies, filter predicates, integral bounds and every other…
substitute_in_equationsfunctionJulia, TypeScript, GoApply substitutions across all equations in a model.
substitute_in_modelfunctionTypeScript, Python, Rust, GoApply substitution across an ENTIRE model, not just its equations.
substitute_in_model_with_contextfunctionRust, Gosubstitute_in_model with scoped reference resolution.
substitute_in_reaction_systemfunctionTypeScript, Python, Rust, GoApply substitution across all rate expressions in a reaction system.
substitute_in_reaction_system_with_contextfunctionRust, Gosubstitute_in_reaction_system with scoped reference resolution.
substitute_with_contextfunctionRust, GoSubstitute variables in an expression with scoped reference resolution (esm-spec §2.3.3).
exprtypePython, RustAn expression (esm-spec §4): a numeric literal (int or float), a variable or parameter reference (str), or an operator node (ExprNode) whose args are themselves…
expr_nodetypePython, GoA node in an expression tree.
closed_function_errorerrorJulia, TypeScript, Rust, GoRaised by the closed function registry when the spec contract is violated.
expression_parse_errorerrorJulia, TypeScript, Python, Rust, GoThrown when an expression string cannot be parsed by parse_expression or parse_equation.

All topics