Verifying SysML v2 Models
In Live
Open Live, pick one of its SysML v2 examples in the toolbar or write your own model, and press Verify all.
On Your Machine
semantifyr-sysml verify model.sysml
In VS Code, see Try in VS Code. To install either, see Install.
Writing a Verification Case
Requirements use three calculation definitions, which Semantifyr recognizes by their names:
private import ScalarValues::Boolean;
calc def <EF> eventually {
in op: Boolean[1];
return : Boolean[1];
}
calc def <AG> mustAlways {
in op: Boolean[1];
return : Boolean[1];
}
calc def isStateActive {
in state s[1];
return : Boolean[1];
}
eventually (short name EF) states that some execution reaches a situation, mustAlways (short name AG) that every execution stays in one, and isStateActive asks whether a state is active.
A verification case is a verification def whose subject is the system under verification and whose objective is a requirement over it:
verification def LampLitReachable {
subject system : Room;
objective {
verify requirement {
require constraint {
eventually(
isStateActive(system.lamp.Behaviour.Lit)
)
}
}
}
}
To build a model and its cases step by step, see Lesson: A Switch and a Lamp.