Skip to content

Require exactly one initial EMV2 behavior state 馃 - #3253

Merged
lwrage merged 2 commits into
masterfrom
2804_require_one_initial_state
Sep 18, 2026
Merged

lwrage merged 2 commits into
masterfrom
2804_require_one_initial_state

Conversation

@lwrage

@lwrage lwrage commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #2804

EMV2 error behavior state machines now require exactly one initial state, as specified by E.8 legality rule L32. The state-machine validator previously checked identifier uniqueness without checking the number of initial states.

Issue2804Test checks the diagnostics for a machine without an initial state, one with two initial states, and one with no states. A separate model verifies that one initial state is valid whether it is the only state or appears after a noninitial state. The regression failed before the fix because the expected diagnostic was absent; both tests pass afterward.

The EMV2 suite exposed four existing fixtures that omitted an initial state. Add the missing initial declarations so the transition, property-reference, and scope tests retain their original assertions.

Validation:

  • Focused offline Tycho clean verify with -Dtest=Issue2804Test: 2 tests passed.
  • Clean offline root-reactor clean install: 1,682 tests, 0 failures/errors/skips; all reactor projects passed. This includes all 300 EMV2 tests and the four repaired fixtures.
  • git diff --check passed.

Build flags: mvn -o -T5 -s releng/osate.releng/settings.xml -Plocal -Dpr.build=true -Dsign=false -Dspotbugs=false -Dcodecoverage=false -Djavadoc=false -DfailIfNoTests=false. The focused run uses -pl :org.osate.xtext.aadl2.errormodel,:org.osate.aadl2.errormodel.tests,:org.osate.xtext.aadl2.errormodel.feature -Dtycho.localArtifacts=default; the root run uses -Dtycho.localArtifacts=ignore clean install.

No dependency on another PR. Existing models with zero or multiple initial states will now receive the required validation error; parsing and instantiation are unchanged.

Check that EMV2 behavior state machines reject zero or multiple initial states, including a machine with no states. Preserve acceptance of exactly one initial state regardless of declaration order using a separate valid model.
Enforce E.8 legality rule L32 by requiring exactly one initial state in each error behavior state machine. Add missing initial declarations in four existing test fixtures so their transition and scoping assertions remain isolated from this new check.
@lwrage
lwrage merged commit 66b8642 into master Sep 18, 2026
1 check passed
@lwrage
lwrage deleted the 2804_require_one_initial_state branch September 18, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing validation for initial error behavior states

2 participants