diff --git a/ba/doc/conformance.md b/ba/doc/conformance.md index b86c0e6397..ed8b4e7e19 100644 --- a/ba/doc/conformance.md +++ b/ba/doc/conformance.md @@ -12,7 +12,7 @@ The user directed that the report findings be treated as valid and filed without | Finding | Issue | Finding | Issue | | --- | --- | --- | --- | -| G01 ✅ | [#3165](https://github.com/osate/osate2/issues/3165) | G15 | [#3179](https://github.com/osate/osate2/issues/3179) | +| G01 ✅ | [#3165](https://github.com/osate/osate2/issues/3165) | G15 ✅ | [#3179](https://github.com/osate/osate2/issues/3179) | | G02 ✅ | [#3166](https://github.com/osate/osate2/issues/3166) | G16 ✅ | [#3180](https://github.com/osate/osate2/issues/3180) | | G03 ✅ | [#3167](https://github.com/osate/osate2/issues/3167) | G17 | [#3181](https://github.com/osate/osate2/issues/3181) | | G04 ✅ | [#3168](https://github.com/osate/osate2/issues/3168) | V01 ✅ | [#3182](https://github.com/osate/osate2/issues/3182) | @@ -57,7 +57,7 @@ The review itself was a source and test-artifact audit. No Maven tests, simulato | Section | Implemented capability and evidence | Assessment | | --- | --- | --- | | D.1–D.2: scope and concepts | Embedded `behavior_specification` parser, linker, serializer, and strict-model translation are registered. | Supports the language-tooling role; execution semantics require separate consumer evidence. | -| D.3: behavior specification | Variables, grouped states, state kinds, named/prioritized and multiple-source transitions, execute conditions, and dispatch/external conditions. State and transition legality checks have dedicated tests. | Partial. Internal conditions (G01), complete external-condition expressions (G02), naming and otherwise-transition rules (V01 and V02), and complete-state mode binding (G14) were absent and are now implemented; multiple subprogram final states are rejected unconditionally, and several consistency obligations lack demonstrated enforcement. | +| D.3: behavior specification | Variables, grouped states, state kinds, named/prioritized and multiple-source transitions, execute conditions, and dispatch/external conditions. State and transition legality checks have dedicated tests. | Partial. Internal conditions (G01), complete external-condition expressions (G02), naming and otherwise-transition rules (V01 and V02), complete-state mode binding (G14), and multiple subprogram final states (G15) were absent and are now implemented; several consistency obligations lack demonstrated enforcement. | | 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. | @@ -144,9 +144,11 @@ The AST precedence error and the strict-model flattening error must be assessed **Standard:** D.3's description explicitly allows several final states when specifying intended behavior; a deterministic implementation representation is distinguished as requiring one final state. -**Evidence:** [AadlBaLegalityRulesChecker.D_3_L1_And_L2_Check](../../ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaLegalityRulesChecker.java), lines 133–145, reports an error whenever a subprogram has more than one final state. No specification-versus-deterministic-implementation distinction gates that branch. `CoveringSemanticTest.test_lr_D3_L1_L2` and the diagnostic regression tests preserve the multiple-final-state rejection. +**Review evidence:** [AadlBaLegalityRulesChecker.D_3_L1_And_L2_Check](../../ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaLegalityRulesChecker.java) reported an error whenever a subprogram had more than one final state. No specification-versus-deterministic-implementation distinction gated that branch. `CoveringSemanticTest.test_lr_D3_L1_L2` and the diagnostic regression tests preserved the multiple-final-state rejection. -**Impact:** A documented standard-conforming specification style is rejected. Add a valid subprogram specification with alternative final states before deciding how any deterministic-profile restriction should be expressed. +**Review impact:** A documented standard-conforming specification style was rejected. + +**Implemented for [#3179](https://github.com/osate/osate2/issues/3179):** standard behavior specifications now allow multiple final states in every component category. Subprograms still require at least one final state; an annex on a component implementation does not itself select a deterministic implementation profile. [Issue3179Test](../../ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3179Test.java) validates an external model covering all 14 categories, both types and implementations, and a subprogram with an initial-final state. It asserts that each annex has two final states and that both classifier kinds cover every category. Existing negative state-rule tests and diagnostic goldens retain the missing-final-state, initial-state, complete-state, and outgoing-final-state checks. ### G16 — Loop-variable target legality is not enforced by its named covering test diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_covering_semantic_lr_D3_L1_L2.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_covering_semantic_lr_D3_L1_L2.txt index e11f70855b..3d97d59e97 100644 --- a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_covering_semantic_lr_D3_L1_L2.txt +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_covering_semantic_lr_D3_L1_L2.txt @@ -2,5 +2,3 @@ error | semantic | 47 | 1 | 96 | exemple_lr_D3_L1_L2::sub.error1 has no final st error | semantic | 48 | 2 | 10 | exemple_lr_D3_L1_L2::sub.error1 can't have more than one initial state : initState1, initState2 : Behavior Annex D.3.(L1) legality rule failed. error | semantic | 49 | 2 | 10 | exemple_lr_D3_L1_L2::sub.error1 can't have more than one initial state : initState1, initState2 : Behavior Annex D.3.(L1) legality rule failed. error | semantic | 50 | 2 | 9 | exemple_lr_D3_L1_L2::sub.error1 can't have complete state : compState : Behavior Annex D.3.(L2) legality rule failed. -error | semantic | 61 | 2 | 11 | exemple_lr_D3_L1_L2::sub.error2 has more than one final state : uniqueState, finalState1 : Behavior Annex D.3.(L1) legality rule failed. -error | semantic | 62 | 2 | 11 | exemple_lr_D3_L1_L2::sub.error2 has more than one final state : uniqueState, finalState1 : Behavior Annex D.3.(L1) legality rule failed. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3155_Issue3155.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3155_Issue3155.txt index 870562280a..23a80e65eb 100644 --- a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3155_Issue3155.txt +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3155_Issue3155.txt @@ -4,8 +4,6 @@ error | semantic | 38 | 5 | 27 | Transitions out of final states are not allowed error | semantic | 48 | 19 | 13 | issue3155::subprogramLegality.impl can't have more than one initial state : firstInitial, secondInitial : Behavior Annex D.3.(L1) legality rule failed. error | semantic | 48 | 5 | 12 | issue3155::subprogramLegality.impl can't have more than one initial state : firstInitial, secondInitial : Behavior Annex D.3.(L1) legality rule failed. error | semantic | 49 | 5 | 9 | issue3155::subprogramLegality.impl can't have complete state : waitState : Behavior Annex D.3.(L2) legality rule failed. -error | semantic | 50 | 17 | 11 | issue3155::subprogramLegality.impl has more than one final state : firstFinal, secondFinal : Behavior Annex D.3.(L1) legality rule failed. -error | semantic | 50 | 5 | 10 | issue3155::subprogramLegality.impl has more than one final state : firstFinal, secondFinal : Behavior Annex D.3.(L1) legality rule failed. error | semantic | 60 | 5 | 12 | issue3155::threadLegality.impl can't have more than one initial state : firstInitial, secondInitial : Behavior Annex D.3.(L3) legality rule failed. error | semantic | 61 | 5 | 13 | issue3155::threadLegality.impl can't have more than one initial state : firstInitial, secondInitial : Behavior Annex D.3.(L3) legality rule failed. error | semantic | 75 | 18 | 11 | Only transition out of complete states may have dispatch condition : Behavior Annex D.3.(L6) legality rule failed. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3179_Issue3179.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3179_Issue3179.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3179_Issue3179.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3179_Issue3179.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_covering_semantic_lr_D3_L1_L2.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_covering_semantic_lr_D3_L1_L2.txt index 0267ffd6ae..4b42cd6d33 100644 --- a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_covering_semantic_lr_D3_L1_L2.txt +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_covering_semantic_lr_D3_L1_L2.txt @@ -3,16 +3,16 @@ annex[0] owner=exemple_lr_D3_L1_L2::sub.good (BehaviorState, uniqueState, 953, 11) (BehaviorStateGroup, , 953, 35) annex[1] owner=exemple_lr_D3_L1_L2::sub.error1 - (BehaviorAnnex, behavior_specification, 1278, 96) - (BehaviorState, compState, 1346, 9) - (BehaviorState, initState1, 1286, 10) - (BehaviorState, initState2, 1316, 10) - (BehaviorStateGroup, , 1286, 28) - (BehaviorStateGroup, , 1316, 28) - (BehaviorStateGroup, , 1346, 28) + (BehaviorAnnex, behavior_specification, 1287, 96) + (BehaviorState, compState, 1355, 9) + (BehaviorState, initState1, 1295, 10) + (BehaviorState, initState2, 1325, 10) + (BehaviorStateGroup, , 1295, 28) + (BehaviorStateGroup, , 1325, 28) + (BehaviorStateGroup, , 1355, 28) annex[2] owner=exemple_lr_D3_L1_L2::sub.error2 - (BehaviorAnnex, behavior_specification, 1573, 72) - (BehaviorState, finalState1, 1618, 11) - (BehaviorState, uniqueState, 1581, 11) - (BehaviorStateGroup, , 1581, 35) - (BehaviorStateGroup, , 1618, 27) + (BehaviorAnnex, behavior_specification, 1608, 72) + (BehaviorState, finalState1, 1653, 11) + (BehaviorState, uniqueState, 1616, 11) + (BehaviorStateGroup, , 1616, 35) + (BehaviorStateGroup, , 1653, 27) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3179_Issue3179.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3179_Issue3179.txt new file mode 100644 index 0000000000..62e89b03d6 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3179_Issue3179.txt @@ -0,0 +1,259 @@ +annex[0] owner=Issue3179::alternative_returns + (BehaviorAnnex, behavior_specification, 1832, 124) + (BehaviorState, failure, 1875, 7) + (BehaviorState, start, 1841, 5) + (BehaviorState, success, 1866, 7) + (BehaviorStateGroup, , 1841, 22) + (BehaviorStateGroup, , 1866, 31) + (BehaviorTransition, , 1913, 20) + (BehaviorTransition, , 1936, 20) +annex[1] owner=Issue3179::alternative_returns.impl + (BehaviorAnnex, behavior_specification, 2073, 124) + (BehaviorState, failure, 2116, 7) + (BehaviorState, start, 2082, 5) + (BehaviorState, success, 2107, 7) + (BehaviorStateGroup, , 2082, 22) + (BehaviorStateGroup, , 2107, 31) + (BehaviorTransition, , 2154, 20) + (BehaviorTransition, , 2177, 20) +annex[2] owner=Issue3179::abstract_behavior + (BehaviorAnnex, behavior_specification, 2295, 133) + (BehaviorState, failure, 2338, 7) + (BehaviorState, start, 2304, 5) + (BehaviorState, success, 2329, 7) + (BehaviorStateGroup, , 2304, 22) + (BehaviorStateGroup, , 2329, 40) + (BehaviorTransition, , 2385, 20) + (BehaviorTransition, , 2408, 20) +annex[3] owner=Issue3179::abstract_behavior.impl + (BehaviorAnnex, behavior_specification, 2539, 133) + (BehaviorState, failure, 2582, 7) + (BehaviorState, start, 2548, 5) + (BehaviorState, success, 2573, 7) + (BehaviorStateGroup, , 2548, 22) + (BehaviorStateGroup, , 2573, 40) + (BehaviorTransition, , 2629, 20) + (BehaviorTransition, , 2652, 20) +annex[4] owner=Issue3179::bus_behavior + (BehaviorAnnex, behavior_specification, 2758, 133) + (BehaviorState, failure, 2801, 7) + (BehaviorState, start, 2767, 5) + (BehaviorState, success, 2792, 7) + (BehaviorStateGroup, , 2767, 22) + (BehaviorStateGroup, , 2792, 40) + (BehaviorTransition, , 2848, 20) + (BehaviorTransition, , 2871, 20) +annex[5] owner=Issue3179::bus_behavior.impl + (BehaviorAnnex, behavior_specification, 2987, 133) + (BehaviorState, failure, 3030, 7) + (BehaviorState, start, 2996, 5) + (BehaviorState, success, 3021, 7) + (BehaviorStateGroup, , 2996, 22) + (BehaviorStateGroup, , 3021, 40) + (BehaviorTransition, , 3077, 20) + (BehaviorTransition, , 3100, 20) +annex[6] owner=Issue3179::data_behavior + (BehaviorAnnex, behavior_specification, 3203, 133) + (BehaviorState, failure, 3246, 7) + (BehaviorState, start, 3212, 5) + (BehaviorState, success, 3237, 7) + (BehaviorStateGroup, , 3212, 22) + (BehaviorStateGroup, , 3237, 40) + (BehaviorTransition, , 3293, 20) + (BehaviorTransition, , 3316, 20) +annex[7] owner=Issue3179::data_behavior.impl + (BehaviorAnnex, behavior_specification, 3435, 133) + (BehaviorState, failure, 3478, 7) + (BehaviorState, start, 3444, 5) + (BehaviorState, success, 3469, 7) + (BehaviorStateGroup, , 3444, 22) + (BehaviorStateGroup, , 3469, 40) + (BehaviorTransition, , 3525, 20) + (BehaviorTransition, , 3548, 20) +annex[8] owner=Issue3179::device_behavior + (BehaviorAnnex, behavior_specification, 3656, 133) + (BehaviorState, failure, 3699, 7) + (BehaviorState, start, 3665, 5) + (BehaviorState, success, 3690, 7) + (BehaviorStateGroup, , 3665, 22) + (BehaviorStateGroup, , 3690, 40) + (BehaviorTransition, , 3746, 20) + (BehaviorTransition, , 3769, 20) +annex[9] owner=Issue3179::device_behavior.impl + (BehaviorAnnex, behavior_specification, 3894, 133) + (BehaviorState, failure, 3937, 7) + (BehaviorState, start, 3903, 5) + (BehaviorState, success, 3928, 7) + (BehaviorStateGroup, , 3903, 22) + (BehaviorStateGroup, , 3928, 40) + (BehaviorTransition, , 3984, 20) + (BehaviorTransition, , 4007, 20) +annex[10] owner=Issue3179::memory_behavior + (BehaviorAnnex, behavior_specification, 4117, 133) + (BehaviorState, failure, 4160, 7) + (BehaviorState, start, 4126, 5) + (BehaviorState, success, 4151, 7) + (BehaviorStateGroup, , 4126, 22) + (BehaviorStateGroup, , 4151, 40) + (BehaviorTransition, , 4207, 20) + (BehaviorTransition, , 4230, 20) +annex[11] owner=Issue3179::memory_behavior.impl + (BehaviorAnnex, behavior_specification, 4355, 133) + (BehaviorState, failure, 4398, 7) + (BehaviorState, start, 4364, 5) + (BehaviorState, success, 4389, 7) + (BehaviorStateGroup, , 4364, 22) + (BehaviorStateGroup, , 4389, 40) + (BehaviorTransition, , 4445, 20) + (BehaviorTransition, , 4468, 20) +annex[12] owner=Issue3179::process_behavior + (BehaviorAnnex, behavior_specification, 4580, 133) + (BehaviorState, failure, 4623, 7) + (BehaviorState, start, 4589, 5) + (BehaviorState, success, 4614, 7) + (BehaviorStateGroup, , 4589, 22) + (BehaviorStateGroup, , 4614, 40) + (BehaviorTransition, , 4670, 20) + (BehaviorTransition, , 4693, 20) +annex[13] owner=Issue3179::process_behavior.impl + (BehaviorAnnex, behavior_specification, 4821, 133) + (BehaviorState, failure, 4864, 7) + (BehaviorState, start, 4830, 5) + (BehaviorState, success, 4855, 7) + (BehaviorStateGroup, , 4830, 22) + (BehaviorStateGroup, , 4855, 40) + (BehaviorTransition, , 4911, 20) + (BehaviorTransition, , 4934, 20) +annex[14] owner=Issue3179::processor_behavior + (BehaviorAnnex, behavior_specification, 5051, 133) + (BehaviorState, failure, 5094, 7) + (BehaviorState, start, 5060, 5) + (BehaviorState, success, 5085, 7) + (BehaviorStateGroup, , 5060, 22) + (BehaviorStateGroup, , 5085, 40) + (BehaviorTransition, , 5141, 20) + (BehaviorTransition, , 5164, 20) +annex[15] owner=Issue3179::processor_behavior.impl + (BehaviorAnnex, behavior_specification, 5298, 133) + (BehaviorState, failure, 5341, 7) + (BehaviorState, start, 5307, 5) + (BehaviorState, success, 5332, 7) + (BehaviorStateGroup, , 5307, 22) + (BehaviorStateGroup, , 5332, 40) + (BehaviorTransition, , 5388, 20) + (BehaviorTransition, , 5411, 20) +annex[16] owner=Issue3179::subprogram_group_behavior + (BehaviorAnnex, behavior_specification, 5544, 133) + (BehaviorState, failure, 5587, 7) + (BehaviorState, start, 5553, 5) + (BehaviorState, success, 5578, 7) + (BehaviorStateGroup, , 5553, 22) + (BehaviorStateGroup, , 5578, 40) + (BehaviorTransition, , 5634, 20) + (BehaviorTransition, , 5657, 20) +annex[17] owner=Issue3179::subprogram_group_behavior.impl + (BehaviorAnnex, behavior_specification, 5812, 133) + (BehaviorState, failure, 5855, 7) + (BehaviorState, start, 5821, 5) + (BehaviorState, success, 5846, 7) + (BehaviorStateGroup, , 5821, 22) + (BehaviorStateGroup, , 5846, 40) + (BehaviorTransition, , 5902, 20) + (BehaviorTransition, , 5925, 20) +annex[18] owner=Issue3179::system_behavior + (BehaviorAnnex, behavior_specification, 6045, 133) + (BehaviorState, failure, 6088, 7) + (BehaviorState, start, 6054, 5) + (BehaviorState, success, 6079, 7) + (BehaviorStateGroup, , 6054, 22) + (BehaviorStateGroup, , 6079, 40) + (BehaviorTransition, , 6135, 20) + (BehaviorTransition, , 6158, 20) +annex[19] owner=Issue3179::system_behavior.impl + (BehaviorAnnex, behavior_specification, 6283, 133) + (BehaviorState, failure, 6326, 7) + (BehaviorState, start, 6292, 5) + (BehaviorState, success, 6317, 7) + (BehaviorStateGroup, , 6292, 22) + (BehaviorStateGroup, , 6317, 40) + (BehaviorTransition, , 6373, 20) + (BehaviorTransition, , 6396, 20) +annex[20] owner=Issue3179::thread_behavior + (BehaviorAnnex, behavior_specification, 6506, 133) + (BehaviorState, failure, 6549, 7) + (BehaviorState, start, 6515, 5) + (BehaviorState, success, 6540, 7) + (BehaviorStateGroup, , 6515, 22) + (BehaviorStateGroup, , 6540, 40) + (BehaviorTransition, , 6596, 20) + (BehaviorTransition, , 6619, 20) +annex[21] owner=Issue3179::thread_behavior.impl + (BehaviorAnnex, behavior_specification, 6744, 133) + (BehaviorState, failure, 6787, 7) + (BehaviorState, start, 6753, 5) + (BehaviorState, success, 6778, 7) + (BehaviorStateGroup, , 6753, 22) + (BehaviorStateGroup, , 6778, 40) + (BehaviorTransition, , 6834, 20) + (BehaviorTransition, , 6857, 20) +annex[22] owner=Issue3179::thread_group_behavior + (BehaviorAnnex, behavior_specification, 6979, 133) + (BehaviorState, failure, 7022, 7) + (BehaviorState, start, 6988, 5) + (BehaviorState, success, 7013, 7) + (BehaviorStateGroup, , 6988, 22) + (BehaviorStateGroup, , 7013, 40) + (BehaviorTransition, , 7069, 20) + (BehaviorTransition, , 7092, 20) +annex[23] owner=Issue3179::thread_group_behavior.impl + (BehaviorAnnex, behavior_specification, 7235, 133) + (BehaviorState, failure, 7278, 7) + (BehaviorState, start, 7244, 5) + (BehaviorState, success, 7269, 7) + (BehaviorStateGroup, , 7244, 22) + (BehaviorStateGroup, , 7269, 40) + (BehaviorTransition, , 7325, 20) + (BehaviorTransition, , 7348, 20) +annex[24] owner=Issue3179::virtual_bus_behavior + (BehaviorAnnex, behavior_specification, 7474, 133) + (BehaviorState, failure, 7517, 7) + (BehaviorState, start, 7483, 5) + (BehaviorState, success, 7508, 7) + (BehaviorStateGroup, , 7483, 22) + (BehaviorStateGroup, , 7508, 40) + (BehaviorTransition, , 7564, 20) + (BehaviorTransition, , 7587, 20) +annex[25] owner=Issue3179::virtual_bus_behavior.impl + (BehaviorAnnex, behavior_specification, 7727, 133) + (BehaviorState, failure, 7770, 7) + (BehaviorState, start, 7736, 5) + (BehaviorState, success, 7761, 7) + (BehaviorStateGroup, , 7736, 22) + (BehaviorStateGroup, , 7761, 40) + (BehaviorTransition, , 7817, 20) + (BehaviorTransition, , 7840, 20) +annex[26] owner=Issue3179::virtual_processor_behavior + (BehaviorAnnex, behavior_specification, 7977, 133) + (BehaviorState, failure, 8020, 7) + (BehaviorState, start, 7986, 5) + (BehaviorState, success, 8011, 7) + (BehaviorStateGroup, , 7986, 22) + (BehaviorStateGroup, , 8011, 40) + (BehaviorTransition, , 8067, 20) + (BehaviorTransition, , 8090, 20) +annex[27] owner=Issue3179::virtual_processor_behavior.impl + (BehaviorAnnex, behavior_specification, 8248, 133) + (BehaviorState, failure, 8291, 7) + (BehaviorState, start, 8257, 5) + (BehaviorState, success, 8282, 7) + (BehaviorStateGroup, , 8257, 22) + (BehaviorStateGroup, , 8282, 40) + (BehaviorTransition, , 8338, 20) + (BehaviorTransition, , 8361, 20) +annex[28] owner=Issue3179::initial_and_final + (BehaviorAnnex, behavior_specification, 8488, 96) + (BehaviorState, finish, 8528, 6) + (BehaviorState, start, 8497, 5) + (BehaviorStateGroup, , 8497, 28) + (BehaviorStateGroup, , 8528, 21) + (BehaviorTransition, , 8565, 19) diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3179_Issue3179.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3179_Issue3179.txt new file mode 100644 index 0000000000..924b1c0e0f --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3179_Issue3179.txt @@ -0,0 +1,201 @@ +annex[0] owner=Issue3179::alternative_returns + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[1] owner=Issue3179::alternative_returns.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[2] owner=Issue3179::abstract_behavior + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[3] owner=Issue3179::abstract_behavior.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[4] owner=Issue3179::bus_behavior + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[5] owner=Issue3179::bus_behavior.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[6] owner=Issue3179::data_behavior + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[7] owner=Issue3179::data_behavior.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[8] owner=Issue3179::device_behavior + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[9] owner=Issue3179::device_behavior.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[10] owner=Issue3179::memory_behavior + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[11] owner=Issue3179::memory_behavior.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[12] owner=Issue3179::process_behavior + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[13] owner=Issue3179::process_behavior.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[14] owner=Issue3179::processor_behavior + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[15] owner=Issue3179::processor_behavior.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[16] owner=Issue3179::subprogram_group_behavior + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[17] owner=Issue3179::subprogram_group_behavior.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[18] owner=Issue3179::system_behavior + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[19] owner=Issue3179::system_behavior.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[20] owner=Issue3179::thread_behavior + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[21] owner=Issue3179::thread_behavior.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[22] owner=Issue3179::thread_group_behavior + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[23] owner=Issue3179::thread_group_behavior.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[24] owner=Issue3179::virtual_bus_behavior + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[25] owner=Issue3179::virtual_bus_behavior.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[26] owner=Issue3179::virtual_processor_behavior + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[27] owner=Issue3179::virtual_processor_behavior.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=success + states[2] : BehaviorState name=failure + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition +annex[28] owner=Issue3179::initial_and_final + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=finish + transitions[0] : BehaviorTransition diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_covering_semantic_lr_D3_L1_L2.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_covering_semantic_lr_D3_L1_L2.txt index c919765e77..c7a6727357 100644 --- a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_covering_semantic_lr_D3_L1_L2.txt +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_covering_semantic_lr_D3_L1_L2.txt @@ -11,7 +11,7 @@ reparsed -- Errors: The behavior annex of a subprogram -- _ can't have more than one initial state. - -- _ must define one final state. + -- _ must define at least one final state. -- _ can't have complete state.\s states initState1 : initial state ; @@ -23,8 +23,8 @@ reparsed ===== annex[2] owner=exemple_lr_D3_L1_L2::sub.error2 ===== - -- Errors: The behavior annex of a subprogram - -- _ can't have more than one final state. + -- Multiple final states are allowed in a standard behavior specification, + -- including when a final state is also initial. states uniqueState : initial final state ; finalState1 : final state ; diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3179_Issue3179.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3179_Issue3179.txt new file mode 100644 index 0000000000..1bffa10a43 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3179_Issue3179.txt @@ -0,0 +1,289 @@ +===== annex[0] owner=Issue3179::alternative_returns ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[1] owner=Issue3179::alternative_returns.impl ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[2] owner=Issue3179::abstract_behavior ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[3] owner=Issue3179::abstract_behavior.impl ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[4] owner=Issue3179::bus_behavior ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[5] owner=Issue3179::bus_behavior.impl ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[6] owner=Issue3179::data_behavior ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[7] owner=Issue3179::data_behavior.impl ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[8] owner=Issue3179::device_behavior ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[9] owner=Issue3179::device_behavior.impl ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[10] owner=Issue3179::memory_behavior ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[11] owner=Issue3179::memory_behavior.impl ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[12] owner=Issue3179::process_behavior ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[13] owner=Issue3179::process_behavior.impl ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[14] owner=Issue3179::processor_behavior ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[15] owner=Issue3179::processor_behavior.impl ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[16] owner=Issue3179::subprogram_group_behavior ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[17] owner=Issue3179::subprogram_group_behavior.impl ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[18] owner=Issue3179::system_behavior ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[19] owner=Issue3179::system_behavior.impl ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[20] owner=Issue3179::thread_behavior ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[21] owner=Issue3179::thread_behavior.impl ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[22] owner=Issue3179::thread_group_behavior ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[23] owner=Issue3179::thread_group_behavior.impl ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[24] owner=Issue3179::virtual_bus_behavior ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[25] owner=Issue3179::virtual_bus_behavior.impl ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[26] owner=Issue3179::virtual_processor_behavior ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[27] owner=Issue3179::virtual_processor_behavior.impl ===== + +\tstates +\t\tstart : initial state; +\t\tsuccess, failure : complete final state; +\ttransitions +\t\tstart -[]-> success; +\t\tstart -[]-> failure; +----- Xtext reparse ----- +reparsed +===== annex[28] owner=Issue3179::initial_and_final ===== + +\tstates +\t\tstart : initial final state; +\t\tfinish : final state; +\ttransitions +\t\tstart -[]-> finish; +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/models/covering_semantic/lr_D3_L1_L2.aadl b/ba/org.osate.ba.tests/models/covering_semantic/lr_D3_L1_L2.aadl index bff69d9e21..42efc504ce 100644 --- a/ba/org.osate.ba.tests/models/covering_semantic/lr_D3_L1_L2.aadl +++ b/ba/org.osate.ba.tests/models/covering_semantic/lr_D3_L1_L2.aadl @@ -42,7 +42,7 @@ annex behavior_specification {** -- Errors: The behavior annex of a subprogram -- _ can't have more than one initial state. - -- _ must define one final state. + -- _ must define at least one final state. -- _ can't have complete state. states initState1 : initial state ; @@ -55,8 +55,8 @@ end sub.error1; subprogram implementation sub.error2 annex behavior_specification {** - -- Errors: The behavior annex of a subprogram - -- _ can't have more than one final state. + -- Multiple final states are allowed in a standard behavior specification, + -- including when a final state is also initial. states uniqueState : initial final state ; finalState1 : final state ; @@ -64,4 +64,4 @@ states **}; end sub.error2 ; -end exemple_lr_D3_L1_L2 ; \ No newline at end of file +end exemple_lr_D3_L1_L2 ; diff --git a/ba/org.osate.ba.tests/models/issue3179/.gitignore b/ba/org.osate.ba.tests/models/issue3179/.gitignore new file mode 100644 index 0000000000..afce51184c --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3179/.gitignore @@ -0,0 +1,2 @@ +/.aadlbin-gen/ +/instances/ diff --git a/ba/org.osate.ba.tests/models/issue3179/.project b/ba/org.osate.ba.tests/models/issue3179/.project new file mode 100644 index 0000000000..3e0357de2f --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3179/.project @@ -0,0 +1,8 @@ + + + issue3179 + + + org.eclipse.xtext.ui.shared.xtextBuilder + org.osate.core.aadlnatureorg.eclipse.xtext.ui.shared.xtextNature + diff --git a/ba/org.osate.ba.tests/models/issue3179/Issue3179.aadl b/ba/org.osate.ba.tests/models/issue3179/Issue3179.aadl new file mode 100644 index 0000000000..7c503f0a6e --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3179/Issue3179.aadl @@ -0,0 +1,344 @@ +-- 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 Issue3179 +public + +subprogram alternative_returns +annex behavior_specification {** + states + start : initial state; + success, failure : final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end alternative_returns; + +subprogram implementation alternative_returns.impl +annex behavior_specification {** + states + start : initial state; + success, failure : final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end alternative_returns.impl; + +abstract abstract_behavior +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end abstract_behavior; + +abstract implementation abstract_behavior.impl +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end abstract_behavior.impl; + +bus bus_behavior +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end bus_behavior; + +bus implementation bus_behavior.impl +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end bus_behavior.impl; + +data data_behavior +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end data_behavior; + +data implementation data_behavior.impl +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end data_behavior.impl; + +device device_behavior +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end device_behavior; + +device implementation device_behavior.impl +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end device_behavior.impl; + +memory memory_behavior +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end memory_behavior; + +memory implementation memory_behavior.impl +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end memory_behavior.impl; + +process process_behavior +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end process_behavior; + +process implementation process_behavior.impl +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end process_behavior.impl; + +processor processor_behavior +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end processor_behavior; + +processor implementation processor_behavior.impl +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end processor_behavior.impl; + +subprogram group subprogram_group_behavior +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end subprogram_group_behavior; + +subprogram group implementation subprogram_group_behavior.impl +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end subprogram_group_behavior.impl; + +system system_behavior +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end system_behavior; + +system implementation system_behavior.impl +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end system_behavior.impl; + +thread thread_behavior +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end thread_behavior; + +thread implementation thread_behavior.impl +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end thread_behavior.impl; + +thread group thread_group_behavior +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end thread_group_behavior; + +thread group implementation thread_group_behavior.impl +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end thread_group_behavior.impl; + +virtual bus virtual_bus_behavior +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end virtual_bus_behavior; + +virtual bus implementation virtual_bus_behavior.impl +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end virtual_bus_behavior.impl; + +virtual processor virtual_processor_behavior +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end virtual_processor_behavior; + +virtual processor implementation virtual_processor_behavior.impl +annex behavior_specification {** + states + start : initial state; + success, failure : complete final state; + transitions + start -[]-> success; + start -[]-> failure; +**}; +end virtual_processor_behavior.impl; + +subprogram initial_and_final +annex behavior_specification {** + states + start : initial final state; + finish : final state; + transitions + start -[]-> finish; +**}; +end initial_and_final; + +end Issue3179; diff --git a/ba/org.osate.ba.tests/src/org/osate/ba/tests/CoveringSemanticTest.java b/ba/org.osate.ba.tests/src/org/osate/ba/tests/CoveringSemanticTest.java index a9771aebb9..281045aca5 100644 --- a/ba/org.osate.ba.tests/src/org/osate/ba/tests/CoveringSemanticTest.java +++ b/ba/org.osate.ba.tests/src/org/osate/ba/tests/CoveringSemanticTest.java @@ -57,8 +57,8 @@ public void test_cr_D3_C4() throws Exception { @Test public void test_lr_D3_L1_L2() throws Exception { // D.3.(L1) and D.3.(L2) mark every state their message names: two initial states, one complete state, the - // missing final state, and two final states. - assertEquals(6, issues("lr_D3_L1_L2.aadl").size()); + // missing final state. Multiple final states are allowed. + assertEquals(4, issues("lr_D3_L1_L2.aadl").size()); } @Test diff --git a/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3155Test.java b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3155Test.java index 30a4a18f9d..3a835cfd26 100644 --- a/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3155Test.java +++ b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3155Test.java @@ -83,11 +83,7 @@ public void subprogramStateRulesMarkTheNamedStates() throws Exception { "secondInitial => issue3155::subprogramLegality.impl can't have more than one initial state :" + " firstInitial, secondInitial : Behavior Annex D.3.(L1) legality rule failed.", "waitState => issue3155::subprogramLegality.impl can't have complete state :" - + " waitState : Behavior Annex D.3.(L2) legality rule failed.", - "firstFinal => issue3155::subprogramLegality.impl has more than one final state :" - + " firstFinal, secondFinal : Behavior Annex D.3.(L1) legality rule failed.", - "secondFinal => issue3155::subprogramLegality.impl has more than one final state :" - + " firstFinal, secondFinal : Behavior Annex D.3.(L1) legality rule failed."), + + " waitState : Behavior Annex D.3.(L2) legality rule failed."), markedText("D.3.(L1)", "D.3.(L2)")); } diff --git a/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3179Test.java b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3179Test.java new file mode 100644 index 0000000000..2cc2dfe280 --- /dev/null +++ b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3179Test.java @@ -0,0 +1,76 @@ +/** + * 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.EnumSet; + +import org.eclipse.xtext.testing.InjectWith; +import org.eclipse.xtext.testing.XtextRunner; +import org.eclipse.xtext.testing.validation.ValidationTestHelper; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.osate.aadl2.AadlPackage; +import org.osate.aadl2.ComponentCategory; +import org.osate.aadl2.ComponentClassifier; +import org.osate.aadl2.ComponentType; +import org.osate.aadl2.DefaultAnnexSubclause; +import org.osate.testsupport.TestHelper; +import org.osate.xtext.aadl2.ba.behaviorAnnex.BehaviorAnnex; +import org.osate.xtext.aadl2.ba.behaviorAnnex.BehaviorStateGroup; + +import com.google.inject.Inject; +import com.itemis.xtext.testing.XtextTest; + +/** Verifies that every component category permits alternative final states in standard behavior specifications. */ +@RunWith(XtextRunner.class) +@InjectWith(BehaviorAnnexInjectorProvider.class) +public class Issue3179Test extends XtextTest { + @Inject + private TestHelper testHelper; + + @Inject + private ValidationTestHelper validationHelper; + + @Test + public void multipleFinalStatesAreAllowedInEveryComponentCategory() throws Exception { + var root = testHelper.parseFile("org.osate.ba.tests/models/issue3179/Issue3179.aadl"); + validationHelper.assertNoIssues(root); + + var typeCategories = EnumSet.noneOf(ComponentCategory.class); + var implementationCategories = EnumSet.noneOf(ComponentCategory.class); + for (var classifier : root.getOwnedPublicSection().getOwnedClassifiers()) { + var component = (ComponentClassifier) classifier; + var categories = component instanceof ComponentType ? typeCategories : implementationCategories; + categories.add(component.getCategory()); + var annex = (DefaultAnnexSubclause) component.getOwnedAnnexSubclauses().getFirst(); + var behavior = (BehaviorAnnex) annex.getParsedAnnexSubclause(); + assertEquals(component.getQualifiedName(), 2, behavior.getStateGroups().stream() + .filter(BehaviorStateGroup::isFinal).mapToInt(group -> group.getStates().size()).sum()); + } + assertEquals(EnumSet.allOf(ComponentCategory.class), typeCategories); + assertEquals(EnumSet.allOf(ComponentCategory.class), implementationCategories); + } +} diff --git a/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaLegalityRulesChecker.java b/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaLegalityRulesChecker.java index a6e49a5888..9a02248abc 100644 --- a/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaLegalityRulesChecker.java +++ b/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaLegalityRulesChecker.java @@ -137,18 +137,12 @@ public boolean D_3_L1_And_L2_Check(EList initialStates, EList 1) { + // AS5506/3 Rev. A D.3 permits several final states in intended-behavior specifications. + // A component implementation does not by itself select a deterministic implementation profile. + if (finalStates.isEmpty()) { result = false; - reportElements = AadlBaUtils.identifierListToString(finalStates, LIST_SEPARATOR); - this.reportLegalityError(finalStates, - _baParentContainer.getQualifiedName() + " has more than one final state : " + reportElements - + " : Behavior Annex D.3.(L1) legality rule failed"); - } else { - if (finalStates.size() == 0) { - result = false; - this.reportLegalityError(_ba, _baParentContainer.getQualifiedName() + " has no final " - + "state : Behavior Annex D.3.(L1) legality rule failed"); - } + this.reportLegalityError(_ba, _baParentContainer.getQualifiedName() + " has no final " + + "state : Behavior Annex D.3.(L1) legality rule failed"); } } // End of first if. diff --git a/ba/org.osate.xtext.aadl2.ba.tests/src/org/osate/xtext/aadl2/ba/tests/BehaviorAnnexIntegrationTest.java b/ba/org.osate.xtext.aadl2.ba.tests/src/org/osate/xtext/aadl2/ba/tests/BehaviorAnnexIntegrationTest.java index ef2f45b5e8..d3090d2ef5 100644 --- a/ba/org.osate.xtext.aadl2.ba.tests/src/org/osate/xtext/aadl2/ba/tests/BehaviorAnnexIntegrationTest.java +++ b/ba/org.osate.xtext.aadl2.ba.tests/src/org/osate/xtext/aadl2/ba/tests/BehaviorAnnexIntegrationTest.java @@ -169,8 +169,8 @@ public void reportsReviewedCheckerCorrectionsWithoutResolvingTheWorkspace() thro Path.of("..", "org.osate.ba.tests", "models", "covering_semantic", "lr_D3_L1_L2.aadl"), StandardCharsets.UTF_8); var result = testHelper.testString(source); - // D.3.(L1) and D.3.(L2) mark every state their message names, so the two-initial-state and - // two-final-state failures each appear once per named state. + // D.3.(L1) and D.3.(L2) mark every state their message names, so the two-initial-state + // failure appears once per named state. Multiple final states are allowed. assertEquals(List.of( "ERROR: exemple_lr_D3_L1_L2::sub.error1 can't have complete state : compState : " + "Behavior Annex D.3.(L2) legality rule failed.", @@ -179,11 +179,7 @@ public void reportsReviewedCheckerCorrectionsWithoutResolvingTheWorkspace() thro "ERROR: exemple_lr_D3_L1_L2::sub.error1 can't have more than one initial state : " + "initState1, initState2 : Behavior Annex D.3.(L1) legality rule failed.", "ERROR: exemple_lr_D3_L1_L2::sub.error1 has no final state : " - + "Behavior Annex D.3.(L1) legality rule failed.", - "ERROR: exemple_lr_D3_L1_L2::sub.error2 has more than one final state : " - + "uniqueState, finalState1 : Behavior Annex D.3.(L1) legality rule failed.", - "ERROR: exemple_lr_D3_L1_L2::sub.error2 has more than one final state : " - + "uniqueState, finalState1 : Behavior Annex D.3.(L1) legality rule failed."), + + "Behavior Annex D.3.(L1) legality rule failed."), result.getIssues() .stream() .filter(issue -> "org.osate.xtext.aadl2.ba.checker".equals(issue.getCode()))