From 97d59f56a77bc6dd2858af8baff5514bc67fff91 Mon Sep 17 00:00:00 2001 From: Lutz Wrage Date: Tue, 15 Sep 2026 11:38:36 -0400 Subject: [PATCH 1/2] Add regression test for issue #3190 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. --- ...ts_models_issue3190_DefiniteAssignment.txt | 4 + ...tests_models_issue3190_InitializerType.txt | 1 + ...te.ba.tests_models_issue3190_Issue3190.txt | 0 ...ts_models_issue3190_DefiniteAssignment.txt | 0 ...tests_models_issue3190_InitializerType.txt | 0 ...te.ba.tests_models_issue3190_Issue3190.txt | 0 ...ts_models_issue3190_DefiniteAssignment.txt | 91 ++++++++++++++ ...tests_models_issue3190_InitializerType.txt | 10 ++ ...te.ba.tests_models_issue3190_Issue3190.txt | 36 ++++++ ...ts_models_issue3190_DefiniteAssignment.txt | 112 ++++++++++++++++++ ...tests_models_issue3190_InitializerType.txt | 7 ++ ...te.ba.tests_models_issue3190_Issue3190.txt | 33 ++++++ ...ts_models_issue3190_DefiniteAssignment.txt | 27 +++++ ...tests_models_issue3190_InitializerType.txt | 11 ++ ...te.ba.tests_models_issue3190_Issue3190.txt | 15 +++ .../models/issue3190/.gitignore | 2 + .../models/issue3190/.project | 18 +++ .../models/issue3190/DefiniteAssignment.aadl | 58 +++++++++ .../models/issue3190/InitializerType.aadl | 40 +++++++ .../models/issue3190/Issue3190.aadl | 47 ++++++++ .../src/org/osate/ba/tests/Issue3190Test.java | 92 ++++++++++++++ 21 files changed, 604 insertions(+) create mode 100644 ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3190_InitializerType.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3190_Issue3190.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3190_InitializerType.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3190_Issue3190.txt create mode 100644 ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt create mode 100644 ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3190_InitializerType.txt create mode 100644 ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3190_Issue3190.txt create mode 100644 ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt create mode 100644 ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3190_InitializerType.txt create mode 100644 ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3190_Issue3190.txt create mode 100644 ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt create mode 100644 ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3190_InitializerType.txt create mode 100644 ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3190_Issue3190.txt create mode 100644 ba/org.osate.ba.tests/models/issue3190/.gitignore create mode 100644 ba/org.osate.ba.tests/models/issue3190/.project create mode 100644 ba/org.osate.ba.tests/models/issue3190/DefiniteAssignment.aadl create mode 100644 ba/org.osate.ba.tests/models/issue3190/InitializerType.aadl create mode 100644 ba/org.osate.ba.tests/models/issue3190/Issue3190.aadl create mode 100644 ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3190Test.java diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt new file mode 100644 index 00000000000..c82a31eb993 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt @@ -0,0 +1,4 @@ +error | semantic | 43 | 12 | 10 | Behavior variable 'guardValue' may be read before it is initialized +error | semantic | 48 | 15 | 11 | Behavior variable 'branchValue' may be read before it is initialized +error | semantic | 49 | 33 | 8 | Behavior variable 'setValue' may be read before it is initialized +error | semantic | 54 | 33 | 9 | Behavior variable 'pathValue' may be read before it is initialized diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3190_InitializerType.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3190_InitializerType.txt new file mode 100644 index 00000000000..722d9f98516 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3190_InitializerType.txt @@ -0,0 +1 @@ +error | semantic | 33 | 35 | 1 | type error for 'behavior variable initializer', 'Base_Types::Boolean' expected, found 'universal integer'. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3190_Issue3190.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3190_Issue3190.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3190_InitializerType.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3190_InitializerType.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3190_Issue3190.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3190_Issue3190.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt new file mode 100644 index 00000000000..b38c32a27a1 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt @@ -0,0 +1,91 @@ +annex[0] owner=DefiniteAssignment::subject.impl + (AssignmentAction, , 2284, 14) + (AssignmentAction, , 2304, 19) + (AssignmentAction, , 2344, 16) + (AssignmentAction, , 2373, 21) + (AssignmentAction, , 2402, 13) + (AssignmentAction, , 2418, 18) + (AssignmentAction, , 2475, 14) + (AssignmentAction, , 2566, 19) + (BehaviorActionBlock, , 2278, 165) + (BehaviorActionBlock, , 2400, 38) + (BehaviorActionBlock, , 2473, 18) + (BehaviorActionBlock, , 2564, 23) + (BehaviorActionSequence, , 2284, 154) + (BehaviorActionSet, , 2402, 34) + (BehaviorAnnex, behavior_specification, 1953, 668) + (BehaviorBooleanLiteral, , 2001, 4) + (BehaviorCondition, , 2237, 10) + (BehaviorCondition, , 2455, 9) + (BehaviorCondition, , 2503, 9) + (BehaviorCondition, , 2600, 11) + (BehaviorIntegerLiteral, , 2297, 1) + (BehaviorIntegerLiteral, , 2359, 1) + (BehaviorIntegerLiteral, , 2414, 1) + (BehaviorIntegerLiteral, , 2488, 1) + (BehaviorState, join, 2165, 4) + (BehaviorState, left, 2152, 4) + (BehaviorState, ready, 2182, 5) + (BehaviorState, right, 2158, 5) + (BehaviorState, start, 2126, 5) + (BehaviorStateGroup, , 2126, 22) + (BehaviorStateGroup, , 2152, 26) + (BehaviorStateGroup, , 2182, 29) + (BehaviorTransition, , 2229, 28) + (BehaviorTransition, , 2261, 183) + (BehaviorTransition, , 2448, 44) + (BehaviorTransition, , 2496, 26) + (BehaviorTransition, , 2526, 17) + (BehaviorTransition, , 2547, 41) + (BehaviorTransition, , 2592, 29) + (BehaviorVariable, branchValue, 2047, 11) + (BehaviorVariable, condition, 1966, 9) + (BehaviorVariable, guardValue, 2010, 10) + (BehaviorVariable, pathValue, 2070, 9) + (BehaviorVariable, safeValue, 2081, 9) + (BehaviorVariable, setValue, 2060, 8) + (BehaviorVariableGroup, , 1966, 40) + (BehaviorVariableGroup, , 2010, 33) + (BehaviorVariableGroup, , 2047, 66) + (DispatchCondition, , 2603, 8) + (ExecuteCondition, , 2237, 10) + (ExecuteCondition, , 2455, 9) + (ExecuteCondition, , 2503, 9) + (IfStatement, , 2329, 38) + (Reference, , 2237, 10) + (Reference, , 2284, 9) + (Reference, , 2304, 6) + (Reference, , 2314, 9) + (Reference, , 2333, 9) + (Reference, , 2344, 11) + (Reference, , 2373, 6) + (Reference, , 2383, 11) + (Reference, , 2402, 8) + (Reference, , 2418, 6) + (Reference, , 2428, 8) + (Reference, , 2455, 9) + (Reference, , 2475, 9) + (Reference, , 2566, 6) + (Reference, , 2576, 9) + (ReferenceExpression, , 2237, 10) + (ReferenceExpression, , 2314, 9) + (ReferenceExpression, , 2333, 9) + (ReferenceExpression, , 2383, 11) + (ReferenceExpression, , 2428, 8) + (ReferenceExpression, , 2455, 9) + (ReferenceExpression, , 2576, 9) + (ReferenceSegment, branchValue, 2344, 11) + (ReferenceSegment, branchValue, 2383, 11) + (ReferenceSegment, condition, 2333, 9) + (ReferenceSegment, condition, 2455, 9) + (ReferenceSegment, guardValue, 2237, 10) + (ReferenceSegment, output, 2304, 6) + (ReferenceSegment, output, 2373, 6) + (ReferenceSegment, output, 2418, 6) + (ReferenceSegment, output, 2566, 6) + (ReferenceSegment, pathValue, 2475, 9) + (ReferenceSegment, pathValue, 2576, 9) + (ReferenceSegment, safeValue, 2284, 9) + (ReferenceSegment, safeValue, 2314, 9) + (ReferenceSegment, setValue, 2402, 8) + (ReferenceSegment, setValue, 2428, 8) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3190_InitializerType.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3190_InitializerType.txt new file mode 100644 index 00000000000..12728f9fee2 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3190_InitializerType.txt @@ -0,0 +1,10 @@ +annex[0] owner=InitializerType::invalid_initializer.impl + (BehaviorAnnex, behavior_specification, 1930, 143) + (BehaviorCondition, , 2052, 11) + (BehaviorIntegerLiteral, , 1974, 1) + (BehaviorState, ready, 1989, 5) + (BehaviorStateGroup, , 1989, 37) + (BehaviorTransition, , 2044, 29) + (BehaviorVariable, wrong, 1943, 5) + (BehaviorVariableGroup, , 1943, 33) + (DispatchCondition, , 2055, 8) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3190_Issue3190.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3190_Issue3190.txt new file mode 100644 index 00000000000..19ae78abf94 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3190_Issue3190.txt @@ -0,0 +1,36 @@ +annex[0] owner=Issue3190::initialized.impl + (AssignmentAction, , 2308, 54) + (BehaviorActionBlock, , 2302, 65) + (BehaviorAnnex, behavior_specification, 1974, 394) + (BehaviorCondition, , 2281, 11) + (BehaviorIntegerLiteral, , 2026, 1) + (BehaviorIntegerLiteral, , 2150, 1) + (BehaviorPropertyAssociation, , 2067, 35) + (BehaviorPropertyAssociation, , 2154, 48) + (BehaviorState, ready, 2218, 5) + (BehaviorStateGroup, , 2218, 37) + (BehaviorTransition, , 2273, 95) + (BehaviorVariable, byDeclaration, 1987, 13) + (BehaviorVariable, byProperty, 2032, 10) + (BehaviorVariable, declarationWins, 2109, 15) + (BehaviorVariableGroup, , 1987, 41) + (BehaviorVariableGroup, , 2032, 73) + (BehaviorVariableGroup, , 2109, 96) + (BinaryExpression, , 2318, 26) + (BinaryExpression, , 2318, 44) + (DispatchCondition, , 2284, 8) + (ListValue, , 2096, 5) + (ListValue, , 2183, 18) + (Reference, , 2308, 6) + (Reference, , 2318, 13) + (Reference, , 2334, 10) + (Reference, , 2347, 15) + (ReferenceExpression, , 2318, 13) + (ReferenceExpression, , 2334, 10) + (ReferenceExpression, , 2347, 15) + (ReferenceSegment, byDeclaration, 2318, 13) + (ReferenceSegment, byProperty, 2334, 10) + (ReferenceSegment, declarationWins, 2347, 15) + (ReferenceSegment, output, 2308, 6) + (StringLiteral, , 2097, 3) + (StringLiteral, , 2184, 16) diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt new file mode 100644 index 00000000000..9d8a91e798b --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt @@ -0,0 +1,112 @@ +annex[0] owner=DefiniteAssignment::subject.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=condition + ownedValueConstant : BehaviorBooleanLiteral + variables[1] : BehaviorVariable name=guardValue + variables[2] : BehaviorVariable name=branchValue + variables[3] : BehaviorVariable name=setValue + variables[4] : BehaviorVariable name=pathValue + variables[5] : BehaviorVariable name=safeValue + states[0] : BehaviorState name=start + states[1] : BehaviorState name=left + states[2] : BehaviorState name=right + states[3] : BehaviorState name=join + states[4] : BehaviorState name=ready + transitions[0] : BehaviorTransition + condition : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=guardValue [BehaviorVariable] + transitions[1] : BehaviorTransition + transitions[2] : BehaviorTransition + condition : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=condition [BehaviorVariable] + transitions[3] : BehaviorTransition + condition : Otherwise + transitions[4] : BehaviorTransition + transitions[5] : BehaviorTransition + transitions[6] : BehaviorTransition + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=safeValue [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[1] : AssignmentAction + target : DataPortHolder element=DefiniteAssignment::subject.output [DataPort] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=safeValue [BehaviorVariable] + actions[2] : IfStatement + behaviorActions : AssignmentAction + target : BehaviorVariableHolder element=branchValue [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=condition [BehaviorVariable] + actions[3] : AssignmentAction + target : DataPortHolder element=DefiniteAssignment::subject.output [DataPort] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=branchValue [BehaviorVariable] + actions[4] : BehaviorActionBlock + content : BehaviorActionSet + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=setValue [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[1] : AssignmentAction + target : DataPortHolder element=DefiniteAssignment::subject.output [DataPort] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=setValue [BehaviorVariable] + actions[1] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=pathValue [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[2] : BehaviorActionBlock + content : AssignmentAction + target : DataPortHolder element=DefiniteAssignment::subject.output [DataPort] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=pathValue [BehaviorVariable] diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3190_InitializerType.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3190_InitializerType.txt new file mode 100644 index 00000000000..51fe065479c --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3190_InitializerType.txt @@ -0,0 +1,7 @@ +annex[0] owner=InitializerType::invalid_initializer.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=wrong + ownedValueConstant : BehaviorIntegerLiteral + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition + condition : DispatchCondition diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3190_Issue3190.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3190_Issue3190.txt new file mode 100644 index 00000000000..3c79435f8ff --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3190_Issue3190.txt @@ -0,0 +1,33 @@ +annex[0] owner=Issue3190::initialized.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=byDeclaration + ownedValueConstant : BehaviorIntegerLiteral + variables[1] : BehaviorVariable name=byProperty + ownedPropertyAssociations[0] : PropertyAssociation + ownedValue[0] : ModalPropertyValue + ownedValue : ListValue + ownedListElement[0] : StringLiteral + variables[2] : BehaviorVariable name=declarationWins + ownedPropertyAssociations[0] : PropertyAssociation + ownedValue[0] : ModalPropertyValue + ownedValue : ListValue + ownedListElement[0] : StringLiteral + ownedValueConstant : BehaviorIntegerLiteral + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : AssignmentAction + target : DataPortHolder element=Issue3190::initialized.output [DataPort] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=byDeclaration [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=byProperty [BehaviorVariable] + terms[2] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=declarationWins [BehaviorVariable] diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt new file mode 100644 index 00000000000..6f17e5abe6d --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3190_DefiniteAssignment.txt @@ -0,0 +1,27 @@ +===== annex[0] owner=DefiniteAssignment::subject.impl ===== + +\t\tvariables +\t\t\tcondition : Base_Types::Boolean := true; +\t\t\tguardValue : Base_Types::Boolean; +\t\t\tbranchValue, setValue, pathValue, safeValue : Base_Types::Integer; +\t\tstates +\t\t\tstart : initial state; +\t\t\tleft, right, join : state; +\t\t\tready : complete final state; +\t\ttransitions +\t\t\tstart -[guardValue]-> ready; +\t\t\tstart -[]-> left { +\t\t\t\tsafeValue := 1; +\t\t\t\toutput := safeValue; +\t\t\t\tif (condition) branchValue := 1 end if; +\t\t\t\toutput := branchValue; +\t\t\t\t{ setValue := 1 & output := setValue } +\t\t\t}; +\t\t\tleft -[condition]-> join { pathValue := 1 }; +\t\t\tleft -[otherwise]-> right; +\t\t\tright -[]-> join; +\t\t\tjoin -[]-> ready { output := pathValue }; +\t\t\tready -[on dispatch]-> ready; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3190_InitializerType.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3190_InitializerType.txt new file mode 100644 index 00000000000..0c03ae7926a --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3190_InitializerType.txt @@ -0,0 +1,11 @@ +===== annex[0] owner=InitializerType::invalid_initializer.impl ===== + +\t\tvariables +\t\t\twrong : Base_Types::Boolean := 1; +\t\tstates +\t\t\tready : initial complete final state; +\t\ttransitions +\t\t\tready -[on dispatch]-> ready; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3190_Issue3190.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3190_Issue3190.txt new file mode 100644 index 00000000000..016bcf2a3da --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3190_Issue3190.txt @@ -0,0 +1,15 @@ +===== annex[0] owner=Issue3190::initialized.impl ===== + +\t\tvariables +\t\t\tbyDeclaration : Base_Types::Integer := 1; +\t\t\tbyProperty : Base_Types::Integer { Data_Model::Initial_Value => ("2"); }; +\t\t\tdeclarationWins : Base_Types::Integer := 3 { Data_Model::Initial_Value => ("not an integer"); }; +\t\tstates +\t\t\tready : initial complete final state; +\t\ttransitions +\t\t\tready -[on dispatch]-> ready { +\t\t\t\toutput := byDeclaration + byProperty + declarationWins +\t\t\t}; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/models/issue3190/.gitignore b/ba/org.osate.ba.tests/models/issue3190/.gitignore new file mode 100644 index 00000000000..afce51184c6 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3190/.gitignore @@ -0,0 +1,2 @@ +/.aadlbin-gen/ +/instances/ diff --git a/ba/org.osate.ba.tests/models/issue3190/.project b/ba/org.osate.ba.tests/models/issue3190/.project new file mode 100644 index 00000000000..13f71e9391c --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3190/.project @@ -0,0 +1,18 @@ + + + issue3190 + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + + org.osate.core.aadlnature + org.eclipse.xtext.ui.shared.xtextNature + + diff --git a/ba/org.osate.ba.tests/models/issue3190/DefiniteAssignment.aadl b/ba/org.osate.ba.tests/models/issue3190/DefiniteAssignment.aadl new file mode 100644 index 00000000000..39dee2e4f9a --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3190/DefiniteAssignment.aadl @@ -0,0 +1,58 @@ +-- Copyright (c) 2004-2026 Carnegie Mellon University and others. (see Contributors file). +-- All Rights Reserved. +-- +-- NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY +-- KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE +-- OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT +-- MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. +-- +-- This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 +-- which is available at https://www.eclipse.org/legal/epl-2.0/ +-- SPDX-License-Identifier: EPL-2.0 +-- +-- Created, in part, with funding and support from the United States Government. (see Acknowledgments file). +-- +-- This program includes and/or can make use of certain third party source code, object code, documentation and other +-- files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system +-- configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and +-- conditions contained in any such Third Party Software or separate license file distributed with such Third Party +-- Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici- +-- aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li- +-- censes only apply to the Third Party Software and not any other portion of this program or this program as a whole. + +package DefiniteAssignment +public + with Base_Types; + + thread subject + features + output : out data port Base_Types::Integer; + end subject; + + thread implementation subject.impl + annex behavior_specification {** + variables + condition : Base_Types::Boolean := true; + guardValue : Base_Types::Boolean; + branchValue, setValue, pathValue, safeValue : Base_Types::Integer; + states + start : initial state; + left, right, join : state; + ready : complete final state; + transitions + start -[guardValue]-> ready; + start -[]-> left { + safeValue := 1; + output := safeValue; + if (condition) branchValue := 1 end if; + output := branchValue; + { setValue := 1 & output := setValue } + }; + left -[condition]-> join { pathValue := 1 }; + left -[otherwise]-> right; + right -[]-> join; + join -[]-> ready { output := pathValue }; + ready -[on dispatch]-> ready; + **}; + end subject.impl; +end DefiniteAssignment; diff --git a/ba/org.osate.ba.tests/models/issue3190/InitializerType.aadl b/ba/org.osate.ba.tests/models/issue3190/InitializerType.aadl new file mode 100644 index 00000000000..738439a4595 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3190/InitializerType.aadl @@ -0,0 +1,40 @@ +-- Copyright (c) 2004-2026 Carnegie Mellon University and others. (see Contributors file). +-- All Rights Reserved. +-- +-- NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY +-- KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE +-- OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT +-- MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. +-- +-- This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 +-- which is available at https://www.eclipse.org/legal/epl-2.0/ +-- SPDX-License-Identifier: EPL-2.0 +-- +-- Created, in part, with funding and support from the United States Government. (see Acknowledgments file). +-- +-- This program includes and/or can make use of certain third party source code, object code, documentation and other +-- files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system +-- configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and +-- conditions contained in any such Third Party Software or separate license file distributed with such Third Party +-- Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici- +-- aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li- +-- censes only apply to the Third Party Software and not any other portion of this program or this program as a whole. + +package InitializerType +public + with Base_Types; + + thread invalid_initializer + end invalid_initializer; + + thread implementation invalid_initializer.impl + annex behavior_specification {** + variables + wrong : Base_Types::Boolean := 1; + states + ready : initial complete final state; + transitions + ready -[on dispatch]-> ready; + **}; + end invalid_initializer.impl; +end InitializerType; diff --git a/ba/org.osate.ba.tests/models/issue3190/Issue3190.aadl b/ba/org.osate.ba.tests/models/issue3190/Issue3190.aadl new file mode 100644 index 00000000000..2914742d1c1 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3190/Issue3190.aadl @@ -0,0 +1,47 @@ +-- Copyright (c) 2004-2026 Carnegie Mellon University and others. (see Contributors file). +-- All Rights Reserved. +-- +-- NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY +-- KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE +-- OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT +-- MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. +-- +-- This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 +-- which is available at https://www.eclipse.org/legal/epl-2.0/ +-- SPDX-License-Identifier: EPL-2.0 +-- +-- Created, in part, with funding and support from the United States Government. (see Acknowledgments file). +-- +-- This program includes and/or can make use of certain third party source code, object code, documentation and other +-- files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system +-- configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and +-- conditions contained in any such Third Party Software or separate license file distributed with such Third Party +-- Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici- +-- aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li- +-- censes only apply to the Third Party Software and not any other portion of this program or this program as a whole. + +package Issue3190 +public + with Base_Types; + with Data_Model; + + thread initialized + features + output : out data port Base_Types::Integer; + end initialized; + + thread implementation initialized.impl + annex behavior_specification {** + variables + byDeclaration : Base_Types::Integer := 1; + byProperty : Base_Types::Integer { Data_Model::Initial_Value => ("2"); }; + declarationWins : Base_Types::Integer := 3 { Data_Model::Initial_Value => ("not an integer"); }; + states + ready : initial complete final state; + transitions + ready -[on dispatch]-> ready { + output := byDeclaration + byProperty + declarationWins + }; + **}; + end initialized.impl; +end Issue3190; diff --git a/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3190Test.java b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3190Test.java new file mode 100644 index 00000000000..6a21818ab9c --- /dev/null +++ b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3190Test.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) 2004-2026 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici- + * aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li- + * censes only apply to the Third Party Software and not any other portion of this program or this program as a whole. + */ +package org.osate.ba.tests; + +import static org.junit.Assert.assertEquals; + +import java.util.Comparator; +import java.util.List; + +import org.eclipse.xtext.diagnostics.Severity; +import org.eclipse.xtext.nodemodel.util.NodeModelUtils; +import org.eclipse.xtext.testing.InjectWith; +import org.eclipse.xtext.testing.XtextRunner; +import org.eclipse.xtext.testing.validation.ValidationTestHelper; +import org.eclipse.xtext.validation.Issue; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.osate.aadl2.AadlPackage; +import org.osate.testsupport.TestHelper; + +import com.google.inject.Inject; +import com.itemis.xtext.testing.XtextTest; + +/** Exercises the AS5506/3 Rev. A D.7 initialization rules. */ +@RunWith(XtextRunner.class) +@InjectWith(BehaviorAnnexInjectorProvider.class) +public class Issue3190Test extends XtextTest { + private static final String PATH = "org.osate.ba.tests/models/issue3190/"; + + @Inject + private TestHelper testHelper; + + @Inject + private ValidationTestHelper validationHelper; + + @Test + public void declarationAndUnprefixedPropertyInitializersInitializeLocalVariables() throws Exception { + var root = testHelper.parseFile(PATH + "Issue3190.aadl"); + validationHelper.assertNoIssues(root); + } + + @Test + public void declarationInitializerMustConformToVariableType() throws Exception { + assertDiagnostics("InitializerType", List.of(new Expected("1", + "type error for 'behavior variable initializer', 'Base_Types::Boolean' expected, found 'universal integer'."))); + } + + @Test + public void assignmentsMustDominateEveryRead() throws Exception { + assertDiagnostics("DefiniteAssignment", List.of( + new Expected("guardValue", "Behavior variable 'guardValue' may be read before it is initialized"), + new Expected("branchValue", "Behavior variable 'branchValue' may be read before it is initialized"), + new Expected("setValue", "Behavior variable 'setValue' may be read before it is initialized"), + new Expected("pathValue", "Behavior variable 'pathValue' may be read before it is initialized"))); + } + + private void assertDiagnostics(String model, List expected) throws Exception { + var root = testHelper.parseFile(PATH + model + ".aadl"); + var source = NodeModelUtils.getNode(root).getRootNode().getText(); + var issues = validationHelper.validate(root).stream().sorted(Comparator.comparing(Issue::getOffset)).toList(); + assertEquals(issues.toString(), expected.size(), issues.size()); + assertEquals(expected, issues.stream().map(issue -> { + assertEquals(Severity.ERROR, issue.getSeverity()); + var target = source.substring(issue.getOffset(), issue.getOffset() + issue.getLength()); + return new Expected(target, issue.getMessage()); + }).toList()); + } + + private record Expected(String target, String message) { + } +} From 811c6dbee2e5ee5ac493cde74a6fbba04847fe3e Mon Sep 17 00:00:00 2001 From: Lutz Wrage Date: Tue, 15 Sep 2026 11:39:03 -0400 Subject: [PATCH 2/2] Enforce BA variable initialization 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. --- ba/doc/conformance.md | 4 +- ...mples_standard_examples_ba_example_007.txt | 2 + ...tion_conformance_ShortCircuitOperators.txt | 53 +- ...s_models_covering_semantic_lr_D6_L3_L4.txt | 550 +++++++++--------- ...te.ba.tests_models_issue3169_Issue3169.txt | 53 +- ...te.ba.tests_models_issue3173_Issue3173.txt | 228 ++++---- ...te.ba.tests_models_issue3177_Issue3177.txt | 154 ++--- ...ests_models_issue3180_FieldAssignments.txt | 168 +++--- ...a.tests_models_issue3205_FieldDequeues.txt | 160 ++--- ...te.ba.tests_models_issue3226_Issue3226.txt | 66 ++- ...tion_conformance_ShortCircuitOperators.txt | 2 + ...s_models_covering_semantic_lr_D6_L3_L4.txt | 2 + ...te.ba.tests_models_issue3169_Issue3169.txt | 2 + ...te.ba.tests_models_issue3173_Issue3173.txt | 5 + ...te.ba.tests_models_issue3177_Issue3177.txt | 4 + ...ests_models_issue3180_FieldAssignments.txt | 8 + ...a.tests_models_issue3205_FieldDequeues.txt | 8 + ...te.ba.tests_models_issue3226_Issue3226.txt | 5 + ...tion_conformance_ShortCircuitOperators.txt | 2 +- ...s_models_covering_semantic_lr_D6_L3_L4.txt | 4 +- ...te.ba.tests_models_issue3169_Issue3169.txt | 2 +- ...te.ba.tests_models_issue3173_Issue3173.txt | 4 +- ...te.ba.tests_models_issue3177_Issue3177.txt | 8 +- ...ests_models_issue3180_FieldAssignments.txt | 4 +- ...a.tests_models_issue3205_FieldDequeues.txt | 4 +- ...te.ba.tests_models_issue3226_Issue3226.txt | 4 +- .../conformance/ShortCircuitOperators.aadl | 2 +- .../models/covering_semantic/lr_D6_L3_L4.aadl | 6 +- .../models/issue3169/Issue3169.aadl | 2 +- .../models/issue3173/Issue3173.aadl | 4 +- .../models/issue3177/Issue3177.aadl | 8 +- .../models/issue3180/FieldAssignments.aadl | 4 +- .../models/issue3205/FieldDequeues.aadl | 4 +- .../models/issue3226/Issue3226.aadl | 4 +- .../AadlBaInitializationChecker.java | 299 ++++++++++ .../osate/ba/analyzers/AadlBaTypeChecker.java | 31 + .../ba/validation/BehaviorAnnexValidator.java | 2 + 37 files changed, 1135 insertions(+), 737 deletions(-) create mode 100644 ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaInitializationChecker.java diff --git a/ba/doc/conformance.md b/ba/doc/conformance.md index be778fc0164..e7ed18b167e 100644 --- a/ba/doc/conformance.md +++ b/ba/doc/conformance.md @@ -61,7 +61,7 @@ The review itself was a source and test-artifact audit. No Maven tests, simulato | D.4: thread dispatch | Dispatch conjunction/disjunction, `stop`, bare timeout, timeout with a duration, and an unparenthesized frozen-port list. Selected timeout/stop checks exist. | Partial. Required frozen-list parentheses were missing (G03) and timeout reset ports absent (G04), both since fixed. Full protocol/trigger compatibility and core-property consistency are not demonstrated. | | D.5: component interactions | Port send/dequeue/freeze, count/fresh/updated, shared-data lock/unlock syntax, and subprogram-call syntax/model classes. | Partial. `updated` was absent (G07), internal events were represented incorrectly (G10), and outgoing ports were accepted for the three input-freeze status values, all since fixed; call-signature and remaining communication direction/category checks need additional coverage. Input/output timing consistency is not established. | | D.6: action language | Assignment/`any`, sequences and sets, blocks, conditionals, loops with a written or an omitted iterator classifier, timed actions and processor bindings. Conflicting assignments in action sets and static minimum/maximum computation-time checks exist. | Partial. Type conformance is disabled outright, so no assignment, send, dequeue, range, or parameter type mismatch is reported (G18). Optional loop classifiers were missing (G09) and are now implemented; loop-variable assignment rejection was not enforced by the existing covering-test expectation (G16, since fixed, though the dequeue form is still open as [#3205](https://github.com/osate/osate2/issues/3205)); action-timeout catch and combination rules are now checked (V03), while resource-release and signature obligations remain incomplete or unverified. | -| D.7: expressions | Boolean/numeric/string syntax, arithmetic/relational/logical operators, property references, indexing, and operator applicability checks per operand data representation. | Partial, with semantic preservation defects. Operand consistency between the two operands is not checked, only applicability of the operator to the first one (G18). Short-circuit logical operators, including in external conditions, and `updated` are now supported (#3166, #3169, and G07, since fixed), and value-expression precedence, association, admissible forms, and grouping now follow the document (G13, since fixed); numeric translation differs from the document, unary plus remains accepted as an extension but now produces a compatibility warning (G06), and initialization analysis is not demonstrated. | +| D.7: expressions | Boolean/numeric/string syntax, arithmetic/relational/logical operators, property references, indexing, and operator applicability checks per operand data representation. | Partial, with semantic preservation defects. Operand consistency between the two operands is not checked, only applicability of the operator to the first one (G18). Short-circuit logical operators, including in external conditions, and `updated` are now supported (#3166, #3169, and G07, since fixed), and value-expression precedence, association, admissible forms, and grouping now follow the document (G13, since fixed); numeric translation differs from the document, unary plus remains accepted as an extension but now produces a compatibility warning (G06), and declarative initializer typing and definite initialization are now checked (#3190). Instance-dependent initialization from prefixed property values remains #3230. | | D.8: synchronization | `Behavior_Properties::Subprogram_Call_Protocol` declares HSER/LSER/ASER and defaults to HSER, matching the supplied document. A client/server example exists. | Property definition conforms. Enforcement of the two LSER/ASER legality rules and execution of the protocols are not established. | Useful positive evidence includes [CoveringSyntaxTest](../../ba/org.osate.ba.tests/src/org/osate/ba/tests/CoveringSyntaxTest.xtend), [CoveringSemanticTest](../../ba/org.osate.ba.tests/src/org/osate/ba/tests/CoveringSemanticTest.xtend), [GrammarHazards.aadl](../../ba/org.osate.ba.tests/models/characterization/GrammarHazards.aadl), [BehaviorAnnexIntegrationTest](../../ba/org.osate.xtext.aadl2.ba.tests/src/org/osate/xtext/aadl2/ba/tests/BehaviorAnnexIntegrationTest.java), and [Issue3153Test](../../ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3153Test.java), [Issue3154Test](../../ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3154Test.java), and [Issue3155Test](../../ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3155Test.java). The latter tests establish specific diagnostic behavior and source locations, rather than general standard coverage. @@ -196,7 +196,7 @@ These are bounded findings from the inspected grammar/translator/checker path. E | V06 | D.4 protocol/trigger compatibility, legal trigger/frozen-port categories, and consistency with core dispatch/freeze properties. | The checker has dedicated timeout branches and a stop check, but no complete implementation of the document's protocol/trigger table was found. Dispatch references use generic `Reference` syntax. A rule implementing one timeout form is not evidence for all rows of the table. Test the matrix and invalid trigger direction/category through embedded source. | | V07 | D.5 C1/C2: BA freeze/send operations agree with `Input_Time`/`Output_Time`, or are absent where required. | No BA check referring to these properties was found in the active BA checker/translator/validator code. Core property validation alone does not establish agreement with BA actions. Use models that are individually legal on each side but inconsistent together. | | V08 | D.6: a complete state cannot be reached while shared data remains locked. | Lock/unlock syntax and holders exist; `Issue2372Test` checks resolved lock references. No path-sensitive lock-balance check was found. Cover a balanced path, an unreleased resource, alternative branches, loops, and wildcard lock/unlock. Parsing a lock operation does not establish this rule. | -| V09 | D.7: right-hand-side variables/data must be initialized; declaration initialization overrides the Data Modeling `Initial_Value` property. | Variable initialization is copied, but `checkBehaviorVariable` does not check the initializer's value/type, and no definite-initialization flow analysis was found. Verify declaration precedence, read-before-write, and branch-dependent initialization separately from basic expression type compatibility. | +| V09 | D.7: right-hand-side variables/data must be initialized; declaration initialization overrides the Data Modeling `Initial_Value` property. | Declaration initializer types and declarative definite initialization are checked by #3190. Explicit declaration initializers and unprefixed `Data_Model::Initial_Value` associations seed the analysis, with declaration initialization taking precedence. Instance-dependent initialization from prefixed property values is tracked by #3230 and blocked by #3229. | | V10 | D.7 property references are restricted to unitless properties or properties with time units. | Property reference machinery exists, but no explicit end-to-end check of this BA-specific restriction was identified. Add positive unitless/time cases and a property with another units type. Do not infer compliance merely because a property name resolves. | | V11 | D.8 LSER/ASER prohibits synchronous called-subprogram type and out/in-out parameters. | The [property set](../../ba/org.osate.ba.contrib/resources/properties/behavior_properties.aadl) matches the standard. Searches of BA and the core AADL validator found no checks consuming `Subprogram_Call_Protocol`; [ba_example_007.aadl](../../ba/org.osate.ba/examples/standard_examples/ba_example_007.aadl) describes the rules in comments but is not negative legality coverage. Add both prohibited combinations for both protocols. | diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba_examples_standard_examples_ba_example_007.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba_examples_standard_examples_ba_example_007.txt index 0269efa9516..6e7a05aa949 100644 --- a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba_examples_standard_examples_ba_example_007.txt +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba_examples_standard_examples_ba_example_007.txt @@ -3,3 +3,5 @@ error | linking | 65 | 56 | 4 | Couldn't resolve reference to Property Constant, error | linking | 65 | 7 | 45 | Couldn't resolve reference to property definition 'Behavior_Properties::Subprogram_Call_Protocol'. error | linking | 67 | 56 | 4 | Couldn't resolve reference to Property Constant, Property Definition, Enumeration or Unit literal 'HSER'. For classifier references use classifier( ). error | linking | 67 | 7 | 45 | Couldn't resolve reference to property definition 'Behavior_Properties::Subprogram_Call_Protocol'. +error | semantic | 54 | 12 | 1 | Behavior variable 'x' may be read before it is initialized +error | semantic | 92 | 27 | 1 | Behavior variable 'v' may be read before it is initialized diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_characterization_conformance_ShortCircuitOperators.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_characterization_conformance_ShortCircuitOperators.txt index 5ab4a3f0fc1..273c46321c3 100644 --- a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_characterization_conformance_ShortCircuitOperators.txt +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_characterization_conformance_ShortCircuitOperators.txt @@ -1,29 +1,30 @@ annex[0] owner=ShortCircuitOperators::operation - (BehaviorAnnex, behavior_specification, 216, 246) - (BehaviorCondition, , 368, 19) - (BehaviorCondition, , 432, 18) - (BehaviorState, finish, 300, 6) - (BehaviorState, start, 275, 5) - (BehaviorStateGroup, , 275, 21) - (BehaviorStateGroup, , 300, 20) - (BehaviorTransition, and_then_transition, 338, 61) - (BehaviorTransition, or_else_transition, 403, 59) + (BehaviorAnnex, behavior_specification, 216, 255) + (BehaviorBooleanLiteral, , 265, 5) + (BehaviorCondition, , 377, 19) + (BehaviorCondition, , 441, 18) + (BehaviorState, finish, 309, 6) + (BehaviorState, start, 284, 5) + (BehaviorStateGroup, , 284, 21) + (BehaviorStateGroup, , 309, 20) + (BehaviorTransition, and_then_transition, 347, 61) + (BehaviorTransition, or_else_transition, 412, 59) (BehaviorVariable, left, 229, 4) (BehaviorVariable, right, 235, 5) - (BehaviorVariableGroup, , 229, 33) - (BinaryExpression, , 368, 19) - (BinaryExpression, , 432, 18) - (ExecuteCondition, , 368, 19) - (ExecuteCondition, , 432, 18) - (Reference, , 368, 4) - (Reference, , 382, 5) - (Reference, , 432, 4) - (Reference, , 445, 5) - (ReferenceExpression, , 368, 4) - (ReferenceExpression, , 382, 5) - (ReferenceExpression, , 432, 4) - (ReferenceExpression, , 445, 5) - (ReferenceSegment, left, 368, 4) - (ReferenceSegment, left, 432, 4) - (ReferenceSegment, right, 382, 5) - (ReferenceSegment, right, 445, 5) + (BehaviorVariableGroup, , 229, 42) + (BinaryExpression, , 377, 19) + (BinaryExpression, , 441, 18) + (ExecuteCondition, , 377, 19) + (ExecuteCondition, , 441, 18) + (Reference, , 377, 4) + (Reference, , 391, 5) + (Reference, , 441, 4) + (Reference, , 454, 5) + (ReferenceExpression, , 377, 4) + (ReferenceExpression, , 391, 5) + (ReferenceExpression, , 441, 4) + (ReferenceExpression, , 454, 5) + (ReferenceSegment, left, 377, 4) + (ReferenceSegment, left, 441, 4) + (ReferenceSegment, right, 391, 5) + (ReferenceSegment, right, 454, 5) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_covering_semantic_lr_D6_L3_L4.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_covering_semantic_lr_D6_L3_L4.txt index d6c9a8270ef..b3d76abc3ad 100644 --- a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_covering_semantic_lr_D6_L3_L4.txt +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_covering_semantic_lr_D6_L3_L4.txt @@ -1,280 +1,282 @@ annex[0] owner=exemple_lr_D6_L3_D6_L4::th.good - (ArrayIndex, , 1934, 3) - (ArrayIndex, , 1980, 3) - (ArrayIndex, , 2719, 3) - (AssignmentAction, , 1801, 6) - (AssignmentAction, , 1825, 6) - (AssignmentAction, , 1850, 6) - (AssignmentAction, , 1859, 6) - (AssignmentAction, , 1885, 13) - (AssignmentAction, , 1901, 13) - (AssignmentAction, , 1933, 9) - (AssignmentAction, , 1945, 6) - (AssignmentAction, , 1970, 18) - (AssignmentAction, , 1991, 15) - (AssignmentAction, , 2232, 6) - (AssignmentAction, , 2241, 6) - (AssignmentAction, , 2347, 5) - (AssignmentAction, , 2530, 6) - (AssignmentAction, , 2709, 18) - (AssignmentAction, , 3066, 10) - (AssignmentAction, , 3380, 6) - (AssignmentAction, , 3475, 6) - (AssignmentAction, , 3597, 15) - (BehaviorActionBlock, , 1800, 8) - (BehaviorActionBlock, , 1823, 10) - (BehaviorActionBlock, , 1824, 8) - (BehaviorActionBlock, , 1848, 19) - (BehaviorActionBlock, , 1883, 33) - (BehaviorActionBlock, , 1931, 22) - (BehaviorActionBlock, , 1968, 40) - (BehaviorActionBlock, , 2023, 1604) - (BehaviorActionBlock, , 2205, 66) - (BehaviorActionBlock, , 2307, 585) - (BehaviorActionBlock, , 2393, 462) - (BehaviorActionBlock, , 2485, 93) - (BehaviorActionBlock, , 2664, 105) - (BehaviorActionBlock, , 2942, 200) - (BehaviorActionBlock, , 3064, 14) - (BehaviorActionBlock, , 3306, 241) - (BehaviorActionBlock, , 3356, 51) - (BehaviorActionBlock, , 3451, 51) - (BehaviorActionSet, , 1850, 15) - (BehaviorActionSet, , 1885, 29) - (BehaviorActionSet, , 1933, 18) - (BehaviorActionSet, , 1970, 36) - (BehaviorActionSet, , 2041, 1571) - (BehaviorActionSet, , 2232, 15) - (BehaviorActionSet, , 2347, 508) - (BehaviorAnnex, behavior_specification, 1512, 2117) - (BehaviorBooleanLiteral, , 2047, 4) - (BehaviorBooleanLiteral, , 2177, 4) - (BehaviorBooleanLiteral, , 2301, 4) - (BehaviorBooleanLiteral, , 2439, 4) - (BehaviorBooleanLiteral, , 3086, 4) - (BehaviorBooleanLiteral, , 3331, 4) - (BehaviorBooleanLiteral, , 3555, 4) - (BehaviorIntegerLiteral, , 1806, 1) - (BehaviorIntegerLiteral, , 1830, 1) - (BehaviorIntegerLiteral, , 1855, 1) - (BehaviorIntegerLiteral, , 1864, 1) - (BehaviorIntegerLiteral, , 1897, 1) - (BehaviorIntegerLiteral, , 1913, 1) - (BehaviorIntegerLiteral, , 1941, 1) - (BehaviorIntegerLiteral, , 1950, 1) - (BehaviorIntegerLiteral, , 1987, 1) - (BehaviorIntegerLiteral, , 2005, 1) - (BehaviorIntegerLiteral, , 2122, 1) + (ArrayIndex, , 1939, 3) + (ArrayIndex, , 1985, 3) + (ArrayIndex, , 2724, 3) + (AssignmentAction, , 1806, 6) + (AssignmentAction, , 1830, 6) + (AssignmentAction, , 1855, 6) + (AssignmentAction, , 1864, 6) + (AssignmentAction, , 1890, 13) + (AssignmentAction, , 1906, 13) + (AssignmentAction, , 1938, 9) + (AssignmentAction, , 1950, 6) + (AssignmentAction, , 1975, 18) + (AssignmentAction, , 1996, 15) + (AssignmentAction, , 2237, 6) + (AssignmentAction, , 2246, 6) + (AssignmentAction, , 2352, 5) + (AssignmentAction, , 2535, 6) + (AssignmentAction, , 2714, 18) + (AssignmentAction, , 3071, 10) + (AssignmentAction, , 3385, 6) + (AssignmentAction, , 3480, 6) + (AssignmentAction, , 3602, 15) + (BehaviorActionBlock, , 1805, 8) + (BehaviorActionBlock, , 1828, 10) + (BehaviorActionBlock, , 1829, 8) + (BehaviorActionBlock, , 1853, 19) + (BehaviorActionBlock, , 1888, 33) + (BehaviorActionBlock, , 1936, 22) + (BehaviorActionBlock, , 1973, 40) + (BehaviorActionBlock, , 2028, 1604) + (BehaviorActionBlock, , 2210, 66) + (BehaviorActionBlock, , 2312, 585) + (BehaviorActionBlock, , 2398, 462) + (BehaviorActionBlock, , 2490, 93) + (BehaviorActionBlock, , 2669, 105) + (BehaviorActionBlock, , 2947, 200) + (BehaviorActionBlock, , 3069, 14) + (BehaviorActionBlock, , 3311, 241) + (BehaviorActionBlock, , 3361, 51) + (BehaviorActionBlock, , 3456, 51) + (BehaviorActionSet, , 1855, 15) + (BehaviorActionSet, , 1890, 29) + (BehaviorActionSet, , 1938, 18) + (BehaviorActionSet, , 1975, 36) + (BehaviorActionSet, , 2046, 1571) + (BehaviorActionSet, , 2237, 15) + (BehaviorActionSet, , 2352, 508) + (BehaviorAnnex, behavior_specification, 1512, 2122) + (BehaviorBooleanLiteral, , 2052, 4) + (BehaviorBooleanLiteral, , 2182, 4) + (BehaviorBooleanLiteral, , 2306, 4) + (BehaviorBooleanLiteral, , 2444, 4) + (BehaviorBooleanLiteral, , 3091, 4) + (BehaviorBooleanLiteral, , 3336, 4) + (BehaviorBooleanLiteral, , 3560, 4) + (BehaviorIntegerLiteral, , 1550, 1) + (BehaviorIntegerLiteral, , 1811, 1) + (BehaviorIntegerLiteral, , 1835, 1) + (BehaviorIntegerLiteral, , 1860, 1) + (BehaviorIntegerLiteral, , 1869, 1) + (BehaviorIntegerLiteral, , 1902, 1) + (BehaviorIntegerLiteral, , 1918, 1) + (BehaviorIntegerLiteral, , 1946, 1) + (BehaviorIntegerLiteral, , 1955, 1) + (BehaviorIntegerLiteral, , 1992, 1) + (BehaviorIntegerLiteral, , 2010, 1) (BehaviorIntegerLiteral, , 2127, 1) - (BehaviorIntegerLiteral, , 2237, 1) - (BehaviorIntegerLiteral, , 2246, 1) - (BehaviorIntegerLiteral, , 2351, 1) - (BehaviorIntegerLiteral, , 2535, 1) - (BehaviorIntegerLiteral, , 2726, 1) - (BehaviorIntegerLiteral, , 3000, 1) + (BehaviorIntegerLiteral, , 2132, 1) + (BehaviorIntegerLiteral, , 2242, 1) + (BehaviorIntegerLiteral, , 2251, 1) + (BehaviorIntegerLiteral, , 2356, 1) + (BehaviorIntegerLiteral, , 2540, 1) + (BehaviorIntegerLiteral, , 2731, 1) (BehaviorIntegerLiteral, , 3005, 1) - (BehaviorIntegerLiteral, , 3385, 1) - (BehaviorIntegerLiteral, , 3480, 1) - (BehaviorIntegerLiteral, , 3611, 1) - (BehaviorState, s1, 1695, 2) - (BehaviorState, s2, 1717, 2) - (BehaviorState, s3, 1740, 2) - (BehaviorStateGroup, , 1695, 20) - (BehaviorStateGroup, , 1717, 21) - (BehaviorStateGroup, , 1740, 18) - (BehaviorTransition, , 1773, 13) - (BehaviorTransition, , 1788, 21) - (BehaviorTransition, , 1811, 23) - (BehaviorTransition, , 1836, 33) - (BehaviorTransition, , 1871, 46) - (BehaviorTransition, , 1919, 35) - (BehaviorTransition, , 1956, 53) - (BehaviorTransition, , 2011, 1618) + (BehaviorIntegerLiteral, , 3010, 1) + (BehaviorIntegerLiteral, , 3390, 1) + (BehaviorIntegerLiteral, , 3485, 1) + (BehaviorIntegerLiteral, , 3616, 1) + (BehaviorState, s1, 1700, 2) + (BehaviorState, s2, 1722, 2) + (BehaviorState, s3, 1745, 2) + (BehaviorStateGroup, , 1700, 20) + (BehaviorStateGroup, , 1722, 21) + (BehaviorStateGroup, , 1745, 18) + (BehaviorTransition, , 1778, 13) + (BehaviorTransition, , 1793, 21) + (BehaviorTransition, , 1816, 23) + (BehaviorTransition, , 1841, 33) + (BehaviorTransition, , 1876, 46) + (BehaviorTransition, , 1924, 35) + (BehaviorTransition, , 1961, 53) + (BehaviorTransition, , 2016, 1618) (BehaviorVariable, a, 1523, 1) - (BehaviorVariable, b, 1550, 1) - (BehaviorVariable, c, 1577, 1) - (BehaviorVariable, d, 1604, 1) - (BehaviorVariable, e, 1631, 1) - (BehaviorVariable, f, 1658, 1) - (BehaviorVariableGroup, , 1523, 25) - (BehaviorVariableGroup, , 1550, 25) - (BehaviorVariableGroup, , 1577, 25) - (BehaviorVariableGroup, , 1604, 25) - (BehaviorVariableGroup, , 1631, 25) - (BehaviorVariableGroup, , 1658, 25) - (BinaryExpression, , 3071, 5) - (DoUntilStatement, , 3061, 30) - (DoUntilStatement, , 3286, 274) - (ElementValues, , 2122, 6) - (ElementValues, , 3000, 6) - (ElseIfClause, , 2294, 598) - (ForStatement, , 2090, 1102) - (ForStatement, , 2968, 150) - (IfStatement, , 2173, 998) - (IfStatement, , 2435, 381) - (IfStatement, , 3327, 201) - (Reference, , 1801, 1) - (Reference, , 1825, 1) - (Reference, , 1850, 1) - (Reference, , 1859, 1) - (Reference, , 1885, 8) - (Reference, , 1901, 8) - (Reference, , 1933, 4) - (Reference, , 1935, 1) - (Reference, , 1945, 1) - (Reference, , 1970, 13) - (Reference, , 1981, 1) - (Reference, , 1991, 10) - (Reference, , 2232, 1) - (Reference, , 2241, 1) - (Reference, , 2347, 1) - (Reference, , 2530, 1) - (Reference, , 2709, 13) - (Reference, , 2720, 1) - (Reference, , 3066, 1) + (BehaviorVariable, b, 1555, 1) + (BehaviorVariable, c, 1582, 1) + (BehaviorVariable, d, 1609, 1) + (BehaviorVariable, e, 1636, 1) + (BehaviorVariable, f, 1663, 1) + (BehaviorVariableGroup, , 1523, 30) + (BehaviorVariableGroup, , 1555, 25) + (BehaviorVariableGroup, , 1582, 25) + (BehaviorVariableGroup, , 1609, 25) + (BehaviorVariableGroup, , 1636, 25) + (BehaviorVariableGroup, , 1663, 25) + (BinaryExpression, , 3076, 5) + (DoUntilStatement, , 3066, 30) + (DoUntilStatement, , 3291, 274) + (ElementValues, , 2127, 6) + (ElementValues, , 3005, 6) + (ElseIfClause, , 2299, 598) + (ForStatement, , 2095, 1102) + (ForStatement, , 2973, 150) + (IfStatement, , 2178, 998) + (IfStatement, , 2440, 381) + (IfStatement, , 3332, 201) + (Reference, , 1806, 1) + (Reference, , 1830, 1) + (Reference, , 1855, 1) + (Reference, , 1864, 1) + (Reference, , 1890, 8) + (Reference, , 1906, 8) + (Reference, , 1938, 4) + (Reference, , 1940, 1) + (Reference, , 1950, 1) + (Reference, , 1975, 13) + (Reference, , 1986, 1) + (Reference, , 1996, 10) + (Reference, , 2237, 1) + (Reference, , 2246, 1) + (Reference, , 2352, 1) + (Reference, , 2535, 1) + (Reference, , 2714, 13) + (Reference, , 2725, 1) (Reference, , 3071, 1) - (Reference, , 3075, 1) - (Reference, , 3380, 1) - (Reference, , 3475, 1) - (Reference, , 3597, 10) - (ReferenceExpression, , 1935, 1) - (ReferenceExpression, , 1981, 1) - (ReferenceExpression, , 2720, 1) - (ReferenceExpression, , 3071, 1) - (ReferenceExpression, , 3075, 1) - (ReferenceSegment, a, 1801, 1) - (ReferenceSegment, a, 1825, 1) - (ReferenceSegment, a, 1850, 1) - (ReferenceSegment, a, 1935, 1) - (ReferenceSegment, a, 1979, 4) - (ReferenceSegment, a, 1981, 1) - (ReferenceSegment, a, 2232, 1) - (ReferenceSegment, a, 2347, 1) - (ReferenceSegment, a, 2718, 4) - (ReferenceSegment, a, 2720, 1) - (ReferenceSegment, b, 1859, 1) - (ReferenceSegment, b, 2000, 1) - (ReferenceSegment, b, 2241, 1) - (ReferenceSegment, b, 2530, 1) - (ReferenceSegment, b, 3606, 1) - (ReferenceSegment, c, 3066, 1) - (ReferenceSegment, d, 3380, 1) - (ReferenceSegment, d, 3475, 1) - (ReferenceSegment, fakeData, 1970, 8) - (ReferenceSegment, fakeData, 1991, 8) - (ReferenceSegment, fakeData, 2709, 8) - (ReferenceSegment, fakeData, 3597, 8) - (ReferenceSegment, i, 3071, 1) - (ReferenceSegment, j, 3075, 1) - (ReferenceSegment, outPortA, 1885, 8) - (ReferenceSegment, outPortB, 1901, 8) - (ReferenceSegment, x, 1933, 4) - (ReferenceSegment, y, 1945, 1) - (ReferenceTail, , 1978, 5) - (ReferenceTail, , 1999, 2) - (ReferenceTail, , 2717, 5) - (ReferenceTail, , 3605, 2) - (WhileStatement, , 2041, 1191) + (Reference, , 3076, 1) + (Reference, , 3080, 1) + (Reference, , 3385, 1) + (Reference, , 3480, 1) + (Reference, , 3602, 10) + (ReferenceExpression, , 1940, 1) + (ReferenceExpression, , 1986, 1) + (ReferenceExpression, , 2725, 1) + (ReferenceExpression, , 3076, 1) + (ReferenceExpression, , 3080, 1) + (ReferenceSegment, a, 1806, 1) + (ReferenceSegment, a, 1830, 1) + (ReferenceSegment, a, 1855, 1) + (ReferenceSegment, a, 1940, 1) + (ReferenceSegment, a, 1984, 4) + (ReferenceSegment, a, 1986, 1) + (ReferenceSegment, a, 2237, 1) + (ReferenceSegment, a, 2352, 1) + (ReferenceSegment, a, 2723, 4) + (ReferenceSegment, a, 2725, 1) + (ReferenceSegment, b, 1864, 1) + (ReferenceSegment, b, 2005, 1) + (ReferenceSegment, b, 2246, 1) + (ReferenceSegment, b, 2535, 1) + (ReferenceSegment, b, 3611, 1) + (ReferenceSegment, c, 3071, 1) + (ReferenceSegment, d, 3385, 1) + (ReferenceSegment, d, 3480, 1) + (ReferenceSegment, fakeData, 1975, 8) + (ReferenceSegment, fakeData, 1996, 8) + (ReferenceSegment, fakeData, 2714, 8) + (ReferenceSegment, fakeData, 3602, 8) + (ReferenceSegment, i, 3076, 1) + (ReferenceSegment, j, 3080, 1) + (ReferenceSegment, outPortA, 1890, 8) + (ReferenceSegment, outPortB, 1906, 8) + (ReferenceSegment, x, 1938, 4) + (ReferenceSegment, y, 1950, 1) + (ReferenceTail, , 1983, 5) + (ReferenceTail, , 2004, 2) + (ReferenceTail, , 2722, 5) + (ReferenceTail, , 3610, 2) + (WhileStatement, , 2046, 1191) annex[1] owner=exemple_lr_D6_L3_D6_L4::th.error - (AssignmentAction, , 4295, 6) - (AssignmentAction, , 4304, 6) - (AssignmentAction, , 4410, 5) - (AssignmentAction, , 4593, 6) - (AssignmentAction, , 4891, 15) - (AssignmentAction, , 5245, 10) - (AssignmentAction, , 5559, 6) - (AssignmentAction, , 5654, 6) - (AssignmentAction, , 5855, 15) - (BehaviorActionBlock, , 4086, 1799) - (BehaviorActionBlock, , 4268, 66) - (BehaviorActionBlock, , 4370, 701) - (BehaviorActionBlock, , 4456, 578) - (BehaviorActionBlock, , 4548, 93) - (BehaviorActionBlock, , 4727, 221) - (BehaviorActionBlock, , 5121, 200) - (BehaviorActionBlock, , 5243, 14) - (BehaviorActionBlock, , 5485, 241) - (BehaviorActionBlock, , 5535, 51) - (BehaviorActionBlock, , 5630, 51) - (BehaviorActionSet, , 4104, 1766) - (BehaviorActionSet, , 4295, 15) - (BehaviorActionSet, , 4410, 624) - (BehaviorAnnex, behavior_specification, 3813, 2074) - (BehaviorBooleanLiteral, , 4110, 4) - (BehaviorBooleanLiteral, , 4240, 4) - (BehaviorBooleanLiteral, , 4364, 4) - (BehaviorBooleanLiteral, , 4502, 4) - (BehaviorBooleanLiteral, , 5265, 4) - (BehaviorBooleanLiteral, , 5510, 4) - (BehaviorBooleanLiteral, , 5734, 4) - (BehaviorIntegerLiteral, , 4185, 1) - (BehaviorIntegerLiteral, , 4190, 1) - (BehaviorIntegerLiteral, , 4300, 1) - (BehaviorIntegerLiteral, , 4309, 1) - (BehaviorIntegerLiteral, , 4414, 1) - (BehaviorIntegerLiteral, , 4598, 1) - (BehaviorIntegerLiteral, , 4905, 1) - (BehaviorIntegerLiteral, , 5179, 1) - (BehaviorIntegerLiteral, , 5184, 1) - (BehaviorIntegerLiteral, , 5564, 1) - (BehaviorIntegerLiteral, , 5659, 1) - (BehaviorIntegerLiteral, , 5869, 1) - (BehaviorState, s1, 3996, 2) - (BehaviorState, s2, 4018, 2) - (BehaviorState, s3, 4041, 2) - (BehaviorStateGroup, , 3996, 20) - (BehaviorStateGroup, , 4018, 21) - (BehaviorStateGroup, , 4041, 18) - (BehaviorTransition, , 4074, 1813) - (BehaviorVariable, a, 3824, 1) - (BehaviorVariable, b, 3851, 1) - (BehaviorVariable, c, 3878, 1) - (BehaviorVariable, d, 3905, 1) - (BehaviorVariable, e, 3932, 1) - (BehaviorVariable, f, 3959, 1) - (BehaviorVariableGroup, , 3824, 25) - (BehaviorVariableGroup, , 3851, 25) - (BehaviorVariableGroup, , 3878, 25) - (BehaviorVariableGroup, , 3905, 25) - (BehaviorVariableGroup, , 3932, 25) - (BehaviorVariableGroup, , 3959, 25) - (BinaryExpression, , 5250, 5) - (DoUntilStatement, , 5240, 30) - (DoUntilStatement, , 5465, 274) - (ElementValues, , 4185, 6) - (ElementValues, , 5179, 6) - (ElseIfClause, , 4357, 714) - (ForStatement, , 4153, 1218) - (ForStatement, , 5147, 150) - (IfStatement, , 4236, 1114) - (IfStatement, , 4498, 497) - (IfStatement, , 5506, 201) - (Reference, , 4295, 1) - (Reference, , 4304, 1) - (Reference, , 4410, 1) - (Reference, , 4593, 1) - (Reference, , 4891, 10) - (Reference, , 5245, 1) - (Reference, , 5250, 1) - (Reference, , 5254, 1) - (Reference, , 5559, 1) - (Reference, , 5654, 1) - (Reference, , 5855, 10) - (ReferenceExpression, , 5250, 1) - (ReferenceExpression, , 5254, 1) - (ReferenceSegment, a, 4295, 1) - (ReferenceSegment, a, 4410, 1) - (ReferenceSegment, b, 4304, 1) - (ReferenceSegment, b, 4593, 1) - (ReferenceSegment, b, 4900, 1) - (ReferenceSegment, b, 5864, 1) - (ReferenceSegment, c, 5245, 1) - (ReferenceSegment, d, 5559, 1) - (ReferenceSegment, d, 5654, 1) - (ReferenceSegment, fakeData, 4891, 8) - (ReferenceSegment, fakeData, 5855, 8) - (ReferenceSegment, i, 5250, 1) - (ReferenceSegment, j, 5254, 1) - (ReferenceTail, , 4899, 2) - (ReferenceTail, , 5863, 2) - (WhileStatement, , 4104, 1307) + (AssignmentAction, , 4305, 6) + (AssignmentAction, , 4314, 6) + (AssignmentAction, , 4420, 5) + (AssignmentAction, , 4603, 6) + (AssignmentAction, , 4901, 15) + (AssignmentAction, , 5255, 10) + (AssignmentAction, , 5569, 6) + (AssignmentAction, , 5664, 6) + (AssignmentAction, , 5865, 15) + (BehaviorActionBlock, , 4096, 1799) + (BehaviorActionBlock, , 4278, 66) + (BehaviorActionBlock, , 4380, 701) + (BehaviorActionBlock, , 4466, 578) + (BehaviorActionBlock, , 4558, 93) + (BehaviorActionBlock, , 4737, 221) + (BehaviorActionBlock, , 5131, 200) + (BehaviorActionBlock, , 5253, 14) + (BehaviorActionBlock, , 5495, 241) + (BehaviorActionBlock, , 5545, 51) + (BehaviorActionBlock, , 5640, 51) + (BehaviorActionSet, , 4114, 1766) + (BehaviorActionSet, , 4305, 15) + (BehaviorActionSet, , 4420, 624) + (BehaviorAnnex, behavior_specification, 3818, 2079) + (BehaviorBooleanLiteral, , 4120, 4) + (BehaviorBooleanLiteral, , 4250, 4) + (BehaviorBooleanLiteral, , 4374, 4) + (BehaviorBooleanLiteral, , 4512, 4) + (BehaviorBooleanLiteral, , 5275, 4) + (BehaviorBooleanLiteral, , 5520, 4) + (BehaviorBooleanLiteral, , 5744, 4) + (BehaviorIntegerLiteral, , 3856, 1) + (BehaviorIntegerLiteral, , 4195, 1) + (BehaviorIntegerLiteral, , 4200, 1) + (BehaviorIntegerLiteral, , 4310, 1) + (BehaviorIntegerLiteral, , 4319, 1) + (BehaviorIntegerLiteral, , 4424, 1) + (BehaviorIntegerLiteral, , 4608, 1) + (BehaviorIntegerLiteral, , 4915, 1) + (BehaviorIntegerLiteral, , 5189, 1) + (BehaviorIntegerLiteral, , 5194, 1) + (BehaviorIntegerLiteral, , 5574, 1) + (BehaviorIntegerLiteral, , 5669, 1) + (BehaviorIntegerLiteral, , 5879, 1) + (BehaviorState, s1, 4006, 2) + (BehaviorState, s2, 4028, 2) + (BehaviorState, s3, 4051, 2) + (BehaviorStateGroup, , 4006, 20) + (BehaviorStateGroup, , 4028, 21) + (BehaviorStateGroup, , 4051, 18) + (BehaviorTransition, , 4084, 1813) + (BehaviorVariable, a, 3829, 1) + (BehaviorVariable, b, 3861, 1) + (BehaviorVariable, c, 3888, 1) + (BehaviorVariable, d, 3915, 1) + (BehaviorVariable, e, 3942, 1) + (BehaviorVariable, f, 3969, 1) + (BehaviorVariableGroup, , 3829, 30) + (BehaviorVariableGroup, , 3861, 25) + (BehaviorVariableGroup, , 3888, 25) + (BehaviorVariableGroup, , 3915, 25) + (BehaviorVariableGroup, , 3942, 25) + (BehaviorVariableGroup, , 3969, 25) + (BinaryExpression, , 5260, 5) + (DoUntilStatement, , 5250, 30) + (DoUntilStatement, , 5475, 274) + (ElementValues, , 4195, 6) + (ElementValues, , 5189, 6) + (ElseIfClause, , 4367, 714) + (ForStatement, , 4163, 1218) + (ForStatement, , 5157, 150) + (IfStatement, , 4246, 1114) + (IfStatement, , 4508, 497) + (IfStatement, , 5516, 201) + (Reference, , 4305, 1) + (Reference, , 4314, 1) + (Reference, , 4420, 1) + (Reference, , 4603, 1) + (Reference, , 4901, 10) + (Reference, , 5255, 1) + (Reference, , 5260, 1) + (Reference, , 5264, 1) + (Reference, , 5569, 1) + (Reference, , 5664, 1) + (Reference, , 5865, 10) + (ReferenceExpression, , 5260, 1) + (ReferenceExpression, , 5264, 1) + (ReferenceSegment, a, 4305, 1) + (ReferenceSegment, a, 4420, 1) + (ReferenceSegment, b, 4314, 1) + (ReferenceSegment, b, 4603, 1) + (ReferenceSegment, b, 4910, 1) + (ReferenceSegment, b, 5874, 1) + (ReferenceSegment, c, 5255, 1) + (ReferenceSegment, d, 5569, 1) + (ReferenceSegment, d, 5664, 1) + (ReferenceSegment, fakeData, 4901, 8) + (ReferenceSegment, fakeData, 5865, 8) + (ReferenceSegment, i, 5260, 1) + (ReferenceSegment, j, 5264, 1) + (ReferenceTail, , 4909, 2) + (ReferenceTail, , 5873, 2) + (WhileStatement, , 4114, 1307) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3169_Issue3169.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3169_Issue3169.txt index 45e4cc15dce..d47d28df2d8 100644 --- a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3169_Issue3169.txt +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3169_Issue3169.txt @@ -1,29 +1,30 @@ annex[0] owner=Issue3169::operation - (BehaviorAnnex, behavior_specification, 1843, 306) - (BehaviorCondition, , 1995, 20) - (BehaviorCondition, , 2060, 77) - (BehaviorState, finish, 1927, 6) - (BehaviorState, start, 1902, 5) - (BehaviorStateGroup, , 1902, 21) - (BehaviorStateGroup, , 1927, 20) - (BehaviorTransition, and_then_transition, 1965, 62) - (BehaviorTransition, or_else_transition, 2031, 118) + (BehaviorAnnex, behavior_specification, 1843, 315) + (BehaviorBooleanLiteral, , 1892, 5) + (BehaviorCondition, , 2004, 20) + (BehaviorCondition, , 2069, 77) + (BehaviorState, finish, 1936, 6) + (BehaviorState, start, 1911, 5) + (BehaviorStateGroup, , 1911, 21) + (BehaviorStateGroup, , 1936, 20) + (BehaviorTransition, and_then_transition, 1974, 62) + (BehaviorTransition, or_else_transition, 2040, 118) (BehaviorVariable, left, 1856, 4) (BehaviorVariable, right, 1862, 5) - (BehaviorVariableGroup, , 1856, 33) - (BinaryExpression, , 1995, 20) - (BinaryExpression, , 2060, 77) - (ExecuteCondition, , 1995, 20) - (ExecuteCondition, , 2060, 77) - (Reference, , 1995, 4) - (Reference, , 2010, 5) - (Reference, , 2060, 4) - (Reference, , 2132, 5) - (ReferenceExpression, , 1995, 4) - (ReferenceExpression, , 2010, 5) - (ReferenceExpression, , 2060, 4) - (ReferenceExpression, , 2132, 5) - (ReferenceSegment, left, 1995, 4) - (ReferenceSegment, left, 2060, 4) - (ReferenceSegment, right, 2010, 5) - (ReferenceSegment, right, 2132, 5) + (BehaviorVariableGroup, , 1856, 42) + (BinaryExpression, , 2004, 20) + (BinaryExpression, , 2069, 77) + (ExecuteCondition, , 2004, 20) + (ExecuteCondition, , 2069, 77) + (Reference, , 2004, 4) + (Reference, , 2019, 5) + (Reference, , 2069, 4) + (Reference, , 2141, 5) + (ReferenceExpression, , 2004, 4) + (ReferenceExpression, , 2019, 5) + (ReferenceExpression, , 2069, 4) + (ReferenceExpression, , 2141, 5) + (ReferenceSegment, left, 2004, 4) + (ReferenceSegment, left, 2069, 4) + (ReferenceSegment, right, 2019, 5) + (ReferenceSegment, right, 2141, 5) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3173_Issue3173.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3173_Issue3173.txt index 27a91d73ed7..9851f5bf3ef 100644 --- a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3173_Issue3173.txt +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3173_Issue3173.txt @@ -1,113 +1,117 @@ annex[0] owner=Issue3173::worker.i - (AssignmentAction, , 3431, 21) - (AssignmentAction, , 3595, 22) - (AssignmentAction, , 3758, 23) - (AssignmentAction, , 3922, 24) - (AssignmentAction, , 4099, 33) - (AssignmentAction, , 4300, 22) - (BehaviorActionBlock, , 3370, 114) - (BehaviorActionBlock, , 3530, 119) - (BehaviorActionBlock, , 3693, 120) - (BehaviorActionBlock, , 3857, 121) - (BehaviorActionBlock, , 4035, 129) - (BehaviorActionBlock, , 4216, 138) - (BehaviorAnnex, behavior_specification, 3139, 1216) - (BehaviorIntegerLiteral, , 3401, 1) - (BehaviorIntegerLiteral, , 3406, 1) - (BehaviorIntegerLiteral, , 3565, 1) - (BehaviorIntegerLiteral, , 3570, 1) - (BehaviorIntegerLiteral, , 4270, 1) - (BehaviorIntegerLiteral, , 4275, 1) - (BehaviorState, done, 3279, 4) - (BehaviorState, start, 3244, 5) - (BehaviorStateGroup, , 3244, 22) - (BehaviorStateGroup, , 3279, 28) - (BehaviorTransition, array_loop, 3827, 152) - (BehaviorTransition, data_model_array_forall, 3992, 173) - (BehaviorTransition, queue_loop, 3663, 151) - (BehaviorTransition, range_forall, 3498, 152) - (BehaviorTransition, range_loop, 3340, 145) - (BehaviorTransition, written_classifier, 4178, 177) - (BehaviorVariable, pairs, 3202, 5) - (BehaviorVariable, total, 3161, 5) - (BehaviorVariableGroup, , 3161, 28) - (BehaviorVariableGroup, , 3202, 14) - (BinaryExpression, , 3440, 12) - (BinaryExpression, , 3604, 13) - (BinaryExpression, , 3767, 14) - (BinaryExpression, , 3931, 15) - (BinaryExpression, , 4108, 24) - (BinaryExpression, , 4309, 13) - (ElementValues, , 3401, 6) - (ElementValues, , 3565, 6) - (ElementValues, , 3726, 8) - (ElementValues, , 3891, 7) - (ElementValues, , 4070, 5) - (ElementValues, , 4270, 6) - (ForStatement, , 3388, 82) - (ForStatement, , 3548, 87) - (ForStatement, , 3711, 88) - (ForStatement, , 3875, 89) - (ForStatement, , 4053, 97) - (ForStatement, , 4234, 106) - (Reference, , 3431, 5) - (Reference, , 3440, 4) - (Reference, , 3447, 5) - (Reference, , 3595, 5) - (Reference, , 3604, 5) - (Reference, , 3612, 5) - (Reference, , 3726, 8) - (Reference, , 3758, 5) - (Reference, , 3767, 6) - (Reference, , 3776, 5) - (Reference, , 3891, 7) - (Reference, , 3922, 5) - (Reference, , 3931, 7) - (Reference, , 3941, 5) - (Reference, , 4070, 5) - (Reference, , 4099, 5) - (Reference, , 4108, 10) - (Reference, , 4121, 11) - (Reference, , 4300, 5) - (Reference, , 4309, 5) - (Reference, , 4317, 5) - (ReferenceExpression, , 3440, 4) - (ReferenceExpression, , 3447, 5) - (ReferenceExpression, , 3604, 5) - (ReferenceExpression, , 3612, 5) - (ReferenceExpression, , 3726, 8) - (ReferenceExpression, , 3767, 6) - (ReferenceExpression, , 3776, 5) - (ReferenceExpression, , 3891, 7) - (ReferenceExpression, , 3931, 7) - (ReferenceExpression, , 3941, 5) - (ReferenceExpression, , 4070, 5) - (ReferenceExpression, , 4108, 10) - (ReferenceExpression, , 4121, 11) - (ReferenceExpression, , 4309, 5) - (ReferenceExpression, , 4317, 5) - (ReferenceSegment, element, 3931, 7) - (ReferenceSegment, entry, 4108, 5) - (ReferenceSegment, entry, 4121, 5) - (ReferenceSegment, history, 3891, 7) - (ReferenceSegment, left, 4114, 4) - (ReferenceSegment, other, 3604, 5) - (ReferenceSegment, pairs, 4070, 5) - (ReferenceSegment, readings, 3726, 8) - (ReferenceSegment, right, 4127, 5) - (ReferenceSegment, sample, 3767, 6) - (ReferenceSegment, step, 3440, 4) - (ReferenceSegment, total, 3431, 5) - (ReferenceSegment, total, 3447, 5) - (ReferenceSegment, total, 3595, 5) - (ReferenceSegment, total, 3612, 5) - (ReferenceSegment, total, 3758, 5) - (ReferenceSegment, total, 3776, 5) - (ReferenceSegment, total, 3922, 5) - (ReferenceSegment, total, 3941, 5) - (ReferenceSegment, total, 4099, 5) - (ReferenceSegment, total, 4300, 5) - (ReferenceSegment, total, 4317, 5) - (ReferenceSegment, typed, 4309, 5) - (ReferenceTail, , 4113, 5) - (ReferenceTail, , 4126, 6) + (AssignmentAction, , 3459, 21) + (AssignmentAction, , 3623, 22) + (AssignmentAction, , 3786, 23) + (AssignmentAction, , 3950, 24) + (AssignmentAction, , 4127, 33) + (AssignmentAction, , 4328, 22) + (BehaviorActionBlock, , 3398, 114) + (BehaviorActionBlock, , 3558, 119) + (BehaviorActionBlock, , 3721, 120) + (BehaviorActionBlock, , 3885, 121) + (BehaviorActionBlock, , 4063, 129) + (BehaviorActionBlock, , 4244, 138) + (BehaviorAnnex, behavior_specification, 3139, 1244) + (BehaviorIntegerLiteral, , 3183, 1) + (BehaviorIntegerLiteral, , 3429, 1) + (BehaviorIntegerLiteral, , 3434, 1) + (BehaviorIntegerLiteral, , 3593, 1) + (BehaviorIntegerLiteral, , 3598, 1) + (BehaviorIntegerLiteral, , 4298, 1) + (BehaviorIntegerLiteral, , 4303, 1) + (BehaviorPropertyAssociation, , 3205, 36) + (BehaviorState, done, 3307, 4) + (BehaviorState, start, 3272, 5) + (BehaviorStateGroup, , 3272, 22) + (BehaviorStateGroup, , 3307, 28) + (BehaviorTransition, array_loop, 3855, 152) + (BehaviorTransition, data_model_array_forall, 4020, 173) + (BehaviorTransition, queue_loop, 3691, 151) + (BehaviorTransition, range_forall, 3526, 152) + (BehaviorTransition, range_loop, 3368, 145) + (BehaviorTransition, written_classifier, 4206, 177) + (BehaviorVariable, pairs, 3189, 5) + (BehaviorVariable, total, 3152, 5) + (BehaviorVariableGroup, , 3152, 33) + (BehaviorVariableGroup, , 3189, 55) + (BinaryExpression, , 3468, 12) + (BinaryExpression, , 3632, 13) + (BinaryExpression, , 3795, 14) + (BinaryExpression, , 3959, 15) + (BinaryExpression, , 4136, 24) + (BinaryExpression, , 4337, 13) + (ElementValues, , 3429, 6) + (ElementValues, , 3593, 6) + (ElementValues, , 3754, 8) + (ElementValues, , 3919, 7) + (ElementValues, , 4098, 5) + (ElementValues, , 4298, 6) + (ForStatement, , 3416, 82) + (ForStatement, , 3576, 87) + (ForStatement, , 3739, 88) + (ForStatement, , 3903, 89) + (ForStatement, , 4081, 97) + (ForStatement, , 4262, 106) + (ListValue, , 3234, 6) + (Reference, , 3459, 5) + (Reference, , 3468, 4) + (Reference, , 3475, 5) + (Reference, , 3623, 5) + (Reference, , 3632, 5) + (Reference, , 3640, 5) + (Reference, , 3754, 8) + (Reference, , 3786, 5) + (Reference, , 3795, 6) + (Reference, , 3804, 5) + (Reference, , 3919, 7) + (Reference, , 3950, 5) + (Reference, , 3959, 7) + (Reference, , 3969, 5) + (Reference, , 4098, 5) + (Reference, , 4127, 5) + (Reference, , 4136, 10) + (Reference, , 4149, 11) + (Reference, , 4328, 5) + (Reference, , 4337, 5) + (Reference, , 4345, 5) + (ReferenceExpression, , 3468, 4) + (ReferenceExpression, , 3475, 5) + (ReferenceExpression, , 3632, 5) + (ReferenceExpression, , 3640, 5) + (ReferenceExpression, , 3754, 8) + (ReferenceExpression, , 3795, 6) + (ReferenceExpression, , 3804, 5) + (ReferenceExpression, , 3919, 7) + (ReferenceExpression, , 3959, 7) + (ReferenceExpression, , 3969, 5) + (ReferenceExpression, , 4098, 5) + (ReferenceExpression, , 4136, 10) + (ReferenceExpression, , 4149, 11) + (ReferenceExpression, , 4337, 5) + (ReferenceExpression, , 4345, 5) + (ReferenceSegment, element, 3959, 7) + (ReferenceSegment, entry, 4136, 5) + (ReferenceSegment, entry, 4149, 5) + (ReferenceSegment, history, 3919, 7) + (ReferenceSegment, left, 4142, 4) + (ReferenceSegment, other, 3632, 5) + (ReferenceSegment, pairs, 4098, 5) + (ReferenceSegment, readings, 3754, 8) + (ReferenceSegment, right, 4155, 5) + (ReferenceSegment, sample, 3795, 6) + (ReferenceSegment, step, 3468, 4) + (ReferenceSegment, total, 3459, 5) + (ReferenceSegment, total, 3475, 5) + (ReferenceSegment, total, 3623, 5) + (ReferenceSegment, total, 3640, 5) + (ReferenceSegment, total, 3786, 5) + (ReferenceSegment, total, 3804, 5) + (ReferenceSegment, total, 3950, 5) + (ReferenceSegment, total, 3969, 5) + (ReferenceSegment, total, 4127, 5) + (ReferenceSegment, total, 4328, 5) + (ReferenceSegment, total, 4345, 5) + (ReferenceSegment, typed, 4337, 5) + (ReferenceTail, , 4141, 5) + (ReferenceTail, , 4154, 6) + (StringLiteral, , 3235, 4) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3177_Issue3177.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3177_Issue3177.txt index b10f3fd809d..38b04180510 100644 --- a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3177_Issue3177.txt +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3177_Issue3177.txt @@ -1,77 +1,81 @@ annex[0] owner=Issue3177::evaluate - (AssignmentAction, , 2295, 32) - (AssignmentAction, , 2468, 34) - (AssignmentAction, , 2611, 17) - (AssignmentAction, , 2792, 22) - (AssignmentAction, , 2900, 27) - (BehaviorActionBlock, , 2137, 795) - (BehaviorActionSequence, , 2295, 632) - (BehaviorAnnex, behavior_specification, 1842, 1091) - (BehaviorIntegerLiteral, , 2622, 1) - (BehaviorIntegerLiteral, , 2627, 1) - (BehaviorIntegerLiteral, , 2813, 1) - (BehaviorIntegerLiteral, , 2920, 1) - (BehaviorIntegerLiteral, , 2926, 1) - (BehaviorState, done, 2082, 4) - (BehaviorState, start, 2056, 5) - (BehaviorStateGroup, , 2056, 22) - (BehaviorStateGroup, , 2082, 19) - (BehaviorTransition, , 2119, 814) - (BehaviorVariable, flag, 2016, 4) - (BehaviorVariable, left, 1920, 4) - (BehaviorVariable, middle, 1951, 6) - (BehaviorVariable, result, 1887, 6) - (BehaviorVariable, right, 1984, 5) + (AssignmentAction, , 2327, 32) + (AssignmentAction, , 2500, 34) + (AssignmentAction, , 2643, 17) + (AssignmentAction, , 2824, 22) + (AssignmentAction, , 2932, 27) + (BehaviorActionBlock, , 2169, 795) + (BehaviorActionSequence, , 2327, 632) + (BehaviorAnnex, behavior_specification, 1842, 1123) + (BehaviorBooleanLiteral, , 1955, 5) + (BehaviorBooleanLiteral, , 1997, 5) + (BehaviorBooleanLiteral, , 2038, 5) + (BehaviorIntegerLiteral, , 1886, 1) + (BehaviorIntegerLiteral, , 2654, 1) + (BehaviorIntegerLiteral, , 2659, 1) + (BehaviorIntegerLiteral, , 2845, 1) + (BehaviorIntegerLiteral, , 2952, 1) + (BehaviorIntegerLiteral, , 2958, 1) + (BehaviorState, done, 2114, 4) + (BehaviorState, start, 2088, 5) + (BehaviorStateGroup, , 2088, 22) + (BehaviorStateGroup, , 2114, 19) + (BehaviorTransition, , 2151, 814) + (BehaviorVariable, flag, 2048, 4) + (BehaviorVariable, left, 1925, 4) + (BehaviorVariable, middle, 1965, 6) + (BehaviorVariable, result, 1892, 6) + (BehaviorVariable, right, 2007, 5) (BehaviorVariable, total, 1855, 5) - (BehaviorVariableGroup, , 1855, 28) - (BehaviorVariableGroup, , 1887, 29) - (BehaviorVariableGroup, , 1920, 27) - (BehaviorVariableGroup, , 1951, 29) - (BehaviorVariableGroup, , 1984, 28) - (BehaviorVariableGroup, , 2016, 27) - (BinaryExpression, , 2303, 14) - (BinaryExpression, , 2303, 24) - (BinaryExpression, , 2476, 26) - (BinaryExpression, , 2486, 15) - (BinaryExpression, , 2622, 6) - (BinaryExpression, , 2803, 11) - (BinaryExpression, , 2910, 17) - (BinaryExpression, , 2911, 10) - (ParenthesizedExpression, , 2485, 17) - (ParenthesizedExpression, , 2910, 12) - (Reference, , 2295, 4) - (Reference, , 2303, 4) - (Reference, , 2311, 6) - (Reference, , 2322, 5) - (Reference, , 2468, 4) - (Reference, , 2476, 4) - (Reference, , 2486, 6) - (Reference, , 2496, 5) - (Reference, , 2611, 6) - (Reference, , 2792, 6) - (Reference, , 2803, 5) - (Reference, , 2900, 6) - (Reference, , 2911, 5) - (ReferenceExpression, , 2303, 4) - (ReferenceExpression, , 2311, 6) - (ReferenceExpression, , 2322, 5) - (ReferenceExpression, , 2476, 4) - (ReferenceExpression, , 2486, 6) - (ReferenceExpression, , 2496, 5) - (ReferenceExpression, , 2803, 5) - (ReferenceExpression, , 2911, 5) - (ReferenceSegment, flag, 2295, 4) - (ReferenceSegment, flag, 2468, 4) - (ReferenceSegment, left, 2303, 4) - (ReferenceSegment, left, 2476, 4) - (ReferenceSegment, middle, 2311, 6) - (ReferenceSegment, middle, 2486, 6) - (ReferenceSegment, result, 2611, 6) - (ReferenceSegment, result, 2792, 6) - (ReferenceSegment, result, 2900, 6) - (ReferenceSegment, right, 2322, 5) - (ReferenceSegment, right, 2496, 5) - (ReferenceSegment, total, 2803, 5) - (ReferenceSegment, total, 2911, 5) - (UnaryExpression, , 2621, 7) - (UnaryExpression, , 2802, 12) + (BehaviorVariableGroup, , 1855, 33) + (BehaviorVariableGroup, , 1892, 29) + (BehaviorVariableGroup, , 1925, 36) + (BehaviorVariableGroup, , 1965, 38) + (BehaviorVariableGroup, , 2007, 37) + (BehaviorVariableGroup, , 2048, 27) + (BinaryExpression, , 2335, 14) + (BinaryExpression, , 2335, 24) + (BinaryExpression, , 2508, 26) + (BinaryExpression, , 2518, 15) + (BinaryExpression, , 2654, 6) + (BinaryExpression, , 2835, 11) + (BinaryExpression, , 2942, 17) + (BinaryExpression, , 2943, 10) + (ParenthesizedExpression, , 2517, 17) + (ParenthesizedExpression, , 2942, 12) + (Reference, , 2327, 4) + (Reference, , 2335, 4) + (Reference, , 2343, 6) + (Reference, , 2354, 5) + (Reference, , 2500, 4) + (Reference, , 2508, 4) + (Reference, , 2518, 6) + (Reference, , 2528, 5) + (Reference, , 2643, 6) + (Reference, , 2824, 6) + (Reference, , 2835, 5) + (Reference, , 2932, 6) + (Reference, , 2943, 5) + (ReferenceExpression, , 2335, 4) + (ReferenceExpression, , 2343, 6) + (ReferenceExpression, , 2354, 5) + (ReferenceExpression, , 2508, 4) + (ReferenceExpression, , 2518, 6) + (ReferenceExpression, , 2528, 5) + (ReferenceExpression, , 2835, 5) + (ReferenceExpression, , 2943, 5) + (ReferenceSegment, flag, 2327, 4) + (ReferenceSegment, flag, 2500, 4) + (ReferenceSegment, left, 2335, 4) + (ReferenceSegment, left, 2508, 4) + (ReferenceSegment, middle, 2343, 6) + (ReferenceSegment, middle, 2518, 6) + (ReferenceSegment, result, 2643, 6) + (ReferenceSegment, result, 2824, 6) + (ReferenceSegment, result, 2932, 6) + (ReferenceSegment, right, 2354, 5) + (ReferenceSegment, right, 2528, 5) + (ReferenceSegment, total, 2835, 5) + (ReferenceSegment, total, 2943, 5) + (UnaryExpression, , 2653, 7) + (UnaryExpression, , 2834, 12) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3180_FieldAssignments.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3180_FieldAssignments.txt index 37a7c46fe41..34253abff60 100644 --- a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3180_FieldAssignments.txt +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3180_FieldAssignments.txt @@ -1,83 +1,89 @@ annex[0] owner=FieldAssignments::worker.i - (AssignmentAction, , 2744, 11) - (AssignmentAction, , 2830, 17) - (BehaviorActionBlock, , 2680, 221) - (BehaviorActionSequence, , 2744, 125) - (BehaviorAnnex, behavior_specification, 2478, 424) - (BehaviorIntegerLiteral, , 2754, 1) - (BehaviorState, done, 2602, 4) - (BehaviorState, start, 2567, 5) - (BehaviorStateGroup, , 2567, 22) - (BehaviorStateGroup, , 2602, 28) - (BehaviorTransition, , 2663, 239) - (BehaviorVariable, here, 2527, 4) - (BehaviorVariable, pairs, 2500, 5) - (BehaviorVariableGroup, , 2500, 14) - (BehaviorVariableGroup, , 2527, 12) - (ElementValues, , 2715, 5) - (ElementValues, , 2797, 5) - (ForStatement, , 2698, 189) - (ForStatement, , 2777, 92) - (Reference, , 2715, 5) - (Reference, , 2744, 6) - (Reference, , 2797, 5) - (Reference, , 2830, 7) - (Reference, , 2841, 6) - (ReferenceExpression, , 2715, 5) - (ReferenceExpression, , 2797, 5) - (ReferenceExpression, , 2841, 6) - (ReferenceSegment, left, 2746, 4) - (ReferenceSegment, left, 2843, 4) - (ReferenceSegment, p, 2744, 1) - (ReferenceSegment, p, 2830, 1) - (ReferenceSegment, pairs, 2715, 5) - (ReferenceSegment, pairs, 2797, 5) - (ReferenceSegment, q, 2841, 1) - (ReferenceSegment, right, 2832, 5) - (ReferenceTail, , 2745, 5) - (ReferenceTail, , 2831, 6) - (ReferenceTail, , 2842, 5) + (AssignmentAction, , 2776, 11) + (AssignmentAction, , 2862, 17) + (BehaviorActionBlock, , 2712, 221) + (BehaviorActionSequence, , 2776, 125) + (BehaviorAnnex, behavior_specification, 2478, 456) + (BehaviorIntegerLiteral, , 2786, 1) + (BehaviorPropertyAssociation, , 2507, 36) + (BehaviorState, done, 2634, 4) + (BehaviorState, start, 2599, 5) + (BehaviorStateGroup, , 2599, 22) + (BehaviorStateGroup, , 2634, 28) + (BehaviorTransition, , 2695, 239) + (BehaviorVariable, here, 2559, 4) + (BehaviorVariable, pairs, 2491, 5) + (BehaviorVariableGroup, , 2491, 55) + (BehaviorVariableGroup, , 2559, 12) + (ElementValues, , 2747, 5) + (ElementValues, , 2829, 5) + (ForStatement, , 2730, 189) + (ForStatement, , 2809, 92) + (ListValue, , 2536, 6) + (Reference, , 2747, 5) + (Reference, , 2776, 6) + (Reference, , 2829, 5) + (Reference, , 2862, 7) + (Reference, , 2873, 6) + (ReferenceExpression, , 2747, 5) + (ReferenceExpression, , 2829, 5) + (ReferenceExpression, , 2873, 6) + (ReferenceSegment, left, 2778, 4) + (ReferenceSegment, left, 2875, 4) + (ReferenceSegment, p, 2776, 1) + (ReferenceSegment, p, 2862, 1) + (ReferenceSegment, pairs, 2747, 5) + (ReferenceSegment, pairs, 2829, 5) + (ReferenceSegment, q, 2873, 1) + (ReferenceSegment, right, 2864, 5) + (ReferenceTail, , 2777, 5) + (ReferenceTail, , 2863, 6) + (ReferenceTail, , 2874, 5) + (StringLiteral, , 2537, 4) annex[1] owner=FieldAssignments::worker.j - (AssignmentAction, , 3390, 19) - (AssignmentAction, , 3431, 21) - (AssignmentAction, , 3474, 9) - (BehaviorActionBlock, , 3326, 189) - (BehaviorActionSequence, , 3390, 93) - (BehaviorAnnex, behavior_specification, 3124, 392) - (BehaviorState, done, 3248, 4) - (BehaviorState, start, 3213, 5) - (BehaviorStateGroup, , 3213, 22) - (BehaviorStateGroup, , 3248, 28) - (BehaviorTransition, , 3309, 207) - (BehaviorVariable, here, 3173, 4) - (BehaviorVariable, pairs, 3146, 5) - (BehaviorVariableGroup, , 3146, 14) - (BehaviorVariableGroup, , 3173, 12) - (ElementValues, , 3361, 5) - (ForStatement, , 3344, 157) - (Reference, , 3361, 5) - (Reference, , 3390, 9) - (Reference, , 3403, 6) - (Reference, , 3431, 10) - (Reference, , 3445, 7) - (Reference, , 3474, 4) - (Reference, , 3482, 1) - (ReferenceExpression, , 3361, 5) - (ReferenceExpression, , 3403, 6) - (ReferenceExpression, , 3445, 7) - (ReferenceExpression, , 3482, 1) - (ReferenceSegment, here, 3390, 4) - (ReferenceSegment, here, 3431, 4) - (ReferenceSegment, here, 3474, 4) - (ReferenceSegment, left, 3395, 4) - (ReferenceSegment, left, 3405, 4) - (ReferenceSegment, p, 3403, 1) - (ReferenceSegment, p, 3445, 1) - (ReferenceSegment, p, 3482, 1) - (ReferenceSegment, pairs, 3361, 5) - (ReferenceSegment, right, 3436, 5) - (ReferenceSegment, right, 3447, 5) - (ReferenceTail, , 3394, 5) - (ReferenceTail, , 3404, 5) - (ReferenceTail, , 3435, 6) - (ReferenceTail, , 3446, 6) + (AssignmentAction, , 3454, 19) + (AssignmentAction, , 3495, 21) + (AssignmentAction, , 3538, 9) + (BehaviorActionBlock, , 3390, 189) + (BehaviorActionSequence, , 3454, 93) + (BehaviorAnnex, behavior_specification, 3156, 424) + (BehaviorPropertyAssociation, , 3185, 36) + (BehaviorState, done, 3312, 4) + (BehaviorState, start, 3277, 5) + (BehaviorStateGroup, , 3277, 22) + (BehaviorStateGroup, , 3312, 28) + (BehaviorTransition, , 3373, 207) + (BehaviorVariable, here, 3237, 4) + (BehaviorVariable, pairs, 3169, 5) + (BehaviorVariableGroup, , 3169, 55) + (BehaviorVariableGroup, , 3237, 12) + (ElementValues, , 3425, 5) + (ForStatement, , 3408, 157) + (ListValue, , 3214, 6) + (Reference, , 3425, 5) + (Reference, , 3454, 9) + (Reference, , 3467, 6) + (Reference, , 3495, 10) + (Reference, , 3509, 7) + (Reference, , 3538, 4) + (Reference, , 3546, 1) + (ReferenceExpression, , 3425, 5) + (ReferenceExpression, , 3467, 6) + (ReferenceExpression, , 3509, 7) + (ReferenceExpression, , 3546, 1) + (ReferenceSegment, here, 3454, 4) + (ReferenceSegment, here, 3495, 4) + (ReferenceSegment, here, 3538, 4) + (ReferenceSegment, left, 3459, 4) + (ReferenceSegment, left, 3469, 4) + (ReferenceSegment, p, 3467, 1) + (ReferenceSegment, p, 3509, 1) + (ReferenceSegment, p, 3546, 1) + (ReferenceSegment, pairs, 3425, 5) + (ReferenceSegment, right, 3500, 5) + (ReferenceSegment, right, 3511, 5) + (ReferenceTail, , 3458, 5) + (ReferenceTail, , 3468, 5) + (ReferenceTail, , 3499, 6) + (ReferenceTail, , 3510, 6) + (StringLiteral, , 3215, 4) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3205_FieldDequeues.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3205_FieldDequeues.txt index 1adeb605ca9..e02d54efaf0 100644 --- a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3205_FieldDequeues.txt +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3205_FieldDequeues.txt @@ -1,79 +1,85 @@ annex[0] owner=FieldDequeues::worker.i - (BehaviorActionBlock, , 2752, 220) - (BehaviorActionSequence, , 2816, 124) - (BehaviorAnnex, behavior_specification, 2550, 423) - (BehaviorState, done, 2674, 4) - (BehaviorState, start, 2639, 5) - (BehaviorStateGroup, , 2639, 22) - (BehaviorStateGroup, , 2674, 28) - (BehaviorTransition, , 2735, 238) - (BehaviorVariable, here, 2599, 4) - (BehaviorVariable, pairs, 2572, 5) - (BehaviorVariableGroup, , 2572, 14) - (BehaviorVariableGroup, , 2599, 12) - (CommunicationAction, , 2816, 13) - (CommunicationAction, , 2904, 14) - (ElementValues, , 2787, 5) - (ElementValues, , 2871, 5) - (ForStatement, , 2770, 188) - (ForStatement, , 2851, 89) - (Reference, , 2787, 5) - (Reference, , 2816, 4) - (Reference, , 2822, 6) - (Reference, , 2871, 5) - (Reference, , 2904, 4) - (Reference, , 2910, 7) - (ReferenceExpression, , 2787, 5) - (ReferenceExpression, , 2871, 5) - (ReferenceSegment, feed, 2816, 4) - (ReferenceSegment, feed, 2904, 4) - (ReferenceSegment, left, 2824, 4) - (ReferenceSegment, p, 2822, 1) - (ReferenceSegment, p, 2910, 1) - (ReferenceSegment, pairs, 2787, 5) - (ReferenceSegment, pairs, 2871, 5) - (ReferenceSegment, right, 2912, 5) - (ReferenceTail, , 2823, 5) - (ReferenceTail, , 2911, 6) + (BehaviorActionBlock, , 2784, 220) + (BehaviorActionSequence, , 2848, 124) + (BehaviorAnnex, behavior_specification, 2550, 455) + (BehaviorPropertyAssociation, , 2579, 36) + (BehaviorState, done, 2706, 4) + (BehaviorState, start, 2671, 5) + (BehaviorStateGroup, , 2671, 22) + (BehaviorStateGroup, , 2706, 28) + (BehaviorTransition, , 2767, 238) + (BehaviorVariable, here, 2631, 4) + (BehaviorVariable, pairs, 2563, 5) + (BehaviorVariableGroup, , 2563, 55) + (BehaviorVariableGroup, , 2631, 12) + (CommunicationAction, , 2848, 13) + (CommunicationAction, , 2936, 14) + (ElementValues, , 2819, 5) + (ElementValues, , 2903, 5) + (ForStatement, , 2802, 188) + (ForStatement, , 2883, 89) + (ListValue, , 2608, 6) + (Reference, , 2819, 5) + (Reference, , 2848, 4) + (Reference, , 2854, 6) + (Reference, , 2903, 5) + (Reference, , 2936, 4) + (Reference, , 2942, 7) + (ReferenceExpression, , 2819, 5) + (ReferenceExpression, , 2903, 5) + (ReferenceSegment, feed, 2848, 4) + (ReferenceSegment, feed, 2936, 4) + (ReferenceSegment, left, 2856, 4) + (ReferenceSegment, p, 2854, 1) + (ReferenceSegment, p, 2942, 1) + (ReferenceSegment, pairs, 2819, 5) + (ReferenceSegment, pairs, 2903, 5) + (ReferenceSegment, right, 2944, 5) + (ReferenceTail, , 2855, 5) + (ReferenceTail, , 2943, 6) + (StringLiteral, , 2609, 4) annex[1] owner=FieldDequeues::worker.j - (AssignmentAction, , 3545, 19) - (BehaviorActionBlock, , 3404, 192) - (BehaviorActionSequence, , 3468, 96) - (BehaviorAnnex, behavior_specification, 3202, 395) - (BehaviorState, done, 3326, 4) - (BehaviorState, start, 3291, 5) - (BehaviorStateGroup, , 3291, 22) - (BehaviorStateGroup, , 3326, 28) - (BehaviorTransition, , 3387, 210) - (BehaviorVariable, here, 3251, 4) - (BehaviorVariable, pairs, 3224, 5) - (BehaviorVariableGroup, , 3224, 14) - (BehaviorVariableGroup, , 3251, 12) - (CommunicationAction, , 3468, 16) - (CommunicationAction, , 3506, 17) - (ElementValues, , 3439, 5) - (ForStatement, , 3422, 160) - (Reference, , 3439, 5) - (Reference, , 3468, 4) - (Reference, , 3474, 9) - (Reference, , 3506, 4) - (Reference, , 3512, 10) - (Reference, , 3545, 9) - (Reference, , 3558, 6) - (ReferenceExpression, , 3439, 5) - (ReferenceExpression, , 3558, 6) - (ReferenceSegment, feed, 3468, 4) - (ReferenceSegment, feed, 3506, 4) - (ReferenceSegment, here, 3474, 4) - (ReferenceSegment, here, 3512, 4) - (ReferenceSegment, here, 3545, 4) - (ReferenceSegment, left, 3479, 4) - (ReferenceSegment, left, 3550, 4) - (ReferenceSegment, left, 3560, 4) - (ReferenceSegment, p, 3558, 1) - (ReferenceSegment, pairs, 3439, 5) - (ReferenceSegment, right, 3517, 5) - (ReferenceTail, , 3478, 5) - (ReferenceTail, , 3516, 6) - (ReferenceTail, , 3549, 5) - (ReferenceTail, , 3559, 5) + (AssignmentAction, , 3609, 19) + (BehaviorActionBlock, , 3468, 192) + (BehaviorActionSequence, , 3532, 96) + (BehaviorAnnex, behavior_specification, 3234, 427) + (BehaviorPropertyAssociation, , 3263, 36) + (BehaviorState, done, 3390, 4) + (BehaviorState, start, 3355, 5) + (BehaviorStateGroup, , 3355, 22) + (BehaviorStateGroup, , 3390, 28) + (BehaviorTransition, , 3451, 210) + (BehaviorVariable, here, 3315, 4) + (BehaviorVariable, pairs, 3247, 5) + (BehaviorVariableGroup, , 3247, 55) + (BehaviorVariableGroup, , 3315, 12) + (CommunicationAction, , 3532, 16) + (CommunicationAction, , 3570, 17) + (ElementValues, , 3503, 5) + (ForStatement, , 3486, 160) + (ListValue, , 3292, 6) + (Reference, , 3503, 5) + (Reference, , 3532, 4) + (Reference, , 3538, 9) + (Reference, , 3570, 4) + (Reference, , 3576, 10) + (Reference, , 3609, 9) + (Reference, , 3622, 6) + (ReferenceExpression, , 3503, 5) + (ReferenceExpression, , 3622, 6) + (ReferenceSegment, feed, 3532, 4) + (ReferenceSegment, feed, 3570, 4) + (ReferenceSegment, here, 3538, 4) + (ReferenceSegment, here, 3576, 4) + (ReferenceSegment, here, 3609, 4) + (ReferenceSegment, left, 3543, 4) + (ReferenceSegment, left, 3614, 4) + (ReferenceSegment, left, 3624, 4) + (ReferenceSegment, p, 3622, 1) + (ReferenceSegment, pairs, 3503, 5) + (ReferenceSegment, right, 3581, 5) + (ReferenceTail, , 3542, 5) + (ReferenceTail, , 3580, 6) + (ReferenceTail, , 3613, 5) + (ReferenceTail, , 3623, 5) + (StringLiteral, , 3293, 4) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3226_Issue3226.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3226_Issue3226.txt index de7585d8afd..78292a3f0dc 100644 --- a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3226_Issue3226.txt +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3226_Issue3226.txt @@ -1,32 +1,36 @@ annex[0] owner=Issue3226::worker.i - (AssignmentAction, , 2971, 21) - (BehaviorActionBlock, , 2844, 202) - (BehaviorAnnex, behavior_specification, 2629, 418) - (BehaviorState, done, 2766, 4) - (BehaviorState, start, 2731, 5) - (BehaviorStateGroup, , 2731, 22) - (BehaviorStateGroup, , 2766, 28) - (BehaviorTransition, , 2827, 220) - (BehaviorVariable, m, 2692, 1) - (BehaviorVariable, total, 2651, 5) - (BehaviorVariableGroup, , 2651, 28) - (BehaviorVariableGroup, , 2692, 11) - (BinaryExpression, , 2980, 12) - (ElementValues, , 2880, 1) - (ElementValues, , 2940, 3) - (ForStatement, , 2862, 170) - (ForStatement, , 2905, 109) - (Reference, , 2880, 1) - (Reference, , 2940, 3) - (Reference, , 2971, 5) - (Reference, , 2980, 4) - (Reference, , 2987, 5) - (ReferenceExpression, , 2880, 1) - (ReferenceExpression, , 2940, 3) - (ReferenceExpression, , 2980, 4) - (ReferenceExpression, , 2987, 5) - (ReferenceSegment, cell, 2980, 4) - (ReferenceSegment, m, 2880, 1) - (ReferenceSegment, row, 2940, 3) - (ReferenceSegment, total, 2971, 5) - (ReferenceSegment, total, 2987, 5) + (AssignmentAction, , 2999, 21) + (BehaviorActionBlock, , 2872, 202) + (BehaviorAnnex, behavior_specification, 2629, 446) + (BehaviorIntegerLiteral, , 2673, 1) + (BehaviorPropertyAssociation, , 2692, 36) + (BehaviorState, done, 2794, 4) + (BehaviorState, start, 2759, 5) + (BehaviorStateGroup, , 2759, 22) + (BehaviorStateGroup, , 2794, 28) + (BehaviorTransition, , 2855, 220) + (BehaviorVariable, m, 2679, 1) + (BehaviorVariable, total, 2642, 5) + (BehaviorVariableGroup, , 2642, 33) + (BehaviorVariableGroup, , 2679, 52) + (BinaryExpression, , 3008, 12) + (ElementValues, , 2908, 1) + (ElementValues, , 2968, 3) + (ForStatement, , 2890, 170) + (ForStatement, , 2933, 109) + (ListValue, , 2721, 6) + (Reference, , 2908, 1) + (Reference, , 2968, 3) + (Reference, , 2999, 5) + (Reference, , 3008, 4) + (Reference, , 3015, 5) + (ReferenceExpression, , 2908, 1) + (ReferenceExpression, , 2968, 3) + (ReferenceExpression, , 3008, 4) + (ReferenceExpression, , 3015, 5) + (ReferenceSegment, cell, 3008, 4) + (ReferenceSegment, m, 2908, 1) + (ReferenceSegment, row, 2968, 3) + (ReferenceSegment, total, 2999, 5) + (ReferenceSegment, total, 3015, 5) + (StringLiteral, , 2722, 4) diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_characterization_conformance_ShortCircuitOperators.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_characterization_conformance_ShortCircuitOperators.txt index 0f73e50769b..9952d35bb96 100644 --- a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_characterization_conformance_ShortCircuitOperators.txt +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_characterization_conformance_ShortCircuitOperators.txt @@ -1,7 +1,9 @@ annex[0] owner=ShortCircuitOperators::operation parsedAnnexSubclause : BehaviorAnnex name=behavior_specification variables[0] : BehaviorVariable name=left + ownedValueConstant : BehaviorBooleanLiteral variables[1] : BehaviorVariable name=right + ownedValueConstant : BehaviorBooleanLiteral states[0] : BehaviorState name=start states[1] : BehaviorState name=finish transitions[0] : BehaviorTransition name=and_then_transition diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_covering_semantic_lr_D6_L3_L4.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_covering_semantic_lr_D6_L3_L4.txt index 71a9e2f577c..c3814338249 100644 --- a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_covering_semantic_lr_D6_L3_L4.txt +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_covering_semantic_lr_D6_L3_L4.txt @@ -1,6 +1,7 @@ annex[0] owner=exemple_lr_D6_L3_D6_L4::th.good parsedAnnexSubclause : BehaviorAnnex name=behavior_specification variables[0] : BehaviorVariable name=a + ownedValueConstant : BehaviorIntegerLiteral variables[1] : BehaviorVariable name=b variables[2] : BehaviorVariable name=c variables[3] : BehaviorVariable name=d @@ -273,6 +274,7 @@ annex[0] owner=exemple_lr_D6_L3_D6_L4::th.good annex[1] owner=exemple_lr_D6_L3_D6_L4::th.error parsedAnnexSubclause : BehaviorAnnex name=behavior_specification variables[0] : BehaviorVariable name=a + ownedValueConstant : BehaviorIntegerLiteral variables[1] : BehaviorVariable name=b variables[2] : BehaviorVariable name=c variables[3] : BehaviorVariable name=d diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3169_Issue3169.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3169_Issue3169.txt index d5a62929d76..3c466c73c45 100644 --- a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3169_Issue3169.txt +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3169_Issue3169.txt @@ -1,7 +1,9 @@ annex[0] owner=Issue3169::operation parsedAnnexSubclause : BehaviorAnnex name=behavior_specification variables[0] : BehaviorVariable name=left + ownedValueConstant : BehaviorBooleanLiteral variables[1] : BehaviorVariable name=right + ownedValueConstant : BehaviorBooleanLiteral states[0] : BehaviorState name=start states[1] : BehaviorState name=finish transitions[0] : BehaviorTransition name=and_then_transition diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3173_Issue3173.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3173_Issue3173.txt index dc89c3b5b67..ead49cb1ca6 100644 --- a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3173_Issue3173.txt +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3173_Issue3173.txt @@ -1,7 +1,12 @@ annex[0] owner=Issue3173::worker.i parsedAnnexSubclause : BehaviorAnnex name=behavior_specification variables[0] : BehaviorVariable name=total + ownedValueConstant : BehaviorIntegerLiteral variables[1] : BehaviorVariable name=pairs + ownedPropertyAssociations[0] : PropertyAssociation + ownedValue[0] : ModalPropertyValue + ownedValue : ListValue + ownedListElement[0] : StringLiteral states[0] : BehaviorState name=start states[1] : BehaviorState name=done transitions[0] : BehaviorTransition name=range_loop diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3177_Issue3177.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3177_Issue3177.txt index 362e0d3fae8..5bfb65df639 100644 --- a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3177_Issue3177.txt +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3177_Issue3177.txt @@ -1,10 +1,14 @@ annex[0] owner=Issue3177::evaluate parsedAnnexSubclause : BehaviorAnnex name=behavior_specification variables[0] : BehaviorVariable name=total + ownedValueConstant : BehaviorIntegerLiteral variables[1] : BehaviorVariable name=result variables[2] : BehaviorVariable name=left + ownedValueConstant : BehaviorBooleanLiteral variables[3] : BehaviorVariable name=middle + ownedValueConstant : BehaviorBooleanLiteral variables[4] : BehaviorVariable name=right + ownedValueConstant : BehaviorBooleanLiteral variables[5] : BehaviorVariable name=flag states[0] : BehaviorState name=start states[1] : BehaviorState name=done diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3180_FieldAssignments.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3180_FieldAssignments.txt index 7a664d43de5..136b012b5a0 100644 --- a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3180_FieldAssignments.txt +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3180_FieldAssignments.txt @@ -1,6 +1,10 @@ annex[0] owner=FieldAssignments::worker.i parsedAnnexSubclause : BehaviorAnnex name=behavior_specification variables[0] : BehaviorVariable name=pairs + ownedPropertyAssociations[0] : PropertyAssociation + ownedValue[0] : ModalPropertyValue + ownedValue : ListValue + ownedListElement[0] : StringLiteral variables[1] : BehaviorVariable name=here states[0] : BehaviorState name=start states[1] : BehaviorState name=done @@ -41,6 +45,10 @@ annex[0] owner=FieldAssignments::worker.i annex[1] owner=FieldAssignments::worker.j parsedAnnexSubclause : BehaviorAnnex name=behavior_specification variables[0] : BehaviorVariable name=pairs + ownedPropertyAssociations[0] : PropertyAssociation + ownedValue[0] : ModalPropertyValue + ownedValue : ListValue + ownedListElement[0] : StringLiteral variables[1] : BehaviorVariable name=here states[0] : BehaviorState name=start states[1] : BehaviorState name=done diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3205_FieldDequeues.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3205_FieldDequeues.txt index 681b88f0ca4..837ffa2beb1 100644 --- a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3205_FieldDequeues.txt +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3205_FieldDequeues.txt @@ -1,6 +1,10 @@ annex[0] owner=FieldDequeues::worker.i parsedAnnexSubclause : BehaviorAnnex name=behavior_specification variables[0] : BehaviorVariable name=pairs + ownedPropertyAssociations[0] : PropertyAssociation + ownedValue[0] : ModalPropertyValue + ownedValue : ListValue + ownedListElement[0] : StringLiteral variables[1] : BehaviorVariable name=here states[0] : BehaviorState name=start states[1] : BehaviorState name=done @@ -28,6 +32,10 @@ annex[0] owner=FieldDequeues::worker.i annex[1] owner=FieldDequeues::worker.j parsedAnnexSubclause : BehaviorAnnex name=behavior_specification variables[0] : BehaviorVariable name=pairs + ownedPropertyAssociations[0] : PropertyAssociation + ownedValue[0] : ModalPropertyValue + ownedValue : ListValue + ownedListElement[0] : StringLiteral variables[1] : BehaviorVariable name=here states[0] : BehaviorState name=start states[1] : BehaviorState name=done diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3226_Issue3226.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3226_Issue3226.txt index 572f090acdf..da4121ac31a 100644 --- a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3226_Issue3226.txt +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3226_Issue3226.txt @@ -1,7 +1,12 @@ annex[0] owner=Issue3226::worker.i parsedAnnexSubclause : BehaviorAnnex name=behavior_specification variables[0] : BehaviorVariable name=total + ownedValueConstant : BehaviorIntegerLiteral variables[1] : BehaviorVariable name=m + ownedPropertyAssociations[0] : PropertyAssociation + ownedValue[0] : ModalPropertyValue + ownedValue : ListValue + ownedListElement[0] : StringLiteral states[0] : BehaviorState name=start states[1] : BehaviorState name=done transitions[0] : BehaviorTransition diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_characterization_conformance_ShortCircuitOperators.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_characterization_conformance_ShortCircuitOperators.txt index 6da636af992..ff904f0924d 100644 --- a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_characterization_conformance_ShortCircuitOperators.txt +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_characterization_conformance_ShortCircuitOperators.txt @@ -1,7 +1,7 @@ ===== annex[0] owner=ShortCircuitOperators::operation ===== \t\tvariables -\t\t\tleft, right: Base_Types::Boolean; +\t\t\tleft, right: Base_Types::Boolean := false; \t\tstates \t\t\tstart: initial state; \t\t\tfinish: final state; diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_covering_semantic_lr_D6_L3_L4.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_covering_semantic_lr_D6_L3_L4.txt index ef53533fdba..f680d0f2e60 100644 --- a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_covering_semantic_lr_D6_L3_L4.txt +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_covering_semantic_lr_D6_L3_L4.txt @@ -2,7 +2,7 @@ variables - a : Base_Types::Integer ; + a : Base_Types::Integer := 0 ; b : Base_Types::Integer ; c : Base_Types::Integer ; d : Base_Types::Integer ; @@ -77,7 +77,7 @@ reparsed variables - a : Base_Types::Integer ; + a : Base_Types::Integer := 0 ; b : Base_Types::Integer ; c : Base_Types::Integer ; d : Base_Types::Integer ; diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3169_Issue3169.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3169_Issue3169.txt index 32cdfaee36c..5029d587a6c 100644 --- a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3169_Issue3169.txt +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3169_Issue3169.txt @@ -1,7 +1,7 @@ ===== annex[0] owner=Issue3169::operation ===== \t\tvariables -\t\t\tleft, right: Base_Types::Boolean; +\t\t\tleft, right: Base_Types::Boolean := false; \t\tstates \t\t\tstart: initial state; \t\t\tfinish: final state; diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3173_Issue3173.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3173_Issue3173.txt index 8de827b28c6..8e8c5d0fd91 100644 --- a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3173_Issue3173.txt +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3173_Issue3173.txt @@ -1,8 +1,8 @@ ===== annex[0] owner=Issue3173::worker.i ===== variables - total : Base_Types::Integer; - pairs : Pairs; +\t\t\ttotal : Base_Types::Integer := 0; +\t\t\tpairs : Pairs { Data_Model::Initial_Value => ("[]"); }; states start : initial state; done : complete final state; diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3177_Issue3177.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3177_Issue3177.txt index 12c03316322..1bdef9ef391 100644 --- a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3177_Issue3177.txt +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3177_Issue3177.txt @@ -1,11 +1,11 @@ ===== annex[0] owner=Issue3177::evaluate ===== \t\tvariables -\t\t\ttotal : Base_Types::Integer; +\t\t\ttotal : Base_Types::Integer := 0; \t\t\tresult : Base_Types::Integer; -\t\t\tleft : Base_Types::Boolean; -\t\t\tmiddle : Base_Types::Boolean; -\t\t\tright : Base_Types::Boolean; +\t\t\tleft : Base_Types::Boolean := false; +\t\t\tmiddle : Base_Types::Boolean := false; +\t\t\tright : Base_Types::Boolean := false; \t\t\tflag : Base_Types::Boolean; \t\tstates \t\t\tstart : initial state; diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3180_FieldAssignments.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3180_FieldAssignments.txt index 94e415486dd..ba0124a72f7 100644 --- a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3180_FieldAssignments.txt +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3180_FieldAssignments.txt @@ -1,7 +1,7 @@ ===== annex[0] owner=FieldAssignments::worker.i ===== variables - pairs : Pairs; +\t\t\tpairs : Pairs { Data_Model::Initial_Value => ("[]"); }; here : Pair; states start : initial state; @@ -21,7 +21,7 @@ reparsed ===== annex[1] owner=FieldAssignments::worker.j ===== variables - pairs : Pairs; +\t\t\tpairs : Pairs { Data_Model::Initial_Value => ("[]"); }; here : Pair; states start : initial state; diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3205_FieldDequeues.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3205_FieldDequeues.txt index 1d8b72192f9..40df7863287 100644 --- a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3205_FieldDequeues.txt +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3205_FieldDequeues.txt @@ -1,7 +1,7 @@ ===== annex[0] owner=FieldDequeues::worker.i ===== variables - pairs : Pairs; +\t\t\tpairs : Pairs { Data_Model::Initial_Value => ("[]"); }; here : Pair; states start : initial state; @@ -21,7 +21,7 @@ reparsed ===== annex[1] owner=FieldDequeues::worker.j ===== variables - pairs : Pairs; +\t\t\tpairs : Pairs { Data_Model::Initial_Value => ("[]"); }; here : Pair; states start : initial state; diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3226_Issue3226.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3226_Issue3226.txt index 418421b311f..68ab7b39a4e 100644 --- a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3226_Issue3226.txt +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3226_Issue3226.txt @@ -1,8 +1,8 @@ ===== annex[0] owner=Issue3226::worker.i ===== variables - total : Base_Types::Integer; - m : Matrix; +\t\t\ttotal : Base_Types::Integer := 0; +\t\t\tm : Matrix { Data_Model::Initial_Value => ("[]"); }; states start : initial state; done : complete final state; diff --git a/ba/org.osate.ba.tests/models/characterization/conformance/ShortCircuitOperators.aadl b/ba/org.osate.ba.tests/models/characterization/conformance/ShortCircuitOperators.aadl index b3d87b77a73..a725c64ff6e 100644 --- a/ba/org.osate.ba.tests/models/characterization/conformance/ShortCircuitOperators.aadl +++ b/ba/org.osate.ba.tests/models/characterization/conformance/ShortCircuitOperators.aadl @@ -7,7 +7,7 @@ public subprogram operation annex behavior_specification {** variables - left, right: Base_Types::Boolean; + left, right: Base_Types::Boolean := false; states start: initial state; finish: final state; diff --git a/ba/org.osate.ba.tests/models/covering_semantic/lr_D6_L3_L4.aadl b/ba/org.osate.ba.tests/models/covering_semantic/lr_D6_L3_L4.aadl index ba1d7e32cb6..4a0d9e4df14 100644 --- a/ba/org.osate.ba.tests/models/covering_semantic/lr_D6_L3_L4.aadl +++ b/ba/org.osate.ba.tests/models/covering_semantic/lr_D6_L3_L4.aadl @@ -50,7 +50,7 @@ thread implementation th.good annex behavior_specification {** variables - a : Base_Types::Integer ; + a : Base_Types::Integer := 0 ; b : Base_Types::Integer ; c : Base_Types::Integer ; d : Base_Types::Integer ; @@ -131,7 +131,7 @@ thread implementation th.error annex behavior_specification {** variables - a : Base_Types::Integer ; + a : Base_Types::Integer := 0 ; b : Base_Types::Integer ; c : Base_Types::Integer ; d : Base_Types::Integer ; @@ -199,4 +199,4 @@ transitions end th.error ; -end exemple_lr_D6_L3_D6_L4 ; \ No newline at end of file +end exemple_lr_D6_L3_D6_L4 ; diff --git a/ba/org.osate.ba.tests/models/issue3169/Issue3169.aadl b/ba/org.osate.ba.tests/models/issue3169/Issue3169.aadl index 30e8de52f52..b2bda45f026 100644 --- a/ba/org.osate.ba.tests/models/issue3169/Issue3169.aadl +++ b/ba/org.osate.ba.tests/models/issue3169/Issue3169.aadl @@ -27,7 +27,7 @@ public subprogram operation annex behavior_specification {** variables - left, right: Base_Types::Boolean; + left, right: Base_Types::Boolean := false; states start: initial state; finish: final state; diff --git a/ba/org.osate.ba.tests/models/issue3173/Issue3173.aadl b/ba/org.osate.ba.tests/models/issue3173/Issue3173.aadl index 2e269b074ab..58b25217240 100644 --- a/ba/org.osate.ba.tests/models/issue3173/Issue3173.aadl +++ b/ba/org.osate.ba.tests/models/issue3173/Issue3173.aadl @@ -55,8 +55,8 @@ public history : data Base_Types::Integer [3]; annex behavior_specification {** variables - total : Base_Types::Integer; - pairs : Pairs; + total : Base_Types::Integer := 0; + pairs : Pairs { Data_Model::Initial_Value => ("[]"); }; states start : initial state; done : complete final state; diff --git a/ba/org.osate.ba.tests/models/issue3177/Issue3177.aadl b/ba/org.osate.ba.tests/models/issue3177/Issue3177.aadl index 3a36574df28..f5b54051ad8 100644 --- a/ba/org.osate.ba.tests/models/issue3177/Issue3177.aadl +++ b/ba/org.osate.ba.tests/models/issue3177/Issue3177.aadl @@ -27,11 +27,11 @@ public subprogram evaluate annex behavior_specification {** variables - total : Base_Types::Integer; + total : Base_Types::Integer := 0; result : Base_Types::Integer; - left : Base_Types::Boolean; - middle : Base_Types::Boolean; - right : Base_Types::Boolean; + left : Base_Types::Boolean := false; + middle : Base_Types::Boolean := false; + right : Base_Types::Boolean := false; flag : Base_Types::Boolean; states start : initial state; diff --git a/ba/org.osate.ba.tests/models/issue3180/FieldAssignments.aadl b/ba/org.osate.ba.tests/models/issue3180/FieldAssignments.aadl index 111fb17b7dd..1b73938e698 100644 --- a/ba/org.osate.ba.tests/models/issue3180/FieldAssignments.aadl +++ b/ba/org.osate.ba.tests/models/issue3180/FieldAssignments.aadl @@ -45,7 +45,7 @@ public thread implementation worker.i annex behavior_specification {** variables - pairs : Pairs; + pairs : Pairs { Data_Model::Initial_Value => ("[]"); }; here : Pair; states start : initial state; @@ -66,7 +66,7 @@ public thread implementation worker.j annex behavior_specification {** variables - pairs : Pairs; + pairs : Pairs { Data_Model::Initial_Value => ("[]"); }; here : Pair; states start : initial state; diff --git a/ba/org.osate.ba.tests/models/issue3205/FieldDequeues.aadl b/ba/org.osate.ba.tests/models/issue3205/FieldDequeues.aadl index 200b6fa3cc2..f938b5454a0 100644 --- a/ba/org.osate.ba.tests/models/issue3205/FieldDequeues.aadl +++ b/ba/org.osate.ba.tests/models/issue3205/FieldDequeues.aadl @@ -47,7 +47,7 @@ public thread implementation worker.i annex behavior_specification {** variables - pairs : Pairs; + pairs : Pairs { Data_Model::Initial_Value => ("[]"); }; here : Pair; states start : initial state; @@ -68,7 +68,7 @@ public thread implementation worker.j annex behavior_specification {** variables - pairs : Pairs; + pairs : Pairs { Data_Model::Initial_Value => ("[]"); }; here : Pair; states start : initial state; diff --git a/ba/org.osate.ba.tests/models/issue3226/Issue3226.aadl b/ba/org.osate.ba.tests/models/issue3226/Issue3226.aadl index 3b8ec7893e7..2d3ce2baca4 100644 --- a/ba/org.osate.ba.tests/models/issue3226/Issue3226.aadl +++ b/ba/org.osate.ba.tests/models/issue3226/Issue3226.aadl @@ -47,8 +47,8 @@ public thread implementation worker.i annex behavior_specification {** variables - total : Base_Types::Integer; - m : Matrix; + total : Base_Types::Integer := 0; + m : Matrix { Data_Model::Initial_Value => ("[]"); }; states start : initial state; done : complete final state; diff --git a/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaInitializationChecker.java b/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaInitializationChecker.java new file mode 100644 index 00000000000..5123d5b195c --- /dev/null +++ b/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaInitializationChecker.java @@ -0,0 +1,299 @@ +/** + * Copyright (c) 2004-2026 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici- + * aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li- + * censes only apply to the Third Party Software and not any other portion of this program or this program as a whole. + */ +package org.osate.ba.analyzers; + +import java.util.ArrayDeque; +import java.util.Collections; +import java.util.IdentityHashMap; +import java.util.Map; +import java.util.Set; + +import org.eclipse.emf.ecore.EObject; +import org.osate.aadl2.PropertyAssociation; +import org.osate.aadl2.modelsupport.errorreporting.AnalysisErrorReporterManager; +import org.osate.ba.aadlba.AssignmentAction; +import org.osate.ba.aadlba.BehaviorActionBlock; +import org.osate.ba.aadlba.BehaviorActionSequence; +import org.osate.ba.aadlba.BehaviorActionSet; +import org.osate.ba.aadlba.BehaviorActions; +import org.osate.ba.aadlba.BehaviorAnnex; +import org.osate.ba.aadlba.BehaviorState; +import org.osate.ba.aadlba.BehaviorTransition; +import org.osate.ba.aadlba.BehaviorVariable; +import org.osate.ba.aadlba.BehaviorVariableHolder; +import org.osate.ba.aadlba.DataComponentReference; +import org.osate.ba.aadlba.ElseStatement; +import org.osate.ba.aadlba.ForOrForAllStatement; +import org.osate.ba.aadlba.IfStatement; +import org.osate.ba.aadlba.IndexableElement; +import org.osate.ba.aadlba.InternalPortSendAction; +import org.osate.ba.aadlba.ParameterLabel; +import org.osate.ba.aadlba.PortDequeueAction; +import org.osate.ba.aadlba.PortSendAction; +import org.osate.ba.aadlba.PropertyReference; +import org.osate.ba.aadlba.SubprogramCallAction; +import org.osate.ba.aadlba.Target; +import org.osate.ba.aadlba.ValueExpression; +import org.osate.ba.aadlba.WhileOrDoUntilStatement; + +/** + * Performs the declarative part of AS5506/3 Rev. A D.7 definite-initialization analysis. Local behavior variables are + * tracked through action control flow and the behavior-state graph. Data-component initialization through a prefixed + * {@code Data_Model::Initial_Value} is instance-dependent and deliberately remains outside this checker. + */ +public final class AadlBaInitializationChecker { + private static final String INITIAL_VALUE = "Data_Model::Initial_Value"; + + private final BehaviorAnnex annex; + private final AnalysisErrorReporterManager errorManager; + + public AadlBaInitializationChecker(BehaviorAnnex annex, AnalysisErrorReporterManager errorManager) { + this.annex = annex; + this.errorManager = errorManager; + } + + /** Checks every reachable read and returns whether all tracked variables were definitely initialized. */ + public boolean check() { + var initial = identitySet(); + annex.getVariables().stream().filter(AadlBaInitializationChecker::hasInitializer).forEach(initial::add); + var stateEntries = findStateEntries(initial); + var valid = new boolean[] { true }; + for (var transition : annex.getTransitions()) { + var entry = stateEntries.get(transition.getSourceState()); + if (entry != null) { + checkReads(transition.getCondition(), entry, valid); + transfer(transition.getActionBlock(), entry, true, valid); + } + } + return valid[0]; + } + + private Map> findStateEntries(Set initial) { + Map> entries = new IdentityHashMap<>(); + var work = new ArrayDeque(); + for (var state : annex.getStates()) { + if (state.isInitial()) { + entries.put(state, copy(initial)); + work.add(state); + } + } + while (!work.isEmpty()) { + var state = work.removeFirst(); + var entry = entries.get(state); + for (var transition : state.getOutgoingTransitions()) { + var destination = transition.getDestinationState(); + if (destination == null) { + continue; + } + var outgoing = transfer(transition.getActionBlock(), entry, false, new boolean[] { true }); + var previous = entries.get(destination); + if (previous == null) { + entries.put(destination, outgoing); + work.add(destination); + } else { + var merged = copy(previous); + merged.retainAll(outgoing); + if (!merged.equals(previous)) { + entries.put(destination, merged); + work.add(destination); + } + } + } + } + return entries; + } + + private Set transfer(BehaviorActions actions, Set incoming, boolean report, + boolean[] valid) { + if (actions == null) { + return copy(incoming); + } + if (actions instanceof BehaviorActionBlock block) { + return transfer(block.getContent(), incoming, report, valid); + } + if (actions instanceof BehaviorActionSequence sequence) { + var result = copy(incoming); + for (var action : sequence.getActions()) { + result = transfer(action, result, report, valid); + } + return result; + } + if (actions instanceof BehaviorActionSet set) { + var result = copy(incoming); + for (var action : set.getActions()) { + result.addAll(transfer(action, incoming, report, valid)); + } + return result; + } + if (actions instanceof AssignmentAction assignment) { + checkReads(assignment.getValueExpression(), incoming, report ? valid : null); + checkTargetIndexes(assignment.getTarget(), incoming, report ? valid : null); + var result = copy(incoming); + var written = wholeVariable(assignment.getTarget()); + if (written != null) { + result.add(written); + } + return result; + } + if (actions instanceof PortDequeueAction dequeue) { + checkTargetIndexes(dequeue.getTarget(), incoming, report ? valid : null); + var result = copy(incoming); + var written = wholeVariable(dequeue.getTarget()); + if (written != null) { + result.add(written); + } + return result; + } + if (actions instanceof PortSendAction send) { + checkReads(send.getValueExpression(), incoming, report ? valid : null); + return copy(incoming); + } + if (actions instanceof InternalPortSendAction send) { + checkReads(send.getValueExpression(), incoming, report ? valid : null); + return copy(incoming); + } + if (actions instanceof SubprogramCallAction call) { + var result = copy(incoming); + for (ParameterLabel parameter : call.getParameterLabels()) { + if (parameter instanceof ValueExpression expression) { + checkReads(expression, incoming, report ? valid : null); + } else if (parameter instanceof Target target) { + checkTargetIndexes(target, incoming, report ? valid : null); + var written = wholeVariable(target); + if (written != null) { + result.add(written); + } + } + } + return result; + } + if (actions instanceof IfStatement conditional) { + return transferConditional(conditional, incoming, report, valid); + } + if (actions instanceof WhileOrDoUntilStatement loop) { + if (loop.isDoUntil()) { + var afterBody = transfer(loop.getBehaviorActions(), incoming, report, valid); + checkReads(loop.getLogicalValueExpression(), afterBody, report ? valid : null); + return afterBody; + } + checkReads(loop.getLogicalValueExpression(), incoming, report ? valid : null); + transfer(loop.getBehaviorActions(), incoming, report, valid); + return copy(incoming); + } + if (actions instanceof ForOrForAllStatement loop) { + checkReads(loop.getIteratedValues(), incoming, report ? valid : null); + transfer(loop.getBehaviorActions(), incoming, report, valid); + return copy(incoming); + } + return copy(incoming); + } + + private Set transferConditional(IfStatement conditional, Set incoming, + boolean report, boolean[] valid) { + checkReads(conditional.getLogicalValueExpression(), incoming, report ? valid : null); + var result = transfer(conditional.getBehaviorActions(), incoming, report, valid); + var alternative = conditional.getElseStatement(); + Set alternativeResult; + if (alternative instanceof IfStatement elseIf) { + alternativeResult = transferConditional(elseIf, incoming, report, valid); + } else if (alternative instanceof ElseStatement elseStatement) { + alternativeResult = transfer(elseStatement.getBehaviorActions(), incoming, report, valid); + } else { + alternativeResult = incoming; + } + result.retainAll(alternativeResult); + return result; + } + + private void checkTargetIndexes(Target target, Set initialized, boolean[] valid) { + if (target == null) { + return; + } + if (target instanceof IndexableElement indexable) { + indexable.getArrayIndexes().forEach(index -> checkReads((EObject) index, initialized, valid)); + } + if (target instanceof DataComponentReference reference) { + for (var holder : reference.getData()) { + if (holder instanceof IndexableElement indexable) { + indexable.getArrayIndexes().forEach(index -> checkReads((EObject) index, initialized, valid)); + } + } + } + } + + private void checkReads(EObject object, Set initialized, boolean[] valid) { + if (object == null || object instanceof PropertyReference) { + return; + } + var variable = readVariable(object); + if (variable != null && !initialized.contains(variable) && valid != null) { + errorManager.error((org.osate.aadl2.Element) object, + "Behavior variable '" + variable.getName() + "' may be read before it is initialized"); + valid[0] = false; + } + for (var child : object.eContents()) { + checkReads(child, initialized, valid); + } + } + + private static BehaviorVariable readVariable(EObject object) { + if (object instanceof DataComponentReference reference && !reference.getData().isEmpty() + && reference.getData().getFirst().getElement() instanceof BehaviorVariable variable) { + return variable; + } + if (object instanceof BehaviorVariableHolder holder && !(holder.eContainer() instanceof DataComponentReference)) { + return holder.getBehaviorVariable(); + } + return null; + } + + private static BehaviorVariable wholeVariable(Target target) { + return target instanceof BehaviorVariableHolder holder && holder.getArrayIndexes().isEmpty() + ? holder.getBehaviorVariable() + : null; + } + + private static boolean hasInitializer(BehaviorVariable variable) { + if (variable.getOwnedValueConstant() != null) { + return true; + } + for (PropertyAssociation association : variable.getOwnedPropertyAssociations()) { + if (association.getProperty() != null + && INITIAL_VALUE.equalsIgnoreCase(association.getProperty().getQualifiedName())) { + return true; + } + } + return false; + } + + private static Set identitySet() { + return Collections.newSetFromMap(new IdentityHashMap<>()); + } + + private static Set copy(Set source) { + var result = identitySet(); + result.addAll(source); + return result; + } +} diff --git a/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaTypeChecker.java b/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaTypeChecker.java index cd9e8825b5a..8ff28ba6a70 100644 --- a/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaTypeChecker.java +++ b/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaTypeChecker.java @@ -147,9 +147,40 @@ private boolean checkBehaviorVariable(BehaviorVariable variable) { result = false; } } + if (result && variable.getOwnedValueConstant() != null) { + var variableType = new TypeHolder(AadlBaUtils.getDataRepresentation(variable), variable.getDataClassifier()); + variableType.setDimension(variable.getArrayDimensions().size()); + var initializerType = getType(variable.getOwnedValueConstant()); + if (initializerType == null || !initializerConformsTo(variableType, initializerType)) { + if (initializerType != null) { + reportTypeError(variable.getOwnedValueConstant(), "behavior variable initializer", + variableType.toString(), initializerType.toString()); + } + result = false; + } + } return result; } + /** + * General BA assignment conformance is intentionally still disabled in {@link AdaLikeDataTypeChecker}. An explicit + * declaration initializer is narrower: both its constant kind and the variable's declared classifier are known + * before any instance-dependent property lookup, so reject only a mismatch that is definite here. + */ + private static boolean initializerConformsTo(TypeHolder variableType, TypeHolder initializerType) { + if (variableType.getDimension() != initializerType.getDimension()) { + return false; + } + var variableRepresentation = variableType.getDataRep(); + var initializerRepresentation = initializerType.getDataRep(); + if (variableRepresentation != DataRepresentation.UNKNOWN + && initializerRepresentation != DataRepresentation.UNKNOWN) { + return variableRepresentation == initializerRepresentation; + } + return variableType.getKlass() == null || initializerType.getKlass() == null + || variableType.getKlass() == initializerType.getKlass(); + } + private boolean checkBehaviorTransition(BehaviorTransition transition, Set checked) { boolean result = true; BehaviorCondition condition = transition.getCondition(); diff --git a/ba/org.osate.xtext.aadl2.ba/src/org/osate/xtext/aadl2/ba/validation/BehaviorAnnexValidator.java b/ba/org.osate.xtext.aadl2.ba/src/org/osate/xtext/aadl2/ba/validation/BehaviorAnnexValidator.java index bc0a7e35517..d0980331b7f 100644 --- a/ba/org.osate.xtext.aadl2.ba/src/org/osate/xtext/aadl2/ba/validation/BehaviorAnnexValidator.java +++ b/ba/org.osate.xtext.aadl2.ba/src/org/osate/xtext/aadl2/ba/validation/BehaviorAnnexValidator.java @@ -59,6 +59,7 @@ import org.osate.annexsupport.ParseResultHolder; import org.osate.ba.aadlba.ForOrForAllStatement; import org.osate.ba.aadlba.PropertySetPropertyReference; +import org.osate.ba.analyzers.AadlBaInitializationChecker; import org.osate.ba.analyzers.AadlBaRulesCheckersDriver; import org.osate.ba.analyzers.AadlBaTypeChecker; import org.osate.ba.analyzers.AdaLikeDataTypeChecker; @@ -159,6 +160,7 @@ public void checkBehaviorAnnex(final BehaviorAnnex source) { var dataTypeChecker = new AdaLikeDataTypeChecker(errorManager); var typeChecker = new AadlBaTypeChecker(strictAnnex, owner, dataTypeChecker, errorManager); if (typeChecker.checkTypes()) { + new AadlBaInitializationChecker(strictAnnex, errorManager).check(); new AadlBaRulesCheckersDriver(strictAnnex, owner, errorManager).process(strictAnnex); } } finally {