From a482cf191f671083e6157cfe0dfc3d7ae9575624 Mon Sep 17 00:00:00 2001 From: Lutz Wrage Date: Fri, 18 Sep 2026 11:03:21 -0400 Subject: [PATCH 1/2] Add regression test for issue #3181 Exercise communication target categories and directions, send payload counts, and complete subprogram signatures through embedded BA validation. Check writable actuals and preserve record-field and port targets in otherwise valid calls. The seven regressions fail on the current implementation: invalid actions and calls receive no diagnostics, and a valid out record-field argument is translated as a value expression. Keep property-dependent conformance separate under issue #3199. --- .../models/issue3181/.gitignore | 2 + .../models/issue3181/.project | 18 +++ .../models/issue3181/CallActuals.aadl | 51 ++++++ .../models/issue3181/CallCounts.aadl | 56 +++++++ .../models/issue3181/CallExpressions.aadl | 43 +++++ .../issue3181/CommunicationTargets.aadl | 59 +++++++ .../models/issue3181/FeatureActuals.aadl | 60 +++++++ .../models/issue3181/InternalSend.aadl | 41 +++++ .../models/issue3181/Issue3181.aadl | 79 ++++++++++ .../src/org/osate/ba/tests/Issue3181Test.java | 147 ++++++++++++++++++ 10 files changed, 556 insertions(+) create mode 100644 ba/org.osate.ba.tests/models/issue3181/.gitignore create mode 100644 ba/org.osate.ba.tests/models/issue3181/.project create mode 100644 ba/org.osate.ba.tests/models/issue3181/CallActuals.aadl create mode 100644 ba/org.osate.ba.tests/models/issue3181/CallCounts.aadl create mode 100644 ba/org.osate.ba.tests/models/issue3181/CallExpressions.aadl create mode 100644 ba/org.osate.ba.tests/models/issue3181/CommunicationTargets.aadl create mode 100644 ba/org.osate.ba.tests/models/issue3181/FeatureActuals.aadl create mode 100644 ba/org.osate.ba.tests/models/issue3181/InternalSend.aadl create mode 100644 ba/org.osate.ba.tests/models/issue3181/Issue3181.aadl create mode 100644 ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3181Test.java diff --git a/ba/org.osate.ba.tests/models/issue3181/.gitignore b/ba/org.osate.ba.tests/models/issue3181/.gitignore new file mode 100644 index 00000000000..afce51184c6 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3181/.gitignore @@ -0,0 +1,2 @@ +/.aadlbin-gen/ +/instances/ diff --git a/ba/org.osate.ba.tests/models/issue3181/.project b/ba/org.osate.ba.tests/models/issue3181/.project new file mode 100644 index 00000000000..b6ae0b1df87 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3181/.project @@ -0,0 +1,18 @@ + + + issue3181 + + + + + + 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/issue3181/CallActuals.aadl b/ba/org.osate.ba.tests/models/issue3181/CallActuals.aadl new file mode 100644 index 00000000000..36c5029fe3c --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3181/CallActuals.aadl @@ -0,0 +1,51 @@ +-- 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 CallActuals +public + with Base_Types; + subprogram operation + features + argument : in parameter Base_Types::Integer; + result : out parameter Base_Types::Integer; + end operation; + subprogram host + features + input : in parameter Base_Types::Integer; + output : out parameter Base_Types::Integer; + end host; + subprogram implementation host.i + annex behavior_specification {** + variables + value : Base_Types::Integer := 1; + states + start : initial state; + done : final state; + transitions + t0 : start -[]-> done { operation!(1, 2) }; + t1 : start -[]-> done { operation!(1, value + 1) }; + t2 : start -[]-> done { operation!(1, input) }; + t3 : start -[]-> done { operation!(output, value) }; + t4 : start -[]-> done { for (i in 1 .. 2) { operation!(1, i) } }; + **}; + end host.i; +end CallActuals; diff --git a/ba/org.osate.ba.tests/models/issue3181/CallCounts.aadl b/ba/org.osate.ba.tests/models/issue3181/CallCounts.aadl new file mode 100644 index 00000000000..f1bd53dc624 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3181/CallCounts.aadl @@ -0,0 +1,56 @@ +-- 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 CallCounts +public + with Base_Types; + subprogram operation + features + argument : in parameter Base_Types::Integer; + result : out parameter Base_Types::Integer; + changed : in out parameter Base_Types::Integer; + shared : requires data access Base_Types::Integer; + signal : out event port; + end operation; + subprogram implementation operation.i + end operation.i; + abstract host + features + call_access : requires subprogram access operation; + end host; + abstract implementation host.i + subcomponents + local_call : subprogram operation.i; + annex behavior_specification {** + variables + value : Base_Types::Integer := 1; + states + start : initial state; + done : final state; + transitions + t0 : start -[]-> done { operation! }; + t1 : start -[]-> done { operation.i!(1) }; + t2 : start -[]-> done { call_access!(1, value) }; + t3 : start -[]-> done { local_call!(1, value, value, value, value, value) }; + **}; + end host.i; +end CallCounts; diff --git a/ba/org.osate.ba.tests/models/issue3181/CallExpressions.aadl b/ba/org.osate.ba.tests/models/issue3181/CallExpressions.aadl new file mode 100644 index 00000000000..d685dc72299 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3181/CallExpressions.aadl @@ -0,0 +1,43 @@ +-- Copyright (c) 2004-2026 Carnegie Mellon University and others. (see Contributors file). +-- All Rights Reserved. +-- +-- NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY +-- KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE +-- OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT +-- MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. +-- +-- This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 +-- which is available at https://www.eclipse.org/legal/epl-2.0/ +-- SPDX-License-Identifier: EPL-2.0 +-- +-- Created, in part, with funding and support from the United States Government. (see Acknowledgments file). +-- +-- This program includes and/or can make use of certain third party source code, object code, documentation and other +-- files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system +-- configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and +-- conditions contained in any such Third Party Software or separate license file distributed with such Third Party +-- Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici- +-- aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li- +-- censes only apply to the Third Party Software and not any other portion of this program or this program as a whole. + +package CallExpressions +public + with Base_Types; + subprogram operation + features + argument : in parameter Base_Types::Integer; + end operation; + abstract host + end host; + abstract implementation host.i + annex behavior_specification {** + variables + value : Base_Types::Integer := 1; + states + start : initial state; + done : final state; + transitions + t0 : start -[]-> done { operation!(1 and 2) }; + **}; + end host.i; +end CallExpressions; diff --git a/ba/org.osate.ba.tests/models/issue3181/CommunicationTargets.aadl b/ba/org.osate.ba.tests/models/issue3181/CommunicationTargets.aadl new file mode 100644 index 00000000000..31c6bcb7bac --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3181/CommunicationTargets.aadl @@ -0,0 +1,59 @@ +-- 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 CommunicationTargets +public + with Base_Types; + abstract host + features + input : in event data port Base_Types::Integer; + output : out event data port Base_Types::Integer; + input_data : in data port Base_Types::Integer; + input_event : in event port; + output_event : out event port; + shared : requires data access Base_Types::Integer; + provided : provides data access Base_Types::Integer; + end host; + abstract implementation host.i + annex behavior_specification {** + variables + value : Base_Types::Integer := 1; + states + start : initial state; + done : final state; + transitions + t0 : start -[]-> done { input! }; + t1 : start -[]-> done { output? }; + t2 : start -[]-> done { input_data? }; + t3 : start -[]-> done { output>> }; + t4 : start -[]-> done { value! }; + t5 : start -[]-> done { value? }; + t6 : start -[]-> done { value>> }; + t7 : start -[]-> done { value!< }; + t8 : start -[]-> done { provided!< }; + t9 : start -[]-> done { output!(1, 2) }; + t10 : start -[]-> done { output_event!(1) }; + t11 : start -[]-> done { input_event?(value) }; + t12 : start -[]-> done { input?(input_data) }; + **}; + end host.i; +end CommunicationTargets; diff --git a/ba/org.osate.ba.tests/models/issue3181/FeatureActuals.aadl b/ba/org.osate.ba.tests/models/issue3181/FeatureActuals.aadl new file mode 100644 index 00000000000..be2620cbe76 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3181/FeatureActuals.aadl @@ -0,0 +1,60 @@ +-- 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 FeatureActuals +public + with Base_Types; + subprogram operation + features + argument : in parameter Base_Types::Integer; + result : out parameter Base_Types::Integer; + changed : in out parameter Base_Types::Integer; + shared : requires data access Base_Types::Integer; + signal : out event port; + end operation; + subprogram implementation operation.i + end operation.i; + abstract host + features + input : in event data port Base_Types::Integer; + output : out event data port Base_Types::Integer; + input_data : in data port Base_Types::Integer; + input_event : in event port; + output_event : out event port; + shared : requires data access Base_Types::Integer; + provided : provides data access Base_Types::Integer; + end host; + abstract implementation host.i + annex behavior_specification {** + variables + value : Base_Types::Integer := 1; + states + start : initial state; + done : final state; + transitions + t0 : start -[]-> done { operation!(1, value, value, 2, output_event) }; + t1 : start -[]-> done { operation!(1, value, value, shared, 2) }; + t2 : start -[]-> done { operation!(1, value, value, shared, input_event) }; + t3 : start -[]-> done { operation!(1, value, value, shared, output) }; + **}; + end host.i; +end FeatureActuals; diff --git a/ba/org.osate.ba.tests/models/issue3181/InternalSend.aadl b/ba/org.osate.ba.tests/models/issue3181/InternalSend.aadl new file mode 100644 index 00000000000..229f6924814 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3181/InternalSend.aadl @@ -0,0 +1,41 @@ +-- 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 InternalSend +public + with Base_Types; + abstract host + end host; + abstract implementation host.i + internal features + internal_data : event data Base_Types::Integer; + annex behavior_specification {** + variables + value : Base_Types::Integer := 1; + states + start : initial state; + done : final state; + transitions + t0 : start -[]-> done { internal_data!(1, 2) }; + **}; + end host.i; +end InternalSend; diff --git a/ba/org.osate.ba.tests/models/issue3181/Issue3181.aadl b/ba/org.osate.ba.tests/models/issue3181/Issue3181.aadl new file mode 100644 index 00000000000..a3f56dda811 --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3181/Issue3181.aadl @@ -0,0 +1,79 @@ +-- Copyright (c) 2004-2026 Carnegie Mellon University and others. (see Contributors file). +-- All Rights Reserved. +-- +-- NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY +-- KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE +-- OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT +-- MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. +-- +-- This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 +-- which is available at https://www.eclipse.org/legal/epl-2.0/ +-- SPDX-License-Identifier: EPL-2.0 +-- +-- Created, in part, with funding and support from the United States Government. (see Acknowledgments file). +-- +-- This program includes and/or can make use of certain third party source code, object code, documentation and other +-- files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system +-- configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and +-- conditions contained in any such Third Party Software or separate license file distributed with such Third Party +-- Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici- +-- aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li- +-- censes only apply to the Third Party Software and not any other portion of this program or this program as a whole. + +package Issue3181 +public + with Base_Types; + subprogram operation + features + argument : in parameter Base_Types::Integer; + result : out parameter Base_Types::Integer; + changed : in out parameter Base_Types::Integer; + shared : requires data access Base_Types::Integer; + signal : out event port; + end operation; + subprogram implementation operation.i + end operation.i; + data record_type + end record_type; + data implementation record_type.i + subcomponents + field : data Base_Types::Integer; + end record_type.i; + feature group outputs + features + channel : out event data port Base_Types::Integer; + end outputs; + abstract host + features + input : in event data port Base_Types::Integer; + output : out event data port Base_Types::Integer; + input_data : in data port Base_Types::Integer; + input_event : in event port; + output_event : out event port; + shared : requires data access Base_Types::Integer; + provided : provides data access Base_Types::Integer; + call_access : requires subprogram access operation; + group_output : feature group outputs; + group_input : feature group inverse of outputs; + end host; + abstract implementation host.i + subcomponents + local_call : subprogram operation.i; + record_value : data record_type.i; + annex behavior_specification {** + variables + value : Base_Types::Integer := 1; + states + start : initial state; + done : final state; + transitions + t0 : start -[]-> done { output!(1); output!; output_event!; input?; input?(value); input>>; input_data>> }; + t1 : start -[]-> done { shared!<; shared!> }; + t2 : start -[]-> done { group_output.channel!(1); group_input.channel?(value); group_input.channel>> }; + t3 : start -[]-> done { operation!(1, value, value, shared, output_event) }; + t4 : start -[]-> done { operation.i!(1, value, value, shared, output_event) }; + t5 : start -[]-> done { call_access!(1, record_value.field, value, shared, output_event) }; + t6 : start -[]-> done { local_call!(1, value, value, shared, output_event) }; + **}; + end host.i; +end Issue3181; diff --git a/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3181Test.java b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3181Test.java new file mode 100644 index 00000000000..1210f36d5e2 --- /dev/null +++ b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3181Test.java @@ -0,0 +1,147 @@ +/** + * Copyright (c) 2004-2026 Carnegie Mellon University and others. (see Contributors file). + * All Rights Reserved. + * + * NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY + * KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE + * OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT + * MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. + * + * This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * SPDX-License-Identifier: EPL-2.0 + * + * Created, in part, with funding and support from the United States Government. (see Acknowledgments file). + * + * This program includes and/or can make use of certain third party source code, object code, documentation and other + * files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system + * configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and + * conditions contained in any such Third Party Software or separate license file distributed with such Third Party + * Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici- + * aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li- + * censes only apply to the Third Party Software and not any other portion of this program or this program as a whole. + */ +package org.osate.ba.tests; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.util.Comparator; +import java.util.List; + +import org.eclipse.xtext.diagnostics.Severity; +import org.eclipse.xtext.nodemodel.util.NodeModelUtils; +import org.eclipse.xtext.testing.InjectWith; +import org.eclipse.xtext.testing.XtextRunner; +import org.eclipse.xtext.testing.validation.ValidationTestHelper; +import org.eclipse.xtext.validation.Issue; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.osate.aadl2.AadlPackage; +import org.osate.annexsupport.AnnexUtil; +import org.osate.ba.aadlba.SubprogramCallAction; +import org.osate.ba.aadlba.Target; +import org.osate.testsupport.TestHelper; +import org.osate.xtext.aadl2.ba.util.BehaviorAnnexUtil; + +import com.google.inject.Inject; +import com.itemis.xtext.testing.XtextTest; + +/** Exercises communication targets and complete call signatures through embedded BA validation. */ +@RunWith(XtextRunner.class) +@InjectWith(BehaviorAnnexInjectorProvider.class) +public class Issue3181Test extends XtextTest { + private static final String PATH = "org.osate.ba.tests/models/issue3181/"; + + @Inject + private TestHelper testHelper; + + @Inject + private ValidationTestHelper validationHelper; + + @Test + public void validCommunicationsAndCallFormsAreAccepted() throws Exception { + var root = testHelper.parseFile(PATH + "Issue3181.aadl"); + validationHelper.assertNoIssues(root); + var annex = BehaviorAnnexUtil.getStrictModel(AnnexUtil.getAllDefaultAnnexSubclauses(root).getFirst()); + var call = (SubprogramCallAction) annex.getTransitions().get(5).getActionBlock().getContent(); + assertEquals(5, call.getParameterLabels().size()); + assertTrue("A record field used as an out actual must remain a target", call.getParameterLabels().get(1) instanceof Target); + assertTrue("An output port formal must retain its target", call.getParameterLabels().get(4) instanceof Target); + } + + @Test + public void communicationTargetsAndPayloadCountsAreChecked() throws Exception { + assertDiagnostics("CommunicationTargets", List.of( + new Expected("input", "A port send action requires an outgoing port"), + new Expected("output", "A dequeue action requires an incoming event or event data port"), + new Expected("input_data", "A dequeue action requires an incoming event or event data port"), + new Expected("output", "A freeze action requires an incoming port"), + new Expected("value", "A send or call action requires a port, internal feature, or callable subprogram"), + new Expected("value", "A dequeue action requires an incoming event or event data port"), + new Expected("value", "A freeze action requires an incoming port"), + new Expected("value", "A lock or unlock action requires a required data access"), + new Expected("provided", "A lock or unlock action requires a required data access"), + new Expected("output!(1, 2)", "A port send action accepts at most one value"), + new Expected("output_event!(1)", "An event port send action cannot carry a value"), + new Expected("input_event?(value)", "An event port dequeue action cannot assign a data value"), + new Expected("input_data", "A dequeue target must be writable"))); + } + + @Test + public void internalSendCannotDiscardExtraValues() throws Exception { + assertDiagnostics("InternalSend", List.of(new Expected("internal_data!(1, 2)", + "A port send action accepts at most one value"))); + } + + @Test + public void everyFormalCountsForEveryCallableForm() throws Exception { + assertDiagnostics("CallCounts", List.of( + new Expected("operation!", "Subprogram call requires 5 actuals but has 0"), + new Expected("operation.i!(1)", "Subprogram call requires 5 actuals but has 1"), + new Expected("call_access!(1, value)", "Subprogram call requires 5 actuals but has 2"), + new Expected("local_call!(1, value, value, value, value, value)", "Subprogram call requires 5 actuals but has 6"))); + } + + @Test + public void parameterDirectionsRequireReadableValuesAndWritableTargets() throws Exception { + assertDiagnostics("CallActuals", List.of( + new Expected("2", "Actual for out parameter 'result' must be a writable target"), + new Expected("value + 1", "Actual for out parameter 'result' must be a writable target"), + new Expected("input", "Actual for out parameter 'result' must be a writable target"), + new Expected("output", "Actual for in parameter 'argument' must be readable"), + new Expected("i", "Actual for out parameter 'result' must be a writable target"))); + } + + @Test + public void dataAccessAndPortActualsMatchTheirFormalCategories() throws Exception { + assertDiagnostics("FeatureActuals", List.of( + new Expected("2", "Actual for data access 'shared' must reference data"), + new Expected("2", "Actual for port 'signal' must reference a port of the same category and direction"), + new Expected("input_event", "Actual for port 'signal' must reference a port of the same category and direction"), + new Expected("output", "Actual for port 'signal' must reference a port of the same category and direction"))); + } + + @Test + public void inputActualExpressionsAreTypeChecked() throws Exception { + var root = testHelper.parseFile(PATH + "CallExpressions.aadl"); + var issues = validationHelper.validate(root); + assertEquals(issues.toString(), 1, issues.size()); + assertEquals(Severity.ERROR, issues.getFirst().getSeverity()); + assertTrue(issues.toString(), issues.getFirst().getMessage().contains("and")); + } + + 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) { + } +} From c281b94e89d269cee2b44c78dc96263330e85a9f Mon Sep 17 00:00:00 2001 From: Lutz Wrage Date: Fri, 18 Sep 2026 11:17:10 -0400 Subject: [PATCH 2/2] Validate Behavior Annex communication and call signatures Reject invalid communication targets, extra send values, and mismatched call arity or actual directions and categories. Include every formal feature in source order, preserving inherited positions and refinements across supported callable forms. Retain writable record-field and port actuals as targets, and route call data actuals through the existing type checker. Property-dependent conformance and access rights remain deferred to issue #3199 and instance validation. Refresh the affected characterization goldens and document these boundaries. Validation: all eight issue regressions and 207 BA tests pass. The clean offline root reactor passes 143 projects and 1,668 tests with no failures, errors, or skips. --- ba/doc/conformance.md | 18 +- ...s_models_covering_syntax_aadlBaTest002.txt | 21 +- ...s_models_covering_syntax_aadlBaTest005.txt | 7 + ...te.ba.tests_models_issue2466_issue2466.txt | 3 + ...te.ba.tests_models_issue2525_issue2525.txt | 2 + ....ba.tests_models_issue3181_CallActuals.txt | 5 + ...e.ba.tests_models_issue3181_CallCounts.txt | 4 + ...tests_models_issue3181_CallExpressions.txt | 1 + ..._models_issue3181_CommunicationTargets.txt | 14 ++ ....tests_models_issue3181_FeatureActuals.txt | 4 + ....tests_models_issue3181_InheritedCalls.txt | 0 ...ba.tests_models_issue3181_InternalSend.txt | 1 + ...te.ba.tests_models_issue3181_Issue3181.txt | 0 ....ba.tests_models_issue3181_CallActuals.txt | 0 ...e.ba.tests_models_issue3181_CallCounts.txt | 0 ...tests_models_issue3181_CallExpressions.txt | 0 ..._models_issue3181_CommunicationTargets.txt | 0 ....tests_models_issue3181_FeatureActuals.txt | 0 ....tests_models_issue3181_InheritedCalls.txt | 0 ...ba.tests_models_issue3181_InternalSend.txt | 0 ...te.ba.tests_models_issue3181_Issue3181.txt | 0 ....ba.tests_models_issue3181_CallActuals.txt | 60 +++++ ...e.ba.tests_models_issue3181_CallCounts.txt | 52 ++++ ...tests_models_issue3181_CallExpressions.txt | 17 ++ ..._models_issue3181_CommunicationTargets.txt | 88 +++++++ ....tests_models_issue3181_FeatureActuals.txt | 77 ++++++ ....tests_models_issue3181_InheritedCalls.txt | 52 ++++ ...ba.tests_models_issue3181_InternalSend.txt | 16 ++ ...te.ba.tests_models_issue3181_Issue3181.txt | 142 +++++++++++ ...s_models_covering_syntax_aadlBaTest002.txt | 22 +- ...te.ba.tests_models_issue2466_issue2466.txt | 130 ++++------ ....ba.tests_models_issue3181_CallActuals.txt | 84 +++++++ ...e.ba.tests_models_issue3181_CallCounts.txt | 51 ++++ ...tests_models_issue3181_CallExpressions.txt | 21 ++ ..._models_issue3181_CommunicationTargets.txt | 73 ++++++ ....tests_models_issue3181_FeatureActuals.txt | 72 ++++++ ....tests_models_issue3181_InheritedCalls.txt | 75 ++++++ ...ba.tests_models_issue3181_InternalSend.txt | 16 ++ ...te.ba.tests_models_issue3181_Issue3181.txt | 111 +++++++++ ...amples_toy_examples_multiModalPingPong.txt | 11 +- ....ba.tests_models_issue3181_CallActuals.txt | 16 ++ ...e.ba.tests_models_issue3181_CallCounts.txt | 15 ++ ...tests_models_issue3181_CallExpressions.txt | 12 + ..._models_issue3181_CommunicationTargets.txt | 25 ++ ....tests_models_issue3181_FeatureActuals.txt | 15 ++ ....tests_models_issue3181_InheritedCalls.txt | 15 ++ ...ba.tests_models_issue3181_InternalSend.txt | 12 + ...te.ba.tests_models_issue3181_Issue3181.txt | 18 ++ .../issue3181/CommunicationTargets.aadl | 1 + .../models/issue3181/InheritedCalls.aadl | 68 ++++++ .../src/org/osate/ba/tests/Issue3181Test.java | 75 +++--- .../osate/ba/analyzers/AadlBaTypeChecker.java | 35 +++ .../osate/ba/utils/SubprogramCallUtil.java | 89 +++++++ .../DeclarativeToStrictTranslator.java | 57 +---- .../ba/validation/BehaviorAnnexValidator.java | 222 ++++++++++++++++++ 55 files changed, 1709 insertions(+), 216 deletions(-) create mode 100644 ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_CallActuals.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_CallCounts.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_CallExpressions.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_FeatureActuals.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_InheritedCalls.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_InternalSend.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_Issue3181.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_CallActuals.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_CallCounts.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_CallExpressions.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_FeatureActuals.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_InheritedCalls.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_InternalSend.txt create mode 100644 ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_Issue3181.txt create mode 100644 ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_CallActuals.txt create mode 100644 ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_CallCounts.txt create mode 100644 ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_CallExpressions.txt create mode 100644 ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt create mode 100644 ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_FeatureActuals.txt create mode 100644 ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_InheritedCalls.txt create mode 100644 ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_InternalSend.txt create mode 100644 ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_Issue3181.txt create mode 100644 ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_CallActuals.txt create mode 100644 ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_CallCounts.txt create mode 100644 ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_CallExpressions.txt create mode 100644 ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt create mode 100644 ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_FeatureActuals.txt create mode 100644 ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_InheritedCalls.txt create mode 100644 ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_InternalSend.txt create mode 100644 ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_Issue3181.txt create mode 100644 ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_CallActuals.txt create mode 100644 ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_CallCounts.txt create mode 100644 ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_CallExpressions.txt create mode 100644 ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt create mode 100644 ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_FeatureActuals.txt create mode 100644 ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_InheritedCalls.txt create mode 100644 ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_InternalSend.txt create mode 100644 ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_Issue3181.txt create mode 100644 ba/org.osate.ba.tests/models/issue3181/InheritedCalls.aadl create mode 100644 ba/org.osate.ba/src/org/osate/ba/utils/SubprogramCallUtil.java diff --git a/ba/doc/conformance.md b/ba/doc/conformance.md index fb3c9ed8630..0be9303e1a7 100644 --- a/ba/doc/conformance.md +++ b/ba/doc/conformance.md @@ -59,8 +59,8 @@ 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; call-signature and remaining communication direction/category checks need additional coverage. Input/output timing consistency is not established. | -| D.6: action language | Assignment/`any`, sequences and sets, blocks, conditionals, loops with a written or an omitted iterator classifier, timed actions and processor bindings. Conflicting assignments in action sets and static minimum/maximum computation-time checks exist. | Partial. Type conformance is disabled outright, so no assignment, send, dequeue, range, or parameter type mismatch is reported (G18). Optional loop classifiers were missing (G09) and are now implemented; loop-variable assignment rejection was not enforced by the existing covering-test expectation (G16, since fixed, though the dequeue form is still open as [#3205](https://github.com/osate/osate2/issues/3205)); action-timeout catch and combination rules (V03) and shared-data resource release (#3189) are now checked, while signature obligations remain incomplete or unverified. | +| 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.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. | @@ -164,13 +164,17 @@ The AST precedence error and the strict-model flattening error must be assessed **Addressed by [#3205](https://github.com/osate/osate2/issues/3205):** D.6 gives the assignment action and the port dequeue action the same `target` production, so the rule reaches the dequeue action too, and the same check now covers it: `p?(i)` and `p?(i.field)` are rejected for the same reason and with the same message as their assignment counterparts. The dequeue shape was invisible for one more reason, that `AadlBaTypeChecker.checkPortDequeue` accepts a dequeue with no target at all, which is what translation leaves behind when the target names an iterator. `Issue3205Test` verifies exact diagnostics and source ranges across both loop forms and nested scopes, and keeps a targetless dequeue, a dequeue into a behavior variable shadowed by an iterator, and a dequeue into a data element of a behavior variable valid. -### G17 — Call signatures and communication categories lack complete enforcement +### G17 — Communication categories and structural call signatures -**Standard:** D.5–D.6 constrain communication targets and require actual call parameters to match the called subprogram's features/signature. +**Standard:** D.5–D.6 constrain communication targets and require actual call parameters to match the called subprogram's features/signature, in declaration order. -**Evidence:** The grammar's `CommunicationAction` accepts a generic reference and a list of expressions. Translator `toCommunicationAction` distinguishes an ordinary port send from a subprogram call, but a port send takes only the first expression from that list. `getFormalParameters` selects parameters and data accesses. [AadlBaTypeChecker.checkBasicAction](../../ba/org.osate.ba/src/org/osate/ba/analyzers/AadlBaTypeChecker.java) checks assignment, port send, and dequeue actions, then returns true for other basic actions; it does not validate a `SubprogramCallAction` signature. The rules driver does not add that signature check. +**Implemented for [#3181](https://github.com/osate/osate2/issues/3181):** The declarative validator rejects non-callable targets, sends on incoming ports, dequeues on outgoing or data-only ports, freezes on outgoing ports, and individual lock/unlock actions on elements other than required data accesses. Port sends reject extra values instead of silently accepting only the first; event-port sends and dequeues cannot carry data. Feature-group inversion is included in direction checks. -**Assessment:** Source-confirmed incomplete checking and a source-confirmed extra-argument discard path for port sends. The exact user-visible acceptance/diagnostics of each invalid call needs external-model reproduction. Required cases include missing/extra parameters, wrong parameter type or direction, calls involving supported non-parameter features, sends on input ports, and attempts to call non-callable elements. G10 illustrates why a generic holder fallback must not be treated as proof of a valid communication action. +Signatures include every feature, including ports, in source declaration order. Inherited features precede added features and refinements retain their inherited positions. Classifier, implementation, subprogram-access, subcomponent, and constrained-prototype calls use the same signature lookup. Unconstrained, unbound prototypes have no signature to check yet. Parameters require readable input expressions and writable output targets; data-access actuals must reference data; port actuals must match the port category and direction. Formal categories that the strict model cannot represent receive an explicit unsupported-feature diagnostic rather than being omitted from the signature. Writable record-field and port actuals remain targets in the strict model. + +**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. ### G18 — Type conformance is disabled, so no type mismatch is reported @@ -233,7 +237,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; G15, G17, 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). 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. | | 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/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_covering_syntax_aadlBaTest002.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_covering_syntax_aadlBaTest002.txt index a536a3e8c5a..4264da2607e 100644 --- a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_covering_syntax_aadlBaTest002.txt +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_covering_syntax_aadlBaTest002.txt @@ -1,19 +1,11 @@ error | semantic | 230 | 17 | 14 | Port status value 'outPortA'count' is defined only for a port that is frozen on input, but 'outPortA' is an outgoing port. AS5506/3 Rev. A states no corresponding legality rule. error | semantic | 237 | 23 | 14 | Port status value 'outPortA'fresh' is defined only for a port that is frozen on input, but 'outPortA' is an outgoing port. AS5506/3 Rev. A states no corresponding legality rule. -error | semantic | 643 | 22 | 13 | There is no applicable operator ">" for type Base_Types::Boolean -error | semantic | 645 | 22 | 17 | There is no applicable operator ">" for type AadlBaTest::Types::Opaque -error | semantic | 650 | 21 | 14 | There is no applicable operator "+" for type AadlBaTest::Types::Opaque -error | semantic | 655 | 21 | 13 | Operator "-" not defined for type Base_Types::Character -error | semantic | 656 | 24 | 17 | There is no applicable operator "+" for type Base_Types::String -error | semantic | 665 | 21 | 17 | There is no applicable operator "mod" for type Base_Types::Float -error | semantic | 666 | 21 | 17 | There is no applicable operator "rem" for type Base_Types::Float -error | semantic | 669 | 23 | 9 | Operator "abs" not defined for type Base_Types::Character -error | semantic | 673 | 23 | 5 | Operator "!" not defined for type universal integer -error | semantic | 679 | 21 | 56 | exponent must be of type natural, found universal integer -error | semantic | 680 | 21 | 15 | exponent must be of type natural, found DataTypeCheckerTest::NegativeInteger -error | semantic | 681 | 21 | 14 | exponent must be of type natural, found Base_Types::Float -error | semantic | 682 | 21 | 12 | exponent must be of type natural, found Base_Types::Integer -error | semantic | 684 | 23 | 14 | Invalid operand types for operator "**": left operand has type DataTypeCheckerTest::MyFixedPoint, right operand has type Base_Types::Natural +error | semantic | 609 | 26 | 3 | Actual for out parameter 'y' must be a writable target +error | semantic | 611 | 13 | 8 | Subprogram call requires 2 actuals but has 0 +error | semantic | 612 | 13 | 23 | Subprogram call requires 0 actuals but has 2 +error | semantic | 614 | 13 | 14 | Subprogram call requires 2 actuals but has 0 +error | semantic | 615 | 13 | 10 | A send or call action requires a port, internal feature, or callable subprogram +error | semantic | 618 | 30 | 1 | Actual for out parameter 'y' must be a writable target warning | semantic | 25 | 33 | 21 | AadlBaTestPropertySet in 'with' clause of public package section is not used. warning | semantic | 25 | 75 | 20 | AadlBaTestSubprogram in 'with' clause of public package section is not used. warning | semantic | 426 | 21 | 1 | Unary plus is not part of AS5506/3 Rev. A @@ -32,4 +24,3 @@ warning | semantic | 454 | 23 | 1 | Unary plus is not part of AS5506/3 Rev. A warning | semantic | 456 | 23 | 1 | Unary plus is not part of AS5506/3 Rev. A warning | semantic | 458 | 23 | 1 | Unary plus is not part of AS5506/3 Rev. A warning | semantic | 460 | 23 | 1 | Unary plus is not part of AS5506/3 Rev. A -warning | semantic | 683 | 21 | 38 | Cannot evaluate if the exponent is a natural diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_covering_syntax_aadlBaTest005.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_covering_syntax_aadlBaTest005.txt index d7a37a0a48a..d48df23731a 100644 --- a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_covering_syntax_aadlBaTest005.txt +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_covering_syntax_aadlBaTest005.txt @@ -4,6 +4,13 @@ error | semantic | 182 | 5 | 54 | Invalid circular dependency. Subcomponent 'sub error | semantic | 183 | 5 | 48 | The type of subcomponent 'recursiveGrp' cannot be the object that contains it error | semantic | 231 | 5 | 54 | Invalid circular dependency. Subcomponent 'subprogGrp' directly or indirectly contains 'thread2.impl'. error | semantic | 379 | 5 | 45 | Invalid circular dependency. Subcomponent 'threadGrp' directly or indirectly contains 'process1.impl'. +error | semantic | 476 | 16 | 25 | A port send action requires an outgoing port +error | semantic | 477 | 16 | 24 | A freeze action requires an incoming port +error | semantic | 478 | 16 | 24 | A dequeue action requires an incoming event or event data port +error | semantic | 482 | 16 | 34 | A lock or unlock action requires a required data access +error | semantic | 483 | 16 | 34 | A lock or unlock action requires a required data access +error | semantic | 484 | 16 | 47 | A lock or unlock action requires a required data access +error | semantic | 485 | 16 | 47 | A lock or unlock action requires a required data access error | semantic | 96 | 5 | 42 | Feature group directly or indirectly contains itself warning | semantic | 29 | 30 | 21 | AadlBaTestPropertySet in 'with' clause of public package section is not used. warning | semantic | 29 | 72 | 20 | AadlBaTestSubprogram in 'with' clause of public package section is not used. diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue2466_issue2466.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue2466_issue2466.txt index e69de29bb2d..5847fd0363f 100644 --- a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue2466_issue2466.txt +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue2466_issue2466.txt @@ -0,0 +1,3 @@ +error | semantic | 57 | 20 | 3 | Actual for out parameter 'f3' must be a writable target +error | semantic | 57 | 25 | 3 | Actual for in out parameter 'f4' must be a writable target +error | semantic | 59 | 11 | 3 | Actual for in out parameter 'f2' must be a writable target diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue2525_issue2525.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue2525_issue2525.txt index e69de29bb2d..c86e994d3fe 100644 --- a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue2525_issue2525.txt +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue2525_issue2525.txt @@ -0,0 +1,2 @@ +error | semantic | 16 | 6 | 4 | A dequeue action requires an incoming event or event data port +error | semantic | 17 | 6 | 4 | A dequeue action requires an incoming event or event data port diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_CallActuals.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_CallActuals.txt new file mode 100644 index 00000000000..ef772ef41e4 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_CallActuals.txt @@ -0,0 +1,5 @@ +error | semantic | 44 | 42 | 1 | Actual for out parameter 'result' must be a writable target +error | semantic | 45 | 42 | 9 | Actual for out parameter 'result' must be a writable target +error | semantic | 46 | 42 | 5 | Actual for out parameter 'result' must be a writable target +error | semantic | 47 | 39 | 6 | Actual for in parameter 'argument' must be readable +error | semantic | 48 | 62 | 1 | Actual for out parameter 'result' must be a writable target diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_CallCounts.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_CallCounts.txt new file mode 100644 index 00000000000..cafb4480e2c --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_CallCounts.txt @@ -0,0 +1,4 @@ +error | semantic | 50 | 28 | 10 | Subprogram call requires 5 actuals but has 0 +error | semantic | 51 | 28 | 15 | Subprogram call requires 5 actuals but has 1 +error | semantic | 52 | 28 | 22 | Subprogram call requires 5 actuals but has 2 +error | semantic | 53 | 28 | 49 | Subprogram call requires 5 actuals but has 6 diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_CallExpressions.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_CallExpressions.txt new file mode 100644 index 00000000000..55f972887ce --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_CallExpressions.txt @@ -0,0 +1 @@ +error | semantic | 40 | 39 | 7 | There is no applicable operator "and" for type universal integer diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt new file mode 100644 index 00000000000..8bfc832897d --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt @@ -0,0 +1,14 @@ +error | semantic | 44 | 28 | 5 | A port send action requires an outgoing port +error | semantic | 45 | 28 | 6 | A dequeue action requires an incoming event or event data port +error | semantic | 46 | 28 | 10 | A dequeue action requires an incoming event or event data port +error | semantic | 47 | 28 | 6 | A freeze action requires an incoming port +error | semantic | 48 | 28 | 5 | A send or call action requires a port, internal feature, or callable subprogram +error | semantic | 49 | 28 | 5 | A dequeue action requires an incoming event or event data port +error | semantic | 50 | 28 | 5 | A freeze action requires an incoming port +error | semantic | 51 | 28 | 5 | A lock or unlock action requires a required data access +error | semantic | 52 | 28 | 8 | A lock or unlock action requires a required data access +error | semantic | 53 | 28 | 13 | A port send action accepts at most one value +error | semantic | 54 | 29 | 16 | An event port send action cannot carry a value +error | semantic | 55 | 29 | 19 | An event port dequeue action cannot assign a data value +error | semantic | 56 | 36 | 10 | A dequeue target must be writable +error | semantic | 57 | 36 | 12 | A dequeue target must be writable diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_FeatureActuals.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_FeatureActuals.txt new file mode 100644 index 00000000000..11505182a81 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_FeatureActuals.txt @@ -0,0 +1,4 @@ +error | semantic | 54 | 56 | 1 | Actual for data access 'shared' must reference data +error | semantic | 55 | 64 | 1 | Actual for port 'signal' must reference a port of the same category and direction +error | semantic | 56 | 64 | 11 | Actual for port 'signal' must reference a port of the same category and direction +error | semantic | 57 | 64 | 6 | Actual for port 'signal' must reference a port of the same category and direction diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_InheritedCalls.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_InheritedCalls.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_InternalSend.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_InternalSend.txt new file mode 100644 index 00000000000..fdceebbf218 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_InternalSend.txt @@ -0,0 +1 @@ +error | semantic | 38 | 28 | 20 | A port send action accepts at most one value diff --git a/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_Issue3181.txt b/ba/org.osate.ba.tests/expected/diagnostics-validated/org.osate.ba.tests_models_issue3181_Issue3181.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_CallActuals.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_CallActuals.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_CallCounts.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_CallCounts.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_CallExpressions.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_CallExpressions.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_FeatureActuals.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_FeatureActuals.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_InheritedCalls.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_InheritedCalls.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_InternalSend.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_InternalSend.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_Issue3181.txt b/ba/org.osate.ba.tests/expected/diagnostics/org.osate.ba.tests_models_issue3181_Issue3181.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_CallActuals.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_CallActuals.txt new file mode 100644 index 00000000000..f09be1a82a0 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_CallActuals.txt @@ -0,0 +1,60 @@ +annex[0] owner=CallActuals::host.i + (BehaviorActionBlock, , 2269, 20) + (BehaviorActionBlock, , 2316, 28) + (BehaviorActionBlock, , 2371, 24) + (BehaviorActionBlock, , 2422, 29) + (BehaviorActionBlock, , 2478, 42) + (BehaviorAnnex, behavior_specification, 2125, 396) + (BehaviorIntegerLiteral, , 2169, 1) + (BehaviorIntegerLiteral, , 2282, 1) + (BehaviorIntegerLiteral, , 2285, 1) + (BehaviorIntegerLiteral, , 2329, 1) + (BehaviorIntegerLiteral, , 2340, 1) + (BehaviorIntegerLiteral, , 2384, 1) + (BehaviorIntegerLiteral, , 2490, 1) + (BehaviorIntegerLiteral, , 2495, 1) + (BehaviorIntegerLiteral, , 2511, 1) + (BehaviorState, done, 2210, 4) + (BehaviorState, start, 2184, 5) + (BehaviorStateGroup, , 2184, 22) + (BehaviorStateGroup, , 2210, 19) + (BehaviorTransition, t0, 2247, 43) + (BehaviorTransition, t1, 2294, 51) + (BehaviorTransition, t2, 2349, 47) + (BehaviorTransition, t3, 2400, 52) + (BehaviorTransition, t4, 2456, 65) + (BehaviorVariable, value, 2138, 5) + (BehaviorVariableGroup, , 2138, 33) + (BinaryExpression, , 2332, 9) + (CommunicationAction, , 2271, 16) + (CommunicationAction, , 2318, 24) + (CommunicationAction, , 2373, 20) + (CommunicationAction, , 2424, 25) + (CommunicationAction, , 2500, 16) + (ElementValues, , 2490, 6) + (ForStatement, , 2480, 38) + (Reference, , 2271, 9) + (Reference, , 2318, 9) + (Reference, , 2332, 5) + (Reference, , 2373, 9) + (Reference, , 2387, 5) + (Reference, , 2424, 9) + (Reference, , 2435, 6) + (Reference, , 2443, 5) + (Reference, , 2500, 9) + (Reference, , 2514, 1) + (ReferenceExpression, , 2332, 5) + (ReferenceExpression, , 2387, 5) + (ReferenceExpression, , 2435, 6) + (ReferenceExpression, , 2443, 5) + (ReferenceExpression, , 2514, 1) + (ReferenceSegment, i, 2514, 1) + (ReferenceSegment, input, 2387, 5) + (ReferenceSegment, operation, 2271, 9) + (ReferenceSegment, operation, 2318, 9) + (ReferenceSegment, operation, 2373, 9) + (ReferenceSegment, operation, 2424, 9) + (ReferenceSegment, operation, 2500, 9) + (ReferenceSegment, output, 2435, 6) + (ReferenceSegment, value, 2332, 5) + (ReferenceSegment, value, 2443, 5) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_CallCounts.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_CallCounts.txt new file mode 100644 index 00000000000..7436a2ef21d --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_CallCounts.txt @@ -0,0 +1,52 @@ +annex[0] owner=CallCounts::host.i + (BehaviorActionBlock, , 2469, 14) + (BehaviorActionBlock, , 2510, 19) + (BehaviorActionBlock, , 2556, 26) + (BehaviorActionBlock, , 2609, 53) + (BehaviorAnnex, behavior_specification, 2325, 338) + (BehaviorIntegerLiteral, , 2369, 1) + (BehaviorIntegerLiteral, , 2525, 1) + (BehaviorIntegerLiteral, , 2571, 1) + (BehaviorIntegerLiteral, , 2623, 1) + (BehaviorState, done, 2410, 4) + (BehaviorState, start, 2384, 5) + (BehaviorStateGroup, , 2384, 22) + (BehaviorStateGroup, , 2410, 19) + (BehaviorTransition, t0, 2447, 37) + (BehaviorTransition, t1, 2488, 42) + (BehaviorTransition, t2, 2534, 49) + (BehaviorTransition, t3, 2587, 76) + (BehaviorVariable, value, 2338, 5) + (BehaviorVariableGroup, , 2338, 33) + (CommunicationAction, , 2471, 10) + (CommunicationAction, , 2512, 15) + (CommunicationAction, , 2558, 22) + (CommunicationAction, , 2611, 49) + (Reference, , 2471, 9) + (Reference, , 2512, 11) + (Reference, , 2558, 11) + (Reference, , 2574, 5) + (Reference, , 2611, 10) + (Reference, , 2626, 5) + (Reference, , 2633, 5) + (Reference, , 2640, 5) + (Reference, , 2647, 5) + (Reference, , 2654, 5) + (ReferenceExpression, , 2574, 5) + (ReferenceExpression, , 2626, 5) + (ReferenceExpression, , 2633, 5) + (ReferenceExpression, , 2640, 5) + (ReferenceExpression, , 2647, 5) + (ReferenceExpression, , 2654, 5) + (ReferenceSegment, call_access, 2558, 11) + (ReferenceSegment, i, 2522, 1) + (ReferenceSegment, local_call, 2611, 10) + (ReferenceSegment, operation, 2471, 9) + (ReferenceSegment, operation, 2512, 9) + (ReferenceSegment, value, 2574, 5) + (ReferenceSegment, value, 2626, 5) + (ReferenceSegment, value, 2633, 5) + (ReferenceSegment, value, 2640, 5) + (ReferenceSegment, value, 2647, 5) + (ReferenceSegment, value, 2654, 5) + (ReferenceTail, , 2521, 2) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_CallExpressions.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_CallExpressions.txt new file mode 100644 index 00000000000..36a70cee23d --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_CallExpressions.txt @@ -0,0 +1,17 @@ +annex[0] owner=CallExpressions::host.i + (BehaviorActionBlock, , 2123, 23) + (BehaviorAnnex, behavior_specification, 1979, 168) + (BehaviorIntegerLiteral, , 2023, 1) + (BehaviorIntegerLiteral, , 2136, 1) + (BehaviorIntegerLiteral, , 2142, 1) + (BehaviorState, done, 2064, 4) + (BehaviorState, start, 2038, 5) + (BehaviorStateGroup, , 2038, 22) + (BehaviorStateGroup, , 2064, 19) + (BehaviorTransition, t0, 2101, 46) + (BehaviorVariable, value, 1992, 5) + (BehaviorVariableGroup, , 1992, 33) + (BinaryExpression, , 2136, 7) + (CommunicationAction, , 2125, 19) + (Reference, , 2125, 9) + (ReferenceSegment, operation, 2125, 9) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt new file mode 100644 index 00000000000..7c15c9b26e2 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt @@ -0,0 +1,88 @@ +annex[0] owner=CommunicationTargets::host.i + (BehaviorActionBlock, , 2366, 10) + (BehaviorActionBlock, , 2403, 11) + (BehaviorActionBlock, , 2441, 15) + (BehaviorActionBlock, , 2483, 12) + (BehaviorActionBlock, , 2522, 10) + (BehaviorActionBlock, , 2559, 10) + (BehaviorActionBlock, , 2596, 11) + (BehaviorActionBlock, , 2634, 11) + (BehaviorActionBlock, , 2672, 14) + (BehaviorActionBlock, , 2713, 17) + (BehaviorActionBlock, , 2758, 20) + (BehaviorActionBlock, , 2806, 23) + (BehaviorActionBlock, , 2857, 22) + (BehaviorActionBlock, , 2907, 24) + (BehaviorAnnex, behavior_specification, 2222, 710) + (BehaviorIntegerLiteral, , 2266, 1) + (BehaviorIntegerLiteral, , 2723, 1) + (BehaviorIntegerLiteral, , 2726, 1) + (BehaviorIntegerLiteral, , 2774, 1) + (BehaviorState, done, 2307, 4) + (BehaviorState, start, 2281, 5) + (BehaviorStateGroup, , 2281, 22) + (BehaviorStateGroup, , 2307, 19) + (BehaviorTransition, t0, 2344, 33) + (BehaviorTransition, t1, 2381, 34) + (BehaviorTransition, t10, 2735, 44) + (BehaviorTransition, t11, 2783, 47) + (BehaviorTransition, t12, 2834, 46) + (BehaviorTransition, t13, 2884, 48) + (BehaviorTransition, t2, 2419, 38) + (BehaviorTransition, t3, 2461, 35) + (BehaviorTransition, t4, 2500, 33) + (BehaviorTransition, t5, 2537, 33) + (BehaviorTransition, t6, 2574, 34) + (BehaviorTransition, t7, 2612, 34) + (BehaviorTransition, t8, 2650, 37) + (BehaviorTransition, t9, 2691, 40) + (BehaviorVariable, value, 2235, 5) + (BehaviorVariableGroup, , 2235, 33) + (CommunicationAction, , 2368, 6) + (CommunicationAction, , 2405, 7) + (CommunicationAction, , 2443, 11) + (CommunicationAction, , 2485, 8) + (CommunicationAction, , 2524, 6) + (CommunicationAction, , 2561, 6) + (CommunicationAction, , 2598, 7) + (CommunicationAction, , 2636, 7) + (CommunicationAction, , 2674, 10) + (CommunicationAction, , 2715, 13) + (CommunicationAction, , 2760, 16) + (CommunicationAction, , 2808, 19) + (CommunicationAction, , 2859, 18) + (CommunicationAction, , 2909, 20) + (Reference, , 2368, 5) + (Reference, , 2405, 6) + (Reference, , 2443, 10) + (Reference, , 2485, 6) + (Reference, , 2524, 5) + (Reference, , 2561, 5) + (Reference, , 2598, 5) + (Reference, , 2636, 5) + (Reference, , 2674, 8) + (Reference, , 2715, 6) + (Reference, , 2760, 12) + (Reference, , 2808, 11) + (Reference, , 2821, 5) + (Reference, , 2859, 5) + (Reference, , 2866, 10) + (Reference, , 2909, 5) + (Reference, , 2916, 12) + (ReferenceSegment, input, 2368, 5) + (ReferenceSegment, input, 2859, 5) + (ReferenceSegment, input, 2909, 5) + (ReferenceSegment, input_data, 2443, 10) + (ReferenceSegment, input_data, 2866, 10) + (ReferenceSegment, input_event, 2808, 11) + (ReferenceSegment, output, 2405, 6) + (ReferenceSegment, output, 2485, 6) + (ReferenceSegment, output, 2715, 6) + (ReferenceSegment, output_event, 2760, 12) + (ReferenceSegment, output_event, 2916, 12) + (ReferenceSegment, provided, 2674, 8) + (ReferenceSegment, value, 2524, 5) + (ReferenceSegment, value, 2561, 5) + (ReferenceSegment, value, 2598, 5) + (ReferenceSegment, value, 2636, 5) + (ReferenceSegment, value, 2821, 5) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_FeatureActuals.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_FeatureActuals.txt new file mode 100644 index 00000000000..71574cb1b82 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_FeatureActuals.txt @@ -0,0 +1,77 @@ +annex[0] owner=FeatureActuals::host.i + (BehaviorActionBlock, , 2688, 48) + (BehaviorActionBlock, , 2763, 42) + (BehaviorActionBlock, , 2832, 52) + (BehaviorActionBlock, , 2911, 47) + (BehaviorAnnex, behavior_specification, 2544, 415) + (BehaviorIntegerLiteral, , 2588, 1) + (BehaviorIntegerLiteral, , 2701, 1) + (BehaviorIntegerLiteral, , 2718, 1) + (BehaviorIntegerLiteral, , 2776, 1) + (BehaviorIntegerLiteral, , 2801, 1) + (BehaviorIntegerLiteral, , 2845, 1) + (BehaviorIntegerLiteral, , 2924, 1) + (BehaviorState, done, 2629, 4) + (BehaviorState, start, 2603, 5) + (BehaviorStateGroup, , 2603, 22) + (BehaviorStateGroup, , 2629, 19) + (BehaviorTransition, t0, 2666, 71) + (BehaviorTransition, t1, 2741, 65) + (BehaviorTransition, t2, 2810, 75) + (BehaviorTransition, t3, 2889, 70) + (BehaviorVariable, value, 2557, 5) + (BehaviorVariableGroup, , 2557, 33) + (CommunicationAction, , 2690, 44) + (CommunicationAction, , 2765, 38) + (CommunicationAction, , 2834, 48) + (CommunicationAction, , 2913, 43) + (Reference, , 2690, 9) + (Reference, , 2704, 5) + (Reference, , 2711, 5) + (Reference, , 2721, 12) + (Reference, , 2765, 9) + (Reference, , 2779, 5) + (Reference, , 2786, 5) + (Reference, , 2793, 6) + (Reference, , 2834, 9) + (Reference, , 2848, 5) + (Reference, , 2855, 5) + (Reference, , 2862, 6) + (Reference, , 2870, 11) + (Reference, , 2913, 9) + (Reference, , 2927, 5) + (Reference, , 2934, 5) + (Reference, , 2941, 6) + (Reference, , 2949, 6) + (ReferenceExpression, , 2704, 5) + (ReferenceExpression, , 2711, 5) + (ReferenceExpression, , 2721, 12) + (ReferenceExpression, , 2779, 5) + (ReferenceExpression, , 2786, 5) + (ReferenceExpression, , 2793, 6) + (ReferenceExpression, , 2848, 5) + (ReferenceExpression, , 2855, 5) + (ReferenceExpression, , 2862, 6) + (ReferenceExpression, , 2870, 11) + (ReferenceExpression, , 2927, 5) + (ReferenceExpression, , 2934, 5) + (ReferenceExpression, , 2941, 6) + (ReferenceExpression, , 2949, 6) + (ReferenceSegment, input_event, 2870, 11) + (ReferenceSegment, operation, 2690, 9) + (ReferenceSegment, operation, 2765, 9) + (ReferenceSegment, operation, 2834, 9) + (ReferenceSegment, operation, 2913, 9) + (ReferenceSegment, output, 2949, 6) + (ReferenceSegment, output_event, 2721, 12) + (ReferenceSegment, shared, 2793, 6) + (ReferenceSegment, shared, 2862, 6) + (ReferenceSegment, shared, 2941, 6) + (ReferenceSegment, value, 2704, 5) + (ReferenceSegment, value, 2711, 5) + (ReferenceSegment, value, 2779, 5) + (ReferenceSegment, value, 2786, 5) + (ReferenceSegment, value, 2848, 5) + (ReferenceSegment, value, 2855, 5) + (ReferenceSegment, value, 2927, 5) + (ReferenceSegment, value, 2934, 5) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_InheritedCalls.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_InheritedCalls.txt new file mode 100644 index 00000000000..bf31e9ea704 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_InheritedCalls.txt @@ -0,0 +1,52 @@ +annex[0] owner=InheritedCalls::host.i + (BehaviorActionBlock, , 2673, 28) + (BehaviorActionBlock, , 2723, 26) + (BehaviorActionBlock, , 2771, 22) + (BehaviorActionBlock, , 2815, 36) + (BehaviorAnnex, behavior_specification, 2534, 318) + (BehaviorBooleanLiteral, , 2694, 4) + (BehaviorBooleanLiteral, , 2742, 4) + (BehaviorBooleanLiteral, , 2844, 4) + (BehaviorIntegerLiteral, , 2578, 1) + (BehaviorIntegerLiteral, , 2684, 1) + (BehaviorIntegerLiteral, , 2732, 1) + (BehaviorIntegerLiteral, , 2782, 1) + (BehaviorIntegerLiteral, , 2829, 1) + (BehaviorState, done, 2619, 4) + (BehaviorState, start, 2593, 5) + (BehaviorStateGroup, , 2593, 22) + (BehaviorStateGroup, , 2619, 19) + (BehaviorTransition, , 2656, 46) + (BehaviorTransition, , 2706, 44) + (BehaviorTransition, , 2754, 40) + (BehaviorTransition, , 2798, 54) + (BehaviorVariable, value, 2547, 5) + (BehaviorVariableGroup, , 2547, 33) + (CommunicationAction, , 2675, 24) + (CommunicationAction, , 2725, 22) + (CommunicationAction, , 2773, 18) + (CommunicationAction, , 2817, 32) + (Reference, , 2675, 7) + (Reference, , 2687, 5) + (Reference, , 2725, 5) + (Reference, , 2735, 5) + (Reference, , 2773, 7) + (Reference, , 2785, 5) + (Reference, , 2817, 10) + (Reference, , 2832, 10) + (ReferenceExpression, , 2687, 5) + (ReferenceExpression, , 2735, 5) + (ReferenceExpression, , 2785, 5) + (ReferenceExpression, , 2832, 10) + (ReferenceSegment, api, 2817, 3) + (ReferenceSegment, api, 2832, 3) + (ReferenceSegment, derived, 2675, 7) + (ReferenceSegment, invoke, 2821, 6) + (ReferenceSegment, shared, 2836, 6) + (ReferenceSegment, typed, 2725, 5) + (ReferenceSegment, untyped, 2773, 7) + (ReferenceSegment, value, 2687, 5) + (ReferenceSegment, value, 2735, 5) + (ReferenceSegment, value, 2785, 5) + (ReferenceTail, , 2820, 7) + (ReferenceTail, , 2835, 7) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_InternalSend.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_InternalSend.txt new file mode 100644 index 00000000000..ce4476053fa --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_InternalSend.txt @@ -0,0 +1,16 @@ +annex[0] owner=InternalSend::host.i + (BehaviorActionBlock, , 2094, 24) + (BehaviorAnnex, behavior_specification, 1950, 169) + (BehaviorIntegerLiteral, , 1994, 1) + (BehaviorIntegerLiteral, , 2111, 1) + (BehaviorIntegerLiteral, , 2114, 1) + (BehaviorState, done, 2035, 4) + (BehaviorState, start, 2009, 5) + (BehaviorStateGroup, , 2009, 22) + (BehaviorStateGroup, , 2035, 19) + (BehaviorTransition, t0, 2072, 47) + (BehaviorVariable, value, 1963, 5) + (BehaviorVariableGroup, , 1963, 33) + (CommunicationAction, , 2096, 20) + (Reference, , 2096, 13) + (ReferenceSegment, internal_data, 2096, 13) diff --git a/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_Issue3181.txt b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_Issue3181.txt new file mode 100644 index 00000000000..03cb0cc6ae9 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/positions/org.osate.ba.tests_models_issue3181_Issue3181.txt @@ -0,0 +1,142 @@ +annex[0] owner=Issue3181::host.i + (BehaviorActionBlock, , 3160, 84) + (BehaviorActionBlock, , 3271, 22) + (BehaviorActionBlock, , 3320, 80) + (BehaviorActionBlock, , 3427, 53) + (BehaviorActionBlock, , 3507, 55) + (BehaviorActionBlock, , 3589, 68) + (BehaviorActionBlock, , 3684, 54) + (BehaviorActionSequence, , 3162, 80) + (BehaviorActionSequence, , 3273, 18) + (BehaviorActionSequence, , 3322, 76) + (BehaviorAnnex, behavior_specification, 3016, 723) + (BehaviorIntegerLiteral, , 3060, 1) + (BehaviorIntegerLiteral, , 3170, 1) + (BehaviorIntegerLiteral, , 3344, 1) + (BehaviorIntegerLiteral, , 3440, 1) + (BehaviorIntegerLiteral, , 3522, 1) + (BehaviorIntegerLiteral, , 3604, 1) + (BehaviorIntegerLiteral, , 3698, 1) + (BehaviorState, done, 3101, 4) + (BehaviorState, start, 3075, 5) + (BehaviorStateGroup, , 3075, 22) + (BehaviorStateGroup, , 3101, 19) + (BehaviorTransition, t0, 3138, 107) + (BehaviorTransition, t1, 3249, 45) + (BehaviorTransition, t2, 3298, 103) + (BehaviorTransition, t3, 3405, 76) + (BehaviorTransition, t4, 3485, 78) + (BehaviorTransition, t5, 3567, 91) + (BehaviorTransition, t6, 3662, 77) + (BehaviorVariable, value, 3029, 5) + (BehaviorVariableGroup, , 3029, 33) + (CommunicationAction, , 3162, 10) + (CommunicationAction, , 3174, 7) + (CommunicationAction, , 3183, 13) + (CommunicationAction, , 3198, 6) + (CommunicationAction, , 3206, 13) + (CommunicationAction, , 3221, 7) + (CommunicationAction, , 3230, 12) + (CommunicationAction, , 3273, 8) + (CommunicationAction, , 3283, 8) + (CommunicationAction, , 3322, 24) + (CommunicationAction, , 3348, 27) + (CommunicationAction, , 3377, 21) + (CommunicationAction, , 3429, 49) + (CommunicationAction, , 3509, 51) + (CommunicationAction, , 3591, 64) + (CommunicationAction, , 3686, 50) + (Reference, , 3162, 6) + (Reference, , 3174, 6) + (Reference, , 3183, 12) + (Reference, , 3198, 5) + (Reference, , 3206, 5) + (Reference, , 3213, 5) + (Reference, , 3221, 5) + (Reference, , 3230, 10) + (Reference, , 3273, 6) + (Reference, , 3283, 6) + (Reference, , 3322, 20) + (Reference, , 3348, 19) + (Reference, , 3369, 5) + (Reference, , 3377, 19) + (Reference, , 3429, 9) + (Reference, , 3443, 5) + (Reference, , 3450, 5) + (Reference, , 3457, 6) + (Reference, , 3465, 12) + (Reference, , 3509, 11) + (Reference, , 3525, 5) + (Reference, , 3532, 5) + (Reference, , 3539, 6) + (Reference, , 3547, 12) + (Reference, , 3591, 11) + (Reference, , 3607, 18) + (Reference, , 3627, 5) + (Reference, , 3634, 6) + (Reference, , 3642, 12) + (Reference, , 3686, 10) + (Reference, , 3701, 5) + (Reference, , 3708, 5) + (Reference, , 3715, 6) + (Reference, , 3723, 12) + (ReferenceExpression, , 3443, 5) + (ReferenceExpression, , 3450, 5) + (ReferenceExpression, , 3457, 6) + (ReferenceExpression, , 3465, 12) + (ReferenceExpression, , 3525, 5) + (ReferenceExpression, , 3532, 5) + (ReferenceExpression, , 3539, 6) + (ReferenceExpression, , 3547, 12) + (ReferenceExpression, , 3607, 18) + (ReferenceExpression, , 3627, 5) + (ReferenceExpression, , 3634, 6) + (ReferenceExpression, , 3642, 12) + (ReferenceExpression, , 3701, 5) + (ReferenceExpression, , 3708, 5) + (ReferenceExpression, , 3715, 6) + (ReferenceExpression, , 3723, 12) + (ReferenceSegment, call_access, 3591, 11) + (ReferenceSegment, channel, 3335, 7) + (ReferenceSegment, channel, 3360, 7) + (ReferenceSegment, channel, 3389, 7) + (ReferenceSegment, field, 3620, 5) + (ReferenceSegment, group_input, 3348, 11) + (ReferenceSegment, group_input, 3377, 11) + (ReferenceSegment, group_output, 3322, 12) + (ReferenceSegment, i, 3519, 1) + (ReferenceSegment, input, 3198, 5) + (ReferenceSegment, input, 3206, 5) + (ReferenceSegment, input, 3221, 5) + (ReferenceSegment, input_data, 3230, 10) + (ReferenceSegment, local_call, 3686, 10) + (ReferenceSegment, operation, 3429, 9) + (ReferenceSegment, operation, 3509, 9) + (ReferenceSegment, output, 3162, 6) + (ReferenceSegment, output, 3174, 6) + (ReferenceSegment, output_event, 3183, 12) + (ReferenceSegment, output_event, 3465, 12) + (ReferenceSegment, output_event, 3547, 12) + (ReferenceSegment, output_event, 3642, 12) + (ReferenceSegment, output_event, 3723, 12) + (ReferenceSegment, record_value, 3607, 12) + (ReferenceSegment, shared, 3273, 6) + (ReferenceSegment, shared, 3283, 6) + (ReferenceSegment, shared, 3457, 6) + (ReferenceSegment, shared, 3539, 6) + (ReferenceSegment, shared, 3634, 6) + (ReferenceSegment, shared, 3715, 6) + (ReferenceSegment, value, 3213, 5) + (ReferenceSegment, value, 3369, 5) + (ReferenceSegment, value, 3443, 5) + (ReferenceSegment, value, 3450, 5) + (ReferenceSegment, value, 3525, 5) + (ReferenceSegment, value, 3532, 5) + (ReferenceSegment, value, 3627, 5) + (ReferenceSegment, value, 3701, 5) + (ReferenceSegment, value, 3708, 5) + (ReferenceTail, , 3334, 8) + (ReferenceTail, , 3359, 8) + (ReferenceTail, , 3388, 8) + (ReferenceTail, , 3518, 2) + (ReferenceTail, , 3619, 6) diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_covering_syntax_aadlBaTest002.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_covering_syntax_aadlBaTest002.txt index 18bd3d17fb8..67f43544de2 100644 --- a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_covering_syntax_aadlBaTest002.txt +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_covering_syntax_aadlBaTest002.txt @@ -692,14 +692,9 @@ annex[0] owner=DataTypeCheckerTest::concreteThread.impl firstValue : DataComponentReference data[0] : DataSubcomponentHolder element=DataTypeCheckerTest::abstractThread.impl.subMyStruct1 [DataSubcomponent] data[1] : DataSubcomponentHolder element=DataTypeCheckerTest::MyStructure.impl.int1 [DataSubcomponent] - parameterLabels[1] : ValueExpression - relations[0] : Relation - firstExpression : SimpleExpression - terms[0] : Term - factors[0] : Factor - firstValue : DataComponentReference - data[0] : DataSubcomponentHolder element=DataTypeCheckerTest::abstractThread.impl.subMyStruct1 [DataSubcomponent] - data[1] : DataSubcomponentHolder element=DataTypeCheckerTest::MyStructure.impl.float1 [DataSubcomponent] + parameterLabels[1] : DataComponentReference + data[0] : DataSubcomponentHolder element=DataTypeCheckerTest::abstractThread.impl.subMyStruct1 [DataSubcomponent] + data[1] : DataSubcomponentHolder element=DataTypeCheckerTest::MyStructure.impl.float1 [DataSubcomponent] actions[31] : BehaviorActionBlock content : SubprogramCallAction subprogram : SubprogramPrototypeHolder element=DataTypeCheckerTest::abstractThread.proto1 [SubprogramPrototype] @@ -3930,14 +3925,9 @@ annex[0] owner=DataTypeCheckerTest::concreteThread.impl firstValue : DataComponentReference data[0] : DataSubcomponentHolder element=DataTypeCheckerTest::abstractThread.impl.subMyStruct1 [DataSubcomponent] data[1] : DataSubcomponentHolder element=DataTypeCheckerTest::MyStructure.impl.float1 [DataSubcomponent] - parameterLabels[1] : ValueExpression - relations[0] : Relation - firstExpression : SimpleExpression - terms[0] : Term - factors[0] : Factor - firstValue : DataComponentReference - data[0] : DataSubcomponentHolder element=DataTypeCheckerTest::abstractThread.impl.subMyStruct1 [DataSubcomponent] - data[1] : DataSubcomponentHolder element=DataTypeCheckerTest::MyStructure.impl.int1 [DataSubcomponent] + parameterLabels[1] : DataComponentReference + data[0] : DataSubcomponentHolder element=DataTypeCheckerTest::abstractThread.impl.subMyStruct1 [DataSubcomponent] + data[1] : DataSubcomponentHolder element=DataTypeCheckerTest::MyStructure.impl.int1 [DataSubcomponent] actions[286] : BehaviorActionBlock content : SubprogramCallAction subprogram : SubprogramPrototypeHolder element=DataTypeCheckerTest::abstractThread.proto1 [SubprogramPrototype] diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue2466_issue2466.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue2466_issue2466.txt index 902112523da..1d9d03b1f8f 100644 --- a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue2466_issue2466.txt +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue2466_issue2466.txt @@ -6,15 +6,10 @@ annex[0] owner=issue2466::s2 content : BehaviorActionSequence actions[0] : SubprogramCallAction subprogram : SubprogramHolder element=issue2466::s1 [SubprogramType] - parameterLabels[0] : ValueExpression - relations[0] : Relation - firstExpression : SimpleExpression - terms[0] : Term - factors[0] : Factor - firstValue : DataComponentReference - data[0] : DataAccessHolder element=issue2466::s2.d [DataAccess] - data[1] : StructUnionElementHolder element=f [StructUnionElement] - structUnionElement : StructUnionElement name=f + parameterLabels[0] : DataComponentReference + data[0] : DataAccessHolder element=issue2466::s2.d [DataAccess] + data[1] : StructUnionElementHolder element=f [StructUnionElement] + structUnionElement : StructUnionElement name=f parameterLabels[1] : ValueExpression relations[0] : Relation firstExpression : SimpleExpression @@ -24,46 +19,26 @@ annex[0] owner=issue2466::s2 data[0] : DataAccessHolder element=issue2466::s2.d [DataAccess] data[1] : StructUnionElementHolder element=f [StructUnionElement] structUnionElement : StructUnionElement name=f - parameterLabels[2] : ValueExpression - relations[0] : Relation - firstExpression : SimpleExpression - terms[0] : Term - factors[0] : Factor - firstValue : DataComponentReference - data[0] : DataAccessHolder element=issue2466::s2.d [DataAccess] - data[1] : StructUnionElementHolder element=f [StructUnionElement] - structUnionElement : StructUnionElement name=f - parameterLabels[3] : ValueExpression - relations[0] : Relation - firstExpression : SimpleExpression - terms[0] : Term - factors[0] : Factor - firstValue : DataComponentReference - data[0] : DataAccessHolder element=issue2466::s2.d [DataAccess] - data[1] : StructUnionElementHolder element=f [StructUnionElement] - structUnionElement : StructUnionElement name=f + parameterLabels[2] : DataComponentReference + data[0] : DataAccessHolder element=issue2466::s2.d [DataAccess] + data[1] : StructUnionElementHolder element=f [StructUnionElement] + structUnionElement : StructUnionElement name=f + parameterLabels[3] : DataComponentReference + data[0] : DataAccessHolder element=issue2466::s2.d [DataAccess] + data[1] : StructUnionElementHolder element=f [StructUnionElement] + structUnionElement : StructUnionElement name=f actions[1] : SubprogramCallAction subprogram : SubprogramHolder element=issue2466::s11 [SubprogramType] - parameterLabels[0] : ValueExpression - relations[0] : Relation - firstExpression : SimpleExpression - terms[0] : Term - factors[0] : Factor - firstValue : DataComponentReference - data[0] : DataAccessHolder element=issue2466::s2.d [DataAccess] - data[1] : StructUnionElementHolder element=f [StructUnionElement] - structUnionElement : StructUnionElement name=f + parameterLabels[0] : DataComponentReference + data[0] : DataAccessHolder element=issue2466::s2.d [DataAccess] + data[1] : StructUnionElementHolder element=f [StructUnionElement] + structUnionElement : StructUnionElement name=f actions[2] : SubprogramCallAction subprogram : SubprogramHolder element=issue2466::s12 [SubprogramType] - parameterLabels[0] : ValueExpression - relations[0] : Relation - firstExpression : SimpleExpression - terms[0] : Term - factors[0] : Factor - firstValue : DataComponentReference - data[0] : DataAccessHolder element=issue2466::s2.d [DataAccess] - data[1] : StructUnionElementHolder element=f [StructUnionElement] - structUnionElement : StructUnionElement name=f + parameterLabels[0] : DataComponentReference + data[0] : DataAccessHolder element=issue2466::s2.d [DataAccess] + data[1] : StructUnionElementHolder element=f [StructUnionElement] + structUnionElement : StructUnionElement name=f annex[1] owner=issue2466::s3 parsedAnnexSubclause : BehaviorAnnex name=behavior_specification states[0] : BehaviorState name=s @@ -72,15 +47,10 @@ annex[1] owner=issue2466::s3 content : BehaviorActionSequence actions[0] : SubprogramCallAction subprogram : SubprogramHolder element=issue2466::s1 [SubprogramType] - parameterLabels[0] : ValueExpression - relations[0] : Relation - firstExpression : SimpleExpression - terms[0] : Term - factors[0] : Factor - firstValue : DataComponentReference - data[0] : ParameterHolder element=issue2466::s3.d [Parameter] - data[1] : StructUnionElementHolder element=f [StructUnionElement] - structUnionElement : StructUnionElement name=f + parameterLabels[0] : DataComponentReference + data[0] : ParameterHolder element=issue2466::s3.d [Parameter] + data[1] : StructUnionElementHolder element=f [StructUnionElement] + structUnionElement : StructUnionElement name=f parameterLabels[1] : ValueExpression relations[0] : Relation firstExpression : SimpleExpression @@ -90,43 +60,23 @@ annex[1] owner=issue2466::s3 data[0] : ParameterHolder element=issue2466::s3.d [Parameter] data[1] : StructUnionElementHolder element=f [StructUnionElement] structUnionElement : StructUnionElement name=f - parameterLabels[2] : ValueExpression - relations[0] : Relation - firstExpression : SimpleExpression - terms[0] : Term - factors[0] : Factor - firstValue : DataComponentReference - data[0] : ParameterHolder element=issue2466::s3.d [Parameter] - data[1] : StructUnionElementHolder element=f [StructUnionElement] - structUnionElement : StructUnionElement name=f - parameterLabels[3] : ValueExpression - relations[0] : Relation - firstExpression : SimpleExpression - terms[0] : Term - factors[0] : Factor - firstValue : DataComponentReference - data[0] : ParameterHolder element=issue2466::s3.d [Parameter] - data[1] : StructUnionElementHolder element=f [StructUnionElement] - structUnionElement : StructUnionElement name=f + parameterLabels[2] : DataComponentReference + data[0] : ParameterHolder element=issue2466::s3.d [Parameter] + data[1] : StructUnionElementHolder element=f [StructUnionElement] + structUnionElement : StructUnionElement name=f + parameterLabels[3] : DataComponentReference + data[0] : ParameterHolder element=issue2466::s3.d [Parameter] + data[1] : StructUnionElementHolder element=f [StructUnionElement] + structUnionElement : StructUnionElement name=f actions[1] : SubprogramCallAction subprogram : SubprogramHolder element=issue2466::s11 [SubprogramType] - parameterLabels[0] : ValueExpression - relations[0] : Relation - firstExpression : SimpleExpression - terms[0] : Term - factors[0] : Factor - firstValue : DataComponentReference - data[0] : ParameterHolder element=issue2466::s3.d [Parameter] - data[1] : StructUnionElementHolder element=f [StructUnionElement] - structUnionElement : StructUnionElement name=f + parameterLabels[0] : DataComponentReference + data[0] : ParameterHolder element=issue2466::s3.d [Parameter] + data[1] : StructUnionElementHolder element=f [StructUnionElement] + structUnionElement : StructUnionElement name=f actions[2] : SubprogramCallAction subprogram : SubprogramHolder element=issue2466::s12 [SubprogramType] - parameterLabels[0] : ValueExpression - relations[0] : Relation - firstExpression : SimpleExpression - terms[0] : Term - factors[0] : Factor - firstValue : DataComponentReference - data[0] : ParameterHolder element=issue2466::s3.d [Parameter] - data[1] : StructUnionElementHolder element=f [StructUnionElement] - structUnionElement : StructUnionElement name=f + parameterLabels[0] : DataComponentReference + data[0] : ParameterHolder element=issue2466::s3.d [Parameter] + data[1] : StructUnionElementHolder element=f [StructUnionElement] + structUnionElement : StructUnionElement name=f diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_CallActuals.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_CallActuals.txt new file mode 100644 index 00000000000..ae2fd72de62 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_CallActuals.txt @@ -0,0 +1,84 @@ +annex[0] owner=CallActuals::host.i + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=value + ownedValueConstant : BehaviorIntegerLiteral + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition name=t0 + transitions[1] : BehaviorTransition name=t1 + transitions[2] : BehaviorTransition name=t2 + transitions[3] : BehaviorTransition name=t3 + transitions[4] : BehaviorTransition name=t4 + actions[0] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramHolder element=CallActuals::operation [SubprogramType] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[1] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramHolder element=CallActuals::operation [SubprogramType] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=value [BehaviorVariable] + terms[1] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[2] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramHolder element=CallActuals::operation [SubprogramType] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : ParameterHolder element=CallActuals::host.input [Parameter] + actions[3] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramHolder element=CallActuals::operation [SubprogramType] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : ParameterHolder element=CallActuals::host.output [Parameter] + parameterLabels[1] : BehaviorVariableHolder element=value [BehaviorVariable] + actions[4] : BehaviorActionBlock + content : ForOrForAllStatement + behaviorActions : SubprogramCallAction + subprogram : SubprogramHolder element=CallActuals::operation [SubprogramType] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : IterativeVariableHolder element=i [IterativeVariable] + iteratedValues : IntegerRange + lowerIntegerValue : BehaviorIntegerLiteral + upperIntegerValue : BehaviorIntegerLiteral + iterativeVariable : IterativeVariable name=i diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_CallCounts.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_CallCounts.txt new file mode 100644 index 00000000000..80a33e947d6 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_CallCounts.txt @@ -0,0 +1,51 @@ +annex[0] owner=CallCounts::host.i + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=value + ownedValueConstant : BehaviorIntegerLiteral + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition name=t0 + transitions[1] : BehaviorTransition name=t1 + transitions[2] : BehaviorTransition name=t2 + transitions[3] : BehaviorTransition name=t3 + actions[0] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramHolder element=CallCounts::operation [SubprogramType] + actions[1] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramHolder element=CallCounts::operation.i [SubprogramImplementation] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[2] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramAccessHolder element=CallCounts::host.call_access [SubprogramAccess] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : BehaviorVariableHolder element=value [BehaviorVariable] + actions[3] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramSubcomponentHolder element=CallCounts::host.i.local_call [SubprogramSubcomponent] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[2] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[3] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[4] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[5] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=value [BehaviorVariable] diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_CallExpressions.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_CallExpressions.txt new file mode 100644 index 00000000000..0cb15c62b50 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_CallExpressions.txt @@ -0,0 +1,21 @@ +annex[0] owner=CallExpressions::host.i + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=value + ownedValueConstant : BehaviorIntegerLiteral + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition name=t0 + actions[0] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramHolder element=CallExpressions::operation [SubprogramType] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + relations[1] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt new file mode 100644 index 00000000000..a742ea62593 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt @@ -0,0 +1,73 @@ +annex[0] owner=CommunicationTargets::host.i + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=value + ownedValueConstant : BehaviorIntegerLiteral + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition name=t0 + transitions[1] : BehaviorTransition name=t1 + transitions[2] : BehaviorTransition name=t2 + transitions[3] : BehaviorTransition name=t3 + transitions[4] : BehaviorTransition name=t4 + transitions[5] : BehaviorTransition name=t5 + transitions[6] : BehaviorTransition name=t6 + transitions[7] : BehaviorTransition name=t7 + transitions[8] : BehaviorTransition name=t8 + transitions[9] : BehaviorTransition name=t9 + transitions[10] : BehaviorTransition name=t10 + transitions[11] : BehaviorTransition name=t11 + transitions[12] : BehaviorTransition name=t12 + transitions[13] : BehaviorTransition name=t13 + actions[0] : BehaviorActionBlock + content : PortSendAction + port : EventDataPortHolder element=CommunicationTargets::host.input [EventDataPort] + actions[1] : BehaviorActionBlock + content : PortDequeueAction + port : EventDataPortHolder element=CommunicationTargets::host.output [EventDataPort] + actions[2] : BehaviorActionBlock + content : PortDequeueAction + port : DataPortHolder element=CommunicationTargets::host.input_data [DataPort] + actions[3] : BehaviorActionBlock + content : PortFreezeAction + actions[4] : BehaviorActionBlock + content : SubprogramCallAction + proxy : BehaviorVariableHolder element=value [BehaviorVariable] + actions[5] : BehaviorActionBlock + content : PortDequeueAction + actions[6] : BehaviorActionBlock + content : PortFreezeAction + actions[7] : BehaviorActionBlock + content : LockAction + actions[8] : BehaviorActionBlock + content : LockAction + dataAccess : DataAccessHolder element=CommunicationTargets::host.provided [DataAccess] + actions[9] : BehaviorActionBlock + content : PortSendAction + port : EventDataPortHolder element=CommunicationTargets::host.output [EventDataPort] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[10] : BehaviorActionBlock + content : PortSendAction + port : EventPortHolder element=CommunicationTargets::host.output_event [EventPort] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[11] : BehaviorActionBlock + content : PortDequeueAction + port : EventPortHolder element=CommunicationTargets::host.input_event [EventPort] + target : BehaviorVariableHolder element=value [BehaviorVariable] + actions[12] : BehaviorActionBlock + content : PortDequeueAction + port : EventDataPortHolder element=CommunicationTargets::host.input [EventDataPort] + target : DataPortHolder element=CommunicationTargets::host.input_data [DataPort] + actions[13] : BehaviorActionBlock + content : PortDequeueAction + port : EventDataPortHolder element=CommunicationTargets::host.input [EventDataPort] + target : EventPortHolder element=CommunicationTargets::host.output_event [EventPort] diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_FeatureActuals.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_FeatureActuals.txt new file mode 100644 index 00000000000..97ad81f3614 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_FeatureActuals.txt @@ -0,0 +1,72 @@ +annex[0] owner=FeatureActuals::host.i + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=value + ownedValueConstant : BehaviorIntegerLiteral + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition name=t0 + transitions[1] : BehaviorTransition name=t1 + transitions[2] : BehaviorTransition name=t2 + transitions[3] : BehaviorTransition name=t3 + actions[0] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramHolder element=FeatureActuals::operation [SubprogramType] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[2] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[3] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[4] : EventPortHolder element=FeatureActuals::host.output_event [EventPort] + actions[1] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramHolder element=FeatureActuals::operation [SubprogramType] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[2] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[3] : DataAccessHolder element=FeatureActuals::host.shared [DataAccess] + parameterLabels[4] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[2] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramHolder element=FeatureActuals::operation [SubprogramType] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[2] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[3] : DataAccessHolder element=FeatureActuals::host.shared [DataAccess] + parameterLabels[4] : EventPortHolder element=FeatureActuals::host.input_event [EventPort] + actions[3] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramHolder element=FeatureActuals::operation [SubprogramType] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[2] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[3] : DataAccessHolder element=FeatureActuals::host.shared [DataAccess] + parameterLabels[4] : EventDataPortHolder element=FeatureActuals::host.output [EventDataPort] diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_InheritedCalls.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_InheritedCalls.txt new file mode 100644 index 00000000000..a35466557a2 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_InheritedCalls.txt @@ -0,0 +1,75 @@ +annex[0] owner=InheritedCalls::host.i + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=value + ownedValueConstant : BehaviorIntegerLiteral + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition + transitions[1] : BehaviorTransition + transitions[2] : BehaviorTransition + transitions[3] : BehaviorTransition + actions[0] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramHolder element=InheritedCalls::derived [SubprogramType] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[2] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral + actions[1] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramPrototypeHolder element=InheritedCalls::host.typed [SubprogramPrototype] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[2] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral + actions[2] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramPrototypeHolder element=InheritedCalls::host.untyped [SubprogramPrototype] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorVariableHolder element=value [BehaviorVariable] + actions[3] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramAccessHolder element=InheritedCalls::services.invoke [SubprogramAccess] + groupHolders[0] : GroupHolder element=InheritedCalls::host.api [FeatureGroup] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : DataAccessHolder element=InheritedCalls::services.shared [DataAccess] + groupHolders[0] : GroupHolder element=InheritedCalls::host.api [FeatureGroup] + parameterLabels[2] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorBooleanLiteral diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_InternalSend.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_InternalSend.txt new file mode 100644 index 00000000000..49d0e18af8b --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_InternalSend.txt @@ -0,0 +1,16 @@ +annex[0] owner=InternalSend::host.i + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=value + ownedValueConstant : BehaviorIntegerLiteral + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition name=t0 + actions[0] : BehaviorActionBlock + content : InternalPortSendAction + internalPort : EventDataSourceHolder element=InternalSend::host.i.internal_data [EventDataSource] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_Issue3181.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_Issue3181.txt new file mode 100644 index 00000000000..4635a10815b --- /dev/null +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba.tests_models_issue3181_Issue3181.txt @@ -0,0 +1,111 @@ +annex[0] owner=Issue3181::host.i + parsedAnnexSubclause : BehaviorAnnex name=behavior_specification + variables[0] : BehaviorVariable name=value + ownedValueConstant : BehaviorIntegerLiteral + states[0] : BehaviorState name=start + states[1] : BehaviorState name=done + transitions[0] : BehaviorTransition name=t0 + transitions[1] : BehaviorTransition name=t1 + transitions[2] : BehaviorTransition name=t2 + transitions[3] : BehaviorTransition name=t3 + transitions[4] : BehaviorTransition name=t4 + transitions[5] : BehaviorTransition name=t5 + transitions[6] : BehaviorTransition name=t6 + actions[0] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : PortSendAction + port : EventDataPortHolder element=Issue3181::host.output [EventDataPort] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[1] : PortSendAction + port : EventDataPortHolder element=Issue3181::host.output [EventDataPort] + actions[2] : PortSendAction + port : EventPortHolder element=Issue3181::host.output_event [EventPort] + actions[3] : PortDequeueAction + port : EventDataPortHolder element=Issue3181::host.input [EventDataPort] + actions[4] : PortDequeueAction + port : EventDataPortHolder element=Issue3181::host.input [EventDataPort] + target : BehaviorVariableHolder element=value [BehaviorVariable] + actions[5] : PortFreezeAction + actions[6] : PortFreezeAction + actions[1] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : LockAction + dataAccess : DataAccessHolder element=Issue3181::host.shared [DataAccess] + actions[1] : UnlockAction + dataAccess : DataAccessHolder element=Issue3181::host.shared [DataAccess] + actions[2] : BehaviorActionBlock + content : BehaviorActionSequence + actions[0] : PortSendAction + port : EventDataPortHolder element=Issue3181::outputs.channel [EventDataPort] + groupHolders[0] : GroupHolder element=Issue3181::host.group_output [FeatureGroup] + valueExpression : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + actions[1] : PortDequeueAction + port : EventDataPortHolder element=Issue3181::outputs.channel [EventDataPort] + groupHolders[0] : GroupHolder element=Issue3181::host.group_input [FeatureGroup] + target : BehaviorVariableHolder element=value [BehaviorVariable] + actions[2] : PortFreezeAction + groupHolders[0] : GroupHolder element=Issue3181::host.group_input [FeatureGroup] + actions[3] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramHolder element=Issue3181::operation [SubprogramType] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[2] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[3] : DataAccessHolder element=Issue3181::host.shared [DataAccess] + parameterLabels[4] : EventPortHolder element=Issue3181::host.output_event [EventPort] + actions[4] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramHolder element=Issue3181::operation.i [SubprogramImplementation] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[2] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[3] : DataAccessHolder element=Issue3181::host.shared [DataAccess] + parameterLabels[4] : EventPortHolder element=Issue3181::host.output_event [EventPort] + actions[5] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramAccessHolder element=Issue3181::host.call_access [SubprogramAccess] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : DataComponentReference + data[0] : DataSubcomponentHolder element=Issue3181::host.i.record_value [DataSubcomponent] + data[1] : DataSubcomponentHolder element=Issue3181::record_type.i.field [DataSubcomponent] + parameterLabels[2] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[3] : DataAccessHolder element=Issue3181::host.shared [DataAccess] + parameterLabels[4] : EventPortHolder element=Issue3181::host.output_event [EventPort] + actions[6] : BehaviorActionBlock + content : SubprogramCallAction + subprogram : SubprogramSubcomponentHolder element=Issue3181::host.i.local_call [SubprogramSubcomponent] + parameterLabels[0] : ValueExpression + relations[0] : Relation + firstExpression : SimpleExpression + terms[0] : Term + factors[0] : Factor + firstValue : BehaviorIntegerLiteral + parameterLabels[1] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[2] : BehaviorVariableHolder element=value [BehaviorVariable] + parameterLabels[3] : DataAccessHolder element=Issue3181::host.shared [DataAccess] + parameterLabels[4] : EventPortHolder element=Issue3181::host.output_event [EventPort] diff --git a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba_examples_toy_examples_multiModalPingPong.txt b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba_examples_toy_examples_multiModalPingPong.txt index e3d91be6b2c..5ff0813f268 100644 --- a/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba_examples_toy_examples_multiModalPingPong.txt +++ b/ba/org.osate.ba.tests/expected/resolved-model/org.osate.ba_examples_toy_examples_multiModalPingPong.txt @@ -109,14 +109,9 @@ annex[0] owner=MultiModalPingPong::Cping_t.impl firstValue : IterativeVariableHolder element=i [IterativeVariable] actions[2] : SubprogramCallAction subprogram : SubprogramHolder element=MultiModalPingPong::set_muid [SubprogramType] - parameterLabels[0] : ValueExpression - relations[0] : Relation - firstExpression : SimpleExpression - terms[0] : Term - factors[0] : Factor - firstValue : DataComponentReference - data[0] : DataSubcomponentHolder element=MultiModalPingPong::Cping_t.impl.the_ping_msg [DataSubcomponent] - data[1] : DataSubcomponentHolder element=MultiModalPingPong::payload.impl.s [DataSubcomponent] + parameterLabels[0] : DataComponentReference + data[0] : DataSubcomponentHolder element=MultiModalPingPong::Cping_t.impl.the_ping_msg [DataSubcomponent] + data[1] : DataSubcomponentHolder element=MultiModalPingPong::payload.impl.s [DataSubcomponent] actions[3] : AssignmentAction target : DataSubcomponentHolder element=MultiModalPingPong::Cping_t.impl.message_array [DataSubcomponent] arrayIndexes[0] : IterativeVariableHolder element=i [IterativeVariable] diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_CallActuals.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_CallActuals.txt new file mode 100644 index 00000000000..2a863f75b40 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_CallActuals.txt @@ -0,0 +1,16 @@ +===== annex[0] owner=CallActuals::host.i ===== + +\t\tvariables +\t\t\tvalue : Base_Types::Integer := 1; +\t\tstates +\t\t\tstart : initial state; +\t\t\tdone : final state; +\t\ttransitions +\t\t\tt0 : start -[]-> done { operation!(1, 2) }; +\t\t\tt1 : start -[]-> done { operation!(1, value + 1) }; +\t\t\tt2 : start -[]-> done { operation!(1, input) }; +\t\t\tt3 : start -[]-> done { operation!(output, value) }; +\t\t\tt4 : start -[]-> done { for (i in 1 .. 2) { operation!(1, i) } }; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_CallCounts.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_CallCounts.txt new file mode 100644 index 00000000000..afca9093429 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_CallCounts.txt @@ -0,0 +1,15 @@ +===== annex[0] owner=CallCounts::host.i ===== + +\t\tvariables +\t\t\tvalue : Base_Types::Integer := 1; +\t\tstates +\t\t\tstart : initial state; +\t\t\tdone : final state; +\t\ttransitions +\t\t\tt0 : start -[]-> done { operation! }; +\t\t\tt1 : start -[]-> done { operation.i!(1) }; +\t\t\tt2 : start -[]-> done { call_access!(1, value) }; +\t\t\tt3 : start -[]-> done { local_call!(1, value, value, value, value, value) }; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_CallExpressions.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_CallExpressions.txt new file mode 100644 index 00000000000..3205ec6ecdb --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_CallExpressions.txt @@ -0,0 +1,12 @@ +===== annex[0] owner=CallExpressions::host.i ===== + +\t\tvariables +\t\t\tvalue : Base_Types::Integer := 1; +\t\tstates +\t\t\tstart : initial state; +\t\t\tdone : final state; +\t\ttransitions +\t\t\tt0 : start -[]-> done { operation!(1 and 2) }; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt new file mode 100644 index 00000000000..02730c39338 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_CommunicationTargets.txt @@ -0,0 +1,25 @@ +===== annex[0] owner=CommunicationTargets::host.i ===== + +\t\tvariables +\t\t\tvalue : Base_Types::Integer := 1; +\t\tstates +\t\t\tstart : initial state; +\t\t\tdone : final state; +\t\ttransitions +\t\t\tt0 : start -[]-> done { input! }; +\t\t\tt1 : start -[]-> done { output? }; +\t\t\tt2 : start -[]-> done { input_data? }; +\t\t\tt3 : start -[]-> done { output>> }; +\t\t\tt4 : start -[]-> done { value! }; +\t\t\tt5 : start -[]-> done { value? }; +\t\t\tt6 : start -[]-> done { value>> }; +\t\t\tt7 : start -[]-> done { value!< }; +\t\t\tt8 : start -[]-> done { provided!< }; +\t\t\tt9 : start -[]-> done { output!(1, 2) }; +\t\t\tt10 : start -[]-> done { output_event!(1) }; +\t\t\tt11 : start -[]-> done { input_event?(value) }; +\t\t\tt12 : start -[]-> done { input?(input_data) }; +\t\t\tt13 : start -[]-> done { input?(output_event) }; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_FeatureActuals.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_FeatureActuals.txt new file mode 100644 index 00000000000..dd34b46cad0 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_FeatureActuals.txt @@ -0,0 +1,15 @@ +===== annex[0] owner=FeatureActuals::host.i ===== + +\t\tvariables +\t\t\tvalue : Base_Types::Integer := 1; +\t\tstates +\t\t\tstart : initial state; +\t\t\tdone : final state; +\t\ttransitions +\t\t\tt0 : start -[]-> done { operation!(1, value, value, 2, output_event) }; +\t\t\tt1 : start -[]-> done { operation!(1, value, value, shared, 2) }; +\t\t\tt2 : start -[]-> done { operation!(1, value, value, shared, input_event) }; +\t\t\tt3 : start -[]-> done { operation!(1, value, value, shared, output) }; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_InheritedCalls.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_InheritedCalls.txt new file mode 100644 index 00000000000..cf34f7c4a34 --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_InheritedCalls.txt @@ -0,0 +1,15 @@ +===== annex[0] owner=InheritedCalls::host.i ===== + +\t\tvariables +\t\t\tvalue : Base_Types::Integer := 1; +\t\tstates +\t\t\tstart : initial state; +\t\t\tdone : final state; +\t\ttransitions +\t\t\tstart -[]-> done { derived!(1, value, true) }; +\t\t\tstart -[]-> done { typed!(1, value, true) }; +\t\t\tstart -[]-> done { untyped!(1, value) }; +\t\t\tstart -[]-> done { api.invoke!(1, api.shared, true) }; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_InternalSend.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_InternalSend.txt new file mode 100644 index 00000000000..8a0b6abc8aa --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_InternalSend.txt @@ -0,0 +1,12 @@ +===== annex[0] owner=InternalSend::host.i ===== + +\t\tvariables +\t\t\tvalue : Base_Types::Integer := 1; +\t\tstates +\t\t\tstart : initial state; +\t\t\tdone : final state; +\t\ttransitions +\t\t\tt0 : start -[]-> done { internal_data!(1, 2) }; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_Issue3181.txt b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_Issue3181.txt new file mode 100644 index 00000000000..0b10a10374a --- /dev/null +++ b/ba/org.osate.ba.tests/expected/unparse/org.osate.ba.tests_models_issue3181_Issue3181.txt @@ -0,0 +1,18 @@ +===== annex[0] owner=Issue3181::host.i ===== + +\t\tvariables +\t\t\tvalue : Base_Types::Integer := 1; +\t\tstates +\t\t\tstart : initial state; +\t\t\tdone : final state; +\t\ttransitions +\t\t\tt0 : start -[]-> done { output!(1); output!; output_event!; input?; input?(value); input>>; input_data>> }; +\t\t\tt1 : start -[]-> done { shared!<; shared!> }; +\t\t\tt2 : start -[]-> done { group_output.channel!(1); group_input.channel?(value); group_input.channel>> }; +\t\t\tt3 : start -[]-> done { operation!(1, value, value, shared, output_event) }; +\t\t\tt4 : start -[]-> done { operation.i!(1, value, value, shared, output_event) }; +\t\t\tt5 : start -[]-> done { call_access!(1, record_value.field, value, shared, output_event) }; +\t\t\tt6 : start -[]-> done { local_call!(1, value, value, shared, output_event) }; +\t +----- Xtext reparse ----- +reparsed diff --git a/ba/org.osate.ba.tests/models/issue3181/CommunicationTargets.aadl b/ba/org.osate.ba.tests/models/issue3181/CommunicationTargets.aadl index 31c6bcb7bac..e583f5d11a8 100644 --- a/ba/org.osate.ba.tests/models/issue3181/CommunicationTargets.aadl +++ b/ba/org.osate.ba.tests/models/issue3181/CommunicationTargets.aadl @@ -54,6 +54,7 @@ public t10 : start -[]-> done { output_event!(1) }; t11 : start -[]-> done { input_event?(value) }; t12 : start -[]-> done { input?(input_data) }; + t13 : start -[]-> done { input?(output_event) }; **}; end host.i; end CommunicationTargets; diff --git a/ba/org.osate.ba.tests/models/issue3181/InheritedCalls.aadl b/ba/org.osate.ba.tests/models/issue3181/InheritedCalls.aadl new file mode 100644 index 00000000000..00fb71b199d --- /dev/null +++ b/ba/org.osate.ba.tests/models/issue3181/InheritedCalls.aadl @@ -0,0 +1,68 @@ +-- Copyright (c) 2004-2026 Carnegie Mellon University and others. (see Contributors file). +-- All Rights Reserved. +-- +-- NO WARRANTY. ALL MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY +-- KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED TO, WARRANTY OF FITNESS FOR PURPOSE +-- OR MERCHANTABILITY, EXCLUSIVITY, OR RESULTS OBTAINED FROM USE OF THE MATERIAL. CARNEGIE MELLON UNIVERSITY DOES NOT +-- MAKE ANY WARRANTY OF ANY KIND WITH RESPECT TO FREEDOM FROM PATENT, TRADEMARK, OR COPYRIGHT INFRINGEMENT. +-- +-- This program and the accompanying materials are made available under the terms of the Eclipse Public License 2.0 +-- which is available at https://www.eclipse.org/legal/epl-2.0/ +-- SPDX-License-Identifier: EPL-2.0 +-- +-- Created, in part, with funding and support from the United States Government. (see Acknowledgments file). +-- +-- This program includes and/or can make use of certain third party source code, object code, documentation and other +-- files ("Third Party Software"). The Third Party Software that is used by this program is dependent upon your system +-- configuration. By using this program, You agree to comply with any and all relevant Third Party Software terms and +-- conditions contained in any such Third Party Software or separate license file distributed with such Third Party +-- Software. The parties who own the Third Party Software ("Third Party Licensors") are intended third party benefici- +-- aries to this license with respect to the terms applicable to their Third Party Software. Third Party Software li- +-- censes only apply to the Third Party Software and not any other portion of this program or this program as a whole. + +package InheritedCalls +public + with Base_Types; + + -- The extension appears first so source offsets alone cannot order inherited features. + subprogram derived extends original + features + result : refined to out parameter Base_Types::Integer; + flag : in parameter Base_Types::Boolean; + end derived; + + subprogram original + features + argument : in parameter Base_Types::Integer; + result : out parameter Base_Types::Integer; + end original; + + feature group services + features + invoke : requires subprogram access derived; + shared : requires data access Base_Types::Integer; + end services; + + abstract host + prototypes + typed : subprogram derived; + untyped : subprogram; + features + api : feature group services; + end host; + + abstract implementation host.i + annex behavior_specification {** + variables + value : Base_Types::Integer := 1; + states + start : initial state; + done : final state; + transitions + start -[]-> done { derived!(1, value, true) }; + start -[]-> done { typed!(1, value, true) }; + start -[]-> done { untyped!(1, value) }; + start -[]-> done { api.invoke!(1, api.shared, true) }; + **}; + end host.i; +end InheritedCalls; diff --git a/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3181Test.java b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3181Test.java index 1210f36d5e2..22383684e29 100644 --- a/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3181Test.java +++ b/ba/org.osate.ba.tests/src/org/osate/ba/tests/Issue3181Test.java @@ -59,6 +59,12 @@ public class Issue3181Test extends XtextTest { @Inject private ValidationTestHelper validationHelper; + @Test + public void inheritedRefinedAndPrototypeSignaturesRetainTheirOrder() throws Exception { + var root = testHelper.parseFile(PATH + "InheritedCalls.aadl"); + validationHelper.assertNoIssues(root); + } + @Test public void validCommunicationsAndCallFormsAreAccepted() throws Exception { var root = testHelper.parseFile(PATH + "Issue3181.aadl"); @@ -66,51 +72,55 @@ public void validCommunicationsAndCallFormsAreAccepted() throws Exception { var annex = BehaviorAnnexUtil.getStrictModel(AnnexUtil.getAllDefaultAnnexSubclauses(root).getFirst()); var call = (SubprogramCallAction) annex.getTransitions().get(5).getActionBlock().getContent(); assertEquals(5, call.getParameterLabels().size()); - assertTrue("A record field used as an out actual must remain a target", call.getParameterLabels().get(1) instanceof Target); + assertTrue("A record field used as an out actual must remain a target", + call.getParameterLabels().get(1) instanceof Target); assertTrue("An output port formal must retain its target", call.getParameterLabels().get(4) instanceof Target); } @Test public void communicationTargetsAndPayloadCountsAreChecked() throws Exception { - assertDiagnostics("CommunicationTargets", List.of( - new Expected("input", "A port send action requires an outgoing port"), - new Expected("output", "A dequeue action requires an incoming event or event data port"), - new Expected("input_data", "A dequeue action requires an incoming event or event data port"), - new Expected("output", "A freeze action requires an incoming port"), - new Expected("value", "A send or call action requires a port, internal feature, or callable subprogram"), - new Expected("value", "A dequeue action requires an incoming event or event data port"), - new Expected("value", "A freeze action requires an incoming port"), - new Expected("value", "A lock or unlock action requires a required data access"), - new Expected("provided", "A lock or unlock action requires a required data access"), - new Expected("output!(1, 2)", "A port send action accepts at most one value"), - new Expected("output_event!(1)", "An event port send action cannot carry a value"), - new Expected("input_event?(value)", "An event port dequeue action cannot assign a data value"), - new Expected("input_data", "A dequeue target must be writable"))); + assertDiagnostics("CommunicationTargets", + List.of(new Expected("input", "A port send action requires an outgoing port"), + new Expected("output", "A dequeue action requires an incoming event or event data port"), + new Expected("input_data", "A dequeue action requires an incoming event or event data port"), + new Expected("output", "A freeze action requires an incoming port"), + new Expected("value", + "A send or call action requires a port, internal feature, or callable subprogram"), + new Expected("value", "A dequeue action requires an incoming event or event data port"), + new Expected("value", "A freeze action requires an incoming port"), + new Expected("value", "A lock or unlock action requires a required data access"), + new Expected("provided", "A lock or unlock action requires a required data access"), + new Expected("output!(1, 2)", "A port send action accepts at most one value"), + new Expected("output_event!(1)", "An event port send action cannot carry a value"), + new Expected("input_event?(value)", "An event port dequeue action cannot assign a data value"), + new Expected("input_data", "A dequeue target must be writable"), + new Expected("output_event", "A dequeue target must be writable"))); } @Test public void internalSendCannotDiscardExtraValues() throws Exception { - assertDiagnostics("InternalSend", List.of(new Expected("internal_data!(1, 2)", - "A port send action accepts at most one value"))); + assertDiagnostics("InternalSend", + List.of(new Expected("internal_data!(1, 2)", "A port send action accepts at most one value"))); } @Test public void everyFormalCountsForEveryCallableForm() throws Exception { - assertDiagnostics("CallCounts", List.of( - new Expected("operation!", "Subprogram call requires 5 actuals but has 0"), - new Expected("operation.i!(1)", "Subprogram call requires 5 actuals but has 1"), - new Expected("call_access!(1, value)", "Subprogram call requires 5 actuals but has 2"), - new Expected("local_call!(1, value, value, value, value, value)", "Subprogram call requires 5 actuals but has 6"))); + assertDiagnostics("CallCounts", + List.of(new Expected("operation!", "Subprogram call requires 5 actuals but has 0"), + new Expected("operation.i!(1)", "Subprogram call requires 5 actuals but has 1"), + new Expected("call_access!(1, value)", "Subprogram call requires 5 actuals but has 2"), + new Expected("local_call!(1, value, value, value, value, value)", + "Subprogram call requires 5 actuals but has 6"))); } @Test public void parameterDirectionsRequireReadableValuesAndWritableTargets() throws Exception { - assertDiagnostics("CallActuals", List.of( - new Expected("2", "Actual for out parameter 'result' must be a writable target"), - new Expected("value + 1", "Actual for out parameter 'result' must be a writable target"), - new Expected("input", "Actual for out parameter 'result' must be a writable target"), - new Expected("output", "Actual for in parameter 'argument' must be readable"), - new Expected("i", "Actual for out parameter 'result' must be a writable target"))); + assertDiagnostics("CallActuals", + List.of(new Expected("2", "Actual for out parameter 'result' must be a writable target"), + new Expected("value + 1", "Actual for out parameter 'result' must be a writable target"), + new Expected("input", "Actual for out parameter 'result' must be a writable target"), + new Expected("output", "Actual for in parameter 'argument' must be readable"), + new Expected("i", "Actual for out parameter 'result' must be a writable target"))); } @Test @@ -118,8 +128,10 @@ public void dataAccessAndPortActualsMatchTheirFormalCategories() throws Exceptio assertDiagnostics("FeatureActuals", List.of( new Expected("2", "Actual for data access 'shared' must reference data"), new Expected("2", "Actual for port 'signal' must reference a port of the same category and direction"), - new Expected("input_event", "Actual for port 'signal' must reference a port of the same category and direction"), - new Expected("output", "Actual for port 'signal' must reference a port of the same category and direction"))); + new Expected("input_event", + "Actual for port 'signal' must reference a port of the same category and direction"), + new Expected("output", + "Actual for port 'signal' must reference a port of the same category and direction"))); } @Test @@ -138,7 +150,8 @@ private void assertDiagnostics(String model, List expected) throws Exc 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()); + return new Expected(source.substring(issue.getOffset(), issue.getOffset() + issue.getLength()), + issue.getMessage()); }).toList()); } 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 8ff28ba6a70..053acb97b4f 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 @@ -64,12 +64,14 @@ import org.osate.ba.aadlba.PortSendAction; import org.osate.ba.aadlba.Relation; import org.osate.ba.aadlba.SimpleExpression; +import org.osate.ba.aadlba.SubprogramCallAction; import org.osate.ba.aadlba.Term; import org.osate.ba.aadlba.ValueExpression; import org.osate.ba.aadlba.WhileOrDoUntilStatement; import org.osate.ba.utils.AadlBaUtils; import org.osate.ba.utils.AadlBaVisitors; import org.osate.ba.utils.DimensionException; +import org.osate.ba.utils.SubprogramCallUtil; /** * Checks an already resolved strict Behavior Annex model. Name binding, ambiguity resolution, holder construction, and @@ -240,10 +242,43 @@ private boolean checkBasicAction(BasicAction action) { return checkInternalPortSend((InternalPortSendAction) action); } else if (action instanceof PortDequeueAction) { return checkPortDequeue((PortDequeueAction) action); + } else if (action instanceof SubprogramCallAction call) { + return checkSubprogramCall(call); } return true; } + private boolean checkSubprogramCall(SubprogramCallAction call) { + var classifier = SubprogramCallUtil.getClassifier(call.getSubprogram(), baParentContainer); + if (classifier == null) { + return true; + } + var formals = SubprogramCallUtil.getFormals(classifier); + if (formals.size() != call.getParameterLabels().size()) { + reportError(call, "Subprogram call requires " + formals.size() + " actuals but has " + + call.getParameterLabels().size()); + return false; + } + var valid = true; + for (var i = 0; i < formals.size(); i++) { + var formal = formals.get(i); + // Event ports and other non-data features have no data type to compare. + if (AadlBaUtils.getClassifier(formal, classifier) instanceof DataClassifier dataClassifier) { + var actual = call.getParameterLabels().get(i); + var formalType = getType(dataClassifier); + var actualType = getType(actual); + if (formalType == null || actualType == null) { + valid = false; + } else if (!dataChecker.conformsTo(formalType, actualType, true)) { + reportTypeError(actual, "actual for '" + formal.getName() + "'", formalType.toString(), + actualType.toString()); + valid = false; + } + } + } + return valid; + } + private boolean checkAssignment(AssignmentAction action) { // AS5506/3 Rev A admits an internal port as an assignment target, but an internal event has no data, so it has // no value to hold. Only an internal event data feature does. diff --git a/ba/org.osate.ba/src/org/osate/ba/utils/SubprogramCallUtil.java b/ba/org.osate.ba/src/org/osate/ba/utils/SubprogramCallUtil.java new file mode 100644 index 00000000000..7e45633c0a2 --- /dev/null +++ b/ba/org.osate.ba/src/org/osate/ba/utils/SubprogramCallUtil.java @@ -0,0 +1,89 @@ +/** + * 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.utils; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; + +import org.eclipse.xtext.nodemodel.util.NodeModelUtils; +import org.osate.aadl2.Classifier; +import org.osate.aadl2.ComponentClassifier; +import org.osate.aadl2.ComponentImplementation; +import org.osate.aadl2.ComponentType; +import org.osate.aadl2.Feature; +import org.osate.aadl2.SubprogramClassifier; +import org.osate.ba.aadlba.CalledSubprogramHolder; + +/** Shared, read-only signature lookup for translation and validation of BA calls. */ +public final class SubprogramCallUtil { + private SubprogramCallUtil() { + } + + /** Resolves accesses, subcomponents and prototypes in their enclosing group context. */ + public static SubprogramClassifier getClassifier(CalledSubprogramHolder holder, ComponentClassifier owner) { + if (holder == null || holder.getElement() == null) { + return null; + } + Classifier context = owner; + for (var group : holder.getGroupHolders()) { + var classifier = AadlBaUtils.getClassifier(group.getElement(), context); + if (classifier != null) { + context = classifier; + } + } + var element = holder.getElement(); + var classifier = element instanceof SubprogramClassifier subprogram ? subprogram + : AadlBaUtils.getClassifier(element, context); + return classifier instanceof SubprogramClassifier subprogram ? subprogram : null; + } + + /** + * Includes every feature, in declaration order, with refinements retaining their inherited position. + * Does not bind prototypes by mutating features in the source classifier. + */ + public static List getFormals(SubprogramClassifier classifier) { + if (classifier == null) { + return List.of(); + } + var type = classifier instanceof ComponentImplementation implementation ? implementation.getType() + : (ComponentType) classifier; + var features = new LinkedHashMap(); + var ancestors = type.getSelfPlusAllExtended(); + for (var ancestor : new ArrayList<>(ancestors).reversed()) { + // getOwnedFeatures is a derived union grouped by feature kind, not by source order. + var declared = new ArrayList<>(((ComponentType) ancestor).getOwnedFeatures()); + declared.sort(Comparator.comparingInt(feature -> { + var node = NodeModelUtils.findActualNodeFor(feature); + return node == null ? Integer.MAX_VALUE : node.getOffset(); + })); + for (var feature : declared) { + features.put(feature.getName().toLowerCase(Locale.ROOT), feature); + } + } + return List.copyOf(features.values()); + } +} diff --git a/ba/org.osate.xtext.aadl2.ba/src/org/osate/xtext/aadl2/ba/translation/DeclarativeToStrictTranslator.java b/ba/org.osate.xtext.aadl2.ba/src/org/osate/xtext/aadl2/ba/translation/DeclarativeToStrictTranslator.java index 18e73203819..31e8a079e17 100644 --- a/ba/org.osate.xtext.aadl2.ba/src/org/osate/xtext/aadl2/ba/translation/DeclarativeToStrictTranslator.java +++ b/ba/org.osate.xtext.aadl2.ba/src/org/osate/xtext/aadl2/ba/translation/DeclarativeToStrictTranslator.java @@ -63,6 +63,7 @@ import org.osate.aadl2.NamedElement; import org.osate.aadl2.NumberValue; import org.osate.aadl2.Parameter; +import org.osate.aadl2.Port; import org.osate.aadl2.PortSpecification; import org.osate.aadl2.ProcessorClassifier; import org.osate.aadl2.Property; @@ -75,10 +76,7 @@ import org.osate.aadl2.RecordType; import org.osate.aadl2.StringLiteral; import org.osate.aadl2.SubprogramAccess; -import org.osate.aadl2.SubprogramImplementation; -import org.osate.aadl2.SubprogramPrototype; import org.osate.aadl2.SubprogramSubcomponent; -import org.osate.aadl2.SubprogramType; import org.osate.aadl2.modelsupport.util.AadlUtil; import org.osate.aadl2.parsesupport.ParseUtil; import org.osate.ba.aadlba.AadlBaFactory; @@ -126,6 +124,7 @@ import org.osate.ba.analyzers.BehaviorTransitionContext; import org.osate.ba.utils.AadlBaUtils; import org.osate.ba.utils.DimensionException; +import org.osate.ba.utils.SubprogramCallUtil; import org.osate.utils.internal.Aadl2Utils; import org.osate.utils.internal.Aadl2Visitors; import org.osate.utils.internal.PropertyUtils; @@ -858,7 +857,8 @@ private BehaviorAction toCommunicationAction(final CommunicationAction action) { && path.getFirst() instanceof org.osate.ba.aadlba.SubprogramHolderProxy proxy) { result.setProxy(proxy); } - final var formalParameters = getFormalParameters(result.getSubprogram()); + final var formalParameters = SubprogramCallUtil + .getFormals(SubprogramCallUtil.getClassifier(result.getSubprogram(), owner)); for (var i = 0; i < action.getParameters().size(); i++) { final var formal = i < formalParameters.size() ? formalParameters.get(i) : null; result.getParameterLabels().add(toParameterLabel(action.getParameters().get(i), formal)); @@ -870,13 +870,12 @@ private ParameterLabel toParameterLabel( final org.osate.xtext.aadl2.ba.behaviorAnnex.ValueExpression parameter, final Feature formal) { final var writable = formal instanceof Parameter formalParameter ? formalParameter.getDirection() != DirectionType.IN - : formal instanceof DataAccess dataAccess - && Aadl2Utils.getDataAccessRight(dataAccess) != Aadl2Utils.DataAccessRight.read_only; + : formal instanceof Port port ? port.isOut() + : formal instanceof DataAccess dataAccess + && Aadl2Utils.getDataAccessRight(dataAccess) != Aadl2Utils.DataAccessRight.read_only; if (writable && parameter instanceof ReferenceExpression expression) { if (expression.getProperty() == null && !expression.isCount() && !expression.isFresh() - && !expression.isUpdated() && !expression.isDequeue() - && expression.getReference().getSegments().size() - + expression.getReference().getTails().size() == 1) { + && !expression.isUpdated() && !expression.isDequeue()) { final var reference = toReferenceValue(expression.getReference()); if (reference instanceof Target target) { return target; @@ -886,46 +885,6 @@ private ParameterLabel toParameterLabel( return toValueExpression(parameter); } - private List getFormalParameters(final CalledSubprogramHolder holder) { - final var classifier = getSubprogramType(holder); - if (classifier == null) { - return List.of(); - } - return Aadl2Utils.orderFeatures(classifier) - .stream() - .filter(feature -> feature instanceof Parameter || feature instanceof DataAccess) - .toList(); - } - - private Classifier getSubprogramType(final CalledSubprogramHolder holder) { - if (holder == null) { - return null; - } - final var element = holder.getElement(); - return switch (element) { - case SubprogramImplementation implementation -> implementation.getType(); - case SubprogramType type -> type; - case SubprogramAccess access -> access.getClassifier(); - case SubprogramSubcomponent subcomponent -> subcomponent.getClassifier(); - case SubprogramPrototype prototype -> { - var prototypeContext = (Classifier) owner; - if (holder instanceof GroupableElement groupable && !groupable.getGroupHolders().isEmpty()) { - final var group = groupable.getGroupHolders().getLast().getElement(); - final var groupClassifier = AadlBaUtils.getClassifier(group, owner); - if (groupClassifier != null) { - prototypeContext = groupClassifier; - } - } - final var boundClassifier = AadlBaUtils.getClassifier(prototype, prototypeContext); - if (boundClassifier instanceof SubprogramImplementation implementation) { - yield implementation.getType(); - } - yield boundClassifier != null ? boundClassifier : prototype.getConstrainingClassifier(); - } - default -> null; - }; - } - private org.osate.ba.aadlba.BehaviorTime toTime(final BehaviorTime time) { final org.osate.ba.aadlba.BehaviorTime result = trace(FACTORY.createBehaviorTime(), time); copyTime(time, result); 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 3fac7ef7a7b..d3058799086 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 @@ -43,10 +43,13 @@ import org.eclipse.xtext.validation.Check; import org.eclipse.xtext.validation.CheckType; import org.eclipse.xtext.validation.ValidationMessageAcceptor; +import org.osate.aadl2.AccessType; import org.osate.aadl2.ComponentClassifier; import org.osate.aadl2.ComponentImplementation; +import org.osate.aadl2.DataAccess; import org.osate.aadl2.DataClassifier; import org.osate.aadl2.DataSubcomponent; +import org.osate.aadl2.DirectedFeature; import org.osate.aadl2.DirectionType; import org.osate.aadl2.Element; import org.osate.aadl2.EventDataPort; @@ -54,6 +57,7 @@ import org.osate.aadl2.FeatureGroup; import org.osate.aadl2.InternalFeature; import org.osate.aadl2.NumberType; +import org.osate.aadl2.Parameter; import org.osate.aadl2.Port; import org.osate.aadl2.Property; import org.osate.aadl2.PropertyType; @@ -68,12 +72,14 @@ import org.osate.ba.aadlba.ForOrForAllStatement; import org.osate.ba.aadlba.PropertyReference; import org.osate.ba.aadlba.PropertySetPropertyReference; +import org.osate.ba.aadlba.SubprogramCallAction; import org.osate.ba.aadlba.util.AadlBaSwitch; import org.osate.ba.analyzers.AadlBaInitializationChecker; import org.osate.ba.analyzers.AadlBaRulesCheckersDriver; import org.osate.ba.analyzers.AadlBaTypeChecker; import org.osate.ba.analyzers.AdaLikeDataTypeChecker; import org.osate.ba.utils.AadlBaUtils; +import org.osate.ba.utils.SubprogramCallUtil; import org.osate.xtext.aadl2.ba.behaviorAnnex.ArrayDimension; import org.osate.xtext.aadl2.ba.behaviorAnnex.AssignmentAction; import org.osate.xtext.aadl2.ba.behaviorAnnex.BehaviorAnnex; @@ -124,6 +130,7 @@ public final class BehaviorAnnexValidator extends AbstractBehaviorAnnexValidator public static final String EXTERNAL_CONDITION_IN_MODES = "org.osate.xtext.aadl2.ba.externalConditionInModes"; public static final String UNARY_PLUS = "org.osate.xtext.aadl2.ba.unaryPlus"; public static final String PORT_STATUS_DIRECTION = "org.osate.xtext.aadl2.ba.portStatusDirection"; + public static final String COMMUNICATION_ACTION = "org.osate.xtext.aadl2.ba.communicationAction"; private static final URI VALIDATION_RESOURCE_URI = URI.createURI("validation:/behavior-annex.aadlba"); @Inject @@ -205,10 +212,12 @@ private final class DeclarativeChecks extends BehaviorAnnexSwitch { private final List completeStates = new ArrayList<>(); private final List> pendingChecks = new ArrayList<>(); private final boolean inModes; + private final ComponentClassifier owner; private boolean hasUnresolvedReference; private DeclarativeChecks(final BehaviorAnnex source) { inModes = DeclarativeToStrictTranslator.hasInModes(source); + owner = (ComponentClassifier) source.getContainingClassifier(); } @Override @@ -293,6 +302,7 @@ public Void caseAssignmentAction(final AssignmentAction action) { @Override public Void caseCommunicationAction(final CommunicationAction action) { + pendingChecks.add(translation -> checkCommunicationAction(action, translation, owner)); if (action.isDequeue()) { pendingChecks.add(translation -> checkIteratorTarget(action.getTarget(), translation)); } @@ -484,6 +494,218 @@ private boolean checkInternalPortUse(final Reference reference, final Translatio return true; } + /** Checks written operands before strict translation can hide an invalid target or extra send value. */ + private boolean checkCommunicationAction(CommunicationAction action, TranslationResult translation, + ComponentClassifier owner) { + var reference = action.getReference(); + if (reference == null) { + return true; // Wildcard lock and unlock actions have no individual target. + } + var resolved = translation.getResolvedReference(reference); + if (resolved instanceof InternalFeature && !action.isSend()) { + return true; // checkInternalPortUse already diagnoses this use. + } + if (action.isLock() || action.isUnlock()) { + return resolved instanceof DataAccess access && isRequiredAccess(reference, access, translation) + || communicationError(reference, "A lock or unlock action requires a required data access"); + } + if (action.isFreeze()) { + return resolved instanceof Port && hasDirection(reference, translation, true) + || communicationError(reference, "A freeze action requires an incoming port"); + } + if (action.isDequeue()) { + var valid = (resolved instanceof EventPort || resolved instanceof EventDataPort) + && hasDirection(reference, translation, true); + if (!valid) { + return communicationError(reference, "A dequeue action requires an incoming event or event data port"); + } + if (action.getTarget() != null) { + if (resolved instanceof EventPort) { + return communicationError(action, "An event port dequeue action cannot assign a data value"); + } + if (referenceRoot(action.getTarget(), translation) instanceof ForStatement) { + return true; // checkIteratorTarget owns the diagnostic for a dequeue into an iterator. + } + return isWritable(action.getTarget(), translation) + || communicationError(action.getTarget(), "A dequeue target must be writable"); + } + return true; + } + if (resolved instanceof Port || resolved instanceof InternalFeature) { + var valid = true; + if (resolved instanceof Port && !hasDirection(reference, translation, false)) { + valid = communicationError(reference, "A port send action requires an outgoing port"); + } + if (action.getParameters().size() > 1) { + valid = communicationError(action, "A port send action accepts at most one value"); + } else if (resolved instanceof EventPort && !action.getParameters().isEmpty()) { + valid = communicationError(action, "An event port send action cannot carry a value"); + } + return valid; + } + if (!(translation.getStrict(action) instanceof SubprogramCallAction call) || call.getSubprogram() == null) { + return communicationError(reference, + "A send or call action requires a port, internal feature, or callable subprogram"); + } + var classifier = SubprogramCallUtil.getClassifier(call.getSubprogram(), owner); + if (classifier == null) { + return true; // An unconstrained, unbound prototype has no signature to check yet. + } + var formals = SubprogramCallUtil.getFormals(classifier); + if (formals.size() != action.getParameters().size()) { + return communicationError(action, + "Subprogram call requires " + formals.size() + " actuals but has " + action.getParameters().size()); + } + var valid = true; + for (var i = 0; i < formals.size(); i++) { + var formal = formals.get(i); + var actual = action.getParameters().get(i); + var actualReference = plainReference(actual); + if (formal instanceof Parameter parameter) { + if (parameter.isOut() && (actualReference == null || !isWritable(actualReference, translation))) { + valid = communicationError(actual, "Actual for " + parameter.getDirection().getLiteral() + + " parameter '" + formal.getName() + "' must be a writable target"); + } else if (parameter.isIn() && !isReadable(actual, translation)) { + valid = communicationError(actual, "Actual for " + parameter.getDirection().getLiteral() + + " parameter '" + formal.getName() + "' must be readable"); + } + } else if (formal instanceof DataAccess) { + if (actualReference == null || !isDataReference(actualReference, translation)) { + valid = communicationError(actual, + "Actual for data access '" + formal.getName() + "' must reference data"); + } + // Access_Right is an effective instance property, not a source-level direction. + } else if (formal instanceof Port port) { + if (actualReference == null + || !(translation.getResolvedReference(actualReference) instanceof Port actualPort) + || port.eClass() != actualPort.eClass() + || port.isIn() && !hasDirection(actualReference, translation, true) + || port.isOut() && !hasDirection(actualReference, translation, false)) { + valid = communicationError(actual, "Actual for port '" + formal.getName() + + "' must reference a port of the same category and direction"); + } + } else { + // Do not omit an unrepresentable formal and shift every subsequent actual to the wrong feature. + valid = communicationError(actual, + "Feature '" + formal.getName() + "' is not supported as a Behavior Annex call parameter"); + } + } + return valid; + } + + private boolean communicationError(EObject source, String message) { + error(message, source, null, ValidationMessageAcceptor.INSIGNIFICANT_INDEX, COMMUNICATION_ACTION); + return false; + } + + private static Reference plainReference(org.osate.xtext.aadl2.ba.behaviorAnnex.ValueExpression expression) { + return expression instanceof ReferenceExpression reference && reference.getProperty() == null + && !reference.isCount() && !reference.isFresh() && !reference.isUpdated() && !reference.isDequeue() + ? reference.getReference() + : null; + } + + /** Direction of an owner feature, accounting for each enclosing inverse feature group. */ + private static boolean hasDirection(Reference reference, TranslationResult translation, boolean incoming) { + var inverse = featureInversion(reference, translation); + return inverse != null && translation.getResolvedReference(reference) instanceof DirectedFeature feature + && (incoming ^ inverse ? feature.isIn() : feature.isOut()); + } + + private static boolean isRequiredAccess(Reference reference, DataAccess access, TranslationResult translation) { + var inverse = featureInversion(reference, translation); + return inverse != null && (access.getKind() == AccessType.REQUIRES) != inverse; + } + + /** Returns null for paths that do not name a feature of the owner or its feature groups. */ + private static Boolean featureInversion(Reference reference, TranslationResult translation) { + var segments = new ArrayList<>(reference.getSegments()); + for (var tail : reference.getTails()) { + if (!".".equals(tail.getSeparator())) { + return null; + } + segments.add(tail.getSegment()); + } + var inverse = false; + for (var i = 0; i < segments.size() - 1; i++) { + if (!(translation.getResolvedReference(segments.get(i)) instanceof FeatureGroup group)) { + return null; + } + inverse ^= group.isInverse(); + var type = group.getAllFeatureGroupType(); + inverse ^= type != null && type.getInverse() != null; + } + return inverse; + } + + private static boolean isDataReference(Reference reference, TranslationResult translation) { + var root = referenceRoot(reference, translation); + return root instanceof DataSubcomponent || root instanceof DataAccess || root instanceof Parameter + || root instanceof BehaviorVariable; + } + + private static EObject referenceRoot(Reference reference, TranslationResult translation) { + var segments = new ArrayList<>(reference.getSegments()); + reference.getTails().forEach(tail -> segments.add(tail.getSegment())); + for (var segment : segments) { + var resolved = translation.getResolvedReference(segment); + if (!(resolved instanceof FeatureGroup)) { + return resolved; + } + } + return null; + } + + private static boolean isWritable(Reference reference, TranslationResult translation) { + if (!(translation.getStrict(reference) instanceof org.osate.ba.aadlba.Target) + || reference.getSegments().isEmpty() + || translation.getResolvedReference(reference) instanceof EventPort) { + return false; + } + var root = referenceRoot(reference, translation); + if (root instanceof ForStatement) { + return false; + } + if (root instanceof Parameter parameter) { + return parameter.isOut(); + } + if (translation.getResolvedReference(reference) instanceof Port) { + return hasDirection(reference, translation, false); + } + return isDataReference(reference, translation) + || translation.getResolvedReference(reference) instanceof org.osate.aadl2.EventDataSource; + } + + private static boolean isReadable(org.osate.xtext.aadl2.ba.behaviorAnnex.ValueExpression expression, + TranslationResult translation) { + if (expression instanceof ReferenceExpression reference && !isReadableReference(reference, translation)) { + return false; + } + for (var contents = expression.eAllContents(); contents.hasNext();) { + if (contents.next() instanceof ReferenceExpression reference + && !isReadableReference(reference, translation)) { + return false; + } + } + return true; + } + + private static boolean isReadableReference(ReferenceExpression expression, TranslationResult translation) { + if (expression.getProperty() != null || expression.isCount() || expression.isFresh() || expression.isUpdated() + || expression.isDequeue()) { + return true; + } + var reference = expression.getReference(); + var root = referenceRoot(reference, translation); + if (root instanceof Parameter parameter) { + return parameter.isIn(); + } + if (translation.getResolvedReference(reference) instanceof Port port) { + return !(port instanceof EventPort) && hasDirection(reference, translation, true); + } + return isDataReference(reference, translation) || root instanceof ForStatement; + } + private static boolean isStandardInternalPortUse(final Reference reference) { if (reference.eContainer() instanceof AssignmentAction assignment) { return assignment.getTarget() == reference;