MBSE iNsightsMBSE iNsights

· 11 min read

Simulation in SysML v2: What the Spec Defines Today, and What Changes When Execution Is Standardized

SysML v2 and KerML say which executions of a model are legal, not how a tool must produce one, and the operational execution rules are not published yet. Here is what that means for any tool that simulates today, quoted from the specs, how SSR handles the open choices, and why the finished standard will make simulation results portable.

People ask me which SysML v2 tools can simulate. The short answer is that several tools will run a SysML v2 model for you today. The longer answer is the one that matters when you plan to use the results: there is no published standard yet that says how a SysML v2 model must execute. The language defines what a correct execution looks like. It does not yet define, step by step, how a tool has to produce one.

That distinction sounds academic until two tools give you two different answers for the same model, and both of them are right. This article explains why that can happen, with the spec text that says so. Then I show how one tool, the SysML v2 Semantic Reasoner (SSR) I’ve been building, deals with it. And I end with why I’m optimistic, because the work under way at the OMG fixes the very problem I’m about to describe.

Declarative semantics: what the specs actually define

SysML v2 sits on KerML, the Kernel Modeling Language, and KerML gives the language its formal meaning. The kind of meaning it gives is the key to everything else. Clause 8.4.3.1.2 of the KerML specification (v1.1, Beta 2, in the 2026-09 release) states it plainly:

The mathematical specification of Core semantics uses a model-theoretic approach.

In plain language: a model is a set of statements, and the semantics say which “worlds” make those statements true. A part definition with three required parts is satisfied by any world where each such part really has three. Nothing in that tells a computer what to do first.

Behavior works the same way. A succession, the first a then b you write between actions, is not an instruction. KerML clause 7.4.6.1 says:

Successions are binary connectors requiring their source and target features to identify Occurrences that are ordered in time.

Requiring is the operative word. A succession is a constraint on any legal execution: whatever happened, b did not start before a ended. It doesn’t say when b starts, or what else runs in between.

KerML is candid about this. Its informative Annex A, titled “Model Execution”, opens with:

The language semantics in this specification give conditions to check whether classifiers have been instantiated properly

and then describes an incremental procedure for building executions that pass that check, closing its overview with:

It covers the basic patterns needed to aid development of a complete execution procedure.

So the annex is guidance toward an execution procedure, labeled informative, and explicitly not the complete thing. The conformance clause follows the same line. A tool shows Semantic Conformance (KerML clause 2) by providing

a demonstrable way to interpret a syntactically conformant model (as defined above) according to the KerML semantics, e.g., via model execution, simulation, or reasoning, when and only when such interpretations are possible.

Execution, simulation and reasoning are all acceptable ways to show you honor the semantics. None of them is prescribed, and no algorithm is.

Declarative semantics are a strength. They make a model precise without committing it to one implementation, and they let a reasoner check a model without running it. But for simulation, they mean that wherever the semantics permit more than one execution, a simulator has to pick one, and the standard doesn’t yet say how. A few concrete places:

Decisions. SysML clause 8.4.13.4, on control nodes, says:

The semantics of a DecisionNode do not determine which of the outgoing Successions will have a value for any specific performance of the DecisionNode.

Guards narrow it: only a succession whose guard is true may be taken. But if two guards are true, or a branch has no guard, the language allows either branch. KerML’s annex describes decisions and merges as steps that “enable sequences to be selected during execution, rather than ahead of time in models” (A.3.7). Selected by what? That’s the tool’s call today.

Concurrency. SysML clause 7.18.1:

A parallel state is one whose substates are performed concurrently.

Concurrent means the semantics don’t order them. If one region assigns a value that another region reads at the same instant, a simulator that runs the regions one after the other in its own fixed order gets one answer, and one that runs them in the other order gets another. Both are legal executions of the model.

Which event gets dispatched. Here the library goes further than many people realize. KerML clause 9.2.11.1 says the transfer a state accepts is chosen by incomingTransferSort, and:

It defaults to earlierFirstIncomingTransferSort for Occurrences, including StatePerformances, which is true if the first Transfer ends (arrives) before the other.

That’s real operational guidance: first come, first served, along with run-to-completion and dispatch-once rules in the same clause. It also shows what’s still open. Two transfers that arrive at the same instant aren’t ordered by “earlier first”, and nothing else orders them.

Time and continuous behavior. The State Space Representation domain library (SysML clause 9.4.4) defines how a model states continuous dynamics, as a state vector and its derivative. Its Integrate calculation carries this doc comment:

Its actual implementation should be given by a solver.

The same idea appears for analysis cases in SysML clause 7.23.1: when an analysis is solved externally,

the analysis case specifies the analysis to be performed, but does not define how the analysis is actually executed.

That’s a sensible split. The model says what is being integrated; the solver says how. But a fixed-step Euler solver and an adaptive Runge–Kutta solver will put a threshold crossing at different times, so the same model gives different numbers.

