Skip to content

Defer EMV2 sums for undefined branch probabilities 馃 - #3257

Merged
lwrage merged 2 commits into
masterfrom
2821_defer_undefined_branch_probabilities
Sep 18, 2026
Merged

lwrage merged 2 commits into
masterfrom
2821_defer_undefined_branch_probabilities

Conversation

@lwrage

@lwrage lwrage commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Fixes #2821

Branch-probability validation now defers the sum check when any referenced probability property has no value in the current context. Previously, an undefined property contributed zero to the sum, so a valid reusable classifier or state machine could receive an error before a value was supplied through extension or containment.

The validator records missing values while continuing to inspect every branch, then skips only the total-probability checks. Duplicate same state and others branches remain errors, and fully known probability sums are still checked.

Issue2821Test uses external models to cover extension, containment, deferred state-machine properties, known values, and others. Invalid controls assert duplicate-branch diagnostics and incorrect known sums. The pre-fix tests reproduced false sum diagnostics for the undefined properties.

Update the existing property-reference scope test to accept its undefined library probability. Its known-invalid component probability still expects the sum error, and all scope assertions are preserved.

Validation:

  • Focused offline Tycho clean verify with -Dtest=Issue2821Test: 2 tests passed.
  • Clean offline root-reactor clean install: 1,692 tests passed, including all 310 EMV2 tests; 0 failures/errors/skips.
  • 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 and EMV2 suite runs use -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 unmerged PR. Decimal precision is addressed independently in #3256. This change defers a sum that cannot be determined in the declarative context; it does not change property lookup or instantiation.

Cover undefined branch probability properties supplied through extension or containment and deferred library-state-machine probabilities. Require structural duplicate-branch diagnostics and fully known sum checks to remain active.
Skip probability-total checks when a referenced property has no value in the current context, allowing extension and containment to supply it later. Continue structural branch checks and known sums, and update the scope test that expected the old false diagnostic.
@lwrage
lwrage merged commit a30e769 into master Sep 18, 2026
1 check passed
@lwrage
lwrage deleted the 2821_defer_undefined_branch_probabilities 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.

Validator should not check branch probabilities when a probability property is undefined

2 participants