Multi-Domain Theory Coordinator (Nelson-Oppen & CDCL(T))
The Multi-Domain Theory Coordinator (packages/runtime/src/formal/theory_coordinator.ts) is ModelScript's cross-language formal verification engine. It combines Nelson-Oppen equality sharing with Conflict-Driven Clause Learning Modulo Theories (
Architectural Motivation
In traditional Model-Based Systems Engineering (MBSE), each engineering tool operates in an isolated semantic silo:
- A SysML v2 requirement specifies
maxBatteryTemp <= 333.15 [K]. - A STEP / OpenSCAD 3D CAD enclosure defines the heat-sink surface area
. - A CFD configuration computes the convective heat transfer coefficient
. - A Modelica thermal-electrical DAE integrates
.
No single solver understands all four representations. The Theory Coordinator bridges these silos by treating each engineering domain as a decidable or semi-decidable Theory Oracle (
The 13 Domain Theory Oracles
packages/runtime/src/formal/theory_coordinator.ts and packages/runtime/src/formal/oracles/index.ts coordinate 13 specialized domain theory oracles implementing the TheoryOracle interface:
| # | Oracle Class | Domain (TheoryDomain) | Decision / Propagation Procedure |
|---|---|---|---|
| 1 | OntologyTheoryOracle | ontology | |
| 2 | ConstraintTheoryOracle | constraints | Interval arithmetic and relational constraint propagation over SysML v2 requirements |
| 3 | AbstractDomainOracle | abstract_interpretation | Floyd-Warshall Difference Bound Matrix (DBM) closure over Zone ( |
| 4 | ContinuousSafetyOracle | continuous_safety | Control Barrier Function (CBF) Lie-derivative positivity ( |
| 5 | DynamicSimulationOracle | simulation | Sensitivity-guided DAE trajectory integration (CVODE/IDA) with exact zero-crossing root finding |
| 6 | SpatialPhysicsOracle | spatial | 3D CAD bounding-box, B-Rep minimum clearance distance, mass budget, and interference checks |
| 7 | CaeContractOracle | cae | FEA structural safety factor ( |
| 8 | CausalizationOracle | causalization | Hopcroft-Karp maximum bipartite matching ( |
| 9 | DimensionalOracle | dimensional | Gaussian elimination over the 7-base SI unit exponent matrix |
| 10 | EntailmentOracle | entailment | Assume-Guarantee contract compatibility ( |
| 11 | FlowAlgebraOracle | flow_algebra | Acausal connection graph conservation ( |
| 12 | ToleranceStackOracle | tolerance | STEP AP242 GD&T 1D/3D tolerance chain stack-up via Worst-Case ( |
| 13 | UqOracle | uq | Latin Hypercube Sampling (LHS), Polynomial Chaos Expansion (PCE) Sobol indices, and distribution-free conformal prediction bounds |
The Verification Loop
- Initialization: Shared variables (
) are initialized to or extracted from SysML v2 requirement bounds and .ssvparameter sets. - Domain Propagation (
propagate): Each registeredTheoryOracleinspects the current shared interval store and tightens bounds monotonically: - Nelson-Oppen Equality Deduction: Whenever
and (or linear relational equalities hold in the Octagon DBM), the coordinator deduces the inter-theory equality and broadcasts it to all oracles. - Conflict & Unsat Core Extraction (
): If any oracle detects (i.e., ) or an axiomatic contradiction, it emits a minimal Unsatisfiable Core ( UnsatCore) pinpointing the exact offending AST nodes across files (e.g.,battery.mo:42,enclosure.step:118,thermal_req.sysml:15). - CEGAR Counterexample Guided Refinement: If all static/algebraic oracles return
SATorUNKNOWN,DynamicSimulationOraclesynthesizes worst-case corner parameters from the narrowed interval box and executes a numerical DAE simulation to either confirm satisfaction or extract a concrete counterexample trajectory.
# Run multi-domain formal verification across Modelica, SysML v2, and STEP artifacts
npx msx verify SystemRequirement model.mo architecture.sysml chassis.step
