diff --git a/ba/doc/conformance.md b/ba/doc/conformance.md index 0be9303e1a7..826f57c67e9 100644 --- a/ba/doc/conformance.md +++ b/ba/doc/conformance.md @@ -4,11 +4,11 @@ Review date: 2026-09-09. Repository: `osate/osate2`, local `master`, commit `019 The current implementation provides substantial Behavior Annex syntax, model construction, and selected semantic checks, but **does not fully conform to the supplied AS5506/3 Rev. A document**. Remaining gaps include syntax acceptance, preservation of some strict-model meaning, and enforcement of several legality, consistency, and execution rules. Existing tests document some of these limitations, but their passing expectations do not establish conformance. -The most urgent remaining findings are type conformance being disabled outright (G18), other losses of information during translation to the strict BA model, and weaknesses in the conformance tests themselves. Fixing only the missing grammar productions would leave significant semantic gaps. +The remaining findings include instance-dependent type checking (G18), other losses of information during translation to the strict BA model, and gaps in conformance-test coverage. Fixing only the missing grammar productions would leave significant semantic gaps. ## GitHub tracking -The user directed that the report findings be treated as valid and filed without additional reproduction or test work. The 28 numbered conformance findings of the review, and G18 added afterwards with its own reproduction, are tracked as follows. G18 is also the one thing this report originally got wrong: its D.6 assessment credited the implementation with type checks that are disabled. +The user directed that the report findings be treated as valid and filed without additional reproduction or test work. The 28 numbered conformance findings of the review, and G18 added afterwards with its own reproduction, are tracked as follows. G18 is also the one thing this report originally got wrong: its D.6 assessment credited the implementation with type conformance that was disabled at the time of review. | Finding | Issue | Finding | Issue | | --- | --- | --- | --- | @@ -59,9 +59,9 @@ The review itself was a source and test-artifact audit. No Maven tests, simulato | D.1–D.2: scope and concepts | Embedded `behavior_specification` parser, linker, serializer, and strict-model translation are registered. | Supports the language-tooling role; execution semantics require separate consumer evidence. | | D.3: behavior specification | Variables, grouped states, state kinds, named/prioritized and multiple-source transitions, execute conditions, and dispatch/external conditions. State and transition legality checks have dedicated tests. | Partial. Internal conditions (G01), complete external-condition expressions (G02), naming and otherwise-transition rules (V01 and V02), 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; communication target categories/directions and structural call signatures are now checked (#3181). Data-type conformance remains deferred to #3199 and the instance-model pass; 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 (V03) and shared-data resource release (#3189) are now checked, and structural call signatures (#3181) are now checked; property-dependent type conformance remains deferred. | -| 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.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; communication target categories/directions and structural call signatures are now checked (#3181). Declared data-type conformance is checked by #3199; effective instance properties remain deferred to #3229. 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. Declared types are compared for assignments, sends, dequeues, iterators, and call parameters, including array rank and known extents (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, and structural call signatures (#3181) are now checked; instance-dependent type conformance remains deferred. | +| 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 is checked using declared classifier names and Data Model representations, with Ada universal literal compatibility (G18). Short-circuit logical operators, including in external conditions, and `updated` are now supported (#3166, #3169, and G07, since fixed), and value-expression precedence, association, admissible forms, and grouping now follow the document (G13, since fixed); numeric translation differs from the document, unary plus remains accepted as an extension but now produces a compatibility warning (G06), and declarative initializer typing and definite initialization are now checked (#3190). Instance-dependent initialization from prefixed property values remains #3230. | | D.8: synchronization | `Behavior_Properties::Subprogram_Call_Protocol` declares HSER/LSER/ASER and defaults to HSER, matching the supplied document. A client/server example exists. | Property definition conforms. Enforcement of the two LSER/ASER legality rules and execution of the protocols are not established. | Useful positive evidence includes [CoveringSyntaxTest](../../ba/org.osate.ba.tests/src/org/osate/ba/tests/CoveringSyntaxTest.xtend), [CoveringSemanticTest](../../ba/org.osate.ba.tests/src/org/osate/ba/tests/CoveringSemanticTest.xtend), [GrammarHazards.aadl](../../ba/org.osate.ba.tests/models/characterization/GrammarHazards.aadl), [BehaviorAnnexIntegrationTest](../../ba/org.osate.xtext.aadl2.ba.tests/src/org/osate/xtext/aadl2/ba/tests/BehaviorAnnexIntegrationTest.java), and [Issue3153Test](../../ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3153Test.java), [Issue3154Test](../../ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3154Test.java), and [Issue3155Test](../../ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3155Test.java). The latter tests establish specific diagnostic behavior and source locations, rather than general standard coverage. @@ -174,21 +174,19 @@ Signatures include every feature, including ports, in source declaration order. **Validation:** `Issue3181Test` reproduces the missing diagnostics and lost writable-target representation through external AADL models, and includes valid calls, inverse feature groups, inherited/refined signatures, and prototypes. Call data actuals now reach the existing type checker, including its active expression-operator checks. -**Deferred:** Actual/formal type comparisons use the existing `DataTypeChecker`; the production `AdaLikeDataTypeChecker.conformsTo` is still disabled under [#3199](https://github.com/osate/osate2/issues/3199). Effective `Access_Right` and property-derived representation, array, and range checks require the instance-model pass described in [properties.md](properties.md). Structural signature validation does not establish those properties. +**Type conformance:** Actual/formal comparisons use the `DataTypeChecker` enabled by [#3199](https://github.com/osate/osate2/issues/3199), including statically declared Data Model properties. Effective `Access_Right` and instance-specific representation, array, range, and prototype checks remain [#3229](https://github.com/osate/osate2/issues/3229), as described in [properties.md](properties.md). Source diagnostics do not establish compatibility after contained overrides. -### G18 — Type conformance is disabled, so no type mismatch is reported +### G18 — Declared type conformance -Added after the review date, with a reproduction. It corrects this report: the D.6 row above originally credited the implementation with type checks, and the D.7 row with operand-type checks. +**Addressed by [#3199](https://github.com/osate/osate2/issues/3199):** `AdaLikeDataTypeChecker.conformsTo` now checks assignment, send, dequeue, call-parameter, iterator, and binary-operand type compatibility. Declaration initializers use the same relation. `Issue3199Test` exercises these paths through external AADL models and the registered BA validator; its original four-transition reproduction reports one error per transition. -**Standard:** D.6 states the assignment rule directly — "In an assignment action, the type of the value expression must match the type of the target" — and D.5 imposes the same obligation on a port send and a dequeue target. D.7 requires operand consistency for the arithmetic and relational operators, and D.6 requires call parameters to match the called signature. +**Standard and tool policy:** D.6 explicitly requires assignment types and subprogram signatures to match; communication actions include implicit assignments through the D.5 service equivalences. D.5 itself has no legality rules. D.7 restricts operator applicability and derives the expression language from Ada95. Annex D does not define classifier substitutability. OSATE therefore uses case-insensitive qualified-name equality for classifier-typed operands, including classifiers with unknown representation. This deliberately rejects extension and type/implementation pairs. Integer literals match integer representations, while universal real literals match floating and fixed-point representations; classifier-typed numerics do not widen implicitly. -**Evidence:** [AdaLikeDataTypeChecker.conformsTo](../../ba/org.osate.ba/src/org/osate/ba/analyzers/AdaLikeDataTypeChecker.java) returns `true` unconditionally; its whole body is commented out behind the note "As type checking is not mature, we disable it". Its own comment names the affected checks, and each is reachable from `AadlBaTypeChecker`: assignment, port send, port dequeue, `for`/`forall`, integer range, and subprogram parameters. Two consequences are not in that comment: `getTopLevelType` can never return `null`, and the operand-consistency guard at the top of `checkDefinition` never fires. +Array rank must agree when known, and each extent is compared only when both extents are statically known. Symbolic extents remain unknown. Expression results preserve their selected classifier, representation, and dimensions. Untyped features and unresolved classifier references do not establish a type mismatch; linking diagnostics retain responsibility for unresolved names. -**Reproduction:** an external model that assigns a string to an integer-typed behavior variable, sends an integer on a string-classified out event data port, adds a string to an integer, and compares an integer with a string is accepted with zero diagnostics under the registered BA validator. This was executed, not inferred; see [#3199](https://github.com/osate/osate2/issues/3199) for the model. +**Corpus triage:** the grammar characterization fixture now consistently uses its custom integer classifier. Standard example 7 uses Boolean status literals and matching data implementation classifiers at its calls; comments record the corrections to the published example and the nominal type policy. The existing internal-port negative fixture now asserts its two formerly suppressed type errors. Type errors no longer suppress initialization and legality checking; unresolved holders, variable classifiers, and property associations still stop strict-model checks. The nested-array regression from #3226 remains accepted: an iterator retains its own declared classifier, and the array extent is read from the array classifier rather than its element classifier. -**What remains active:** operator applicability per operand data representation. `checkDefinition` still rejects `and` on a non-boolean, `<` on a non-alphanumeric, and `mod` on a non-integer after the disabled guard passes. So the gap is agreement between two types, not type checking as a whole. - -**Impact and required work:** re-enabling the comparison is a one-line change whose consequences are the actual work. Diagnostics will appear across `models/covering_semantic`, `models/covering_syntax`, and the standard examples, and each has to be triaged into a wrong fixture, a wrong message or location, or a rule in the commented-out body that is itself wrong for Rev. A — the fixed-point/universal-real and dimension clauses are the likely candidates. The diagnostics goldens make that triage measurable. Until then, no assertion anywhere in the suite may be read as evidence that BA types are checked. +**Source/instance boundary:** source checking uses statically declared Data Model properties. It does not evaluate effective instance properties or contained overrides. Instance-specific conformance, prototype bindings, selected property values, and paired-instance regression coverage are tracked separately by [#3229](https://github.com/osate/osate2/issues/3229). This source policy is not proof that every instance of a classifier has the same effective types. Integer-bound, time, index, and extent legality beyond the existing comparisons remain separate from enabling this relation. ## Further rule coverage and implementation gaps @@ -224,9 +222,9 @@ Some checker comments identify their source as **AADL Behavior Annex draft 0.94* 6. **Some legacy fixtures retain errors while tests now expect no diagnostics.** The loop-variable assignment example in G16 was a concrete instance until #3180 made that covering test require its diagnostic; the corresponding dequeue fixture shape is still accepted and is tracked as #3205. Other issue tests frequently assert only issue counts and successful parse. Counts should not substitute for the intended rule, severity, location, and positive control. -7. **Validator registration and gating matter.** At the review date the conformance and characterization classes used the generic AADL injector, unlike `CoveringSemanticTest` and the recent diagnostic regressions, so their goldens showed core-AADL findings only. **Step 1 made both states explicit** rather than choosing one: `BehaviorAnnexValidatedDiagnosticsTest` records the corpus with the validator registered under `expected/diagnostics-validated`, `BehaviorAnnexCharacterizationTest` keeps the plain-AADL baseline, and each asserts the presence or absence of BA rule diagnostics so the two cannot be confused. 29 of the 100 corpus models reported findings only the validated run saw at that point; each BA check added since raises that share, and at this update it is 63 of 156. `BehaviorAnnexValidator` still skips all later rule checking when the type checker fails, so an absent secondary diagnostic remains uninformative. G08 was the case in point — its validated golden held the null-element holder error and therefore no D.3 rule result at all — and that golden is empty now that #3172 has landed, which removes the example without removing the gating behavior. +7. **Validator registration and gating matter.** At the review date the conformance and characterization classes used the generic AADL injector, unlike `CoveringSemanticTest` and the recent diagnostic regressions, so their goldens showed core-AADL findings only. **Step 1 made both states explicit** rather than choosing one: `BehaviorAnnexValidatedDiagnosticsTest` records the corpus with the validator registered under `expected/diagnostics-validated`, `BehaviorAnnexCharacterizationTest` keeps the plain-AADL baseline, and each asserts the presence or absence of BA rule diagnostics so the two cannot be confused. 29 of the 100 corpus models reported findings only the validated run saw at that point; the later issue regressions extend that coverage. `BehaviorAnnexValidator` now separates resolution from conformance: #3199 preserves initialization and rule diagnostics after a type mismatch, while unresolved strict-model references remain a gate. `Issue3199Test` asserts a type error, an uninitialized read, and a D.3 legality error in the same annex. -8. **No test establishes that BA types are checked.** Every type-mismatch expectation in the suite passes because `conformsTo` accepts every pair (G18), not because the compared types agree. `Issue3174Test.internalEventWithoutDataCarriesNoValue` documents that for one construct. +8. **Declared BA type conformance is now tested (G18).** `Issue3199Test` verifies mismatches and positive controls for classifier identity, numerics, array shape, communications, and calls. `Issue3174Test.internalEventWithoutDataCarriesNoValue` now includes the internal-port type errors. Effective instance types remain outside these source tests. ## Recommended order and acceptance evidence @@ -237,7 +235,7 @@ These are proposed follow-up changes, not changes made by this review. | 1 | ~~Repair the conformance test oracle and ensure deterministic BA validator registration. Separate legacy characterization from standard expectations.~~ **Done**, branch `repair_conformance_test_oracle` (commit `Repair the Behavior Annex conformance test oracle`). | Exact diagnostics are compared, by `expected/diagnostics` and the new `expected/diagnostics-validated`; registration is proved end to end by requiring at least one BA rule diagnostic in the validated suite and none in the plain baseline; both suites and the conformance class assert nonzero executed cases; the nine skips it left were listed in `TRACKED_SKIPS` against their own issues and enforced by reflection, and that list has shrunk to five as those issues closed; `SelfPropertyReference.aadl` no longer carries an unrelated D.3 error. Each repaired expectation was confirmed to fail for its intended reason by temporarily removing its `@Ignore`. | | 2 | Preserve strict-model meaning: numeric literals, array extents, logical grouping, `self`, internal events, and mode bindings (G08, G10–G14). **Done:** G08 and G10–G14 are implemented. | External AADL input produces correct literal values, extents, references, operation kinds, and mode links; no test-only model mutation is needed. Assert attributes and semantic structure directly. | | 3 | Implement the missing standard syntax and remove unwanted overacceptance (G01–G07, G09, G13). **Under way:** G01–G07 and G13 are closed; G09 remains. G06 uses a deliberate warned-extension policy rather than strict grammar rejection. | Each standard form parses and translates; nonstandard forms have deliberate rejection/extension policy. Enable corrected standard acceptance tests and add AST/strict-model expression tests. | -| 4 | Correct the explicit validation mismatches and add the remaining static legality checks (G15–G18, V01–V03, V06–V07, V10–V11). G18 belongs first in this step: with type conformance disabled, several of the others cannot be demonstrated. **Under way:** G16 and V01–V03 are addressed; G17 structural checks are implemented; G15, G18, V06, V07, V10, and V11 remain, and the G16 dequeue form (#3205) is open. | Each negative model has an exact rule diagnostic and a nearby positive control. For G18, every diagnostic that appears in the existing corpus is triaged and its golden updated deliberately. Reproduce independently before opening an issue; use one independently reviewable defect per issue/fix. | +| 4 | Correct the explicit validation mismatches and add the remaining static legality checks (G15–G18, V01–V03, V06–V07, V10–V11). Enabling G18 declared conformance makes further type-related gaps observable. **Under way:** G16 and V01–V03 are addressed; G17 structural checks are implemented; G18 declared conformance is implemented; G15, V06, V07, V10, and V11 remain, and the G16 dequeue form (#3205) is open. | Each negative model has an exact rule diagnostic and a nearby positive control. For G18, every diagnostic that appears in the existing corpus is triaged and its golden updated deliberately. Reproduce independently before opening an issue; use one independently reviewable defect per issue/fix. | | 5 | Establish behavioral/dataflow coverage and consumer boundaries (V04–V05, V08–V09, D.5 and D.8 runtime semantics). **Under way:** V05 is addressed, except for the subcomponent override rule, which that row assigns to the consumer that walks the instance hierarchy. | State which obligations the front end can prove, which are warnings/approximations, and which belong to a simulator, analyzer, or generator. Validate queue behavior, timeouts, lock lifetimes, initialization, and call synchronization in the responsible consumer. | There is no basis here for a numerical conformance percentage: the suite is not a clause-complete standard test suite, some assertions are ineffective, and operational semantics were outside the executed scope. A defensible future claim should distinguish syntax acceptance, valid strict-model construction, legality/consistency enforcement, and downstream execution semantics. diff --git a/ba/doc/properties.md b/ba/doc/properties.md index a2a0cc10b3b..952f806ca19 100644 --- a/ba/doc/properties.md +++ b/ba/doc/properties.md @@ -19,7 +19,7 @@ This review covers the 19 issues carrying the `ba` label that were open on Septe | [#2669 — action blocks not fully typechecked](https://github.com/osate/osate2/issues/2669) | The reproduction determines the port's enum type from `Data_Representation` and `Enumerators`, both property values that may be overridden on a feature instance. | | [#3173 — omitted loop classifier](https://github.com/osate/osate2/issues/3173) | Grammar acceptance and integer-range inference are declarative. Inference from ports or arrays uses effective `Data_Representation`, `Base_Type`, and `Dimension` values and resolved prototype actuals, so that portion is instance-specific. | | [#3181 — communication and call signatures](https://github.com/osate/osate2/issues/3181) | Target category, parameter count and order, and direction are structural. Actual/formal type compatibility becomes instance-specific wherever it uses Data Model representation, array, range, or feature properties. | -| [#3199 — disabled type conformance](https://github.com/osate/osate2/issues/3199) | Simple classifier-identity and literal-kind mismatches can still be checked declaratively. Operator applicability, arrays, ranges, structural data types, and property-reference typing currently consume `Data_Representation`, `Dimension`, `Integer_Range`, and related property values. The umbrella implementation plan in the issue comments therefore needs splitting into declarative and instance passes. | +| [#3199 — declared type conformance](https://github.com/osate/osate2/issues/3199) | The source fix checks classifier identity, literal compatibility, and statically declared Data Model properties. It does not establish conformance after contained overrides or effective prototype bindings. Those checks, including instance-specific operator applicability, arrays, ranges, and property-reference values, remain [#3229](https://github.com/osate/osate2/issues/3229). | ## Issues not inherently affected @@ -58,7 +58,7 @@ The current BA validation path cannot soundly evaluate effective property values - `InstanceObjectImpl.getPropertyValueInternal` checks those cached local values before falling back to the declarative model. - The BA plug-in registers parser, linker, unparser, and text-position services, but no annex instantiator or other instance-checking hook. -Consequently, property-dependent checks must not produce ordinary source-validation diagnostics. They need an instance-side BA validation or analysis entry point that evaluates the declarative annex separately in each `ComponentInstance` context and reports against the affected instance, with source navigation where possible. +Consequently, source diagnostics cannot establish conformance for effective instance properties. The #3199 source policy also checks statically declared Data Model properties; its diagnostics describe those declarations, not the values after contained overrides. Checking effective values needs an instance-side BA validation or analysis entry point under [#3229](https://github.com/osate/osate2/issues/3229) that evaluates the annex separately in each `ComponentInstance` context and reports against the affected instance, with source navigation where possible. The declarative validator should retain checks whose answer cannot vary between instances, including syntax, name resolution, structural category and direction rules, property-definition type restrictions, and property-independent portions of type checking. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3174_InternalPortTypes.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3174_InternalPortTypes.txt index f597e331a68..aa203af7371 100644 --- a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3174_InternalPortTypes.txt +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3174_InternalPortTypes.txt @@ -1,2 +1,4 @@ error | semantic | 40 | 39 | 12 | internal event 'raised_event' has no data: it cannot be an assignment target error | semantic | 41 | 57 | 1 | internal event 'raised_event' has no data: its send action cannot carry a value +error | semantic | 43 | 59 | 6 | type error for 'assignment', 'Base_Types::Integer' expected, found 'standard string'. +error | semantic | 44 | 55 | 6 | type error for 'internal port send action', 'Base_Types::Integer' expected, found 'standard string'. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_ArrayTypes.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_ArrayTypes.txt new file mode 100644 index 00000000000..6cbad28a12e --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_ArrayTypes.txt @@ -0,0 +1,2 @@ +error | semantic | 38 | 69 | 12 | type error for 'assignment', 'Base_Types::Integer[2]' expected, found 'Base_Types::Integer[3]'. +error | semantic | 39 | 61 | 6 | type error for 'assignment', 'Base_Types::Integer[2]' expected, found 'Base_Types::Integer[2][2]'. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt new file mode 100644 index 00000000000..d57a8d85790 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt @@ -0,0 +1,5 @@ +error | semantic | 64 | 65 | 6 | type error for 'assignment', 'ClassifierIdentity::first_type' expected, found 'ClassifierIdentity::second_type'. +error | semantic | 65 | 58 | 5 | type error for 'assignment', 'ClassifierIdentity::first_type' expected, found 'ClassifierIdentity::child_type'. +error | semantic | 66 | 77 | 14 | type error for 'assignment', 'ClassifierIdentity::first_type' expected, found 'ClassifierIdentity::first_type.impl'. +error | semantic | 68 | 52 | 20 | type error for 'assignment', 'ClassifierIdentity::first_boolean' expected, found 'ClassifierIdentity::second_boolean'. +error | semantic | 69 | 53 | 20 | type error for 'assignment', 'ClassifierIdentity::first_boolean' expected, found 'ClassifierIdentity::second_boolean'. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_CommunicationTypes.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_CommunicationTypes.txt new file mode 100644 index 00000000000..5dba1117566 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_CommunicationTypes.txt @@ -0,0 +1,4 @@ +error | semantic | 48 | 33 | 15 | type error for 'port dequeue action', 'Base_Types::String' expected, found 'Base_Types::Integer'. +error | semantic | 49 | 41 | 7 | type error for 'actual for 'argument'', 'Base_Types::String' expected, found 'Base_Types::Integer'. +error | semantic | 49 | 50 | 7 | type error for 'actual for 'result'', 'Base_Types::String' expected, found 'Base_Types::Integer'. +error | semantic | 50 | 52 | 6 | type error for 'internal port send action', 'Base_Types::Integer' expected, found 'standard string'. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_ConformingTypes.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_ConformingTypes.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_Issue3199.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_Issue3199.txt new file mode 100644 index 00000000000..56e142c8629 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_Issue3199.txt @@ -0,0 +1,4 @@ +error | semantic | 40 | 54 | 6 | type error for 'assignment', 'Base_Types::Integer' expected, found 'standard string'. +error | semantic | 41 | 41 | 13 | type error for 'port send action', 'Base_Types::String' expected, found 'universal integer'. +error | semantic | 42 | 51 | 10 | Invalid operand types for operator "+": left operand has type universal integer, right operand has type standard string +error | semantic | 43 | 58 | 16 | Invalid operand types for operator "<": left operand has type Base_Types::Integer, right operand has type standard string diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_NumericTypes.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_NumericTypes.txt new file mode 100644 index 00000000000..039c3acbcbe --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_NumericTypes.txt @@ -0,0 +1,4 @@ +error | semantic | 39 | 55 | 1 | type error for 'assignment', 'Base_Types::Float' expected, found 'universal integer'. +error | semantic | 40 | 53 | 13 | type error for 'assignment', 'Base_Types::Float' expected, found 'Base_Types::Integer'. +error | semantic | 41 | 54 | 7 | Invalid operand types for operator "+": left operand has type universal integer, right operand has type universal real +error | semantic | 42 | 51 | 26 | Invalid operand types for operator "+": left operand has type Base_Types::Integer, right operand has type Base_Types::Float diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_SourceDiagnostics.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_SourceDiagnostics.txt new file mode 100644 index 00000000000..92fb905c4a5 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3199_SourceDiagnostics.txt @@ -0,0 +1,3 @@ +error | semantic | 34 | 3 | 193 | SourceDiagnostics::worker.impl has no complete state : Behavior Annex D.3.(L3) legality rule failed. +error | semantic | 35 | 34 | 1 | type error for 'behavior variable initializer', 'Base_Types::Boolean' expected, found 'universal integer'. +error | semantic | 41 | 31 | 7 | Behavior variable 'counter' may be read before it is initialized diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba_examples_standard_examples_ba_example_007.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba_examples_standard_examples_ba_example_007.txt index 6e7a05aa949..ad66cdbba10 100644 --- a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba_examples_standard_examples_ba_example_007.txt +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba_examples_standard_examples_ba_example_007.txt @@ -1,7 +1,7 @@ error | linking | 11 | 6 | 19 | Couldn't resolve reference to ModelUnit 'Behavior_Properties'. -error | linking | 65 | 56 | 4 | Couldn't resolve reference to Property Constant, Property Definition, Enumeration or Unit literal 'LSER'. For classifier references use classifier( ). -error | linking | 65 | 7 | 45 | Couldn't resolve reference to property definition 'Behavior_Properties::Subprogram_Call_Protocol'. -error | linking | 67 | 56 | 4 | Couldn't resolve reference to Property Constant, Property Definition, Enumeration or Unit literal 'HSER'. For classifier references use classifier( ). +error | linking | 67 | 56 | 4 | Couldn't resolve reference to Property Constant, Property Definition, Enumeration or Unit literal 'LSER'. For classifier references use classifier( ). error | linking | 67 | 7 | 45 | Couldn't resolve reference to property definition 'Behavior_Properties::Subprogram_Call_Protocol'. -error | semantic | 54 | 12 | 1 | Behavior variable 'x' may be read before it is initialized -error | semantic | 92 | 27 | 1 | Behavior variable 'v' may be read before it is initialized +error | linking | 69 | 56 | 4 | Couldn't resolve reference to Property Constant, Property Definition, Enumeration or Unit literal 'HSER'. For classifier references use classifier( ). +error | linking | 69 | 7 | 45 | Couldn't resolve reference to property definition 'Behavior_Properties::Subprogram_Call_Protocol'. +error | semantic | 56 | 12 | 1 | Behavior variable 'x' may be read before it is initialized +error | semantic | 95 | 27 | 1 | Behavior variable 'v' may be read before it is initialized diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3199_ArrayTypes.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3199_ArrayTypes.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3199_CommunicationTypes.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3199_CommunicationTypes.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3199_ConformingTypes.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3199_ConformingTypes.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3199_Issue3199.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3199_Issue3199.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3199_NumericTypes.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3199_NumericTypes.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3199_SourceDiagnostics.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3199_SourceDiagnostics.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba_examples_standard_examples_ba_example_007.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba_examples_standard_examples_ba_example_007.txt index 0269efa9516..8362df511a3 100644 --- a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba_examples_standard_examples_ba_example_007.txt +++ b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba_examples_standard_examples_ba_example_007.txt @@ -1,5 +1,5 @@ error | linking | 11 | 6 | 19 | Couldn't resolve reference to ModelUnit 'Behavior_Properties'. -error | linking | 65 | 56 | 4 | Couldn't resolve reference to Property Constant, Property Definition, Enumeration or Unit literal 'LSER'. For classifier references use classifier( ). -error | linking | 65 | 7 | 45 | Couldn't resolve reference to property definition 'Behavior_Properties::Subprogram_Call_Protocol'. -error | linking | 67 | 56 | 4 | Couldn't resolve reference to Property Constant, Property Definition, Enumeration or Unit literal 'HSER'. For classifier references use classifier( ). +error | linking | 67 | 56 | 4 | Couldn't resolve reference to Property Constant, Property Definition, Enumeration or Unit literal 'LSER'. For classifier references use classifier( ). error | linking | 67 | 7 | 45 | Couldn't resolve reference to property definition 'Behavior_Properties::Subprogram_Call_Protocol'. +error | linking | 69 | 56 | 4 | Couldn't resolve reference to Property Constant, Property Definition, Enumeration or Unit literal 'HSER'. For classifier references use classifier( ). +error | linking | 69 | 7 | 45 | Couldn't resolve reference to property definition 'Behavior_Properties::Subprogram_Call_Protocol'. diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_characterization_GrammarHazards.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_characterization_GrammarHazards.txt index f8d522c4a64..f6e62b75caa 100644 --- a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_characterization_GrammarHazards.txt +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_characterization_GrammarHazards.txt @@ -1,248 +1,248 @@ annex[0] owner=Issue2445_Grammar_Hazards::hazards - (AssignmentAction, , 1218, 15) - (AssignmentAction, , 1239, 18) - (AssignmentAction, , 1263, 24) - (AssignmentAction, , 1336, 19) - (AssignmentAction, , 1361, 15) - (AssignmentAction, , 1382, 18) - (AssignmentAction, , 1406, 24) - (AssignmentAction, , 1436, 24) - (AssignmentAction, , 1756, 10) - (AssignmentAction, , 1794, 10) - (AssignmentAction, , 1819, 10) - (AssignmentAction, , 1893, 18) - (AssignmentAction, , 1973, 18) - (AssignmentAction, , 2029, 18) - (AssignmentAction, , 2067, 18) - (BehaviorActionBlock, , 1212, 80) - (BehaviorActionBlock, , 1330, 135) - (BehaviorActionBlock, , 1528, 75) - (BehaviorActionBlock, , 1640, 53) - (BehaviorActionBlock, , 1730, 382) - (BehaviorActionBlock, , 2136, 60) - (BehaviorActionSequence, , 1218, 69) - (BehaviorActionSequence, , 1336, 124) - (BehaviorActionSequence, , 1534, 64) - (BehaviorActionSequence, , 1646, 42) - (BehaviorActionSequence, , 1736, 371) - (BehaviorAnnex, BeHaViOr_SpEcIfIcAtIoN, 932, 1314) - (BehaviorCondition, , 1191, 9) - (BehaviorCondition, , 1308, 9) - (BehaviorCondition, , 1480, 36) - (BehaviorCondition, , 1618, 10) - (BehaviorCondition, , 1708, 10) - (BehaviorCondition, , 2208, 26) - (BehaviorIntegerLiteral, , 1053, 1) - (BehaviorIntegerLiteral, , 1199, 1) - (BehaviorIntegerLiteral, , 1227, 6) - (BehaviorIntegerLiteral, , 1248, 9) - (BehaviorIntegerLiteral, , 1316, 1) - (BehaviorIntegerLiteral, , 1354, 1) - (BehaviorIntegerLiteral, , 1515, 1) - (BehaviorIntegerLiteral, , 1627, 1) - (BehaviorIntegerLiteral, , 1716, 2) - (BehaviorIntegerLiteral, , 1748, 1) - (BehaviorIntegerLiteral, , 1765, 1) - (BehaviorIntegerLiteral, , 1786, 1) - (BehaviorIntegerLiteral, , 1803, 1) - (BehaviorIntegerLiteral, , 1828, 1) - (BehaviorIntegerLiteral, , 1878, 1) - (BehaviorIntegerLiteral, , 1883, 1) - (BehaviorIntegerLiteral, , 1958, 1) - (BehaviorIntegerLiteral, , 1963, 1) - (BehaviorIntegerLiteral, , 2018, 2) - (BehaviorIntegerLiteral, , 2046, 1) - (BehaviorIntegerLiteral, , 2084, 1) - (BehaviorIntegerLiteral, , 2105, 1) - (BehaviorIntegerLiteral, , 2154, 1) - (BehaviorIntegerLiteral, , 2162, 1) - (BehaviorIntegerLiteral, , 970, 1) - (BehaviorPropertyAssociation, , 978, 35) - (BehaviorState, done, 1112, 4) - (BehaviorState, execute, 1093, 7) - (BehaviorState, start, 1068, 5) - (BehaviorStateGroup, , 1068, 21) - (BehaviorStateGroup, , 1093, 15) - (BehaviorStateGroup, , 1112, 27) - (BehaviorTime, , 2154, 4) - (BehaviorTime, , 2162, 4) - (BehaviorTransition, , 1157, 20) - (BehaviorTransition, , 1181, 112) - (BehaviorTransition, , 1297, 169) - (BehaviorTransition, , 1470, 134) - (BehaviorTransition, , 1608, 86) - (BehaviorTransition, , 1698, 415) - (BehaviorTransition, , 2117, 80) - (BehaviorTransition, , 2201, 45) - (BehaviorVariable, Other, 1023, 5) - (BehaviorVariable, Value, 945, 5) - (BehaviorVariableGroup, , 1023, 32) - (BehaviorVariableGroup, , 945, 74) - (BinaryExpression, , 1191, 9) - (BinaryExpression, , 1308, 9) - (BinaryExpression, , 1345, 10) - (BinaryExpression, , 1415, 15) - (BinaryExpression, , 1445, 15) - (BinaryExpression, , 1480, 36) - (BinaryExpression, , 1501, 15) - (BinaryExpression, , 1618, 10) - (BinaryExpression, , 1708, 10) - (BinaryExpression, , 1740, 9) - (BinaryExpression, , 1778, 9) - (BinaryExpression, , 1902, 9) - (BinaryExpression, , 1982, 9) - (BinaryExpression, , 2010, 10) - (BinaryExpression, , 2038, 9) - (BinaryExpression, , 2076, 9) - (BinaryExpression, , 2097, 9) - (CommunicationAction, , 1534, 7) - (CommunicationAction, , 1547, 15) - (CommunicationAction, , 1568, 8) - (CommunicationAction, , 1582, 16) + (AssignmentAction, , 1203, 15) + (AssignmentAction, , 1224, 18) + (AssignmentAction, , 1248, 24) + (AssignmentAction, , 1321, 19) + (AssignmentAction, , 1346, 15) + (AssignmentAction, , 1367, 18) + (AssignmentAction, , 1391, 24) + (AssignmentAction, , 1421, 24) + (AssignmentAction, , 1741, 10) + (AssignmentAction, , 1779, 10) + (AssignmentAction, , 1804, 10) + (AssignmentAction, , 1873, 18) + (AssignmentAction, , 1948, 18) + (AssignmentAction, , 2004, 18) + (AssignmentAction, , 2042, 18) + (BehaviorActionBlock, , 1197, 80) + (BehaviorActionBlock, , 1315, 135) + (BehaviorActionBlock, , 1513, 75) + (BehaviorActionBlock, , 1625, 53) + (BehaviorActionBlock, , 1715, 372) + (BehaviorActionBlock, , 2111, 60) + (BehaviorActionSequence, , 1203, 69) + (BehaviorActionSequence, , 1321, 124) + (BehaviorActionSequence, , 1519, 64) + (BehaviorActionSequence, , 1631, 42) + (BehaviorActionSequence, , 1721, 361) + (BehaviorAnnex, BeHaViOr_SpEcIfIcAtIoN, 922, 1299) + (BehaviorCondition, , 1176, 9) + (BehaviorCondition, , 1293, 9) + (BehaviorCondition, , 1465, 36) + (BehaviorCondition, , 1603, 10) + (BehaviorCondition, , 1693, 10) + (BehaviorCondition, , 2183, 26) + (BehaviorIntegerLiteral, , 1038, 1) + (BehaviorIntegerLiteral, , 1184, 1) + (BehaviorIntegerLiteral, , 1212, 6) + (BehaviorIntegerLiteral, , 1233, 9) + (BehaviorIntegerLiteral, , 1301, 1) + (BehaviorIntegerLiteral, , 1339, 1) + (BehaviorIntegerLiteral, , 1500, 1) + (BehaviorIntegerLiteral, , 1612, 1) + (BehaviorIntegerLiteral, , 1701, 2) + (BehaviorIntegerLiteral, , 1733, 1) + (BehaviorIntegerLiteral, , 1750, 1) + (BehaviorIntegerLiteral, , 1771, 1) + (BehaviorIntegerLiteral, , 1788, 1) + (BehaviorIntegerLiteral, , 1813, 1) + (BehaviorIntegerLiteral, , 1858, 1) + (BehaviorIntegerLiteral, , 1863, 1) + (BehaviorIntegerLiteral, , 1933, 1) + (BehaviorIntegerLiteral, , 1938, 1) + (BehaviorIntegerLiteral, , 1993, 2) + (BehaviorIntegerLiteral, , 2021, 1) + (BehaviorIntegerLiteral, , 2059, 1) + (BehaviorIntegerLiteral, , 2080, 1) + (BehaviorIntegerLiteral, , 2129, 1) + (BehaviorIntegerLiteral, , 2137, 1) + (BehaviorIntegerLiteral, , 960, 1) + (BehaviorPropertyAssociation, , 968, 35) + (BehaviorState, done, 1097, 4) + (BehaviorState, execute, 1078, 7) + (BehaviorState, start, 1053, 5) + (BehaviorStateGroup, , 1053, 21) + (BehaviorStateGroup, , 1078, 15) + (BehaviorStateGroup, , 1097, 27) + (BehaviorTime, , 2129, 4) + (BehaviorTime, , 2137, 4) + (BehaviorTransition, , 1142, 20) + (BehaviorTransition, , 1166, 112) + (BehaviorTransition, , 1282, 169) + (BehaviorTransition, , 1455, 134) + (BehaviorTransition, , 1593, 86) + (BehaviorTransition, , 1683, 405) + (BehaviorTransition, , 2092, 80) + (BehaviorTransition, , 2176, 45) + (BehaviorVariable, Other, 1013, 5) + (BehaviorVariable, Value, 935, 5) + (BehaviorVariableGroup, , 1013, 27) + (BehaviorVariableGroup, , 935, 74) + (BinaryExpression, , 1176, 9) + (BinaryExpression, , 1293, 9) + (BinaryExpression, , 1330, 10) + (BinaryExpression, , 1400, 15) + (BinaryExpression, , 1430, 15) + (BinaryExpression, , 1465, 36) + (BinaryExpression, , 1486, 15) + (BinaryExpression, , 1603, 10) + (BinaryExpression, , 1693, 10) + (BinaryExpression, , 1725, 9) + (BinaryExpression, , 1763, 9) + (BinaryExpression, , 1882, 9) + (BinaryExpression, , 1957, 9) + (BinaryExpression, , 1985, 10) + (BinaryExpression, , 2013, 9) + (BinaryExpression, , 2051, 9) + (BinaryExpression, , 2072, 9) + (CommunicationAction, , 1519, 7) + (CommunicationAction, , 1532, 15) + (CommunicationAction, , 1553, 8) + (CommunicationAction, , 1567, 16) + (CommunicationAction, , 1631, 9) (CommunicationAction, , 1646, 9) - (CommunicationAction, , 1661, 9) - (CommunicationAction, , 1676, 3) - (CommunicationAction, , 1685, 3) - (DispatchCondition, , 2211, 23) - (DispatchConjunction, , 2220, 14) - (DispatchTriggerCondition, , 2220, 14) - (DispatchTriggerLogicalExpression, , 2220, 14) - (DoUntilStatement, , 2059, 48) - (ElementValues, , 1878, 6) - (ElementValues, , 1958, 6) - (ElseIfClause, , 1771, 33) - (ExecuteCondition, , 1191, 9) - (ExecuteCondition, , 1308, 9) - (ExecuteCondition, , 1480, 36) - (ExecuteCondition, , 1618, 10) - (ExecuteCondition, , 1708, 10) - (ForStatement, , 1846, 71) - (ForStatement, , 1923, 74) - (HashPropertyReference, , 1272, 15) - (IfStatement, , 1736, 104) - (ListValue, , 1007, 5) - (ParenthesizedExpression, , 1484, 13) - (Reference, , 1191, 5) - (Reference, , 1218, 5) - (Reference, , 1239, 5) - (Reference, , 1263, 5) - (Reference, , 1308, 5) - (Reference, , 1336, 5) - (Reference, , 1345, 5) - (Reference, , 1361, 5) - (Reference, , 1371, 5) - (Reference, , 1382, 5) - (Reference, , 1395, 5) - (Reference, , 1406, 5) - (Reference, , 1415, 5) - (Reference, , 1425, 5) - (Reference, , 1436, 5) - (Reference, , 1445, 5) - (Reference, , 1455, 5) - (Reference, , 1485, 5) - (Reference, , 1501, 5) - (Reference, , 1534, 5) - (Reference, , 1547, 5) - (Reference, , 1556, 5) - (Reference, , 1568, 5) - (Reference, , 1582, 6) - (Reference, , 1592, 5) - (Reference, , 1618, 5) + (CommunicationAction, , 1661, 3) + (CommunicationAction, , 1670, 3) + (DispatchCondition, , 2186, 23) + (DispatchConjunction, , 2195, 14) + (DispatchTriggerCondition, , 2195, 14) + (DispatchTriggerLogicalExpression, , 2195, 14) + (DoUntilStatement, , 2034, 48) + (ElementValues, , 1858, 6) + (ElementValues, , 1933, 6) + (ElseIfClause, , 1756, 33) + (ExecuteCondition, , 1176, 9) + (ExecuteCondition, , 1293, 9) + (ExecuteCondition, , 1465, 36) + (ExecuteCondition, , 1603, 10) + (ExecuteCondition, , 1693, 10) + (ForStatement, , 1831, 66) + (ForStatement, , 1903, 69) + (HashPropertyReference, , 1257, 15) + (IfStatement, , 1721, 104) + (ListValue, , 997, 5) + (ParenthesizedExpression, , 1469, 13) + (Reference, , 1176, 5) + (Reference, , 1203, 5) + (Reference, , 1224, 5) + (Reference, , 1248, 5) + (Reference, , 1293, 5) + (Reference, , 1321, 5) + (Reference, , 1330, 5) + (Reference, , 1346, 5) + (Reference, , 1356, 5) + (Reference, , 1367, 5) + (Reference, , 1380, 5) + (Reference, , 1391, 5) + (Reference, , 1400, 5) + (Reference, , 1410, 5) + (Reference, , 1421, 5) + (Reference, , 1430, 5) + (Reference, , 1440, 5) + (Reference, , 1470, 5) + (Reference, , 1486, 5) + (Reference, , 1519, 5) + (Reference, , 1532, 5) + (Reference, , 1541, 5) + (Reference, , 1553, 5) + (Reference, , 1567, 6) + (Reference, , 1577, 5) + (Reference, , 1603, 5) + (Reference, , 1631, 6) (Reference, , 1646, 6) - (Reference, , 1661, 6) - (Reference, , 1708, 5) - (Reference, , 1740, 5) - (Reference, , 1756, 5) - (Reference, , 1778, 5) - (Reference, , 1794, 5) - (Reference, , 1819, 5) - (Reference, , 1893, 5) - (Reference, , 1902, 5) - (Reference, , 1910, 1) - (Reference, , 1973, 5) - (Reference, , 1982, 5) - (Reference, , 1990, 1) - (Reference, , 2010, 5) - (Reference, , 2029, 5) - (Reference, , 2038, 5) - (Reference, , 2067, 5) - (Reference, , 2076, 5) - (Reference, , 2097, 5) - (Reference, , 2220, 14) - (ReferenceExpression, , 1191, 5) - (ReferenceExpression, , 1308, 5) - (ReferenceExpression, , 1345, 5) - (ReferenceExpression, , 1371, 5) - (ReferenceExpression, , 1395, 5) - (ReferenceExpression, , 1415, 5) - (ReferenceExpression, , 1425, 5) - (ReferenceExpression, , 1445, 5) - (ReferenceExpression, , 1455, 5) - (ReferenceExpression, , 1485, 11) - (ReferenceExpression, , 1501, 11) - (ReferenceExpression, , 1592, 5) - (ReferenceExpression, , 1618, 5) - (ReferenceExpression, , 1708, 5) - (ReferenceExpression, , 1740, 5) - (ReferenceExpression, , 1778, 5) - (ReferenceExpression, , 1902, 5) - (ReferenceExpression, , 1910, 1) - (ReferenceExpression, , 1982, 5) - (ReferenceExpression, , 1990, 1) - (ReferenceExpression, , 2010, 5) - (ReferenceExpression, , 2038, 5) - (ReferenceExpression, , 2076, 5) - (ReferenceExpression, , 2097, 5) - (ReferenceSegment, Other, 1345, 5) - (ReferenceSegment, Other, 1425, 5) - (ReferenceSegment, Other, 1455, 5) - (ReferenceSegment, Value, 1218, 5) - (ReferenceSegment, Value, 1239, 5) - (ReferenceSegment, Value, 1263, 5) - (ReferenceSegment, Value, 1308, 5) - (ReferenceSegment, Value, 1336, 5) - (ReferenceSegment, Value, 1361, 5) - (ReferenceSegment, Value, 1371, 5) - (ReferenceSegment, Value, 1382, 5) - (ReferenceSegment, Value, 1395, 5) - (ReferenceSegment, Value, 1406, 5) - (ReferenceSegment, Value, 1415, 5) - (ReferenceSegment, Value, 1436, 5) - (ReferenceSegment, Value, 1445, 5) - (ReferenceSegment, Value, 1556, 5) - (ReferenceSegment, Value, 1592, 5) - (ReferenceSegment, Value, 1618, 5) - (ReferenceSegment, Value, 1708, 5) - (ReferenceSegment, Value, 1740, 5) - (ReferenceSegment, Value, 1756, 5) - (ReferenceSegment, Value, 1778, 5) - (ReferenceSegment, Value, 1794, 5) - (ReferenceSegment, Value, 1819, 5) - (ReferenceSegment, Value, 1893, 5) - (ReferenceSegment, Value, 1902, 5) - (ReferenceSegment, Value, 1973, 5) - (ReferenceSegment, Value, 1982, 5) - (ReferenceSegment, Value, 2010, 5) - (ReferenceSegment, Value, 2029, 5) - (ReferenceSegment, Value, 2038, 5) - (ReferenceSegment, Value, 2067, 5) - (ReferenceSegment, Value, 2076, 5) - (ReferenceSegment, Value, 2097, 5) - (ReferenceSegment, dispatch_event, 2220, 14) - (ReferenceSegment, i, 1910, 1) - (ReferenceSegment, input, 1485, 5) - (ReferenceSegment, input, 1501, 5) - (ReferenceSegment, input, 1534, 5) - (ReferenceSegment, input, 1547, 5) - (ReferenceSegment, input, 1568, 5) - (ReferenceSegment, j, 1990, 1) - (ReferenceSegment, output, 1582, 6) + (Reference, , 1693, 5) + (Reference, , 1725, 5) + (Reference, , 1741, 5) + (Reference, , 1763, 5) + (Reference, , 1779, 5) + (Reference, , 1804, 5) + (Reference, , 1873, 5) + (Reference, , 1882, 5) + (Reference, , 1890, 1) + (Reference, , 1948, 5) + (Reference, , 1957, 5) + (Reference, , 1965, 1) + (Reference, , 1985, 5) + (Reference, , 2004, 5) + (Reference, , 2013, 5) + (Reference, , 2042, 5) + (Reference, , 2051, 5) + (Reference, , 2072, 5) + (Reference, , 2195, 14) + (ReferenceExpression, , 1176, 5) + (ReferenceExpression, , 1293, 5) + (ReferenceExpression, , 1330, 5) + (ReferenceExpression, , 1356, 5) + (ReferenceExpression, , 1380, 5) + (ReferenceExpression, , 1400, 5) + (ReferenceExpression, , 1410, 5) + (ReferenceExpression, , 1430, 5) + (ReferenceExpression, , 1440, 5) + (ReferenceExpression, , 1470, 11) + (ReferenceExpression, , 1486, 11) + (ReferenceExpression, , 1577, 5) + (ReferenceExpression, , 1603, 5) + (ReferenceExpression, , 1693, 5) + (ReferenceExpression, , 1725, 5) + (ReferenceExpression, , 1763, 5) + (ReferenceExpression, , 1882, 5) + (ReferenceExpression, , 1890, 1) + (ReferenceExpression, , 1957, 5) + (ReferenceExpression, , 1965, 1) + (ReferenceExpression, , 1985, 5) + (ReferenceExpression, , 2013, 5) + (ReferenceExpression, , 2051, 5) + (ReferenceExpression, , 2072, 5) + (ReferenceSegment, Other, 1330, 5) + (ReferenceSegment, Other, 1410, 5) + (ReferenceSegment, Other, 1440, 5) + (ReferenceSegment, Value, 1203, 5) + (ReferenceSegment, Value, 1224, 5) + (ReferenceSegment, Value, 1248, 5) + (ReferenceSegment, Value, 1293, 5) + (ReferenceSegment, Value, 1321, 5) + (ReferenceSegment, Value, 1346, 5) + (ReferenceSegment, Value, 1356, 5) + (ReferenceSegment, Value, 1367, 5) + (ReferenceSegment, Value, 1380, 5) + (ReferenceSegment, Value, 1391, 5) + (ReferenceSegment, Value, 1400, 5) + (ReferenceSegment, Value, 1421, 5) + (ReferenceSegment, Value, 1430, 5) + (ReferenceSegment, Value, 1541, 5) + (ReferenceSegment, Value, 1577, 5) + (ReferenceSegment, Value, 1603, 5) + (ReferenceSegment, Value, 1693, 5) + (ReferenceSegment, Value, 1725, 5) + (ReferenceSegment, Value, 1741, 5) + (ReferenceSegment, Value, 1763, 5) + (ReferenceSegment, Value, 1779, 5) + (ReferenceSegment, Value, 1804, 5) + (ReferenceSegment, Value, 1873, 5) + (ReferenceSegment, Value, 1882, 5) + (ReferenceSegment, Value, 1948, 5) + (ReferenceSegment, Value, 1957, 5) + (ReferenceSegment, Value, 1985, 5) + (ReferenceSegment, Value, 2004, 5) + (ReferenceSegment, Value, 2013, 5) + (ReferenceSegment, Value, 2042, 5) + (ReferenceSegment, Value, 2051, 5) + (ReferenceSegment, Value, 2072, 5) + (ReferenceSegment, dispatch_event, 2195, 14) + (ReferenceSegment, i, 1890, 1) + (ReferenceSegment, input, 1470, 5) + (ReferenceSegment, input, 1486, 5) + (ReferenceSegment, input, 1519, 5) + (ReferenceSegment, input, 1532, 5) + (ReferenceSegment, input, 1553, 5) + (ReferenceSegment, j, 1965, 1) + (ReferenceSegment, output, 1567, 6) + (ReferenceSegment, shared, 1631, 6) (ReferenceSegment, shared, 1646, 6) - (ReferenceSegment, shared, 1661, 6) - (ReferenceSegment, vAlUe, 1191, 5) - (StringLiteral, , 1008, 3) - (TimedAction, , 2142, 49) - (UnaryExpression, , 1370, 6) - (UnaryExpression, , 1391, 9) - (UnaryExpression, , 1480, 17) - (WhileStatement, , 2003, 50) + (ReferenceSegment, vAlUe, 1176, 5) + (StringLiteral, , 998, 3) + (TimedAction, , 2117, 49) + (UnaryExpression, , 1355, 6) + (UnaryExpression, , 1376, 9) + (UnaryExpression, , 1465, 17) + (WhileStatement, , 1978, 50) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3169_InvalidShortCircuitOperands.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3169_InvalidShortCircuitOperands.txt index facb47f3a32..8779fdfb5ca 100644 --- a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3169_InvalidShortCircuitOperands.txt +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3169_InvalidShortCircuitOperands.txt @@ -1,29 +1,30 @@ annex[0] owner=InvalidShortCircuitOperands::operation - (BehaviorAnnex, behavior_specification, 1861, 246) - (BehaviorCondition, , 2013, 19) - (BehaviorCondition, , 2077, 18) - (BehaviorState, finish, 1945, 6) - (BehaviorState, start, 1920, 5) - (BehaviorStateGroup, , 1920, 21) - (BehaviorStateGroup, , 1945, 20) - (BehaviorTransition, and_then_transition, 1983, 61) - (BehaviorTransition, or_else_transition, 2048, 59) + (BehaviorAnnex, behavior_specification, 1861, 251) + (BehaviorCondition, , 2018, 19) + (BehaviorCondition, , 2082, 18) + (BehaviorIntegerLiteral, , 1910, 1) + (BehaviorState, finish, 1950, 6) + (BehaviorState, start, 1925, 5) + (BehaviorStateGroup, , 1925, 21) + (BehaviorStateGroup, , 1950, 20) + (BehaviorTransition, and_then_transition, 1988, 61) + (BehaviorTransition, or_else_transition, 2053, 59) (BehaviorVariable, left, 1874, 4) (BehaviorVariable, right, 1880, 5) - (BehaviorVariableGroup, , 1874, 33) - (BinaryExpression, , 2013, 19) - (BinaryExpression, , 2077, 18) - (ExecuteCondition, , 2013, 19) - (ExecuteCondition, , 2077, 18) - (Reference, , 2013, 4) - (Reference, , 2027, 5) - (Reference, , 2077, 4) - (Reference, , 2090, 5) - (ReferenceExpression, , 2013, 4) - (ReferenceExpression, , 2027, 5) - (ReferenceExpression, , 2077, 4) - (ReferenceExpression, , 2090, 5) - (ReferenceSegment, left, 2013, 4) - (ReferenceSegment, left, 2077, 4) - (ReferenceSegment, right, 2027, 5) - (ReferenceSegment, right, 2090, 5) + (BehaviorVariableGroup, , 1874, 38) + (BinaryExpression, , 2018, 19) + (BinaryExpression, , 2082, 18) + (ExecuteCondition, , 2018, 19) + (ExecuteCondition, , 2082, 18) + (Reference, , 2018, 4) + (Reference, , 2032, 5) + (Reference, , 2082, 4) + (Reference, , 2095, 5) + (ReferenceExpression, , 2018, 4) + (ReferenceExpression, , 2032, 5) + (ReferenceExpression, , 2082, 4) + (ReferenceExpression, , 2095, 5) + (ReferenceSegment, left, 2018, 4) + (ReferenceSegment, left, 2082, 4) + (ReferenceSegment, right, 2032, 5) + (ReferenceSegment, right, 2095, 5) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_ArrayTypes.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_ArrayTypes.txt new file mode 100644 index 00000000000..b4478828878 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_ArrayTypes.txt @@ -0,0 +1,42 @@ +annex[0] owner=ArrayTypes::mismatch.impl + (ArrayDimension, , 1921, 3) + (ArrayDimension, , 1938, 3) + (ArrayDimension, , 1949, 3) + (ArrayDimension, , 1952, 3) + (AssignmentAction, , 2082, 19) + (AssignmentAction, , 2103, 28) + (AssignmentAction, , 2164, 13) + (AssignmentAction, , 2179, 22) + (BehaviorActionBlock, , 2080, 53) + (BehaviorActionBlock, , 2162, 41) + (BehaviorActionSequence, , 2082, 49) + (BehaviorActionSequence, , 2164, 37) + (BehaviorAnnex, behavior_specification, 1896, 308) + (BehaviorIntegerLiteral, , 1922, 1) + (BehaviorIntegerLiteral, , 1939, 1) + (BehaviorIntegerLiteral, , 1950, 1) + (BehaviorIntegerLiteral, , 1953, 1) + (BehaviorState, done, 2017, 4) + (BehaviorState, start, 1991, 5) + (BehaviorStateGroup, , 1991, 22) + (BehaviorStateGroup, , 2017, 19) + (BehaviorTransition, extent, 2054, 80) + (BehaviorTransition, rank, 2138, 66) + (BehaviorVariable, larger_array, 1926, 15) + (BehaviorVariable, matrix, 1943, 12) + (BehaviorVariable, target_array, 1909, 15) + (BehaviorVariableGroup, , 1909, 69) + (Reference, , 2082, 12) + (Reference, , 2103, 12) + (Reference, , 2119, 12) + (Reference, , 2164, 6) + (Reference, , 2179, 12) + (Reference, , 2195, 6) + (ReferenceExpression, , 2119, 12) + (ReferenceExpression, , 2195, 6) + (ReferenceSegment, larger_array, 2082, 12) + (ReferenceSegment, larger_array, 2119, 12) + (ReferenceSegment, matrix, 2164, 6) + (ReferenceSegment, matrix, 2195, 6) + (ReferenceSegment, target_array, 2103, 12) + (ReferenceSegment, target_array, 2179, 12) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt new file mode 100644 index 00000000000..d5c62cefcf4 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt @@ -0,0 +1,98 @@ +annex[0] owner=ClassifierIdentity::mismatch.impl + (AssignmentAction, , 2599, 13) + (AssignmentAction, , 2614, 15) + (AssignmentAction, , 2667, 12) + (AssignmentAction, , 2681, 14) + (AssignmentAction, , 2743, 21) + (AssignmentAction, , 2766, 23) + (AssignmentAction, , 2827, 12) + (AssignmentAction, , 2841, 14) + (AssignmentAction, , 2896, 34) + (AssignmentAction, , 2972, 34) + (AssignmentAction, , 3052, 33) + (BehaviorActionBlock, , 2597, 34) + (BehaviorActionBlock, , 2665, 32) + (BehaviorActionBlock, , 2741, 50) + (BehaviorActionBlock, , 2825, 32) + (BehaviorActionBlock, , 2894, 38) + (BehaviorActionBlock, , 2970, 38) + (BehaviorActionBlock, , 3050, 37) + (BehaviorActionSequence, , 2599, 30) + (BehaviorActionSequence, , 2667, 28) + (BehaviorActionSequence, , 2743, 46) + (BehaviorActionSequence, , 2827, 28) + (BehaviorAnnex, behavior_specification, 2289, 799) + (BehaviorBooleanLiteral, , 2440, 4) + (BehaviorBooleanLiteral, , 2481, 4) + (BehaviorBooleanLiteral, , 2910, 4) + (BehaviorBooleanLiteral, , 3001, 5) + (BehaviorBooleanLiteral, , 3066, 4) + (BehaviorState, done, 2525, 4) + (BehaviorState, start, 2499, 5) + (BehaviorStateGroup, , 2499, 22) + (BehaviorStateGroup, , 2525, 19) + (BehaviorTransition, different_names, 2562, 70) + (BehaviorTransition, extension, 2636, 62) + (BehaviorTransition, identical, 2796, 62) + (BehaviorTransition, identical_boolean, 3013, 75) + (BehaviorTransition, literal_left, 2862, 71) + (BehaviorTransition, literal_right, 2937, 72) + (BehaviorTransition, type_implementation, 2702, 90) + (BehaviorVariable, child, 2350, 5) + (BehaviorVariable, first, 2302, 5) + (BehaviorVariable, first_flag, 2410, 10) + (BehaviorVariable, implementation, 2373, 14) + (BehaviorVariable, second, 2325, 6) + (BehaviorVariable, second_flag, 2449, 11) + (BehaviorVariableGroup, , 2302, 19) + (BehaviorVariableGroup, , 2325, 21) + (BehaviorVariableGroup, , 2350, 19) + (BehaviorVariableGroup, , 2373, 33) + (BehaviorVariableGroup, , 2410, 35) + (BehaviorVariableGroup, , 2449, 37) + (BinaryExpression, , 2910, 20) + (BinaryExpression, , 2986, 20) + (BinaryExpression, , 3066, 19) + (Reference, , 2599, 6) + (Reference, , 2614, 5) + (Reference, , 2623, 6) + (Reference, , 2667, 5) + (Reference, , 2681, 5) + (Reference, , 2690, 5) + (Reference, , 2743, 14) + (Reference, , 2766, 5) + (Reference, , 2775, 14) + (Reference, , 2827, 5) + (Reference, , 2841, 5) + (Reference, , 2850, 5) + (Reference, , 2896, 10) + (Reference, , 2919, 11) + (Reference, , 2972, 10) + (Reference, , 2986, 11) + (Reference, , 3052, 10) + (Reference, , 3075, 10) + (ReferenceExpression, , 2623, 6) + (ReferenceExpression, , 2690, 5) + (ReferenceExpression, , 2775, 14) + (ReferenceExpression, , 2850, 5) + (ReferenceExpression, , 2919, 11) + (ReferenceExpression, , 2986, 11) + (ReferenceExpression, , 3075, 10) + (ReferenceSegment, child, 2667, 5) + (ReferenceSegment, child, 2690, 5) + (ReferenceSegment, first, 2614, 5) + (ReferenceSegment, first, 2681, 5) + (ReferenceSegment, first, 2766, 5) + (ReferenceSegment, first, 2827, 5) + (ReferenceSegment, first, 2841, 5) + (ReferenceSegment, first, 2850, 5) + (ReferenceSegment, first_flag, 2896, 10) + (ReferenceSegment, first_flag, 2972, 10) + (ReferenceSegment, first_flag, 3052, 10) + (ReferenceSegment, first_flag, 3075, 10) + (ReferenceSegment, implementation, 2743, 14) + (ReferenceSegment, implementation, 2775, 14) + (ReferenceSegment, second, 2599, 6) + (ReferenceSegment, second, 2623, 6) + (ReferenceSegment, second_flag, 2919, 11) + (ReferenceSegment, second_flag, 2986, 11) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_CommunicationTypes.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_CommunicationTypes.txt new file mode 100644 index 00000000000..afbb06e30a5 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_CommunicationTypes.txt @@ -0,0 +1,33 @@ +annex[0] owner=CommunicationTypes::host.impl + (BehaviorActionBlock, , 2309, 19) + (BehaviorActionBlock, , 2357, 32) + (BehaviorActionBlock, , 2427, 24) + (BehaviorAnnex, behavior_specification, 2158, 294) + (BehaviorIntegerLiteral, , 2204, 1) + (BehaviorState, done, 2245, 4) + (BehaviorState, start, 2219, 5) + (BehaviorStateGroup, , 2219, 22) + (BehaviorStateGroup, , 2245, 19) + (BehaviorStringLiteral, , 2442, 6) + (BehaviorTransition, call, 2333, 57) + (BehaviorTransition, dequeue, 2282, 47) + (BehaviorTransition, internal_send, 2394, 58) + (BehaviorVariable, counter, 2171, 7) + (BehaviorVariableGroup, , 2171, 35) + (CommunicationAction, , 2311, 15) + (CommunicationAction, , 2359, 28) + (CommunicationAction, , 2429, 20) + (Reference, , 2311, 5) + (Reference, , 2318, 7) + (Reference, , 2359, 9) + (Reference, , 2370, 7) + (Reference, , 2379, 7) + (Reference, , 2429, 11) + (ReferenceExpression, , 2370, 7) + (ReferenceExpression, , 2379, 7) + (ReferenceSegment, counter, 2318, 7) + (ReferenceSegment, counter, 2370, 7) + (ReferenceSegment, counter, 2379, 7) + (ReferenceSegment, input, 2311, 5) + (ReferenceSegment, operation, 2359, 9) + (ReferenceSegment, raised_data, 2429, 11) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_ConformingTypes.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_ConformingTypes.txt new file mode 100644 index 00000000000..093987e26fd --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_ConformingTypes.txt @@ -0,0 +1,126 @@ +annex[0] owner=ConformingTypes::worker.impl + (ArrayDimension, , 2299, 3) + (ArrayDimension, , 2316, 3) + (ArrayDimension, , 2360, 18) + (AssignmentAction, , 2508, 24) + (AssignmentAction, , 2538, 34) + (AssignmentAction, , 2578, 22) + (AssignmentAction, , 2606, 32) + (AssignmentAction, , 2644, 32) + (AssignmentAction, , 2682, 30) + (AssignmentAction, , 2718, 49) + (AssignmentAction, , 2773, 36) + (AssignmentAction, , 2815, 19) + (AssignmentAction, , 2840, 27) + (AssignmentAction, , 2873, 29) + (AssignmentAction, , 2956, 24) + (BehaviorActionBlock, , 2502, 485) + (BehaviorActionSequence, , 2508, 474) + (BehaviorAnnex, behavior_specification, 2058, 930) + (BehaviorBooleanLiteral, , 2233, 4) + (BehaviorBooleanLiteral, , 2735, 4) + (BehaviorBooleanLiteral, , 2749, 5) + (BehaviorBooleanLiteral, , 2763, 4) + (BehaviorIntegerLiteral, , 2110, 1) + (BehaviorIntegerLiteral, , 2300, 1) + (BehaviorIntegerLiteral, , 2317, 1) + (BehaviorIntegerLiteral, , 2526, 1) + (BehaviorIntegerLiteral, , 2531, 1) + (BehaviorIntegerLiteral, , 2556, 1) + (BehaviorIntegerLiteral, , 2560, 1) + (BehaviorIntegerLiteral, , 2566, 1) + (BehaviorIntegerLiteral, , 2570, 1) + (BehaviorIntegerLiteral, , 2599, 1) + (BehaviorIntegerLiteral, , 2946, 1) + (BehaviorIntegerLiteral, , 2951, 1) + (BehaviorRealLiteral, , 2150, 3) + (BehaviorRealLiteral, , 2186, 3) + (BehaviorRealLiteral, , 2592, 3) + (BehaviorRealLiteral, , 2621, 3) + (BehaviorRealLiteral, , 2673, 3) + (BehaviorState, done, 2440, 4) + (BehaviorState, start, 2414, 5) + (BehaviorStateGroup, , 2414, 22) + (BehaviorStateGroup, , 2440, 19) + (BehaviorStringLiteral, , 2277, 6) + (BehaviorStringLiteral, , 2803, 6) + (BehaviorTransition, valid, 2477, 511) + (BehaviorVariable, boolean_value, 2194, 13) + (BehaviorVariable, first_array, 2288, 14) + (BehaviorVariable, fixed_value, 2158, 11) + (BehaviorVariable, integer_value, 2071, 13) + (BehaviorVariable, real_value, 2116, 10) + (BehaviorVariable, second_array, 2304, 15) + (BehaviorVariable, symbolic_array, 2346, 32) + (BehaviorVariable, text_value, 2242, 10) + (BehaviorVariableGroup, , 2071, 41) + (BehaviorVariableGroup, , 2116, 38) + (BehaviorVariableGroup, , 2158, 32) + (BehaviorVariableGroup, , 2194, 44) + (BehaviorVariableGroup, , 2242, 42) + (BehaviorVariableGroup, , 2288, 54) + (BehaviorVariableGroup, , 2346, 55) + (BinaryExpression, , 2526, 6) + (BinaryExpression, , 2555, 17) + (BinaryExpression, , 2556, 5) + (BinaryExpression, , 2566, 5) + (BinaryExpression, , 2592, 8) + (BinaryExpression, , 2621, 17) + (BinaryExpression, , 2659, 17) + (BinaryExpression, , 2735, 19) + (BinaryExpression, , 2735, 32) + (BinaryExpression, , 2790, 19) + (ElementValues, , 2946, 6) + (ForStatement, , 2908, 74) + (ParenthesizedExpression, , 2555, 7) + (ParenthesizedExpression, , 2565, 7) + (PropertyReferenceTail, , 2366, 11) + (Reference, , 2361, 5) + (Reference, , 2508, 13) + (Reference, , 2538, 13) + (Reference, , 2578, 10) + (Reference, , 2606, 11) + (Reference, , 2627, 11) + (Reference, , 2644, 11) + (Reference, , 2659, 11) + (Reference, , 2682, 13) + (Reference, , 2699, 5) + (Reference, , 2718, 13) + (Reference, , 2773, 13) + (Reference, , 2790, 10) + (Reference, , 2815, 12) + (Reference, , 2840, 11) + (Reference, , 2855, 12) + (Reference, , 2873, 14) + (Reference, , 2891, 11) + (Reference, , 2956, 13) + (Reference, , 2973, 7) + (ReferenceExpression, , 2361, 16) + (ReferenceExpression, , 2627, 11) + (ReferenceExpression, , 2659, 11) + (ReferenceExpression, , 2699, 13) + (ReferenceExpression, , 2790, 10) + (ReferenceExpression, , 2855, 12) + (ReferenceExpression, , 2891, 11) + (ReferenceExpression, , 2973, 7) + (ReferenceSegment, boolean_value, 2682, 13) + (ReferenceSegment, boolean_value, 2718, 13) + (ReferenceSegment, boolean_value, 2773, 13) + (ReferenceSegment, element, 2973, 7) + (ReferenceSegment, first_array, 2840, 11) + (ReferenceSegment, first_array, 2891, 11) + (ReferenceSegment, fixed_value, 2606, 11) + (ReferenceSegment, fixed_value, 2627, 11) + (ReferenceSegment, fixed_value, 2644, 11) + (ReferenceSegment, fixed_value, 2659, 11) + (ReferenceSegment, input, 2361, 5) + (ReferenceSegment, input, 2699, 5) + (ReferenceSegment, integer_value, 2508, 13) + (ReferenceSegment, integer_value, 2538, 13) + (ReferenceSegment, integer_value, 2956, 13) + (ReferenceSegment, real_value, 2578, 10) + (ReferenceSegment, second_array, 2815, 12) + (ReferenceSegment, second_array, 2855, 12) + (ReferenceSegment, symbolic_array, 2873, 14) + (ReferenceSegment, text_value, 2790, 10) + (UnaryExpression, , 2525, 7) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_Issue3199.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_Issue3199.txt new file mode 100644 index 00000000000..0f265b13664 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_Issue3199.txt @@ -0,0 +1,45 @@ +annex[0] owner=Issue3199::mismatch.impl + (AssignmentAction, , 2116, 17) + (AssignmentAction, , 2233, 21) + (AssignmentAction, , 2297, 12) + (AssignmentAction, , 2333, 12) + (BehaviorActionBlock, , 2114, 21) + (BehaviorActionBlock, , 2175, 17) + (BehaviorActionBlock, , 2231, 25) + (BehaviorActionBlock, , 2295, 59) + (BehaviorActionSequence, , 2297, 55) + (BehaviorAnnex, behavior_specification, 1958, 397) + (BehaviorIntegerLiteral, , 2187, 2) + (BehaviorIntegerLiteral, , 2244, 1) + (BehaviorIntegerLiteral, , 2308, 1) + (BehaviorIntegerLiteral, , 2344, 1) + (BehaviorState, done, 2040, 4) + (BehaviorState, start, 2014, 5) + (BehaviorStateGroup, , 2014, 22) + (BehaviorStateGroup, , 2040, 19) + (BehaviorStringLiteral, , 2127, 6) + (BehaviorStringLiteral, , 2248, 6) + (BehaviorStringLiteral, , 2325, 6) + (BehaviorTransition, assign_wrong_type, 2077, 59) + (BehaviorTransition, mixed_operands, 2197, 60) + (BehaviorTransition, mixed_relation, 2261, 94) + (BehaviorTransition, send_wrong_type, 2140, 53) + (BehaviorVariable, counter, 1971, 7) + (BehaviorVariableGroup, , 1971, 30) + (BinaryExpression, , 2244, 10) + (BinaryExpression, , 2315, 16) + (CommunicationAction, , 2177, 13) + (IfStatement, , 2311, 41) + (Reference, , 2116, 7) + (Reference, , 2177, 8) + (Reference, , 2233, 7) + (Reference, , 2297, 7) + (Reference, , 2315, 7) + (Reference, , 2333, 7) + (ReferenceExpression, , 2315, 7) + (ReferenceSegment, counter, 2116, 7) + (ReferenceSegment, counter, 2233, 7) + (ReferenceSegment, counter, 2297, 7) + (ReferenceSegment, counter, 2315, 7) + (ReferenceSegment, counter, 2333, 7) + (ReferenceSegment, out_text, 2177, 8) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_NumericTypes.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_NumericTypes.txt new file mode 100644 index 00000000000..36f7140754a --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_NumericTypes.txt @@ -0,0 +1,46 @@ +annex[0] owner=NumericTypes::mismatch.impl + (AssignmentAction, , 2107, 15) + (AssignmentAction, , 2164, 27) + (AssignmentAction, , 2234, 21) + (AssignmentAction, , 2295, 40) + (BehaviorActionBlock, , 2105, 19) + (BehaviorActionBlock, , 2162, 31) + (BehaviorActionBlock, , 2232, 25) + (BehaviorActionBlock, , 2293, 44) + (BehaviorAnnex, behavior_specification, 1898, 440) + (BehaviorIntegerLiteral, , 1950, 1) + (BehaviorIntegerLiteral, , 2121, 1) + (BehaviorIntegerLiteral, , 2248, 1) + (BehaviorRealLiteral, , 1990, 3) + (BehaviorRealLiteral, , 2252, 3) + (BehaviorState, done, 2033, 4) + (BehaviorState, start, 2007, 5) + (BehaviorStateGroup, , 2007, 22) + (BehaviorStateGroup, , 2033, 19) + (BehaviorTransition, integer_literal, 2070, 55) + (BehaviorTransition, mixed_literals, 2198, 60) + (BehaviorTransition, mixed_typed, 2262, 76) + (BehaviorTransition, typed_integer, 2129, 65) + (BehaviorVariable, integer_value, 1911, 13) + (BehaviorVariable, real_value, 1956, 10) + (BehaviorVariableGroup, , 1911, 41) + (BehaviorVariableGroup, , 1956, 38) + (BinaryExpression, , 2248, 7) + (BinaryExpression, , 2309, 26) + (Reference, , 2107, 10) + (Reference, , 2164, 10) + (Reference, , 2178, 13) + (Reference, , 2234, 10) + (Reference, , 2295, 10) + (Reference, , 2309, 13) + (Reference, , 2325, 10) + (ReferenceExpression, , 2178, 13) + (ReferenceExpression, , 2309, 13) + (ReferenceExpression, , 2325, 10) + (ReferenceSegment, integer_value, 2178, 13) + (ReferenceSegment, integer_value, 2309, 13) + (ReferenceSegment, real_value, 2107, 10) + (ReferenceSegment, real_value, 2164, 10) + (ReferenceSegment, real_value, 2234, 10) + (ReferenceSegment, real_value, 2295, 10) + (ReferenceSegment, real_value, 2325, 10) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_SourceDiagnostics.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_SourceDiagnostics.txt new file mode 100644 index 00000000000..f2e3b782e76 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3199_SourceDiagnostics.txt @@ -0,0 +1,19 @@ +annex[0] owner=SourceDiagnostics::worker.impl + (BehaviorActionBlock, , 2121, 20) + (BehaviorAnnex, behavior_specification, 1949, 193) + (BehaviorIntegerLiteral, , 1992, 1) + (BehaviorState, done, 2067, 4) + (BehaviorState, start, 2041, 5) + (BehaviorStateGroup, , 2041, 22) + (BehaviorStateGroup, , 2067, 19) + (BehaviorTransition, , 2104, 38) + (BehaviorVariable, counter, 1998, 7) + (BehaviorVariable, flag, 1962, 4) + (BehaviorVariableGroup, , 1962, 32) + (BehaviorVariableGroup, , 1998, 30) + (CommunicationAction, , 2123, 16) + (Reference, , 2123, 6) + (Reference, , 2131, 7) + (ReferenceExpression, , 2131, 7) + (ReferenceSegment, counter, 2131, 7) + (ReferenceSegment, output, 2123, 6) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba_examples_standard_examples_ba_example_007.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba_examples_standard_examples_ba_example_007.txt index 246095631ea..05640634405 100644 --- a/ba/org.osate.ba.tests/expected/positions/org.osate.ba_examples_standard_examples_ba_example_007.txt +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba_examples_standard_examples_ba_example_007.txt @@ -1,99 +1,99 @@ annex[0] owner=BA_example7::a_client - (BehaviorActionBlock, , 1357, 276) - (BehaviorActionSequence, , 1495, 136) - (BehaviorAnnex, behavior_specification, 1237, 397) - (BehaviorCondition, , 1339, 11) - (BehaviorIntegerLiteral, , 1524, 2) - (BehaviorState, s, 1282, 1) - (BehaviorStateGroup, , 1282, 33) - (BehaviorTime, , 1524, 4) - (BehaviorTransition, , 1334, 300) - (BehaviorVariable, x, 1251, 1) - (BehaviorVariable, y, 1254, 1) - (BehaviorVariableGroup, , 1251, 17) - (CommunicationAction, , 1495, 9) - (CommunicationAction, , 1621, 10) - (DispatchCondition, , 1342, 8) - (Reference, , 1495, 3) - (Reference, , 1500, 1) - (Reference, , 1502, 1) - (Reference, , 1621, 4) - (Reference, , 1627, 1) - (Reference, , 1629, 1) - (ReferenceExpression, , 1500, 1) - (ReferenceExpression, , 1502, 1) - (ReferenceExpression, , 1627, 1) - (ReferenceExpression, , 1629, 1) - (ReferenceSegment, post, 1621, 4) - (ReferenceSegment, pre, 1495, 3) - (ReferenceSegment, x, 1500, 1) - (ReferenceSegment, x, 1629, 1) - (ReferenceSegment, y, 1502, 1) - (ReferenceSegment, y, 1627, 1) - (TimedAction, , 1512, 17) + (BehaviorActionBlock, , 1515, 276) + (BehaviorActionSequence, , 1653, 136) + (BehaviorAnnex, behavior_specification, 1393, 399) + (BehaviorCondition, , 1497, 11) + (BehaviorIntegerLiteral, , 1682, 2) + (BehaviorState, s, 1440, 1) + (BehaviorStateGroup, , 1440, 33) + (BehaviorTime, , 1682, 4) + (BehaviorTransition, , 1492, 300) + (BehaviorVariable, x, 1407, 1) + (BehaviorVariable, y, 1410, 1) + (BehaviorVariableGroup, , 1407, 19) + (CommunicationAction, , 1653, 9) + (CommunicationAction, , 1779, 10) + (DispatchCondition, , 1500, 8) + (Reference, , 1653, 3) + (Reference, , 1658, 1) + (Reference, , 1660, 1) + (Reference, , 1779, 4) + (Reference, , 1785, 1) + (Reference, , 1787, 1) + (ReferenceExpression, , 1658, 1) + (ReferenceExpression, , 1660, 1) + (ReferenceExpression, , 1785, 1) + (ReferenceExpression, , 1787, 1) + (ReferenceSegment, post, 1779, 4) + (ReferenceSegment, pre, 1653, 3) + (ReferenceSegment, x, 1658, 1) + (ReferenceSegment, x, 1787, 1) + (ReferenceSegment, y, 1660, 1) + (ReferenceSegment, y, 1785, 1) + (TimedAction, , 1670, 17) annex[1] owner=BA_example7::a_server.i - (AssignmentAction, , 2611, 24) - (AssignmentAction, , 2679, 24) - (BehaviorActionBlock, , 2564, 86) - (BehaviorActionBlock, , 2677, 28) - (BehaviorActionBlock, , 2742, 33) - (BehaviorActionSequence, , 2575, 60) - (BehaviorAnnex, behavior_specification, 2378, 398) - (BehaviorCondition, , 2522, 16) - (BehaviorCondition, , 2662, 7) - (BehaviorCondition, , 2717, 17) - (BehaviorIntegerLiteral, , 2634, 1) - (BehaviorIntegerLiteral, , 2646, 2) - (BehaviorIntegerLiteral, , 2702, 1) - (BehaviorState, s0, 2422, 2) - (BehaviorState, s1, 2461, 2) - (BehaviorState, s2, 2477, 2) - (BehaviorStateGroup, , 2422, 34) - (BehaviorStateGroup, , 2461, 11) - (BehaviorStateGroup, , 2477, 20) - (BehaviorTime, , 2646, 4) - (BehaviorTransition, , 2516, 30) - (BehaviorTransition, , 2551, 100) - (BehaviorTransition, , 2656, 50) - (BehaviorTransition, , 2711, 65) - (BehaviorVariable, v, 2392, 1) - (BehaviorVariableGroup, , 2392, 16) - (CommunicationAction, , 2575, 34) - (CommunicationAction, , 2744, 29) - (DispatchCondition, , 2525, 13) - (DispatchCondition, , 2720, 14) - (DispatchConjunction, , 2534, 4) - (DispatchConjunction, , 2729, 5) - (DispatchTriggerCondition, , 2534, 4) - (DispatchTriggerCondition, , 2729, 5) - (DispatchTriggerLogicalExpression, , 2534, 4) - (DispatchTriggerLogicalExpression, , 2729, 5) - (ExecuteCondition, , 2662, 7) - (Reference, , 2534, 4) - (Reference, , 2575, 16) - (Reference, , 2593, 1) - (Reference, , 2596, 12) - (Reference, , 2611, 19) - (Reference, , 2679, 19) - (Reference, , 2729, 5) - (Reference, , 2744, 11) - (Reference, , 2757, 12) - (Reference, , 2771, 1) - (ReferenceExpression, , 2593, 1) - (ReferenceExpression, , 2596, 12) - (ReferenceExpression, , 2757, 12) - (ReferenceExpression, , 2771, 1) - (ReferenceSegment, local_result, 2596, 12) - (ReferenceSegment, local_result, 2611, 12) - (ReferenceSegment, local_result, 2679, 12) - (ReferenceSegment, local_result, 2757, 12) - (ReferenceSegment, long, 2534, 4) - (ReferenceSegment, long_computation, 2575, 16) - (ReferenceSegment, send_result, 2744, 11) - (ReferenceSegment, short, 2729, 5) - (ReferenceSegment, status, 2624, 6) - (ReferenceSegment, status, 2692, 6) - (ReferenceSegment, v, 2593, 1) - (ReferenceSegment, v, 2771, 1) - (ReferenceTail, , 2623, 7) - (ReferenceTail, , 2691, 7) + (AssignmentAction, , 2863, 27) + (AssignmentAction, , 2934, 28) + (BehaviorActionBlock, , 2816, 89) + (BehaviorActionBlock, , 2932, 32) + (BehaviorActionBlock, , 3001, 33) + (BehaviorActionSequence, , 2827, 63) + (BehaviorAnnex, behavior_specification, 2536, 499) + (BehaviorBooleanLiteral, , 2886, 4) + (BehaviorBooleanLiteral, , 2957, 5) + (BehaviorCondition, , 2680, 16) + (BehaviorCondition, , 2917, 7) + (BehaviorCondition, , 2976, 17) + (BehaviorIntegerLiteral, , 2901, 2) + (BehaviorState, s0, 2580, 2) + (BehaviorState, s1, 2619, 2) + (BehaviorState, s2, 2635, 2) + (BehaviorStateGroup, , 2580, 34) + (BehaviorStateGroup, , 2619, 11) + (BehaviorStateGroup, , 2635, 20) + (BehaviorTime, , 2901, 4) + (BehaviorTransition, , 2674, 30) + (BehaviorTransition, , 2803, 103) + (BehaviorTransition, , 2911, 54) + (BehaviorTransition, , 2970, 65) + (BehaviorVariable, v, 2550, 1) + (BehaviorVariableGroup, , 2550, 16) + (CommunicationAction, , 2827, 34) + (CommunicationAction, , 3003, 29) + (DispatchCondition, , 2683, 13) + (DispatchCondition, , 2979, 14) + (DispatchConjunction, , 2692, 4) + (DispatchConjunction, , 2988, 5) + (DispatchTriggerCondition, , 2692, 4) + (DispatchTriggerCondition, , 2988, 5) + (DispatchTriggerLogicalExpression, , 2692, 4) + (DispatchTriggerLogicalExpression, , 2988, 5) + (ExecuteCondition, , 2917, 7) + (Reference, , 2692, 4) + (Reference, , 2827, 16) + (Reference, , 2845, 1) + (Reference, , 2848, 12) + (Reference, , 2863, 19) + (Reference, , 2934, 19) + (Reference, , 2988, 5) + (Reference, , 3003, 11) + (Reference, , 3016, 12) + (Reference, , 3030, 1) + (ReferenceExpression, , 2845, 1) + (ReferenceExpression, , 2848, 12) + (ReferenceExpression, , 3016, 12) + (ReferenceExpression, , 3030, 1) + (ReferenceSegment, local_result, 2848, 12) + (ReferenceSegment, local_result, 2863, 12) + (ReferenceSegment, local_result, 2934, 12) + (ReferenceSegment, local_result, 3016, 12) + (ReferenceSegment, long, 2692, 4) + (ReferenceSegment, long_computation, 2827, 16) + (ReferenceSegment, send_result, 3003, 11) + (ReferenceSegment, short, 2988, 5) + (ReferenceSegment, status, 2876, 6) + (ReferenceSegment, status, 2947, 6) + (ReferenceSegment, v, 2845, 1) + (ReferenceSegment, v, 3030, 1) + (ReferenceTail, , 2875, 7) + (ReferenceTail, , 2946, 7) diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3169_InvalidShortCircuitOperands.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3169_InvalidShortCircuitOperands.txt index 4671d3e9d27..2c1d1641042 100644 --- a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3169_InvalidShortCircuitOperands.txt +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3169_InvalidShortCircuitOperands.txt @@ -1,7 +1,9 @@ annex[0] owner=InvalidShortCircuitOperands::operation parsedAnnexSubclause : BehaviorAnnex name=behavior_specification variables[0] : BehaviorVariable name=left + ownedValueConstant : BehaviorIntegerLiteral variables[1] : BehaviorVariable name=right + ownedValueConstant : BehaviorIntegerLiteral states[0] : BehaviorState name=start states[1] : BehaviorState name=finish transitions[0] : BehaviorTransition name=and_then_transition diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_ArrayTypes.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_ArrayTypes.txt new file mode 100644 index 00000000000..d7acdc65b06 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_ArrayTypes.txt @@ -0,0 +1,47 @@ +annex[0] owner=ArrayTypes::mismatch.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=target_array + arrayDimension[0] : ArrayDimension + size : BehaviorArraySize + integerValue : BehaviorIntegerLiteral + variables[1] : BehaviorVariable name=larger_array + arrayDimension[0] : ArrayDimension + size : BehaviorArraySize + integerValue : BehaviorIntegerLiteral + variables[2] : BehaviorVariable name=matrix + arrayDimension[0] : ArrayDimension + size : BehaviorArraySize + integerValue : BehaviorIntegerLiteral + arrayDimension[1] : ArrayDimension + size : BehaviorArraySize + integerValue : BehaviorIntegerLiteral + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition name=extent + transitions[1] : BehaviorTransition name=rank + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=larger_array [BehaviorVariable] + valueExpression : Any + actions[1] : AssignmentAction + target : BehaviorVariableHolder element=target_array [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=larger_array [BehaviorVariable] + actions[1] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=matrix [BehaviorVariable] + valueExpression : Any + actions[1] : AssignmentAction + target : BehaviorVariableHolder element=target_array [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=matrix [BehaviorVariable] diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt new file mode 100644 index 00000000000..2c284d3a1f7 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt @@ -0,0 +1,113 @@ +annex[0] owner=ClassifierIdentity::mismatch.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=first + variables[1] : BehaviorVariable name=second + variables[2] : BehaviorVariable name=child + variables[3] : BehaviorVariable name=implementation + variables[4] : BehaviorVariable name=first_flag + ownedValueConstant : BehaviorBooleanLiteral + variables[5] : BehaviorVariable name=second_flag + ownedValueConstant : BehaviorBooleanLiteral + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition name=different_names + transitions[1] : BehaviorTransition name=extension + transitions[2] : BehaviorTransition name=type_implementation + transitions[3] : BehaviorTransition name=identical + transitions[4] : BehaviorTransition name=literal_left + transitions[5] : BehaviorTransition name=literal_right + transitions[6] : BehaviorTransition name=identical_boolean + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=second [BehaviorVariable] + valueExpression : Any + actions[1] : AssignmentAction + target : BehaviorVariableHolder element=first [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=second [BehaviorVariable] + actions[1] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=child [BehaviorVariable] + valueExpression : Any + actions[1] : AssignmentAction + target : BehaviorVariableHolder element=first [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=child [BehaviorVariable] + actions[2] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=implementation [BehaviorVariable] + valueExpression : Any + actions[1] : AssignmentAction + target : BehaviorVariableHolder element=first [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=implementation [BehaviorVariable] + actions[3] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=first [BehaviorVariable] + valueExpression : Any + actions[1] : AssignmentAction + target : BehaviorVariableHolder element=first [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=first [BehaviorVariable] + actions[4] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=first_flag [BehaviorVariable] + valueExpression : 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 : BehaviorVariableHolder element=second_flag [BehaviorVariable] + actions[5] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=first_flag [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=second_flag [BehaviorVariable] + relations[1] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral + actions[6] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=first_flag [BehaviorVariable] + valueExpression : 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 : BehaviorVariableHolder element=first_flag [BehaviorVariable] diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_CommunicationTypes.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_CommunicationTypes.txt new file mode 100644 index 00000000000..87e965280dc --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_CommunicationTypes.txt @@ -0,0 +1,32 @@ +annex[0] owner=CommunicationTypes::host.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=counter + ownedValueConstant : BehaviorIntegerLiteral + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition name=dequeue + transitions[1] : BehaviorTransition name=call + transitions[2] : BehaviorTransition name=internal_send + actions[0] : BehaviorActionBlock + content : PortDequeueAction + port : EventDataPortHolder element=CommunicationTypes::host.input [EventDataPort] + target : BehaviorVariableHolder element=counter [BehaviorVariable] + actions[1] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramHolder element=CommunicationTypes::operation [SubprogramType] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=counter [BehaviorVariable] + parameterLabels[1] : BehaviorVariableHolder element=counter [BehaviorVariable] + actions[2] : BehaviorActionBlock + content : InternalPortSendAction + internalPort : EventDataSourceHolder element=CommunicationTypes::host.impl.raised_data [EventDataSource] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorStringLiteral diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_ConformingTypes.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_ConformingTypes.txt new file mode 100644 index 00000000000..71c26663fe5 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_ConformingTypes.txt @@ -0,0 +1,168 @@ +annex[0] owner=ConformingTypes::worker.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=integer_value + ownedValueConstant : BehaviorIntegerLiteral + variables[1] : BehaviorVariable name=real_value + ownedValueConstant : BehaviorRealLiteral + variables[2] : BehaviorVariable name=fixed_value + ownedValueConstant : BehaviorRealLiteral + variables[3] : BehaviorVariable name=boolean_value + ownedValueConstant : BehaviorBooleanLiteral + variables[4] : BehaviorVariable name=text_value + ownedValueConstant : BehaviorStringLiteral + variables[5] : BehaviorVariable name=first_array + arrayDimension[0] : ArrayDimension + size : BehaviorArraySize + integerValue : BehaviorIntegerLiteral + variables[6] : BehaviorVariable name=second_array + arrayDimension[0] : ArrayDimension + size : BehaviorArraySize + integerValue : BehaviorIntegerLiteral + variables[7] : BehaviorVariable name=symbolic_array + arrayDimension[0] : ArrayDimension + size : BehaviorArraySize + integerValue : ClassifierFeaturePropertyReference + properties[0] : PropertyNameHolder + property : BasicPropertyHolder element=Communication_Properties::Queue_Size [Property] + component : EventDataPortHolder element=ConformingTypes::worker.input [EventDataPort] + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition name=valid + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=integer_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + secondValue : BehaviorIntegerLiteral + actions[1] : AssignmentAction + target : BehaviorVariableHolder element=integer_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + factors[1] : Factor + firstValue : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[2] : AssignmentAction + target : BehaviorVariableHolder element=real_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorRealLiteral + secondValue : BehaviorIntegerLiteral + actions[3] : AssignmentAction + target : BehaviorVariableHolder element=fixed_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorRealLiteral + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=fixed_value [BehaviorVariable] + actions[4] : AssignmentAction + target : BehaviorVariableHolder element=fixed_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=fixed_value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorRealLiteral + actions[5] : AssignmentAction + target : BehaviorVariableHolder element=boolean_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : PortUpdatedValue + actions[6] : AssignmentAction + target : BehaviorVariableHolder element=boolean_value [BehaviorVariable] + valueExpression : 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 + relations[2] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral + actions[7] : AssignmentAction + target : BehaviorVariableHolder element=boolean_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=text_value [BehaviorVariable] + secondExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorStringLiteral + actions[8] : AssignmentAction + target : BehaviorVariableHolder element=second_array [BehaviorVariable] + valueExpression : Any + actions[9] : AssignmentAction + target : BehaviorVariableHolder element=first_array [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=second_array [BehaviorVariable] + actions[10] : AssignmentAction + target : BehaviorVariableHolder element=symbolic_array [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=first_array [BehaviorVariable] + actions[11] : ForOrForAllStatement + behaviorActions : AssignmentAction + target : BehaviorVariableHolder element=integer_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : IterativeVariableHolder element=element [IterativeVariable] + iteratedValues : IntegerRange + lowerIntegerValue : BehaviorIntegerLiteral + upperIntegerValue : BehaviorIntegerLiteral + iterativeVariable : IterativeVariable name=element diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_Issue3199.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_Issue3199.txt new file mode 100644 index 00000000000..e913a340bdf --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_Issue3199.txt @@ -0,0 +1,68 @@ +annex[0] owner=Issue3199::mismatch.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=counter + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition name=assign_wrong_type + transitions[1] : BehaviorTransition name=send_wrong_type + transitions[2] : BehaviorTransition name=mixed_operands + transitions[3] : BehaviorTransition name=mixed_relation + actions[0] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=counter [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorStringLiteral + actions[1] : BehaviorActionBlock + content : PortSendAction + port : EventDataPortHolder element=Issue3199::mismatch.out_text [EventDataPort] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[2] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=counter [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorStringLiteral + actions[3] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : AssignmentAction + target : BehaviorVariableHolder element=counter [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[1] : IfStatement + behaviorActions : AssignmentAction + target : BehaviorVariableHolder element=counter [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + logicalValueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=counter [BehaviorVariable] + secondExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorStringLiteral diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_NumericTypes.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_NumericTypes.txt new file mode 100644 index 00000000000..f599fdbe2e3 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_NumericTypes.txt @@ -0,0 +1,54 @@ +annex[0] owner=NumericTypes::mismatch.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=integer_value + ownedValueConstant : BehaviorIntegerLiteral + variables[1] : BehaviorVariable name=real_value + ownedValueConstant : BehaviorRealLiteral + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition name=integer_literal + transitions[1] : BehaviorTransition name=typed_integer + transitions[2] : BehaviorTransition name=mixed_literals + transitions[3] : BehaviorTransition name=mixed_typed + actions[0] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=real_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[1] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=real_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=integer_value [BehaviorVariable] + actions[2] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=real_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorRealLiteral + actions[3] : BehaviorActionBlock + content : AssignmentAction + target : BehaviorVariableHolder element=real_value [BehaviorVariable] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=integer_value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=real_value [BehaviorVariable] diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_SourceDiagnostics.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_SourceDiagnostics.txt new file mode 100644 index 00000000000..a57340f2b24 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3199_SourceDiagnostics.txt @@ -0,0 +1,17 @@ +annex[0] owner=SourceDiagnostics::worker.impl + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=flag + ownedValueConstant : BehaviorIntegerLiteral + variables[1] : BehaviorVariable name=counter + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition + actions[0] : BehaviorActionBlock + content : PortSendAction + port : DataPortHolder element=SourceDiagnostics::worker.output [DataPort] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=counter [BehaviorVariable] diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba_examples_standard_examples_ba_example_007.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba_examples_standard_examples_ba_example_007.txt index a3827cecafc..d0b5a26b619 100644 --- a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba_examples_standard_examples_ba_example_007.txt +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba_examples_standard_examples_ba_example_007.txt @@ -58,7 +58,7 @@ annex[1] owner=BA_example7::a_server.i firstExpression : SimpleExpression terms[0] : Term factors[0] : Factor - firstValue : BehaviorIntegerLiteral + firstValue : BehaviorBooleanLiteral timeout : BehaviorTime integerValue : BehaviorIntegerLiteral actions[1] : BehaviorActionBlock @@ -71,7 +71,7 @@ annex[1] owner=BA_example7::a_server.i firstExpression : SimpleExpression terms[0] : Term factors[0] : Factor - firstValue : BehaviorIntegerLiteral + firstValue : BehaviorBooleanLiteral actions[2] : BehaviorActionBlock content : SubprogramCallAction subprogram : SubprogramHolder element=BA_example7::send_result [SubprogramType] diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_characterization_GrammarHazards.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_characterization_GrammarHazards.txt index 4933dab6540..cce06d562b4 100644 --- a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_characterization_GrammarHazards.txt +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_characterization_GrammarHazards.txt @@ -4,7 +4,7 @@ \t\t\tValue: hazard_integer := 0 { \t\t\t\tData_Model::Initial_Value => ("1"); \t\t\t}; -\t\t\tOther: Base_Types::Integer := 1; +\t\t\tOther: hazard_integer := 1; \t\tStAtEs \t\t\tstart: initial state; \t\t\texecute: state; @@ -43,10 +43,10 @@ \t\t\t\telse \t\t\t\t\tValue := 3 \t\t\t\tend if; -\t\t\t\tfor (i : Base_Types::Integer in 0 .. 1) { +\t\t\t\tfor (i : hazard_integer in 0 .. 1) { \t\t\t\t\tValue := Value + i \t\t\t\t}; -\t\t\t\tforall (j : Base_Types::Integer in 0 .. 1) { +\t\t\t\tforall (j : hazard_integer in 0 .. 1) { \t\t\t\t\tValue := Value + j \t\t\t\t}; \t\t\t\twhile (Value < 10) { diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3169_InvalidShortCircuitOperands.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3169_InvalidShortCircuitOperands.txt index 46c8197b87f..d8f063b9ba7 100644 --- a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3169_InvalidShortCircuitOperands.txt +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3169_InvalidShortCircuitOperands.txt @@ -1,7 +1,7 @@ ===== annex[0] owner=InvalidShortCircuitOperands::operation ===== \t\tvariables -\t\t\tleft, right: Base_Types::Integer; +\t\t\tleft, right: Base_Types::Integer := 0; \t\tstates \t\t\tstart: initial state; \t\t\tfinish: final state; diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_ArrayTypes.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_ArrayTypes.txt new file mode 100644 index 00000000000..5d62e5723a6 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_ArrayTypes.txt @@ -0,0 +1,13 @@ +===== annex[0] owner=ArrayTypes::mismatch.impl ===== + +\t\tvariables +\t\t\ttarget_array[2], larger_array[3], matrix[2][2] : Base_Types::Integer; +\t\tstates +\t\t\tstart : initial state; +\t\t\tdone : final state; +\t\ttransitions +\t\t\textent : start -[]-> done { larger_array := any; target_array := larger_array }; +\t\t\trank : start -[]-> done { matrix := any; target_array := matrix }; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt new file mode 100644 index 00000000000..deec7703d3e --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_ClassifierIdentity.txt @@ -0,0 +1,23 @@ +===== annex[0] owner=ClassifierIdentity::mismatch.impl ===== + +\t\tvariables +\t\t\tfirst : first_type; +\t\t\tsecond : second_type; +\t\t\tchild : child_type; +\t\t\timplementation : first_type.impl; +\t\t\tfirst_flag : first_boolean := true; +\t\t\tsecond_flag : second_boolean := true; +\t\tstates +\t\t\tstart : initial state; +\t\t\tdone : final state; +\t\ttransitions +\t\t\tdifferent_names : start -[]-> done { second := any; first := second }; +\t\t\textension : start -[]-> done { child := any; first := child }; +\t\t\ttype_implementation : start -[]-> done { implementation := any; first := implementation }; +\t\t\tidentical : start -[]-> done { first := any; first := first }; +\t\t\tliteral_left : start -[]-> done { first_flag := true and second_flag }; +\t\t\tliteral_right : start -[]-> done { first_flag := second_flag or false }; +\t\t\tidentical_boolean : start -[]-> done { first_flag := true and first_flag }; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_CommunicationTypes.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_CommunicationTypes.txt new file mode 100644 index 00000000000..b634a233f61 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_CommunicationTypes.txt @@ -0,0 +1,14 @@ +===== annex[0] owner=CommunicationTypes::host.impl ===== + +\t\tvariables +\t\t\tcounter : Base_Types::Integer := 0; +\t\tstates +\t\t\tstart : initial state; +\t\t\tdone : final state; +\t\ttransitions +\t\t\tdequeue : start -[]-> done { input?(counter) }; +\t\t\tcall : start -[]-> done { operation!(counter, counter) }; +\t\t\tinternal_send : start -[]-> done { raised_data!("text") }; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_ConformingTypes.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_ConformingTypes.txt new file mode 100644 index 00000000000..1f8de56a858 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_ConformingTypes.txt @@ -0,0 +1,31 @@ +===== annex[0] owner=ConformingTypes::worker.impl ===== + +\t\tvariables +\t\t\tinteger_value : Base_Types::Integer := 0; +\t\t\treal_value : Base_Types::Float := 0.0; +\t\t\tfixed_value : FixedPoint := 0.0; +\t\t\tboolean_value : Base_Types::Boolean := true; +\t\t\ttext_value : Base_Types::String := "text"; +\t\t\tfirst_array[2], second_array[2] : Base_Types::Integer; +\t\t\tsymbolic_array[input#Queue_Size] : Base_Types::Integer; +\t\tstates +\t\t\tstart : initial state; +\t\t\tdone : final state; +\t\ttransitions +\t\t\tvalid : start -[]-> done { +\t\t\t\tinteger_value := -2 ** 2; +\t\t\t\tinteger_value := (1 + 2) * (3 - 1); +\t\t\t\treal_value := 2.0 ** 2; +\t\t\t\tfixed_value := 1.0 + fixed_value; +\t\t\t\tfixed_value := fixed_value + 1.0; +\t\t\t\tboolean_value := input'updated; +\t\t\t\tboolean_value := true and then false or else true; +\t\t\t\tboolean_value := text_value = "text"; +\t\t\t\tsecond_array := any; +\t\t\t\tfirst_array := second_array; +\t\t\t\tsymbolic_array := first_array; +\t\t\t\tfor (element : Base_Types::Integer in 1 .. 2) { integer_value := element } +\t\t\t}; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_Issue3199.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_Issue3199.txt new file mode 100644 index 00000000000..9d7ca9af2d3 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_Issue3199.txt @@ -0,0 +1,15 @@ +===== annex[0] owner=Issue3199::mismatch.impl ===== + +\t\tvariables +\t\t\tcounter : Base_Types::Integer; +\t\tstates +\t\t\tstart : initial state; +\t\t\tdone : final state; +\t\ttransitions +\t\t\tassign_wrong_type : start -[]-> done { counter := "text" }; +\t\t\tsend_wrong_type : start -[]-> done { out_text!(42) }; +\t\t\tmixed_operands : start -[]-> done { counter := 1 + "text" }; +\t\t\tmixed_relation : start -[]-> done { counter := 1; if (counter < "text") counter := 2 end if }; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_NumericTypes.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_NumericTypes.txt new file mode 100644 index 00000000000..688b10e401f --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_NumericTypes.txt @@ -0,0 +1,16 @@ +===== annex[0] owner=NumericTypes::mismatch.impl ===== + +\t\tvariables +\t\t\tinteger_value : Base_Types::Integer := 1; +\t\t\treal_value : Base_Types::Float := 1.0; +\t\tstates +\t\t\tstart : initial state; +\t\t\tdone : final state; +\t\ttransitions +\t\t\tinteger_literal : start -[]-> done { real_value := 1 }; +\t\t\ttyped_integer : start -[]-> done { real_value := integer_value }; +\t\t\tmixed_literals : start -[]-> done { real_value := 1 + 1.0 }; +\t\t\tmixed_typed : start -[]-> done { real_value := integer_value + real_value }; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_SourceDiagnostics.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_SourceDiagnostics.txt new file mode 100644 index 00000000000..3003b29b9eb --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3199_SourceDiagnostics.txt @@ -0,0 +1,13 @@ +===== annex[0] owner=SourceDiagnostics::worker.impl ===== + +\t\tvariables +\t\t\tflag : Base_Types::Boolean := 1; +\t\t\tcounter : Base_Types::Integer; +\t\tstates +\t\t\tstart : initial state; +\t\t\tdone : final state; +\t\ttransitions +\t\t\tstart -[]-> done { output!(counter) }; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba_examples_standard_examples_ba_example_007.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba_examples_standard_examples_ba_example_007.txt index 9c8e8d9b8cc..27c3fec6957 100644 --- a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba_examples_standard_examples_ba_example_007.txt +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba_examples_standard_examples_ba_example_007.txt @@ -1,7 +1,7 @@ ===== annex[0] owner=BA_example7::a_client ===== variables - x, y : data_type; + x, y : data_type.i; states s : initial complete final state; transitions @@ -25,9 +25,10 @@ reparsed s2 : complete state; transitions s0 -[ on dispatch long ]-> s1; + -- The published example assigns 1 and 0 to Boolean status. Use Boolean literals instead. s1 -[ ]-> s2 {\s - long_computation!(v, local_result); local_result.status := 1 } timeout 60ms; - s1 -[ timeout ]-> s2 { local_result.status := 0 }; + long_computation!(v, local_result); local_result.status := true } timeout 60ms; + s1 -[ timeout ]-> s2 { local_result.status := false }; s2 -[ on dispatch short ]-> s0 { send_result!(local_result, v) }; ----- Xtext reparse ----- reparsed diff --git a/ba/org.osate.ba.tests/models/characterization/GrammarHazards.aadl b/ba/org.osate.ba.tests/models/characterization/GrammarHazards.aadl index 5884107d327..37c9260a49d 100644 --- a/ba/org.osate.ba.tests/models/characterization/GrammarHazards.aadl +++ b/ba/org.osate.ba.tests/models/characterization/GrammarHazards.aadl @@ -24,10 +24,10 @@ public thread hazards features dispatch_event: in event port; - input: in event data port Base_Types::Integer { + input: in event data port hazard_integer { Dequeue_Protocol => AllItems; }; - output: out event data port Base_Types::Integer; + output: out event data port hazard_integer; shared: requires data access Base_Types::Integer; properties Dispatch_Protocol => Sporadic; @@ -36,7 +36,7 @@ public Value: hazard_integer := 0 { Data_Model::Initial_Value => ("1"); }; - Other: Base_Types::Integer := 1; + Other: hazard_integer := 1; StAtEs start: initial state; execute: state; @@ -75,10 +75,10 @@ public else Value := 3 end if; - for (i : Base_Types::Integer in 0 .. 1) { + for (i : hazard_integer in 0 .. 1) { Value := Value + i }; - forall (j : Base_Types::Integer in 0 .. 1) { + forall (j : hazard_integer in 0 .. 1) { Value := Value + j }; while (Value < 10) { diff --git a/ba/org.osate.ba.tests/models/issue3169/InvalidShortCircuitOperands.aadl b/ba/org.osate.ba.tests/models/issue3169/InvalidShortCircuitOperands.aadl index f427a3ea406..604d5ed65ff 100644 --- a/ba/org.osate.ba.tests/models/issue3169/InvalidShortCircuitOperands.aadl +++ b/ba/org.osate.ba.tests/models/issue3169/InvalidShortCircuitOperands.aadl @@ -27,7 +27,7 @@ public subprogram operation annex behavior_specification {** variables - left, right: Base_Types::Integer; + left, right: Base_Types::Integer := 0; states start: initial state; finish: final state; diff --git a/ba/org.osate.ba.tests/models/issue3199/.gitignore b/ba/org.osate.ba.tests/models/issue3199/.gitignore new file mode 100644 index 00000000000..afce51184c6 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3199/.gitignore @@ -0,0 +1,2 @@ +/.aadlbin-gen/ +/instances/ diff --git a/ba/org.osate.ba.tests/models/issue3199/.project b/ba/org.osate.ba.tests/models/issue3199/.project new file mode 100644 index 00000000000..e3cc45327eb --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3199/.project @@ -0,0 +1,18 @@ + + + issue3199 + + + + + + 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/issue3199/ArrayTypes.aadl b/ba/org.osate.ba.tests/models/issue3199/ArrayTypes.aadl new file mode 100644 index 00000000000..0e91da8f731 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3199/ArrayTypes.aadl @@ -0,0 +1,42 @@ +-- 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 ArrayTypes +public + with Base_Types; + + abstract mismatch + end mismatch; + + abstract implementation mismatch.impl + annex behavior_specification {** + variables + target_array[2], larger_array[3], matrix[2][2] : Base_Types::Integer; + states + start : initial state; + done : final state; + transitions + extent : start -[]-> done { larger_array := any; target_array := larger_array }; + rank : start -[]-> done { matrix := any; target_array := matrix }; + **}; + end mismatch.impl; +end ArrayTypes; diff --git a/ba/org.osate.ba.tests/models/issue3199/ClassifierIdentity.aadl b/ba/org.osate.ba.tests/models/issue3199/ClassifierIdentity.aadl new file mode 100644 index 00000000000..14c4e383dbd --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3199/ClassifierIdentity.aadl @@ -0,0 +1,73 @@ +-- 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 ClassifierIdentity +public + with Data_Model; + data first_type + end first_type; + + data second_type + end second_type; + + data child_type extends first_type + end child_type; + + data implementation first_type.impl + end first_type.impl; + + data first_boolean + properties + Data_Model::Data_Representation => Boolean; + end first_boolean; + + data second_boolean + properties + Data_Model::Data_Representation => Boolean; + end second_boolean; + + abstract mismatch + end mismatch; + + abstract implementation mismatch.impl + annex behavior_specification {** + variables + first : first_type; + second : second_type; + child : child_type; + implementation : first_type.impl; + first_flag : first_boolean := true; + second_flag : second_boolean := true; + states + start : initial state; + done : final state; + transitions + different_names : start -[]-> done { second := any; first := second }; + extension : start -[]-> done { child := any; first := child }; + type_implementation : start -[]-> done { implementation := any; first := implementation }; + identical : start -[]-> done { first := any; first := first }; + literal_left : start -[]-> done { first_flag := true and second_flag }; + literal_right : start -[]-> done { first_flag := second_flag or false }; + identical_boolean : start -[]-> done { first_flag := true and first_flag }; + **}; + end mismatch.impl; +end ClassifierIdentity; diff --git a/ba/org.osate.ba.tests/models/issue3199/CommunicationTypes.aadl b/ba/org.osate.ba.tests/models/issue3199/CommunicationTypes.aadl new file mode 100644 index 00000000000..b4cd816e968 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3199/CommunicationTypes.aadl @@ -0,0 +1,53 @@ +-- 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 CommunicationTypes +public + with Base_Types; + + subprogram operation + features + argument : in parameter Base_Types::String; + result : out parameter Base_Types::String; + end operation; + + abstract host + features + input : in event data port Base_Types::String; + end host; + + abstract implementation host.impl + internal features + raised_data : event data Base_Types::Integer; + annex behavior_specification {** + variables + counter : Base_Types::Integer := 0; + states + start : initial state; + done : final state; + transitions + dequeue : start -[]-> done { input?(counter) }; + call : start -[]-> done { operation!(counter, counter) }; + internal_send : start -[]-> done { raised_data!("text") }; + **}; + end host.impl; +end CommunicationTypes; diff --git a/ba/org.osate.ba.tests/models/issue3199/ConformingTypes.aadl b/ba/org.osate.ba.tests/models/issue3199/ConformingTypes.aadl new file mode 100644 index 00000000000..039a5d3a903 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3199/ConformingTypes.aadl @@ -0,0 +1,67 @@ +-- 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 ConformingTypes +public + with Base_Types, Data_Model; + + data FixedPoint + properties + Data_Model::Data_Representation => Fixed; + end FixedPoint; + + abstract worker + features + input : in event data port Base_Types::Integer; + end worker; + + abstract implementation worker.impl + annex behavior_specification {** + variables + integer_value : Base_Types::Integer := 0; + real_value : Base_Types::Float := 0.0; + fixed_value : FixedPoint := 0.0; + boolean_value : Base_Types::Boolean := true; + text_value : Base_Types::String := "text"; + first_array[2], second_array[2] : Base_Types::Integer; + symbolic_array[input#Queue_Size] : Base_Types::Integer; + states + start : initial state; + done : final state; + transitions + valid : start -[]-> done { + integer_value := -2 ** 2; + integer_value := (1 + 2) * (3 - 1); + real_value := 2.0 ** 2; + fixed_value := 1.0 + fixed_value; + fixed_value := fixed_value + 1.0; + boolean_value := input'updated; + boolean_value := true and then false or else true; + boolean_value := text_value = "text"; + second_array := any; + first_array := second_array; + symbolic_array := first_array; + for (element : Base_Types::Integer in 1 .. 2) { integer_value := element } + }; + **}; + end worker.impl; +end ConformingTypes; diff --git a/ba/org.osate.ba.tests/models/issue3199/Issue3199.aadl b/ba/org.osate.ba.tests/models/issue3199/Issue3199.aadl new file mode 100644 index 00000000000..fad789cf123 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3199/Issue3199.aadl @@ -0,0 +1,46 @@ +-- 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 Issue3199 +public + with Base_Types; + + abstract mismatch + features + out_text : out event data port Base_Types::String; + end mismatch; + + abstract implementation mismatch.impl + annex behavior_specification {** + variables + counter : Base_Types::Integer; + states + start : initial state; + done : final state; + transitions + assign_wrong_type : start -[]-> done { counter := "text" }; + send_wrong_type : start -[]-> done { out_text!(42) }; + mixed_operands : start -[]-> done { counter := 1 + "text" }; + mixed_relation : start -[]-> done { counter := 1; if (counter < "text") counter := 2 end if }; + **}; + end mismatch.impl; +end Issue3199; diff --git a/ba/org.osate.ba.tests/models/issue3199/NumericTypes.aadl b/ba/org.osate.ba.tests/models/issue3199/NumericTypes.aadl new file mode 100644 index 00000000000..addf3195602 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3199/NumericTypes.aadl @@ -0,0 +1,45 @@ +-- 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 NumericTypes +public + with Base_Types; + + abstract mismatch + end mismatch; + + abstract implementation mismatch.impl + annex behavior_specification {** + variables + integer_value : Base_Types::Integer := 1; + real_value : Base_Types::Float := 1.0; + states + start : initial state; + done : final state; + transitions + integer_literal : start -[]-> done { real_value := 1 }; + typed_integer : start -[]-> done { real_value := integer_value }; + mixed_literals : start -[]-> done { real_value := 1 + 1.0 }; + mixed_typed : start -[]-> done { real_value := integer_value + real_value }; + **}; + end mismatch.impl; +end NumericTypes; diff --git a/ba/org.osate.ba.tests/models/issue3199/SourceDiagnostics.aadl b/ba/org.osate.ba.tests/models/issue3199/SourceDiagnostics.aadl new file mode 100644 index 00000000000..87da3c52e2e --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3199/SourceDiagnostics.aadl @@ -0,0 +1,44 @@ +-- 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 SourceDiagnostics +public + with Base_Types; + + thread worker + features + output : out data port Base_Types::Integer; + end worker; + + thread implementation worker.impl + annex behavior_specification {** + variables + flag : Base_Types::Boolean := 1; + counter : Base_Types::Integer; + states + start : initial state; + done : final state; + transitions + start -[]-> done { output!(counter) }; + **}; + end worker.impl; +end SourceDiagnostics; diff --git a/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3174Test.java b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3174Test.java index 9721700bcd3..876efc216b2 100644 --- a/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3174Test.java +++ b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3174Test.java @@ -77,17 +77,13 @@ public void internalPortActionsNameTheirInternalFeatureCategory() throws Excepti strictAnnex().getTransitions().stream().map(Issue3174Test::describe).toList()); } - /** - * The wrong-typed assignment and send in the same model are not listed: they reach - * {@code AdaLikeDataTypeChecker.conformsTo}, which the implementation disables for every assignment and send alike. - * An internal port send compares its value against the internal event data classifier by that same path as a port - * send, so re-enabling that comparison covers this model without further work. - */ @Test public void internalEventWithoutDataCarriesNoValue() throws Exception { assertEquals(List.of( "ERROR: internal event 'raised_event' has no data: it cannot be an assignment target", - "ERROR: internal event 'raised_event' has no data: its send action cannot carry a value"), + "ERROR: internal event 'raised_event' has no data: its send action cannot carry a value", + "ERROR: type error for 'assignment', 'Base_Types::Integer' expected, found 'standard string'.", + "ERROR: type error for 'internal port send action', 'Base_Types::Integer' expected, found 'standard string'."), issues("InternalPortTypes.aadl")); } diff --git a/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3199Test.java b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3199Test.java new file mode 100644 index 00000000000..1b4d729f804 --- /dev/null +++ b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3199Test.java @@ -0,0 +1,149 @@ +/** + * Copyright (c) 2004-2026 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici- + * aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li- + * censes only apply to the Third Party Software and not any other portion of this program or this program as a whole. + */ +package org.osate.ba.tests; + +import static org.junit.Assert.assertEquals; + +import java.util.Comparator; +import java.util.List; + +import org.eclipse.xtext.diagnostics.Severity; +import org.eclipse.xtext.nodemodel.util.NodeModelUtils; +import org.eclipse.xtext.testing.InjectWith; +import org.eclipse.xtext.testing.XtextRunner; +import org.eclipse.xtext.testing.validation.ValidationTestHelper; +import org.eclipse.xtext.validation.Issue; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.osate.aadl2.AadlPackage; +import org.osate.testsupport.TestHelper; + +import com.google.inject.Inject; +import com.itemis.xtext.testing.XtextTest; + +/** Exercises declarative type conformance through embedded BA validation. */ +@RunWith(XtextRunner.class) +@InjectWith(BehaviorAnnexInjectorProvider.class) +public class Issue3199Test extends XtextTest { + private static final String PATH = "org.osate.ba.tests/models/issue3199/"; + + @Inject + private TestHelper testHelper; + + @Inject + private ValidationTestHelper validationHelper; + + @Test + public void classifierNamesAndExpressionResultsMustMatch() throws Exception { + assertDiagnostics("ClassifierIdentity", List.of(new Expected("second", + "type error for 'assignment', 'ClassifierIdentity::first_type' expected, found 'ClassifierIdentity::second_type'."), + new Expected("child", + "type error for 'assignment', 'ClassifierIdentity::first_type' expected, found 'ClassifierIdentity::child_type'."), + new Expected("implementation", + "type error for 'assignment', 'ClassifierIdentity::first_type' expected, found 'ClassifierIdentity::first_type.impl'."), + new Expected("true and second_flag", + "type error for 'assignment', 'ClassifierIdentity::first_boolean' expected, found 'ClassifierIdentity::second_boolean'."), + new Expected("second_flag or false", + "type error for 'assignment', 'ClassifierIdentity::first_boolean' expected, found 'ClassifierIdentity::second_boolean'."))); + } + + @Test + public void assignmentsSendsAndOperandsRejectTheReportedMismatches() throws Exception { + assertDiagnostics("Issue3199", List.of( + new Expected("\"text\"", + "type error for 'assignment', 'Base_Types::Integer' expected, found 'standard string'."), + new Expected("out_text!(42)", + "type error for 'port send action', 'Base_Types::String' expected, found 'universal integer'."), + new Expected("1 + \"text\"", + "Invalid operand types for operator \"+\": left operand has type universal integer, right operand has type standard string"), + new Expected("counter < \"text\"", + "Invalid operand types for operator \"<\": left operand has type Base_Types::Integer, right operand has type standard string"))); + } + + @Test + public void universalLiteralsFixedPointGroupingAndUpdatedAreAccepted() throws Exception { + validationHelper.assertNoIssues(testHelper.parseFile(PATH + "ConformingTypes.aadl")); + } + + @Test + public void numericsDoNotWidenImplicitly() throws Exception { + assertDiagnostics("NumericTypes", List.of( + new Expected("1", + "type error for 'assignment', 'Base_Types::Float' expected, found 'universal integer'."), + new Expected("integer_value", + "type error for 'assignment', 'Base_Types::Float' expected, found 'Base_Types::Integer'."), + new Expected("1 + 1.0", + "Invalid operand types for operator \"+\": left operand has type universal integer, right operand has type universal real"), + new Expected("integer_value + real_value", + "Invalid operand types for operator \"+\": left operand has type Base_Types::Integer, right operand has type Base_Types::Float"))); + } + + @Test + public void arrayRankAndKnownExtentsMustMatch() throws Exception { + assertDiagnostics("ArrayTypes", List.of(new Expected("larger_array", + "type error for 'assignment', 'Base_Types::Integer[2]' expected, found 'Base_Types::Integer[3]'."), + new Expected("matrix", + "type error for 'assignment', 'Base_Types::Integer[2]' expected, found 'Base_Types::Integer[2][2]'."))); + } + + @Test + public void dequeueCallsAndInternalSendsUseTheSameConformance() throws Exception { + assertDiagnostics("CommunicationTypes", List.of(new Expected("input?(counter)", + "type error for 'port dequeue action', 'Base_Types::String' expected, found 'Base_Types::Integer'."), + new Expected("counter", + "type error for 'actual for 'argument'', 'Base_Types::String' expected, found 'Base_Types::Integer'."), + new Expected("counter", + "type error for 'actual for 'result'', 'Base_Types::String' expected, found 'Base_Types::Integer'."), + new Expected("\"text\"", + "type error for 'internal port send action', 'Base_Types::Integer' expected, found 'standard string'."))); + } + + @Test + public void typeErrorsDoNotSuppressInitializationAndLegalityDiagnostics() throws Exception { + var root = testHelper.parseFile(PATH + "SourceDiagnostics.aadl"); + var issues = validationHelper.validate(root); + assertEquals(List.of("Behavior variable 'counter' may be read before it is initialized", + "SourceDiagnostics::worker.impl has no complete state : Behavior Annex D.3.(L3) legality rule failed.", + "type error for 'behavior variable initializer', 'Base_Types::Boolean' expected, found 'universal integer'."), + issues.stream().map(issue -> { + assertEquals(Severity.ERROR, issue.getSeverity()); + return issue.getMessage(); + }).sorted().toList()); + } + + private void assertDiagnostics(String model, List expected) throws Exception { + var root = testHelper.parseFile(PATH + model + ".aadl"); + var source = NodeModelUtils.getNode(root).getRootNode().getText(); + var issues = validationHelper.validate(root).stream().sorted(Comparator.comparing(Issue::getOffset)).toList(); + assertEquals(issues.toString(), expected.size(), issues.size()); + assertEquals(expected, issues.stream().map(issue -> { + assertEquals(Severity.ERROR, issue.getSeverity()); + return new Expected(source.substring(issue.getOffset(), issue.getOffset() + issue.getLength()), + issue.getMessage()); + }).toList()); + } + + private record Expected(String target, String message) { + } +} diff --git a/ba/org.osate.ba/examples/standard_examples/ba_example_007.aadl b/ba/org.osate.ba/examples/standard_examples/ba_example_007.aadl index 03ef44733dc..be3390afb9f 100644 --- a/ba/org.osate.ba/examples/standard_examples/ba_example_007.aadl +++ b/ba/org.osate.ba/examples/standard_examples/ba_example_007.aadl @@ -32,7 +32,9 @@ end long_computation; subprogram send_result features result : requires data access data_type.i; - output : out parameter data_type; + -- The published example mixes data_type and data_type.i at calls. Use one classifier to satisfy OSATE's + -- exact classifier-name conformance policy. + output : out parameter data_type.i; end send_result; thread a_client @@ -44,7 +46,7 @@ properties Period => 200ms; annex behavior_specification {** variables - x, y : data_type; + x, y : data_type.i; states s : initial complete final state; transitions @@ -88,9 +90,10 @@ connections s2 : complete state; transitions s0 -[ on dispatch long ]-> s1; + -- The published example assigns 1 and 0 to Boolean status. Use Boolean literals instead. s1 -[ ]-> s2 { - long_computation!(v, local_result); local_result.status := 1 } timeout 60ms; - s1 -[ timeout ]-> s2 { local_result.status := 0 }; + long_computation!(v, local_result); local_result.status := true } timeout 60ms; + s1 -[ timeout ]-> s2 { local_result.status := false }; s2 -[ on dispatch short ]-> s0 { send_result!(local_result, v) }; **}; end a_server.i; diff --git a/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaTypeChecker.java b/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaTypeChecker.java index 053acb97b4f..97251c8078b 100644 --- a/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaTypeChecker.java +++ b/ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaTypeChecker.java @@ -114,9 +114,28 @@ public AadlBaTypeChecker(BehaviorAnnex ba, ComponentClassifier parentContainer, * @return {@code true} when all checked types are consistent */ public boolean checkTypes() { + return checkResolution() && checkResolvedTypes(); + } + + /** + * Checks the references required by strict-model checkers. Resolution failures must stop those checkers; + * conformance errors must not suppress their independent diagnostics. + */ + public boolean checkResolution() { boolean result = checkResolvedModel(); for (BehaviorVariable variable : ba.getVariables()) { - result &= checkBehaviorVariable(variable); + result &= checkBehaviorVariableResolution(variable); + } + return result; + } + + /** + * Checks conformance after {@link #checkResolution()} has succeeded, without changing the strict model. + */ + public boolean checkResolvedTypes() { + boolean result = true; + for (BehaviorVariable variable : ba.getVariables()) { + result &= checkBehaviorVariableInitializer(variable); } // Expanded multi-source transitions have condition copies and a shared action block. Set checked = Collections.newSetFromMap(new IdentityHashMap<>()); @@ -138,7 +157,7 @@ private boolean checkResolvedModel() { return result; } - private boolean checkBehaviorVariable(BehaviorVariable variable) { + private boolean checkBehaviorVariableResolution(BehaviorVariable variable) { boolean result = variable.getDataClassifier() instanceof DataClassifier; if (!result) { reportError(variable, "behavior variable data classifier is not resolved"); @@ -149,11 +168,16 @@ private boolean checkBehaviorVariable(BehaviorVariable variable) { result = false; } } - if (result && variable.getOwnedValueConstant() != null) { + return result; + } + + private boolean checkBehaviorVariableInitializer(BehaviorVariable variable) { + boolean result = true; + if (variable.getOwnedValueConstant() != null) { var variableType = new TypeHolder(AadlBaUtils.getDataRepresentation(variable), variable.getDataClassifier()); variableType.setDimension(variable.getArrayDimensions().size()); var initializerType = getType(variable.getOwnedValueConstant()); - if (initializerType == null || !initializerConformsTo(variableType, initializerType)) { + if (initializerType == null || !dataChecker.conformsTo(variableType, initializerType, true)) { if (initializerType != null) { reportTypeError(variable.getOwnedValueConstant(), "behavior variable initializer", variableType.toString(), initializerType.toString()); @@ -164,25 +188,6 @@ private boolean checkBehaviorVariable(BehaviorVariable variable) { return result; } - /** - * General BA assignment conformance is intentionally still disabled in {@link AdaLikeDataTypeChecker}. An explicit - * declaration initializer is narrower: both its constant kind and the variable's declared classifier are known - * before any instance-dependent property lookup, so reject only a mismatch that is definite here. - */ - private static boolean initializerConformsTo(TypeHolder variableType, TypeHolder initializerType) { - if (variableType.getDimension() != initializerType.getDimension()) { - return false; - } - var variableRepresentation = variableType.getDataRep(); - var initializerRepresentation = initializerType.getDataRep(); - if (variableRepresentation != DataRepresentation.UNKNOWN - && initializerRepresentation != DataRepresentation.UNKNOWN) { - return variableRepresentation == initializerRepresentation; - } - return variableType.getKlass() == null || initializerType.getKlass() == null - || variableType.getKlass() == initializerType.getKlass(); - } - private boolean checkBehaviorTransition(BehaviorTransition transition, Set checked) { boolean result = true; BehaviorCondition condition = transition.getCondition(); diff --git a/ba/org.osate.ba/src/org/osate/ba/analyzers/AdaLikeDataTypeChecker.java b/ba/org.osate.ba/src/org/osate/ba/analyzers/AdaLikeDataTypeChecker.java index 245cfd8d82d..c23cebbce0e 100644 --- a/ba/org.osate.ba/src/org/osate/ba/analyzers/AdaLikeDataTypeChecker.java +++ b/ba/org.osate.ba/src/org/osate/ba/analyzers/AdaLikeDataTypeChecker.java @@ -21,9 +21,7 @@ package org.osate.ba.analyzers; -import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.Enumerator; -import org.osate.aadl2.DataClassifier; import org.osate.aadl2.RangeValue; import org.osate.aadl2.modelsupport.errorreporting.AnalysisErrorReporterManager; import org.osate.ba.aadlba.BehaviorElement; @@ -39,7 +37,6 @@ import org.osate.ba.aadlba.UnaryAddingOperator; import org.osate.ba.aadlba.UnaryBooleanOperator; import org.osate.ba.aadlba.UnaryNumericOperator; -import org.osate.ba.aadlba.Value; import org.osate.utils.internal.Aadl2Utils; import org.osate.utils.internal.PropertyUtils; import org.osate.utils.internal.names.DataModelProperties; @@ -69,59 +66,50 @@ public AdaLikeDataTypeChecker(AnalysisErrorReporterManager errManager) { @Override public boolean conformsTo(TypeHolder type1, TypeHolder type2, boolean hasToCheckDimension) { - boolean result = true; - /* - * As type checking is not mature, we disable it (this method always - * returns true). It impacts: - * _ assignment checking - * _ for/forall checking - * _ integer range checking - * _ port dequeue action checking - * _ port send action checking - * _ subprogram parameters checking - * - * - * // Preliminaries checking. - * if(type1 == null || type2 == null || - * type1.dataRep == null || type2.dataRep == null || - * type1.dataRep == DataRepresentation.UNKNOWN && type1.klass == null || - * type2.dataRep == DataRepresentation.UNKNOWN && type2.klass == null ) - * { - * result = false ; - * } - * else - * { - * // The types are not consistency when their data representation are not - * // the same, excepted Fixed point and universal float. - * if( ( - * type1.dataRep.equals(DataRepresentation.FLOAT) && - * type1.klass == null && - * type2.dataRep.equals(DataRepresentation.FIXED) - * ) || - * ( - * type2.dataRep.equals(DataRepresentation.FLOAT) && - * type2.klass == null && - * type1.dataRep.equals(DataRepresentation.FIXED) - * ) - * ) - * { - * result = true ; - * } - * else if( false == type1.dataRep.equals(type2.dataRep) || - * (hasToCheckDimension && (type1.dimension != type2.dimension)) - * ) - * { - * result = false ; - * } - * else if(type1.klass != null && type2.klass != null) - * { - * // If both type have a classifier, their classifier's name must match. - * result = type1.klass.getQualifiedName().equalsIgnoreCase( - * type2.klass.getQualifiedName()); - * } - * } - */ - return result; + if (type1 == null || type2 == null || type1.getDataRep() == null || type2.getDataRep() == null) { + return false; + } + if (hasToCheckDimension) { + // A symbolic extent is unknown, not zero. Compare rank and each extent only when both are known. + if (type1.getDimension() >= 0 && type2.getDimension() >= 0 + && type1.getDimension() != type2.getDimension()) { + return false; + } + var sizes1 = type1.getDimensionSizes(); + var sizes2 = type2.getDimensionSizes(); + if (sizes1 != null && sizes2 != null) { + for (var i = 0; i < Math.min(sizes1.length, sizes2.length); i++) { + if (sizes1[i] > 0 && sizes2[i] > 0 && sizes1[i] != sizes2[i]) { + return false; + } + } + } + } + // Untyped features and unresolved references do not establish a mismatch. Let resolution diagnostics stand + // on their own instead of adding errors that claim an unknown type disagrees with a known one. + if (type1.getDataRep() == DataRepresentation.UNKNOWN && type1.getKlass() == null + || type2.getDataRep() == DataRepresentation.UNKNOWN && type2.getKlass() == null) { + return true; + } + if (type1.getKlass() != null && type2.getKlass() != null) { + // Annex D does not define classifier substitutability. OSATE uses nominal equality, including for + // classifiers without a Data_Representation; extension and type/implementation pairs are distinct. + if (!type1.getKlass().getQualifiedName().equalsIgnoreCase(type2.getKlass().getQualifiedName())) { + return false; + } + } + if (type1.getDataRep() == DataRepresentation.UNKNOWN || type2.getDataRep() == DataRepresentation.UNKNOWN) { + return type1.getKlass() != null && type2.getKlass() != null; + } + // Ada universal real literals may initialize either floating or fixed-point values. This does not permit + // implicit conversions between classifier-typed numerics or between integer and real literals. + return type1.getDataRep() == type2.getDataRep() + || isUniversalReal(type1) && type2.getDataRep() == DataRepresentation.FIXED + || isUniversalReal(type2) && type1.getDataRep() == DataRepresentation.FIXED; + } + + private static boolean isUniversalReal(TypeHolder type) { + return type.getKlass() == null && type.getDataRep() == DataRepresentation.FLOAT; } public TypeHolder getTopLevelType(TypeHolder type1, TypeHolder type2) { @@ -132,10 +120,12 @@ public TypeHolder getTopLevelType(TypeHolder type1, TypeHolder type2) { } private TypeHolder getTopLevelTypeWithoutConsistencyChecking(TypeHolder type1, TypeHolder type2) { - var result = new TypeHolder(); - result.setDataRep(type1.getDataRep()); - var c = (type1.getKlass() != null) ? type1.getKlass() : type2.getKlass(); - result.setKlass(c); + // A universal literal adopts the other operand's declared type, including fixed-point representation. + var source = type1.getKlass() != null || type2.getKlass() == null ? type1 : type2; + var result = new TypeHolder(source.getDataRep(), source.getKlass()); + result.setDimension(source.getDimension()); + var sizes = source.getDimensionSizes(); + result.setDimensionSizes(sizes == null ? null : sizes.clone()); return result; } @@ -150,7 +140,7 @@ public TypeHolder checkDefinition(BehaviorElement e, Enumerator operator, TypeHo if (operator instanceof LogicalOperator) { if (operand1.getDataRep() == DataRepresentation.BOOLEAN) { - return getTopLevelTypeWithoutConsistencyChecking(operand1, operand1); + return getTopLevelTypeWithoutConsistencyChecking(operand1, operand2); } else { reportErrorBinaryOperator(e, operator, operand1); return null; diff --git a/ba/org.osate.ba/src/org/osate/ba/analyzers/TypeHolder.java b/ba/org.osate.ba/src/org/osate/ba/analyzers/TypeHolder.java index 2221744de8d..3704765b0cd 100644 --- a/ba/org.osate.ba/src/org/osate/ba/analyzers/TypeHolder.java +++ b/ba/org.osate.ba/src/org/osate/ba/analyzers/TypeHolder.java @@ -49,8 +49,6 @@ public class TypeHolder { */ private long[] dimension_sizes = new long[0]; - private static final String ARRAY_DIMENSION_TOKEN = "[]"; - /** * Builds a TypeHolder object with default attributes ({@code null}). */ @@ -79,7 +77,11 @@ public String toString() { } for (int i = 0; i < getDimension(); i++) { - result.append(ARRAY_DIMENSION_TOKEN); + result.append('['); + if (dimension_sizes != null && i < dimension_sizes.length && dimension_sizes[i] > 0) { + result.append(dimension_sizes[i]); + } + result.append(']'); } return result.toString(); diff --git a/ba/org.osate.ba/src/org/osate/ba/utils/AadlBaUtils.java b/ba/org.osate.ba/src/org/osate/ba/utils/AadlBaUtils.java index c3f35a257eb..67d557262bf 100644 --- a/ba/org.osate.ba/src/org/osate/ba/utils/AadlBaUtils.java +++ b/ba/org.osate.ba/src/org/osate/ba/utils/AadlBaUtils.java @@ -1024,8 +1024,9 @@ public static TypeHolder getTypeHolder(Element el, ComponentClassifier parentCon result = getTypeHolder(iv); - processArrayDataRepresentation(el, result, 0); - + // This is the iterator's own declared type. Expanding its Base_Type here would turn an iterator over + // rows into an integer before the enclosing loop compares it with the matrix's row type. A use of + // the iterator as an iterable is normalized through its holder, like any other array value. return result; } else if (el instanceof DataClassifier) { DataClassifier dc = (DataClassifier) el; @@ -1142,6 +1143,7 @@ private static void processArrayDataRepresentation(Element el, TypeHolder type, throws DimensionException { // Treats only type declared as an array. Otherwise returns. if (type.getDataRep() == DataRepresentation.ARRAY) { + var arrayClassifier = type.getKlass(); // Fetches the array element data type. ClassifierValue cv = AadlBaUtils.getBaseType(type.getKlass()); @@ -1153,7 +1155,7 @@ private static void processArrayDataRepresentation(Element el, TypeHolder type, type.setKlass(null); } - EList pel = PropertyUtils.findPropertyExpression(type.getKlass(), + EList pel = PropertyUtils.findPropertyExpression(arrayClassifier, DataModelProperties.DIMENSION); int declareDimBT = 0; long[] declareDimSizeBT; diff --git a/ba/org.osate.xtext.aadl2.ba/src/org/osate/xtext/aadl2/ba/validation/BehaviorAnnexValidator.java b/ba/org.osate.xtext.aadl2.ba/src/org/osate/xtext/aadl2/ba/validation/BehaviorAnnexValidator.java index d3058799086..0483dc18e1f 100644 --- a/ba/org.osate.xtext.aadl2.ba/src/org/osate/xtext/aadl2/ba/validation/BehaviorAnnexValidator.java +++ b/ba/org.osate.xtext.aadl2.ba/src/org/osate/xtext/aadl2/ba/validation/BehaviorAnnexValidator.java @@ -192,7 +192,8 @@ public void checkBehaviorAnnex(final BehaviorAnnex source) { resource -> new ValidatorErrorReporter(resource, this, translation, reported)); var dataTypeChecker = new AdaLikeDataTypeChecker(errorManager); var typeChecker = new AadlBaTypeChecker(strictAnnex, owner, dataTypeChecker, errorManager); - if (typeChecker.checkTypes()) { + if (typeChecker.checkResolution()) { + typeChecker.checkResolvedTypes(); new AadlBaInitializationChecker(strictAnnex, errorManager).check(); new AadlBaRulesCheckersDriver(strictAnnex, owner, errorManager).process(strictAnnex); }