What this means for tools that simulate today

Put those together and the consequence is unavoidable. Any tool that simulates SysML v2 today has had to make its own operational choices: dispatch order for simultaneous events, ordering of concurrent regions and branches, which branch a decision takes when more than one is allowed, how time advances, which solver runs and at what step. The specs permit those choices; they don’t make them. Two careful, well-built tools can make them differently and produce different traces from the same file, and neither one is wrong by the standard.

There’s a second, quieter consequence. “Simulate” often means something more than the model. A tool may expect an action language of its own in an opaque body, or attach a behavior written in a general-purpose language, or read a tool-specific annotation to know what to run. Those models only run in that tool. That’s not bad engineering; it’s what you do when the standard stops short. But the model is no longer the whole story, and it doesn’t travel.

SysML v1 users know a version of this. For UML, the OMG published fUML, an operational execution model for a subset of UML classes and activities, and PSSM, which does the same for state machines. Neither is part of the SysML v1 specification, but simulation tools for v1 commonly build on them, so there was at least a common reference for what an activity or a state machine does step by step. SysML v2 doesn’t have its equivalent yet.

The OMG knows this. It has groups working on precisely this problem, including an execution working group and a formal methods working group, toward published operational execution rules for KerML and SysML v2. That work is in progress and hasn’t been released. Until it is, I’d treat every SysML v2 simulation result, from any tool, as “this tool’s legal execution of the model”, not “the model’s execution”.

How SSR handles it: run what’s normative, ask about the rest

SSR is my SysML v2 Semantic Reasoner. It isn’t publicly released yet, so treat what follows as a description of an approach, not a product pitch. I made three rules for its simulator, and each one comes straight from the spec situation above.

It runs only what KerML and SysML define. No action language of its own, no annotations a model has to carry to be runnable. It runs state machines, action flows, sends and accepts, at, after and when triggers, and continuous dynamics written with the standard State Space Representation library. Where the library gives a rule, such as earliest-first dispatch, run-to-completion, or accept-once, it follows that rule. A construct it can’t execute is listed with the reason, never silently skipped.

Every value comes from the reasoner. An assignment’s value is the reasoner’s own evaluation of the expression, applied to the model as a what-if change. A derived value bound with = is re-derived. A requirement’s verdict at each moment is the same verdict the reasoner gives a model at rest. There is no second, simulation-only interpretation of the model.

Where the spec leaves a choice open, it stops and asks. Two transitions enabled by one event, two guards true at a decision, concurrent regions where one changes what the other reads, two arrivals at one instant: the run pauses and offers the options. It never picks. Your answer goes into the run’s trace, along with every input. Concurrent work that doesn’t interfere isn’t asked about, so when it does ask, the question is a real one.

Here’s what a run looks like. The traffic light example is a crossing controller on two timers, thirty seconds of stop and twenty of go, telling two lamps what to show by sending items through its ports.

The traffic light at normal speed. When the 30-second timer fires, the transition it takes lights for a moment, a token running along it, and go takes the halo. On the timeline, the controller moves from stop to go, the red lamp goes dark, and the green lamp shines.

A pedestrian request has a guard on a counter of finished cycles. Sent at 35 seconds, before a full cycle, it isn’t accepted, and the log says why. Sent at 85 seconds, it is.

The water tank: met at rest, violated in a run

The example I find most useful is a tank. One part, two regions in parallel. One samples the level every second; the other watches the level with change events and opens or closes a valve. This is the model, as written in the example file:

part def Tank {
    attribute level : Real := 1.9;
    attribute inflow : Real := 0.25;
    attribute valve : Real := 0;

    exhibit state operation parallel {
        state dynamics {
            entry; then sampling;
            state sampling {
                entry assign level := level + inflow - inflow * valve * 2;
            }
            transition sample first sampling accept after 1 [s] then sampling;
        }
        state control {
            entry; then closed;
            state closed {
                entry assign valve := 0;
            }
            state open {
                entry assign valve := 1;
            }
            transition tooHigh first closed accept when level >= 3.0 then open;
            transition tooLow first open accept when level <= 1.0 then closed;
        }
    }
}

part tank : Tank;

requirement levelBand {
    doc /* The level stays between 1.0 and 3.0. */
    subject t : Tank;
    require constraint { t.level <= 3.0 and t.level >= 1.0 }
}
satisfy levelBand by tank;
A state transition view of the exhibit state operation, marked parallel. It contains two states. The state dynamics has an initial pseudostate into sampling, whose state actions read entry assign level := level + inflow - inflow * valve * 2, and a self-transition on sampling, a loop below it labeled after 1 [s]. The state control has an initial pseudostate into closed, a transition from closed to open labeled when level >= 3.0, and a transition from open to closed labeled when level <= 1.0. Each of closed and open lists its entry assignment to valve.
The tank's exhibited state, drawn by SSR's view renderer: two concurrent regions, one sampling the level every second, one opening and closing the valve on change events.

