Concepts and model
EXS separates expression infrastructure from domain semantics. The solver recognizes operators, converts operands into an atom type, and applies registered evaluation steps. The atom and operator implementations decide what the values and operations mean.
Core objects
- Atom
An atom is the value type produced while parsing an operand and consumed by operators. The default
snt::exs::Atomstores a numeric-or-Boolean variant. A custom atom can own strings, arrays, or application values.Solver<Atom, Settings>The solver owns an operator list and a step list, tokenizes an expression, and evaluates it into an atom. Constructing it without arguments installs the built-in atom, operators, and steps.
OperatorListRegisters operator implementations by operation type. Append order is the order in which the solver recognizes symbols while tokenizing, so overlapping symbols must be ordered explicitly.
StepListDefines the evaluation passes. Earlier steps run first and therefore control precedence. An operator is usable only when it is both registered and included in a matching step category.
- Settings
A settings object can accompany a solver. It is copied by the solver and passed to atom parsing and operator callbacks, allowing application data to participate without becoming part of the expression syntax.
CompositionGraphAn optional graph records operand, operator, and group nodes for an expression. It describes syntax and operation nesting; it does not evaluate a second time or add domain-specific meaning.
Evaluation model
Evaluation proceeds by scanning operands and operators, converting each
operand with the atom’s from_string function, then applying the configured
steps in order. A step may change an atom in place, consume child atoms, or
produce a grouped result. The final token must reduce to one atom.
PUQ, DIP, and other expression-based modules use this mechanism with their own atom and operator definitions. They do not reimplement tokenization or the step engine for each language.
Continue with Getting started, then use Solver usage and composition graphs for the detailed evaluation path.