{"modulePath":"github.com/Open-MBEE/OpenSysML","version":"v0.13.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package solve\n\nPackage solve translates the conditions a constraint, requirement or satisfaction assertion states into a solver-independent term IR and writes that IR as an SMT-LIB2 script.\n\nIt also runs an external solver over that script — z3 or cvc5, found on PATH or named by OPENSYSML\\_SMT — as a process speaking SMT-LIB2 on standard input, so no library is linked in and releases stay pure Go. The verdicts sat, unsat and unknown stay distinct: a timeout or arithmetic the solver gave up on is unknown, and a solver that crashes, is absent, or replies unusably is a typed error rather than a verdict.\n\nThe runtime evaluator remains the normative semantics; SysML v2 defines no solving semantics, so this is an advertised extension, not a conformance claim.\n\nThe capability set — satisfiability, unsat-core conflict explanation, value synthesis and objective optimization over an SMT solver — follows the design of OpenMBEE's HMF ConstraintSolverService (Apache 2.0); see README Acknowledgements.\n\n### Solver compatibility {#hdr-Solver_compatibility}\n\nOPENSYSML\\_SMT names any executable that speaks SMT-LIB2 on standard input, so what a backend must support is stated rather than assumed of z3.\n\nLogic selection emits the narrowest logic of the SMT-LIB 2.6 logic list ([https://smt-lib.org/logics.shtml](https://smt-lib.org/logics.shtml)) that covers what a query actually uses: QF\\_UF for constants alone, QF\\_LIA/QF\\_NIA over Int, QF\\_LRA/QF\\_NRA over Real, and AUFLIRA/AUFNIRA for a query over both, the list defining no quantifier-free mixed logic to narrow to. Truncating integer division by a literal divisor stays in the linear logic — \\`div\\` and \\`mod\\` are the Ints theory's, which those logics include — and a variable divisor selects the nonlinear one it really needs. Datatypes and strings have no logic in the list, so a query using either sets the non-standard NonStandardLogic (\"ALL\"), which both verified backends accept; the script says so in a comment, and LogicChoice.Standard reports it. No logic is widened to dodge a hard case.\n\nWhat a backend is required to support is a Capability, and a Solver is probed once per executable (cached, one small script per form of the feature the writer emits — QF\\_NIA and QF\\_NRA for nonlinear, AUFLIRA and AUFNIRA for mixed — and only for the capabilities a query and operation actually need) or declared capable by the caller (Solver.Declared). A capability the backend rejects — an \\`(error …)\\` reply or \\`unsupported\\` — makes the request an UnsupportedCapabilityError naming the backend, the feature and the operation, refused before any query is run: no silent degrade and no fabricated verdict. A check the backend neither answered nor rejected settles nothing, so the query proceeds and its own verdict or SolverProcessError is reported.\n\nThree answers to a check are told apart, so a backend is never blamed for the wrong thing:\n\n  - \\`(error …)\\`, \\`unsupported\\`, or a defined reply that contradicts the check — the backend refuses the capability, reported as UnsupportedCapabilityError.\n  - \\`unknown\\`, no reply, a closed pipe or the check's deadline — nothing was established, so the query runs and answers for itself.\n  - a reply SMT-LIB does not define at all, such as \\`maybe\\` — the executable is not answering as a solver, reported as SolverProcessError rather than as a missing feature, which is also how the dialogue itself reports one.\n\nProbed against z3 4.8.12 and cvc5 1.3.4: both support models, unsat cores, incremental checks, datatypes, strings, div/mod, nonlinear and mixed arithmetic and the non-standard logic. cvc5 rejects \\`(maximize …)\\` as a parse error and answers \\`unsupported\\` to \\`:opt.priority\\`, both z3 extensions, so objective optimization is z3-only. internal/exec/solve's portability harness (portability\\_test.go, TestPortability) runs one query per feature against whatever OPENSYSML\\_SMT names and reports each as pass, refuse or fail, a rejected script being ours to fix in the writer.\n\n### Conflict explanation {#hdr-Conflict_explanation}\n\nExplain answers an unsat verdict with the assertions that conflict. The script it writes (CoreScript) names each assertion, turns unsat cores on and asks for the core once the verdict is unsat; labels are the assertion's position, so a core reads back to the Assertion, and its Provenance, that produced it. Every role can appear in a core, a declared domain (RoleDomain) or a well-definedness guard (RoleDefined) included, and an inherited condition names the supertype that declared it.\n\nMinimality is established, not assumed. A solver's core is unsatisfiable but need not be irreducible, so reduction drops one member at a time, each round a fresh solver process, and Core.Minimal says every remaining member was shown to be needed: dropping any one left the rest satisfiable. Reduction is bounded, in the spirit of the runtime's step budgets, by DefaultMaxCoreMembers members and DefaultCoreBudget of wall time (OPENSYSML\\_SMT\\_CORE\\_BUDGET overrides it); a core too large, out of budget, or whose round the solver did not decide is reported as it stands with Minimal false and Core.Note saying why. A solver that refuses cores, names an assertion the query did not assert, answers unreadably or reports an empty core is a CoreError, never an empty or invented core.\n\nConditions come from the evaluator's own collection (runtime.Context.ConditionsOf), keeping its order and its distinctions: \\`require\\` versus \\`assume\\`, negation, and a body meaning the conjunction of its conditions.\n\n### Violation queries, and floating point {#hdr-Violation_queries__and_floating_point}\n\nConstraintViolation, RequirementViolation and SatisfactionViolation translate the same conditions the other way: the query's models are the assignments violating the element's claim — the conjunction of its required conditions, or its denial for \\`assert not\\` — asserted as one negation in role RoleViolated, its assumptions kept as hypotheses. Unsatisfiable then proves the claim holds for every assignment of the free features, within their declared sorts and domains and the values fixed as pins.\n\nA violation query hoists no definedness side condition: the evaluator stops at the first failing required condition, so a guard hoisted from a later one could exclude real counterexamples and yield a false proof. A computed divisor therefore refuses translation in violation mode, as it does under a branch or a negation. The evaluation path the translator tracks (see Reads the evaluator never reaches) could guard such a divisor under the condition the evaluator divides on; that is deliberately not done: a proof over the assignments where the division is defined would still be a \\`holds\\` about assignments the evaluator answers nothing about, and the conservative refusal is kept until that contract is settled.\n\nThe evaluator computes real arithmetic in float64 while the encoding is exact: an exact-real unsat does not by itself decide the evaluator's arithmetic. Query.RoundingSound re-encodes the query so its models over-approximate every float64 evaluation — one fresh Real variable per rounding site, bounded by the doubles its exact value lies between, each guarded by the conditions under which the evaluator computes it — and Solve asks it as a recheck after an unsat over a rounded query. A second unsat sets Result.RoundingProved: the evaluator's arithmetic satisfies the conditions nowhere either. Over-approximating evaluation is the sound direction; the recheck's own witness is never replayed. The argument needs no case for a non-finite site: the evaluator refuses a non-finite Real result, so an assignment whose evaluation overflows yields no verdict — neither a counterexample nor a confirmation — and every evaluation yielding a verdict computes only finite sites.\n\n### Differential agreement gate {#hdr-Differential_agreement_gate}\n\nThe translation is evidence-backed rather than asserted: for an element whose conditions translate, and for a concrete assignment of the features they read, the gate (differential\\_test.go and the corpus and randomized gates beside it) requires the query conjoined with that assignment to be sat exactly when the evaluator says the conditions hold, and unsat exactly when it says they do not. Every other outcome is classified, never averaged away: unknown is recorded, a typed evaluator error is no verdict, and ErrDivisionByZero is required to correspond to the guarded query being unsat for that assignment.\n\nIt runs over the runtime conformance corpus, the bundled standard library, the OMG training corpus and deterministic randomized models, and reports how much of each it reached — translated, refused, agreed, disagreed, unknown — so coverage drift is reviewable. What it proves is that the translation is faithful to the evaluator on the cases it covered; it is not a conformance claim, and the evaluator remains normative where the two ever differ.\n\n### Translatable subset {#hdr-Translatable_subset}\n\nA condition is translatable when every part of it is:\n\n  - Boolean operators: \\`not\\`, \\`and\\`, \\`\u0026\\`, \\`or\\`, \\`|\\`, \\`xor\\`, \\`implies\\`, and the conditional expression \\`if c ? a else b\\`.\n  - Equality \\`==\\` and \\`!=\\` between two values of the same sort.\n  - Comparisons \\`\\\u003c\\`, \\`\\\u003c=\\`, \\`\u003e\\`, \\`\u003e=\\` between numbers of the same dimension.\n  - Arithmetic \\`+\\`, \\`-\\`, \\`\\*\\`, unary \\`-\\` and \\`+\\`.\n  - Division \\`/\\` and remainder \\`%\\`. Integer division truncates toward zero as the evaluator does, encoded as ite(a \u003e= 0, div(a, b), -div(-a, b)), and the remainder as a - b\\*tdiv(a, b), which takes the dividend's sign. A literal divisor keeps this linear; a variable divisor sets Query.Nonlinear, so unknown is an expected verdict rather than a surprise.\n  - Division by zero, which SMT-LIB leaves underspecified while the evaluator refuses it: a literal zero divisor refuses translation, and any other divisor, integer or real, is asserted non-zero as a RoleDefined side condition. That assertion constrains the whole query, so it is only made where the division is always evaluated and read unnegated; a computed divisor under \\`not\\`, \\`or\\`, \\`xor\\`, \\`implies\\`, a conditional branch or a denied element refuses instead, since the evaluator may never divide there.\n  - Literals: boolean, integer, real, string.\n  - Quantity expressions (\\`450.0 \\[km/h]\\`), normalized to the base units their unit reduces to through semantics.UnitTermOf — magnitudes are exact rationals, so a scale factor introduces no rounding.\n  - References to scalar-valued features, resolved through the same names the evaluator resolves: Boolean, String, Natural (declared non-negative), Integer, Rational, Real and Number features, features typed by a quantity value type, enumeration-typed features and variation points.\n  - Feature chains that ground in such a feature (\\`lander.verticalSpeed\\`).\n  - Enumeration literals and variants, as constructors of a finite datatype sort declared per enumeration definition or variation point. A variation point whose every variant declares a value compares under \\`==\\` and \\`!=\\` by the value its selection stands for (KerML BaseFunctions::'==' is value equality for data values), so two variants declaring one value are equal; two variants named outright compare as the choice itself.\n  - \\`P-\u003eforAll { in ref w; w == V }\\` and \\`P-\u003eexists { … }\\` over a variation point P holding at least one object, as the selection \\`P == V\\` (\\`P != V\\` for \\`w != V\\`): a configuration holds only the variant P selects (SysML v2.1 §8.3.6, §7.6.7), so every value of P is that variant. A point that may hold no object, or a body comparing the iterate with anything but a value of P's sort, refuses with that reason.\n\nA variable stands for the value a feature may take, constrained only by its sort: declared values are not asserted, so a query asks what the conditions permit rather than what one object holds. The one exception is a derived declared value, an expression written over other features of the same element (\\`attribute volume : VolumeValue = height \\* width \\* length;\\`): it is asserted as the defining equation of its variable, since the model states not a value but how the value follows from the others (see \"Derived declared values\" under Value synthesis). A value bound with \\`=\\` is fixed as declared (Pin.Bound); a \\`default\\` or \\`:=\\` value stays unasserted.\n\n### Reads the evaluator never reaches {#hdr-Reads_the_evaluator_never_reaches}\n\nThe evaluator evaluates left to right and stops early: \\`and\\`, \\`\u0026\\` and \\`implies\\` read their right operand only where the left one holds, \\`or\\` and \\`|\\` only where it fails (runtime.shortCircuit decides \\`\u0026\\` and \\`|\\` exactly as \\`and\\` and \\`or\\`); \\`xor\\`, \\`not\\`, \\`==\\` and \\`!=\\` read every operand; a conditional \\`if c ? a else b\\` reads the branch c selects; the conditions of an element are evaluated in order and a failing required condition stops the rest, an assumption stopping nothing. The translator mirrors this as one mechanism: every reference is translated under the path condition the evaluator reaches it on, and Var.Reached records, per variable, the disjunction of those conditions — nil where some reference reads it on every path. The encoding of the connectives is unchanged (they are total), so Reached is the only thing the path adds; it is the same path condition rounding.go guards its sites by.\n\nReached is what makes a declared value that does not evaluate — a default dividing by zero, or one reading a feature with no value — answerable. Such a feature is an Unfixed with a non-nil Err, and it is never left free: an assignment reaching the read has no value for the feature, so a model choosing one would be a verdict the evaluator never gives. UnfixedRead applies the order instead:\n\n  - read on every path (Reached nil), the query is refused with the read failure: \\`bad \u003e 0.0 or true\\` and \\`true xor bad \u003e 0.0\\` are undecided, as the evaluator fails on them;\n  - read under a condition, the query asserts that condition false as a RoleDefined guard ahead of its conditions and records the read in Query.Unreadable, so its models are the assignments the evaluator answers about without reading the feature; Query.Free leaves the variable out.\n\nWhat a verdict then means: a model of the guarded query is an assignment the evaluator confirms (satisfiable) or refutes (a violation query's counterexample) — \\`free \u003e 0.0 or bad \u003e 0.0\\` is satisfied at free = 0.5, and \\`free \u003e 0.0 and bad \u003e 0.0\\` is violated at free = 0.0 — since the guard is exactly the condition under which the evaluator never reaches the read. An unsat, however, only speaks for the guarded assignments; Query.Reached is the query whose models are the assignments reaching some unreadable feature — the same domains, pins and assumptions, requiring the disjunction of the reads' conditions, each with the definedness guards of the operations the evaluator performs before reaching it (Var.Preceding). A guard hoisted from an operation after the read — a later required condition's divisor — constrains no assignment reaching it: the evaluator fails at the read and never performs the operation, so imposing the guard could hide the assignment and certify a false proof. Reached unsat proves no assignment reaches the read, and the unsat is the evaluator's answer on every assignment: \\`true or bad \u003e 0.0\\` holds. Reached sat witnesses an assignment on which the evaluator reaches no verdict, and the question stays undecided with Query.ReachedError naming the feature: \\`free \u003e 0.0 or bad \u003e 0.0\\` is not proved to hold, and \\`free \u003e 0.0 and bad \u003e 0.0\\` is not proved unsatisfiable, since at free \\\u003c= 0.0 and free \u003e 0.0 respectively the evaluator reads bad. A verdict is thus never one the evaluator would contradict: decided assignments are decided as it decides them, and a universal claim is made only where it reaches every assignment.\n\nA feature a chain reaches (\\`inner.dependent\\`) is read the same way. ChainPins reads it where the evaluator reads it, through the object the chain walks: the value it holds is a Pin; a feature holding nothing stays free, as a direct one does; a declared value that does not evaluate — which the runtime marks ErrFeatureValueMaterialization, whatever its cause, a missing value of its own dependency included — is an Unfixed naming the chain variable, for UnfixedRead to refuse or guard by the same Reached. So \\`false or inner.dependent \u003e 0.0\\` is undecided, not satisfied by a value the solver chose for inner.dependent, and \\`true or inner.dependent \u003e 0.0\\` holds.\n\nThe differential gate checks this per assignment: a read on every path must leave the evaluator without a verdict, an assignment the guard excludes must be one on which the evaluator fails reading the feature, and the guarded query must agree with the evaluator on every admitted assignment. Its randomized generator declares such a default as often as not, on the case itself and on a nested part its conditions read through a chain.\n\n### Value synthesis {#hdr-Value_synthesis}\n\nTranslateWith (and ConstraintWith, RequirementWith, SatisfactionWith) takes a partial assignment: Pins fixing some features to the values the model already fixes, the rest left free for the solver to choose. A pin is read where the evaluator reads it — Fixed and FixedFor go through the runtime's objects, feature values and declared defaults — and carries its provenance: held by an object (PinHeld), declared by the model (PinDeclared) or chosen by the caller (PinChosen). Passing no pin translates exactly as before, so a query with no partial assignment is the same script it always was.\n\nA pin becomes an ordinary equality assertion in role RolePinned, asserted before the conditions and named in Query.Pinned with its assertion index, so it can appear in an unsat core like any other assertion: unsat under pins means no values exist consistent with what is already fixed, and the core says which fixed values conflict. Values are converted through the same machinery the translator uses — a quantity normalized to base units as an exact rational, an enumeration literal or variant as the datatype constructor the writer declares — and a value the subset cannot represent, or one whose dimension does not match its feature, is a PinError wrapping ErrNotPinnable, never a silent drop. Features read by the conditions but not readable as a value are reported as Unread rather than being fixed to something.\n\n### Derived declared values {#hdr-Derived_declared_values}\n\nA declared value that is an expression over other features of the element (\\`attribute volume : VolumeValue = height \\* width \\* length;\\`, with \\`height\\`, \\`width\\` and \\`length\\` features of the same definition) is a Pin carrying the expression (Pin.Derived) rather than a value: Fixed reads the declaration before reading the object, since reading a lazily held value materializes it. The translator asserts the equation \\`volume == height \\* width \\* length\\` in role RoleDerived, translated in the declaration's scope through the same expression translation the conditions use (so a quantity is scaled to base units, and a product of two variables marks the query nonlinear), with the declaration's file:line:col as provenance so an unsat core can name it; the query lists it in Query.Derived. The equations are stated before the fixed values, since an equation reads features no condition may have read yet. The variable stays in Free(): the solver still chooses its value, by the equation, and a witness reports it alongside the operands it follows from.\n\nThe rule is scoped so that %check's answers over literal values do not move: an expression over no feature of the element (\\`1.0 + 2.0\\`) is a value as before, pinned where it evaluates; so is one reading anything but the element's own features and literals — a chain (\\`inner.x + 1.0\\`), a qualified or imported name (\\`test::scale \\* r\\`) — since the query fixes no value of what it names and an equation would leave that to the solver; a value the object has materialized (fv.Materialized — read already, or written) is held by the object and pinned as held, so an object's recorded volume is what it recorded, not what its dimensions now give; a value read through a chain from another object (\\`crate.volume\\` from a holder) is the value that object derives, since the equation is over the held object's features, not the subject's — one it cannot derive is an Unfixed, guarded or refused as any failed read. The equation stands in only for a value the evaluator could not derive for want of a value (ErrNoValue) or derived without failing: one it failed to derive from values it had (\\`1.0 / x\\` with x fixed to zero) is unreadable, guarded by Reached or refused, as any failed read. It is read where the evaluator reads the variable — translated under its Reached, where a computed divisor refuses to hoist its guard exactly as one in a short-circuited operand does, and asserted as Reached ⇒ equation — so a read the evaluator skips never constrains the query. An equation the term language does not carry (a function outside the subset, or a division under a conditional read) falls back: the value the evaluator derives is pinned where there is one, and where there is none the read is guarded by Reached or refused, exactly as a failed read is; a derived value no condition reads is Unread like any pin.\n\nResult.Model is one witness, not a canonical answer: a satisfiable query usually has many models and the solver may return any of them. Values are rendered in OpenSysML's terms where the sort allows (qualified feature names, declared units, enumeration and variant names) and flagged as the solver wrote them where it does not.\n\n### Variant configuration {#hdr-Variant_configuration}\n\nA variation point translates as a finite datatype sort (Sort.Variation), so Query.Variations are its variation variables. Query.FixValue chooses a variant (PinChosen), which Solve then checks like any other fixed value, and with none chosen Solve's model is a consistent selection. Configurations enumerates consistent selections: one fresh check-sat per solution, each asserting the negation of the complete previous assignment, built from the solver's own terms rather than from rendered text. Every variation variable is assigned in every solution, nested variation points and constrained variants included, since they are variables of the same query as any other condition.\n\nThe enumeration is bounded, in the spirit of the runtime's step budgets, by DefaultMaxConfigurations solutions (OPENSYSML\\_SMT\\_MAX\\_CONFIGURATIONS overrides it). Result.Truncated says the enumeration was cut short and why: AtBound for the bound, Undecided for a solver that stopped deciding, with TimedOut when the run's deadline was what stopped it — a deadline reports the solutions already found rather than discarding them. Results are exhaustive only when a final check-sat answered unsat; nothing implies exhaustiveness that was not shown. A query reading no variation point is a NoVariationsError wrapping ErrNoVariations, not an empty enumeration.\n\nKnown limitations: only variation points in the translatable subset are configured, so a variation whose variants carry collection-valued or otherwise untranslatable conditions refuses with ErrNotTranslatable; variants are configured as values of a variation point, not as objects, so nothing is materialized and features a variant would only have once bound are not constrained; and the enumeration order is the solver's, not a defined one.\n\n### Objective optimization {#hdr-Objective_optimization}\n\nAnalysis and AnalysisWith translate an \\`analysis def\\` as an optimization query: what its conditions permit, and the objectives to improve within that. Solver.Optimize then asks a backend for each objective's optimum.\n\nSysML v2 states no direction, value or solving semantics for \\`objective\\`, so this layer states the contract it reads (an OpenSysML extension, not a conformance claim):\n\n  - Direction comes from the trade-study definition the objective is typed by: TradeStudies::MinimizeObjective or MaximizeObjective, specializations included. An objective typed by neither refuses with ErrNotOptimizable.\n  - The value to improve is the expression the objective's redefinition of the library's \\`eval\\` calculation returns — \\`objective o : MinimizeObjective { subject :\u003e\u003e selectedAlternative; in calc :\u003e\u003e eval { expression } }\\` — which is the library's own extension point: it derives \\`best\\` as \\`eval\\` over the alternatives. An objective giving the bound \\`best\\` a value of its own instead (\\`attribute :\u003e\u003e best = expression;\\`) is a validation error, and refuses here with ErrNotOptimizable pointing at the \\`eval\\` spelling rather than being read. A value bound directly to the objective is read too, where a model can write one.\n  - What is feasible is the case's own conditions (CaseConditionsOf: \\`require\\`, \\`assume\\`, \\`assert\\`, \\`inv\\`, inherited ones included) together with the conditions each objective states: its own body's, and the ones it inherits from the model's own objective definitions, read where they are inherited. Only the trade-study library's own conditions are left out, being about choosing among alternatives rather than about which values are feasible. A condition an inherited definition states over \\`best\\` bounds the value improved, since the objective's \\`best\\` is asserted equal to what its \\`eval\\` returns, as the library derives it (RoleDefined). A case stating no condition is legitimately unbounded, not refused.\n  - Objectives, values and conditions are read through the runtime's own surfaces (runtime.Context.ObjectivesOf), so what is optimized is what the evaluator would evaluate; no declaration is re-parsed and no AST mutated.\n\nThe objective term must be numeric and linear: an optimizer improves a linear objective, so a product or quotient of two computed values refuses with ErrNotOptimizable rather than being sent and misread. Divisor guards therefore sit in the conditions, where a computed divisor is asserted non-zero as usual.\n\n### Multiple objectives, and backend requirements {#hdr-Multiple_objectives__and_backend_requirements}\n\nSeveral objectives are optimized lexicographically in declaration order: each within what the ones before it already settled. The script says so itself with \\`(set-option :opt.priority lex)\\` rather than relying on a backend default — z3's \\`box\\` mode reports each objective's optimum separately and returns a model attaining only one of them, which would make \"the assignments achieving the optimum\" untrue.\n\n\\`(minimize e)\\`/\\`(maximize e)\\`, \\`(get-objectives)\\` and \\`:opt.priority\\` are solver extensions rather than SMT-LIB2; cvc5 implements none of them. Solver.Optimize settles them through the capability model below before sending a query — CapOptimization and CapOptimizationPriority, probed once per backend and cached — and reports a backend without them as NoOptimizationError, which wraps both ErrNoOptimization and the ErrUnsupportedCapability refusal it was settled by. Nothing is ever degraded to a plain check-sat and presented as an optimum.\n\n### What an optimum is, and is not {#hdr-What_an_optimum_is__and_is_not}\n\nOptimum.Status keeps the cases apart, and no case fabricates a number:\n\n  - OptimumAttained: the value reported is the optimum and an assignment attains it. Both are checked here rather than taken on the backend's word: the objective's value in the reported model is read back, and a further check asks whether any assignment does lexicographically better — better in an earlier objective, or equal there and better in a later one. Unsat is what makes the answer an optimum.\n  - OptimumUnbounded: the conditions permit arbitrarily better values (\\`oo\\`).\n  - OptimumBounded: the objective approaches a bound no assignment attains, as a strict inequality over the reals does. Backends report this as an infinitesimal (\\`(+ 10.5 (\\* (- 1.0) epsilon))\\`) or an interval; the bound is reported as a bound, never as an attained value.\n  - OptimumUnverified: the backend reported a value a better feasible value refutes. z3 4.8.12 does this for open real suprema — maximizing x under x \\\u003c 10.5 reports 9.5 — which is why every optimum is verified rather than trusted.\n  - OptimumUndecided: verification did not decide, or the answer was no number.\n\nOptimum.Feasible is always a value the reported assignment attains: a witness the conditions permit, not an optimum. A solver answering sat but refusing to report its objectives readably is an OptimumError wrapping ErrNoOptimum and ErrSolverProcess; unsat and unknown stay the verdicts they are, with no optima invented for them, and a query stating no objective is a NoObjectiveError wrapping ErrNoObjective rather than a satisfiability check.\n\n### Deliberately out of subset {#hdr-Deliberately_out_of_subset}\n\nEverything else refuses with ErrNotTranslatable, and one refused conjunct fails the whole query, so no partial script exists:\n\n  - Collections and quantifiers: sequences, sets, \\`-\u003eselect\\`, \\`-\u003ecollect\\`, \\`-\u003esize\\`, indexing \\`#(i)\\`, ranges \\`a..b\\`, collection-valued features, and \\`-\u003eforAll\\`/\\`-\u003eexists\\` in any form but the variation-point selection above. Bounded expansion is not implemented.\n  - Invocations of any kind, calc usages included: a calc body may be iterative or read state, and constant folding it is the evaluator's job.\n  - Euclidean \\`div\\`/\\`mod\\` themselves, as SMT-LIB defines them: only the evaluator's truncating semantics are encoded.\n  - Real remainder \\`%\\`, which the evaluator answers by floating-point remainder.\n  - \\`\\*\\*\\` and \\`^\\`: exponentiation is outside linear and polynomial arithmetic as encoded here.\n  - Classification and metadata operators: \\`hastype\\`, \\`istype\\`, \\`@\\`, \\`@@\\`, \\`as\\`, \\`meta\\`, \\`all\\`, \\`===\\`, \\`!==\\`, \\`??\\`, \\`~\\`, and \\`null\\`.\n  - Complex numbers, string operations other than equality, and features whose type determines no scalar sort.\n  - Comparing or adding magnitudes of different dimensions, which the evaluator reports as incommensurable units.\n  - Unresolved names and feature chains that ground in nothing.\n\n## Constants\n\n```go\nconst (\n\t// NoteUncovered marks an object-holding feature whose objects' own\n\t// assertions the query does not state.\n\tNoteUncovered = \"uncovered\"\n\t// NoteAssumedOne marks a feature read as one value or one object while only\n\t// the default `0..*` governs it.\n\tNoteAssumedOne = \"assumed_one\"\n)\n```\nNote kinds, named the same on every surface that reports a verdict.\n\n```go\nconst CoreBudgetEnv = \"OPENSYSML_SMT_CORE_BUDGET\"\n```\nCoreBudgetEnv names the environment variable that overrides how long a core may be shrunk for, as a Go duration (\"5s\", \"500ms\").\n\n```go\nconst DefaultCoreBudget = 30 * time.Second\n```\nDefaultCoreBudget is how long reduction is given in total, in the spirit of the runtime's step budgets: past it the solver's own core is reported as it came, said to be not necessarily minimal.\n\n```go\nconst DefaultMaxConfigurations = 32\n```\nDefaultMaxConfigurations bounds how many configurations one enumeration reports. The combinations grow as the product of the variants of every variation point read, so the bound is what stops a runaway enumeration; results stopped by it are reported as truncated rather than as all there are.\n\n```go\nconst DefaultMaxCoreMembers = 64\n```\nDefaultMaxCoreMembers is the largest core reduction is attempted over, since each dropped candidate costs a solver call.\n\n```go\nconst DefaultTimeout = 10 * time.Second\n```\nDefaultTimeout is how long a solver is given to answer one query before the verdict becomes \\`unknown\\`, in the spirit of the runtime's step budgets.\n\n```go\nconst MaxConfigurationsEnv = \"OPENSYSML_SMT_MAX_CONFIGURATIONS\"\n```\nMaxConfigurationsEnv names the environment variable that overrides how many configurations one enumeration reports.\n\n```go\nconst NonStandardLogic = \"ALL\"\n```\nNonStandardLogic is the logic a script sets when no SMT-LIB logic covers what it uses. The SMT-LIB 2.6 logic list names no logic with algebraic datatypes or with strings, so a query using either sets this, which z3 and cvc5 accept.\n\n```go\nconst ProbeTimeout = 10 * time.Second\n```\nProbeTimeout is how long one capability check is given. The checks are tiny, so a backend that does not answer in this long is refusing rather than working.\n\n```go\nconst SolverEnv = \"OPENSYSML_SMT\"\n```\nSolverEnv names the environment variable that overrides solver discovery with the path of an executable speaking SMT-LIB2 on standard input.\n\n```go\nconst TimeoutEnv = \"OPENSYSML_SMT_TIMEOUT\"\n```\nTimeoutEnv names the environment variable that overrides how long a solver is given, as a Go duration (\"5s\", \"500ms\").\n\n## Variables\n\n```go\nvar (\n\tBool   = Sort{Kind: SortBool, Name: \"Bool\"}\n\tInt    = Sort{Kind: SortInt, Name: \"Int\"}\n\tReal   = Sort{Kind: SortReal, Name: \"Real\"}\n\tString = Sort{Kind: SortString, Name: \"String\"}\n)\n```\nThe scalar sorts, which every query may use without declaring them.\n\n```go\nvar AllCapabilities = []Capability{\n\tCapModels, CapUnsatCores, CapIncremental, CapDatatypes, CapStrings,\n\tCapIntegerDivision, CapNonlinearArith, CapMixedArith, CapNonStandardLogic,\n\tCapOptimization, CapOptimizationPriority,\n}\n```\nAllCapabilities are every capability, in declaration order: what a probe reports on and what a compatibility table lists.\n\n```go\nvar ErrNoCore = errors.New(\"the SMT solver did not report an unsat core\")\n```\nErrNoCore is returned when a solver answered unsat but would not report which assertions conflict, or named assertions the query never asserted. No core is invented in its place.\n\n```go\nvar ErrNoObjective = errors.New(\"states no objective\")\n```\nErrNoObjective is returned for an analysis case that states no objective, so there is nothing to optimize: what it permits is still a satisfiability question, which checking it plainly answers.\n\n```go\nvar ErrNoOptimization = errors.New(\"the SMT solver does not implement optimization\")\n```\nErrNoOptimization is returned when the solver found does not implement optimization. \\`(maximize …)\\` is a z3 extension rather than SMT-LIB, so this is reported rather than degraded to a plain satisfiability check.\n\n```go\nvar ErrNoOptimum = errors.New(\"the SMT solver did not report the optimum\")\n```\nErrNoOptimum is returned when a solver answered sat but did not report the optimum readably. No optimum is invented in its place.\n\n```go\nvar ErrNoSolver = errors.New(\"no SMT solver found\")\n```\nErrNoSolver is returned when no SMT solver could be found to run a query. Solving is optional, so its absence is reported rather than passed over.\n\n```go\nvar ErrNoVariations = errors.New(\"no variation point is read\")\n```\nErrNoVariations is returned for a query whose conditions read no variation point, so there is no configuration to check or enumerate: the element may still be satisfiable, which is what solving it plainly answers.\n\n```go\nvar ErrNotDeclared = errors.New(\"the query does not declare it\")\n```\nErrNotDeclared is returned for an enumeration over a variable the query does not declare, which no model of it assigns.\n\n```go\nvar ErrNotOptimizable = errors.New(\"not optimizable\")\n```\nErrNotOptimizable is returned for an objective that cannot be optimized as written: it states no direction, no value, or a value an optimizer cannot improve. It is a refusal about the objective rather than about the subset a condition is translated in.\n\n```go\nvar ErrNotPinnable = errors.New(\"value cannot be fixed for solving\")\n```\nErrNotPinnable is returned for a value that cannot be fixed in a query: one the term language has no literal for, or one whose type or dimension does not match the variable it would fix. A pin is never dropped silently, since a query missing one would answer about values the model does not hold.\n\n```go\nvar ErrNotTranslatable = errors.New(\"not translatable for solving\")\n```\nErrNotTranslatable is returned when a condition uses a construct outside the translatable subset. A query that cannot encode one conjunct fails as a whole: a partial script would answer sat or unsat about conditions it does not hold.\n\n```go\nvar ErrNothingAsserted = errors.New(\"asserts nothing about its objects\")\n```\nErrNothingAsserted is returned for a part or definition that asserts nothing about its objects — no asserted constraint, requirement or satisfaction, owned or inherited — so there is no conjunction to configure or solve.\n\n```go\nvar ErrSolverProcess = errors.New(\"the SMT solver did not answer\")\n```\nErrSolverProcess is returned when a solver was found but did not answer: it crashed, failed, or replied unintelligibly. Never a verdict, not even \\`unknown\\`.\n\n```go\nvar ErrUnsupportedCapability = errors.New(\"the SMT solver does not support a feature this query needs\")\n```\nErrUnsupportedCapability is returned when the backend found lacks a feature the query needs. It is a refusal, not a verdict: nothing is degraded and no answer is guessed from a script the backend would not accept.\n\n## Functions\n\n```go\nfunc ChainPins(ctx *runtime.Context, q *Query, read Reader, self *runtime.Instance) ([]Pin, []Unfixed)\n```\nChainPins reads the value each unpinned chain variable names through read: a feature a chain of two or more steps reaches, which no fixed value names directly. A chain reaching a feature that holds nothing stays free. One whose read fails — a declared value that does not evaluate (the runtime marks it ErrFeatureValueMaterialization), or any other failure — is an Unfixed naming the variable, for UnfixedRead to guard or refuse as it does a direct read.\n\n```go\nfunc CoreLabel(i int) string\n```\nCoreLabel names the assertion at index i in a labelled script. The index is the label, so a label a solver returns reads back the Assertion itself, with the provenance it carries, rather than a table kept beside the query.\n\n```go\nfunc CoreScript(q *Query, include []int) string\n```\nCoreScript renders the query as a core-producing script: every assertion labelled, unsat cores turned on, and \\`get-unsat-core\\` asked after \\`check-sat\\`, so running the script by hand answers what the driver asks. include, when non-nil, asserts only the assertions at those indices, which is how a core is reduced without retranslating.\n\n```go\nfunc Fixed(ctx *runtime.Context, sym *symbols.Symbol, inst *runtime.Instance) ([]Pin, []Unfixed)\n```\nFixed reads the values the model already fixes for the features of sym: what inst holds where an object was created, else what the declaration states. The values are read through the evaluator, which is what a verdict about them reads, rather than through a second reader of the same declarations.\n\nThe second result names the features whose value could not be read, which stay free rather than being reported as fixed to something.\n\n```go\nfunc FixedFor(ctx *runtime.Context, f Fixing) ([]Pin, []Unfixed)\n```\nFixedFor gathers the values fixed for a query about the fixing's element, from its object, its owner and the element itself; see fixedFeatures for a feature read twice.\n\n```go\nfunc Magnitude(rendered, unit, dimension string) string\n```\nMagnitude is a rendered quantity without the units written after it, for a reader that takes the unit and the dimension as fields of their own.\n\n```go\nfunc MaxConfigurationsFromEnv() int\n```\nMaxConfigurationsFromEnv is the bound the environment asks enumeration to use, or DefaultMaxConfigurations when it names none or names an unusable one: a bound is what stops a runaway, so an unreadable override never removes it.\n\n```go\nfunc Script(q *Query) string\n```\nScript renders the query as an SMT-LIB2 script: its logic, declarations, assertions each preceded by a comment naming where it came from, and \\`check-sat\\`. Output is deterministic, so it compares byte for byte.\n\n```go\nfunc UnfixedRead(ctx *runtime.Context, q *Query, unfixed []Unfixed) error\n```\nUnfixedRead is the read failure of an unfixed feature a variable of q reads on every path, nil when it reads none. A feature the evaluator reaches only under some condition — the right operand of a short-circuiting connective, a branch of a conditional, a condition after another required one — is guarded instead: q asserts that condition false in role RoleDefined and names the read in Query.Unreadable, so its models are the assignments the evaluator answers about without reading the feature. A failed default is never left free: an assignment reaching it has no value for it, and Query.Reached asks whether one exists.\n\n```go\nfunc Unsupported(err error) bool\n```\nUnsupported reports whether the error is a backend refusing a capability, which is a reported refusal rather than a defect in the script.\n\n```go\nfunc ValueText(v *Var, value string) string\n```\nValueText writes a value stated for v as the notation does: a datatype's value is a qualified name, quoted where it needs quoting; any other is already written so.\n\n## Types\n\n```go\ntype Assertion struct {\n\t// Term is the boolean term asserted.\n\tTerm *Term\n\n\t// From records the condition the term encodes.\n\tFrom Provenance\n}\n```\nAssertion is one term the query asserts, with where it came from.\n\n```go\ntype Assignment struct {\n\t// Var is the variable the solver assigned, naming the feature it stands for.\n\tVar *Var\n\n\t// Dead marks a variable the model gives no meaning: a variation point of a\n\t// variant the model does not select (Var.Live is false in it).\n\tDead bool\n\n\t// Value renders the value as the notation writes it: a quantity with its\n\t// unit, an enumeration value by name, a number, a boolean or a string.\n\tValue string\n\n\t// Raw is the solver's own S-expression for the value.\n\tRaw string\n\n\t// Rendered is false when the solver answered with a term the notation has no\n\t// literal for, such as an algebraic number, and Value repeats Raw.\n\tRendered bool\n}\n```\nAssignment is one variable's value in a satisfying model, rendered in the notation's own terms rather than SMT-LIB's.\n\n```go\ntype AssumedOne struct {\n\t// Feature is the feature declaration read.\n\tFeature *symbols.Symbol\n\n\t// Name names the feature as the report quotes it: its qualified name, or\n\t// its path from the element for an object-holding feature walked.\n\tName string\n\n\t// Multiplicity is the multiplicity the model computes for it.\n\tMultiplicity semantics.Range\n\n\t// Object marks an object-holding feature walked as one object, as opposed to\n\t// a feature read as one value.\n\tObject bool\n}\n```\nAssumedOne is a feature a query reads as holding one value or one object while nothing holds it to one: it declares and inherits no multiplicity, so the default \\`0..\\*\\` governs it (KerML 1.1 §7.4.12; SysML v2 §7.6.3 gives the implicit \\`\\[1..1]\\` to an eligible usage only). A verdict is about the case where it holds one, which is also the only case the evaluator answers about.\n\n```go\ntype Capabilities struct {\n\t// Solver names the backend the answers are about.\n\tSolver string\n\n\t// Probed reports that the answers came from running the executable rather\n\t// than from a declaration.\n\tProbed bool\n\n\t// Elapsed is how long probing took, zero for declared capabilities.\n\tElapsed time.Duration\n\t// contains filtered or unexported fields\n}\n```\nCapabilities is what one backend supports of the subset this layer needs, either probed by running it or declared for a backend already known.\n\n```go\nfunc DeclaredCapabilities(solver string, supported ...Capability) *Capabilities\n```\nDeclaredCapabilities states what a backend supports without probing it, which is how a caller that already knows a backend avoids the probe.\n\n```go\nfunc (c *Capabilities) Detail(capability Capability) string\n```\nDetail is what the backend said when it refused the capability or left the check undecided, empty for one it supports.\n\n```go\nfunc (c *Capabilities) Missing(needed []Capability) []Capability\n```\nMissing are those of the capabilities the backend refused, in the order given, with duplicates dropped.\n\n```go\nfunc (c *Capabilities) Refuses(capability Capability) bool\n```\nRefuses reports whether the backend rejected the capability. Only a refusal stops a query: a check that settled nothing does not.\n\n```go\nfunc (c *Capabilities) Supported() []Capability\n```\nSupported are the capabilities the backend has, in AllCapabilities order.\n\n```go\nfunc (c *Capabilities) Supports(capability Capability) bool\n```\nSupports reports whether the backend was found to have the capability.\n\n```go\nfunc (c *Capabilities) Undetermined(capability Capability) bool\n```\nUndetermined reports that the check neither established the capability nor was refused, so what the backend does with the feature is unknown.\n\n```go\ntype Capability int\n```\nCapability is one thing this layer needs of a backend beyond parsing SMT-LIB2: a theory feature, a script-level facility, or a solver's own extension.\n\n```go\nconst (\n\t// CapModels is `:produce-models` with `(get-value …)`, which every answer\n\t// carrying an assignment needs.\n\tCapModels Capability = iota\n\t// CapUnsatCores is `:produce-unsat-cores` with `:named` assertions and\n\t// `(get-unsat-core)`, which explaining a conflict needs.\n\tCapUnsatCores\n\t// CapIncremental is more than one `(check-sat)` in one dialogue, which\n\t// enumerating configurations needs.\n\tCapIncremental\n\t// CapDatatypes is `(declare-datatypes …)` with nullary constructors, which\n\t// enumerations and variation points are declared as.\n\tCapDatatypes\n\t// CapStrings is the String sort with equality, from the strings theory.\n\tCapStrings\n\t// CapIntegerDivision is `div` and `mod` from the Ints theory.\n\tCapIntegerDivision\n\t// CapNonlinearArith is a product or quotient of two non-literal terms.\n\tCapNonlinearArith\n\t// CapMixedArith is the mixed integer and real logics AUFLIRA and AUFNIRA,\n\t// which a query over both Int and Real is set to.\n\tCapMixedArith\n\t// CapNonStandardLogic is `(set-logic ALL)`, which no SMT-LIB logic name\n\t// covers and which datatypes and strings are set to.\n\tCapNonStandardLogic\n\t// CapOptimization is `(maximize …)`/`(minimize …)` with `(get-objectives)`,\n\t// a solver extension rather than SMT-LIB 2.6.\n\tCapOptimization\n\t// CapOptimizationPriority is `:opt.priority`, a z3 extension for ordering\n\t// several objectives.\n\tCapOptimizationPriority\n)\n```\n\n```go\nfunc (c Capability) Feature() string\n```\nFeature says what SMT-LIB feature, or which extension, the capability is.\n\n```go\nfunc (c Capability) String() string\n```\nString names the capability as a report names it.\n\n```go\ntype Core struct {\n\t// Members are the conflicting assertions, in the query's assertion order.\n\tMembers []Assertion\n\n\t// Indices are the positions those assertions hold in Query.Assertions.\n\tIndices []int\n\n\t// Minimal reports that dropping any one member was tried and left the rest\n\t// satisfiable, so every member is needed. It is false for a core reported as\n\t// the solver produced it, which is unsatisfiable but not necessarily\n\t// irreducible.\n\tMinimal bool\n\n\t// Note says why minimality was not established, empty when it was.\n\tNote string\n\n\t// Rounds is how many further solver calls reduction made.\n\tRounds int\n\n\t// Elapsed is how long reduction took.\n\tElapsed time.Duration\n}\n```\nCore is a set of assertions whose conjunction is unsatisfiable: the conditions that conflict, each carrying the provenance of the condition it came from.\n\n```go\nfunc (c *Core) Rounded() bool\n```\nRounded reports whether the conflict rests on a condition the evaluator computes in float64; a conflict with no members to inspect counts.\n\n```go\ntype CoreError struct {\n\t// Solver is the executable that was run.\n\tSolver string\n\n\t// Detail says what it answered instead of a core.\n\tDetail string\n\n\t// Stderr is what the solver wrote on standard error, trimmed.\n\tStderr string\n}\n```\nCoreError says which solver would not explain its unsat verdict and how. It unwraps to both ErrNoCore and ErrSolverProcess, as the solver did not answer what it was asked.\n\n```go\nfunc (e *CoreError) Error() string\n```\nError reports the failure, naming the solver and what it answered.\n\n```go\nfunc (e *CoreError) Unwrap() []error\n```\nUnwrap returns both kinds this failure is, so either is testable with errors.Is.\n\n```go\ntype DeadVariationError struct {\n\t// Var is the variation point chosen, Live the selection under which it exists.\n\tVar  *Var\n\tLive *Term\n}\n```\nDeadVariationError is a chosen selection fixing a variation point that does not exist under the variants it chooses: a feature declared for one variant is a variation point only where the holding variation selects that variant.\n\n```go\nfunc (e *DeadVariationError) Error() string\n```\nError names the variation point and the selection it exists under.\n\n```go\ntype Derived struct {\n\tExpr  *lower.ExprEntry\n\tScope *symbols.Scope\n\tErr   error\n}\n```\nDerived is a declared value written as an expression over other features of the element: the expression, the scope it is read in, and the error reading it where the evaluator could not materialize it.\n\n```go\ntype DerivedValue struct {\n\t// Var is the variable the equation defines.\n\tVar *Var\n\n\t// Expression is the declared expression, as the model writes it.\n\tExpression string\n\n\t// Declared is the feature declaration stating the expression.\n\tDeclared *symbols.Symbol\n}\n```\nDerivedValue is a defining equation the query asserts: the variable it defines and the expression the model declares for it, as written.\n\n```go\ntype Direction int\n```\nDirection is the way an objective's value is to be improved.\n\n```go\nconst (\n\t// Minimize asks for the least value the conditions permit.\n\tMinimize Direction = iota\n\t// Maximize asks for the greatest value the conditions permit.\n\tMaximize\n)\n```\n\n```go\nfunc (d Direction) String() string\n```\nString names the direction as the emitted objective form reads.\n\n```go\ntype Expression struct {\n\t// Term is the value the expression yields.\n\tTerm *Term\n\n\t// Defined are the conditions the evaluator needs to compute Term, each a\n\t// boolean term; empty for an expression it always computes.\n\tDefined []*Term\n}\n```\nExpression is one translated expression: the term it yields, and the side conditions under which the evaluator computes that term rather than reporting an error — a computed divisor being non-zero. A consumer encoding a step of execution asserts Term where Defined all hold and the evaluator's error where one does not, since SMT-LIB's division is total while the evaluator's is not. Integers are unbounded in both.\n\n```go\ntype Features struct {\n\t// Bool, Int, Real, Strings and Datatypes are set for each sort used, by a\n\t// declared variable or by a term.\n\tBool      bool\n\tInt       bool\n\tReal      bool\n\tStrings   bool\n\tDatatypes bool\n\n\t// Nonlinear is set when a product or a quotient of two non-literal terms is\n\t// asserted, which no linear logic admits.\n\tNonlinear bool\n\n\t// IntegerDivision is set when `div` or `mod` from the Ints theory is used.\n\t// By a literal divisor this stays linear; by a computed one it is nonlinear.\n\tIntegerDivision bool\n}\n```\nFeatures is what a query uses of SMT-LIB: the sorts its variables and terms range over, and the arithmetic its terms apply.\n\n```go\ntype Fixing struct {\n\tElement    *symbols.Symbol\n\tOwner      *symbols.Symbol\n\tObject     *runtime.Instance\n\tObjectType *symbols.Symbol\n}\n```\nFixing is what a query reads fixed values from: the element it is about, the element whose declarations its conditions were written among, and the object a verdict about it would be about, named by the definition this resolution declares — an object carried over a submission is bound to symbols of another scope tree, which are not the ones the query is translated from.\n\n```go\ntype LogicChoice struct {\n\t// Name is the logic as `set-logic` names it.\n\tName string\n\n\t// Standard reports that the SMT-LIB 2.6 logic list defines Name. It is false\n\t// only for NonStandardLogic.\n\tStandard bool\n\n\t// Why names the features that forced this logic, for the script's comment\n\t// and for a message about a solver that refuses it.\n\tWhy string\n}\n```\nLogicChoice is the logic a script sets: its name, whether SMT-LIB defines it, and what the query uses that forced it.\n\n```go\ntype ModelValue struct {\n\t// Kind is the sort of the value, the variable's own.\n\tKind SortKind\n\n\t// Bool holds a SortBool value.\n\tBool bool\n\n\t// Number holds a SortInt value, which is integral, or a SortReal value, exact.\n\tNumber *big.Rat\n\n\t// Text holds a SortString value, or the name of a SortDatatype value: the\n\t// qualified name of the literal or variant, as the sort declares it.\n\tText string\n}\n```\nModelValue is one variable's value in a model, read back exactly from the solver's own text: a consumer decoding a witness reads it rather than parsing the rendered Assignment.\n\n```go\nfunc DecodeValue(a Assignment) (ModelValue, error)\n```\nDecodeValue reads an assignment back exactly. A value the variable's sort does not hold — a datatype value the sort does not declare, an algebraic number the solver writes as a root, a term rather than a literal — is an error.\n\n```go\nfunc (v ModelValue) Assign(x *Var) (Assignment, error)\n```\nAssign is the assignment a solver's model would carry for x holding v: the literal as the solver writes it, rendered as the notation writes it.\n\n```go\nfunc (v ModelValue) Literal(sort Sort) (*Term, error)\n```\nLiteral is the term denoting a decoded value, which is what denies a model in an enumeration.\n\n```go\nfunc (v ModelValue) Render(variable *Var) string\n```\nRender writes the value as the notation does for the variable: a quantity with its unit, an enumeration or variant by name, a number, a boolean or a string.\n\n```go\nfunc (v ModelValue) Written(variable *Var) (string, error)\n```\nWritten is the value as an expression the notation reads back to it, exact, for a witness to fix the variable's feature at. A magnitude in base units no unit names has no such spelling.\n\n```go\ntype NoObjectiveError struct {\n\t// Element names the analysis case asked about.\n\tElement string\n}\n```\nNoObjectiveError says which analysis case states no objective. It unwraps to ErrNoObjective.\n\n```go\nfunc (e *NoObjectiveError) Error() string\n```\nError reports that the case states no objective.\n\n```go\nfunc (e *NoObjectiveError) Unwrap() error\n```\nUnwrap returns ErrNoObjective.\n\n```go\ntype NoOptimizationError struct {\n\t// Solver is the executable that was run.\n\tSolver string\n\n\t// Detail says how it turned out not to implement optimization.\n\tDetail string\n\n\t// Cause is the capability refusal this was settled by, when one settled it.\n\tCause error\n}\n```\nNoOptimizationError names the solver that does not implement optimization and what to run instead. It unwraps to ErrNoOptimization.\n\n```go\nfunc (e *NoOptimizationError) Error() string\n```\nError reports that the solver cannot optimize, naming what can.\n\n```go\nfunc (e *NoOptimizationError) Unwrap() []error\n```\nUnwrap returns ErrNoOptimization, and the capability refusal behind it when the capability model settled it.\n\n```go\ntype NoSolverError struct {\n\t// Override is the value of the OPENSYSML_SMT override, empty when unset.\n\tOverride string\n\n\t// Looked lists the executables looked for on PATH, in order.\n\tLooked []string\n}\n```\nNoSolverError names the candidates looked for and what to install. It unwraps to ErrNoSolver.\n\n```go\nfunc (e *NoSolverError) Error() string\n```\nError reports that no solver was found, naming what would satisfy the search.\n\n```go\nfunc (e *NoSolverError) Unwrap() error\n```\nUnwrap returns ErrNoSolver.\n\n```go\ntype NoVariationsError struct {\n\t// Kind and Element name the element asked about.\n\tKind    string\n\tElement string\n}\n```\nNoVariationsError says which element reads no variation point. It unwraps to ErrNoVariations.\n\n```go\nfunc (e *NoVariationsError) Error() string\n```\nError reports that the element's conditions read no variation point.\n\n```go\nfunc (e *NoVariationsError) Unwrap() error\n```\nUnwrap returns ErrNoVariations.\n\n```go\ntype NotDeclaredError struct {\n\t// Kind and Element name the query asked about.\n\tKind    string\n\tElement string\n\n\t// Variable is the name of the variable the query lacks.\n\tVariable string\n}\n```\nNotDeclaredError names the variable an enumeration was asked over that the query does not declare. It unwraps to ErrNotDeclared.\n\n```go\nfunc (e *NotDeclaredError) Error() string\n```\nError reports which variable the query lacks.\n\n```go\nfunc (e *NotDeclaredError) Unwrap() error\n```\nUnwrap returns ErrNotDeclared.\n\n```go\ntype NotTranslatableError struct {\n\t// Construct names the construct that refused, as the notation writes it.\n\tConstruct string\n\n\t// Reason says why it is outside the subset.\n\tReason string\n\n\t// Element is the element whose condition was being translated.\n\tElement string\n\n\t// Condition is the condition as written, empty when the refusal is about a\n\t// declaration rather than a condition.\n\tCondition string\n\n\t// File is the document the construct was written in, empty when unknown.\n\tFile string\n\n\t// Span is where in File it was written.\n\tSpan source.Span\n\n\t// Location renders File and Span as `file:line:col`, empty when unknown.\n\tLocation string\n}\n```\nNotTranslatableError says which construct refused, why, and where it was written. It unwraps to ErrNotTranslatable.\n\n```go\nfunc (e *NotTranslatableError) Error() string\n```\nError reports the refusal, naming the construct, the condition it appeared in, and where it was written.\n\n```go\nfunc (e *NotTranslatableError) Unwrap() error\n```\nUnwrap returns ErrNotTranslatable, so a caller tests the kind of failure rather than its text.\n\n```go\ntype Note struct {\n\t// Kind is NoteUncovered or NoteAssumedOne.\n\tKind string\n\t// Subject names the feature the note is about, as the report quotes it.\n\tSubject string\n\t// Text is the note as a sentence.\n\tText string\n}\n```\nNote is an assumption or omission a verdict about the query rests on, worded once for every surface: the REPL prints Text, a gRPC verdict carries all three.\n\n```go\ntype Objective struct {\n\t// Direction is the way its value is to be improved.\n\tDirection Direction\n\n\t// Term is the translated objective expression, of an arithmetic sort.\n\tTerm *Term\n\n\t// Name is the objective's name as the model wrote it, empty for an anonymous\n\t// one.\n\tName string\n\n\t// Symbol is the objective usage it came from.\n\tSymbol *symbols.Symbol\n\n\t// Expression is the objective expression as written.\n\tExpression string\n\n\t// Dimension is the quantity dimension its value is expressed in over base\n\t// units, empty for a value that has none.\n\tDimension string\n\n\t// Unit names the base units its magnitude is expressed in (\"g\", \"m·s^-1\"),\n\t// empty when the value is no quantity or no quantity named them.\n\tUnit string\n\n\t// File and Span are where the objective was written.\n\tFile string\n\tSpan source.Span\n\n\t// Location renders File and Span as `file:line:col`.\n\tLocation string\n}\n```\nObjective is one objective a query optimizes: which way its value is to be improved, the term stating that value, and where the objective was written.\n\n```go\ntype ObjectiveError struct {\n\t// Objective names the objective as the model writes it.\n\tObjective string\n\n\t// Reason says what about it cannot be optimized.\n\tReason string\n\n\t// Remedy says what the model would have to state instead, empty when there\n\t// is nothing to suggest.\n\tRemedy string\n\n\t// Element is the analysis case stating the objective.\n\tElement string\n\n\t// File is the document it was written in, empty when unknown.\n\tFile string\n\n\t// Span is where in File it was written.\n\tSpan source.Span\n\n\t// Location renders File and Span as `file:line:col`, empty when unknown.\n\tLocation string\n}\n```\nObjectiveError says which objective cannot be optimized, why, and where it was written. It unwraps to ErrNotOptimizable.\n\n```go\nfunc (e *ObjectiveError) Error() string\n```\nError reports the refusal, naming the objective and where it was written.\n\n```go\nfunc (e *ObjectiveError) Unwrap() error\n```\nUnwrap returns ErrNotOptimizable.\n\n```go\ntype Op int\n```\nOp is the operator a term applies. The set is closed: every translatable construct maps onto one of these, and anything else refuses with ErrNotTranslatable.\n\n```go\nconst (\n\t// OpBool is a boolean literal, held in Bool.\n\tOpBool Op = iota\n\t// OpInt is an integer literal, held in Int.\n\tOpInt\n\t// OpReal is a real literal, held as an exact rational in Real.\n\tOpReal\n\t// OpString is a string literal, held in Str.\n\tOpString\n\t// OpValue is a value of a datatype sort — an enumeration literal or a\n\t// variant — named by Str.\n\tOpValue\n\t// OpVar is a variable, held in Var.\n\tOpVar\n\n\t// OpNot is boolean negation, one argument.\n\tOpNot\n\t// OpAnd is conjunction, two or more arguments.\n\tOpAnd\n\t// OpOr is disjunction, two or more arguments.\n\tOpOr\n\t// OpXor is exclusive disjunction, two arguments.\n\tOpXor\n\t// OpImplies is implication, two arguments.\n\tOpImplies\n\n\t// OpEq is equality of two terms of the same sort.\n\tOpEq\n\t// OpNe is inequality of two terms of the same sort.\n\tOpNe\n\t// OpLt is `\u003c` between two numbers of the same sort.\n\tOpLt\n\t// OpLe is `\u003c=` between two numbers of the same sort.\n\tOpLe\n\t// OpGt is `\u003e` between two numbers of the same sort.\n\tOpGt\n\t// OpGe is `\u003e=` between two numbers of the same sort.\n\tOpGe\n\n\t// OpAdd is addition of two numbers of the same sort.\n\tOpAdd\n\t// OpSub is subtraction of two numbers of the same sort.\n\tOpSub\n\t// OpMul is multiplication of two numbers of the same sort.\n\tOpMul\n\t// OpDiv is division of two reals.\n\tOpDiv\n\t// OpIntDiv is SMT-LIB's Euclidean integer division; TruncRem builds the\n\t// evaluator's truncating remainder from it.\n\tOpIntDiv\n\t// OpNeg is arithmetic negation, one argument.\n\tOpNeg\n\n\t// OpIte is `if c then a else b`: a boolean condition and two branches of\n\t// the same sort.\n\tOpIte\n\t// OpToReal widens an integer term to a real one.\n\tOpToReal\n)\n```\n\n```go\ntype Optimum struct {\n\t// Objective is the objective asked about.\n\tObjective Objective\n\n\t// Status says what came of asking.\n\tStatus OptimumStatus\n\n\t// Value is the optimum in the notation's own terms, with the units its\n\t// magnitude is expressed in; empty unless Status is OptimumAttained.\n\tValue string\n\n\t// Bound is the value the objective approaches without attaining it, in the\n\t// notation's own terms; empty unless Status is OptimumBounded.\n\tBound string\n\n\t// Feasible is a value the reported model attains, in the notation's own\n\t// terms: a witness the conditions permit, not an optimum.\n\tFeasible string\n\n\t// Raw is the solver's own expression for the optimum.\n\tRaw string\n\n\t// Detail says why an optimum was not reported, empty when one was.\n\tDetail string\n}\n```\nOptimum is what a solver answered about one objective.\n\n```go\ntype OptimumError struct {\n\t// Solver is the executable that was run.\n\tSolver string\n\n\t// Objective names the objective it was asked about.\n\tObjective string\n\n\t// Detail says what it answered instead of an optimum.\n\tDetail string\n\n\t// Stderr is what the solver wrote on standard error, trimmed.\n\tStderr string\n}\n```\nOptimumError says which solver would not report an optimum it had found, and how. It unwraps to both ErrNoOptimum and ErrSolverProcess, as the solver did not answer what it was asked.\n\n```go\nfunc (e *OptimumError) Error() string\n```\nError reports the failure, naming the solver and what it answered.\n\n```go\nfunc (e *OptimumError) Unwrap() []error\n```\nUnwrap returns both kinds this failure is, so either is testable with errors.Is.\n\n```go\ntype OptimumStatus int\n```\nOptimumStatus is what came of asking for one objective's optimum. The cases stay distinct: a bound no assignment attains is never reported as a value, and an answer that did not survive verification is never reported as an optimum.\n\n```go\nconst (\n\t// OptimumAttained means the value reported is the optimum and an assignment\n\t// attains it, both checked here rather than taken on the solver's word.\n\tOptimumAttained OptimumStatus = iota\n\n\t// OptimumBounded means the objective approaches a bound no assignment\n\t// attains, which is what a solver reports as an infinitesimal or an interval.\n\tOptimumBounded\n\n\t// OptimumUnbounded means the conditions permit arbitrarily better values, so\n\t// there is no optimum to report.\n\tOptimumUnbounded\n\n\t// OptimumUnverified means the solver reported an optimum that verification\n\t// refuted: a better value is feasible. Only the feasible value found stands.\n\tOptimumUnverified\n\n\t// OptimumUndecided means verification itself was not decided, so whether the\n\t// value reported is the optimum is unknown.\n\tOptimumUndecided\n)\n```\n\n```go\nfunc (s OptimumStatus) String() string\n```\nString names the outcome in the terms a report uses.\n\n```go\ntype Pin struct {\n\t// Feature is the feature declaration whose value is fixed.\n\tFeature *symbols.Symbol\n\n\t// Name is the feature as the element naming it writes it.\n\tName string\n\n\t// Var is the exact query variable the pin fixes, where it names one.\n\tVar string\n\n\t// Value is the value it is fixed to, read where the evaluator reads it.\n\tValue runtime.Value\n\n\t// Source says where the value came from.\n\tSource PinSource\n\n\t// Object is the object holding the value, 0 for a value no object holds.\n\tObject int64\n\n\t// Bound says a declared value was written with `=`, a binding the feature\n\t// holds at all times, rather than as a `default` or `:=` initial value.\n\tBound bool\n\n\t// Derived is the expression the model declares the value by, over other\n\t// features of the same element, for a value the object has not materialized;\n\t// nil for a literal value or a held one. A derived value is defined by\n\t// its equation in the query rather than fixed, Value standing in only where\n\t// the equation cannot be stated.\n\tDerived *Derived\n}\n```\nPin fixes one feature to a value a query asserts, rather than leaving the feature free for the solver to choose.\n\n```go\ntype PinError struct {\n\t// Feature names the feature whose value was to be fixed.\n\tFeature string\n\n\t// Value renders the value as the notation writes it.\n\tValue string\n\n\t// Reason says why it cannot be fixed.\n\tReason string\n\n\t// Source says where the value came from.\n\tSource PinSource\n\n\t// File and Span are where the feature was declared.\n\tFile string\n\tSpan source.Span\n\n\t// Location renders File and Span as `file:line:col`, empty when unknown.\n\tLocation string\n}\n```\nPinError says which value could not be fixed, why, and where the feature was declared. It unwraps to ErrNotPinnable.\n\n```go\nfunc (e *PinError) Error() string\n```\nError reports the refusal, naming the feature, the value and where it was declared.\n\n```go\nfunc (e *PinError) Unwrap() error\n```\nUnwrap returns ErrNotPinnable, so a caller tests the kind of failure rather than its text.\n\n```go\ntype PinSource int\n```\nPinSource says where a fixed value came from, so a report distinguishes what an object holds from what the model declares and from what a caller chose.\n\n```go\nconst (\n\t// PinHeld is a value an object holds.\n\tPinHeld PinSource = iota\n\t// PinDeclared is a value the model declares for a feature.\n\tPinDeclared\n\t// PinChosen is a value the caller supplied, such as a variant selection.\n\tPinChosen\n)\n```\n\n```go\nfunc (s PinSource) String() string\n```\nString names the source for a report a machine reads.\n\n```go\ntype PinnedValue struct {\n\t// Var is the variable fixed.\n\tVar *Var\n\n\t// Value renders the fixed value as the notation writes it.\n\tValue string\n\n\t// Source says where the value came from.\n\tSource PinSource\n\n\t// Object is the object holding the value, 0 for a value no object holds.\n\tObject int64\n\n\t// Index is the assertion's position in Query.Assertions.\n\tIndex int\n}\n```\nPinnedValue is a pin the query asserts: the variable it fixed, the value as the notation writes it, and where that assertion sits, so an unsat core naming the assertion names the pin.\n\n```go\ntype Provenance struct {\n\t// Kind is the kind of element the assertion came from: \"constraint\",\n\t// \"requirement\", \"satisfaction\", or \"declaration\" for a domain assertion.\n\tKind string\n\n\t// Element names that element as a verdict about it would.\n\tElement string\n\n\t// Condition is the condition as written, negation and grouping included.\n\tCondition string\n\n\t// Role says why the query asserts the term.\n\tRole Role\n\n\t// Declared is the element that declared the condition, which is the\n\t// supertype it was inherited from for an inherited one.\n\tDeclared *symbols.Symbol\n\n\t// File and Span are where the condition was written.\n\tFile string\n\tSpan source.Span\n\n\t// Location renders File and Span as `file:line:col`.\n\tLocation string\n}\n```\nProvenance records what an assertion came from, so a later step can map an answer about the script back to what the user wrote.\n\n```go\ntype Query struct {\n\t// Kind is the kind of element translated: \"constraint\", \"requirement\" or\n\t// \"satisfaction\".\n\tKind string\n\n\t// Element names the translated element as a verdict about it would.\n\tElement string\n\n\t// Negated is set for an element asserting that its conditions do not all\n\t// hold (`assert not …`), which the query asserts as one denial.\n\tNegated bool\n\n\t// Violation is set for a query whose models are the assignments violating\n\t// the element's claim: unsatisfiable means the claim holds for every\n\t// assignment of the free features.\n\tViolation bool\n\n\t// Sorts are the datatype sorts the query declares, ordered by name.\n\tSorts []Sort\n\n\t// Vars are the variables the query declares, ordered by name.\n\tVars []*Var\n\n\t// Assertions are the terms asserted: declared domains first, then the\n\t// well-definedness side conditions, then the conditions in the order the\n\t// evaluator checks them.\n\tAssertions []Assertion\n\n\t// Nonlinear is set when a product or a quotient of two non-literal terms was\n\t// asserted, which is what a nonlinear logic is set for.\n\tNonlinear bool\n\n\t// IntegerDivision is set when integer division or remainder was encoded,\n\t// which needs `div` and `mod` from the Ints theory of a backend.\n\tIntegerDivision bool\n\n\t// Pinned are the values the query fixes rather than leaves free, each naming\n\t// the assertion that fixes it; nil for a query that fixes none.\n\tPinned []PinnedValue\n\n\t// Unread are the values that were to be fixed but that no variable of the\n\t// query reads, reported rather than dropped.\n\tUnread []Unread\n\n\t// Derived are the variables the query defines by the equation the model\n\t// declares for them rather than fixes or leaves free; nil when it defines\n\t// none.\n\tDerived []DerivedValue\n\n\t// Uncovered are the object-holding features of the element whose objects'\n\t// own assertions the query does not state, each with the reason; nil when it\n\t// states them all.\n\tUncovered []Refused\n\n\t// Unreadable are the features the query reads whose value could not be read,\n\t// each guarded so that no model reaches the read; nil when it reads none.\n\tUnreadable []UnreadableRead\n\n\t// AssumedOne are the features the query reads as one value or one object\n\t// although their multiplicity, the usual default `0..*` (KerML 1.1 §7.4.12),\n\t// admits any count: the assumption is reported, never asserted; nil when every\n\t// feature read is held to one by a declared, inherited or implicit multiplicity.\n\tAssumedOne []AssumedOne\n\n\t// Objectives are the objectives to optimize, in the order the analysis case\n\t// declares them, which is the order they are optimized in; nil for a query\n\t// that only asks about satisfiability.\n\tObjectives []Objective\n}\n```\nQuery is a translated element: the variables its conditions read, the finite sorts they range over, and the terms it asserts. It is what a solver-facing step consumes, and what the SMT-LIB2 writer writes.\n\n```go\nfunc Analysis(ctx *runtime.Context, sym *symbols.Symbol, scope *symbols.Scope) (*Query, error)\n```\nAnalysis translates an analysis case as an optimization query: what its conditions permit, and the objectives to improve within that.\n\nThe contract, which SysML v2 leaves to a tool since it defines no solving: direction comes from the trade-study definition the objective is typed by (TradeStudies::MinimizeObjective or MaximizeObjective), the value to improve from the expression the objective's redefinition of the library's \\`eval\\` calculation returns (\\`in calc :\u003e\u003e eval { expression }\\`), and what is feasible from the conditions the case requires or assumes together with the ones each objective states in its own body.\n\n```go\nfunc AnalysisWith(ctx *runtime.Context, sym *symbols.Symbol, scope *symbols.Scope, pins []Pin) (*Query, error)\n```\nAnalysisWith translates an analysis case with values already fixed, so the optimum is the best one consistent with what the model already fixes. With no pins it is Analysis.\n\n```go\nfunc Asserted(ctx *runtime.Context, sym *symbols.Symbol, scope *symbols.Scope) (*Query, error)\n```\nAsserted translates every assertion a part or definition states about its objects — asserted constraints, carried requirements and satisfactions, owned and inherited — as one conjunction: the collection validating one of its objects checks, so what the solver permits is what validation would accept.\n\n```go\nfunc AssertedOn(ctx *runtime.Context, sym *symbols.Symbol, scope *symbols.Scope, pins []Pin, self *runtime.Instance) (*Query, error)\n```\nAssertedOn is AssertedWith about one object of sym, whose held values the features read through its nested objects are fixed to.\n\n```go\nfunc AssertedWith(ctx *runtime.Context, sym *symbols.Symbol, scope *symbols.Scope, pins []Pin) (*Query, error)\n```\nAssertedWith translates what a part or definition asserts with values already fixed. With no pins it is Asserted.\n\n```go\nfunc Constraint(ctx *runtime.Context, sym *symbols.Symbol, scope *symbols.Scope) (*Query, error)\n```\nConstraint translates the conditions sym states as a constraint, inherited ones included, in the order the evaluator checks them. scope stands in for sym's own scope when sym declares none.\n\n```go\nfunc ConstraintViolation(ctx *runtime.Context, sym *symbols.Symbol, scope *symbols.Scope, pins []Pin) (*Query, error)\n```\nConstraintViolation translates sym's conditions as a violation query: its models are the assignments violating the constraint's claim, so an unsatisfiable one proves the claim holds for every assignment of the free features.\n\n```go\nfunc ConstraintWith(ctx *runtime.Context, sym *symbols.Symbol, scope *symbols.Scope, pins []Pin) (*Query, error)\n```\nConstraintWith translates a constraint with values already fixed, so the solver synthesises only what the model leaves free. With no pins it is Constraint.\n\n```go\nfunc Requirement(ctx *runtime.Context, sym *symbols.Symbol, scope *symbols.Scope) (*Query, error)\n```\nRequirement translates the conditions sym states as a requirement, its assumptions included as assumed rather than required.\n\n```go\nfunc RequirementViolation(ctx *runtime.Context, sym *symbols.Symbol, scope *symbols.Scope, pins []Pin) (*Query, error)\n```\nRequirementViolation translates sym's conditions as a violation query: its models are the assignments violating the requirement's claim, its assumptions kept as hypotheses of it, so an unsatisfiable one proves the claim holds for every assignment of the free features.\n\n```go\nfunc RequirementWith(ctx *runtime.Context, sym *symbols.Symbol, scope *symbols.Scope, pins []Pin) (*Query, error)\n```\nRequirementWith translates a requirement with values already fixed. With no pins it is Requirement.\n\n```go\nfunc Satisfaction(ctx *runtime.Context, assertion *runtime.SatisfyAssertion) (*Query, error)\n```\nSatisfaction translates the conditions an \\`assert satisfy\\` checks: those of the requirement it names, read through that requirement's own parameters, since the query asks what they permit rather than what the subject holds.\n\n```go\nfunc SatisfactionViolation(ctx *runtime.Context, assertion *runtime.SatisfyAssertion, pins []Pin) (*Query, error)\n```\nSatisfactionViolation translates an \\`assert satisfy\\` as a violation query: its models are the assignments violating the requirement's claim, so an unsatisfiable one proves satisfaction for every assignment of the free features.\n\n```go\nfunc SatisfactionWith(ctx *runtime.Context, assertion *runtime.SatisfyAssertion, pins []Pin) (*Query, error)\n```\nSatisfactionWith translates an \\`assert satisfy\\` with values already fixed. With no pins it is Satisfaction.\n\n```go\nfunc TranslateWith(ctx *runtime.Context, subject Subject, conds []runtime.Condition, pins []Pin) (*Query, error)\n```\nTranslateWith builds a query whose pinned features are asserted equal to the values given, leaving the rest free. A value that cannot be fixed refuses, as an untranslatable condition does; a value no condition reads is reported in Query.Unread rather than dropped. One refusal fails the whole translation, since a query missing a conjunct would answer about conditions it does not hold.\n\n```go\nfunc (q *Query) ChooseLive(chosen map[*Var]string) error\n```\nChooseLive admits a chosen selection's variation points: one that exists only under a variant the selection chooses against is refused, and one whose holder is left unchosen asserts the selection it exists under, so that choosing it selects the variant that has it.\n\n```go\nfunc (q *Query) Confirm(values map[string]ModelValue) (bool, string)\n```\nConfirm re-runs the query's assertions through the evaluator's own arithmetic on values of its variables by name, as a solver's model is confirmed before \\`sat\\` is claimed: ok=false with why when a variable has no value, a value the evaluator cannot hold, or an assertion that does not evaluate to true.\n\n```go\nfunc (q *Query) Features() Features\n```\nFeatures inventories what the query uses, reading its terms rather than trusting the flags a translation recorded, so a hand-built query inventories the same.\n\n```go\nfunc (q *Query) FixValue(v *Var, value string, src PinSource) error\n```\nFixValue fixes a variable of a finite sort to one of that sort's values, naming a variant or an enumeration literal by its qualified name, as a caller choosing a configuration to check does. The assertion is appended, so the positions the query's other assertions hold — and any core naming them — do not move.\n\n```go\nfunc (q *Query) Fixes() bool\n```\nFixes reports whether the query fixes any value, which is what makes an unsat verdict about it a verdict about those values too.\n\n```go\nfunc (q *Query) Free() []*Var\n```\nFree are the variables the query leaves for the solver to choose, in the order they are declared.\n\n```go\nfunc (q *Query) Logic() string\n```\nLogic is the name the script's \\`set-logic\\` sets.\n\n```go\nfunc (q *Query) LogicChoice() LogicChoice\n```\nLogicChoice names the narrowest SMT-LIB logic that covers what the query uses, falling back to NonStandardLogic only for features the logic list has no logic for. Names are the SMT-LIB 2.6 list's own; nothing is widened to avoid a hard case, and a wider logic than the terms need is never set.\n\n```go\nfunc (q *Query) Notes() []Note\n```\nNotes lists the query's notes in report order: what the query leaves uncovered, then what it assumes holds one.\n\n```go\nfunc (q *Query) Optimizes() bool\n```\nOptimizes reports whether the query asks for an optimum rather than only for satisfiability.\n\n```go\nfunc (q *Query) Reached() *Query\n```\nReached is the query whose models are the assignments of the free features under which the evaluator reads a feature whose value could not be read: q's domains, fixed values and assumptions, with the disjunction of the unreadable reads required — each read's condition together with the definedness guards of the operations the evaluator performs before reaching it. A guard hoisted from an operation after the read — a later required condition's divisor — constrains no assignment reaching it: the evaluator fails at the read and never performs the operation, so imposing the guard could hide the assignment and certify a false proof. Nil for a query reading no such feature. Unsat proves that every assignment the question is about evaluates without the read, so q's verdict is the evaluator's; sat witnesses an assignment on which the evaluator reaches no verdict, which leaves a proof or a refutation of q undecided (ReachedError).\n\n```go\nfunc (q *Query) ReachedError() error\n```\nReachedError is the error a question about q reports when Reached is satisfiable: some assignment of the free features reads a feature whose value could not be read, so the evaluator reaches no verdict there.\n\n```go\nfunc (q *Query) Requires() []Capability\n```\nRequires are the capabilities a backend must have to answer this query: what its sorts and operators use, and the non-standard logic when it needs one. Capabilities an operation adds — a model, an unsat core — are the operation's.\n\n```go\nfunc (q *Query) Rounded() bool\n```\nRounded reports whether the query asserts or optimizes a value the evaluator computes in binary64 — arithmetic a Real takes part in — whose rounding the exact-real encoding does not model. Integer and Rational arithmetic is exact.\n\n```go\nfunc (q *Query) RoundingSound() *Query\n```\nRoundingSound returns a new query over the same variables and sorts plus one fresh Real variable per rounding site, whose models over-approximate every evaluation the runtime evaluator's binary64 arithmetic performs, as replay.go models it; Integer and Rational arithmetic is exact and needs none. An unsatisfiable rounding-sound query therefore proves the exact query's unsat holds under the evaluator's arithmetic too; the query itself is never replayed — only its verdict is used.\n\nA rounding site is a \\`+\\`, \\`-\\`, \\`\\*\\` or \\`/\\` a Real takes part in, or an exact operand of one, which the evaluator rounds once to binary64; an exact literal operand is replaced by the exact rational of its nearest float64. Negation is exact and is not a site. Identical rewritten subterms share one site.\n\nEach site variable r is bounded by the doubles the exact value v lies between: for every double z the axioms state \\`(v \\\u003c= z) =\u003e r \\\u003c= z\\` and \\`(v \u003e= z) =\u003e r \u003e= z\\`, where z is every Real variable, the value 0 and every rewritten real literal (all always doubles), and every other site r' whose guard is the condition under which the evaluator computes it. No guard bounds a site by itself.\n\nSoundness: assign each evaluated site its actual float64 result and each unevaluated site its exact value v. Round-to-nearest is monotone and fixes doubles, so the float64 result lies between the same doubles v does, and z is a double whenever its guard holds at that point of the evaluation. Every assignment the evaluator can produce is then a model, so an unsat verdict refutes float64 arithmetic as surely as exact arithmetic. Relative-error bounds are deliberately omitted: fewer axioms is still sound, since over-approximating evaluation is the sound direction.\n\nNo case is needed for a non-finite site: the evaluator refuses one (constArithmetic via RealResult/MagnitudeArith; replayArithmetic mirrors it), so an overflowing assignment yields no verdict and every verdict computes finite sites. NaN cannot arise, and underflow to 0 is covered because 0 is a bound.\n\n```go\nfunc (q *Query) Variations() []*Var\n```\nVariations are the variables standing for the variation points the query's conditions read, in declaration order. They are the variables a configuration assigns.\n\n```go\ntype Reader func(scope *symbols.Scope, ref *lower.ExprEntry) (runtime.Value, error)\n```\nA Reader reads the value ref, written in scope, names, as the query's conditions read it.\n\n```go\nfunc ObjectReader(ctx *runtime.Context, self *runtime.Instance) Reader\n```\nObjectReader reads a reference in the scope of an object.\n\n```go\nfunc SatisfactionReader(ctx *runtime.Context, a *runtime.SatisfyAssertion, subject *runtime.Instance) Reader\n```\nSatisfactionReader reads a reference with the requirement bindings of a satisfaction.\n\n```go\ntype Refused struct {\n\t// Feature is the holding feature; Path names it from the element, through\n\t// the features holding it (`engine.cylinder`).\n\tFeature *symbols.Symbol\n\tPath    string\n\tReason  string\n}\n```\nRefused is an object-holding feature of the element whose objects' own assertions a query about the element leaves out, and why: validating an object checks them, the query does not state them.\n\n```go\ntype Result struct {\n\t// Query is the query asked.\n\tQuery *Query\n\n\t// Status is the verdict.\n\tStatus Status\n\n\t// Solver names the solver that answered.\n\tSolver string\n\n\t// TimedOut reports that the solver ran out of time rather than giving up:\n\t// Status is StatusUnknown, or StatusSat and Undecided for an enumeration\n\t// reporting what it had found when the deadline fired.\n\tTimedOut bool\n\n\t// Reason is what the solver said when asked why it answered `unknown`,\n\t// empty when it said nothing or was not asked.\n\tReason string\n\n\t// Model is the satisfying assignment, one entry per declared variable, for\n\t// StatusSat and empty otherwise. A solver may answer with any model of many:\n\t// it is one witness, not a canonical answer.\n\tModel []Assignment\n\n\t// Solutions are the distinct assignments an enumeration reported, in the\n\t// order the solver produced them, over the variables enumerated rather than\n\t// every declared one; nil for a plain solve.\n\tSolutions [][]Assignment\n\n\t// Truncated reports that an enumeration stopped before it had shown there is\n\t// no further solution, for the reason AtBound or Undecided names.\n\tTruncated bool\n\n\t// AtBound reports that the enumeration stopped because it had reported as\n\t// many solutions as it was asked for; raising the bound may report more.\n\tAtBound bool\n\n\t// Undecided reports that the enumeration stopped because the solver stopped\n\t// deciding or ran out of time (TimedOut), whether or not it said why: the\n\t// solutions found stand, and whether others exist is unknown.\n\tUndecided bool\n\n\t// Optima are what came of asking for each objective's optimum, in the order\n\t// they are optimized; nil for a query that states none.\n\tOptima []Optimum\n\n\t// Core holds the conflicting assertions for a query Explain found unsat, and\n\t// is nil for every other verdict; a plain Solve leaves it nil unless its\n\t// caller attaches the core an Explain of the same query found.\n\tCore *Core\n\n\t// RoundingProved reports that an unsat over a query whose conditions the\n\t// evaluator rounds was answered unsat a second time over an\n\t// over-approximation of that float64 arithmetic (Query.RoundingSound): the\n\t// evaluator's arithmetic satisfies the conditions nowhere either.\n\tRoundingProved bool\n\n\t// Elapsed is how long the solver took, for an Explain every round of\n\t// shrinking the core included.\n\tElapsed time.Duration\n}\n```\nResult is what a solver answered about one query.\n\n```go\ntype Role int\n```\nRole says why a query asserts a term.\n\n```go\nconst (\n\t// RoleRequired is a condition the element requires to hold (`require`,\n\t// `assert`).\n\tRoleRequired Role = iota\n\t// RoleAssumed is a condition the element assumes (`assume`), trusted rather\n\t// than required.\n\tRoleAssumed\n\t// RoleDenied is the assertion a negated element makes: that its required\n\t// conditions do not all hold.\n\tRoleDenied\n\t// RoleDomain is a bound a declaration puts on a variable's values rather\n\t// than a condition the model wrote, such as a Natural being non-negative.\n\tRoleDomain\n\t// RoleDefined is a side condition a condition needs for the solver to mean by\n\t// it what the evaluator means, such as a divisor being non-zero.\n\tRoleDefined\n\t// RolePinned is a value the model already fixes — held by an object, declared\n\t// by the model, or chosen by the caller — asserted so the solver synthesises\n\t// only what is still free.\n\tRolePinned\n\t// RoleDerived is the defining equation of a derived declared value — one the\n\t// model declares as an expression over other features of the same object —\n\t// asserted so the value the solver chooses is the one the model derives.\n\tRoleDerived\n\t// RoleExcluded is an assignment already reported, denied so enumerating asks\n\t// for a different one.\n\tRoleExcluded\n\t// RoleTransition is one step of a behavior's execution as the interpreter\n\t// takes it, asserted by a model-checking query over a run.\n\tRoleTransition\n\t// RoleViolated is the denial of an element's claim, asserted by a violation\n\t// query: its models are the assignments violating the element.\n\tRoleViolated\n)\n```\n\n```go\nfunc (r Role) String() string\n```\nString names the role as an assertion's comment reads it.\n\n```go\ntype Solver struct {\n\t// Name is the solver as a message names it, its executable's base name.\n\tName string\n\n\t// Path is the executable run.\n\tPath string\n\n\t// Args are the arguments that put it in SMT-LIB2 mode on standard input.\n\tArgs []string\n\n\t// Timeout is how long it is given to answer one query; zero means\n\t// DefaultTimeout.\n\tTimeout time.Duration\n\n\t// Env are environment variables added to the process's own environment.\n\tEnv []string\n\n\t// CoreBudget is how long shrinking an unsat core is given in total; zero\n\t// means the OPENSYSML_SMT_CORE_BUDGET override or DefaultCoreBudget.\n\tCoreBudget time.Duration\n\n\t// MaxCoreMembers is the largest core shrinking is attempted over; zero means\n\t// DefaultMaxCoreMembers.\n\tMaxCoreMembers int\n\n\t// Declared states what this backend supports instead of probing it, which is\n\t// how a caller that already knows a backend skips the probe; nil probes.\n\tDeclared *Capabilities\n}\n```\nSolver is an external SMT solver run as a process: no library is linked in, so releases stay pure Go and cross-compile.\n\n```go\nfunc Discover() (*Solver, error)\n```\nDiscover finds a solver: the OPENSYSML\\_SMT override first, then z3 and cvc5 on PATH. An absent solver is a typed error, never a fabricated verdict.\n\n```go\nfunc (s *Solver) Capabilities(ctx context.Context) (*Capabilities, error)\n```\nCapabilities reports what this backend supports of the whole subset, probing each capability once per executable however many queries ask. Declared capabilities are returned as they are, unprobed.\n\n```go\nfunc (s *Solver) Configurations(ctx context.Context, q *Query, limit int) (*Result, error)\n```\nConfigurations enumerates the combinations of variants that satisfy the query, asking for at most limit of them; a limit of zero or less uses the bound the environment names. Each combination is found by its own \\`check-sat\\`, with the combinations already reported denied, and Result.Truncated says the enumeration stopped at its bound rather than having shown there is no other.\n\n```go\nfunc (s *Solver) Enumerate(ctx context.Context, q *Query, vars []*Var, limit int) (*Result, error)\n```\nEnumerate enumerates the distinct assignments to vars the query admits, asking for at most limit of them, each found by its own \\`check-sat\\` with the ones already reported denied; a limit of zero or less asks for one. It is Configurations over variables the caller names rather than over the variation points read, for a query whose distinct models are told apart by chosen variables — the moves of a bounded run, say — rather than by every variable. Result.Truncated says the enumeration stopped at its bound rather than having shown there is no other assignment.\n\n```go\nfunc (s *Solver) Explain(ctx context.Context, q *Query) (*Result, error)\n```\nExplain asks the solver about the query and, when the verdict is unsat, for the assertions that conflict: the solver's own unsat core, shrunk to a minimal one while the budget lasts. sat and unknown carry no core, and a solver that refuses cores or names an assertion the query did not assert is an error rather than an empty or invented core.\n\n```go\nfunc (s *Solver) Optimize(ctx context.Context, q *Query) (*Result, error)\n```\nOptimize asks the solver for the optimum of each objective, in the lexicographic order the query declares them.\n\nOptimization is a z3 extension rather than SMT-LIB, so a backend without it is reported rather than degraded to a plain satisfiability check, and every optimum a backend does report is verified here: that an assignment attains it, and that no assignment does lexicographically better. A solver whose answer fails either check reports no optimum, only the feasible value it found.\n\n```go\nfunc (s *Solver) Solve(ctx context.Context, q *Query) (*Result, error)\n```\nSolve writes the query's script to the solver and reads its verdict, plus the model on \\`sat\\`. Failing to obtain a verdict is an error, not \\`unknown\\`, and a backend lacking a feature the query needs refuses before it is run.\n\n```go\ntype SolverProcessError struct {\n\t// Solver is the executable that was run.\n\tSolver string\n\n\t// Stage names what was being done: \"start\", \"write\", \"check-sat\",\n\t// \"get-value\", \"capability check\" or \"exit\".\n\tStage string\n\n\t// Detail says what went wrong.\n\tDetail string\n\n\t// Stderr is what the solver wrote on standard error, trimmed.\n\tStderr string\n\n\t// Err is the underlying error, nil when the failure was the reply itself.\n\tErr error\n}\n```\nSolverProcessError says which solver failed, at which step, and what it wrote on standard error. It unwraps to ErrSolverProcess.\n\n```go\nfunc (e *SolverProcessError) Error() string\n```\nError reports the failure, naming the solver and the step it failed at.\n\n```go\nfunc (e *SolverProcessError) Unwrap() []error\n```\nUnwrap returns ErrSolverProcess, and the underlying error when there is one, so both are testable with errors.Is.\n\n```go\ntype Sort struct {\n\t// Kind is which kind of sort this is.\n\tKind SortKind\n\n\t// Name is the sort's SMT-LIB name, unquoted: \"Bool\", \"Int\", \"Real\",\n\t// \"String\", or the qualified name of the definition a datatype comes from.\n\tName string\n\n\t// Values are a datatype's constructors, in declaration order, unquoted; nil\n\t// for a scalar sort.\n\tValues []string\n\n\t// Origin is the enumeration definition or variation point a datatype sort\n\t// was declared for; nil for a scalar sort.\n\tOrigin string\n\n\t// Variation marks a datatype sort declared for a variation point, whose\n\t// values are its variants rather than an enumeration's literals.\n\tVariation bool\n}\n```\nSort is the sort of a term: one of the four scalar sorts, or a finite datatype declared by the query.\n\n```go\nfunc (s Sort) Equal(other Sort) bool\n```\nEqual reports whether two sorts are the same sort.\n\n```go\nfunc (s Sort) Numeric() bool\n```\nNumeric reports whether the sort is Int or Real.\n\n```go\nfunc (s Sort) String() string\n```\nString returns the sort as it is written in a script.\n\n```go\ntype SortKind int\n```\nSortKind is the kind of value a sort holds. The set is closed: a construct whose values fit none of these kinds is not translatable.\n\n```go\nconst (\n\t// SortBool is the boolean sort, SMT-LIB Bool.\n\tSortBool SortKind = iota\n\t// SortInt is the integer sort, SMT-LIB Int.\n\tSortInt\n\t// SortReal is the real sort, SMT-LIB Real.\n\tSortReal\n\t// SortString is the string sort, SMT-LIB String.\n\tSortString\n\t// SortDatatype is a finite enumerated sort, declared as an SMT-LIB datatype\n\t// with one nullary constructor per value: an enumeration definition's\n\t// literals, or a variation point's variants.\n\tSortDatatype\n)\n```\n\n```go\ntype Status int\n```\nStatus is a solver's verdict about a query. The three verdicts stay distinct: StatusUnknown is never reported as either of the others.\n\n```go\nconst (\n\t// StatusSat means the solver found an assignment satisfying the assertions.\n\tStatusSat Status = iota\n\t// StatusUnsat means no assignment satisfies them.\n\tStatusUnsat\n\t// StatusUnknown means the solver did not decide: it timed out, or gave up on\n\t// arithmetic it cannot decide.\n\tStatusUnknown\n)\n```\n\n```go\nfunc (s Status) String() string\n```\nString names the verdict as SMT-LIB writes it.\n\n```go\ntype Subject struct {\n\t// Kind is the kind of element: \"constraint\", \"requirement\" or\n\t// \"satisfaction\".\n\tKind string\n\n\t// Name is the element as a verdict about it would name it.\n\tName string\n\n\t// Symbol is the element's declaration, used for provenance.\n\tSymbol *symbols.Symbol\n\n\t// Negated is set for `assert not …`, which denies the conjunction of the\n\t// required conditions rather than asserting each one.\n\tNegated bool\n\n\t// Violation is set for a query whose models are the assignments violating\n\t// the element's claim rather than meeting it: unsatisfiable proves the claim\n\t// holds for every assignment of the free features.\n\tViolation bool\n}\n```\nSubject is the element a query is about: what a verdict on it would name, and whether it asserts that its conditions do not hold.\n\n```go\ntype Term struct {\n\t// Op is the operator applied.\n\tOp Op\n\n\t// Sort is the sort of the value the term yields.\n\tSort Sort\n\n\t// Args are the operands of a compound term, nil for a leaf.\n\tArgs []*Term\n\n\t// Var is the variable an OpVar term reads.\n\tVar *Var\n\n\t// Bool holds an OpBool literal.\n\tBool bool\n\n\t// Int holds an OpInt literal within int64.\n\tInt int64\n\n\t// Big holds an OpInt literal beyond int64, Int then being zero; IntBig\n\t// reads either.\n\tBig *big.Int\n\n\t// Real holds an OpReal literal as an exact rational.\n\tReal *big.Rat\n\n\t// Str holds an OpString literal or the name of an OpValue datatype value.\n\tStr string\n\n\t// IntRatio marks an OpDiv over widened integers: a whole-number quotient,\n\t// which the evaluator computes as the exact Rational ratio.\n\tIntRatio bool\n}\n```\nTerm is one node of the query's term language: an operator, the sort of the value it yields, and its arguments. A leaf carries its value instead of arguments. Terms are built by the translator and are never mutated afterwards.\n\n```go\nfunc And(args ...*Term) *Term\n```\nAnd returns the conjunction of boolean terms: \\`true\\` for none, the term itself for one.\n\n```go\nfunc BigIntTerm(b *big.Int) *Term\n```\nBigIntTerm returns the integer literal b, which the term then owns.\n\n```go\nfunc Binary(op Op, sort Sort, left, right *Term) *Term\n```\nBinary returns a compound term over two arguments, of the sort given.\n\n```go\nfunc BoolTerm(b bool) *Term\n```\nBoolTerm returns a boolean literal.\n\n```go\nfunc IntTerm(i int64) *Term\n```\nIntTerm returns an integer literal.\n\n```go\nfunc Ite(cond, then, otherwise *Term) *Term\n```\nIte returns a conditional term: cond selects between two branches, which must share the sort the term yields.\n\n```go\nfunc Not(arg *Term) *Term\n```\nNot returns the negation of a boolean term, folding a double negation.\n\n```go\nfunc Or(args ...*Term) *Term\n```\nOr returns the disjunction of boolean terms: \\`false\\` for none, the term itself for one.\n\n```go\nfunc RatioDiv(a, b *Term) *Term\n```\nRatioDiv returns the exact real quotient of two integer terms, marked as a whole-number ratio for the evaluator-arithmetic replay.\n\n```go\nfunc RealTerm(r *big.Rat) *Term\n```\nRealTerm returns a real literal, held as the exact rational given.\n\n```go\nfunc StringTerm(s string) *Term\n```\nStringTerm returns a string literal.\n\n```go\nfunc Substitute(t *Term, replace func(*Var) *Term) *Term\n```\nSubstitute returns t with every variable replaced by what replace returns for it, sharing the subterms that read no variable. A replacement must yield the variable's sort; replace returning nil keeps the variable.\n\n```go\nfunc ToReal(arg *Term) *Term\n```\nToReal widens an integer term to a real one, leaving a real term as it is.\n\n```go\nfunc TruncDiv(a, b *Term) *Term\n```\nTruncDiv returns integer division truncating toward zero: \\`ite(a \u003e= 0, div(a, b), -div(-a, b))\\`. TruncRem builds the remainder from it.\n\n```go\nfunc TruncRem(a, b *Term) *Term\n```\nTruncRem returns the remainder that truncating division leaves, \\`a - b\\*TruncDiv(a, b)\\`, which takes the sign of the dividend as \\`%\\` does.\n\n```go\nfunc Unary(op Op, sort Sort, arg *Term) *Term\n```\nUnary returns a compound term over one argument, of the sort given.\n\n```go\nfunc ValueTerm(sort Sort, value string) *Term\n```\nValueTerm returns a value of a datatype sort, named by one of its values.\n\n```go\nfunc VarTerm(v *Var) *Term\n```\nVarTerm returns a term reading a variable.\n\n```go\nfunc (t *Term) Binary64() bool\n```\nBinary64 reports whether the evaluator computes the term in binary64: a Real variable, or arithmetic one takes part in. Integer and Rational arithmetic, literals included, is exact.\n\n```go\nfunc (t *Term) IntBig() *big.Int\n```\nIntBig is an OpInt literal's value, which the caller must not modify.\n\n```go\nfunc (t *Term) Literal() bool\n```\nLiteral reports whether the term is a literal value, which is what makes a product or a quotient linear.\n\n```go\ntype Translator struct {\n\t// contains filtered or unexported fields\n}\n```\nTranslator translates the expressions one element writes — the guards, assignments and conditions of a behavior — into terms over one set of variables, for a consumer assembling a Query of its own from them. Each feature read is one variable, named and sorted as a condition's translation names it, so a consumer substituting variables of its own for them (a copy per step, say) keys the substitution by the feature.\n\n```go\nfunc NewTranslator(ctx *runtime.Context, subject Subject) (*Translator, error)\n```\nNewTranslator starts translating the expressions subject writes. Names resolve as the evaluator resolves them: first among the features subject declares or inherits, then in the scope each expression is written in.\n\n```go\nfunc (x *Translator) Boolean(node *lower.ExprEntry, scope *symbols.Scope, within string) (*Expression, error)\n```\nBoolean translates an expression that must yield a boolean — a guard, a loop or branch condition — refusing one that yields another sort, as the executor reports a condition that is not Boolean.\n\n```go\nfunc (x *Translator) Condition(cond runtime.Condition) (*Expression, error)\n```\nCondition translates one condition as the evaluator reads it: a group as the conjunction of its members, negated as written. Its Term is Boolean; Defined holds the conditions under which the evaluator computes it at all.\n\n```go\nfunc (x *Translator) Conditions(conds []runtime.Condition) (*Expression, error)\n```\nConditions translates what the subject's conditions establish as a set, the way the evaluator judges them: the required ones must hold, an assumed one is evaluated but binds nothing, and a negated subject denies the conjunction of its required ones. Its Term is that verdict; Defined holds the conditions under which the evaluator computes every one it reaches, assumed ones included — the evaluator stops at the first required one that fails, so a later one need be defined only while those before it hold.\n\n```go\nfunc (x *Translator) Domains() []Assertion\n```\nDomains are the bounds the declarations of the variables read put on their values (a Natural is not negative), in a deterministic order. A consumer asserts each one of every copy of the variable it declares.\n\n```go\nfunc (x *Translator) Expression(node *lower.ExprEntry, scope *symbols.Scope, within string) (*Expression, error)\n```\nExpression translates one expression written in scope. within names the statement or guard the expression belongs to, which a refusal reports as the condition it appeared in. A construct outside the subset refuses with ErrNotTranslatable; nothing is degraded.\n\n```go\nfunc (x *Translator) Literal(v *Var, value runtime.Value) (*Term, error)\n```\nLiteral renders a value the evaluator holds for v as a term of v's sort, as a pinned value is rendered. A value the term language has no literal for refuses with a PinError naming the feature.\n\n```go\nfunc (x *Translator) Sorts() []Sort\n```\nSorts are the finite datatype sorts the expressions translated so far range over, ordered by name.\n\n```go\nfunc (x *Translator) Variable(name string, scope *symbols.Scope, within string) (*Var, error)\n```\nVariable is the variable standing for the feature name resolves to where it is written in scope — the one a reference to the name in an expression reads — for a consumer encoding a write to it. within names the statement writing it.\n\n```go\nfunc (x *Translator) Vars() []*Var\n```\nVars are the variables the expressions translated so far read, ordered by name; each stands for one feature.\n\n```go\ntype Unfixed struct {\n\t// Feature is the feature declaration whose value was not read.\n\tFeature *symbols.Symbol\n\n\t// Name is the feature as the element naming it writes it.\n\tName string\n\n\t// Var is the exact query variable reading the feature, where it names one:\n\t// a chain variable, which the feature declaration alone does not identify.\n\tVar string\n\n\t// Reason says why no value was read.\n\tReason string\n\n\t// Err is the error returned while reading the feature's value.\n\tErr error\n}\n```\nUnfixed is a feature whose value could not be read, so the query leaves it free. Reading a declared value is an evaluation, and one that fails says nothing about the feature.\n\n```go\nfunc ReadUnfixed(q *Query, unfixed []Unfixed) []Unfixed\n```\nReadUnfixed is the subset of unfixed that some variable of q reads, in order: the features whose failed read bears on q, as UnfixedRead guards or refuses them. One no condition of q reads bears on no answer, as a fixed value no condition reads does not.\n\n```go\ntype Unread struct {\n\t// Pin is the value that was fixed.\n\tPin Pin\n\n\t// Reason says why the query does not read it.\n\tReason string\n}\n```\nUnread is a fixed value no variable of the query reads. It is reported rather than dropped: the query answers about the conditions, which say nothing about this feature.\n\n```go\ntype UnreadableRead struct {\n\t// Var is the variable standing for the feature.\n\tVar *Var\n\n\t// Name is the feature as the element naming it writes it.\n\tName string\n\n\t// Err is the error returned while reading the feature's value.\n\tErr error\n\n\t// Reached is the condition under which the evaluator reads the feature.\n\tReached *Term\n\n\t// Guard is the term the query asserts to keep its models from reaching the\n\t// read: the negation of Reached.\n\tGuard *Term\n\n\t// Preceding are the definedness guards of the operations the evaluator\n\t// performs before reaching the read (Var.Preceding), which an assignment\n\t// reaching it satisfies.\n\tPreceding []*Term\n}\n```\nUnreadableRead is a feature a query reads whose value could not be read, and which the evaluator reaches only under some condition. The query asserts that condition false, so its models never read the feature; Query.Reached asks whether any assignment the question is about does.\n\n```go\ntype UnsupportedCapabilityError struct {\n\t// Solver is the backend that lacks the capability.\n\tSolver string\n\n\t// Operation is what was being asked of it: \"solving\", \"explaining a\n\t// conflict\", \"enumerating configurations\".\n\tOperation string\n\n\t// Missing are the capabilities it lacks, the first being the one reported.\n\tMissing []Capability\n\n\t// Detail is what it answered when probed for the first missing capability.\n\tDetail string\n}\n```\nUnsupportedCapabilityError names the backend, the features it lacks, and what was being asked of it. It unwraps to ErrUnsupportedCapability.\n\n```go\nfunc (e *UnsupportedCapabilityError) Error() string\n```\nError names the missing feature, the backend, and how to get a backend that has it, since the choice of solver is the operator's.\n\n```go\nfunc (e *UnsupportedCapabilityError) Unwrap() error\n```\nUnwrap returns ErrUnsupportedCapability.\n\n```go\ntype Var struct {\n\t// Name is the variable's name, the qualified name of the feature it stands\n\t// for, with a feature chain's further steps appended with '.'.\n\tName string\n\n\t// Sort is the sort of its values.\n\tSort Sort\n\n\t// Binary64 marks a variable whose feature is declared Real, whose values the\n\t// evaluator holds as binary64; Integer and Rational values are exact.\n\tBinary64 bool\n\n\t// Symbol is the feature declaration it stands for.\n\tSymbol *symbols.Symbol\n\n\t// Root is the first value-holding feature the reference read through, where\n\t// the name is a chain — the object the chain's further steps index into.\n\t// A subject member's root stands for the object the query is about; another\n\t// usage's root stands for one of its member objects.\n\tRoot *symbols.Symbol\n\n\t// Steps are the value-holding features the reference read through, where\n\t// the name is a chain — [root, …, feature] for a name of two or more steps.\n\tSteps []*symbols.Symbol\n\n\t// Ref and Scope are the reference node and the scope it was written in, so\n\t// the variable's value can be read the way the evaluator reads it.\n\tRef   *lower.ExprEntry\n\tScope *symbols.Scope\n\n\t// Reached is the condition under which the evaluator reads the variable:\n\t// the disjunction, over the references reading it, of the operands a\n\t// connective decided before reaching each, the branches conditionals\n\t// selected, and the required conditions evaluated before the one it is in.\n\t// Nil where some reference reads it on every path.\n\tReached *Term\n\n\t// Preceding are the definedness guards the query asserted for operations\n\t// the evaluator performs before it first reaches the variable under\n\t// Reached — a divisor it has checked non-zero by then. An assignment\n\t// reaching the variable satisfies them; the guards asserted after come from\n\t// operations an evaluation failing at the read never performs.\n\tPreceding []*Term\n\n\t// Live is the selection of variants under which the variable exists: a\n\t// feature declared for one variant is a variation point only where the\n\t// holding variation selects that variant. Nil where it exists in every\n\t// configuration.\n\tLive *Term\n\n\t// Dimension is the quantity dimension its magnitude is expressed in, over\n\t// base units, empty for a value that has none.\n\tDimension string\n\n\t// Unit names the base units its magnitude is expressed in (\"g\", \"m·s^-1\"),\n\t// empty when no quantity of that dimension was written to name them.\n\tUnit string\n\n\t// File and Span are where the feature was declared.\n\tFile string\n\tSpan source.Span\n\n\t// Location renders File and Span as `file:line:col`.\n\tLocation string\n}\n```\nVar is one variable a query declares: the value a feature may take. It is unconstrained except by its sort and the domain assertions the query makes about it — values a model declares are not asserted here.\n\n```go\nfunc (v *Var) ValueOf(given runtime.ToolValue) (ModelValue, error)\n```\nValueOf reads a value a witness states for v as a protocol spells one: a number, a boolean or a text, and the unit of a magnitude, which must be the base unit v's magnitudes are expressed in. A value v's sort does not hold is an error saying why.\n\n","path":"github.com/Open-MBEE/OpenSysML/internal/exec/solve","name":"solve","synopsis":"Package solve translates the conditions a constraint, requirement or satisfaction assertion states into a solver-independent term IR and writes that IR as an SMT-LIB2 script.","isRedistributable":true}
