Skip to content

Enforce Behavior Annex variable initialization 馃 - #3231

Merged
lwrage merged 2 commits into
masterfrom
3190_enforce_variable_initialization
Sep 16, 2026
Merged

lwrage merged 2 commits into
masterfrom
3190_enforce_variable_initialization

Conversation

@lwrage

@lwrage lwrage commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

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:

  • explicit and unprefixed property initialization;
  • declaration precedence over Data_Model::Initial_Value;
  • invalid declaration initializer types;
  • uninitialized transition-condition reads;
  • sequential, conditional, action-set, and state-merge flow.

The regression assets are in the first commit, followed by the production fix.

Validation

  • Focused Issue3190Test: 3 tests, 0 failures, 0 errors.
  • Complete BA reactor: 162 tests, 0 failures, 0 errors.
  • Characterization, translated-model, and validated-diagnostic baselines passed.
  • git diff --check passed.
  • All Maven commands used -Dxtext.generator.skip=true.

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.

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.
@lwrage
lwrage merged commit f400239 into master Sep 16, 2026
1 check passed
@lwrage
lwrage deleted the 3190_enforce_variable_initialization branch September 17, 2026 00:22
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.

Enforce Behavior Annex variable initialization rules 馃

2 participants