Defer EMV2 sums for undefined branch probabilities 馃 - #3257
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 stateandothersbranches remain errors, and fully known probability sums are still checked.Issue2821Testuses external models to cover extension, containment, deferred state-machine properties, known values, andothers. 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:
clean verifywith-Dtest=Issue2821Test: 2 tests passed.clean install: 1,692 tests passed, including all 310 EMV2 tests; 0 failures/errors/skips.git diff --checkpassed.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.