Enforce Behavior Annex variable initialization 馃 - #3231
Merged
Merged
Conversation
Model explicit and property-based initialization together with initializer type errors and control-flow-dependent reads. Assert transition, conditional, action-set, and state-merge behavior while keeping the instance-dependent property case out of scope.
Validate explicit declaration initializer types and track definitely initialized local behavior variables through action control flow and state transitions. Treat unprefixed Data_Model::Initial_Value associations as declarative initialization, while leaving prefixed instance-dependent values to #3230.
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 #3190
Cause and correction
Behavior Annex validation preserved declaration initializers but did not validate their types or track whether local behavior variables were initialized before reads.
This change validates explicit initializer types and adds a declarative definite-initialization analysis over transition conditions, sequential actions, action sets, conditionals, loops, and behavior-state joins. Explicit declaration initializers and unprefixed Data_Model::Initial_Value associations initialize local variables. Property references do not read the runtime value of their prefix.
Existing acceptance fixtures now declare the initialization needed by their original scenarios, and the conformance/characterization baselines record the new behavior.
Regression coverage
Issue3190Test and its external AADL model project cover:
The regression assets are in the first commit, followed by the production fix.
Validation
A clean root reactor with -Dtycho.localArtifacts=ignore reached org.osate.alisa.common and then stopped because clean removed local Xsemantics output while the no-generation flag prevented recreation of CommonInterpreter and CommonTypeSystemValidator. The complete focused BA reactor was rerun successfully after that clean.
Dependencies and residual risk
This PR has no merge dependency. Instance-dependent initialization from prefixed property values is intentionally excluded and tracked by #3230, which is blocked by #3229. This checker therefore covers declarative local behavior variables only.
No BA grammar or aadlba metamodel files changed, and no EMF/Xtext source generation was run.