diff --git a/ba/doc/conformance.md b/ba/doc/conformance.md index f5b821ad36..fb3c9ed863 100644 --- a/ba/doc/conformance.md +++ b/ba/doc/conformance.md @@ -60,7 +60,7 @@ The review itself was a source and test-artifact audit. No Maven tests, simulato | 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. | +| 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 (V03) and shared-data resource release (#3189) are now checked, while 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 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. | @@ -199,7 +199,7 @@ These are bounded findings from the inspected grammar/translator/checker path. E | V05 | D.3 component-category/mode restrictions on external/internal conditions; behavior inheritance and replacement. | Conditions can be parsed generically, while type checking dispatches only execute conditions and the rules driver primarily dispatch conditions. Same-named complete states are now bound for no-`in modes` refinements (G14), but the builder does not copy an in-modes context into the strict annex. Core AADL may retain mode applicability on the enclosing annex. Verify the complete consumer path before declaring inheritance or mode-specific selection unsupported. Cover thread/subprogram external-condition rejection and device condition mixing. **Addressed by [#3186](https://github.com/osate/osate2/issues/3186):** the consistency checker rejects an external condition in a thread or a subprogram and rejects a mixture of external and dispatch conditions out of one complete state of a device; the validator rejects an external condition in a subclause with an `in modes` statement, which is where in-modes rules already live because core AADL keeps that statement on the enclosing subclause rather than in the strict annex. D.3 states no per-category restriction on internal conditions beyond the execution-state rule closed with [#3165](https://github.com/osate/osate2/issues/3165). C4 now reads the triggers of an external condition as well, so the mode-transition comparison covers the way a component of any other category than thread and subprogram describes a mode transition; that made `issue2147` report the missing-mode-transition finding its dispatch equivalent already produced. Mode applicability is not duplicated into the strict annex: core AADL keeps it on the `DefaultAnnexSubclause` that every consumer of `BehaviorAnnexUtil.getStrictModel` already holds. `BehaviorAnnexUtil.getBehaviorAnnexSubclauses` implements the ancestor/descendant rule on that access path, with a mode-selecting overload. `Issue3186Test` covers each rejection, a positive control for each, and the inheritance, replacement, type-fallback, and mode-selection cases. The subcomponent override rule is not enforced: it selects which subclause a consumer interprets for an instance rather than constraining a declaration, so it belongs to the consumer that walks the instance hierarchy. | | 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. | +| V08 | D.6: a complete state cannot be reached while shared data remains locked. | **Implemented for [#3189](https://github.com/osate/osate2/issues/3189):** `AadlBaLockChecker` tracks each required data-access path, including inherited, nested, and inverted feature-group accesses, from initial states through transition joins and cycles. It reports each transition/resource pair that can enter a complete state with a held lock. A path established without assumptions about runtime values produces an error; a finding that depends on conservative runtime assumptions is informational, so potential false positives do not invalidate a balanced model. Action summaries handle sequences, unordered sets (including interleaved nested sequences), conditional alternatives, zero-or-more versus one-or-more loop iterations, and wildcard lock/unlock. Statically false branches/transitions, disabled `otherwise` transitions, empty literal ranges, and loops with no possible exit do not introduce spurious complete-state paths. `Issue3189Test` covers balanced controls and unreleased-resource paths through the embedded validator. Runtime-dependent guards and collection/range sizes are approximated conservatively; the checker does not correlate data values across separate conditions or resolve instance-level aliases between accesses. | | 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. | **Addressed by [#3191](https://github.com/osate/osate2/issues/3191):** the validator checks the declared units type of referenced properties, constants, and selected record fields, accepting unitless values and `AADL_Project::Time_Units`. Other units types are reported at the property reference. `Issue3191Test` covers integer and real values, defaults, symbolic element prefixes, record fields, and a custom units type whose literal is named `ms`. Translation retains default values and their written units, and prefixed references retain their owners and property definitions. Effective instance-value selection remains part of #3229. | | 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.tests_models_issue3189_ActionSets.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_ActionSets.txt new file mode 100644 index 0000000000..cbf277cd99 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_ActionSets.txt @@ -0,0 +1,3 @@ +error | semantic | 38 | 13 | 79 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. +error | semantic | 49 | 13 | 122 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. +error | semantic | 60 | 13 | 113 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Balanced.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Balanced.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Branches.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Branches.txt new file mode 100644 index 0000000000..25e088fa26 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Branches.txt @@ -0,0 +1,3 @@ +info | semantic | 39 | 13 | 110 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. +info | semantic | 50 | 13 | 130 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. +info | semantic | 61 | 13 | 158 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_GroupedResources.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_GroupedResources.txt new file mode 100644 index 0000000000..d20c042602 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_GroupedResources.txt @@ -0,0 +1,2 @@ +error | semantic | 55 | 13 | 66 | Complete state 'ready' may be reached while shared data 'left.d' remains locked: Behavior Annex D.6. +error | semantic | 64 | 13 | 84 | Complete state 'ready' may be reached while shared data 'nested.inner.d' remains locked: Behavior Annex D.6. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Issue3189.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Issue3189.txt new file mode 100644 index 0000000000..0d56c12f88 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Issue3189.txt @@ -0,0 +1 @@ +error | semantic | 38 | 13 | 78 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Loops.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Loops.txt new file mode 100644 index 0000000000..8e0e2156fa --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Loops.txt @@ -0,0 +1,6 @@ +error | semantic | 72 | 13 | 97 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. +error | semantic | 83 | 13 | 103 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. +error | semantic | 94 | 13 | 107 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. +info | semantic | 39 | 13 | 99 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. +info | semantic | 50 | 13 | 107 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. +info | semantic | 61 | 13 | 99 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_PotentialFalsePositives.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_PotentialFalsePositives.txt new file mode 100644 index 0000000000..c6cdc277be --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_PotentialFalsePositives.txt @@ -0,0 +1,3 @@ +error | semantic | 55 | 13 | 111 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. +info | semantic | 40 | 13 | 143 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. +info | semantic | 72 | 13 | 48 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Transitions.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Transitions.txt new file mode 100644 index 0000000000..5cc0a82952 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Transitions.txt @@ -0,0 +1,2 @@ +info | semantic | 41 | 13 | 35 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. +info | semantic | 59 | 13 | 39 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Wildcards.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Wildcards.txt new file mode 100644 index 0000000000..321aebe3ce --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3189_Wildcards.txt @@ -0,0 +1,4 @@ +error | semantic | 43 | 13 | 63 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. +error | semantic | 52 | 13 | 77 | Complete state 'ready' may be reached while shared data 'd' remains locked: Behavior Annex D.6. +error | semantic | 52 | 13 | 77 | Complete state 'ready' may be reached while shared data 'e' remains locked: Behavior Annex D.6. +error | semantic | 63 | 13 | 87 | Complete state 'ready' may be reached while shared data 'e' remains locked: Behavior Annex D.6. diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_ActionSets.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_ActionSets.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_Balanced.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_Balanced.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_Branches.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_Branches.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_GroupedResources.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_GroupedResources.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_Issue3189.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_Issue3189.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_Loops.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_Loops.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_PotentialFalsePositives.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_PotentialFalsePositives.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_Transitions.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_Transitions.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_Wildcards.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3189_Wildcards.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_ActionSets.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_ActionSets.txt new file mode 100644 index 0000000000..c165f90c1a --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_ActionSets.txt @@ -0,0 +1,63 @@ +annex[0] owner=ActionSets::subject.order + (BehaviorActionBlock, , 2158, 41) + (BehaviorActionSet, , 2176, 9) + (BehaviorAnnex, behavior_specification, 2032, 168) + (BehaviorCondition, , 2137, 11) + (BehaviorState, ready, 2051, 5) + (BehaviorStateGroup, , 2051, 37) + (BehaviorTransition, order, 2121, 79) + (CommunicationAction, , 2176, 3) + (CommunicationAction, , 2182, 3) + (DispatchCondition, , 2140, 8) + (Reference, , 2176, 1) + (Reference, , 2182, 1) + (ReferenceSegment, d, 2176, 1) + (ReferenceSegment, d, 2182, 1) +annex[1] owner=ActionSets::subject.nestedOrder + (BehaviorActionBlock, , 2457, 78) + (BehaviorActionBlock, , 2475, 17) + (BehaviorActionBlock, , 2495, 26) + (BehaviorActionSequence, , 2477, 13) + (BehaviorActionSequence, , 2497, 22) + (BehaviorActionSet, , 2475, 46) + (BehaviorAnnex, behavior_specification, 2325, 211) + (BehaviorCondition, , 2436, 11) + (BehaviorIntegerLiteral, , 2509, 1) + (BehaviorState, ready, 2344, 5) + (BehaviorStateGroup, , 2344, 37) + (BehaviorTime, , 2509, 4) + (BehaviorTransition, nestedOrder, 2414, 122) + (CommunicationAction, , 2477, 3) + (CommunicationAction, , 2482, 3) + (CommunicationAction, , 2487, 3) + (CommunicationAction, , 2516, 3) + (DispatchCondition, , 2439, 8) + (Reference, , 2477, 1) + (Reference, , 2482, 1) + (Reference, , 2487, 1) + (Reference, , 2516, 1) + (ReferenceSegment, d, 2477, 1) + (ReferenceSegment, d, 2516, 1) + (ReferenceSegment, e, 2482, 1) + (ReferenceSegment, e, 2487, 1) + (TimedAction, , 2497, 17) +annex[2] owner=ActionSets::subject.unrelatedRelease + (BehaviorActionBlock, , 2809, 64) + (BehaviorActionBlock, , 2832, 27) + (BehaviorActionSequence, , 2827, 32) + (BehaviorActionSet, , 2834, 23) + (BehaviorAnnex, behavior_specification, 2672, 202) + (BehaviorCondition, , 2788, 11) + (BehaviorIntegerLiteral, , 2852, 1) + (BehaviorState, ready, 2691, 5) + (BehaviorStateGroup, , 2691, 37) + (BehaviorTime, , 2852, 4) + (BehaviorTransition, unrelatedRelease, 2761, 113) + (CommunicationAction, , 2827, 3) + (CommunicationAction, , 2834, 3) + (DispatchCondition, , 2791, 8) + (Reference, , 2827, 1) + (Reference, , 2834, 1) + (ReferenceSegment, d, 2827, 1) + (ReferenceSegment, e, 2834, 1) + (TimedAction, , 2840, 17) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Balanced.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Balanced.txt new file mode 100644 index 0000000000..8937f25fd5 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Balanced.txt @@ -0,0 +1,347 @@ +annex[0] owner=Balanced::subject.sequence + (BehaviorActionBlock, , 2216, 40) + (BehaviorActionSequence, , 2234, 8) + (BehaviorAnnex, behavior_specification, 2087, 170) + (BehaviorCondition, , 2195, 11) + (BehaviorState, ready, 2106, 5) + (BehaviorStateGroup, , 2106, 37) + (BehaviorTransition, sequence, 2176, 81) + (CommunicationAction, , 2234, 3) + (CommunicationAction, , 2239, 3) + (DispatchCondition, , 2198, 8) + (Reference, , 2234, 1) + (Reference, , 2239, 1) + (ReferenceSegment, d, 2234, 1) + (ReferenceSegment, d, 2239, 1) +annex[1] owner=Balanced::subject.branches + (BehaviorActionBlock, , 2511, 105) + (BehaviorActionBlock, , 2549, 7) + (BehaviorActionBlock, , 2575, 7) + (BehaviorActionBlock, , 2588, 7) + (BehaviorActionSequence, , 2529, 73) + (BehaviorAnnex, behavior_specification, 2382, 235) + (BehaviorCondition, , 2490, 11) + (BehaviorState, ready, 2401, 5) + (BehaviorStateGroup, , 2401, 37) + (BehaviorTransition, branches, 2471, 146) + (CommunicationAction, , 2529, 3) + (CommunicationAction, , 2551, 3) + (CommunicationAction, , 2577, 3) + (CommunicationAction, , 2590, 3) + (DispatchCondition, , 2493, 8) + (ElseIfClause, , 2557, 25) + (IfStatement, , 2534, 68) + (Reference, , 2529, 1) + (Reference, , 2538, 9) + (Reference, , 2551, 1) + (Reference, , 2564, 9) + (Reference, , 2577, 1) + (Reference, , 2590, 1) + (ReferenceExpression, , 2538, 9) + (ReferenceExpression, , 2564, 9) + (ReferenceSegment, condition, 2538, 9) + (ReferenceSegment, condition, 2564, 9) + (ReferenceSegment, d, 2529, 1) + (ReferenceSegment, d, 2551, 1) + (ReferenceSegment, d, 2577, 1) + (ReferenceSegment, d, 2590, 1) +annex[2] owner=Balanced::subject.branchLocal + (BehaviorActionBlock, , 2877, 66) + (BehaviorActionBlock, , 2910, 12) + (BehaviorActionSequence, , 2912, 8) + (BehaviorAnnex, behavior_specification, 2745, 199) + (BehaviorCondition, , 2856, 11) + (BehaviorState, ready, 2764, 5) + (BehaviorStateGroup, , 2764, 37) + (BehaviorTransition, branchLocal, 2834, 110) + (CommunicationAction, , 2912, 3) + (CommunicationAction, , 2917, 3) + (DispatchCondition, , 2859, 8) + (IfStatement, , 2895, 34) + (Reference, , 2899, 9) + (Reference, , 2912, 1) + (Reference, , 2917, 1) + (ReferenceExpression, , 2899, 9) + (ReferenceSegment, condition, 2899, 9) + (ReferenceSegment, d, 2912, 1) + (ReferenceSegment, d, 2917, 1) +annex[3] owner=Balanced::subject.actionSet + (BehaviorActionBlock, , 3203, 59) + (BehaviorActionBlock, , 3226, 22) + (BehaviorActionBlock, , 3228, 12) + (BehaviorActionSequence, , 3221, 27) + (BehaviorActionSequence, , 3230, 8) + (BehaviorActionSet, , 3228, 18) + (BehaviorAnnex, behavior_specification, 3073, 190) + (BehaviorCondition, , 3182, 11) + (BehaviorState, ready, 3092, 5) + (BehaviorStateGroup, , 3092, 37) + (BehaviorTransition, actionSet, 3162, 101) + (CommunicationAction, , 3221, 3) + (CommunicationAction, , 3230, 3) + (CommunicationAction, , 3235, 3) + (CommunicationAction, , 3243, 3) + (DispatchCondition, , 3185, 8) + (Reference, , 3221, 1) + (Reference, , 3230, 1) + (Reference, , 3235, 1) + (Reference, , 3243, 1) + (ReferenceSegment, d, 3221, 1) + (ReferenceSegment, d, 3243, 1) + (ReferenceSegment, e, 3230, 1) + (ReferenceSegment, e, 3235, 1) +annex[4] owner=Balanced::subject.setSequences + (BehaviorActionBlock, , 3526, 59) + (BehaviorActionBlock, , 3544, 12) + (BehaviorActionBlock, , 3559, 12) + (BehaviorActionSequence, , 3546, 8) + (BehaviorActionSequence, , 3561, 8) + (BehaviorActionSet, , 3544, 27) + (BehaviorAnnex, behavior_specification, 3393, 193) + (BehaviorCondition, , 3505, 11) + (BehaviorState, ready, 3412, 5) + (BehaviorStateGroup, , 3412, 37) + (BehaviorTransition, setSequences, 3482, 104) + (CommunicationAction, , 3546, 3) + (CommunicationAction, , 3551, 3) + (CommunicationAction, , 3561, 3) + (CommunicationAction, , 3566, 3) + (DispatchCondition, , 3508, 8) + (Reference, , 3546, 1) + (Reference, , 3551, 1) + (Reference, , 3561, 1) + (Reference, , 3566, 1) + (ReferenceSegment, d, 3546, 1) + (ReferenceSegment, d, 3551, 1) + (ReferenceSegment, d, 3561, 1) + (ReferenceSegment, d, 3566, 1) +annex[5] owner=Balanced::subject.whileBalanced + (BehaviorActionBlock, , 3854, 62) + (BehaviorActionSequence, , 3892, 8) + (BehaviorAnnex, behavior_specification, 3720, 197) + (BehaviorCondition, , 3833, 11) + (BehaviorState, ready, 3739, 5) + (BehaviorStateGroup, , 3739, 37) + (BehaviorTransition, whileBalanced, 3809, 108) + (CommunicationAction, , 3892, 3) + (CommunicationAction, , 3897, 3) + (DispatchCondition, , 3836, 8) + (Reference, , 3879, 9) + (Reference, , 3892, 1) + (Reference, , 3897, 1) + (ReferenceExpression, , 3879, 9) + (ReferenceSegment, condition, 3879, 9) + (ReferenceSegment, d, 3892, 1) + (ReferenceSegment, d, 3897, 1) + (WhileStatement, , 3872, 30) +annex[6] owner=Balanced::subject.whileCleanup + (BehaviorActionBlock, , 4184, 62) + (BehaviorActionSequence, , 4202, 30) + (BehaviorAnnex, behavior_specification, 4051, 196) + (BehaviorCondition, , 4163, 11) + (BehaviorState, ready, 4070, 5) + (BehaviorStateGroup, , 4070, 37) + (BehaviorTransition, whileCleanup, 4140, 107) + (CommunicationAction, , 4222, 3) + (CommunicationAction, , 4229, 3) + (DispatchCondition, , 4166, 8) + (Reference, , 4209, 9) + (Reference, , 4222, 1) + (Reference, , 4229, 1) + (ReferenceExpression, , 4209, 9) + (ReferenceSegment, condition, 4209, 9) + (ReferenceSegment, d, 4222, 1) + (ReferenceSegment, d, 4229, 1) + (WhileStatement, , 4202, 25) +annex[7] owner=Balanced::subject.doRelease + (BehaviorActionBlock, , 4507, 65) + (BehaviorActionBlock, , 4533, 7) + (BehaviorActionSequence, , 4525, 33) + (BehaviorAnnex, behavior_specification, 4377, 196) + (BehaviorCondition, , 4486, 11) + (BehaviorState, ready, 4396, 5) + (BehaviorStateGroup, , 4396, 37) + (BehaviorTransition, doRelease, 4466, 107) + (CommunicationAction, , 4525, 3) + (CommunicationAction, , 4535, 3) + (DispatchCondition, , 4489, 8) + (DoUntilStatement, , 4530, 28) + (Reference, , 4525, 1) + (Reference, , 4535, 1) + (Reference, , 4548, 9) + (ReferenceExpression, , 4548, 9) + (ReferenceSegment, condition, 4548, 9) + (ReferenceSegment, d, 4525, 1) + (ReferenceSegment, d, 4535, 1) +annex[8] owner=Balanced::subject.forRelease + (BehaviorActionBlock, , 4832, 62) + (BehaviorActionSequence, , 4850, 30) + (BehaviorAnnex, behavior_specification, 4701, 194) + (BehaviorCondition, , 4811, 11) + (BehaviorIntegerLiteral, , 4865, 1) + (BehaviorIntegerLiteral, , 4870, 1) + (BehaviorState, ready, 4720, 5) + (BehaviorStateGroup, , 4720, 37) + (BehaviorTransition, forRelease, 4790, 105) + (CommunicationAction, , 4850, 3) + (CommunicationAction, , 4875, 3) + (DispatchCondition, , 4814, 8) + (ElementValues, , 4865, 6) + (ForStatement, , 4855, 25) + (Reference, , 4850, 1) + (Reference, , 4875, 1) + (ReferenceSegment, d, 4850, 1) + (ReferenceSegment, d, 4875, 1) +annex[9] owner=Balanced::subject.forallBalanced + (BehaviorActionBlock, , 5163, 65) + (BehaviorActionSequence, , 5204, 8) + (BehaviorAnnex, behavior_specification, 5028, 201) + (BehaviorCondition, , 5142, 11) + (BehaviorIntegerLiteral, , 5194, 1) + (BehaviorIntegerLiteral, , 5199, 1) + (BehaviorState, ready, 5047, 5) + (BehaviorStateGroup, , 5047, 37) + (BehaviorTransition, forallBalanced, 5117, 112) + (CommunicationAction, , 5204, 3) + (CommunicationAction, , 5209, 3) + (DispatchCondition, , 5145, 8) + (ElementValues, , 5194, 6) + (ForStatement, , 5181, 33) + (Reference, , 5204, 1) + (Reference, , 5209, 1) + (ReferenceSegment, d, 5204, 1) + (ReferenceSegment, d, 5209, 1) +annex[10] owner=Balanced::subject.wildcards + (BehaviorActionBlock, , 5491, 40) + (BehaviorActionSequence, , 5509, 8) + (BehaviorAnnex, behavior_specification, 5361, 171) + (BehaviorCondition, , 5470, 11) + (BehaviorState, ready, 5380, 5) + (BehaviorStateGroup, , 5380, 37) + (BehaviorTransition, wildcards, 5450, 82) + (CommunicationAction, , 5509, 3) + (CommunicationAction, , 5514, 3) + (DispatchCondition, , 5473, 8) +annex[11] owner=Balanced::subject.individualUnlocks + (BehaviorActionBlock, , 5805, 45) + (BehaviorActionSequence, , 5823, 13) + (BehaviorAnnex, behavior_specification, 5667, 184) + (BehaviorCondition, , 5784, 11) + (BehaviorState, ready, 5686, 5) + (BehaviorStateGroup, , 5686, 37) + (BehaviorTransition, individualUnlocks, 5756, 95) + (CommunicationAction, , 5823, 3) + (CommunicationAction, , 5828, 3) + (CommunicationAction, , 5833, 3) + (DispatchCondition, , 5787, 8) + (Reference, , 5828, 1) + (Reference, , 5833, 1) + (ReferenceSegment, d, 5828, 1) + (ReferenceSegment, e, 5833, 1) +annex[12] owner=Balanced::subject.wildcardUnlock + (BehaviorActionBlock, , 6126, 40) + (BehaviorActionSequence, , 6144, 8) + (BehaviorAnnex, behavior_specification, 5991, 176) + (BehaviorCondition, , 6105, 11) + (BehaviorState, ready, 6010, 5) + (BehaviorStateGroup, , 6010, 37) + (BehaviorTransition, wildcardUnlock, 6080, 87) + (CommunicationAction, , 6144, 3) + (CommunicationAction, , 6149, 3) + (DispatchCondition, , 6108, 8) + (Reference, , 6144, 1) + (ReferenceSegment, d, 6144, 1) +annex[13] owner=Balanced::subject.staticConditionsBranch + (BehaviorActionBlock, , 6447, 69) + (BehaviorActionBlock, , 6488, 7) + (BehaviorAnnex, behavior_specification, 6312, 205) + (BehaviorBooleanLiteral, , 6469, 5) + (BehaviorBooleanLiteral, , 6482, 4) + (BehaviorCondition, , 6426, 11) + (BehaviorState, ready, 6331, 5) + (BehaviorStateGroup, , 6331, 37) + (BehaviorTransition, constantBranch, 6401, 116) + (BinaryExpression, , 6469, 17) + (CommunicationAction, , 6490, 3) + (DispatchCondition, , 6429, 8) + (IfStatement, , 6465, 37) + (Reference, , 6490, 1) + (ReferenceSegment, d, 6490, 1) + (UnaryExpression, , 6478, 8) +annex[14] owner=Balanced::subject.staticConditionsElse + (BehaviorActionBlock, , 6801, 74) + (BehaviorActionBlock, , 6829, 12) + (BehaviorActionBlock, , 6847, 7) + (BehaviorActionSequence, , 6831, 8) + (BehaviorAnnex, behavior_specification, 6668, 208) + (BehaviorBooleanLiteral, , 6823, 4) + (BehaviorCondition, , 6780, 11) + (BehaviorState, ready, 6687, 5) + (BehaviorStateGroup, , 6687, 37) + (BehaviorTransition, constantElse, 6757, 119) + (CommunicationAction, , 6831, 3) + (CommunicationAction, , 6836, 3) + (CommunicationAction, , 6849, 3) + (DispatchCondition, , 6783, 8) + (IfStatement, , 6819, 42) + (Reference, , 6831, 1) + (Reference, , 6836, 1) + (Reference, , 6849, 1) + (ReferenceSegment, d, 6831, 1) + (ReferenceSegment, d, 6836, 1) + (ReferenceSegment, d, 6849, 1) +annex[15] owner=Balanced::subject.emptyWhile + (BehaviorActionBlock, , 7146, 53) + (BehaviorAnnex, behavior_specification, 7015, 185) + (BehaviorBooleanLiteral, , 7171, 5) + (BehaviorCondition, , 7125, 11) + (BehaviorState, ready, 7034, 5) + (BehaviorStateGroup, , 7034, 37) + (BehaviorTransition, emptyWhile, 7104, 96) + (CommunicationAction, , 7180, 3) + (DispatchCondition, , 7128, 8) + (Reference, , 7180, 1) + (ReferenceSegment, d, 7180, 1) + (WhileStatement, , 7164, 21) +annex[16] owner=Balanced::subject.emptyFor + (BehaviorActionBlock, , 7456, 57) + (BehaviorAnnex, behavior_specification, 7327, 187) + (BehaviorCondition, , 7435, 11) + (BehaviorIntegerLiteral, , 7484, 1) + (BehaviorIntegerLiteral, , 7489, 1) + (BehaviorState, ready, 7346, 5) + (BehaviorStateGroup, , 7346, 37) + (BehaviorTransition, emptyFor, 7416, 98) + (CommunicationAction, , 7494, 3) + (DispatchCondition, , 7438, 8) + (ElementValues, , 7484, 6) + (ForStatement, , 7474, 25) + (Reference, , 7494, 1) + (ReferenceSegment, d, 7494, 1) +annex[17] owner=Balanced::subject.whileForever + (BehaviorActionBlock, , 7776, 24) + (BehaviorAnnex, behavior_specification, 7643, 158) + (BehaviorBooleanLiteral, , 7785, 4) + (BehaviorCondition, , 7755, 11) + (BehaviorState, ready, 7662, 5) + (BehaviorStateGroup, , 7662, 37) + (BehaviorTransition, whileForever, 7732, 69) + (CommunicationAction, , 7793, 3) + (DispatchCondition, , 7758, 8) + (Reference, , 7793, 1) + (ReferenceSegment, d, 7793, 1) + (WhileStatement, , 7778, 20) +annex[18] owner=Balanced::subject.doForever + (BehaviorActionBlock, , 8061, 28) + (BehaviorActionBlock, , 8066, 7) + (BehaviorAnnex, behavior_specification, 7931, 159) + (BehaviorBooleanLiteral, , 8081, 5) + (BehaviorCondition, , 8040, 11) + (BehaviorState, ready, 7950, 5) + (BehaviorStateGroup, , 7950, 37) + (BehaviorTransition, doForever, 8020, 70) + (CommunicationAction, , 8068, 3) + (DispatchCondition, , 8043, 8) + (DoUntilStatement, , 8063, 24) + (Reference, , 8068, 1) + (ReferenceSegment, d, 8068, 1) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Branches.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Branches.txt new file mode 100644 index 0000000000..e7f07894f9 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Branches.txt @@ -0,0 +1,72 @@ +annex[0] owner=Branches::subject.missingElse + (BehaviorActionBlock, , 2222, 66) + (BehaviorActionBlock, , 2260, 7) + (BehaviorActionSequence, , 2240, 34) + (BehaviorAnnex, behavior_specification, 2090, 199) + (BehaviorCondition, , 2201, 11) + (BehaviorState, ready, 2109, 5) + (BehaviorStateGroup, , 2109, 37) + (BehaviorTransition, missingElse, 2179, 110) + (CommunicationAction, , 2240, 3) + (CommunicationAction, , 2262, 3) + (DispatchCondition, , 2204, 8) + (IfStatement, , 2245, 29) + (Reference, , 2240, 1) + (Reference, , 2249, 9) + (Reference, , 2262, 1) + (ReferenceExpression, , 2249, 9) + (ReferenceSegment, condition, 2249, 9) + (ReferenceSegment, d, 2240, 1) + (ReferenceSegment, d, 2262, 1) +annex[1] owner=Branches::subject.oneBranch + (BehaviorActionBlock, , 2548, 88) + (BehaviorActionBlock, , 2581, 7) + (BehaviorActionBlock, , 2594, 21) + (BehaviorAnnex, behavior_specification, 2418, 219) + (BehaviorCondition, , 2527, 11) + (BehaviorIntegerLiteral, , 2608, 1) + (BehaviorState, ready, 2437, 5) + (BehaviorStateGroup, , 2437, 37) + (BehaviorTime, , 2608, 4) + (BehaviorTransition, oneBranch, 2507, 130) + (CommunicationAction, , 2583, 3) + (DispatchCondition, , 2530, 8) + (IfStatement, , 2566, 56) + (Reference, , 2570, 9) + (Reference, , 2583, 1) + (ReferenceExpression, , 2570, 9) + (ReferenceSegment, condition, 2570, 9) + (ReferenceSegment, d, 2583, 1) + (TimedAction, , 2596, 17) +annex[2] owner=Branches::subject.elseIf + (BehaviorActionBlock, , 2888, 119) + (BehaviorActionBlock, , 2926, 7) + (BehaviorActionBlock, , 2952, 21) + (BehaviorActionBlock, , 2979, 7) + (BehaviorActionSequence, , 2906, 87) + (BehaviorAnnex, behavior_specification, 2761, 247) + (BehaviorCondition, , 2867, 11) + (BehaviorIntegerLiteral, , 2966, 1) + (BehaviorState, ready, 2780, 5) + (BehaviorStateGroup, , 2780, 37) + (BehaviorTime, , 2966, 4) + (BehaviorTransition, elseIf, 2850, 158) + (CommunicationAction, , 2906, 3) + (CommunicationAction, , 2928, 3) + (CommunicationAction, , 2981, 3) + (DispatchCondition, , 2870, 8) + (ElseIfClause, , 2934, 39) + (IfStatement, , 2911, 82) + (Reference, , 2906, 1) + (Reference, , 2915, 9) + (Reference, , 2928, 1) + (Reference, , 2941, 9) + (Reference, , 2981, 1) + (ReferenceExpression, , 2915, 9) + (ReferenceExpression, , 2941, 9) + (ReferenceSegment, condition, 2915, 9) + (ReferenceSegment, condition, 2941, 9) + (ReferenceSegment, d, 2906, 1) + (ReferenceSegment, d, 2928, 1) + (ReferenceSegment, d, 2981, 1) + (TimedAction, , 2954, 17) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_GroupedResources.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_GroupedResources.txt new file mode 100644 index 0000000000..f5602a6a97 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_GroupedResources.txt @@ -0,0 +1,96 @@ +annex[0] owner=GroupedResources::subject.wrongGroup + (BehaviorActionBlock, , 2589, 23) + (BehaviorActionSequence, , 2591, 19) + (BehaviorAnnex, behavior_specification, 2458, 155) + (BehaviorCondition, , 2568, 11) + (BehaviorState, ready, 2477, 5) + (BehaviorStateGroup, , 2477, 37) + (BehaviorTransition, wrongGroup, 2547, 66) + (CommunicationAction, , 2591, 8) + (CommunicationAction, , 2601, 9) + (DispatchCondition, , 2571, 8) + (Reference, , 2591, 6) + (Reference, , 2601, 7) + (ReferenceSegment, d, 2596, 1) + (ReferenceSegment, d, 2607, 1) + (ReferenceSegment, left, 2591, 4) + (ReferenceSegment, right, 2601, 5) + (ReferenceTail, , 2595, 2) + (ReferenceTail, , 2606, 2) +annex[1] owner=GroupedResources::subject.allGroups + (BehaviorActionBlock, , 2871, 42) + (BehaviorActionSequence, , 2873, 38) + (BehaviorAnnex, behavior_specification, 2741, 173) + (BehaviorCondition, , 2850, 11) + (BehaviorState, ready, 2760, 5) + (BehaviorStateGroup, , 2760, 37) + (BehaviorTransition, allGroups, 2830, 84) + (CommunicationAction, , 2873, 3) + (CommunicationAction, , 2878, 8) + (CommunicationAction, , 2888, 9) + (CommunicationAction, , 2899, 12) + (DispatchCondition, , 2853, 8) + (Reference, , 2878, 6) + (Reference, , 2888, 7) + (Reference, , 2899, 10) + (ReferenceSegment, d, 2883, 1) + (ReferenceSegment, d, 2894, 1) + (ReferenceSegment, d, 2908, 1) + (ReferenceSegment, inverted, 2899, 8) + (ReferenceSegment, left, 2878, 4) + (ReferenceSegment, right, 2888, 5) + (ReferenceTail, , 2882, 2) + (ReferenceTail, , 2893, 2) + (ReferenceTail, , 2907, 2) +annex[2] owner=GroupedResources::subject.balanced + (BehaviorActionBlock, , 3169, 152) + (BehaviorActionSequence, , 3187, 120) + (BehaviorAnnex, behavior_specification, 3040, 282) + (BehaviorCondition, , 3148, 11) + (BehaviorState, ready, 3059, 5) + (BehaviorStateGroup, , 3059, 37) + (BehaviorTransition, balanced, 3129, 193) + (CommunicationAction, , 3187, 3) + (CommunicationAction, , 3192, 8) + (CommunicationAction, , 3202, 9) + (CommunicationAction, , 3213, 16) + (CommunicationAction, , 3231, 12) + (CommunicationAction, , 3261, 8) + (CommunicationAction, , 3271, 8) + (CommunicationAction, , 3281, 12) + (CommunicationAction, , 3295, 12) + (DispatchCondition, , 3151, 8) + (Reference, , 3192, 6) + (Reference, , 3202, 7) + (Reference, , 3213, 14) + (Reference, , 3231, 10) + (Reference, , 3261, 6) + (Reference, , 3271, 6) + (Reference, , 3281, 10) + (Reference, , 3295, 10) + (ReferenceSegment, d, 3197, 1) + (ReferenceSegment, d, 3208, 1) + (ReferenceSegment, d, 3226, 1) + (ReferenceSegment, d, 3240, 1) + (ReferenceSegment, d, 3266, 1) + (ReferenceSegment, d, 3276, 1) + (ReferenceSegment, d, 3290, 1) + (ReferenceSegment, d, 3304, 1) + (ReferenceSegment, inner, 3220, 5) + (ReferenceSegment, inverted, 3231, 8) + (ReferenceSegment, inverted, 3281, 8) + (ReferenceSegment, inverted, 3295, 8) + (ReferenceSegment, left, 3192, 4) + (ReferenceSegment, left, 3261, 4) + (ReferenceSegment, left, 3271, 4) + (ReferenceSegment, nested, 3213, 6) + (ReferenceSegment, right, 3202, 5) + (ReferenceTail, , 3196, 2) + (ReferenceTail, , 3207, 2) + (ReferenceTail, , 3219, 6) + (ReferenceTail, , 3225, 2) + (ReferenceTail, , 3239, 2) + (ReferenceTail, , 3265, 2) + (ReferenceTail, , 3275, 2) + (ReferenceTail, , 3289, 2) + (ReferenceTail, , 3303, 2) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Issue3189.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Issue3189.txt new file mode 100644 index 0000000000..d9e2ad84c9 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Issue3189.txt @@ -0,0 +1,11 @@ +annex[0] owner=Issue3189::subject.unreleased + (BehaviorActionBlock, , 2167, 35) + (BehaviorAnnex, behavior_specification, 2036, 167) + (BehaviorCondition, , 2146, 11) + (BehaviorState, ready, 2055, 5) + (BehaviorStateGroup, , 2055, 37) + (BehaviorTransition, unreleased, 2125, 78) + (CommunicationAction, , 2185, 3) + (DispatchCondition, , 2149, 8) + (Reference, , 2185, 1) + (ReferenceSegment, d, 2185, 1) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Loops.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Loops.txt new file mode 100644 index 0000000000..6b2fb84209 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Loops.txt @@ -0,0 +1,99 @@ +annex[0] owner=Loops::subject.whileLock + (BehaviorActionBlock, , 2215, 57) + (BehaviorAnnex, behavior_specification, 2085, 188) + (BehaviorCondition, , 2194, 11) + (BehaviorState, ready, 2104, 5) + (BehaviorStateGroup, , 2104, 37) + (BehaviorTransition, whileLock, 2174, 99) + (CommunicationAction, , 2253, 3) + (DispatchCondition, , 2197, 8) + (Reference, , 2240, 9) + (Reference, , 2253, 1) + (ReferenceExpression, , 2240, 9) + (ReferenceSegment, condition, 2240, 9) + (ReferenceSegment, d, 2253, 1) + (WhileStatement, , 2233, 25) +annex[1] owner=Loops::subject.whileMaySkip + (BehaviorActionBlock, , 2536, 62) + (BehaviorActionSequence, , 2554, 30) + (BehaviorAnnex, behavior_specification, 2403, 196) + (BehaviorCondition, , 2515, 11) + (BehaviorState, ready, 2422, 5) + (BehaviorStateGroup, , 2422, 37) + (BehaviorTransition, whileMaySkip, 2492, 107) + (CommunicationAction, , 2554, 3) + (CommunicationAction, , 2579, 3) + (DispatchCondition, , 2518, 8) + (Reference, , 2554, 1) + (Reference, , 2566, 9) + (Reference, , 2579, 1) + (ReferenceExpression, , 2566, 9) + (ReferenceSegment, condition, 2566, 9) + (ReferenceSegment, d, 2554, 1) + (ReferenceSegment, d, 2579, 1) + (WhileStatement, , 2559, 25) +annex[2] owner=Loops::subject.doLock + (BehaviorActionBlock, , 2853, 60) + (BehaviorActionBlock, , 2874, 7) + (BehaviorAnnex, behavior_specification, 2726, 188) + (BehaviorCondition, , 2832, 11) + (BehaviorState, ready, 2745, 5) + (BehaviorStateGroup, , 2745, 37) + (BehaviorTransition, doLock, 2815, 99) + (CommunicationAction, , 2876, 3) + (DispatchCondition, , 2835, 8) + (DoUntilStatement, , 2871, 28) + (Reference, , 2876, 1) + (Reference, , 2889, 9) + (ReferenceExpression, , 2889, 9) + (ReferenceSegment, condition, 2889, 9) + (ReferenceSegment, d, 2876, 1) +annex[3] owner=Loops::subject.forLock + (BehaviorActionBlock, , 3164, 57) + (BehaviorAnnex, behavior_specification, 3036, 186) + (BehaviorCondition, , 3143, 11) + (BehaviorIntegerLiteral, , 3192, 1) + (BehaviorIntegerLiteral, , 3197, 1) + (BehaviorState, ready, 3055, 5) + (BehaviorStateGroup, , 3055, 37) + (BehaviorTransition, forLock, 3125, 97) + (CommunicationAction, , 3202, 3) + (DispatchCondition, , 3146, 8) + (ElementValues, , 3192, 6) + (ForStatement, , 3182, 25) + (Reference, , 3202, 1) + (ReferenceSegment, d, 3202, 1) +annex[4] owner=Loops::subject.forallLock + (BehaviorActionBlock, , 3479, 60) + (BehaviorAnnex, behavior_specification, 3348, 192) + (BehaviorCondition, , 3458, 11) + (BehaviorIntegerLiteral, , 3510, 1) + (BehaviorIntegerLiteral, , 3515, 1) + (BehaviorState, ready, 3367, 5) + (BehaviorStateGroup, , 3367, 37) + (BehaviorTransition, forallLock, 3437, 103) + (CommunicationAction, , 3520, 3) + (DispatchCondition, , 3461, 8) + (ElementValues, , 3510, 6) + (ForStatement, , 3497, 28) + (Reference, , 3520, 1) + (ReferenceSegment, d, 3520, 1) +annex[5] owner=Loops::subject.emptyRelease + (BehaviorActionBlock, , 3804, 62) + (BehaviorActionSequence, , 3822, 30) + (BehaviorAnnex, behavior_specification, 3671, 196) + (BehaviorCondition, , 3783, 11) + (BehaviorIntegerLiteral, , 3837, 1) + (BehaviorIntegerLiteral, , 3842, 1) + (BehaviorState, ready, 3690, 5) + (BehaviorStateGroup, , 3690, 37) + (BehaviorTransition, emptyRelease, 3760, 107) + (CommunicationAction, , 3822, 3) + (CommunicationAction, , 3847, 3) + (DispatchCondition, , 3786, 8) + (ElementValues, , 3837, 6) + (ForStatement, , 3827, 25) + (Reference, , 3822, 1) + (Reference, , 3847, 1) + (ReferenceSegment, d, 3822, 1) + (ReferenceSegment, d, 3847, 1) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_PotentialFalsePositives.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_PotentialFalsePositives.txt new file mode 100644 index 0000000000..2cdac6692e --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_PotentialFalsePositives.txt @@ -0,0 +1,82 @@ +annex[0] owner=PotentialFalsePositives::subject.correlated + (BehaviorActionBlock, , 2296, 100) + (BehaviorActionSequence, , 2314, 68) + (BehaviorAnnex, behavior_specification, 1996, 401) + (BehaviorBooleanLiteral, , 2053, 4) + (BehaviorCondition, , 2275, 11) + (BehaviorState, ready, 2086, 5) + (BehaviorStateGroup, , 2086, 37) + (BehaviorTransition, correlated, 2254, 143) + (BehaviorVariable, condition, 2018, 9) + (BehaviorVariableGroup, , 2018, 40) + (CommunicationAction, , 2329, 3) + (CommunicationAction, , 2372, 3) + (DispatchCondition, , 2278, 8) + (IfStatement, , 2314, 25) + (IfStatement, , 2357, 25) + (Reference, , 2318, 9) + (Reference, , 2329, 1) + (Reference, , 2361, 9) + (Reference, , 2372, 1) + (ReferenceExpression, , 2318, 9) + (ReferenceExpression, , 2361, 9) + (ReferenceSegment, condition, 2318, 9) + (ReferenceSegment, condition, 2361, 9) + (ReferenceSegment, d, 2329, 1) + (ReferenceSegment, d, 2372, 1) +annex[1] owner=PotentialFalsePositives::subject.bothBranches + (BehaviorActionBlock, , 2835, 66) + (BehaviorAnnex, behavior_specification, 2528, 374) + (BehaviorBooleanLiteral, , 2585, 4) + (BehaviorCondition, , 2814, 11) + (BehaviorState, ready, 2618, 5) + (BehaviorStateGroup, , 2618, 37) + (BehaviorTransition, bothBranches, 2791, 111) + (BehaviorVariable, condition, 2550, 9) + (BehaviorVariableGroup, , 2550, 40) + (CommunicationAction, , 2868, 3) + (CommunicationAction, , 2877, 3) + (DispatchCondition, , 2817, 8) + (IfStatement, , 2853, 34) + (Reference, , 2857, 9) + (Reference, , 2868, 1) + (Reference, , 2877, 1) + (ReferenceExpression, , 2857, 9) + (ReferenceSegment, condition, 2857, 9) + (ReferenceSegment, d, 2868, 1) + (ReferenceSegment, d, 2877, 1) +annex[2] owner=PotentialFalsePositives::subject.contradictory + (BehaviorActionBlock, , 3395, 7) + (BehaviorActionBlock, , 3517, 7) + (BehaviorAnnex, behavior_specification, 3036, 489) + (BehaviorBooleanLiteral, , 3093, 4) + (BehaviorCondition, , 3375, 9) + (BehaviorCondition, , 3441, 13) + (BehaviorCondition, , 3496, 11) + (BehaviorState, middle, 3161, 6) + (BehaviorState, ready, 3189, 5) + (BehaviorState, start, 3126, 5) + (BehaviorStateGroup, , 3126, 22) + (BehaviorStateGroup, , 3161, 15) + (BehaviorStateGroup, , 3189, 29) + (BehaviorTransition, acquire, 3357, 46) + (BehaviorTransition, contradictory, 3416, 48) + (BehaviorTransition, runAgain, 3477, 48) + (BehaviorVariable, condition, 3058, 9) + (BehaviorVariableGroup, , 3058, 40) + (CommunicationAction, , 3397, 3) + (CommunicationAction, , 3519, 3) + (DispatchCondition, , 3499, 8) + (ExecuteCondition, , 3375, 9) + (ExecuteCondition, , 3441, 13) + (Reference, , 3375, 9) + (Reference, , 3397, 1) + (Reference, , 3445, 9) + (Reference, , 3519, 1) + (ReferenceExpression, , 3375, 9) + (ReferenceExpression, , 3445, 9) + (ReferenceSegment, condition, 3375, 9) + (ReferenceSegment, condition, 3445, 9) + (ReferenceSegment, d, 3397, 1) + (ReferenceSegment, d, 3519, 1) + (UnaryExpression, , 3441, 13) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Transitions.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Transitions.txt new file mode 100644 index 0000000000..0b70ec6cf1 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Transitions.txt @@ -0,0 +1,138 @@ +annex[0] owner=Transitions::subject.impl + (BehaviorActionBlock, , 2377, 7) + (BehaviorActionBlock, , 2480, 7) + (BehaviorActionBlock, , 2583, 7) + (BehaviorActionBlock, , 2640, 7) + (BehaviorActionBlock, , 2703, 7) + (BehaviorAnnex, behavior_specification, 2032, 679) + (BehaviorBooleanLiteral, , 2625, 5) + (BehaviorCondition, , 2308, 9) + (BehaviorCondition, , 2358, 9) + (BehaviorCondition, , 2462, 9) + (BehaviorCondition, , 2517, 9) + (BehaviorCondition, , 2625, 5) + (BehaviorCondition, , 2682, 11) + (BehaviorState, join, 2099, 4) + (BehaviorState, left, 2086, 4) + (BehaviorState, ready, 2138, 5) + (BehaviorState, right, 2092, 5) + (BehaviorState, start, 2051, 5) + (BehaviorState, unreachable, 2105, 11) + (BehaviorStateGroup, , 2051, 22) + (BehaviorStateGroup, , 2086, 39) + (BehaviorStateGroup, , 2138, 29) + (BehaviorTransition, acquired, 2443, 45) + (BehaviorTransition, clean, 2501, 35) + (BehaviorTransition, ignored, 2549, 42) + (BehaviorTransition, impossible, 2604, 44) + (BehaviorTransition, joined, 2398, 32) + (BehaviorTransition, leaked, 2292, 35) + (BehaviorTransition, redispatch, 2661, 50) + (BehaviorTransition, released, 2340, 45) + (CommunicationAction, , 2379, 3) + (CommunicationAction, , 2482, 3) + (CommunicationAction, , 2585, 3) + (CommunicationAction, , 2642, 3) + (CommunicationAction, , 2705, 3) + (DispatchCondition, , 2685, 8) + (ExecuteCondition, , 2308, 9) + (ExecuteCondition, , 2358, 9) + (ExecuteCondition, , 2462, 9) + (ExecuteCondition, , 2517, 9) + (ExecuteCondition, , 2625, 5) + (Reference, , 2308, 9) + (Reference, , 2379, 1) + (Reference, , 2462, 9) + (Reference, , 2482, 1) + (Reference, , 2585, 1) + (Reference, , 2642, 1) + (Reference, , 2705, 1) + (ReferenceExpression, , 2308, 9) + (ReferenceExpression, , 2462, 9) + (ReferenceSegment, condition, 2308, 9) + (ReferenceSegment, condition, 2462, 9) + (ReferenceSegment, d, 2379, 1) + (ReferenceSegment, d, 2482, 1) + (ReferenceSegment, d, 2585, 1) + (ReferenceSegment, d, 2642, 1) + (ReferenceSegment, d, 2705, 1) +annex[1] owner=Transitions::subject.cycle + (BehaviorActionBlock, , 3148, 7) + (BehaviorActionBlock, , 3214, 7) + (BehaviorAnnex, behavior_specification, 2829, 393) + (BehaviorCondition, , 3000, 9) + (BehaviorCondition, , 3089, 9) + (BehaviorCondition, , 3193, 11) + (BehaviorState, first, 2883, 5) + (BehaviorState, ready, 2918, 5) + (BehaviorState, second, 2890, 6) + (BehaviorState, start, 2848, 5) + (BehaviorStateGroup, , 2848, 22) + (BehaviorStateGroup, , 2883, 22) + (BehaviorStateGroup, , 2918, 29) + (BehaviorTransition, back, 3122, 34) + (BehaviorTransition, dispatchAgain, 3169, 53) + (BehaviorTransition, entry, 3032, 26) + (BehaviorTransition, exitCycle, 2980, 39) + (BehaviorTransition, forward, 3071, 38) + (CommunicationAction, , 3150, 3) + (CommunicationAction, , 3216, 3) + (DispatchCondition, , 3196, 8) + (ExecuteCondition, , 3000, 9) + (ExecuteCondition, , 3089, 9) + (Reference, , 3000, 9) + (Reference, , 3150, 1) + (Reference, , 3216, 1) + (ReferenceExpression, , 3000, 9) + (ReferenceSegment, condition, 3000, 9) + (ReferenceSegment, d, 3150, 1) + (ReferenceSegment, d, 3216, 1) +annex[2] owner=Transitions::subject.balanced + (BehaviorActionBlock, , 3519, 7) + (BehaviorActionBlock, , 3570, 7) + (BehaviorAnnex, behavior_specification, 3344, 287) + (BehaviorCondition, , 3610, 11) + (BehaviorState, ready, 3427, 5) + (BehaviorState, running, 3398, 7) + (BehaviorState, start, 3363, 5) + (BehaviorStateGroup, , 3363, 22) + (BehaviorStateGroup, , 3398, 16) + (BehaviorStateGroup, , 3427, 29) + (BehaviorTransition, acquire, 3489, 38) + (BehaviorTransition, release, 3540, 38) + (BehaviorTransition, runAgain, 3591, 40) + (CommunicationAction, , 3521, 3) + (CommunicationAction, , 3572, 3) + (DispatchCondition, , 3613, 8) + (Reference, , 3521, 1) + (Reference, , 3572, 1) + (ReferenceSegment, d, 3521, 1) + (ReferenceSegment, d, 3572, 1) +annex[3] owner=Transitions::subject.staticConditions + (BehaviorActionBlock, , 3911, 12) + (BehaviorActionBlock, , 3972, 7) + (BehaviorActionSequence, , 3913, 8) + (BehaviorAnnex, behavior_specification, 3764, 269) + (BehaviorBooleanLiteral, , 3897, 4) + (BehaviorCondition, , 3897, 4) + (BehaviorCondition, , 3953, 9) + (BehaviorCondition, , 4012, 11) + (BehaviorState, ready, 3818, 5) + (BehaviorState, start, 3783, 5) + (BehaviorStateGroup, , 3783, 22) + (BehaviorStateGroup, , 3818, 29) + (BehaviorTransition, always, 3880, 44) + (BehaviorTransition, never, 3937, 43) + (BehaviorTransition, runAgain, 3993, 40) + (CommunicationAction, , 3913, 3) + (CommunicationAction, , 3918, 3) + (CommunicationAction, , 3974, 3) + (DispatchCondition, , 4015, 8) + (ExecuteCondition, , 3897, 4) + (ExecuteCondition, , 3953, 9) + (Reference, , 3913, 1) + (Reference, , 3918, 1) + (Reference, , 3974, 1) + (ReferenceSegment, d, 3913, 1) + (ReferenceSegment, d, 3918, 1) + (ReferenceSegment, d, 3974, 1) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Wildcards.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Wildcards.txt new file mode 100644 index 0000000000..64b3c9ae44 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3189_Wildcards.txt @@ -0,0 +1,38 @@ +annex[0] owner=Wildcards::inherited.impl + (BehaviorActionBlock, , 2290, 17) + (BehaviorActionSequence, , 2292, 13) + (BehaviorAnnex, behavior_specification, 2156, 152) + (BehaviorCondition, , 2269, 11) + (BehaviorState, ready, 2175, 5) + (BehaviorStateGroup, , 2175, 37) + (BehaviorTransition, inheritedLock, 2245, 63) + (CommunicationAction, , 2292, 3) + (CommunicationAction, , 2297, 3) + (CommunicationAction, , 2302, 3) + (DispatchCondition, , 2272, 8) + (Reference, , 2297, 1) + (Reference, , 2302, 1) + (ReferenceSegment, e, 2302, 1) + (ReferenceSegment, f, 2297, 1) +annex[1] owner=Wildcards::subject.allLocked + (BehaviorActionBlock, , 2562, 35) + (BehaviorAnnex, behavior_specification, 2432, 166) + (BehaviorCondition, , 2541, 11) + (BehaviorState, ready, 2451, 5) + (BehaviorStateGroup, , 2451, 37) + (BehaviorTransition, allLocked, 2521, 77) + (CommunicationAction, , 2580, 3) + (DispatchCondition, , 2544, 8) +annex[2] owner=Wildcards::subject.partialRelease + (BehaviorActionBlock, , 2865, 40) + (BehaviorActionSequence, , 2883, 8) + (BehaviorAnnex, behavior_specification, 2730, 176) + (BehaviorCondition, , 2844, 11) + (BehaviorState, ready, 2749, 5) + (BehaviorStateGroup, , 2749, 37) + (BehaviorTransition, partialRelease, 2819, 87) + (CommunicationAction, , 2883, 3) + (CommunicationAction, , 2888, 3) + (DispatchCondition, , 2847, 8) + (Reference, , 2888, 1) + (ReferenceSegment, d, 2888, 1) diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_ActionSets.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_ActionSets.txt new file mode 100644 index 0000000000..656f550408 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_ActionSets.txt @@ -0,0 +1,49 @@ +annex[0] owner=ActionSets::subject.order + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=order + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSet + actions[0] : LockAction + dataAccess : DataAccessHolder element=ActionSets::subject.d [DataAccess] + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=ActionSets::subject.d [DataAccess] +annex[1] owner=ActionSets::subject.nestedOrder + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=nestedOrder + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSet + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=ActionSets::subject.d [DataAccess] + actions[1] : LockAction + dataAccess : DataAccessHolder element=ActionSets::subject.e [DataAccess] + actions[2] : UnlockAction + dataAccess : DataAccessHolder element=ActionSets::subject.e [DataAccess] + actions[1] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : TimedAction + lowerTime : BehaviorTime + integerValue : BehaviorIntegerLiteral + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=ActionSets::subject.d [DataAccess] +annex[2] owner=ActionSets::subject.unrelatedRelease + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=unrelatedRelease + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=ActionSets::subject.d [DataAccess] + actions[1] : BehaviorActionBlock + content : BehaviorActionSet + actions[0] : UnlockAction + dataAccess : DataAccessHolder element=ActionSets::subject.e [DataAccess] + actions[1] : TimedAction + lowerTime : BehaviorTime + integerValue : BehaviorIntegerLiteral diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Balanced.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Balanced.txt new file mode 100644 index 0000000000..909061c868 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Balanced.txt @@ -0,0 +1,322 @@ +annex[0] owner=Balanced::subject.sequence + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=sequence + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] +annex[1] owner=Balanced::subject.branches + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=branches + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + actions[1] : IfStatement + behaviorActions : BehaviorActionBlock + content : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : DataPortHolder element=Balanced::subject.condition [DataPort] + elseStatement : IfStatement + behaviorActions : BehaviorActionBlock + content : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : DataPortHolder element=Balanced::subject.condition [DataPort] + elseStatement : ElseStatement + behaviorActions : BehaviorActionBlock + content : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] +annex[2] owner=Balanced::subject.branchLocal + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=branchLocal + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : IfStatement + behaviorActions : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : DataPortHolder element=Balanced::subject.condition [DataPort] +annex[3] owner=Balanced::subject.actionSet + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=actionSet + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + actions[1] : BehaviorActionBlock + content : BehaviorActionSet + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.e [DataAccess] + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.e [DataAccess] + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] +annex[4] owner=Balanced::subject.setSequences + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=setSequences + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSet + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + actions[1] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] +annex[5] owner=Balanced::subject.whileBalanced + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=whileBalanced + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : WhileOrDoUntilStatement + behaviorActions : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : DataPortHolder element=Balanced::subject.condition [DataPort] +annex[6] owner=Balanced::subject.whileCleanup + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=whileCleanup + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : WhileOrDoUntilStatement + behaviorActions : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : DataPortHolder element=Balanced::subject.condition [DataPort] + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] +annex[7] owner=Balanced::subject.doRelease + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=doRelease + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + actions[1] : WhileOrDoUntilStatement + behaviorActions : BehaviorActionBlock + content : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : DataPortHolder element=Balanced::subject.condition [DataPort] +annex[8] owner=Balanced::subject.forRelease + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=forRelease + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + actions[1] : ForOrForAllStatement + behaviorActions : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + iteratedValues : IntegerRange + lowerIntegerValue : BehaviorIntegerLiteral + upperIntegerValue : BehaviorIntegerLiteral + iterativeVariable : IterativeVariable name=i +annex[9] owner=Balanced::subject.forallBalanced + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=forallBalanced + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : ForOrForAllStatement + behaviorActions : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + iteratedValues : IntegerRange + lowerIntegerValue : BehaviorIntegerLiteral + upperIntegerValue : BehaviorIntegerLiteral + iterativeVariable : IterativeVariable name=i +annex[10] owner=Balanced::subject.wildcards + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=wildcards + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + actions[1] : UnlockAction +annex[11] owner=Balanced::subject.individualUnlocks + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=individualUnlocks + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + actions[2] : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.e [DataAccess] +annex[12] owner=Balanced::subject.wildcardUnlock + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=wildcardUnlock + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + actions[1] : UnlockAction +annex[13] owner=Balanced::subject.staticConditionsBranch + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=constantBranch + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : IfStatement + behaviorActions : BehaviorActionBlock + content : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral + relations[1] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral +annex[14] owner=Balanced::subject.staticConditionsElse + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=constantElse + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : IfStatement + behaviorActions : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral + elseStatement : ElseStatement + behaviorActions : BehaviorActionBlock + content : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] +annex[15] owner=Balanced::subject.emptyWhile + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=emptyWhile + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : WhileOrDoUntilStatement + behaviorActions : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral +annex[16] owner=Balanced::subject.emptyFor + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=emptyFor + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : ForOrForAllStatement + behaviorActions : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + iteratedValues : IntegerRange + lowerIntegerValue : BehaviorIntegerLiteral + upperIntegerValue : BehaviorIntegerLiteral + iterativeVariable : IterativeVariable name=i +annex[17] owner=Balanced::subject.whileForever + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=whileForever + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : WhileOrDoUntilStatement + behaviorActions : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral +annex[18] owner=Balanced::subject.doForever + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=doForever + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : WhileOrDoUntilStatement + behaviorActions : BehaviorActionBlock + content : LockAction + dataAccess : DataAccessHolder element=Balanced::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Branches.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Branches.txt new file mode 100644 index 0000000000..915b1a3213 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Branches.txt @@ -0,0 +1,74 @@ +annex[0] owner=Branches::subject.missingElse + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=missingElse + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Branches::subject.d [DataAccess] + actions[1] : IfStatement + behaviorActions : BehaviorActionBlock + content : UnlockAction + dataAccess : DataAccessHolder element=Branches::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : DataPortHolder element=Branches::subject.condition [DataPort] +annex[1] owner=Branches::subject.oneBranch + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=oneBranch + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : IfStatement + behaviorActions : BehaviorActionBlock + content : LockAction + dataAccess : DataAccessHolder element=Branches::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : DataPortHolder element=Branches::subject.condition [DataPort] + elseStatement : ElseStatement + behaviorActions : BehaviorActionBlock + content : TimedAction + lowerTime : BehaviorTime + integerValue : BehaviorIntegerLiteral +annex[2] owner=Branches::subject.elseIf + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=elseIf + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Branches::subject.d [DataAccess] + actions[1] : IfStatement + behaviorActions : BehaviorActionBlock + content : UnlockAction + dataAccess : DataAccessHolder element=Branches::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : DataPortHolder element=Branches::subject.condition [DataPort] + elseStatement : IfStatement + behaviorActions : BehaviorActionBlock + content : TimedAction + lowerTime : BehaviorTime + integerValue : BehaviorIntegerLiteral + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : DataPortHolder element=Branches::subject.condition [DataPort] + elseStatement : ElseStatement + behaviorActions : BehaviorActionBlock + content : UnlockAction + dataAccess : DataAccessHolder element=Branches::subject.d [DataAccess] diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_GroupedResources.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_GroupedResources.txt new file mode 100644 index 0000000000..6514d43cb2 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_GroupedResources.txt @@ -0,0 +1,63 @@ +annex[0] owner=GroupedResources::subject.wrongGroup + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=wrongGroup + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=GroupedResources::AccessGroup.d [DataAccess] + groupHolders[0] : GroupHolder element=GroupedResources::subject.left [FeatureGroup] + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=GroupedResources::AccessGroup.d [DataAccess] + groupHolders[0] : GroupHolder element=GroupedResources::subject.right [FeatureGroup] +annex[1] owner=GroupedResources::subject.allGroups + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=allGroups + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=GroupedResources::AccessGroup.d [DataAccess] + groupHolders[0] : GroupHolder element=GroupedResources::subject.left [FeatureGroup] + actions[2] : UnlockAction + dataAccess : DataAccessHolder element=GroupedResources::AccessGroup.d [DataAccess] + groupHolders[0] : GroupHolder element=GroupedResources::subject.right [FeatureGroup] + actions[3] : UnlockAction + dataAccess : DataAccessHolder element=GroupedResources::OfferedGroup.d [DataAccess] + groupHolders[0] : GroupHolder element=GroupedResources::subject.inverted [FeatureGroup] +annex[2] owner=GroupedResources::subject.balanced + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=balanced + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=GroupedResources::AccessGroup.d [DataAccess] + groupHolders[0] : GroupHolder element=GroupedResources::subject.left [FeatureGroup] + actions[2] : UnlockAction + dataAccess : DataAccessHolder element=GroupedResources::AccessGroup.d [DataAccess] + groupHolders[0] : GroupHolder element=GroupedResources::subject.right [FeatureGroup] + actions[3] : UnlockAction + dataAccess : DataAccessHolder element=GroupedResources::AccessGroup.d [DataAccess] + groupHolders[0] : GroupHolder element=GroupedResources::subject.nested [FeatureGroup] + groupHolders[1] : GroupHolder element=GroupedResources::Wrapper.inner [FeatureGroup] + actions[4] : UnlockAction + dataAccess : DataAccessHolder element=GroupedResources::OfferedGroup.d [DataAccess] + groupHolders[0] : GroupHolder element=GroupedResources::subject.inverted [FeatureGroup] + actions[5] : LockAction + dataAccess : DataAccessHolder element=GroupedResources::AccessGroup.d [DataAccess] + groupHolders[0] : GroupHolder element=GroupedResources::subject.left [FeatureGroup] + actions[6] : UnlockAction + dataAccess : DataAccessHolder element=GroupedResources::AccessGroup.d [DataAccess] + groupHolders[0] : GroupHolder element=GroupedResources::subject.left [FeatureGroup] + actions[7] : LockAction + dataAccess : DataAccessHolder element=GroupedResources::OfferedGroup.d [DataAccess] + groupHolders[0] : GroupHolder element=GroupedResources::subject.inverted [FeatureGroup] + actions[8] : UnlockAction + dataAccess : DataAccessHolder element=GroupedResources::OfferedGroup.d [DataAccess] + groupHolders[0] : GroupHolder element=GroupedResources::subject.inverted [FeatureGroup] diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Issue3189.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Issue3189.txt new file mode 100644 index 0000000000..135dc1b9cf --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Issue3189.txt @@ -0,0 +1,8 @@ +annex[0] owner=Issue3189::subject.unreleased + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=unreleased + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : LockAction + dataAccess : DataAccessHolder element=Issue3189::subject.d [DataAccess] diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Loops.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Loops.txt new file mode 100644 index 0000000000..74a713b021 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Loops.txt @@ -0,0 +1,91 @@ +annex[0] owner=Loops::subject.whileLock + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=whileLock + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : WhileOrDoUntilStatement + behaviorActions : LockAction + dataAccess : DataAccessHolder element=Loops::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : DataPortHolder element=Loops::subject.condition [DataPort] +annex[1] owner=Loops::subject.whileMaySkip + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=whileMaySkip + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Loops::subject.d [DataAccess] + actions[1] : WhileOrDoUntilStatement + behaviorActions : UnlockAction + dataAccess : DataAccessHolder element=Loops::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : DataPortHolder element=Loops::subject.condition [DataPort] +annex[2] owner=Loops::subject.doLock + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=doLock + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : WhileOrDoUntilStatement + behaviorActions : BehaviorActionBlock + content : LockAction + dataAccess : DataAccessHolder element=Loops::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : DataPortHolder element=Loops::subject.condition [DataPort] +annex[3] owner=Loops::subject.forLock + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=forLock + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : ForOrForAllStatement + behaviorActions : LockAction + dataAccess : DataAccessHolder element=Loops::subject.d [DataAccess] + iteratedValues : IntegerRange + lowerIntegerValue : BehaviorIntegerLiteral + upperIntegerValue : BehaviorIntegerLiteral + iterativeVariable : IterativeVariable name=i +annex[4] owner=Loops::subject.forallLock + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=forallLock + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : ForOrForAllStatement + behaviorActions : LockAction + dataAccess : DataAccessHolder element=Loops::subject.d [DataAccess] + iteratedValues : IntegerRange + lowerIntegerValue : BehaviorIntegerLiteral + upperIntegerValue : BehaviorIntegerLiteral + iterativeVariable : IterativeVariable name=i +annex[5] owner=Loops::subject.emptyRelease + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=emptyRelease + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Loops::subject.d [DataAccess] + actions[1] : ForOrForAllStatement + behaviorActions : UnlockAction + dataAccess : DataAccessHolder element=Loops::subject.d [DataAccess] + iteratedValues : IntegerRange + lowerIntegerValue : BehaviorIntegerLiteral + upperIntegerValue : BehaviorIntegerLiteral + iterativeVariable : IterativeVariable name=i diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_PotentialFalsePositives.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_PotentialFalsePositives.txt new file mode 100644 index 0000000000..d4277aa1c2 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_PotentialFalsePositives.txt @@ -0,0 +1,76 @@ +annex[0] owner=PotentialFalsePositives::subject.correlated + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=condition + ownedValueConstant : BehaviorBooleanLiteral + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=correlated + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : IfStatement + behaviorActions : LockAction + dataAccess : DataAccessHolder element=PotentialFalsePositives::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=condition [BehaviorVariable] + actions[1] : IfStatement + behaviorActions : UnlockAction + dataAccess : DataAccessHolder element=PotentialFalsePositives::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=condition [BehaviorVariable] +annex[1] owner=PotentialFalsePositives::subject.bothBranches + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=condition + ownedValueConstant : BehaviorBooleanLiteral + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=bothBranches + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : IfStatement + behaviorActions : LockAction + dataAccess : DataAccessHolder element=PotentialFalsePositives::subject.d [DataAccess] + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=condition [BehaviorVariable] + elseStatement : ElseStatement + behaviorActions : LockAction + dataAccess : DataAccessHolder element=PotentialFalsePositives::subject.d [DataAccess] +annex[2] owner=PotentialFalsePositives::subject.contradictory + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=condition + ownedValueConstant : BehaviorBooleanLiteral + states[0] : BehaviorState name=start + states[1] : BehaviorState name=middle + states[2] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=acquire + condition : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=condition [BehaviorVariable] + transitions[1] : BehaviorTransition name=contradictory + condition : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=condition [BehaviorVariable] + transitions[2] : BehaviorTransition name=runAgain + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : LockAction + dataAccess : DataAccessHolder element=PotentialFalsePositives::subject.d [DataAccess] + actions[1] : BehaviorActionBlock + content : UnlockAction + dataAccess : DataAccessHolder element=PotentialFalsePositives::subject.d [DataAccess] diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Transitions.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Transitions.txt new file mode 100644 index 0000000000..f385bed003 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Transitions.txt @@ -0,0 +1,117 @@ +annex[0] owner=Transitions::subject.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=left + states[2] : BehaviorState name=right + states[3] : BehaviorState name=join + states[4] : BehaviorState name=unreachable + states[5] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=leaked + condition : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : DataPortHolder element=Transitions::subject.condition [DataPort] + transitions[1] : BehaviorTransition name=released + condition : Otherwise + transitions[2] : BehaviorTransition name=joined + transitions[3] : BehaviorTransition name=joined + transitions[4] : BehaviorTransition name=acquired + condition : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : DataPortHolder element=Transitions::subject.condition [DataPort] + transitions[5] : BehaviorTransition name=clean + condition : Otherwise + transitions[6] : BehaviorTransition name=ignored + transitions[7] : BehaviorTransition name=impossible + condition : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral + transitions[8] : BehaviorTransition name=redispatch + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : UnlockAction + dataAccess : DataAccessHolder element=Transitions::subject.d [DataAccess] + actions[1] : BehaviorActionBlock + content : LockAction + dataAccess : DataAccessHolder element=Transitions::subject.d [DataAccess] + actions[2] : BehaviorActionBlock + content : LockAction + dataAccess : DataAccessHolder element=Transitions::subject.d [DataAccess] + actions[3] : BehaviorActionBlock + content : LockAction + dataAccess : DataAccessHolder element=Transitions::subject.d [DataAccess] + actions[4] : BehaviorActionBlock + content : UnlockAction + dataAccess : DataAccessHolder element=Transitions::subject.d [DataAccess] +annex[1] owner=Transitions::subject.cycle + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=first + states[2] : BehaviorState name=second + states[3] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=exitCycle + condition : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : DataPortHolder element=Transitions::subject.condition [DataPort] + transitions[1] : BehaviorTransition name=entry + transitions[2] : BehaviorTransition name=forward + condition : Otherwise + transitions[3] : BehaviorTransition name=back + transitions[4] : BehaviorTransition name=dispatchAgain + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : LockAction + dataAccess : DataAccessHolder element=Transitions::subject.d [DataAccess] + actions[1] : BehaviorActionBlock + content : UnlockAction + dataAccess : DataAccessHolder element=Transitions::subject.d [DataAccess] +annex[2] owner=Transitions::subject.balanced + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=running + states[2] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=acquire + transitions[1] : BehaviorTransition name=release + transitions[2] : BehaviorTransition name=runAgain + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : LockAction + dataAccess : DataAccessHolder element=Transitions::subject.d [DataAccess] + actions[1] : BehaviorActionBlock + content : UnlockAction + dataAccess : DataAccessHolder element=Transitions::subject.d [DataAccess] +annex[3] owner=Transitions::subject.staticConditions + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=start + states[1] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=always + condition : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral + transitions[1] : BehaviorTransition name=never + condition : Otherwise + transitions[2] : BehaviorTransition name=runAgain + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Transitions::subject.d [DataAccess] + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=Transitions::subject.d [DataAccess] + actions[1] : BehaviorActionBlock + content : LockAction + dataAccess : DataAccessHolder element=Transitions::subject.d [DataAccess] diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Wildcards.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Wildcards.txt new file mode 100644 index 0000000000..1beedb52a2 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3189_Wildcards.txt @@ -0,0 +1,29 @@ +annex[0] owner=Wildcards::inherited.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=inheritedLock + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=Wildcards::inherited.f [DataAccess] + actions[2] : UnlockAction + dataAccess : DataAccessHolder element=Wildcards::subject.e [DataAccess] +annex[1] owner=Wildcards::subject.allLocked + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=allLocked + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : LockAction +annex[2] owner=Wildcards::subject.partialRelease + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + states[0] : BehaviorState name=ready + transitions[0] : BehaviorTransition name=partialRelease + condition : DispatchCondition + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=Wildcards::subject.d [DataAccess] diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_ActionSets.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_ActionSets.txt new file mode 100644 index 0000000000..afe7756d9c --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_ActionSets.txt @@ -0,0 +1,33 @@ +===== annex[0] owner=ActionSets::subject.order ===== + + states + ready : initial complete final state; + transitions + order : ready -[on dispatch]-> ready { + d!< & d!> + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[1] owner=ActionSets::subject.nestedOrder ===== + + states + ready : initial complete final state; + transitions + nestedOrder : ready -[on dispatch]-> ready { + { d!<; e!<; e!> } & { computation(1 ms); d!> } + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[2] owner=ActionSets::subject.unrelatedRelease ===== + + states + ready : initial complete final state; + transitions + unrelatedRelease : ready -[on dispatch]-> ready { + d!<; { e!> & computation(1 ms) } + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Balanced.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Balanced.txt new file mode 100644 index 0000000000..7e2fcf428d --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Balanced.txt @@ -0,0 +1,205 @@ +===== annex[0] owner=Balanced::subject.sequence ===== + + states + ready : initial complete final state; + transitions + sequence : ready -[on dispatch]-> ready { + d!<; d!> + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[1] owner=Balanced::subject.branches ===== + + states + ready : initial complete final state; + transitions + branches : ready -[on dispatch]-> ready { + d!<; if (condition) { d!> } elsif (condition) { d!> } else { d!> } end if + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[2] owner=Balanced::subject.branchLocal ===== + + states + ready : initial complete final state; + transitions + branchLocal : ready -[on dispatch]-> ready { + if (condition) { d!<; d!> } end if + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[3] owner=Balanced::subject.actionSet ===== + + states + ready : initial complete final state; + transitions + actionSet : ready -[on dispatch]-> ready { + d!<; { { e!<; e!> } & d!> } + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[4] owner=Balanced::subject.setSequences ===== + + states + ready : initial complete final state; + transitions + setSequences : ready -[on dispatch]-> ready { + { d!<; d!> } & { d!<; d!> } + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[5] owner=Balanced::subject.whileBalanced ===== + + states + ready : initial complete final state; + transitions + whileBalanced : ready -[on dispatch]-> ready { + while (condition) { d!<; d!> } + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[6] owner=Balanced::subject.whileCleanup ===== + + states + ready : initial complete final state; + transitions + whileCleanup : ready -[on dispatch]-> ready { + while (condition) { d!< }; d!> + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[7] owner=Balanced::subject.doRelease ===== + + states + ready : initial complete final state; + transitions + doRelease : ready -[on dispatch]-> ready { + d!<; do { d!> } until (condition) + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[8] owner=Balanced::subject.forRelease ===== + + states + ready : initial complete final state; + transitions + forRelease : ready -[on dispatch]-> ready { + d!<; for (i in 1 .. 2) { d!> } + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[9] owner=Balanced::subject.forallBalanced ===== + + states + ready : initial complete final state; + transitions + forallBalanced : ready -[on dispatch]-> ready { + forall (i in 1 .. 2) { d!<; d!> } + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[10] owner=Balanced::subject.wildcards ===== + + states + ready : initial complete final state; + transitions + wildcards : ready -[on dispatch]-> ready { + *!<; *!> + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[11] owner=Balanced::subject.individualUnlocks ===== + + states + ready : initial complete final state; + transitions + individualUnlocks : ready -[on dispatch]-> ready { + *!<; d!>; e!> + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[12] owner=Balanced::subject.wildcardUnlock ===== + + states + ready : initial complete final state; + transitions + wildcardUnlock : ready -[on dispatch]-> ready { + d!<; *!> + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[13] owner=Balanced::subject.staticConditionsBranch ===== + + states + ready : initial complete final state; + transitions + constantBranch : ready -[on dispatch]-> ready { + if (false or not true) { d!< } end if + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[14] owner=Balanced::subject.staticConditionsElse ===== + + states + ready : initial complete final state; + transitions + constantElse : ready -[on dispatch]-> ready { + if (true) { d!<; d!> } else { d!< } end if + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[15] owner=Balanced::subject.emptyWhile ===== + + states + ready : initial complete final state; + transitions + emptyWhile : ready -[on dispatch]-> ready { + while (false) { d!< } + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[16] owner=Balanced::subject.emptyFor ===== + + states + ready : initial complete final state; + transitions + emptyFor : ready -[on dispatch]-> ready { + for (i in 2 .. 1) { d!< } + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[17] owner=Balanced::subject.whileForever ===== + + states + ready : initial complete final state; + transitions + whileForever : ready -[on dispatch]-> ready { while (true) { d!< } }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[18] owner=Balanced::subject.doForever ===== + + states + ready : initial complete final state; + transitions + doForever : ready -[on dispatch]-> ready { do { d!< } until (false) }; +\s\s\s\s +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Branches.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Branches.txt new file mode 100644 index 0000000000..8c091032c3 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Branches.txt @@ -0,0 +1,33 @@ +===== annex[0] owner=Branches::subject.missingElse ===== + + states + ready : initial complete final state; + transitions + missingElse : ready -[on dispatch]-> ready { + d!<; if (condition) { d!> } end if + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[1] owner=Branches::subject.oneBranch ===== + + states + ready : initial complete final state; + transitions + oneBranch : ready -[on dispatch]-> ready { + if (condition) { d!< } else { computation(1 ms) } end if + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[2] owner=Branches::subject.elseIf ===== + + states + ready : initial complete final state; + transitions + elseIf : ready -[on dispatch]-> ready { + d!<; if (condition) { d!> } elsif (condition) { computation(1 ms) } else { d!> } end if + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_GroupedResources.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_GroupedResources.txt new file mode 100644 index 0000000000..0ecbd0e41c --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_GroupedResources.txt @@ -0,0 +1,30 @@ +===== annex[0] owner=GroupedResources::subject.wrongGroup ===== + + states + ready : initial complete final state; + transitions + wrongGroup : ready -[on dispatch]-> ready { left.d!<; right.d!> }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[1] owner=GroupedResources::subject.allGroups ===== + + states + ready : initial complete final state; + transitions + allGroups : ready -[on dispatch]-> ready { *!<; left.d!>; right.d!>; inverted.d!> }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[2] owner=GroupedResources::subject.balanced ===== + + states + ready : initial complete final state; + transitions + balanced : ready -[on dispatch]-> ready { + *!<; left.d!>; right.d!>; nested.inner.d!>; inverted.d!>; + left.d!<; left.d!>; inverted.d!<; inverted.d!> + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Issue3189.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Issue3189.txt new file mode 100644 index 0000000000..2cc937bbdd --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Issue3189.txt @@ -0,0 +1,11 @@ +===== annex[0] owner=Issue3189::subject.unreleased ===== + + states + ready : initial complete final state; + transitions + unreleased : ready -[on dispatch]-> ready { + d!< + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Loops.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Loops.txt new file mode 100644 index 0000000000..fa910da8b8 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Loops.txt @@ -0,0 +1,66 @@ +===== annex[0] owner=Loops::subject.whileLock ===== + + states + ready : initial complete final state; + transitions + whileLock : ready -[on dispatch]-> ready { + while (condition) { d!< } + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[1] owner=Loops::subject.whileMaySkip ===== + + states + ready : initial complete final state; + transitions + whileMaySkip : ready -[on dispatch]-> ready { + d!<; while (condition) { d!> } + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[2] owner=Loops::subject.doLock ===== + + states + ready : initial complete final state; + transitions + doLock : ready -[on dispatch]-> ready { + do { d!< } until (condition) + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[3] owner=Loops::subject.forLock ===== + + states + ready : initial complete final state; + transitions + forLock : ready -[on dispatch]-> ready { + for (i in 1 .. 2) { d!< } + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[4] owner=Loops::subject.forallLock ===== + + states + ready : initial complete final state; + transitions + forallLock : ready -[on dispatch]-> ready { + forall (i in 1 .. 2) { d!< } + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[5] owner=Loops::subject.emptyRelease ===== + + states + ready : initial complete final state; + transitions + emptyRelease : ready -[on dispatch]-> ready { + d!<; for (i in 2 .. 1) { d!> } + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_PotentialFalsePositives.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_PotentialFalsePositives.txt new file mode 100644 index 0000000000..620f6b2aa1 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_PotentialFalsePositives.txt @@ -0,0 +1,45 @@ +===== annex[0] owner=PotentialFalsePositives::subject.correlated ===== + + variables + condition : Base_Types::Boolean := true; + states + ready : initial complete final state; + transitions + -- The condition cannot change between these actions: this path is actually balanced. + correlated : ready -[on dispatch]-> ready { + if (condition) d!< end if; + if (condition) d!> end if + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[1] owner=PotentialFalsePositives::subject.bothBranches ===== + + variables + condition : Base_Types::Boolean := true; + states + ready : initial complete final state; + transitions + -- Both alternatives have the same effect, so no assumption about the condition is needed. + bothBranches : ready -[on dispatch]-> ready { + if (condition) d!< else d!< end if + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[2] owner=PotentialFalsePositives::subject.contradictory ===== + + variables + condition : Base_Types::Boolean := true; + states + start : initial state; + middle : state; + ready : complete final state; + transitions + -- The checker must retain uncertainty across transitions, even when all entries hold a lock. + acquire : start -[condition]-> middle { d!< }; + contradictory : middle -[not condition]-> ready; + runAgain : ready -[on dispatch]-> ready { d!> }; +\s\s\s\s +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Transitions.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Transitions.txt new file mode 100644 index 0000000000..1757e538a9 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Transitions.txt @@ -0,0 +1,59 @@ +===== annex[0] owner=Transitions::subject.impl ===== + + states + start : initial state; + left, right, join, unreachable : state; + ready : complete final state; + transitions + -- Deliberately list consumers before predecessors to exercise the fixed point. + leaked : join -[condition]-> ready; + released : join -[otherwise]-> ready { d!> }; + joined : left, right -[]-> join; + acquired : start -[condition]-> left { d!< }; + clean : start -[otherwise]-> right; + ignored : unreachable -[]-> ready { d!< }; + impossible : start -[false]-> ready { d!< }; + redispatch : ready -[on dispatch]-> ready { d!> }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[1] owner=Transitions::subject.cycle ===== + + states + start : initial state; + first, second : state; + ready : complete final state; + transitions + exitCycle : first -[condition]-> ready; + entry : start -[]-> first; + forward : first -[otherwise]-> second; + back : second -[]-> first { d!< }; + dispatchAgain : ready -[on dispatch]-> ready { d!> }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[2] owner=Transitions::subject.balanced ===== + + states + start : initial state; + running : state; + ready : complete final state; + transitions + acquire : start -[]-> running { d!< }; + release : running -[]-> ready { d!> }; + runAgain : ready -[on dispatch]-> ready; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[3] owner=Transitions::subject.staticConditions ===== + + states + start : initial state; + ready : complete final state; + transitions + always : start -[true]-> ready { d!<; d!> }; + never : start -[otherwise]-> ready { d!< }; + runAgain : ready -[on dispatch]-> ready; +\s\s\s\s +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Wildcards.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Wildcards.txt new file mode 100644 index 0000000000..e0c8a8bc9d --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3189_Wildcards.txt @@ -0,0 +1,31 @@ +===== annex[0] owner=Wildcards::inherited.impl ===== + + states + ready : initial complete final state; + transitions + inheritedLock : ready -[on dispatch]-> ready { *!<; f!>; e!> }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[1] owner=Wildcards::subject.allLocked ===== + + states + ready : initial complete final state; + transitions + allLocked : ready -[on dispatch]-> ready { + *!< + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed +===== annex[2] owner=Wildcards::subject.partialRelease ===== + + states + ready : initial complete final state; + transitions + partialRelease : ready -[on dispatch]-> ready { + *!<; d!> + }; +\s\s\s\s +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/models/issue3189/.gitignore b/ba/org.osate.ba.tests/models/issue3189/.gitignore new file mode 100644 index 0000000000..afce51184c --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3189/.gitignore @@ -0,0 +1,2 @@ +/.aadlbin-gen/ +/instances/ diff --git a/ba/org.osate.ba.tests/models/issue3189/.project b/ba/org.osate.ba.tests/models/issue3189/.project new file mode 100644 index 0000000000..e491b3dcf6 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3189/.project @@ -0,0 +1,18 @@ + + + issue3189 + + + + + + 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/issue3189/ActionSets.aadl b/ba/org.osate.ba.tests/models/issue3189/ActionSets.aadl new file mode 100644 index 0000000000..d338f69cd2 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3189/ActionSets.aadl @@ -0,0 +1,65 @@ +-- 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 ActionSets +public + with Base_Types; + + thread subject + features + d : requires data access Base_Types::Integer; + e : requires data access Base_Types::Integer; + end subject; + + thread implementation subject.order + annex behavior_specification {** + states + ready : initial complete final state; + transitions + order : ready -[on dispatch]-> ready { + d!< & d!> + }; + **}; + end subject.order; + + thread implementation subject.nestedOrder + annex behavior_specification {** + states + ready : initial complete final state; + transitions + nestedOrder : ready -[on dispatch]-> ready { + { d!<; e!<; e!> } & { computation(1 ms); d!> } + }; + **}; + end subject.nestedOrder; + + thread implementation subject.unrelatedRelease + annex behavior_specification {** + states + ready : initial complete final state; + transitions + unrelatedRelease : ready -[on dispatch]-> ready { + d!<; { e!> & computation(1 ms) } + }; + **}; + end subject.unrelatedRelease; +end ActionSets; diff --git a/ba/org.osate.ba.tests/models/issue3189/Balanced.aadl b/ba/org.osate.ba.tests/models/issue3189/Balanced.aadl new file mode 100644 index 0000000000..214eb98c66 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3189/Balanced.aadl @@ -0,0 +1,238 @@ +-- 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 Balanced +public + with Base_Types; + + thread subject + features + condition : in data port Base_Types::Boolean; + d : requires data access Base_Types::Integer; + e : requires data access Base_Types::Integer; + end subject; + + thread implementation subject.sequence + annex behavior_specification {** + states + ready : initial complete final state; + transitions + sequence : ready -[on dispatch]-> ready { + d!<; d!> + }; + **}; + end subject.sequence; + + thread implementation subject.branches + annex behavior_specification {** + states + ready : initial complete final state; + transitions + branches : ready -[on dispatch]-> ready { + d!<; if (condition) { d!> } elsif (condition) { d!> } else { d!> } end if + }; + **}; + end subject.branches; + + thread implementation subject.branchLocal + annex behavior_specification {** + states + ready : initial complete final state; + transitions + branchLocal : ready -[on dispatch]-> ready { + if (condition) { d!<; d!> } end if + }; + **}; + end subject.branchLocal; + + thread implementation subject.actionSet + annex behavior_specification {** + states + ready : initial complete final state; + transitions + actionSet : ready -[on dispatch]-> ready { + d!<; { { e!<; e!> } & d!> } + }; + **}; + end subject.actionSet; + + thread implementation subject.setSequences + annex behavior_specification {** + states + ready : initial complete final state; + transitions + setSequences : ready -[on dispatch]-> ready { + { d!<; d!> } & { d!<; d!> } + }; + **}; + end subject.setSequences; + + thread implementation subject.whileBalanced + annex behavior_specification {** + states + ready : initial complete final state; + transitions + whileBalanced : ready -[on dispatch]-> ready { + while (condition) { d!<; d!> } + }; + **}; + end subject.whileBalanced; + + thread implementation subject.whileCleanup + annex behavior_specification {** + states + ready : initial complete final state; + transitions + whileCleanup : ready -[on dispatch]-> ready { + while (condition) { d!< }; d!> + }; + **}; + end subject.whileCleanup; + + thread implementation subject.doRelease + annex behavior_specification {** + states + ready : initial complete final state; + transitions + doRelease : ready -[on dispatch]-> ready { + d!<; do { d!> } until (condition) + }; + **}; + end subject.doRelease; + + thread implementation subject.forRelease + annex behavior_specification {** + states + ready : initial complete final state; + transitions + forRelease : ready -[on dispatch]-> ready { + d!<; for (i in 1 .. 2) { d!> } + }; + **}; + end subject.forRelease; + + thread implementation subject.forallBalanced + annex behavior_specification {** + states + ready : initial complete final state; + transitions + forallBalanced : ready -[on dispatch]-> ready { + forall (i in 1 .. 2) { d!<; d!> } + }; + **}; + end subject.forallBalanced; + + thread implementation subject.wildcards + annex behavior_specification {** + states + ready : initial complete final state; + transitions + wildcards : ready -[on dispatch]-> ready { + *!<; *!> + }; + **}; + end subject.wildcards; + + thread implementation subject.individualUnlocks + annex behavior_specification {** + states + ready : initial complete final state; + transitions + individualUnlocks : ready -[on dispatch]-> ready { + *!<; d!>; e!> + }; + **}; + end subject.individualUnlocks; + + thread implementation subject.wildcardUnlock + annex behavior_specification {** + states + ready : initial complete final state; + transitions + wildcardUnlock : ready -[on dispatch]-> ready { + d!<; *!> + }; + **}; + end subject.wildcardUnlock; + + thread implementation subject.staticConditionsBranch + annex behavior_specification {** + states + ready : initial complete final state; + transitions + constantBranch : ready -[on dispatch]-> ready { + if (false or not true) { d!< } end if + }; + **}; + end subject.staticConditionsBranch; + + thread implementation subject.staticConditionsElse + annex behavior_specification {** + states + ready : initial complete final state; + transitions + constantElse : ready -[on dispatch]-> ready { + if (true) { d!<; d!> } else { d!< } end if + }; + **}; + end subject.staticConditionsElse; + + thread implementation subject.emptyWhile + annex behavior_specification {** + states + ready : initial complete final state; + transitions + emptyWhile : ready -[on dispatch]-> ready { + while (false) { d!< } + }; + **}; + end subject.emptyWhile; + + thread implementation subject.emptyFor + annex behavior_specification {** + states + ready : initial complete final state; + transitions + emptyFor : ready -[on dispatch]-> ready { + for (i in 2 .. 1) { d!< } + }; + **}; + end subject.emptyFor; + + thread implementation subject.whileForever + annex behavior_specification {** + states + ready : initial complete final state; + transitions + whileForever : ready -[on dispatch]-> ready { while (true) { d!< } }; + **}; + end subject.whileForever; + + thread implementation subject.doForever + annex behavior_specification {** + states + ready : initial complete final state; + transitions + doForever : ready -[on dispatch]-> ready { do { d!< } until (false) }; + **}; + end subject.doForever; +end Balanced; diff --git a/ba/org.osate.ba.tests/models/issue3189/Branches.aadl b/ba/org.osate.ba.tests/models/issue3189/Branches.aadl new file mode 100644 index 0000000000..ec94b2ac1a --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3189/Branches.aadl @@ -0,0 +1,66 @@ +-- 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 Branches +public + with Base_Types; + + thread subject + features + condition : in data port Base_Types::Boolean; + d : requires data access Base_Types::Integer; + e : requires data access Base_Types::Integer; + end subject; + + thread implementation subject.missingElse + annex behavior_specification {** + states + ready : initial complete final state; + transitions + missingElse : ready -[on dispatch]-> ready { + d!<; if (condition) { d!> } end if + }; + **}; + end subject.missingElse; + + thread implementation subject.oneBranch + annex behavior_specification {** + states + ready : initial complete final state; + transitions + oneBranch : ready -[on dispatch]-> ready { + if (condition) { d!< } else { computation(1 ms) } end if + }; + **}; + end subject.oneBranch; + + thread implementation subject.elseIf + annex behavior_specification {** + states + ready : initial complete final state; + transitions + elseIf : ready -[on dispatch]-> ready { + d!<; if (condition) { d!> } elsif (condition) { computation(1 ms) } else { d!> } end if + }; + **}; + end subject.elseIf; +end Branches; diff --git a/ba/org.osate.ba.tests/models/issue3189/GroupedResources.aadl b/ba/org.osate.ba.tests/models/issue3189/GroupedResources.aadl new file mode 100644 index 0000000000..20d8b6c9d1 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3189/GroupedResources.aadl @@ -0,0 +1,79 @@ +-- 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 GroupedResources +public + with Base_Types; + + feature group AccessGroup + features + d : requires data access Base_Types::Integer; + end AccessGroup; + + feature group Wrapper + features + inner : feature group AccessGroup; + end Wrapper; + + feature group OfferedGroup + features + d : provides data access Base_Types::Integer; + end OfferedGroup; + + thread subject + features + left : feature group AccessGroup; + right : feature group AccessGroup; + nested : feature group Wrapper; + inverted : feature group inverse of OfferedGroup; + end subject; + + thread implementation subject.wrongGroup + annex behavior_specification {** + states + ready : initial complete final state; + transitions + wrongGroup : ready -[on dispatch]-> ready { left.d!<; right.d!> }; + **}; + end subject.wrongGroup; + + thread implementation subject.allGroups + annex behavior_specification {** + states + ready : initial complete final state; + transitions + allGroups : ready -[on dispatch]-> ready { *!<; left.d!>; right.d!>; inverted.d!> }; + **}; + end subject.allGroups; + + thread implementation subject.balanced + annex behavior_specification {** + states + ready : initial complete final state; + transitions + balanced : ready -[on dispatch]-> ready { + *!<; left.d!>; right.d!>; nested.inner.d!>; inverted.d!>; + left.d!<; left.d!>; inverted.d!<; inverted.d!> + }; + **}; + end subject.balanced; +end GroupedResources; diff --git a/ba/org.osate.ba.tests/models/issue3189/Issue3189.aadl b/ba/org.osate.ba.tests/models/issue3189/Issue3189.aadl new file mode 100644 index 0000000000..539f90a32d --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3189/Issue3189.aadl @@ -0,0 +1,43 @@ +-- 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 Issue3189 +public + with Base_Types; + + thread subject + features + d : requires data access Base_Types::Integer; + e : requires data access Base_Types::Integer; + end subject; + + thread implementation subject.unreleased + annex behavior_specification {** + states + ready : initial complete final state; + transitions + unreleased : ready -[on dispatch]-> ready { + d!< + }; + **}; + end subject.unreleased; +end Issue3189; diff --git a/ba/org.osate.ba.tests/models/issue3189/Loops.aadl b/ba/org.osate.ba.tests/models/issue3189/Loops.aadl new file mode 100644 index 0000000000..d075c47688 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3189/Loops.aadl @@ -0,0 +1,99 @@ +-- 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 Loops +public + with Base_Types; + + thread subject + features + condition : in data port Base_Types::Boolean; + d : requires data access Base_Types::Integer; + e : requires data access Base_Types::Integer; + end subject; + + thread implementation subject.whileLock + annex behavior_specification {** + states + ready : initial complete final state; + transitions + whileLock : ready -[on dispatch]-> ready { + while (condition) { d!< } + }; + **}; + end subject.whileLock; + + thread implementation subject.whileMaySkip + annex behavior_specification {** + states + ready : initial complete final state; + transitions + whileMaySkip : ready -[on dispatch]-> ready { + d!<; while (condition) { d!> } + }; + **}; + end subject.whileMaySkip; + + thread implementation subject.doLock + annex behavior_specification {** + states + ready : initial complete final state; + transitions + doLock : ready -[on dispatch]-> ready { + do { d!< } until (condition) + }; + **}; + end subject.doLock; + + thread implementation subject.forLock + annex behavior_specification {** + states + ready : initial complete final state; + transitions + forLock : ready -[on dispatch]-> ready { + for (i in 1 .. 2) { d!< } + }; + **}; + end subject.forLock; + + thread implementation subject.forallLock + annex behavior_specification {** + states + ready : initial complete final state; + transitions + forallLock : ready -[on dispatch]-> ready { + forall (i in 1 .. 2) { d!< } + }; + **}; + end subject.forallLock; + + thread implementation subject.emptyRelease + annex behavior_specification {** + states + ready : initial complete final state; + transitions + emptyRelease : ready -[on dispatch]-> ready { + d!<; for (i in 2 .. 1) { d!> } + }; + **}; + end subject.emptyRelease; +end Loops; diff --git a/ba/org.osate.ba.tests/models/issue3189/PotentialFalsePositives.aadl b/ba/org.osate.ba.tests/models/issue3189/PotentialFalsePositives.aadl new file mode 100644 index 0000000000..5d833afc51 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3189/PotentialFalsePositives.aadl @@ -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 PotentialFalsePositives +public + with Base_Types; + + thread subject + features + d : requires data access Base_Types::Integer; + end subject; + + thread implementation subject.correlated + annex behavior_specification {** + variables + condition : Base_Types::Boolean := true; + states + ready : initial complete final state; + transitions + -- The condition cannot change between these actions: this path is actually balanced. + correlated : ready -[on dispatch]-> ready { + if (condition) d!< end if; + if (condition) d!> end if + }; + **}; + end subject.correlated; + + thread implementation subject.bothBranches + annex behavior_specification {** + variables + condition : Base_Types::Boolean := true; + states + ready : initial complete final state; + transitions + -- Both alternatives have the same effect, so no assumption about the condition is needed. + bothBranches : ready -[on dispatch]-> ready { + if (condition) d!< else d!< end if + }; + **}; + end subject.bothBranches; + + thread implementation subject.contradictory + annex behavior_specification {** + variables + condition : Base_Types::Boolean := true; + states + start : initial state; + middle : state; + ready : complete final state; + transitions + -- The checker must retain uncertainty across transitions, even when all entries hold a lock. + acquire : start -[condition]-> middle { d!< }; + contradictory : middle -[not condition]-> ready; + runAgain : ready -[on dispatch]-> ready { d!> }; + **}; + end subject.contradictory; +end PotentialFalsePositives; diff --git a/ba/org.osate.ba.tests/models/issue3189/Transitions.aadl b/ba/org.osate.ba.tests/models/issue3189/Transitions.aadl new file mode 100644 index 0000000000..5d09d19a62 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3189/Transitions.aadl @@ -0,0 +1,91 @@ +-- 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 Transitions +public + with Base_Types; + + thread subject + features + condition : in data port Base_Types::Boolean; + d : requires data access Base_Types::Integer; + end subject; + + thread implementation subject.impl + annex behavior_specification {** + states + start : initial state; + left, right, join, unreachable : state; + ready : complete final state; + transitions + -- Deliberately list consumers before predecessors to exercise the fixed point. + leaked : join -[condition]-> ready; + released : join -[otherwise]-> ready { d!> }; + joined : left, right -[]-> join; + acquired : start -[condition]-> left { d!< }; + clean : start -[otherwise]-> right; + ignored : unreachable -[]-> ready { d!< }; + impossible : start -[false]-> ready { d!< }; + redispatch : ready -[on dispatch]-> ready { d!> }; + **}; + end subject.impl; + + thread implementation subject.cycle + annex behavior_specification {** + states + start : initial state; + first, second : state; + ready : complete final state; + transitions + exitCycle : first -[condition]-> ready; + entry : start -[]-> first; + forward : first -[otherwise]-> second; + back : second -[]-> first { d!< }; + dispatchAgain : ready -[on dispatch]-> ready { d!> }; + **}; + end subject.cycle; + + thread implementation subject.balanced + annex behavior_specification {** + states + start : initial state; + running : state; + ready : complete final state; + transitions + acquire : start -[]-> running { d!< }; + release : running -[]-> ready { d!> }; + runAgain : ready -[on dispatch]-> ready; + **}; + end subject.balanced; + + thread implementation subject.staticConditions + annex behavior_specification {** + states + start : initial state; + ready : complete final state; + transitions + always : start -[true]-> ready { d!<; d!> }; + never : start -[otherwise]-> ready { d!< }; + runAgain : ready -[on dispatch]-> ready; + **}; + end subject.staticConditions; +end Transitions; diff --git a/ba/org.osate.ba.tests/models/issue3189/Wildcards.aadl b/ba/org.osate.ba.tests/models/issue3189/Wildcards.aadl new file mode 100644 index 0000000000..b276a69238 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3189/Wildcards.aadl @@ -0,0 +1,68 @@ +-- 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 Wildcards +public + with Base_Types; + + thread subject + features + d : requires data access Base_Types::Integer; + e : requires data access Base_Types::Integer; + end subject; + + thread inherited extends subject + features + f : requires data access Base_Types::Integer; + end inherited; + + thread implementation inherited.impl + annex behavior_specification {** + states + ready : initial complete final state; + transitions + inheritedLock : ready -[on dispatch]-> ready { *!<; f!>; e!> }; + **}; + end inherited.impl; + + thread implementation subject.allLocked + annex behavior_specification {** + states + ready : initial complete final state; + transitions + allLocked : ready -[on dispatch]-> ready { + *!< + }; + **}; + end subject.allLocked; + + thread implementation subject.partialRelease + annex behavior_specification {** + states + ready : initial complete final state; + transitions + partialRelease : ready -[on dispatch]-> ready { + *!<; d!> + }; + **}; + end subject.partialRelease; +end Wildcards; diff --git a/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3189Test.java b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3189Test.java new file mode 100644 index 0000000000..72fd2877af --- /dev/null +++ b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3189Test.java @@ -0,0 +1,137 @@ +/** + * 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 static org.junit.Assert.assertTrue; + +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 shared-data resource lifetime through the embedded BA validator. */ +@RunWith(XtextRunner.class) +@InjectWith(BehaviorAnnexInjectorProvider.class) +public class Issue3189Test extends XtextTest { + private static final String PATH = "org.osate.ba.tests/models/issue3189/"; + + @Inject + private TestHelper testHelper; + + @Inject + private ValidationTestHelper validationHelper; + + @Test + public void balancedPathsAndUnreachableLocksAreAccepted() throws Exception { + var root = testHelper.parseFile(PATH + "Balanced.aadl"); + validationHelper.assertNoIssues(root); + } + + @Test + public void unreleasedResourceIsReported() throws Exception { + assertDiagnostics("Issue3189", List.of(new Expected("unreleased", "d"))); + } + + @Test + public void alternativeBranchesPreservePossibleLocks() throws Exception { + assertDiagnostics("Branches", List.of(new Expected("missingElse", "d", Severity.INFO), + new Expected("oneBranch", "d", Severity.INFO), new Expected("elseIf", "d", Severity.INFO))); + } + + @Test + public void actionSetsConsiderEveryOrder() throws Exception { + assertDiagnostics("ActionSets", List.of(new Expected("order", "d"), new Expected("nestedOrder", "d"), + new Expected("unrelatedRelease", "d"))); + } + + @Test + public void loopsAccountForSkippedAndRepeatedBodies() throws Exception { + assertDiagnostics("Loops", + List.of(new Expected("whileLock", "d", Severity.INFO), new Expected("whileMaySkip", "d", Severity.INFO), + new Expected("doLock", "d", Severity.INFO), new Expected("forLock", "d"), + new Expected("forallLock", "d"), new Expected("emptyRelease", "d"))); + } + + @Test + public void wildcardOperationsIncludeInheritedRequiredAccesses() throws Exception { + assertDiagnostics("Wildcards", List.of(new Expected("inheritedLock", "d"), new Expected("allLocked", "d"), + new Expected("allLocked", "e"), new Expected("partialRelease", "e"))); + } + + @Test + public void locksFlowThroughTransitionsJoinsAndCycles() throws Exception { + assertDiagnostics("Transitions", + List.of(new Expected("leaked", "d", Severity.INFO), new Expected("exitCycle", "d", Severity.INFO))); + } + + @Test + public void groupedResourcesRetainTheirAccessPaths() throws Exception { + assertDiagnostics("GroupedResources", + List.of(new Expected("wrongGroup", "left.d"), new Expected("allGroups", "nested.inner.d"))); + } + + @Test + public void potentialFalsePositivesAreInformational() throws Exception { + assertDiagnostics("PotentialFalsePositives", List.of(new Expected("correlated", "d", Severity.INFO), + new Expected("bothBranches", "d"), new Expected("contradictory", "d", Severity.INFO))); + } + + 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).thenComparing(Issue::getMessage)) + .toList(); + assertEquals(issues.toString(), expected.size(), issues.size()); + for (var i = 0; i < expected.size(); i++) { + var issue = issues.get(i); + var diagnostic = expected.get(i); + assertEquals(diagnostic.severity(), issue.getSeverity()); + assertEquals("Complete state 'ready' may be reached while shared data '" + diagnostic.resource() + + "' remains locked: Behavior Annex D.6.", issue.getMessage()); + var target = source.substring(issue.getOffset(), issue.getOffset() + issue.getLength()); + assertTrue(target, target.startsWith(diagnostic.transition() + " :")); + } + } + + private record Expected(String transition, String resource, Severity severity) { + private Expected(String transition, String resource) { + this(transition, resource, Severity.ERROR); + } + } +} diff --git a/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaConsistencyRulesChecker.java b/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaConsistencyRulesChecker.java index 4e2ebb5b58..10d9b7ade0 100644 --- a/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaConsistencyRulesChecker.java +++ b/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaConsistencyRulesChecker.java @@ -119,7 +119,7 @@ public boolean D_3_C3_Check(BehaviorAnnex ba) { return result; } - private static StaticTruth staticTruth(ValueExpression expression) { + static StaticTruth staticTruth(ValueExpression expression) { if (expression.getRelations().isEmpty() || expression.getLogicalOperators().size() != expression.getRelations().size() - 1) { return StaticTruth.UNKNOWN; @@ -174,7 +174,7 @@ private static StaticTruth staticTruth(Value value) { return value instanceof ValueExpression expression ? staticTruth(expression) : StaticTruth.UNKNOWN; } - private enum StaticTruth { + enum StaticTruth { FALSE, TRUE, UNKNOWN; private StaticTruth and(StaticTruth other) { diff --git a/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaLockChecker.java b/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaLockChecker.java new file mode 100644 index 0000000000..f621c39b35 --- /dev/null +++ b/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaLockChecker.java @@ -0,0 +1,334 @@ +/** + * 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 static org.osate.ba.analyzers.AadlBaConsistencyRulesChecker.StaticTruth.FALSE; +import static org.osate.ba.analyzers.AadlBaConsistencyRulesChecker.StaticTruth.TRUE; +import static org.osate.ba.analyzers.AadlBaConsistencyRulesChecker.StaticTruth.UNKNOWN; +import static org.osate.ba.analyzers.AadlBaConsistencyRulesChecker.staticTruth; + +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.IdentityHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import org.osate.aadl2.AccessType; +import org.osate.aadl2.ComponentClassifier; +import org.osate.aadl2.DataAccess; +import org.osate.aadl2.Feature; +import org.osate.aadl2.FeatureGroup; +import org.osate.aadl2.FeatureGroupType; +import org.osate.aadl2.NamedElement; +import org.osate.aadl2.modelsupport.errorreporting.AnalysisErrorReporterManager; +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.BehaviorIntegerLiteral; +import org.osate.ba.aadlba.BehaviorState; +import org.osate.ba.aadlba.BehaviorTransition; +import org.osate.ba.aadlba.DataAccessHolder; +import org.osate.ba.aadlba.ElseStatement; +import org.osate.ba.aadlba.ForOrForAllStatement; +import org.osate.ba.aadlba.IfStatement; +import org.osate.ba.aadlba.IntegerRange; +import org.osate.ba.aadlba.LockAction; +import org.osate.ba.aadlba.Otherwise; +import org.osate.ba.aadlba.SharedDataAction; +import org.osate.ba.aadlba.ValueExpression; +import org.osate.ba.aadlba.WhileOrDoUntilStatement; +import org.osate.ba.utils.AadlBaVisitors; + +/** + * Checks AS5506/3 Rev. A D.6 resource release at complete states. Each required data access is tracked independently: + * joins retain any possibly held lock, and unlocks kill that fact. Action summaries preserve the distinction between + * leaving an incoming lock untouched and acquiring a new lock, which is necessary for unordered action sets. + * Runtime-dependent guards and iteration bounds are conservative; this is not a symbolic execution of data values. + * A second traversal excludes those assumptions to distinguish established violations from informational findings. + */ +public final class AadlBaLockChecker { + private final BehaviorAnnex annex; + private final List resources; + private final AnalysisErrorReporterManager errorManager; + + public AadlBaLockChecker(BehaviorAnnex annex, ComponentClassifier owner, + AnalysisErrorReporterManager errorManager) { + this.annex = annex; + var collected = new ArrayList(); + collectResources(AadlBaVisitors.getParentComponent(annex, owner).getAllFeatures(), List.of(), false, + new HashSet<>(), collected); + resources = List.copyOf(collected); + this.errorManager = errorManager; + } + + private static void collectResources(List features, List groups, boolean inverse, + Set activeTypes, List result) { + for (var feature : features) { + if (feature instanceof DataAccess access && (access.getKind() == AccessType.REQUIRES) != inverse) { + result.add(new Resource(access, groups)); + } else if (feature instanceof FeatureGroup group) { + var type = group.getAllFeatureGroupType(); + if (type != null && activeTypes.add(type)) { + var nestedGroups = new ArrayList<>(groups); + nestedGroups.add(group); + var nestedInverse = inverse ^ group.isInverse(); + // Match the feature inference used when instantiating an inverse feature group type. + if (type.getOwnedFeatures().isEmpty() && type.getInverse() != null && type.getExtended() == null) { + nestedInverse = !nestedInverse; + } + collectResources(type.getAllFeatures(), List.copyOf(nestedGroups), nestedInverse, activeTypes, + result); + activeTypes.remove(type); + } + } + } + } + + /** The group path distinguishes two features whose common group type declares the same data access. */ + private record Resource(DataAccess access, List groups) { + private String name() { + return Stream.concat(groups.stream(), Stream.of(access)) + .map(NamedElement::getName) + .collect(Collectors.joining(".")); + } + + private boolean matches(DataAccessHolder holder) { + return holder.getDataAccess() == access + && holder.getGroupHolders().stream().map(group -> group.getElement()).toList().equals(groups); + } + } + + /** Reports held locks at complete states and returns false only for established violations. */ + public boolean check() { + var valid = true; + for (var resource : resources) { + Map effects = new IdentityHashMap<>(); + for (var transition : annex.getTransitions()) { + var effect = isDisabled(transition) ? Effect.NO_EXIT : summarize(transition.getActionBlock(), resource); + effects.put(transition, effect); + } + var entries = findStateEntries(effects, false); + var confirmedEntries = findStateEntries(effects, true); + for (var transition : annex.getTransitions()) { + var entry = entries.get(transition.getSourceState()); + var destination = transition.getDestinationState(); + var effect = effects.get(transition); + if (entry != null && destination != null && destination.isComplete() && effect.canComplete() + && effect.apply(entry)) { + var message = "Complete state '" + destination.getName() + "' may be reached while shared data '" + + resource.name() + "' remains locked: Behavior Annex D.6."; + var confirmedEntry = confirmedEntries.get(transition.getSourceState()); + if (confirmedEntry != null && !isUncertain(transition, effect) && effect.apply(confirmedEntry)) { + errorManager.error(transition, message); + valid = false; + } else { + errorManager.info(transition, message); + } + } + } + } + return valid; + } + + private static boolean isDisabled(BehaviorTransition transition) { + var condition = transition.getCondition(); + if (condition instanceof ValueExpression expression) { + return staticTruth(expression) == FALSE; + } + if (condition instanceof Otherwise && transition.getSourceState() != null) { + return transition.getSourceState() + .getOutgoingTransitions() + .stream() + .anyMatch(other -> other != transition && (other.getCondition() == null + || other.getCondition() instanceof ValueExpression expression + && staticTruth(expression) == TRUE)); + } + return false; + } + + private static boolean isUncertain(BehaviorTransition transition, Effect effect) { + if (effect.uncertain()) { + return true; + } + var condition = transition.getCondition(); + if (condition instanceof ValueExpression expression) { + return staticTruth(expression) == UNKNOWN; + } + if (condition instanceof Otherwise && transition.getSourceState() != null) { + // An otherwise edge is known to be enabled only when every alternative is statically false. + return transition.getSourceState() + .getOutgoingTransitions() + .stream() + .anyMatch( + other -> other != transition && !(other.getCondition() instanceof ValueExpression expression + && staticTruth(expression) == FALSE)); + } + return false; + } + + private Map findStateEntries(Map effects, + boolean confirmedOnly) { + Map entries = new IdentityHashMap<>(); + var work = new ArrayDeque(); + for (var state : annex.getStates()) { + if (state.isInitial()) { + entries.put(state, false); + work.add(state); + } + } + while (!work.isEmpty()) { + var state = work.removeFirst(); + for (var transition : state.getOutgoingTransitions()) { + var destination = transition.getDestinationState(); + var effect = effects.get(transition); + if (destination == null || !effect.canComplete() || confirmedOnly && isUncertain(transition, effect)) { + continue; + } + var outgoing = effect.apply(entries.get(state)); + var previous = entries.get(destination); + if (previous == null || outgoing && !previous) { + entries.put(destination, outgoing); + work.add(destination); + } + } + } + return entries; + } + + private Effect summarize(BehaviorActions actions, Resource resource) { + if (actions instanceof BehaviorActionBlock block) { + return summarize(block.getContent(), resource); + } + if (actions instanceof BehaviorActionSequence sequence) { + var result = Effect.IDENTITY; + for (var action : sequence.getActions()) { + result = result.then(summarize(action, resource)); + } + return result; + } + if (actions instanceof BehaviorActionSet set) { + var result = Effect.IDENTITY; + for (var action : set.getActions()) { + result = result.parallel(summarize(action, resource)); + } + return result; + } + if (actions instanceof SharedDataAction action) { + if (action.getDataAccess() == null || resource.matches(action.getDataAccess())) { + return action instanceof LockAction ? Effect.LOCK : Effect.UNLOCK; + } + return Effect.IDENTITY; + } + if (actions instanceof IfStatement conditional) { + return summarizeConditional(conditional, resource); + } + if (actions instanceof WhileOrDoUntilStatement loop) { + var condition = staticTruth(loop.getLogicalValueExpression()); + if (loop.isDoUntil()) { + var body = summarize(loop.getBehaviorActions(), resource); + return condition == FALSE ? Effect.NO_EXIT : condition == TRUE ? body : body.withUncertainty(); + } + return switch (condition) { + case FALSE -> Effect.IDENTITY; + case TRUE -> Effect.NO_EXIT; + case UNKNOWN -> Effect.IDENTITY.or(summarize(loop.getBehaviorActions(), resource)).withUncertainty(); + }; + } + if (actions instanceof ForOrForAllStatement loop) { + if (loop.getIteratedValues() instanceof IntegerRange range + && range.getLowerIntegerValue() instanceof BehaviorIntegerLiteral lower + && range.getUpperIntegerValue() instanceof BehaviorIntegerLiteral upper) { + return lower.getValue() > upper.getValue() ? Effect.IDENTITY + : summarize(loop.getBehaviorActions(), resource); + } + // An unknown range or collection can be empty. Repeating the body adds no new per-resource effects: + // every terminating path either preserves the input, locks, or unlocks, and their union is idempotent. + var body = summarize(loop.getBehaviorActions(), resource); + return body.equals(Effect.IDENTITY) ? body : Effect.IDENTITY.or(body).withUncertainty(); + } + return Effect.IDENTITY; + } + + private Effect summarizeConditional(IfStatement conditional, Resource resource) { + var condition = staticTruth(conditional.getLogicalValueExpression()); + var thenEffect = condition == FALSE ? Effect.NO_EXIT : summarize(conditional.getBehaviorActions(), resource); + if (condition == TRUE) { + return thenEffect; + } + var alternative = conditional.getElseStatement(); + var elseEffect = alternative instanceof IfStatement elseIf ? summarizeConditional(elseIf, resource) + : alternative instanceof ElseStatement elseStatement + ? summarize(elseStatement.getBehaviorActions(), resource) + : Effect.IDENTITY; + if (condition == FALSE) { + return elseEffect; + } + return thenEffect.equals(elseEffect) ? thenEffect : thenEffect.or(elseEffect).withUncertainty(); + } + + /** + * The may-lock transfer function is {@code locks || (preserves && incoming)}. A separate completion bit distinguishes + * an unlock from a path that never reaches its successor. Summaries describe only paths that complete. Uncertainty + * records a dependency on runtime choices; such paths contribute informational findings, not validation errors. + */ + private record Effect(boolean preserves, boolean locks, boolean canComplete, boolean uncertain) { + private static final Effect IDENTITY = new Effect(true, false, true, false); + private static final Effect LOCK = new Effect(false, true, true, false); + private static final Effect UNLOCK = new Effect(false, false, true, false); + private static final Effect NO_EXIT = new Effect(false, false, false, false); + + private Effect withUncertainty() { + return new Effect(preserves, locks, canComplete, true); + } + + private boolean apply(boolean incoming) { + return locks || preserves && incoming; + } + + private Effect then(Effect next) { + return canComplete && next.canComplete + ? new Effect(preserves && next.preserves, next.apply(locks), true, uncertain || next.uncertain) + : NO_EXIT; + } + + private Effect or(Effect alternative) { + return new Effect(preserves || alternative.preserves, locks || alternative.locks, + canComplete || alternative.canComplete, uncertain || alternative.uncertain); + } + + private Effect parallel(Effect other) { + // The final operation on this resource can come from either member, including interleaved sequences. + // An incoming lock survives untouched only if every member has a path that leaves it untouched. + return canComplete && other.canComplete + ? new Effect(preserves && other.preserves, locks || other.locks, true, uncertain || other.uncertain) + : NO_EXIT; + } + } +} diff --git a/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaRulesCheckersDriver.java b/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaRulesCheckersDriver.java index 7a07fe1c6d..45a4cb273e 100644 --- a/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaRulesCheckersDriver.java +++ b/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaRulesCheckersDriver.java @@ -71,6 +71,7 @@ public class AadlBaRulesCheckersDriver { private AadlBaLegalityRulesChecker _legality; private AadlBaSemanticRulesChecker _semantic; private AadlBaConsistencyRulesChecker _consistency; + private AadlBaLockChecker _locks; private AnalysisErrorReporterManager _errManager; private BehaviorTransition _currentBt; @@ -85,6 +86,7 @@ public AadlBaRulesCheckersDriver(BehaviorAnnex ba, ComponentClassifier parentCon _legality = new AadlBaLegalityRulesChecker(ba, parentContainer, errManager); _semantic = new AadlBaSemanticRulesChecker(errManager); _consistency = new AadlBaConsistencyRulesChecker(ba, parentContainer, errManager); + _locks = new AadlBaLockChecker(ba, parentContainer, errManager); _errManager = errManager; this.initSwitches(); } @@ -181,6 +183,7 @@ public Boolean caseAnnexSubclause(AnnexSubclause object) { for (BehaviorTransition bt : _ba.getTransitions()) { result &= checkBehaviorTransition(bt, checked); } + result &= _locks.check(); } return result;