Documentation
¶
Overview ¶
Package behavior contains validation passes over state machines, successions and control nodes.
Index ¶
Constants ¶
const ( // CodeControlNodeIncomingMultiplicity: a succession into a control node // writes a target multiplicity other than 1..1 // (validateControlNodeIncomingSuccessions). CodeControlNodeIncomingMultiplicity = "control-node-incoming-multiplicity" // CodeControlNodeOutgoingMultiplicity: a succession out of a control node // writes a source multiplicity other than 1..1 // (validateControlNodeOutgoingSuccessions). CodeControlNodeOutgoingMultiplicity = "control-node-outgoing-multiplicity" // CodeForkIncomingSuccessions: a fork node has more than one incoming // succession (validateForkNodeIncomingSuccessions). CodeForkIncomingSuccessions = "fork-incoming-successions" // CodeJoinOutgoingSuccessions: a join node has more than one outgoing // succession (validateJoinNodeOutgoingSuccessions). CodeJoinOutgoingSuccessions = "join-outgoing-successions" // CodeMergeIncomingMultiplicity: a succession into a merge node writes a // source multiplicity other than 0..1 (validateMergeNodeIncomingSuccessions). CodeMergeIncomingMultiplicity = "merge-incoming-multiplicity" // CodeMergeOutgoingSuccessions: a merge node has more than one outgoing // succession (validateMergeNodeOutgoingSuccessions). CodeMergeOutgoingSuccessions = "merge-outgoing-successions" // CodeDecisionIncomingSuccessions: a decision node has more than one // incoming succession (validateDecisionNodeIncomingSuccessions). CodeDecisionIncomingSuccessions = "decision-incoming-successions" // CodeDecisionOutgoingMultiplicity: a succession out of a decision node // writes a target multiplicity other than 0..1 // (validateDecisionNodeOutgoingSuccessions). CodeDecisionOutgoingMultiplicity = "decision-outgoing-multiplicity" )
Diagnostic codes for the bounds SysML v2 8.3.17 places on the successions of each control-node kind, one per validation constraint.
const CodeAccepterSourceNotState = "accepter-source-not-state"
CodeAccepterSourceNotState marks a transition with an accepter whose source is an action usage but no state usage (SysML v2.1 §8.3.18.9 validateTransitionUsageTriggerActions).
const CodeControlNodeOwner = "control-node-owner"
CodeControlNodeOwner marks a control node declared outside an action definition or usage (SysML v2 8.3.17.6 validateControlNodeOwningType).
const CodeEndpointNotANode = "endpoint-not-a-node"
CodeEndpointNotANode marks an action endpoint naming something other than an action node accepted by the action lowerer.
const CodeEndpointNotOfMachine = "endpoint-not-of-machine"
CodeEndpointNotOfMachine marks a transition endpoint naming a vertex the machine the transition belongs to does not own (UML 2.5.1 §14.2.3.9).
const CodeEntryTransitionShape = "entry-transition-shape"
CodeEntryTransitionShape marks a transition out of the entry action written with a trigger or an effect, which chooses a starting state by its guard alone (SysML v2 §7.18.3, EntryTransitionMember).
const CodeEntryTransitionTarget = "entry-transition-target"
CodeEntryTransitionTarget marks a transition out of the entry action whose target is a vertex but not a state the body can start in (SysML v2 §7.18.3).
const CodeNoOutgoingTransition = "no-outgoing-transition"
CodeNoOutgoingTransition marks a routing pseudostate no transition leaves, which a transition reaching it terminates nowhere at (UML 2.5.1 §15.7.18).
const CodeNoTransitionSource = "no-transition-source"
CodeNoTransitionSource marks a transition written without a source that no member precedes in its body (SysML v2 §7.18.3, TargetTransitionUsage).
const CodeParallelStateTransition = "parallel-state-transition"
CodeParallelStateTransition marks a succession or transition ordering the direct substates of a parallel state, which are concurrent (SysML v2 §7.16).
const CodeTransitionSourceNotVertex = "transition-source-not-vertex"
CodeTransitionSourceNotVertex marks a transition written without a source whose preceding member is not a vertex of the machine (SysML v2 §7.18.3).
const MsgAccepterSourceNotState = "A transition with an accepter must have a state as its source."
MsgAccepterSourceNotState is the pilot's wording of the same rule.
const MsgParallelStateTransition = "A parallel state cannot have successions or transitions."
MsgParallelStateTransition is the pilot's wording of the same rule.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionEndpointPass ¶
type ActionEndpointPass struct{}
ActionEndpointPass checks endpoints written in action bodies against the nodes accepted by action lowering.
func (ActionEndpointPass) ElementScoped ¶
func (ActionEndpointPass) ElementScoped()
ElementScoped lets each endpoint subject gate independently on lower failures.
func (ActionEndpointPass) Level ¶
func (ActionEndpointPass) Level() kit.PassLevel
Level reports that this pass consumes name-resolution results.
func (ActionEndpointPass) Run ¶
func (ActionEndpointPass) Run(ctx *kit.Context, name string, root *ast.RootNamespace) []diag.Diagnostic
Run checks named endpoints in every action body in the document.
type ActionStepMultiplicityPass ¶ added in v0.10.0
type ActionStepMultiplicityPass struct{}
ActionStepMultiplicityPass warns about action steps the runtime cannot execute according to their declared multiplicity.
func (ActionStepMultiplicityPass) ElementScoped ¶ added in v0.10.0
func (ActionStepMultiplicityPass) ElementScoped()
func (ActionStepMultiplicityPass) Level ¶ added in v0.10.0
func (ActionStepMultiplicityPass) Level() kit.PassLevel
func (ActionStepMultiplicityPass) Run ¶ added in v0.10.0
func (ActionStepMultiplicityPass) Run(ctx *kit.Context, name string, root *ast.RootNamespace) []diag.Diagnostic
type ControlNodeSuccessionPass ¶
type ControlNodeSuccessionPass struct{}
ControlNodeSuccessionPass checks the successions of fork, join, merge, and decision nodes against the bounds SysML v2 7.17.3 places on each kind, and that every control node is owned by an action definition or usage.
func (ControlNodeSuccessionPass) ElementScoped ¶
func (ControlNodeSuccessionPass) ElementScoped()
ElementScoped: each control node is its own subject.
func (ControlNodeSuccessionPass) Level ¶
func (ControlNodeSuccessionPass) Level() kit.PassLevel
func (ControlNodeSuccessionPass) Run ¶
func (ControlNodeSuccessionPass) Run(ctx *kit.Context, name string, root *ast.RootNamespace) []diag.Diagnostic
type StateTransitionPass ¶
type StateTransitionPass struct{}
StateTransitionPass checks that every transition names one source and one target vertex of its own machine (UML 2.5.1 §14.2.3.9), and that a routing pseudostate is left by one (§15.7.18).
func (StateTransitionPass) Level ¶
func (StateTransitionPass) Level() kit.PassLevel
Level reports the name-resolution level: resolved endpoints are all it reads.
func (StateTransitionPass) Run ¶
func (StateTransitionPass) Run(ctx *kit.Context, name string, root *ast.RootNamespace) []diag.Diagnostic
Run checks every state machine the document declares, and the source of every transition with an accepter wherever it is written.