At rest, the reasoner says levelBand is met: the level starts at 1.9. Run it, and the verdict changes.

The level climbs a quarter each second. At t = 4 s it reads 3.15, the value turns red, and on the timeline the reasoner's own verdict on levelBand turns from met to violated.

At four seconds the level is 3.15, above the band, before the controller reacts. The valve opens, the level falls, and at thirteen seconds it undershoots to 0.9. A controller that reacts to a sampled level always reacts one sample late, and the run shows by how much. The requirement is met by the model as written and violated by the model as run. That is exactly the kind of thing you simulate to find.

Notice what this model doesn’t make you choose. The two regions are concurrent and both touch level, but the control region only observes it through change events, which are checked after every change whatever the order, so SSR has nothing to ask. Change the model so both regions assign level at the same instant, and the run will stop and ask you which goes first, because the spec doesn’t say.

The timeline, and runs that replay

Every step of a run records a snapshot, so the timeline under the run panel can rewind the whole view without running anything again.

The tank's state machine, then its timeline. Each sample is the self-transition lighting as it fires; at 4 s the controller opens the valve. The band for levelBand is red where it was violated, and scrubbing back rewinds the drawing, the values and the verdict from recorded snapshots.

The trace is the part I care most about. It holds the model’s fingerprint, every input with its time, and every answer to an open choice, and it’s deterministic and hashed. Replay it and you get the same bytes:

Terminal output. cat crossing-run.json shows two inputs, PedestrianRequest to the controller at 35 and at 85. ssr simulate 48-traffic-light.sysml with that script until 120 prints: at t = 35 the request is not accepted because no transition out of the active states accepts it now; at t = 85 the controller enters requested on PedestrianRequest. The trace is saved under .ssr/runs with its SHA-256 hash. ssr simulate with --replay prints, in green, replayed: identical, byte for byte, with the same hash.
A scripted run of the traffic light with pedestrian requests at 35 s and 85 s, kept as a trace beside the model, then replayed: identical, byte for byte.

That makes a run usable as evidence. A verification case written with the PassIf(requirement(subject)) idiom can take its verdict from a saved run, and the verdict is recomputed from the trace every time the model is read. Change the model and the run goes stale and counts for nothing until you run it again. The open choices you answered are part of that record, so a reviewer can see not just the result, but every place the tool needed a decision the standard didn’t make.

Action flows, the same way

Actions run as token flow with the same rules. In the bottling line, the filler forks to rinse and load labels, joins, fills one bottle a second in a loop, and sends each bottle to the capper. At the end, a decision releases a full batch or else holds it.

The bottling line's action flow at half speed. Each succession lights while it fires, a token running along it; the actions going on are haloed. The timeline plots filled and capped stepping up as bottles are filled and capped.

For the instant a bottle is in flight between the filler and the capper, the requirement that no filled bottle is left uncapped is violated, and then met again when the capper takes it. If the decision at the end could go both ways, the run would ask.

If you’d rather watch all three models run with narration, I walk through them in this video.

Why I’m optimistic

None of this is a complaint about SysML v2. Getting the declarative semantics right first was the correct order. It’s why a reasoner can check a SysML v2 model without running it, and it’s the foundation any execution rules have to be consistent with. The execution work builds on that, and when it’s published, several things change at once.

Models become interchangeable for behavior, not just structure. SysML v2 already has a standard textual notation, a standard interchange format and a standard API. Add a published operational semantics and a model that runs in one tool runs in another, with no tool-specific action language holding it hostage.

Different tools give the same results. Today, two tools that disagree can both be right. With standard execution rules, they agree, or one of them has a bug you can point to in a clause. Where the rules deliberately leave something open, the open point is named in the standard, and tools can handle it the same way: ask, record, replay.

A trace becomes evidence across tools. If the rules define what a step is and what gets recorded, a run from one tool can be checked by another. That matters for verification. “The model, run under the standard semantics with these inputs and these answers, violates the requirement at four seconds” is a statement anybody with a conforming tool can confirm. That’s a much stronger kind of evidence than a screenshot from a simulator nobody else can run.

Vendors compete on experience, not on private semantics. The best tools will win on how well they show a run, how fast they are, how they connect to hardware and to solvers, and how clearly they explain a failure. Not on whose in-house interpretation your models are locked into.

I built SSR’s simulator to be ready for that. It runs only what the specs define, it never invents an answer where they’re silent, and it records every answer it was given. When the execution rules are published, the places where SSR asks today become places where the standard answers, and I expect most of those questions simply to go away. Until then, my advice for any SysML v2 simulation, in any tool, is the same: know which choices the tool made for you, and keep the record of them with the result.

Get the next article by email

One email when a new article goes live, usually Thursday morning. SysML v2 and MBSE practice, no filler. Unsubscribe with one click.

More of this, on video

Walkthroughs in SysML v2 and MBSE tooling, with the model on screen.

Subscribe on YouTube