From ad87cfcfc708017a7f36e28d6825878e830a26d2 Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Tue, 5 Nov 2024 20:51:36 +0100 Subject: [PATCH 01/27] #34 Updated JDK to 21 --- .github/workflows/build.yml | 2 +- .github/workflows/dependency.yml | 2 +- README.md | 2 +- .../hu/bme/mit/semantifyr/gradle/conventions/jvm.gradle.kts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 018e8aa..6559934 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v4 with: - java-version: 17 + java-version: 21 distribution: adopt - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 diff --git a/.github/workflows/dependency.yml b/.github/workflows/dependency.yml index 22a6d73..05fa8e2 100644 --- a/.github/workflows/dependency.yml +++ b/.github/workflows/dependency.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: temurin - java-version: 17 + java-version: 21 - name: Generate and submit dependency graph uses: gradle/actions/dependency-submission@v4 diff --git a/README.md b/README.md index 6d0edde..449b16f 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ A framework to support the declarative definition of engineering model semantics ## Build -Use Java 17 for building. +Use Java 21 for building. Run `gradlew build` to assemble the whole project, and execute all automated test, including regression testing and formal verifications. The required environment (e.g., Theta binaries) is automatically constructed by Gradle. Tests should run in a few minutes. diff --git a/buildSrc/src/main/kotlin/hu/bme/mit/semantifyr/gradle/conventions/jvm.gradle.kts b/buildSrc/src/main/kotlin/hu/bme/mit/semantifyr/gradle/conventions/jvm.gradle.kts index 3861a23..e4cccca 100644 --- a/buildSrc/src/main/kotlin/hu/bme/mit/semantifyr/gradle/conventions/jvm.gradle.kts +++ b/buildSrc/src/main/kotlin/hu/bme/mit/semantifyr/gradle/conventions/jvm.gradle.kts @@ -32,7 +32,7 @@ dependencies { } java.toolchain { - languageVersion.set(JavaLanguageVersion.of(17)) + languageVersion.set(JavaLanguageVersion.of(21)) } tasks { From 99d3c6f64d593b4429ecf633fcbaecbeb02ceccb Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Tue, 5 Nov 2024 20:54:00 +0100 Subject: [PATCH 02/27] #18 Added Cex language support --- settings.gradle.kts | 2 + subprojects/cex.lang.ide/.gitignore | 6 ++ subprojects/cex.lang.ide/build.gradle.kts | 56 +++++++++++++++ .../semantifyr/cex/lang/ide/CexIdeModule.java | 14 ++++ .../semantifyr/cex/lang/ide/CexIdeSetup.java | 42 ++++++++++++ .../src/main/resources/plugin.properties | 5 ++ subprojects/cex.lang/.gitignore | 7 ++ subprojects/cex.lang/build.gradle.kts | 65 ++++++++++++++++++ .../hu/bme/mit/semantifyr/cex/lang/Cex.xtext | 61 +++++++++++++++++ .../semantifyr/cex/lang/CexRuntimeModule.java | 11 +++ .../cex/lang/CexStandaloneSetup.java | 15 ++++ .../mit/semantifyr/cex/lang/GenerateCex.mwe2 | 68 +++++++++++++++++++ .../cex/lang/formatting2/CexFormatter.java | 26 +++++++ .../cex/lang/generator/CexGenerator.java | 30 ++++++++ .../cex/lang/scoping/CexScopeProvider.java | 15 ++++ .../lang/serializer/CexSemanticSequencer.java | 8 +++ .../serializer/CexSyntacticSequencer.java | 8 +++ .../cex/lang/validation/CexValidator.java | 25 +++++++ 18 files changed, 464 insertions(+) create mode 100644 subprojects/cex.lang.ide/.gitignore create mode 100644 subprojects/cex.lang.ide/build.gradle.kts create mode 100644 subprojects/cex.lang.ide/src/main/java/hu/bme/mit/semantifyr/cex/lang/ide/CexIdeModule.java create mode 100644 subprojects/cex.lang.ide/src/main/java/hu/bme/mit/semantifyr/cex/lang/ide/CexIdeSetup.java create mode 100644 subprojects/cex.lang.ide/src/main/resources/plugin.properties create mode 100644 subprojects/cex.lang/.gitignore create mode 100644 subprojects/cex.lang/build.gradle.kts create mode 100644 subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext create mode 100644 subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/CexRuntimeModule.java create mode 100644 subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/CexStandaloneSetup.java create mode 100644 subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/GenerateCex.mwe2 create mode 100644 subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/formatting2/CexFormatter.java create mode 100644 subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/generator/CexGenerator.java create mode 100644 subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/scoping/CexScopeProvider.java create mode 100644 subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/serializer/CexSemanticSequencer.java create mode 100644 subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/serializer/CexSyntacticSequencer.java create mode 100644 subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/validation/CexValidator.java diff --git a/settings.gradle.kts b/settings.gradle.kts index 81d7c36..927d143 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -10,6 +10,8 @@ include( "semantifyr", "xsts.lang", "xsts.lang.ide", + "cex.lang", + "cex.lang.ide", "oxsts.model", "oxsts.lang", "oxsts.lang.ide", diff --git a/subprojects/cex.lang.ide/.gitignore b/subprojects/cex.lang.ide/.gitignore new file mode 100644 index 0000000..ae7eb7e --- /dev/null +++ b/subprojects/cex.lang.ide/.gitignore @@ -0,0 +1,6 @@ +# SPDX-FileCopyrightText: 2023-2024 The Semantifyr Authors +# +# SPDX-License-Identifier: EPL-2.0 + +/src/main/xtext-gen/ +!.gitignore diff --git a/subprojects/cex.lang.ide/build.gradle.kts b/subprojects/cex.lang.ide/build.gradle.kts new file mode 100644 index 0000000..7684b93 --- /dev/null +++ b/subprojects/cex.lang.ide/build.gradle.kts @@ -0,0 +1,56 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 The Semantifyr Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + +plugins { + id("hu.bme.mit.semantifyr.gradle.xtext-generated") + id("hu.bme.mit.semantifyr.gradle.conventions.application") +} + +val ideGeneratedClasspath by configurations.creating { + isCanBeConsumed = false + isCanBeResolved = true +} + +dependencies { + api(project(":cex.lang")) + + implementation(libs.xtext.ide) + runtimeOnly(libs.slf4j.log4j) + + ideGeneratedClasspath(project(":cex.lang", configuration = "ideGeneratedOutput")) +} + +val distributionOutput by configurations.creating { + isCanBeConsumed = true + isCanBeResolved = false +} + +artifacts { + add(distributionOutput.name, layout.buildDirectory.dir("install")) { + builtBy(tasks.installDist) + } +} + +val cloneIdeGenerated by tasks.registering(Sync::class) { + inputs.files(ideGeneratedClasspath) + + from(ideGeneratedClasspath.asFileTree) + into("src/main/xtext-gen") +} + +listOf("compileJava", "processResources").forEach { task -> + tasks.named(task) { + inputs.files(cloneIdeGenerated.get().outputs) + } +} + +tasks.clean { + delete("src/main/xtext-gen") +} + +application { + mainClass = "hu.bme.mit.semantifyr.cex.lang.ide.CexIdeSetup" +} diff --git a/subprojects/cex.lang.ide/src/main/java/hu/bme/mit/semantifyr/cex/lang/ide/CexIdeModule.java b/subprojects/cex.lang.ide/src/main/java/hu/bme/mit/semantifyr/cex/lang/ide/CexIdeModule.java new file mode 100644 index 0000000..38d9a5b --- /dev/null +++ b/subprojects/cex.lang.ide/src/main/java/hu/bme/mit/semantifyr/cex/lang/ide/CexIdeModule.java @@ -0,0 +1,14 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 The Semantifyr Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package hu.bme.mit.semantifyr.cex.lang.ide; + +/** + * Use this class to register ide components. + */ +public class CexIdeModule extends AbstractCexIdeModule { + +} diff --git a/subprojects/cex.lang.ide/src/main/java/hu/bme/mit/semantifyr/cex/lang/ide/CexIdeSetup.java b/subprojects/cex.lang.ide/src/main/java/hu/bme/mit/semantifyr/cex/lang/ide/CexIdeSetup.java new file mode 100644 index 0000000..39bbef5 --- /dev/null +++ b/subprojects/cex.lang.ide/src/main/java/hu/bme/mit/semantifyr/cex/lang/ide/CexIdeSetup.java @@ -0,0 +1,42 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 The Semantifyr Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package hu.bme.mit.semantifyr.cex.lang.ide; + +import com.google.inject.Guice; +import com.google.inject.Injector; +import hu.bme.mit.semantifyr.cex.lang.CexRuntimeModule; +import hu.bme.mit.semantifyr.cex.lang.CexStandaloneSetup; +import org.eclipse.lsp4j.jsonrpc.Launcher; +import org.eclipse.lsp4j.services.LanguageClient; +import org.eclipse.xtext.ide.server.LanguageServerImpl; +import org.eclipse.xtext.ide.server.ServerModule; +import org.eclipse.xtext.util.Modules2; + +import java.util.concurrent.ExecutionException; + +/** + * Initialization support for running Xtext languages as language servers. + */ +public class CexIdeSetup extends CexStandaloneSetup { + + @Override + public Injector createInjector() { + return Guice.createInjector(Modules2.mixin(new CexRuntimeModule(), new CexIdeModule())); + } + + public static void main(String[] args) throws InterruptedException, ExecutionException { + CexIdeSetup.doSetup(); + + Injector injector = Guice.createInjector(new ServerModule()); + LanguageServerImpl languageServer = injector.getInstance(LanguageServerImpl.class); + + Launcher launcher = Launcher.createLauncher(languageServer, LanguageClient.class, System.in, System.out); + languageServer.connect(launcher.getRemoteProxy()); + launcher.startListening().get(); + } + +} diff --git a/subprojects/cex.lang.ide/src/main/resources/plugin.properties b/subprojects/cex.lang.ide/src/main/resources/plugin.properties new file mode 100644 index 0000000..c0f2617 --- /dev/null +++ b/subprojects/cex.lang.ide/src/main/resources/plugin.properties @@ -0,0 +1,5 @@ +# SPDX-FileCopyrightText: 2023-2024 The Semantifyr Authors +# +# SPDX-License-Identifier: EPL-2.0 + +_UI_DiagnosticRoot_diagnostic=Specified, so the LSP server functions correctly diff --git a/subprojects/cex.lang/.gitignore b/subprojects/cex.lang/.gitignore new file mode 100644 index 0000000..ada8597 --- /dev/null +++ b/subprojects/cex.lang/.gitignore @@ -0,0 +1,7 @@ +# SPDX-FileCopyrightText: 2023-2024 The Semantifyr Authors +# +# SPDX-License-Identifier: EPL-2.0 + +model/ +/src/main/xtext-gen/ +/src/testFixtures/xtext-gen/ diff --git a/subprojects/cex.lang/build.gradle.kts b/subprojects/cex.lang/build.gradle.kts new file mode 100644 index 0000000..4b12ba7 --- /dev/null +++ b/subprojects/cex.lang/build.gradle.kts @@ -0,0 +1,65 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 The Semantifyr Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + +plugins { + id("hu.bme.mit.semantifyr.gradle.xtext-generated") +} + +dependencies { + implementation(platform(libs.xtext.bom)) + implementation(libs.xtext.core) + implementation(libs.xtext.xbase) + + testFixturesApi(libs.xtext.testing) + + mwe2(libs.xtext.generator) + mwe2(libs.xtext.generator.antlr) +} + +val generateXtextLanguage by tasks.registering(JavaExec::class) { + mainClass.set("org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher") + classpath(configurations.mwe2) + + inputs.file("src/main/java/hu/bme/mit/semantifyr/cex/lang/GenerateCex.mwe2") + inputs.file("src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext") + + outputs.dir("src/main/xtext-gen") + outputs.dir("src/testFixtures/xtext-gen") + outputs.dir(layout.buildDirectory.dir("generated/sources/xtext/ide")) + + args("src/main/java/hu/bme/mit/semantifyr/cex/lang/GenerateCex.mwe2", "-p", "rootPath=/$projectDir/..") +} + +val ideGeneratedOutput by configurations.creating { + isCanBeConsumed = true + isCanBeResolved = false +} + +artifacts { + add(ideGeneratedOutput.name, layout.buildDirectory.dir("generated/sources/xtext/ide")) { + builtBy(generateXtextLanguage) + } +} + +tasks { + jar { + from(sourceSets.main.map { it.allSource }) { + include("**/*.xtext") + } + } + + listOf("compileJava", "processResources", "compileTestJava", "compileTestFixturesJava", "processTestFixturesResources").forEach { task -> + named(task) { + inputs.files(generateXtextLanguage.get().outputs) + } + } + + clean { + delete("src/main/xtext-gen") + delete("src/test/java") + delete("src/testFixtures/xtext-gen") + } +} diff --git a/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext new file mode 100644 index 0000000..1bb3018 --- /dev/null +++ b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext @@ -0,0 +1,61 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 The Semantifyr Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + +grammar hu.bme.mit.semantifyr.cex.lang.Cex with org.eclipse.xtext.common.Terminals + +generate cex "http://www.bme.hu/mit/2024/cex" + +import "http://www.eclipse.org/emf/2002/Ecore" as Ecore + +Cex: + "(" "XstsStateSequence" + (states += XstsState)* + ")" +; + +XstsState: + "(" "XstsState" (preInit?="pre_init")? (postInit?="post_init")? (lastEnv?="last_env")? (lastInternal?="last_internal")? + state = State + ")" +; + +State: + ExplState +; + +ExplState: + "(" "ExplState" + (variableStates += ExplVariableState)* + ")" +; + +ExplVariableState: + "(" + variable=ID value=ExplVariableValue + ")" +; + +ExplVariableValue: + LiteralInteger + | LiteralBoolean + | LiteralEnum +; + +LiteralEnum: + type=ID "." value=ID +; + +LiteralBoolean: + value = BooleanValue +; + +LiteralInteger: + value = INT +; + +BooleanValue returns Ecore::EBoolean: + 'true' | 'false' +; diff --git a/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/CexRuntimeModule.java b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/CexRuntimeModule.java new file mode 100644 index 0000000..678b89e --- /dev/null +++ b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/CexRuntimeModule.java @@ -0,0 +1,11 @@ +/* + * generated by Xtext 2.36.0 + */ +package hu.bme.mit.semantifyr.cex.lang; + + +/** + * Use this class to register components to be used at runtime / without the Equinox extension registry. + */ +public class CexRuntimeModule extends AbstractCexRuntimeModule { +} diff --git a/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/CexStandaloneSetup.java b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/CexStandaloneSetup.java new file mode 100644 index 0000000..dc248d9 --- /dev/null +++ b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/CexStandaloneSetup.java @@ -0,0 +1,15 @@ +/* + * generated by Xtext 2.36.0 + */ +package hu.bme.mit.semantifyr.cex.lang; + + +/** + * Initialization support for running Xtext languages without Equinox extension registry. + */ +public class CexStandaloneSetup extends CexStandaloneSetupGenerated { + + public static void doSetup() { + new CexStandaloneSetup().createInjectorAndDoEMFRegistration(); + } +} diff --git a/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/GenerateCex.mwe2 b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/GenerateCex.mwe2 new file mode 100644 index 0000000..65facd1 --- /dev/null +++ b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/GenerateCex.mwe2 @@ -0,0 +1,68 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 The Semantifyr Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + +module hu.bme.mit.semantifyr.cex.lang.GenerateCex + +import org.eclipse.xtext.xtext.generator.* +import org.eclipse.xtext.xtext.generator.model.project.* + +var rootPath = ".." + +Workflow { + component = XtextGenerator { + configuration = { + project = StandardProjectConfig { + baseName = "cex.lang" + rootPath = rootPath + runtime = { + src = null + } + runtimeTest = { + enabled = true + // Only generate the xtext-gen files and leave the rest of the project alone + root = null + srcGen = '${rootPath}/cex.lang/src/testFixtures/xtext-gen' + } + genericIde = { + enabled = true + root = null + srcGen = "${rootPath}/cex.lang/build/generated/sources/xtext/ide" + } + mavenLayout = true + } + code = { + encoding = "UTF-8" + lineDelimiter = "\n" + fileHeader = "/*\n * generated by Xtext \${version}\n */" + preferXtendStubs = false + } + } + language = StandardLanguage { + name = "hu.bme.mit.semantifyr.cex.lang.Cex" + fileExtensions = "cex" + + fragment = ecore2xtext.Ecore2XtextValueConverterServiceFragment2 auto-inject {} + + serializer = { + generateStub = true + } + formatter = { + generateStub = true + } + validator = { + generateDeprecationValidation = true + } + generator = { + generateXtendStub = false + } + junitSupport = { + generateStub = false + skipXbaseTestingPackage = true + junitVersion = '5' + } + } + } +} diff --git a/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/formatting2/CexFormatter.java b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/formatting2/CexFormatter.java new file mode 100644 index 0000000..2c2694a --- /dev/null +++ b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/formatting2/CexFormatter.java @@ -0,0 +1,26 @@ +/* + * generated by Xtext 2.36.0 + */ +package hu.bme.mit.semantifyr.cex.lang.formatting2; + +import hu.bme.mit.semantifyr.cex.lang.cex.Cex; +import hu.bme.mit.semantifyr.cex.lang.cex.XstsState; +import org.eclipse.xtext.formatting2.AbstractJavaFormatter; +import org.eclipse.xtext.formatting2.IFormattableDocument; + +public class CexFormatter extends AbstractJavaFormatter { + + protected void format(Cex cex, IFormattableDocument doc) { + // TODO: format HiddenRegions around keywords, attributes, cross references, etc. + for (XstsState xstsState : cex.getStates()) { + doc.format(xstsState); + } + } + + protected void format(XstsState xstsState, IFormattableDocument doc) { + // TODO: format HiddenRegions around keywords, attributes, cross references, etc. + doc.format(xstsState.getState()); + } + + // TODO: implement for ExplState +} diff --git a/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/generator/CexGenerator.java b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/generator/CexGenerator.java new file mode 100644 index 0000000..be3824d --- /dev/null +++ b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/generator/CexGenerator.java @@ -0,0 +1,30 @@ +/* + * generated by Xtext 2.36.0 + */ +package hu.bme.mit.semantifyr.cex.lang.generator; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.xtext.generator.AbstractGenerator; +import org.eclipse.xtext.generator.IFileSystemAccess2; +import org.eclipse.xtext.generator.IGeneratorContext; + +/** + * Generates code from your model files on save. + * + * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation + */ +public class CexGenerator extends AbstractGenerator { + + @Override + public void doGenerate(Resource resource, IFileSystemAccess2 fsa, IGeneratorContext context) { +// Iterator filtered = Iterators.filter(resource.getAllContents(), Greeting.class); +// Iterator names = Iterators.transform(filtered, new Function() { +// +// @Override +// public String apply(Greeting greeting) { +// return greeting.getName(); +// } +// }); +// fsa.generateFile("greetings.txt", "People to greet: " + IteratorExtensions.join(names, ", ")); + } +} diff --git a/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/scoping/CexScopeProvider.java b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/scoping/CexScopeProvider.java new file mode 100644 index 0000000..cd4c8dd --- /dev/null +++ b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/scoping/CexScopeProvider.java @@ -0,0 +1,15 @@ +/* + * generated by Xtext 2.36.0 + */ +package hu.bme.mit.semantifyr.cex.lang.scoping; + + +/** + * This class contains custom scoping description. + * + * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping + * on how and when to use it. + */ +public class CexScopeProvider extends AbstractCexScopeProvider { + +} diff --git a/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/serializer/CexSemanticSequencer.java b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/serializer/CexSemanticSequencer.java new file mode 100644 index 0000000..79f3d40 --- /dev/null +++ b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/serializer/CexSemanticSequencer.java @@ -0,0 +1,8 @@ +/* + * generated by Xtext 2.36.0 + */ +package hu.bme.mit.semantifyr.cex.lang.serializer; + + +public class CexSemanticSequencer extends AbstractCexSemanticSequencer { +} diff --git a/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/serializer/CexSyntacticSequencer.java b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/serializer/CexSyntacticSequencer.java new file mode 100644 index 0000000..3626d23 --- /dev/null +++ b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/serializer/CexSyntacticSequencer.java @@ -0,0 +1,8 @@ +/* + * generated by Xtext 2.36.0 + */ +package hu.bme.mit.semantifyr.cex.lang.serializer; + + +public class CexSyntacticSequencer extends AbstractCexSyntacticSequencer { +} diff --git a/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/validation/CexValidator.java b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/validation/CexValidator.java new file mode 100644 index 0000000..75b450b --- /dev/null +++ b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/validation/CexValidator.java @@ -0,0 +1,25 @@ +/* + * generated by Xtext 2.36.0 + */ +package hu.bme.mit.semantifyr.cex.lang.validation; + + +/** + * This class contains custom validation rules. + * + * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#validation + */ +public class CexValidator extends AbstractCexValidator { + +// public static final String INVALID_NAME = "invalidName"; +// +// @Check +// public void checkGreetingStartsWithCapital(Greeting greeting) { +// if (!Character.isUpperCase(greeting.getName().charAt(0))) { +// warning("Name should start with a capital", +// CexPackage.Literals.GREETING__NAME, +// INVALID_NAME); +// } +// } + +} From 65aae5d6367328c15c0ee111712ca82a0ce34b17 Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Thu, 7 Nov 2024 13:08:27 +0100 Subject: [PATCH 03/27] #18 Renamed Serializer to XstsSerializer --- .../src/main/kotlin/commands/CompileCommand.kt | 4 ++-- .../src/main/kotlin/commands/VerifyCommand.kt | 4 ++-- .../{Serializer.kt => XstsSerializer.kt} | 17 ++++------------- .../src/testFixtures/kotlin/CompilationTest.kt | 4 ++-- .../src/testFixtures/kotlin/VerificationTest.kt | 4 ++-- 5 files changed, 12 insertions(+), 21 deletions(-) rename subprojects/semantifyr/src/main/kotlin/serialization/{Serializer.kt => XstsSerializer.kt} (96%) diff --git a/subprojects/semantifyr/src/main/kotlin/commands/CompileCommand.kt b/subprojects/semantifyr/src/main/kotlin/commands/CompileCommand.kt index 987417a..2014e77 100644 --- a/subprojects/semantifyr/src/main/kotlin/commands/CompileCommand.kt +++ b/subprojects/semantifyr/src/main/kotlin/commands/CompileCommand.kt @@ -6,7 +6,7 @@ import com.github.ajalt.clikt.parameters.options.option import com.github.ajalt.clikt.parameters.types.file import hu.bme.mit.semantifyr.oxsts.semantifyr.reader.OxstsReader import hu.bme.mit.semantifyr.oxsts.semantifyr.reader.prepareOxsts -import hu.bme.mit.semantifyr.oxsts.semantifyr.serialization.Serializer +import hu.bme.mit.semantifyr.oxsts.semantifyr.serialization.XstsSerializer import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.XstsTransformer import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.loggerFactory import java.io.File @@ -35,7 +35,7 @@ class CompileCommand : CliktCommand("compile") { val transformer = XstsTransformer(reader) val xsts = transformer.transform(targetName, rewriteChoice = true) - val xstsString = Serializer.serialize(xsts) + val xstsString = XstsSerializer.serialize(xsts) val outputFile = output ?: File(model.path.replace(".oxsts", ".xsts")) diff --git a/subprojects/semantifyr/src/main/kotlin/commands/VerifyCommand.kt b/subprojects/semantifyr/src/main/kotlin/commands/VerifyCommand.kt index 962543c..b468a93 100644 --- a/subprojects/semantifyr/src/main/kotlin/commands/VerifyCommand.kt +++ b/subprojects/semantifyr/src/main/kotlin/commands/VerifyCommand.kt @@ -4,7 +4,7 @@ import com.github.ajalt.clikt.parameters.arguments.argument import com.github.ajalt.clikt.parameters.types.file import hu.bme.mit.semantifyr.oxsts.semantifyr.reader.OxstsReader import hu.bme.mit.semantifyr.oxsts.semantifyr.reader.prepareOxsts -import hu.bme.mit.semantifyr.oxsts.semantifyr.serialization.Serializer +import hu.bme.mit.semantifyr.oxsts.semantifyr.serialization.XstsSerializer import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.XstsTransformer import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.loggerFactory import java.io.File @@ -31,7 +31,7 @@ class VerifyCommand : BaseVerifyCommand("verify") { val transformer = XstsTransformer(reader) val xsts = transformer.transform(targetName, rewriteChoice = true) - val xstsString = Serializer.serialize(xsts) + val xstsString = XstsSerializer.serialize(xsts) val output = model.path.replace(".oxsts", ".xsts") diff --git a/subprojects/semantifyr/src/main/kotlin/serialization/Serializer.kt b/subprojects/semantifyr/src/main/kotlin/serialization/XstsSerializer.kt similarity index 96% rename from subprojects/semantifyr/src/main/kotlin/serialization/Serializer.kt rename to subprojects/semantifyr/src/main/kotlin/serialization/XstsSerializer.kt index 3e63ebb..6d63e9e 100644 --- a/subprojects/semantifyr/src/main/kotlin/serialization/Serializer.kt +++ b/subprojects/semantifyr/src/main/kotlin/serialization/XstsSerializer.kt @@ -43,16 +43,9 @@ import hu.bme.mit.semantifyr.oxsts.model.oxsts.Variable import hu.bme.mit.semantifyr.oxsts.model.oxsts.XSTS import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.referencedElement -object Serializer { - fun serializeProperty(xsts: XSTS): String { - val text = indent { - append(xsts.property) - } +object XstsSerializer { - return text - } - - fun serialize(xsts: XSTS, includeProperty: Boolean = true): String { + fun serialize(xsts: XSTS): String { val text = indent { for (type in xsts.enums) { append(type) @@ -76,11 +69,9 @@ object Serializer { appendLine("env {}") - if (includeProperty) { - appendLine() + appendLine() - append(xsts.property) - } + append(xsts.property) } return text diff --git a/subprojects/semantifyr/src/testFixtures/kotlin/CompilationTest.kt b/subprojects/semantifyr/src/testFixtures/kotlin/CompilationTest.kt index c6734be..478b6ba 100644 --- a/subprojects/semantifyr/src/testFixtures/kotlin/CompilationTest.kt +++ b/subprojects/semantifyr/src/testFixtures/kotlin/CompilationTest.kt @@ -7,7 +7,7 @@ package hu.bme.mit.semantifyr.oxsts.semantifyr import hu.bme.mit.semantifyr.oxsts.semantifyr.reader.OxstsReader -import hu.bme.mit.semantifyr.oxsts.semantifyr.serialization.Serializer +import hu.bme.mit.semantifyr.oxsts.semantifyr.serialization.XstsSerializer import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.XstsTransformer import org.junit.jupiter.api.Assertions import java.io.File @@ -23,7 +23,7 @@ open class CompilationTest { val transformer = XstsTransformer(reader) val xsts = transformer.transform("Mission", rewriteChoice) - val serializedXsts = Serializer.serialize(xsts) + val serializedXsts = XstsSerializer.serialize(xsts) File("$directory/model.xsts").writeText(serializedXsts) } diff --git a/subprojects/semantifyr/src/testFixtures/kotlin/VerificationTest.kt b/subprojects/semantifyr/src/testFixtures/kotlin/VerificationTest.kt index 5ff9884..49d9598 100644 --- a/subprojects/semantifyr/src/testFixtures/kotlin/VerificationTest.kt +++ b/subprojects/semantifyr/src/testFixtures/kotlin/VerificationTest.kt @@ -8,7 +8,7 @@ package hu.bme.mit.semantifyr.oxsts.semantifyr import hu.bme.mit.semantifyr.oxsts.model.oxsts.Target import hu.bme.mit.semantifyr.oxsts.semantifyr.reader.OxstsReader -import hu.bme.mit.semantifyr.oxsts.semantifyr.serialization.Serializer +import hu.bme.mit.semantifyr.oxsts.semantifyr.serialization.XstsSerializer import hu.bme.mit.semantifyr.oxsts.semantifyr.theta.ThetaExecutor import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.XstsTransformer import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.EnvVar @@ -104,7 +104,7 @@ open class VerificationTest { val transformer = XstsTransformer(reader) val xsts = transformer.transform(targetName, true) - val serializedXsts = Serializer.serialize(xsts) + val serializedXsts = XstsSerializer.serialize(xsts) File("$targetDirectory/$targetName.xsts").writeText(serializedXsts) } From 4d7584d88b2a1ff16292ed50f7c5b0296abc2224 Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Thu, 7 Nov 2024 13:09:07 +0100 Subject: [PATCH 04/27] #18 Added CexReader --- .../hu/bme/mit/semantifyr/cex/lang/Cex.xtext | 10 ++- subprojects/semantifyr/build.gradle.kts | 1 + .../src/main/kotlin/theta/CexReader.kt | 77 +++++++++++++++++++ 3 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 subprojects/semantifyr/src/main/kotlin/theta/CexReader.kt diff --git a/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext index 1bb3018..099fd30 100644 --- a/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext +++ b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext @@ -11,13 +11,19 @@ generate cex "http://www.bme.hu/mit/2024/cex" import "http://www.eclipse.org/emf/2002/Ecore" as Ecore Cex: - "(" "XstsStateSequence" + "(" ("XstsStateSequence" | "XstsCliTracegen") (states += XstsState)* + + (edges += StateEdge)* ")" ; +StateEdge: + from=[XstsState] "->" to=[XstsState] +; + XstsState: - "(" "XstsState" (preInit?="pre_init")? (postInit?="post_init")? (lastEnv?="last_env")? (lastInternal?="last_internal")? + "(" (name=ID ":")? "XstsState" (preInit?="pre_init")? (postInit?="post_init")? (lastEnv?="last_env")? (lastInternal?="last_internal")? state = State ")" ; diff --git a/subprojects/semantifyr/build.gradle.kts b/subprojects/semantifyr/build.gradle.kts index 077ccec..ebfa5b6 100644 --- a/subprojects/semantifyr/build.gradle.kts +++ b/subprojects/semantifyr/build.gradle.kts @@ -35,6 +35,7 @@ artifacts { dependencies { implementation(project(":oxsts.lang")) + implementation(project(":cex.lang")) implementation(libs.guice) implementation(libs.slf4j.api) diff --git a/subprojects/semantifyr/src/main/kotlin/theta/CexReader.kt b/subprojects/semantifyr/src/main/kotlin/theta/CexReader.kt new file mode 100644 index 0000000..1663384 --- /dev/null +++ b/subprojects/semantifyr/src/main/kotlin/theta/CexReader.kt @@ -0,0 +1,77 @@ +package hu.bme.mit.semantifyr.oxsts.semantifyr.theta + +import hu.bme.mit.semantifyr.cex.lang.CexStandaloneSetup +import hu.bme.mit.semantifyr.cex.lang.cex.Cex +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.error +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.info +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.loggerFactory +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.warn +import org.eclipse.emf.common.util.URI +import org.eclipse.emf.ecore.resource.Resource +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl +import org.eclipse.xtext.diagnostics.Severity +import org.eclipse.xtext.resource.XtextResource +import org.eclipse.xtext.util.CancelIndicator +import org.eclipse.xtext.validation.CheckMode +import java.io.File + +fun prepareCex() { + CexStandaloneSetup.doSetup() +} + +class CexReader { + val logger by loggerFactory() + + val resourceSet = ResourceSetImpl() + + init { + resourceSet.loadOptions[XtextResource.OPTION_ENCODING] = "UTF-8" + } + + fun validateResource(resource: Resource) { + if (resource.errors.any()) { + logger.error { "Errors found in file (${resource.uri.toFileString()})" } + + for (error in resource.errors) { + logger.error(error.message) + } + + error("Errors found in file (${resource.uri.toFileString()})}") + } + if (resource.warnings.any()) { + logger.warn { "Warnings found in file (${resource.uri.toFileString()})" } + + for (warning in resource.warnings) { + logger.warn(warning.message) + } + } + val validator = (resource as XtextResource).resourceServiceProvider.resourceValidator + val issues = validator.validate(resource, CheckMode.ALL, CancelIndicator.NullImpl) + if (issues.any()) { + logger.info { "Issues found in file (${resource.uri.toFileString()})" } + + for (issue in issues) { + when (issue.severity) { + Severity.INFO -> { + logger.info { "${issue.uriToProblem.toFileString()}[${issue.lineNumber}:${issue.column}] ${issue.message}" } + } + Severity.WARNING -> { + logger.warn { "${issue.uriToProblem.toFileString()}[${issue.lineNumber}:${issue.column}] ${issue.message}" } + } + Severity.ERROR -> { + logger.error { "${issue.uriToProblem.toFileString()}[${issue.lineNumber}:${issue.column}] ${issue.message}" } + } + else -> { } + } + } + } + } + + fun readCexFile(file: File): Cex { + val resource = resourceSet.getResource(URI.createFileURI(file.path), true) + resource.load(emptyMap()) + validateResource(resource) + + return resource.contents.single() as Cex + } +} From b2817860b6fe02555c26cf3ef66107b8b6f5257c Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Thu, 7 Nov 2024 20:18:00 +0100 Subject: [PATCH 05/27] Added SignedInt rule --- .../main/java/hu/bme/mit/semantifyr/oxsts/lang/Oxsts.xtext | 6 +++++- .../main/java/hu/bme/mit/semantifyr/xsts/lang/Xsts.xtext | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/Oxsts.xtext b/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/Oxsts.xtext index 1611060..57f2a99 100644 --- a/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/Oxsts.xtext +++ b/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/Oxsts.xtext @@ -507,9 +507,13 @@ LiteralBoolean: ; LiteralInteger: - value = INT + value = SignedInt ; BooleanValue returns Ecore::EBoolean: 'true' | 'false' ; + +SignedInt returns Ecore::EInt: + ('-')? INT +; diff --git a/subprojects/xsts.lang/src/main/java/hu/bme/mit/semantifyr/xsts/lang/Xsts.xtext b/subprojects/xsts.lang/src/main/java/hu/bme/mit/semantifyr/xsts/lang/Xsts.xtext index d3ce225..2288c78 100644 --- a/subprojects/xsts.lang/src/main/java/hu/bme/mit/semantifyr/xsts/lang/Xsts.xtext +++ b/subprojects/xsts.lang/src/main/java/hu/bme/mit/semantifyr/xsts/lang/Xsts.xtext @@ -229,9 +229,13 @@ LiteralBoolean: ; LiteralInteger: - value = INT + value = SignedInt ; BooleanValue returns Ecore::EBoolean: 'true' | 'false' ; + +SignedInt returns Ecore::EInt: + ('-')? INT +; From 5e650b0aa87a4e7d9b9acd340ea8ab0fff5c1235 Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Fri, 8 Nov 2024 13:32:26 +0100 Subject: [PATCH 06/27] Fixed MissionWitness incorrect references --- .../Automated/Example/PetriNet/model.oxsts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/subprojects/semantifyr/TestModels/Automated/Example/PetriNet/model.oxsts b/subprojects/semantifyr/TestModels/Automated/Example/PetriNet/model.oxsts index bbc91e0..c13993a 100644 --- a/subprojects/semantifyr/TestModels/Automated/Example/PetriNet/model.oxsts +++ b/subprojects/semantifyr/TestModels/Automated/Example/PetriNet/model.oxsts @@ -89,15 +89,15 @@ target Mission { } target MissionWitness : Mission { - ctrl var state : Integer = 0 - 1 + ctrl var state : Integer = -1 init { - assume (state == (0 - 1)) + assume (state == -1) assume (petriNet.p1.tokens == 100) assume (petriNet.p2.tokens == 0) - static inline ExamplePetriNet::init() + static inline Mission::init() assume (petriNet.p1.tokens == 100) assume (petriNet.p2.tokens == 0) @@ -111,7 +111,7 @@ target MissionWitness : Mission { choice { assume (state == 0) - static inline ExamplePetriNet::main() + static inline Mission::main() assume (petriNet.p1.tokens == 95) assume (petriNet.p2.tokens == 5) @@ -122,7 +122,7 @@ target MissionWitness : Mission { } or { assume (state == 1) - static inline ExamplePetriNet::main() + static inline Mission::main() assume (petriNet.p1.tokens == 90) assume (petriNet.p2.tokens == 10) @@ -133,7 +133,7 @@ target MissionWitness : Mission { } or { assume (state == 2) - static inline ExamplePetriNet::main() + static inline Mission::main() assume (petriNet.p1.tokens == 85) assume (petriNet.p2.tokens == 15) @@ -144,7 +144,7 @@ target MissionWitness : Mission { } or { assume (state == 3) - static inline ExamplePetriNet::main() + static inline Mission::main() assume (petriNet.p1.tokens == 80) assume (petriNet.p2.tokens == 20) From 89f3b6238b274e4a2125977fd64e17bea947481a Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Fri, 8 Nov 2024 13:58:04 +0100 Subject: [PATCH 07/27] Optimized Utility functions --- .../kotlin/serialization/XstsSerializer.kt | 6 +- .../kotlin/transformation/XstsTransformer.kt | 8 +- .../instantiation/VariableTransformer.kt | 7 +- .../rewrite/ExpressionRewriter.kt | 9 +- .../rewrite/OperationInliner.kt | 9 +- .../src/main/kotlin/utils/CollectionUtils.kt | 2 +- .../main/kotlin/utils/InstanceExtensions.kt | 2 +- .../src/main/kotlin/utils/OxstsFactory.kt | 8 - .../src/main/kotlin/utils/OxstsUtils.kt | 139 +++++++++++------- 9 files changed, 105 insertions(+), 85 deletions(-) diff --git a/subprojects/semantifyr/src/main/kotlin/serialization/XstsSerializer.kt b/subprojects/semantifyr/src/main/kotlin/serialization/XstsSerializer.kt index 6d63e9e..2048e2c 100644 --- a/subprojects/semantifyr/src/main/kotlin/serialization/XstsSerializer.kt +++ b/subprojects/semantifyr/src/main/kotlin/serialization/XstsSerializer.kt @@ -41,7 +41,7 @@ import hu.bme.mit.semantifyr.oxsts.model.oxsts.Transition import hu.bme.mit.semantifyr.oxsts.model.oxsts.Typing import hu.bme.mit.semantifyr.oxsts.model.oxsts.Variable import hu.bme.mit.semantifyr.oxsts.model.oxsts.XSTS -import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.referencedElement +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.referencedElementOrNull object XstsSerializer { @@ -179,8 +179,8 @@ object XstsSerializer { is IntegerType -> "integer" is BooleanType -> "boolean" is ReferenceTyping -> { - when (referencedElement) { - is Enum -> (referencedElement as Enum).name + when (referencedElementOrNull()) { + is Enum -> (referencedElementOrNull() as Enum).name else -> "UNKNOWN_TYPE$$$" } } diff --git a/subprojects/semantifyr/src/main/kotlin/transformation/XstsTransformer.kt b/subprojects/semantifyr/src/main/kotlin/transformation/XstsTransformer.kt index 3f92e6a..0e35176 100644 --- a/subprojects/semantifyr/src/main/kotlin/transformation/XstsTransformer.kt +++ b/subprojects/semantifyr/src/main/kotlin/transformation/XstsTransformer.kt @@ -30,7 +30,7 @@ import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.findMainTransition import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.findProperty import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.loggerFactory import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.operationInliner -import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.referencedElement +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.referencedElementOrNull import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.type import org.eclipse.xtext.EcoreUtil2 import java.util.* @@ -59,8 +59,8 @@ class XstsTransformer( logger.info("Transforming transitions") - val init = rootInstance.contextualEvaluator.evaluateTransition(OxstsFactory.createChainReferenceExpression(OxstsFactory.createDeclarationReferenceExpression(rootInstance.type.findInitTransition()))) - val tran = rootInstance.contextualEvaluator.evaluateTransition(OxstsFactory.createChainReferenceExpression(OxstsFactory.createDeclarationReferenceExpression(rootInstance.type.findMainTransition()))) + val init = rootInstance.contextualEvaluator.evaluateTransition(OxstsFactory.createChainReferenceExpression(rootInstance.type.findInitTransition())) + val tran = rootInstance.contextualEvaluator.evaluateTransition(OxstsFactory.createChainReferenceExpression(rootInstance.type.findMainTransition())) val property = target.findProperty() xsts.init = init.copy() // FIXME: consider non-existent tran as empty tran @@ -77,7 +77,7 @@ class XstsTransformer( xsts.enums += xsts.variables.asSequence().map { it.typing }.filterIsInstance().map { - it.referencedElement + it.referencedElementOrNull() }.filterIsInstance().toSet() logger.info("Optimizing XSTS model") diff --git a/subprojects/semantifyr/src/main/kotlin/transformation/instantiation/VariableTransformer.kt b/subprojects/semantifyr/src/main/kotlin/transformation/instantiation/VariableTransformer.kt index 6cb67c8..5b3a5a0 100644 --- a/subprojects/semantifyr/src/main/kotlin/transformation/instantiation/VariableTransformer.kt +++ b/subprojects/semantifyr/src/main/kotlin/transformation/instantiation/VariableTransformer.kt @@ -26,6 +26,7 @@ import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.instancePlacer import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.isDataTyped import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.isFeatureTyped import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.referencedElement +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.referencedElementOrNull import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.variableTransformer private class EnumMapping( @@ -78,7 +79,7 @@ class VariableTransformer( val typing = typedVariable.typing as ReferenceTyping - val feature = typing.referencedElement as Feature + val feature = typing.referencedElement() as Feature val contextInstance = instance.contextualEvaluator.evaluateInstance(variableExpression.asChainReferenceExpression().dropLast(1)) val featureHolder = contextInstance.contextualEvaluator.evaluateInstance(typing.reference.dropLast(1)) @@ -91,11 +92,11 @@ class VariableTransformer( } private fun ReferenceTyping.transform(isOptional: Boolean): ReferenceTyping { - if (referencedElement !is Feature) { + if (referencedElementOrNull() !is Feature) { return this } - val enum = (referencedElement as Feature).transform(isOptional) + val enum = (referencedElement() as Feature).transform(isOptional) return OxstsFactory.createReferenceTyping().also { it.reference = OxstsFactory.createChainReferenceExpression(enum) diff --git a/subprojects/semantifyr/src/main/kotlin/transformation/rewrite/ExpressionRewriter.kt b/subprojects/semantifyr/src/main/kotlin/transformation/rewrite/ExpressionRewriter.kt index 1b165b4..720dc2d 100644 --- a/subprojects/semantifyr/src/main/kotlin/transformation/rewrite/ExpressionRewriter.kt +++ b/subprojects/semantifyr/src/main/kotlin/transformation/rewrite/ExpressionRewriter.kt @@ -26,9 +26,10 @@ import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.OxstsFactory import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.contextualEvaluator import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.createReference import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.dropLast -import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.element import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.isFeatureTyped import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.lastChain +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.referencedElement +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.referencedElementOrNull import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.variableTransformer import org.eclipse.emf.ecore.EObject import org.eclipse.xtext.EcoreUtil2 @@ -83,7 +84,7 @@ object ExpressionRewriter { private fun XSTS.evaluateFeatureReferences(rootInstance: Instance) { val references = EcoreUtil2.getAllContentsOfType(this, ChainReferenceExpression::class.java).filter { - it.lastChain().element is Feature + it.lastChain().referencedElementOrNull() is Feature } for (reference in references) { @@ -101,11 +102,11 @@ object ExpressionRewriter { private fun XSTS.rewriteFeatureTypedOperatorAccess(rootInstance: Instance) { val expressions = EcoreUtil2.getAllContentsOfType(this, ChainReferenceExpression::class.java).filter { - (it.lastChain().element as? Variable)?.isFeatureTyped == true + (it.lastChain().referencedElementOrNull() as? Variable)?.isFeatureTyped == true } for (expression in expressions) { - val oldVariable = expression.lastChain().element!! as Variable + val oldVariable = expression.lastChain().referencedElement() as Variable rewriteFeatureTypedOperatorAccess(oldVariable, expression, rootInstance) } diff --git a/subprojects/semantifyr/src/main/kotlin/transformation/rewrite/OperationInliner.kt b/subprojects/semantifyr/src/main/kotlin/transformation/rewrite/OperationInliner.kt index ea68c65..aa7599c 100644 --- a/subprojects/semantifyr/src/main/kotlin/transformation/rewrite/OperationInliner.kt +++ b/subprojects/semantifyr/src/main/kotlin/transformation/rewrite/OperationInliner.kt @@ -27,8 +27,9 @@ import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.copy import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.createReference import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.drop import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.dropLast -import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.element import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.isStaticReference +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.referencedElement +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.referencedElementOrNull import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.typedReferencedElement import org.eclipse.emf.ecore.EObject import org.eclipse.xtext.EcoreUtil2 @@ -109,11 +110,11 @@ class OperationInliner( private fun Operation.rewriteToArguments(arguments: List, bindings: List): Operation { val references = EcoreUtil2.getAllContents(this, true).asSequence().filterIsInstance().filter { - arguments.contains(it.chains.first().element) + arguments.contains(it.chains.first().referencedElement()) }.toList() for (reference in references) { - val argument = reference.chains.first().element + val argument = reference.chains.first().referencedElement() val argumentIndex = arguments.indexOf(argument) val binding = bindings[argumentIndex] // TODO is index based stable? val expression = binding.expression @@ -131,7 +132,7 @@ class OperationInliner( private fun Operation.rewriteToContextSkipArguments(localContext: Instance, arguments: List): Operation { val references = EcoreUtil2.getAllContentsOfType(this, ChainReferenceExpression::class.java).asSequence().filterNot { - arguments.contains(it.chains.firstOrNull()?.element) + arguments.contains(it.chains.firstOrNull()?.referencedElementOrNull()) }.filterNot { it.isStaticReference }.filterNot { diff --git a/subprojects/semantifyr/src/main/kotlin/utils/CollectionUtils.kt b/subprojects/semantifyr/src/main/kotlin/utils/CollectionUtils.kt index ef62875..005e97a 100644 --- a/subprojects/semantifyr/src/main/kotlin/utils/CollectionUtils.kt +++ b/subprojects/semantifyr/src/main/kotlin/utils/CollectionUtils.kt @@ -6,4 +6,4 @@ package hu.bme.mit.semantifyr.oxsts.semantifyr.utils -inline fun > C.except(other: T) = filter { it != other }.toSet() +inline fun > C.except(other: T) = asSequence().filter { it != other }.toSet() diff --git a/subprojects/semantifyr/src/main/kotlin/utils/InstanceExtensions.kt b/subprojects/semantifyr/src/main/kotlin/utils/InstanceExtensions.kt index 48f7953..1998ca4 100644 --- a/subprojects/semantifyr/src/main/kotlin/utils/InstanceExtensions.kt +++ b/subprojects/semantifyr/src/main/kotlin/utils/InstanceExtensions.kt @@ -8,12 +8,12 @@ package hu.bme.mit.semantifyr.oxsts.semantifyr.utils import hu.bme.mit.semantifyr.oxsts.model.oxsts.Instance import hu.bme.mit.semantifyr.oxsts.model.oxsts.impl.InstanceImpl -import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.rewrite.OperationInliner import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.evaluation.ContextualExpressionEvaluator import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.evaluation.FeatureEvaluator import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.instantiation.InstancePlacer import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.instantiation.VariableTransformer import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.resolution.TransitionResolver +import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.rewrite.OperationInliner val Instance.type get() = containment.type diff --git a/subprojects/semantifyr/src/main/kotlin/utils/OxstsFactory.kt b/subprojects/semantifyr/src/main/kotlin/utils/OxstsFactory.kt index 4dbb677..b87117a 100644 --- a/subprojects/semantifyr/src/main/kotlin/utils/OxstsFactory.kt +++ b/subprojects/semantifyr/src/main/kotlin/utils/OxstsFactory.kt @@ -24,11 +24,9 @@ import hu.bme.mit.semantifyr.oxsts.model.oxsts.LiteralInteger import hu.bme.mit.semantifyr.oxsts.model.oxsts.NotOperator import hu.bme.mit.semantifyr.oxsts.model.oxsts.Operation import hu.bme.mit.semantifyr.oxsts.model.oxsts.OrOperator -import hu.bme.mit.semantifyr.oxsts.model.oxsts.Package import hu.bme.mit.semantifyr.oxsts.model.oxsts.ReferenceExpression import hu.bme.mit.semantifyr.oxsts.model.oxsts.ReferenceTyping import hu.bme.mit.semantifyr.oxsts.model.oxsts.impl.OxstsFactoryImpl -import org.eclipse.emf.ecore.EObject object OxstsFactory : OxstsFactoryImpl() { fun createEmptyOperation(): Operation { @@ -138,9 +136,3 @@ object OxstsFactory : OxstsFactoryImpl() { } } - -val Element._package - get() = if (this is Package) this else eContainer()._package - -val EObject._package: Package - get() = if (this is Package) this else eContainer()._package diff --git a/subprojects/semantifyr/src/main/kotlin/utils/OxstsUtils.kt b/subprojects/semantifyr/src/main/kotlin/utils/OxstsUtils.kt index f1a7268..4e972fc 100644 --- a/subprojects/semantifyr/src/main/kotlin/utils/OxstsUtils.kt +++ b/subprojects/semantifyr/src/main/kotlin/utils/OxstsUtils.kt @@ -27,10 +27,29 @@ import hu.bme.mit.semantifyr.oxsts.model.oxsts.ReferenceTyping import hu.bme.mit.semantifyr.oxsts.model.oxsts.Transition import hu.bme.mit.semantifyr.oxsts.model.oxsts.Type import hu.bme.mit.semantifyr.oxsts.model.oxsts.Variable +import org.eclipse.emf.ecore.EObject import org.eclipse.xtext.EcoreUtil2 import java.util.* import kotlin.collections.ArrayDeque +@Suppress("ObjectPropertyName") +val EObject._package: Package + get() = if (this is Package) this else eContainer()._package + +fun Instance.createReference(): List { + val context = ArrayDeque() + var current: Instance? = this + + while (current != null) { + context.addFirst(OxstsFactory.createDeclarationReference(current.containment)) + current = current.parent + } + + context.removeFirst() // remove rootInstance reference + + return context +} + fun ReferenceExpression.asChainReferenceExpression(): ChainReferenceExpression { require(this is ChainReferenceExpression) { "No other kinds of expressions should be in the model at this point." @@ -68,8 +87,8 @@ fun ChainReferenceExpression.lastChain(): ChainingExpression { } fun ChainReferenceExpression.appendWith(chainReferenceExpression: ChainReferenceExpression): ChainReferenceExpression { - return OxstsFactory.createChainReferenceExpression().also { - it.chains += chains.copy() + chainReferenceExpression.chains.copy() + return copy().also { + it.chains += chainReferenceExpression.chains.copy() } } @@ -83,36 +102,24 @@ val Element.isStatic } val Feature.type - get() = (typing as ReferenceTyping).referencedElement as Type + get() = (typing as ReferenceTyping).reference.typedReferencedElement() val Variable.isFeatureTyped - get() = (typing as? ReferenceTyping)?.referencedElement is Feature + get() = (typing as? ReferenceTyping)?.reference?.referencedElementOrNull() is Feature val Variable.isDataTyped get() = typing is DataType -val ReferenceTyping.referencedElement - get() = reference.chains.last().element - -val ChainingExpression.element - get() = (this as? DeclarationReferenceExpression)?.element - -fun Instance.createReference(): List { - val context = ArrayDeque() - var current: Instance? = this - - while (current != null) { - context.addFirst(OxstsFactory.createDeclarationReference(current.containment)) - current = current.parent - } - - context.removeFirst() // remove rootInstance reference +val Feature.isRedefine + get() = redefines != null - return context +fun ReferenceTyping.referencedElement(): Element { + return reference.referencedElement() } -val Feature.isRedefine - get() = redefines != null +fun ReferenceTyping.referencedElementOrNull(): Element? { + return reference.referencedElementOrNull() +} inline fun ReferenceExpression.typedReferencedElement(): T { val element = referencedElement() @@ -134,7 +141,6 @@ fun ReferenceExpression.referencedElementOrNull(): Element? { return chains.lastOrNull()?.referencedElementOrNull() } - fun ChainingExpression.referencedElement(): Element { return referencedElementOrNull() ?: error("Expression $this must be DeclarationReferenceExpression") } @@ -147,79 +153,98 @@ fun ChainingExpression.referencedElementOrNull(): Element? { return null } -// TODO create caching containment and variable query - -val Feature.allContainments: List +val Feature.allContainments: Sequence get() = allFeatures.filterIsInstance() -val Feature.allFeatures: List +val Feature.allFeatures: Sequence get() = type.allFeatures -val Feature.allVariables: List +val Feature.allVariables: Sequence get() = type.allVariables -val Type.allFeatures: List - get() { - val list = mutableListOf() - list += features +val Type.allFeatures: Sequence + get() = sequence { + yieldAll(features) if (supertype != null) { - // FIXME: recursive property accessor - list += supertype.allFeatures + yieldAll(supertype.allFeatures) } - return list } -val Type.allVariables: List - get() { - val list = mutableListOf() - list += variables +val Type.allVariables: Sequence + get() = sequence { + yieldAll(variables) if (supertype != null) { - // FIXME: recursive property accessor - list += supertype.allVariables + yieldAll(supertype.allVariables) } - return list } val Feature.isDataType get() = typing is IntegerType || typing is BooleanType +val Feature.allSubsets + get() = internalAllSubsets.toSet() -val Feature.allSubsets: Set - get() { - val features = subsets?.toMutableSet() ?: mutableSetOf() +private val Feature.internalAllSubsets: Sequence + get() = sequence { + if (subsets != null) { + yieldAll(subsets) + } if (redefines != null) { - // FIXME: recursive property accessor - features += redefines - features += redefines.allSubsets + yield(redefines) + yieldAll(redefines.internalAllSubsets) } - - return features } +val BaseType.allLocalTransitions: Sequence + get() = transitions.asSequence() + initTransition.asSequence() + havocTransition.asSequence() + mainTransition.asSequence() + fun Type.findInitTransition(): Transition { - return initTransition.singleOrNull() ?: supertype?.findInitTransition() ?: error("No init transition found!") + return findLocalInitTransition() ?: supertype?.findInitTransition() ?: error("No init transition found!") +} + +fun BaseType.findLocalInitTransition(): Transition? { + return allLocalTransitions.firstOrNull { + it.isInitTransition + } } fun Type.findMainTransition(): Transition { - return mainTransition.singleOrNull() ?: supertype?.findMainTransition() ?: error("No main transition found!") + return findLocalMainTransition() ?: supertype?.findMainTransition() ?: error("No main transition found!") +} + +fun BaseType.findLocalMainTransition(): Transition? { + return allLocalTransitions.firstOrNull { + it.isMainTransition + } +} + + +fun Type.findHavocTransition(): Transition { + return findLocalHavocTransition() ?: supertype?.findHavocTransition() ?: error("No main transition found!") +} + +fun BaseType.findLocalHavocTransition(): Transition? { + return allLocalTransitions.firstOrNull { + it.isHavocTransition + } } fun Type.findProperty(): Property { - return properties.singleOrNull() ?: supertype?.findProperty() ?: error("No property in type hierarchy!") + return properties.firstOrNull() ?: supertype?.findProperty() ?: error("No property in type hierarchy!") } val Transition.baseType: BaseType get() = EcoreUtil2.getContainerOfType(this, BaseType::class.java) val Transition.isMainTransition: Boolean - get() = baseType.mainTransition.contains(this) + get() = name == "main" || baseType.mainTransition.contains(this) val Transition.isInitTransition: Boolean - get() = baseType.initTransition.contains(this) + get() = name == "init" || baseType.initTransition.contains(this) val Transition.isHavocTransition: Boolean - get() = baseType.havocTransition.contains(this) + get() = name == "havoc" || baseType.havocTransition.contains(this) val Pattern.fullyQualifiedName get() = "${(eContainer() as Package).name}__$name" From 885336241c4732ca85bf2a8e06321193ae35087e Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Fri, 8 Nov 2024 13:58:20 +0100 Subject: [PATCH 08/27] Implemented initial OXSTS formatter --- .../lang/formatting2/OxstsFormatter.java | 240 +++++++++++++++++- 1 file changed, 227 insertions(+), 13 deletions(-) diff --git a/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/formatting2/OxstsFormatter.java b/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/formatting2/OxstsFormatter.java index aabb774..e117ff8 100644 --- a/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/formatting2/OxstsFormatter.java +++ b/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/formatting2/OxstsFormatter.java @@ -7,29 +7,243 @@ package hu.bme.mit.semantifyr.oxsts.lang.formatting2; -import hu.bme.mit.semantifyr.oxsts.model.oxsts.EnumLiteral; -import hu.bme.mit.semantifyr.oxsts.model.oxsts.Type; +import hu.bme.mit.semantifyr.oxsts.model.oxsts.*; +import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.formatting2.AbstractJavaFormatter; import org.eclipse.xtext.formatting2.IFormattableDocument; public class OxstsFormatter extends AbstractJavaFormatter { - protected void format(hu.bme.mit.semantifyr.oxsts.model.oxsts.Package _package, IFormattableDocument doc) { - // TODO: format HiddenRegions around keywords, attributes, cross references, etc. - for (Type type : _package.getTypes()) { - doc.format(type); + protected void format(hu.bme.mit.semantifyr.oxsts.model.oxsts.Package _package, IFormattableDocument document) { + for (var _import : _package.getImports()) { + document.format(_import); } - for (hu.bme.mit.semantifyr.oxsts.model.oxsts.Enum _enum : _package.getEnums()) { - doc.format(_enum); + + for (var pattern : _package.getPatterns()) { + document.format(pattern); + } + + for (var _enum : _package.getEnums()) { + document.format(_enum); + } + + for (var type : _package.getTypes()) { + document.format(type); + } + } + + protected void format(Import _import, IFormattableDocument document) { + document.prepend(regionFor(_import).keyword("import"), (a) -> { + a.setNewLines(1, 1, 2); + }); + } + + protected void format(hu.bme.mit.semantifyr.oxsts.model.oxsts.Enum _enum, IFormattableDocument document) { + document.prepend(regionFor(_enum).keyword("enum"), (a) -> { + a.setNewLines(1, 1, 2); + }); + document.prepend(regionFor(_enum).keyword(","), this::noSpace); + document.append(regionFor(_enum).keyword(","), this::noSpace); + setupBrackets(_enum, document); + + for (var literal : _enum.getLiterals()) { + document.format(literal); + } + } + + protected void format(EnumLiteral literal, IFormattableDocument document) { + document.prepend(regionFor(literal).feature(OxstsPackage.Literals.ELEMENT__NAME), this::newLine); + } + + protected void format(Type type, IFormattableDocument document) { + document.prepend(regionFor(type).keyword("type"), (a) -> { + a.setNewLines(1, 1, 2); + }); + document.prepend(regionFor(type).keyword("target"), (a) -> { + a.setNewLines(1, 1, 2); + }); + + formatBaseType(type, document); + + for (var variable : type.getVariables()) { + document.format(variable); + } + + for (var property : type.getProperties()) { + document.format(property); + } + } + + protected void format(Variable variable, IFormattableDocument document) { + document.prepend(regionFor(variable).keyword("var"), this::newLine); + } + + protected void format(Feature feature, IFormattableDocument document) { + document.prepend(regionFor(feature).keyword("feature"), this::newLine); + document.prepend(regionFor(feature).keyword("reference"), this::newLine); + document.prepend(regionFor(feature).keyword("derived"), this::newLine); + } + + protected void format(Containment containment, IFormattableDocument document) { + document.prepend(regionFor(containment).keyword("containment"), this::newLine); + + formatBaseType(containment, document); + } + + protected void formatBaseType(BaseType type, IFormattableDocument document) { + setupBrackets(type, document); + + for (var feature : type.getFeatures()) { + document.format(feature); + } + + for (var init : type.getInitTransition()) { + document.format(init); + } + + for (var transition : type.getTransitions()) { + document.format(transition); + } + + for (var main : type.getMainTransition()) { + document.format(main); + } + + for (var havoc : type.getHavocTransition()) { + document.format(havoc); + } + } + + protected void format(Transition transition, IFormattableDocument document) { + document.prepend(regionFor(transition).keyword("tran"), this::newLine); + document.prepend(regionFor(transition).keyword("havoc"), this::newLine); + document.prepend(regionFor(transition).keyword("init"), this::newLine); + setupBrackets(transition, document); + + for (var operation : transition.getOperation()) { + document.format(operation); + } + } + + protected void format(CompositeOperation operation, IFormattableDocument document) { + setupBrackets(operation, document); + + for (var inner : operation.getOperation()) { + document.format(inner); } } - protected void format(hu.bme.mit.semantifyr.oxsts.model.oxsts.Enum _enum, IFormattableDocument doc) { - // TODO: format HiddenRegions around keywords, attributes, cross references, etc. - for (EnumLiteral enumLiteral : _enum.getLiterals()) { - doc.format(enumLiteral); + protected void format(SequenceOperation operation, IFormattableDocument document) { + format((CompositeOperation) operation, document); + } + + protected void format(ChoiceOperation operation, IFormattableDocument document) { + document.prepend(regionFor(operation).keyword("choice"), this::newLine); + + format((CompositeOperation) operation, document); + + if (operation.getElse() != null) { + document.format(operation.getElse()); + } + } + + protected void format(IfOperation operation, IFormattableDocument document) { + document.prepend(regionFor(operation).keyword("if"), this::newLine); + document.format(operation.getBody()); + + if (operation.getElse() != null) { + document.format(operation.getElse()); + } + } + + protected void format(AssumptionOperation operation, IFormattableDocument document) { + document.prepend(regionFor(operation).keyword("assume"), this::newLine); + } + + protected void format(HavocOperation operation, IFormattableDocument document) { + document.prepend(regionFor(operation).keyword("havoc"), this::newLine); + } + + protected void format(AssignmentOperation operation, IFormattableDocument document) { + document.prepend(regionFor(operation).feature(OxstsPackage.Literals.ASSIGNMENT_OPERATION__REFERENCE), this::newLine); + } + + protected void format(InlineCall operation, IFormattableDocument document) { + document.prepend(regionFor(operation).keyword("inline"), this::newLine); + } + + protected void format(InlineChoice operation, IFormattableDocument document) { + document.prepend(regionFor(operation).keyword("inline"), this::newLine); + + if (operation.getElse() != null) { + document.format(operation.getElse()); } } - // TODO: implement for Type, Transition, SequenceOperation, HavocOperation, ChoiceOperation, AssumptionOperation, IfOperation, InlineChoice, InlineSeq, InlineCall, InlineIfOperation, AssignmentOperation, Variable, Feature, Instance, InstanceBinding, OrOperator, AndOperator, PlusOperator, MinusOperator, EqualityOperator, InequalityOperator, NotOperator, ChainReferenceExpression + protected void format(InlineSeq operation, IFormattableDocument document) { + document.prepend(regionFor(operation).keyword("inline"), this::newLine); + } + + protected void format(InlineIfOperation operation, IFormattableDocument document) { + document.prepend(regionFor(operation).keyword("inline"), this::newLine); + document.format(operation.getBody()); + + if (operation.getElse() != null) { + document.format(operation.getElse()); + } + } + + protected void format(Property property, IFormattableDocument document) { + document.prepend(regionFor(property).keyword("prop"), this::newLine); + setupBrackets(property, document); + } + + protected void format(Pattern pattern, IFormattableDocument document) { + document.prepend(regionFor(pattern).keyword("pattern"), (a) -> { + a.setNewLines(1, 1, 2); + }); + + for (var body : pattern.getPatternBodies()) { + document.format(body); + } + } + + protected void format(PatternBody body, IFormattableDocument document) { + setupBrackets(body, document); + + for (var constraint : body.getConstraints()) { + document.format(constraint); + } + } + + protected void format(TypeConstraint constraint, IFormattableDocument document) { + if (constraint.isNegated()) { + document.prepend(regionFor(constraint).keyword("neg"), this::newLine); + } else { + document.prepend(regionFor(constraint).feature(OxstsPackage.Literals.TYPE_CONSTRAINT__TYPE), this::newLine); + } + } + + protected void format(FeatureConstraint constraint, IFormattableDocument document) { + if (constraint.isNegated()) { + document.prepend(regionFor(constraint).keyword("neg"), this::newLine); + } else { + document.prepend(regionFor(constraint).feature(OxstsPackage.Literals.TYPE_CONSTRAINT__TYPE), this::newLine); + } + } + + protected void format(PatternConstraint constraint, IFormattableDocument document) { + if (constraint.isNegated()) { + document.prepend(regionFor(constraint).keyword("neg"), this::newLine); + } else { + document.prepend(regionFor(constraint).keyword("find"), this::newLine); + } + } + + protected void setupBrackets(EObject eObject, IFormattableDocument document) { + document.prepend(regionFor(eObject).keyword("{"), this::oneSpace); + document.prepend(regionFor(eObject).keyword("}"), this::newLine); + document.interior(regionFor(eObject).keyword("{"), regionFor(eObject).keyword("}"), this::indent); + } + } From 33239c68738e56d6aaa4ab2886eb5cb519996267 Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Tue, 12 Nov 2024 14:29:48 +0100 Subject: [PATCH 09/27] Added Namings helper object for common naming --- .../instantiation/Instantiator.kt | 3 +- .../instantiation/VariableTransformer.kt | 11 +++--- .../main/kotlin/utils/InstanceExtensions.kt | 11 +++--- .../src/main/kotlin/utils/Namings.kt | 39 +++++++++++++++++++ 4 files changed, 52 insertions(+), 12 deletions(-) create mode 100644 subprojects/semantifyr/src/main/kotlin/utils/Namings.kt diff --git a/subprojects/semantifyr/src/main/kotlin/transformation/instantiation/Instantiator.kt b/subprojects/semantifyr/src/main/kotlin/transformation/instantiation/Instantiator.kt index 9c2d019..d23355c 100644 --- a/subprojects/semantifyr/src/main/kotlin/transformation/instantiation/Instantiator.kt +++ b/subprojects/semantifyr/src/main/kotlin/transformation/instantiation/Instantiator.kt @@ -16,6 +16,7 @@ import hu.bme.mit.semantifyr.oxsts.model.oxsts.Reference import hu.bme.mit.semantifyr.oxsts.model.oxsts.Target import hu.bme.mit.semantifyr.oxsts.model.oxsts.Variable import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.pattern.PatternRunner +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.Namings.implicitTypeName import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.OxstsFactory import hu.bme.mit.semantifyr.oxsts.semantifyr.utils._package import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.allContainments @@ -91,7 +92,7 @@ object Instantiator { } val newType = OxstsFactory.createType().also { - it.name = "${containment.name}__implicit" + it.name = containment.implicitTypeName it.features += containment.features it.havocTransition += containment.havocTransition it.initTransition += containment.initTransition diff --git a/subprojects/semantifyr/src/main/kotlin/transformation/instantiation/VariableTransformer.kt b/subprojects/semantifyr/src/main/kotlin/transformation/instantiation/VariableTransformer.kt index 5b3a5a0..381151b 100644 --- a/subprojects/semantifyr/src/main/kotlin/transformation/instantiation/VariableTransformer.kt +++ b/subprojects/semantifyr/src/main/kotlin/transformation/instantiation/VariableTransformer.kt @@ -14,6 +14,9 @@ import hu.bme.mit.semantifyr.oxsts.model.oxsts.Instance import hu.bme.mit.semantifyr.oxsts.model.oxsts.ReferenceExpression import hu.bme.mit.semantifyr.oxsts.model.oxsts.ReferenceTyping import hu.bme.mit.semantifyr.oxsts.model.oxsts.Variable +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.Namings.enumLiteralName +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.Namings.enumName +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.Namings.variableName import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.rewrite.ExpressionRewriter.rewriteToContext import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.NothingInstance import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.OxstsFactory @@ -21,7 +24,6 @@ import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.asChainReferenceExpression import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.contextualEvaluator import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.copy import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.dropLast -import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.fullyQualifiedName import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.instancePlacer import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.isDataTyped import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.isFeatureTyped @@ -52,7 +54,7 @@ class VariableTransformer( fun transform(variable: Variable) { val newVariable = variable.copy() - newVariable.name = "${instance.fullyQualifiedName}__${variable.name}" + newVariable.name = instance.variableName(variable) if (variable.isFeatureTyped) { val typing = variable.typing @@ -125,13 +127,10 @@ class VariableTransformer( literalMapping[instance] = literal } - enum.name = "${instance.fullyQualifiedName}__${this.name}__type" + enum.name = instance.enumName(this) enum.literals += literalMapping.values return enum } - private val Instance.enumLiteralName: String - get() = "${fullyQualifiedName}__literal" - } diff --git a/subprojects/semantifyr/src/main/kotlin/utils/InstanceExtensions.kt b/subprojects/semantifyr/src/main/kotlin/utils/InstanceExtensions.kt index 1998ca4..9446298 100644 --- a/subprojects/semantifyr/src/main/kotlin/utils/InstanceExtensions.kt +++ b/subprojects/semantifyr/src/main/kotlin/utils/InstanceExtensions.kt @@ -8,12 +8,15 @@ package hu.bme.mit.semantifyr.oxsts.semantifyr.utils import hu.bme.mit.semantifyr.oxsts.model.oxsts.Instance import hu.bme.mit.semantifyr.oxsts.model.oxsts.impl.InstanceImpl +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.Namings.computeFullyQualifiedName import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.evaluation.ContextualExpressionEvaluator import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.evaluation.FeatureEvaluator import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.instantiation.InstancePlacer import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.instantiation.VariableTransformer import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.resolution.TransitionResolver import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.rewrite.OperationInliner +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.Namings.NOTHING_CONTAINMENT_NAME +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.Namings.NOTHING_TYPE_NAME val Instance.type get() = containment.type @@ -33,9 +36,7 @@ private class InstanceExtensions( val variableTransformer = VariableTransformer(instance) val fullyQualifiedName: String by lazy { - val parentName = instance.parent?.fullyQualifiedName ?: "" - - "${parentName}__${instance.name}" + instance.computeFullyQualifiedName() } } @@ -61,10 +62,10 @@ val Instance.fullyQualifiedName get() = extensions.fullyQualifiedName private val nothingType = OxstsFactory.createType().also { - it.name = "NothingType" // TODO: need character that is valid in XSTS, but not in OXSTS + it.name = NOTHING_TYPE_NAME } private val nothingContainment = OxstsFactory.createContainment().also { - it.name = "Nothing" // TODO: need character that is valid in XSTS, but not in OXSTS + it.name = NOTHING_CONTAINMENT_NAME it.typing = OxstsFactory.createReferenceTyping(nothingType) } diff --git a/subprojects/semantifyr/src/main/kotlin/utils/Namings.kt b/subprojects/semantifyr/src/main/kotlin/utils/Namings.kt new file mode 100644 index 0000000..34bf98e --- /dev/null +++ b/subprojects/semantifyr/src/main/kotlin/utils/Namings.kt @@ -0,0 +1,39 @@ +package hu.bme.mit.semantifyr.oxsts.semantifyr.utils + +import hu.bme.mit.semantifyr.oxsts.model.oxsts.Feature +import hu.bme.mit.semantifyr.oxsts.model.oxsts.Instance +import hu.bme.mit.semantifyr.oxsts.model.oxsts.Variable + +@Suppress("MemberVisibilityCanBePrivate") +object Namings { + const val SYNTHETIC_SEPARATOR = "__" + const val SYNTHETIC_ELEMENT_PREFIX = "__" + + const val LITERAL_SUFFIX = "${SYNTHETIC_ELEMENT_PREFIX}literal" + const val TYPE_SUFFIX = "${SYNTHETIC_ELEMENT_PREFIX}type" + const val IMPLICIT_SUFFIX = "${SYNTHETIC_ELEMENT_PREFIX}implicit" + + const val NOTHING_CONTAINMENT_NAME = "Nothing" // "${SYNTHETIC_ELEMENT_PREFIX}Nothing" + const val NOTHING_TYPE_NAME = "NothingType" // "${SYNTHETIC_ELEMENT_PREFIX}NothingType" + + val Instance.enumLiteralName: String + get() = "$fullyQualifiedName$LITERAL_SUFFIX" + + fun Instance.enumName(feature: Feature): String { + return "$fullyQualifiedName$SYNTHETIC_SEPARATOR${feature.name}$TYPE_SUFFIX" + } + + fun Instance.variableName(variable: Variable): String { + return "$fullyQualifiedName$SYNTHETIC_SEPARATOR${variable.name}" + } + + fun Instance.computeFullyQualifiedName(): String { + val parentName = parent?.fullyQualifiedName ?: "" + + return "$parentName$SYNTHETIC_SEPARATOR$name" + } + + val Feature.implicitTypeName: String + get() = "$name$IMPLICIT_SUFFIX" + +} From 03627229c4571ae910888d1a25d835efa37f1117 Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Tue, 12 Nov 2024 14:51:50 +0100 Subject: [PATCH 10/27] Using $ to signify synthetic element names --- .../hu/bme/mit/semantifyr/cex/lang/Cex.xtext | 2 + .../Example/CompositeInline/expected.xsts | 32 +- .../Example/FeatureTyping/expected.xsts | 20 +- .../Automated/Example/InlineIf/expected.xsts | 4 +- .../Automated/Example/PetriNet/expected.xsts | 12 +- .../Example/SimpleTarget/expected.xsts | 16 +- .../Example/StaticRecursion/expected.xsts | 28 +- .../Example/TransitionInlining/expected.xsts | 14 +- .../Automated/Example/Type/expected.xsts | 12 +- .../Automated/Gamma/Crossroads/expected.xsts | 572 +++++++++--------- .../Gamma/SimpleMission/expected.xsts | 80 +-- .../Automated/Gamma/Spacecraft/expected.xsts | 388 ++++++------ .../Feature/FeatureRedefinition/expected.xsts | 4 +- .../Feature/FeatureSubseting/expected.xsts | 4 +- .../Feature/ReferenceSubseting/expected.xsts | 4 +- .../MultipleVariables/expected.xsts | 20 +- .../expected.xsts | 32 +- .../SingleVariable/expected.xsts | 16 +- .../VariableWithNothing/expected.xsts | 18 +- .../expected.xsts | 18 +- .../Automated/Simple/Import/expected.xsts | 4 +- .../Inheritance/BaseTypeFeature/expected.xsts | 4 +- .../ChildTypeFeature/expected.xsts | 4 +- .../MultipleOverrides/expected.xsts | 4 +- .../Inheritance/MultipleTypes/expected.xsts | 4 +- .../expected.xsts | 4 +- .../expected.xsts | 4 +- .../Arguments/Boolean/expected.xsts | 8 +- .../Arguments/Integer/expected.xsts | 8 +- .../expected.xsts | 10 +- .../InlineCallWithParameters/expected.xsts | 4 +- .../InlineCompositeChoice/expected.xsts | 8 +- .../InlineCompositeSequence/expected.xsts | 8 +- .../InlineFunctor/expected.xsts | 4 +- .../InlineIfFalse/expected.xsts | 8 +- .../InlineIfTrue/expected.xsts | 10 +- .../InlineStaticRecursion/expected.xsts | 20 +- .../MultipleInlineCalls/expected.xsts | 20 +- .../SingleInlineCall/expected.xsts | 8 +- .../MultiHierarchical/expected.xsts | 9 +- .../expected.xsts | 14 +- .../expected.xsts | 8 +- .../expected.xsts | 60 +- .../expected.xsts | 34 +- .../expected.xsts | 14 +- .../Instance/ReferenceBinding/expected.xsts | 6 +- .../ReferenceBindingToUpper/expected.xsts | 8 +- .../expected.xsts | 4 +- .../expected.xsts | 8 +- .../Simple/Pattern/Simple/expected.xsts | 10 +- .../Target/BooleanVariable/expected.xsts | 8 +- .../Simple/Target/EnumVariable/expected.xsts | 8 +- .../Target/IntegerVariable/expected.xsts | 8 +- .../AssignmentOperation/expected.xsts | 8 +- .../Transition/Assumption/expected.xsts | 10 +- .../Simple/Transition/Choice/expected.xsts | 12 +- .../Transition/ChoiceElse/expected.xsts | 20 +- .../Transition/HavocOperation/expected.xsts | 8 +- .../Simple/Transition/If/expected.xsts | 16 +- .../Simple/Transition/Sequence/expected.xsts | 12 +- .../Initializer/Boolean/expected.xsts | 4 +- .../Initializer/Integer/expected.xsts | 4 +- .../SysMLv2/Action/Decision/expected.xsts | 152 ++--- .../SysMLv2/Action/Fork/expected.xsts | 152 ++--- .../SysMLv2/Action/Simple/expected.xsts | 70 +-- .../src/main/kotlin/utils/Namings.kt | 4 +- .../bme/mit/semantifyr/xsts/lang/Xsts.xtext | 2 + 67 files changed, 1058 insertions(+), 1055 deletions(-) diff --git a/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext index 099fd30..d1c2b4b 100644 --- a/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext +++ b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext @@ -65,3 +65,5 @@ LiteralInteger: BooleanValue returns Ecore::EBoolean: 'true' | 'false' ; + +terminal ID: '^'?('a'..'z'|'A'..'Z'|'_'|'$') ('a'..'z'|'A'..'Z'|'_'|'0'..'9'|'$')*; diff --git a/subprojects/semantifyr/TestModels/Automated/Example/CompositeInline/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Example/CompositeInline/expected.xsts index 01bb255..0acd051 100644 --- a/subprojects/semantifyr/TestModels/Automated/Example/CompositeInline/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Example/CompositeInline/expected.xsts @@ -5,34 +5,34 @@ */ -var __Mission__holder__c1__x : integer -var __Mission__holder__c1__isZero : boolean -var __Mission__holder__c2__x : integer -var __Mission__holder__c2__isZero : boolean -var __Mission__holder__c3__x : integer -var __Mission__holder__c3__isZero : boolean +var $Mission$holder$c1$x : integer +var $Mission$holder$c1$isZero : boolean +var $Mission$holder$c2$x : integer +var $Mission$holder$c2$isZero : boolean +var $Mission$holder$c3$x : integer +var $Mission$holder$c3$isZero : boolean trans { choice { - havoc __Mission__holder__c1__x; - __Mission__holder__c1__isZero := (__Mission__holder__c1__x == 0); + havoc $Mission$holder$c1$x; + $Mission$holder$c1$isZero := ($Mission$holder$c1$x == 0); } or { - havoc __Mission__holder__c2__x; - __Mission__holder__c2__isZero := (__Mission__holder__c2__x == 0); + havoc $Mission$holder$c2$x; + $Mission$holder$c2$isZero := ($Mission$holder$c2$x == 0); } or { - havoc __Mission__holder__c3__x; - __Mission__holder__c3__isZero := (__Mission__holder__c3__x == 0); + havoc $Mission$holder$c3$x; + $Mission$holder$c3$isZero := ($Mission$holder$c3$x == 0); } } init { - __Mission__holder__c1__x := 2; - __Mission__holder__c2__x := 2; - __Mission__holder__c3__x := 2; + $Mission$holder$c1$x := 2; + $Mission$holder$c2$x := 2; + $Mission$holder$c3$x := 2; } env {} prop { - (((__Mission__holder__c1__isZero == false) && (__Mission__holder__c2__isZero == false)) && (__Mission__holder__c3__isZero == false)) + ((($Mission$holder$c1$isZero == false) && ($Mission$holder$c2$isZero == false)) && ($Mission$holder$c3$isZero == false)) } diff --git a/subprojects/semantifyr/TestModels/Automated/Example/FeatureTyping/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Example/FeatureTyping/expected.xsts index 98422c8..7939543 100644 --- a/subprojects/semantifyr/TestModels/Automated/Example/FeatureTyping/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Example/FeatureTyping/expected.xsts @@ -4,19 +4,19 @@ * SPDX-License-Identifier: EPL-2.0 */ -type __Mission__MainRegion__states__type : { - __Mission__MainRegion__MainEntry__literal, - __Mission__MainRegion__AState__literal, - __Mission__MainRegion__BState__literal, - __Nothing__literal +type $Mission$MainRegion$states$$type : { + $Mission$MainRegion$MainEntry$$literal, + $Mission$MainRegion$AState$$literal, + $Mission$MainRegion$BState$$literal, + $Nothing$$literal } -type __Mission__MainRegion__BState__BRegion__states__type : { - __Mission__MainRegion__BState__BRegion__CState__literal, - __Nothing__literal +type $Mission$MainRegion$BState$BRegion$states$$type : { + $Mission$MainRegion$BState$BRegion$CState$$literal, + $Nothing$$literal } -var __Mission__MainRegion__activeState : __Mission__MainRegion__states__type -var __Mission__MainRegion__BState__BRegion__activeState : __Mission__MainRegion__BState__BRegion__states__type +var $Mission$MainRegion$activeState : $Mission$MainRegion$states$$type +var $Mission$MainRegion$BState$BRegion$activeState : $Mission$MainRegion$BState$BRegion$states$$type trans { } diff --git a/subprojects/semantifyr/TestModels/Automated/Example/InlineIf/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Example/InlineIf/expected.xsts index 04f770b..ad228ae 100644 --- a/subprojects/semantifyr/TestModels/Automated/Example/InlineIf/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Example/InlineIf/expected.xsts @@ -5,10 +5,10 @@ */ -var __Mission__x : integer = 1 +var $Mission$x : integer = 1 trans { - __Mission__x := 0; + $Mission$x := 0; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Example/PetriNet/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Example/PetriNet/expected.xsts index c96dc10..2a14187 100644 --- a/subprojects/semantifyr/TestModels/Automated/Example/PetriNet/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Example/PetriNet/expected.xsts @@ -5,13 +5,13 @@ */ -var __Mission__petriNet__p1__tokens : integer = 100 -var __Mission__petriNet__p2__tokens : integer = 0 +var $Mission$petriNet$p1$tokens : integer = 100 +var $Mission$petriNet$p2$tokens : integer = 0 trans { - assume ((__Mission__petriNet__p1__tokens >= 5)); - __Mission__petriNet__p1__tokens := (__Mission__petriNet__p1__tokens - 5); - __Mission__petriNet__p2__tokens := (__Mission__petriNet__p2__tokens + 5); + assume (($Mission$petriNet$p1$tokens >= 5)); + $Mission$petriNet$p1$tokens := ($Mission$petriNet$p1$tokens - 5); + $Mission$petriNet$p2$tokens := ($Mission$petriNet$p2$tokens + 5); } init { @@ -20,5 +20,5 @@ init { env {} prop { - ! ((__Mission__petriNet__p2__tokens >= 20)) + ! (($Mission$petriNet$p2$tokens >= 20)) } diff --git a/subprojects/semantifyr/TestModels/Automated/Example/SimpleTarget/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Example/SimpleTarget/expected.xsts index e911a83..f5fcca8 100644 --- a/subprojects/semantifyr/TestModels/Automated/Example/SimpleTarget/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Example/SimpleTarget/expected.xsts @@ -10,22 +10,22 @@ type TimeUnit : { Hours } -var __Mission__unit : TimeUnit -var __Mission__x : integer = 1 -var __Mission__isZero : boolean = false +var $Mission$unit : TimeUnit +var $Mission$x : integer = 1 +var $Mission$isZero : boolean = false trans { - __Mission__unit := Minutes; - havoc __Mission__x; - __Mission__isZero := (__Mission__x == 0); + $Mission$unit := Minutes; + havoc $Mission$x; + $Mission$isZero := ($Mission$x == 0); } init { - __Mission__unit := Seconds; + $Mission$unit := Seconds; } env {} prop { - (__Mission__isZero == false) + ($Mission$isZero == false) } diff --git a/subprojects/semantifyr/TestModels/Automated/Example/StaticRecursion/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Example/StaticRecursion/expected.xsts index 4051489..d9f0f19 100644 --- a/subprojects/semantifyr/TestModels/Automated/Example/StaticRecursion/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Example/StaticRecursion/expected.xsts @@ -4,25 +4,25 @@ * SPDX-License-Identifier: EPL-2.0 */ -type __Mission__MainRegion__states__type : { - __Mission__MainRegion__MainEntry__literal, - __Mission__MainRegion__AState__literal, - __Mission__MainRegion__BState__literal, - __Nothing__literal +type $Mission$MainRegion$states$$type : { + $Mission$MainRegion$MainEntry$$literal, + $Mission$MainRegion$AState$$literal, + $Mission$MainRegion$BState$$literal, + $Nothing$$literal } -type __Mission__MainRegion__BState__BRegion__states__type : { - __Mission__MainRegion__BState__BRegion__CState__literal, - __Nothing__literal +type $Mission$MainRegion$BState$BRegion$states$$type : { + $Mission$MainRegion$BState$BRegion$CState$$literal, + $Nothing$$literal } -var __Mission__MainRegion__activeState : __Mission__MainRegion__states__type -var __Mission__MainRegion__BState__BRegion__activeState : __Mission__MainRegion__BState__BRegion__states__type +var $Mission$MainRegion$activeState : $Mission$MainRegion$states$$type +var $Mission$MainRegion$BState$BRegion$activeState : $Mission$MainRegion$BState$BRegion$states$$type trans { - __Mission__MainRegion__activeState := __Mission__MainRegion__AState__literal; - __Mission__MainRegion__activeState := __Nothing__literal; - __Mission__MainRegion__activeState := __Mission__MainRegion__BState__literal; - __Mission__MainRegion__BState__BRegion__activeState := __Mission__MainRegion__BState__BRegion__CState__literal; + $Mission$MainRegion$activeState := $Mission$MainRegion$AState$$literal; + $Mission$MainRegion$activeState := $Nothing$$literal; + $Mission$MainRegion$activeState := $Mission$MainRegion$BState$$literal; + $Mission$MainRegion$BState$BRegion$activeState := $Mission$MainRegion$BState$BRegion$CState$$literal; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Example/TransitionInlining/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Example/TransitionInlining/expected.xsts index 28c9e35..fdb3135 100644 --- a/subprojects/semantifyr/TestModels/Automated/Example/TransitionInlining/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Example/TransitionInlining/expected.xsts @@ -5,21 +5,21 @@ */ -var __Mission__x : integer = 1 -var __Mission__isZero : boolean = false +var $Mission$x : integer = 1 +var $Mission$isZero : boolean = false trans { - havoc __Mission__x; - __Mission__isZero := (__Mission__x == 0); + havoc $Mission$x; + $Mission$isZero := ($Mission$x == 0); } init { - __Mission__x := 2; - __Mission__isZero := (__Mission__x == 0); + $Mission$x := 2; + $Mission$isZero := ($Mission$x == 0); } env {} prop { - (__Mission__isZero == false) + ($Mission$isZero == false) } diff --git a/subprojects/semantifyr/TestModels/Automated/Example/Type/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Example/Type/expected.xsts index f7d5d5f..8984eb5 100644 --- a/subprojects/semantifyr/TestModels/Automated/Example/Type/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Example/Type/expected.xsts @@ -5,20 +5,20 @@ */ -var __Mission__container__x : integer -var __Mission__container__isZero : boolean +var $Mission$container$x : integer +var $Mission$container$isZero : boolean trans { - havoc __Mission__container__x; - __Mission__container__isZero := (__Mission__container__x == 0); + havoc $Mission$container$x; + $Mission$container$isZero := ($Mission$container$x == 0); } init { - __Mission__container__x := 2; + $Mission$container$x := 2; } env {} prop { - (__Mission__container__isZero == false) + ($Mission$container$isZero == false) } diff --git a/subprojects/semantifyr/TestModels/Automated/Gamma/Crossroads/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Gamma/Crossroads/expected.xsts index 6cffcce..ddc30b4 100644 --- a/subprojects/semantifyr/TestModels/Automated/Gamma/Crossroads/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Gamma/Crossroads/expected.xsts @@ -4,376 +4,376 @@ * SPDX-License-Identifier: EPL-2.0 */ -type __Mission__crossroad__controller__Main__states__type : { - __Mission__crossroad__controller__Main__Operating__literal, - __Mission__crossroad__controller__Main__Interrupted__literal, - __Nothing__literal +type $Mission$crossroad$controller$Main$states$$type : { + $Mission$crossroad$controller$Main$Operating$$literal, + $Mission$crossroad$controller$Main$Interrupted$$literal, + $Nothing$$literal } -type __Mission__crossroad__trafficLightA__Main__states__type : { - __Mission__crossroad__trafficLightA__Main__Normal__literal, - __Mission__crossroad__trafficLightA__Main__Interrupted__literal, - __Nothing__literal +type $Mission$crossroad$trafficLightA$Main$states$$type : { + $Mission$crossroad$trafficLightA$Main$Normal$$literal, + $Mission$crossroad$trafficLightA$Main$Interrupted$$literal, + $Nothing$$literal } -type __Mission__crossroad__trafficLightB__Main__states__type : { - __Mission__crossroad__trafficLightB__Main__Normal__literal, - __Mission__crossroad__trafficLightB__Main__Interrupted__literal, - __Nothing__literal +type $Mission$crossroad$trafficLightB$Main$states$$type : { + $Mission$crossroad$trafficLightB$Main$Normal$$literal, + $Mission$crossroad$trafficLightB$Main$Interrupted$$literal, + $Nothing$$literal } -type __Mission__crossroad__controller__Main__Operating__OperatingRegion__states__type : { - __Mission__crossroad__controller__Main__Operating__OperatingRegion__Init__literal, - __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnA__literal, - __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingA__literal, - __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnB__literal, - __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingB__literal, - __Nothing__literal +type $Mission$crossroad$controller$Main$Operating$OperatingRegion$states$$type : { + $Mission$crossroad$controller$Main$Operating$OperatingRegion$Init$$literal, + $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnA$$literal, + $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingA$$literal, + $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnB$$literal, + $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingB$$literal, + $Nothing$$literal } -type __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__states__type : { - __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Red__literal, - __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Green__literal, - __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Yellow__literal, - __Nothing__literal +type $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$states$$type : { + $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Red$$literal, + $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Green$$literal, + $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Yellow$$literal, + $Nothing$$literal } -type __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__states__type : { - __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Black__literal, - __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Yellow__literal, - __Nothing__literal +type $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$states$$type : { + $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Black$$literal, + $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Yellow$$literal, + $Nothing$$literal } -type __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__states__type : { - __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Red__literal, - __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Green__literal, - __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Yellow__literal, - __Nothing__literal +type $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$states$$type : { + $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Red$$literal, + $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Green$$literal, + $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Yellow$$literal, + $Nothing$$literal } -type __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__states__type : { - __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Black__literal, - __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Yellow__literal, - __Nothing__literal +type $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$states$$type : { + $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Black$$literal, + $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Yellow$$literal, + $Nothing$$literal } -ctrl var __Mission__crossroad__controller__policeEvent__isActive : boolean = false -ctrl var __Mission__crossroad__controller__policeEventA__isActive : boolean = false -ctrl var __Mission__crossroad__controller__toggleEventA__isActive : boolean = false -ctrl var __Mission__crossroad__controller__policeEventB__isActive : boolean = false -ctrl var __Mission__crossroad__controller__toggleEventB__isActive : boolean = false -var __Mission__crossroad__controller__trafficTimeout__remainingTime : integer = 0 -ctrl var __Mission__crossroad__controller__Main__activeState : __Mission__crossroad__controller__Main__states__type = __Nothing__literal -ctrl var __Mission__crossroad__trafficLightA__policeEvent__isActive : boolean = false -ctrl var __Mission__crossroad__trafficLightA__toggleEvent__isActive : boolean = false -ctrl var __Mission__crossroad__trafficLightA__displayRedEvent__isActive : boolean = false -ctrl var __Mission__crossroad__trafficLightA__displayYellowEvent__isActive : boolean = false -ctrl var __Mission__crossroad__trafficLightA__displayGreenEvent__isActive : boolean = false -ctrl var __Mission__crossroad__trafficLightA__displayNoneEvent__isActive : boolean = false -var __Mission__crossroad__trafficLightA__blinkingTimeout__remainingTime : integer = 0 -ctrl var __Mission__crossroad__trafficLightA__Main__activeState : __Mission__crossroad__trafficLightA__Main__states__type = __Nothing__literal -ctrl var __Mission__crossroad__trafficLightB__policeEvent__isActive : boolean = false -ctrl var __Mission__crossroad__trafficLightB__toggleEvent__isActive : boolean = false -ctrl var __Mission__crossroad__trafficLightB__displayRedEvent__isActive : boolean = false -ctrl var __Mission__crossroad__trafficLightB__displayYellowEvent__isActive : boolean = false -ctrl var __Mission__crossroad__trafficLightB__displayGreenEvent__isActive : boolean = false -ctrl var __Mission__crossroad__trafficLightB__displayNoneEvent__isActive : boolean = false -var __Mission__crossroad__trafficLightB__blinkingTimeout__remainingTime : integer = 0 -ctrl var __Mission__crossroad__trafficLightB__Main__activeState : __Mission__crossroad__trafficLightB__Main__states__type = __Nothing__literal -ctrl var __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState : __Mission__crossroad__controller__Main__Operating__OperatingRegion__states__type = __Nothing__literal -ctrl var __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState : __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__states__type = __Nothing__literal -ctrl var __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState : __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__states__type = __Nothing__literal -ctrl var __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState : __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__states__type = __Nothing__literal -ctrl var __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState : __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__states__type = __Nothing__literal +ctrl var $Mission$crossroad$controller$policeEvent$isActive : boolean = false +ctrl var $Mission$crossroad$controller$policeEventA$isActive : boolean = false +ctrl var $Mission$crossroad$controller$toggleEventA$isActive : boolean = false +ctrl var $Mission$crossroad$controller$policeEventB$isActive : boolean = false +ctrl var $Mission$crossroad$controller$toggleEventB$isActive : boolean = false +var $Mission$crossroad$controller$trafficTimeout$remainingTime : integer = 0 +ctrl var $Mission$crossroad$controller$Main$activeState : $Mission$crossroad$controller$Main$states$$type = $Nothing$$literal +ctrl var $Mission$crossroad$trafficLightA$policeEvent$isActive : boolean = false +ctrl var $Mission$crossroad$trafficLightA$toggleEvent$isActive : boolean = false +ctrl var $Mission$crossroad$trafficLightA$displayRedEvent$isActive : boolean = false +ctrl var $Mission$crossroad$trafficLightA$displayYellowEvent$isActive : boolean = false +ctrl var $Mission$crossroad$trafficLightA$displayGreenEvent$isActive : boolean = false +ctrl var $Mission$crossroad$trafficLightA$displayNoneEvent$isActive : boolean = false +var $Mission$crossroad$trafficLightA$blinkingTimeout$remainingTime : integer = 0 +ctrl var $Mission$crossroad$trafficLightA$Main$activeState : $Mission$crossroad$trafficLightA$Main$states$$type = $Nothing$$literal +ctrl var $Mission$crossroad$trafficLightB$policeEvent$isActive : boolean = false +ctrl var $Mission$crossroad$trafficLightB$toggleEvent$isActive : boolean = false +ctrl var $Mission$crossroad$trafficLightB$displayRedEvent$isActive : boolean = false +ctrl var $Mission$crossroad$trafficLightB$displayYellowEvent$isActive : boolean = false +ctrl var $Mission$crossroad$trafficLightB$displayGreenEvent$isActive : boolean = false +ctrl var $Mission$crossroad$trafficLightB$displayNoneEvent$isActive : boolean = false +var $Mission$crossroad$trafficLightB$blinkingTimeout$remainingTime : integer = 0 +ctrl var $Mission$crossroad$trafficLightB$Main$activeState : $Mission$crossroad$trafficLightB$Main$states$$type = $Nothing$$literal +ctrl var $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState : $Mission$crossroad$controller$Main$Operating$OperatingRegion$states$$type = $Nothing$$literal +ctrl var $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState : $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$states$$type = $Nothing$$literal +ctrl var $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState : $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$states$$type = $Nothing$$literal +ctrl var $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState : $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$states$$type = $Nothing$$literal +ctrl var $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState : $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$states$$type = $Nothing$$literal trans { - havoc __Mission__crossroad__controller__policeEvent__isActive; - __Mission__crossroad__controller__policeEventA__isActive := false; - __Mission__crossroad__controller__toggleEventA__isActive := false; - __Mission__crossroad__controller__policeEventB__isActive := false; - __Mission__crossroad__controller__toggleEventB__isActive := false; + havoc $Mission$crossroad$controller$policeEvent$isActive; + $Mission$crossroad$controller$policeEventA$isActive := false; + $Mission$crossroad$controller$toggleEventA$isActive := false; + $Mission$crossroad$controller$policeEventB$isActive := false; + $Mission$crossroad$controller$toggleEventB$isActive := false; choice { - assume (__Mission__crossroad__controller__policeEvent__isActive); - assume ((__Mission__crossroad__controller__Main__activeState == __Mission__crossroad__controller__Main__Operating__literal)); - __Mission__crossroad__controller__Main__activeState := __Nothing__literal; - if ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__Init__literal)) { - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Nothing__literal; + assume ($Mission$crossroad$controller$policeEvent$isActive); + assume (($Mission$crossroad$controller$Main$activeState == $Mission$crossroad$controller$Main$Operating$$literal)); + $Mission$crossroad$controller$Main$activeState := $Nothing$$literal; + if (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$Init$$literal)) { + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Nothing$$literal; } - if ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnA__literal)) { - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Nothing__literal; + if (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnA$$literal)) { + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Nothing$$literal; } - if ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingA__literal)) { - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Nothing__literal; + if (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingA$$literal)) { + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Nothing$$literal; } - if ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnB__literal)) { - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Nothing__literal; + if (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnB$$literal)) { + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Nothing$$literal; } - if ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingB__literal)) { - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Nothing__literal; + if (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingB$$literal)) { + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Nothing$$literal; } - __Mission__crossroad__controller__Main__activeState := __Mission__crossroad__controller__Main__Interrupted__literal; - __Mission__crossroad__controller__policeEventA__isActive := true; - __Mission__crossroad__controller__policeEventB__isActive := true; + $Mission$crossroad$controller$Main$activeState := $Mission$crossroad$controller$Main$Interrupted$$literal; + $Mission$crossroad$controller$policeEventA$isActive := true; + $Mission$crossroad$controller$policeEventB$isActive := true; } or { - assume (__Mission__crossroad__controller__policeEvent__isActive); - assume ((__Mission__crossroad__controller__Main__activeState == __Mission__crossroad__controller__Main__Interrupted__literal)); - __Mission__crossroad__controller__policeEventA__isActive := true; - __Mission__crossroad__controller__policeEventB__isActive := true; - __Mission__crossroad__controller__Main__activeState := __Nothing__literal; - __Mission__crossroad__controller__Main__activeState := __Mission__crossroad__controller__Main__Operating__literal; - __Mission__crossroad__controller__Main__activeState := __Mission__crossroad__controller__Main__Operating__literal; - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Mission__crossroad__controller__Main__Operating__OperatingRegion__Init__literal; - __Mission__crossroad__controller__trafficTimeout__remainingTime := 1; + assume ($Mission$crossroad$controller$policeEvent$isActive); + assume (($Mission$crossroad$controller$Main$activeState == $Mission$crossroad$controller$Main$Interrupted$$literal)); + $Mission$crossroad$controller$policeEventA$isActive := true; + $Mission$crossroad$controller$policeEventB$isActive := true; + $Mission$crossroad$controller$Main$activeState := $Nothing$$literal; + $Mission$crossroad$controller$Main$activeState := $Mission$crossroad$controller$Main$Operating$$literal; + $Mission$crossroad$controller$Main$activeState := $Mission$crossroad$controller$Main$Operating$$literal; + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Mission$crossroad$controller$Main$Operating$OperatingRegion$Init$$literal; + $Mission$crossroad$controller$trafficTimeout$remainingTime := 1; } or { - assume (! ((((__Mission__crossroad__controller__policeEvent__isActive && (__Mission__crossroad__controller__Main__activeState == __Mission__crossroad__controller__Main__Operating__literal)) && ((((((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__Init__literal) || ! ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__Init__literal))) && ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnA__literal) || ! ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnA__literal)))) && ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingA__literal) || ! ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingA__literal)))) && ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnB__literal) || ! ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnB__literal)))) && ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingB__literal) || ! ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingB__literal))))) || (__Mission__crossroad__controller__policeEvent__isActive && (__Mission__crossroad__controller__Main__activeState == __Mission__crossroad__controller__Main__Interrupted__literal))))); + assume (! (((($Mission$crossroad$controller$policeEvent$isActive && ($Mission$crossroad$controller$Main$activeState == $Mission$crossroad$controller$Main$Operating$$literal)) && (((((($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$Init$$literal) || ! (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$Init$$literal))) && (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnA$$literal) || ! (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnA$$literal)))) && (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingA$$literal) || ! (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingA$$literal)))) && (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnB$$literal) || ! (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnB$$literal)))) && (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingB$$literal) || ! (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingB$$literal))))) || ($Mission$crossroad$controller$policeEvent$isActive && ($Mission$crossroad$controller$Main$activeState == $Mission$crossroad$controller$Main$Interrupted$$literal))))); choice { - assume ((__Mission__crossroad__controller__Main__activeState == __Mission__crossroad__controller__Main__Operating__literal)); + assume (($Mission$crossroad$controller$Main$activeState == $Mission$crossroad$controller$Main$Operating$$literal)); choice { - assume ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0)); - assume ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__Init__literal)); - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Nothing__literal; - __Mission__crossroad__controller__toggleEventA__isActive := true; - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnA__literal; - __Mission__crossroad__controller__trafficTimeout__remainingTime := 2; + assume (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0)); + assume (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$Init$$literal)); + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Nothing$$literal; + $Mission$crossroad$controller$toggleEventA$isActive := true; + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnA$$literal; + $Mission$crossroad$controller$trafficTimeout$remainingTime := 2; } or { - assume ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0)); - assume ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnA__literal)); - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Nothing__literal; - __Mission__crossroad__controller__toggleEventA__isActive := true; - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingA__literal; - __Mission__crossroad__controller__trafficTimeout__remainingTime := 1; + assume (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0)); + assume (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnA$$literal)); + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Nothing$$literal; + $Mission$crossroad$controller$toggleEventA$isActive := true; + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingA$$literal; + $Mission$crossroad$controller$trafficTimeout$remainingTime := 1; } or { - assume ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0)); - assume ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingA__literal)); - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Nothing__literal; - __Mission__crossroad__controller__toggleEventA__isActive := true; - __Mission__crossroad__controller__toggleEventB__isActive := true; - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnB__literal; - __Mission__crossroad__controller__trafficTimeout__remainingTime := 2; + assume (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0)); + assume (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingA$$literal)); + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Nothing$$literal; + $Mission$crossroad$controller$toggleEventA$isActive := true; + $Mission$crossroad$controller$toggleEventB$isActive := true; + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnB$$literal; + $Mission$crossroad$controller$trafficTimeout$remainingTime := 2; } or { - assume ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0)); - assume ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnB__literal)); - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Nothing__literal; - __Mission__crossroad__controller__toggleEventB__isActive := true; - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingB__literal; - __Mission__crossroad__controller__trafficTimeout__remainingTime := 1; + assume (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0)); + assume (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnB$$literal)); + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Nothing$$literal; + $Mission$crossroad$controller$toggleEventB$isActive := true; + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingB$$literal; + $Mission$crossroad$controller$trafficTimeout$remainingTime := 1; } or { - assume ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0)); - assume ((__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingB__literal)); - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Nothing__literal; - __Mission__crossroad__controller__toggleEventB__isActive := true; - __Mission__crossroad__controller__toggleEventA__isActive := true; - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnA__literal; - __Mission__crossroad__controller__trafficTimeout__remainingTime := 2; + assume (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0)); + assume (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingB$$literal)); + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Nothing$$literal; + $Mission$crossroad$controller$toggleEventB$isActive := true; + $Mission$crossroad$controller$toggleEventA$isActive := true; + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnA$$literal; + $Mission$crossroad$controller$trafficTimeout$remainingTime := 2; } or { - assume (! (((((((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0) && (__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__Init__literal)) || ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0) && (__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnA__literal))) || ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0) && (__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingA__literal))) || ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0) && (__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnB__literal))) || ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0) && (__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingB__literal))))); + assume (! ((((((($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0) && ($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$Init$$literal)) || (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0) && ($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnA$$literal))) || (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0) && ($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingA$$literal))) || (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0) && ($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnB$$literal))) || (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0) && ($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingB$$literal))))); } } or { - assume (! (((__Mission__crossroad__controller__Main__activeState == __Mission__crossroad__controller__Main__Operating__literal) && (((((((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0) && (__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__Init__literal)) || ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0) && (__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnA__literal))) || ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0) && (__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingA__literal))) || ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0) && (__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnB__literal))) || ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0) && (__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingB__literal))) || ! (((((((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0) && (__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__Init__literal)) || ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0) && (__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnA__literal))) || ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0) && (__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingA__literal))) || ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0) && (__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__TrafficOnB__literal))) || ((__Mission__crossroad__controller__trafficTimeout__remainingTime <= 0) && (__Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState == __Mission__crossroad__controller__Main__Operating__OperatingRegion__StoppingB__literal)))))))); + assume (! ((($Mission$crossroad$controller$Main$activeState == $Mission$crossroad$controller$Main$Operating$$literal) && ((((((($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0) && ($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$Init$$literal)) || (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0) && ($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnA$$literal))) || (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0) && ($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingA$$literal))) || (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0) && ($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnB$$literal))) || (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0) && ($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingB$$literal))) || ! ((((((($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0) && ($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$Init$$literal)) || (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0) && ($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnA$$literal))) || (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0) && ($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingA$$literal))) || (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0) && ($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnB$$literal))) || (($Mission$crossroad$controller$trafficTimeout$remainingTime <= 0) && ($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingB$$literal)))))))); } } - __Mission__crossroad__controller__policeEvent__isActive := false; - __Mission__crossroad__trafficLightA__displayRedEvent__isActive := false; - __Mission__crossroad__trafficLightA__displayYellowEvent__isActive := false; - __Mission__crossroad__trafficLightA__displayGreenEvent__isActive := false; - __Mission__crossroad__trafficLightA__displayNoneEvent__isActive := false; + $Mission$crossroad$controller$policeEvent$isActive := false; + $Mission$crossroad$trafficLightA$displayRedEvent$isActive := false; + $Mission$crossroad$trafficLightA$displayYellowEvent$isActive := false; + $Mission$crossroad$trafficLightA$displayGreenEvent$isActive := false; + $Mission$crossroad$trafficLightA$displayNoneEvent$isActive := false; choice { - assume (__Mission__crossroad__trafficLightA__policeEvent__isActive); - assume ((__Mission__crossroad__trafficLightA__Main__activeState == __Mission__crossroad__trafficLightA__Main__Normal__literal)); - __Mission__crossroad__trafficLightA__Main__activeState := __Nothing__literal; - if ((__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Red__literal)) { - __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState := __Nothing__literal; + assume ($Mission$crossroad$trafficLightA$policeEvent$isActive); + assume (($Mission$crossroad$trafficLightA$Main$activeState == $Mission$crossroad$trafficLightA$Main$Normal$$literal)); + $Mission$crossroad$trafficLightA$Main$activeState := $Nothing$$literal; + if (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Red$$literal)) { + $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState := $Nothing$$literal; } - if ((__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Green__literal)) { - __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState := __Nothing__literal; + if (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Green$$literal)) { + $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState := $Nothing$$literal; } - if ((__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Yellow__literal)) { - __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState := __Nothing__literal; + if (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Yellow$$literal)) { + $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState := $Nothing$$literal; } - __Mission__crossroad__trafficLightA__Main__activeState := __Mission__crossroad__trafficLightA__Main__Interrupted__literal; - __Mission__crossroad__trafficLightA__Main__activeState := __Mission__crossroad__trafficLightA__Main__Interrupted__literal; - __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState := __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Black__literal; - __Mission__crossroad__trafficLightA__blinkingTimeout__remainingTime := 1; - __Mission__crossroad__trafficLightA__displayNoneEvent__isActive := true; + $Mission$crossroad$trafficLightA$Main$activeState := $Mission$crossroad$trafficLightA$Main$Interrupted$$literal; + $Mission$crossroad$trafficLightA$Main$activeState := $Mission$crossroad$trafficLightA$Main$Interrupted$$literal; + $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState := $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Black$$literal; + $Mission$crossroad$trafficLightA$blinkingTimeout$remainingTime := 1; + $Mission$crossroad$trafficLightA$displayNoneEvent$isActive := true; } or { - assume (__Mission__crossroad__trafficLightA__policeEvent__isActive); - assume ((__Mission__crossroad__trafficLightA__Main__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__literal)); - __Mission__crossroad__trafficLightA__Main__activeState := __Nothing__literal; - if ((__Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Black__literal)) { - __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState := __Nothing__literal; + assume ($Mission$crossroad$trafficLightA$policeEvent$isActive); + assume (($Mission$crossroad$trafficLightA$Main$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$$literal)); + $Mission$crossroad$trafficLightA$Main$activeState := $Nothing$$literal; + if (($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Black$$literal)) { + $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState := $Nothing$$literal; } - if ((__Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Yellow__literal)) { - __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState := __Nothing__literal; + if (($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Yellow$$literal)) { + $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState := $Nothing$$literal; } - __Mission__crossroad__trafficLightA__Main__activeState := __Mission__crossroad__trafficLightA__Main__Normal__literal; - __Mission__crossroad__trafficLightA__Main__activeState := __Mission__crossroad__trafficLightA__Main__Normal__literal; - __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState := __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Red__literal; - __Mission__crossroad__trafficLightA__displayRedEvent__isActive := true; + $Mission$crossroad$trafficLightA$Main$activeState := $Mission$crossroad$trafficLightA$Main$Normal$$literal; + $Mission$crossroad$trafficLightA$Main$activeState := $Mission$crossroad$trafficLightA$Main$Normal$$literal; + $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState := $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Red$$literal; + $Mission$crossroad$trafficLightA$displayRedEvent$isActive := true; } or { - assume (! ((((__Mission__crossroad__trafficLightA__policeEvent__isActive && (__Mission__crossroad__trafficLightA__Main__activeState == __Mission__crossroad__trafficLightA__Main__Normal__literal)) && ((((__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Red__literal) || ! ((__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Red__literal))) && ((__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Green__literal) || ! ((__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Green__literal)))) && ((__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Yellow__literal) || ! ((__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Yellow__literal))))) || ((__Mission__crossroad__trafficLightA__policeEvent__isActive && (__Mission__crossroad__trafficLightA__Main__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__literal)) && (((__Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Black__literal) || ! ((__Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Black__literal))) && ((__Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Yellow__literal) || ! ((__Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Yellow__literal)))))))); + assume (! (((($Mission$crossroad$trafficLightA$policeEvent$isActive && ($Mission$crossroad$trafficLightA$Main$activeState == $Mission$crossroad$trafficLightA$Main$Normal$$literal)) && (((($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Red$$literal) || ! (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Red$$literal))) && (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Green$$literal) || ! (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Green$$literal)))) && (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Yellow$$literal) || ! (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Yellow$$literal))))) || (($Mission$crossroad$trafficLightA$policeEvent$isActive && ($Mission$crossroad$trafficLightA$Main$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$$literal)) && ((($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Black$$literal) || ! (($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Black$$literal))) && (($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Yellow$$literal) || ! (($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Yellow$$literal)))))))); choice { - assume ((__Mission__crossroad__trafficLightA__Main__activeState == __Mission__crossroad__trafficLightA__Main__Normal__literal)); + assume (($Mission$crossroad$trafficLightA$Main$activeState == $Mission$crossroad$trafficLightA$Main$Normal$$literal)); choice { - assume (__Mission__crossroad__trafficLightA__toggleEvent__isActive); - assume ((__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Red__literal)); - __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState := __Nothing__literal; - __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState := __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Green__literal; - __Mission__crossroad__trafficLightA__displayGreenEvent__isActive := true; + assume ($Mission$crossroad$trafficLightA$toggleEvent$isActive); + assume (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Red$$literal)); + $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState := $Nothing$$literal; + $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState := $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Green$$literal; + $Mission$crossroad$trafficLightA$displayGreenEvent$isActive := true; } or { - assume (__Mission__crossroad__trafficLightA__toggleEvent__isActive); - assume ((__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Green__literal)); - __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState := __Nothing__literal; - __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState := __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Yellow__literal; - __Mission__crossroad__trafficLightA__displayYellowEvent__isActive := true; + assume ($Mission$crossroad$trafficLightA$toggleEvent$isActive); + assume (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Green$$literal)); + $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState := $Nothing$$literal; + $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState := $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Yellow$$literal; + $Mission$crossroad$trafficLightA$displayYellowEvent$isActive := true; } or { - assume (__Mission__crossroad__trafficLightA__toggleEvent__isActive); - assume ((__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Yellow__literal)); - __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState := __Nothing__literal; - __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState := __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Red__literal; - __Mission__crossroad__trafficLightA__displayRedEvent__isActive := true; + assume ($Mission$crossroad$trafficLightA$toggleEvent$isActive); + assume (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Yellow$$literal)); + $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState := $Nothing$$literal; + $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState := $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Red$$literal; + $Mission$crossroad$trafficLightA$displayRedEvent$isActive := true; } or { - assume (! ((((__Mission__crossroad__trafficLightA__toggleEvent__isActive && (__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Red__literal)) || (__Mission__crossroad__trafficLightA__toggleEvent__isActive && (__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Green__literal))) || (__Mission__crossroad__trafficLightA__toggleEvent__isActive && (__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Yellow__literal))))); + assume (! (((($Mission$crossroad$trafficLightA$toggleEvent$isActive && ($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Red$$literal)) || ($Mission$crossroad$trafficLightA$toggleEvent$isActive && ($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Green$$literal))) || ($Mission$crossroad$trafficLightA$toggleEvent$isActive && ($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Yellow$$literal))))); } } or { - assume ((__Mission__crossroad__trafficLightA__Main__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__literal)); + assume (($Mission$crossroad$trafficLightA$Main$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$$literal)); choice { - assume ((__Mission__crossroad__trafficLightA__blinkingTimeout__remainingTime <= 0)); - assume ((__Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Black__literal)); - __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState := __Nothing__literal; - __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState := __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Yellow__literal; - __Mission__crossroad__trafficLightA__blinkingTimeout__remainingTime := 1; - __Mission__crossroad__trafficLightA__displayYellowEvent__isActive := true; + assume (($Mission$crossroad$trafficLightA$blinkingTimeout$remainingTime <= 0)); + assume (($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Black$$literal)); + $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState := $Nothing$$literal; + $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState := $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Yellow$$literal; + $Mission$crossroad$trafficLightA$blinkingTimeout$remainingTime := 1; + $Mission$crossroad$trafficLightA$displayYellowEvent$isActive := true; } or { - assume ((__Mission__crossroad__trafficLightA__blinkingTimeout__remainingTime <= 0)); - assume ((__Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Yellow__literal)); - __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState := __Nothing__literal; - __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState := __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Black__literal; - __Mission__crossroad__trafficLightA__blinkingTimeout__remainingTime := 1; - __Mission__crossroad__trafficLightA__displayNoneEvent__isActive := true; + assume (($Mission$crossroad$trafficLightA$blinkingTimeout$remainingTime <= 0)); + assume (($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Yellow$$literal)); + $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState := $Nothing$$literal; + $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState := $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Black$$literal; + $Mission$crossroad$trafficLightA$blinkingTimeout$remainingTime := 1; + $Mission$crossroad$trafficLightA$displayNoneEvent$isActive := true; } or { - assume (! ((((__Mission__crossroad__trafficLightA__blinkingTimeout__remainingTime <= 0) && (__Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Black__literal)) || ((__Mission__crossroad__trafficLightA__blinkingTimeout__remainingTime <= 0) && (__Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Yellow__literal))))); + assume (! (((($Mission$crossroad$trafficLightA$blinkingTimeout$remainingTime <= 0) && ($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Black$$literal)) || (($Mission$crossroad$trafficLightA$blinkingTimeout$remainingTime <= 0) && ($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Yellow$$literal))))); } } or { - assume (! ((((__Mission__crossroad__trafficLightA__Main__activeState == __Mission__crossroad__trafficLightA__Main__Normal__literal) && ((((__Mission__crossroad__trafficLightA__toggleEvent__isActive && (__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Red__literal)) || (__Mission__crossroad__trafficLightA__toggleEvent__isActive && (__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Green__literal))) || (__Mission__crossroad__trafficLightA__toggleEvent__isActive && (__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Yellow__literal))) || ! ((((__Mission__crossroad__trafficLightA__toggleEvent__isActive && (__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Red__literal)) || (__Mission__crossroad__trafficLightA__toggleEvent__isActive && (__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Green__literal))) || (__Mission__crossroad__trafficLightA__toggleEvent__isActive && (__Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Yellow__literal)))))) || ((__Mission__crossroad__trafficLightA__Main__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__literal) && ((((__Mission__crossroad__trafficLightA__blinkingTimeout__remainingTime <= 0) && (__Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Black__literal)) || ((__Mission__crossroad__trafficLightA__blinkingTimeout__remainingTime <= 0) && (__Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Yellow__literal))) || ! ((((__Mission__crossroad__trafficLightA__blinkingTimeout__remainingTime <= 0) && (__Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Black__literal)) || ((__Mission__crossroad__trafficLightA__blinkingTimeout__remainingTime <= 0) && (__Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightA__Main__Interrupted__InterruptedRegion__Yellow__literal))))))))); + assume (! (((($Mission$crossroad$trafficLightA$Main$activeState == $Mission$crossroad$trafficLightA$Main$Normal$$literal) && (((($Mission$crossroad$trafficLightA$toggleEvent$isActive && ($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Red$$literal)) || ($Mission$crossroad$trafficLightA$toggleEvent$isActive && ($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Green$$literal))) || ($Mission$crossroad$trafficLightA$toggleEvent$isActive && ($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Yellow$$literal))) || ! (((($Mission$crossroad$trafficLightA$toggleEvent$isActive && ($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Red$$literal)) || ($Mission$crossroad$trafficLightA$toggleEvent$isActive && ($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Green$$literal))) || ($Mission$crossroad$trafficLightA$toggleEvent$isActive && ($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Yellow$$literal)))))) || (($Mission$crossroad$trafficLightA$Main$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$$literal) && (((($Mission$crossroad$trafficLightA$blinkingTimeout$remainingTime <= 0) && ($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Black$$literal)) || (($Mission$crossroad$trafficLightA$blinkingTimeout$remainingTime <= 0) && ($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Yellow$$literal))) || ! (((($Mission$crossroad$trafficLightA$blinkingTimeout$remainingTime <= 0) && ($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Black$$literal)) || (($Mission$crossroad$trafficLightA$blinkingTimeout$remainingTime <= 0) && ($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Yellow$$literal))))))))); } } - __Mission__crossroad__trafficLightA__policeEvent__isActive := false; - __Mission__crossroad__trafficLightA__toggleEvent__isActive := false; - __Mission__crossroad__trafficLightB__displayRedEvent__isActive := false; - __Mission__crossroad__trafficLightB__displayYellowEvent__isActive := false; - __Mission__crossroad__trafficLightB__displayGreenEvent__isActive := false; - __Mission__crossroad__trafficLightB__displayNoneEvent__isActive := false; + $Mission$crossroad$trafficLightA$policeEvent$isActive := false; + $Mission$crossroad$trafficLightA$toggleEvent$isActive := false; + $Mission$crossroad$trafficLightB$displayRedEvent$isActive := false; + $Mission$crossroad$trafficLightB$displayYellowEvent$isActive := false; + $Mission$crossroad$trafficLightB$displayGreenEvent$isActive := false; + $Mission$crossroad$trafficLightB$displayNoneEvent$isActive := false; choice { - assume (__Mission__crossroad__trafficLightB__policeEvent__isActive); - assume ((__Mission__crossroad__trafficLightB__Main__activeState == __Mission__crossroad__trafficLightB__Main__Normal__literal)); - __Mission__crossroad__trafficLightB__Main__activeState := __Nothing__literal; - if ((__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Red__literal)) { - __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState := __Nothing__literal; + assume ($Mission$crossroad$trafficLightB$policeEvent$isActive); + assume (($Mission$crossroad$trafficLightB$Main$activeState == $Mission$crossroad$trafficLightB$Main$Normal$$literal)); + $Mission$crossroad$trafficLightB$Main$activeState := $Nothing$$literal; + if (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Red$$literal)) { + $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState := $Nothing$$literal; } - if ((__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Green__literal)) { - __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState := __Nothing__literal; + if (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Green$$literal)) { + $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState := $Nothing$$literal; } - if ((__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Yellow__literal)) { - __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState := __Nothing__literal; + if (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Yellow$$literal)) { + $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState := $Nothing$$literal; } - __Mission__crossroad__trafficLightB__Main__activeState := __Mission__crossroad__trafficLightB__Main__Interrupted__literal; - __Mission__crossroad__trafficLightB__Main__activeState := __Mission__crossroad__trafficLightB__Main__Interrupted__literal; - __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState := __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Black__literal; - __Mission__crossroad__trafficLightB__blinkingTimeout__remainingTime := 1; - __Mission__crossroad__trafficLightB__displayNoneEvent__isActive := true; + $Mission$crossroad$trafficLightB$Main$activeState := $Mission$crossroad$trafficLightB$Main$Interrupted$$literal; + $Mission$crossroad$trafficLightB$Main$activeState := $Mission$crossroad$trafficLightB$Main$Interrupted$$literal; + $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState := $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Black$$literal; + $Mission$crossroad$trafficLightB$blinkingTimeout$remainingTime := 1; + $Mission$crossroad$trafficLightB$displayNoneEvent$isActive := true; } or { - assume (__Mission__crossroad__trafficLightB__policeEvent__isActive); - assume ((__Mission__crossroad__trafficLightB__Main__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__literal)); - __Mission__crossroad__trafficLightB__Main__activeState := __Nothing__literal; - if ((__Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Black__literal)) { - __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState := __Nothing__literal; + assume ($Mission$crossroad$trafficLightB$policeEvent$isActive); + assume (($Mission$crossroad$trafficLightB$Main$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$$literal)); + $Mission$crossroad$trafficLightB$Main$activeState := $Nothing$$literal; + if (($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Black$$literal)) { + $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState := $Nothing$$literal; } - if ((__Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Yellow__literal)) { - __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState := __Nothing__literal; + if (($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Yellow$$literal)) { + $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState := $Nothing$$literal; } - __Mission__crossroad__trafficLightB__Main__activeState := __Mission__crossroad__trafficLightB__Main__Normal__literal; - __Mission__crossroad__trafficLightB__Main__activeState := __Mission__crossroad__trafficLightB__Main__Normal__literal; - __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState := __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Red__literal; - __Mission__crossroad__trafficLightB__displayRedEvent__isActive := true; + $Mission$crossroad$trafficLightB$Main$activeState := $Mission$crossroad$trafficLightB$Main$Normal$$literal; + $Mission$crossroad$trafficLightB$Main$activeState := $Mission$crossroad$trafficLightB$Main$Normal$$literal; + $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState := $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Red$$literal; + $Mission$crossroad$trafficLightB$displayRedEvent$isActive := true; } or { - assume (! ((((__Mission__crossroad__trafficLightB__policeEvent__isActive && (__Mission__crossroad__trafficLightB__Main__activeState == __Mission__crossroad__trafficLightB__Main__Normal__literal)) && ((((__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Red__literal) || ! ((__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Red__literal))) && ((__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Green__literal) || ! ((__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Green__literal)))) && ((__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Yellow__literal) || ! ((__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Yellow__literal))))) || ((__Mission__crossroad__trafficLightB__policeEvent__isActive && (__Mission__crossroad__trafficLightB__Main__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__literal)) && (((__Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Black__literal) || ! ((__Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Black__literal))) && ((__Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Yellow__literal) || ! ((__Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Yellow__literal)))))))); + assume (! (((($Mission$crossroad$trafficLightB$policeEvent$isActive && ($Mission$crossroad$trafficLightB$Main$activeState == $Mission$crossroad$trafficLightB$Main$Normal$$literal)) && (((($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Red$$literal) || ! (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Red$$literal))) && (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Green$$literal) || ! (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Green$$literal)))) && (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Yellow$$literal) || ! (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Yellow$$literal))))) || (($Mission$crossroad$trafficLightB$policeEvent$isActive && ($Mission$crossroad$trafficLightB$Main$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$$literal)) && ((($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Black$$literal) || ! (($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Black$$literal))) && (($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Yellow$$literal) || ! (($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Yellow$$literal)))))))); choice { - assume ((__Mission__crossroad__trafficLightB__Main__activeState == __Mission__crossroad__trafficLightB__Main__Normal__literal)); + assume (($Mission$crossroad$trafficLightB$Main$activeState == $Mission$crossroad$trafficLightB$Main$Normal$$literal)); choice { - assume (__Mission__crossroad__trafficLightB__toggleEvent__isActive); - assume ((__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Red__literal)); - __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState := __Nothing__literal; - __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState := __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Green__literal; - __Mission__crossroad__trafficLightB__displayGreenEvent__isActive := true; + assume ($Mission$crossroad$trafficLightB$toggleEvent$isActive); + assume (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Red$$literal)); + $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState := $Nothing$$literal; + $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState := $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Green$$literal; + $Mission$crossroad$trafficLightB$displayGreenEvent$isActive := true; } or { - assume (__Mission__crossroad__trafficLightB__toggleEvent__isActive); - assume ((__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Green__literal)); - __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState := __Nothing__literal; - __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState := __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Yellow__literal; - __Mission__crossroad__trafficLightB__displayYellowEvent__isActive := true; + assume ($Mission$crossroad$trafficLightB$toggleEvent$isActive); + assume (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Green$$literal)); + $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState := $Nothing$$literal; + $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState := $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Yellow$$literal; + $Mission$crossroad$trafficLightB$displayYellowEvent$isActive := true; } or { - assume (__Mission__crossroad__trafficLightB__toggleEvent__isActive); - assume ((__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Yellow__literal)); - __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState := __Nothing__literal; - __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState := __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Red__literal; - __Mission__crossroad__trafficLightB__displayRedEvent__isActive := true; + assume ($Mission$crossroad$trafficLightB$toggleEvent$isActive); + assume (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Yellow$$literal)); + $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState := $Nothing$$literal; + $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState := $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Red$$literal; + $Mission$crossroad$trafficLightB$displayRedEvent$isActive := true; } or { - assume (! ((((__Mission__crossroad__trafficLightB__toggleEvent__isActive && (__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Red__literal)) || (__Mission__crossroad__trafficLightB__toggleEvent__isActive && (__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Green__literal))) || (__Mission__crossroad__trafficLightB__toggleEvent__isActive && (__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Yellow__literal))))); + assume (! (((($Mission$crossroad$trafficLightB$toggleEvent$isActive && ($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Red$$literal)) || ($Mission$crossroad$trafficLightB$toggleEvent$isActive && ($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Green$$literal))) || ($Mission$crossroad$trafficLightB$toggleEvent$isActive && ($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Yellow$$literal))))); } } or { - assume ((__Mission__crossroad__trafficLightB__Main__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__literal)); + assume (($Mission$crossroad$trafficLightB$Main$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$$literal)); choice { - assume ((__Mission__crossroad__trafficLightB__blinkingTimeout__remainingTime <= 0)); - assume ((__Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Black__literal)); - __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState := __Nothing__literal; - __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState := __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Yellow__literal; - __Mission__crossroad__trafficLightB__blinkingTimeout__remainingTime := 1; - __Mission__crossroad__trafficLightB__displayYellowEvent__isActive := true; + assume (($Mission$crossroad$trafficLightB$blinkingTimeout$remainingTime <= 0)); + assume (($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Black$$literal)); + $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState := $Nothing$$literal; + $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState := $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Yellow$$literal; + $Mission$crossroad$trafficLightB$blinkingTimeout$remainingTime := 1; + $Mission$crossroad$trafficLightB$displayYellowEvent$isActive := true; } or { - assume ((__Mission__crossroad__trafficLightB__blinkingTimeout__remainingTime <= 0)); - assume ((__Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Yellow__literal)); - __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState := __Nothing__literal; - __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState := __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Black__literal; - __Mission__crossroad__trafficLightB__blinkingTimeout__remainingTime := 1; - __Mission__crossroad__trafficLightB__displayNoneEvent__isActive := true; + assume (($Mission$crossroad$trafficLightB$blinkingTimeout$remainingTime <= 0)); + assume (($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Yellow$$literal)); + $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState := $Nothing$$literal; + $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState := $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Black$$literal; + $Mission$crossroad$trafficLightB$blinkingTimeout$remainingTime := 1; + $Mission$crossroad$trafficLightB$displayNoneEvent$isActive := true; } or { - assume (! ((((__Mission__crossroad__trafficLightB__blinkingTimeout__remainingTime <= 0) && (__Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Black__literal)) || ((__Mission__crossroad__trafficLightB__blinkingTimeout__remainingTime <= 0) && (__Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Yellow__literal))))); + assume (! (((($Mission$crossroad$trafficLightB$blinkingTimeout$remainingTime <= 0) && ($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Black$$literal)) || (($Mission$crossroad$trafficLightB$blinkingTimeout$remainingTime <= 0) && ($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Yellow$$literal))))); } } or { - assume (! ((((__Mission__crossroad__trafficLightB__Main__activeState == __Mission__crossroad__trafficLightB__Main__Normal__literal) && ((((__Mission__crossroad__trafficLightB__toggleEvent__isActive && (__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Red__literal)) || (__Mission__crossroad__trafficLightB__toggleEvent__isActive && (__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Green__literal))) || (__Mission__crossroad__trafficLightB__toggleEvent__isActive && (__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Yellow__literal))) || ! ((((__Mission__crossroad__trafficLightB__toggleEvent__isActive && (__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Red__literal)) || (__Mission__crossroad__trafficLightB__toggleEvent__isActive && (__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Green__literal))) || (__Mission__crossroad__trafficLightB__toggleEvent__isActive && (__Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState == __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Yellow__literal)))))) || ((__Mission__crossroad__trafficLightB__Main__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__literal) && ((((__Mission__crossroad__trafficLightB__blinkingTimeout__remainingTime <= 0) && (__Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Black__literal)) || ((__Mission__crossroad__trafficLightB__blinkingTimeout__remainingTime <= 0) && (__Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Yellow__literal))) || ! ((((__Mission__crossroad__trafficLightB__blinkingTimeout__remainingTime <= 0) && (__Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Black__literal)) || ((__Mission__crossroad__trafficLightB__blinkingTimeout__remainingTime <= 0) && (__Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__activeState == __Mission__crossroad__trafficLightB__Main__Interrupted__InterruptedRegion__Yellow__literal))))))))); + assume (! (((($Mission$crossroad$trafficLightB$Main$activeState == $Mission$crossroad$trafficLightB$Main$Normal$$literal) && (((($Mission$crossroad$trafficLightB$toggleEvent$isActive && ($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Red$$literal)) || ($Mission$crossroad$trafficLightB$toggleEvent$isActive && ($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Green$$literal))) || ($Mission$crossroad$trafficLightB$toggleEvent$isActive && ($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Yellow$$literal))) || ! (((($Mission$crossroad$trafficLightB$toggleEvent$isActive && ($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Red$$literal)) || ($Mission$crossroad$trafficLightB$toggleEvent$isActive && ($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Green$$literal))) || ($Mission$crossroad$trafficLightB$toggleEvent$isActive && ($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Yellow$$literal)))))) || (($Mission$crossroad$trafficLightB$Main$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$$literal) && (((($Mission$crossroad$trafficLightB$blinkingTimeout$remainingTime <= 0) && ($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Black$$literal)) || (($Mission$crossroad$trafficLightB$blinkingTimeout$remainingTime <= 0) && ($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Yellow$$literal))) || ! (((($Mission$crossroad$trafficLightB$blinkingTimeout$remainingTime <= 0) && ($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Black$$literal)) || (($Mission$crossroad$trafficLightB$blinkingTimeout$remainingTime <= 0) && ($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Yellow$$literal))))))))); } } - __Mission__crossroad__trafficLightB__policeEvent__isActive := false; - __Mission__crossroad__trafficLightB__toggleEvent__isActive := false; - if (__Mission__crossroad__controller__policeEventA__isActive) { - __Mission__crossroad__trafficLightA__policeEvent__isActive := true; + $Mission$crossroad$trafficLightB$policeEvent$isActive := false; + $Mission$crossroad$trafficLightB$toggleEvent$isActive := false; + if ($Mission$crossroad$controller$policeEventA$isActive) { + $Mission$crossroad$trafficLightA$policeEvent$isActive := true; } - if (__Mission__crossroad__controller__toggleEventA__isActive) { - __Mission__crossroad__trafficLightA__toggleEvent__isActive := true; + if ($Mission$crossroad$controller$toggleEventA$isActive) { + $Mission$crossroad$trafficLightA$toggleEvent$isActive := true; } - if (__Mission__crossroad__controller__policeEventB__isActive) { - __Mission__crossroad__trafficLightB__policeEvent__isActive := true; + if ($Mission$crossroad$controller$policeEventB$isActive) { + $Mission$crossroad$trafficLightB$policeEvent$isActive := true; } - if (__Mission__crossroad__controller__toggleEventB__isActive) { - __Mission__crossroad__trafficLightB__toggleEvent__isActive := true; + if ($Mission$crossroad$controller$toggleEventB$isActive) { + $Mission$crossroad$trafficLightB$toggleEvent$isActive := true; } - if ((__Mission__crossroad__controller__trafficTimeout__remainingTime > 0)) { - __Mission__crossroad__controller__trafficTimeout__remainingTime := (__Mission__crossroad__controller__trafficTimeout__remainingTime - 1); + if (($Mission$crossroad$controller$trafficTimeout$remainingTime > 0)) { + $Mission$crossroad$controller$trafficTimeout$remainingTime := ($Mission$crossroad$controller$trafficTimeout$remainingTime - 1); } - if ((__Mission__crossroad__trafficLightA__blinkingTimeout__remainingTime > 0)) { - __Mission__crossroad__trafficLightA__blinkingTimeout__remainingTime := (__Mission__crossroad__trafficLightA__blinkingTimeout__remainingTime - 1); + if (($Mission$crossroad$trafficLightA$blinkingTimeout$remainingTime > 0)) { + $Mission$crossroad$trafficLightA$blinkingTimeout$remainingTime := ($Mission$crossroad$trafficLightA$blinkingTimeout$remainingTime - 1); } - if ((__Mission__crossroad__trafficLightB__blinkingTimeout__remainingTime > 0)) { - __Mission__crossroad__trafficLightB__blinkingTimeout__remainingTime := (__Mission__crossroad__trafficLightB__blinkingTimeout__remainingTime - 1); + if (($Mission$crossroad$trafficLightB$blinkingTimeout$remainingTime > 0)) { + $Mission$crossroad$trafficLightB$blinkingTimeout$remainingTime := ($Mission$crossroad$trafficLightB$blinkingTimeout$remainingTime - 1); } } init { - __Mission__crossroad__controller__Main__activeState := __Mission__crossroad__controller__Main__Operating__literal; - __Mission__crossroad__controller__Main__activeState := __Mission__crossroad__controller__Main__Operating__literal; - __Mission__crossroad__controller__Main__Operating__OperatingRegion__activeState := __Mission__crossroad__controller__Main__Operating__OperatingRegion__Init__literal; - __Mission__crossroad__controller__trafficTimeout__remainingTime := 1; - __Mission__crossroad__trafficLightA__Main__activeState := __Mission__crossroad__trafficLightA__Main__Normal__literal; - __Mission__crossroad__trafficLightA__Main__activeState := __Mission__crossroad__trafficLightA__Main__Normal__literal; - __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__activeState := __Mission__crossroad__trafficLightA__Main__Normal__NormalRegion__Red__literal; - __Mission__crossroad__trafficLightA__displayRedEvent__isActive := true; - __Mission__crossroad__trafficLightB__Main__activeState := __Mission__crossroad__trafficLightB__Main__Normal__literal; - __Mission__crossroad__trafficLightB__Main__activeState := __Mission__crossroad__trafficLightB__Main__Normal__literal; - __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__activeState := __Mission__crossroad__trafficLightB__Main__Normal__NormalRegion__Red__literal; - __Mission__crossroad__trafficLightB__displayRedEvent__isActive := true; + $Mission$crossroad$controller$Main$activeState := $Mission$crossroad$controller$Main$Operating$$literal; + $Mission$crossroad$controller$Main$activeState := $Mission$crossroad$controller$Main$Operating$$literal; + $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Mission$crossroad$controller$Main$Operating$OperatingRegion$Init$$literal; + $Mission$crossroad$controller$trafficTimeout$remainingTime := 1; + $Mission$crossroad$trafficLightA$Main$activeState := $Mission$crossroad$trafficLightA$Main$Normal$$literal; + $Mission$crossroad$trafficLightA$Main$activeState := $Mission$crossroad$trafficLightA$Main$Normal$$literal; + $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState := $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Red$$literal; + $Mission$crossroad$trafficLightA$displayRedEvent$isActive := true; + $Mission$crossroad$trafficLightB$Main$activeState := $Mission$crossroad$trafficLightB$Main$Normal$$literal; + $Mission$crossroad$trafficLightB$Main$activeState := $Mission$crossroad$trafficLightB$Main$Normal$$literal; + $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState := $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Red$$literal; + $Mission$crossroad$trafficLightB$displayRedEvent$isActive := true; } env {} diff --git a/subprojects/semantifyr/TestModels/Automated/Gamma/SimpleMission/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Gamma/SimpleMission/expected.xsts index 51b9c72..f588060 100644 --- a/subprojects/semantifyr/TestModels/Automated/Gamma/SimpleMission/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Gamma/SimpleMission/expected.xsts @@ -4,65 +4,65 @@ * SPDX-License-Identifier: EPL-2.0 */ -type __Mission__system__leader__Main__states__type : { - __Mission__system__leader__Main__Idle__literal, - __Mission__system__leader__Main__Operational__literal, - __Nothing__literal +type $Mission$system$leader$Main$states$$type : { + $Mission$system$leader$Main$Idle$$literal, + $Mission$system$leader$Main$Operational$$literal, + $Nothing$$literal } -type __Mission__system__worker__Main__states__type : { - __Mission__system__worker__Main__Idle__literal, - __Mission__system__worker__Main__Operational__literal, - __Nothing__literal +type $Mission$system$worker$Main$states$$type : { + $Mission$system$worker$Main$Idle$$literal, + $Mission$system$worker$Main$Operational$$literal, + $Nothing$$literal } -ctrl var __Mission__system__leader__fireEvent__isActive : boolean = false -ctrl var __Mission__system__leader__stopEvent__isActive : boolean = false -ctrl var __Mission__system__leader__startEvent__isActive : boolean = false -ctrl var __Mission__system__leader__Main__activeState : __Mission__system__leader__Main__states__type = __Nothing__literal -ctrl var __Mission__system__worker__startEvent__isActive : boolean = false -ctrl var __Mission__system__worker__Main__activeState : __Mission__system__worker__Main__states__type = __Nothing__literal +ctrl var $Mission$system$leader$fireEvent$isActive : boolean = false +ctrl var $Mission$system$leader$stopEvent$isActive : boolean = false +ctrl var $Mission$system$leader$startEvent$isActive : boolean = false +ctrl var $Mission$system$leader$Main$activeState : $Mission$system$leader$Main$states$$type = $Nothing$$literal +ctrl var $Mission$system$worker$startEvent$isActive : boolean = false +ctrl var $Mission$system$worker$Main$activeState : $Mission$system$worker$Main$states$$type = $Nothing$$literal trans { - havoc __Mission__system__leader__fireEvent__isActive; - havoc __Mission__system__leader__stopEvent__isActive; - __Mission__system__leader__startEvent__isActive := false; + havoc $Mission$system$leader$fireEvent$isActive; + havoc $Mission$system$leader$stopEvent$isActive; + $Mission$system$leader$startEvent$isActive := false; choice { - assume (__Mission__system__leader__fireEvent__isActive); - assume ((__Mission__system__leader__Main__activeState == __Mission__system__leader__Main__Idle__literal)); - __Mission__system__leader__Main__activeState := __Nothing__literal; - __Mission__system__leader__startEvent__isActive := true; - __Mission__system__leader__Main__activeState := __Mission__system__leader__Main__Operational__literal; + assume ($Mission$system$leader$fireEvent$isActive); + assume (($Mission$system$leader$Main$activeState == $Mission$system$leader$Main$Idle$$literal)); + $Mission$system$leader$Main$activeState := $Nothing$$literal; + $Mission$system$leader$startEvent$isActive := true; + $Mission$system$leader$Main$activeState := $Mission$system$leader$Main$Operational$$literal; } or { - assume (__Mission__system__leader__stopEvent__isActive); - assume ((__Mission__system__leader__Main__activeState == __Mission__system__leader__Main__Operational__literal)); - __Mission__system__leader__Main__activeState := __Nothing__literal; - __Mission__system__leader__Main__activeState := __Mission__system__leader__Main__Idle__literal; + assume ($Mission$system$leader$stopEvent$isActive); + assume (($Mission$system$leader$Main$activeState == $Mission$system$leader$Main$Operational$$literal)); + $Mission$system$leader$Main$activeState := $Nothing$$literal; + $Mission$system$leader$Main$activeState := $Mission$system$leader$Main$Idle$$literal; } or { - assume (! (((__Mission__system__leader__fireEvent__isActive && (__Mission__system__leader__Main__activeState == __Mission__system__leader__Main__Idle__literal)) || (__Mission__system__leader__stopEvent__isActive && (__Mission__system__leader__Main__activeState == __Mission__system__leader__Main__Operational__literal))))); + assume (! ((($Mission$system$leader$fireEvent$isActive && ($Mission$system$leader$Main$activeState == $Mission$system$leader$Main$Idle$$literal)) || ($Mission$system$leader$stopEvent$isActive && ($Mission$system$leader$Main$activeState == $Mission$system$leader$Main$Operational$$literal))))); } - __Mission__system__leader__fireEvent__isActive := false; - __Mission__system__leader__stopEvent__isActive := false; + $Mission$system$leader$fireEvent$isActive := false; + $Mission$system$leader$stopEvent$isActive := false; choice { - assume (__Mission__system__worker__startEvent__isActive); - assume ((__Mission__system__worker__Main__activeState == __Mission__system__worker__Main__Idle__literal)); - __Mission__system__worker__Main__activeState := __Nothing__literal; - __Mission__system__worker__Main__activeState := __Mission__system__worker__Main__Operational__literal; + assume ($Mission$system$worker$startEvent$isActive); + assume (($Mission$system$worker$Main$activeState == $Mission$system$worker$Main$Idle$$literal)); + $Mission$system$worker$Main$activeState := $Nothing$$literal; + $Mission$system$worker$Main$activeState := $Mission$system$worker$Main$Operational$$literal; } or { - assume (! ((__Mission__system__worker__startEvent__isActive && (__Mission__system__worker__Main__activeState == __Mission__system__worker__Main__Idle__literal)))); + assume (! (($Mission$system$worker$startEvent$isActive && ($Mission$system$worker$Main$activeState == $Mission$system$worker$Main$Idle$$literal)))); } - __Mission__system__worker__startEvent__isActive := false; - if (__Mission__system__leader__startEvent__isActive) { - __Mission__system__worker__startEvent__isActive := true; + $Mission$system$worker$startEvent$isActive := false; + if ($Mission$system$leader$startEvent$isActive) { + $Mission$system$worker$startEvent$isActive := true; } } init { - __Mission__system__leader__Main__activeState := __Mission__system__leader__Main__Idle__literal; - __Mission__system__worker__Main__activeState := __Mission__system__worker__Main__Idle__literal; + $Mission$system$leader$Main$activeState := $Mission$system$leader$Main$Idle$$literal; + $Mission$system$worker$Main$activeState := $Mission$system$worker$Main$Idle$$literal; } env {} prop { - (__Mission__system__worker__Main__activeState != __Mission__system__worker__Main__Operational__literal) + ($Mission$system$worker$Main$activeState != $Mission$system$worker$Main$Operational$$literal) } diff --git a/subprojects/semantifyr/TestModels/Automated/Gamma/Spacecraft/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Gamma/Spacecraft/expected.xsts index a2bf9e2..641ca2a 100644 --- a/subprojects/semantifyr/TestModels/Automated/Gamma/Spacecraft/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Gamma/Spacecraft/expected.xsts @@ -4,257 +4,257 @@ * SPDX-License-Identifier: EPL-2.0 */ -type __Mission__spaceMission__station__Main__states__type : { - __Mission__spaceMission__station__Main__Idle__literal, - __Mission__spaceMission__station__Main__Operation__literal, - __Nothing__literal +type $Mission$spaceMission$station$Main$states$$type : { + $Mission$spaceMission$station$Main$Idle$$literal, + $Mission$spaceMission$station$Main$Operation$$literal, + $Nothing$$literal } -type __Mission__spaceMission__spacecraft__Communication__states__type : { - __Mission__spaceMission__spacecraft__Communication__WaitingPing__literal, - __Mission__spaceMission__spacecraft__Communication__Transmitting__literal, - __Nothing__literal +type $Mission$spaceMission$spacecraft$Communication$states$$type : { + $Mission$spaceMission$spacecraft$Communication$WaitingPing$$literal, + $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal, + $Nothing$$literal } -type __Mission__spaceMission__spacecraft__Battery__states__type : { - __Mission__spaceMission__spacecraft__Battery__NotRecharging__literal, - __Mission__spaceMission__spacecraft__Battery__Recharging__literal, - __Nothing__literal +type $Mission$spaceMission$spacecraft$Battery$states$$type : { + $Mission$spaceMission$spacecraft$Battery$NotRecharging$$literal, + $Mission$spaceMission$spacecraft$Battery$Recharging$$literal, + $Nothing$$literal } -type __Mission__spaceMission__station__Main__Operation__ReceiveData__states__type : { - __Mission__spaceMission__station__Main__Operation__ReceiveData__Waiting__literal, - __Nothing__literal +type $Mission$spaceMission$station$Main$Operation$ReceiveData$states$$type : { + $Mission$spaceMission$station$Main$Operation$ReceiveData$Waiting$$literal, + $Nothing$$literal } -type __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__states__type : { - __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__Sending__literal, - __Nothing__literal +type $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$states$$type : { + $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal, + $Nothing$$literal } -type __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__states__type : { - __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__Consuming__literal, - __Nothing__literal +type $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$states$$type : { + $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal, + $Nothing$$literal } -var __Mission__spaceMission__station__receivedData : integer = 0 -var __Mission__spaceMission__spacecraft__batteryCharge : integer = 100 -var __Mission__spaceMission__spacecraft__recharging : boolean = false -var __Mission__spaceMission__spacecraft__data : integer = 100 -ctrl var __Mission__spaceMission__station__dataEvent__isActive : boolean = false -ctrl var __Mission__spaceMission__station__startEvent__isActive : boolean = false -ctrl var __Mission__spaceMission__station__shutdownEvent__isActive : boolean = false -ctrl var __Mission__spaceMission__station__pingEvent__isActive : boolean = false -var __Mission__spaceMission__station__pingTimeout__remainingTime : integer = 0 -var __Mission__spaceMission__station__startTimeout__remainingTime : integer = 0 -ctrl var __Mission__spaceMission__station__Main__activeState : __Mission__spaceMission__station__Main__states__type = __Nothing__literal -ctrl var __Mission__spaceMission__spacecraft__pingEvent__isActive : boolean = false -ctrl var __Mission__spaceMission__spacecraft__dataEvent__isActive : boolean = false -var __Mission__spaceMission__spacecraft__checkBatteryTimeout__remainingTime : integer = 0 -var __Mission__spaceMission__spacecraft__rechargeTimeout__remainingTime : integer = 0 -var __Mission__spaceMission__spacecraft__consumeTimeout__remainingTime : integer = 0 -var __Mission__spaceMission__spacecraft__transmitTimeout__remainingTime : integer = 0 -ctrl var __Mission__spaceMission__spacecraft__Communication__activeState : __Mission__spaceMission__spacecraft__Communication__states__type = __Nothing__literal -ctrl var __Mission__spaceMission__spacecraft__Battery__activeState : __Mission__spaceMission__spacecraft__Battery__states__type = __Nothing__literal -ctrl var __Mission__spaceMission__station__Main__Operation__ReceiveData__activeState : __Mission__spaceMission__station__Main__Operation__ReceiveData__states__type = __Nothing__literal -ctrl var __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__activeState : __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__states__type = __Nothing__literal -ctrl var __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__activeState : __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__states__type = __Nothing__literal +var $Mission$spaceMission$station$receivedData : integer = 0 +var $Mission$spaceMission$spacecraft$batteryCharge : integer = 100 +var $Mission$spaceMission$spacecraft$recharging : boolean = false +var $Mission$spaceMission$spacecraft$data : integer = 100 +ctrl var $Mission$spaceMission$station$dataEvent$isActive : boolean = false +ctrl var $Mission$spaceMission$station$startEvent$isActive : boolean = false +ctrl var $Mission$spaceMission$station$shutdownEvent$isActive : boolean = false +ctrl var $Mission$spaceMission$station$pingEvent$isActive : boolean = false +var $Mission$spaceMission$station$pingTimeout$remainingTime : integer = 0 +var $Mission$spaceMission$station$startTimeout$remainingTime : integer = 0 +ctrl var $Mission$spaceMission$station$Main$activeState : $Mission$spaceMission$station$Main$states$$type = $Nothing$$literal +ctrl var $Mission$spaceMission$spacecraft$pingEvent$isActive : boolean = false +ctrl var $Mission$spaceMission$spacecraft$dataEvent$isActive : boolean = false +var $Mission$spaceMission$spacecraft$checkBatteryTimeout$remainingTime : integer = 0 +var $Mission$spaceMission$spacecraft$rechargeTimeout$remainingTime : integer = 0 +var $Mission$spaceMission$spacecraft$consumeTimeout$remainingTime : integer = 0 +var $Mission$spaceMission$spacecraft$transmitTimeout$remainingTime : integer = 0 +ctrl var $Mission$spaceMission$spacecraft$Communication$activeState : $Mission$spaceMission$spacecraft$Communication$states$$type = $Nothing$$literal +ctrl var $Mission$spaceMission$spacecraft$Battery$activeState : $Mission$spaceMission$spacecraft$Battery$states$$type = $Nothing$$literal +ctrl var $Mission$spaceMission$station$Main$Operation$ReceiveData$activeState : $Mission$spaceMission$station$Main$Operation$ReceiveData$states$$type = $Nothing$$literal +ctrl var $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState : $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$states$$type = $Nothing$$literal +ctrl var $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState : $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$states$$type = $Nothing$$literal trans { - havoc __Mission__spaceMission__station__startEvent__isActive; - havoc __Mission__spaceMission__station__shutdownEvent__isActive; - __Mission__spaceMission__station__pingEvent__isActive := false; + havoc $Mission$spaceMission$station$startEvent$isActive; + havoc $Mission$spaceMission$station$shutdownEvent$isActive; + $Mission$spaceMission$station$pingEvent$isActive := false; choice { - assume (__Mission__spaceMission__station__startEvent__isActive); - assume ((__Mission__spaceMission__station__Main__activeState == __Mission__spaceMission__station__Main__Idle__literal)); - __Mission__spaceMission__station__Main__activeState := __Nothing__literal; - __Mission__spaceMission__station__Main__activeState := __Mission__spaceMission__station__Main__Operation__literal; - __Mission__spaceMission__station__pingTimeout__remainingTime := 10; - __Mission__spaceMission__station__pingEvent__isActive := true; - __Mission__spaceMission__station__Main__activeState := __Mission__spaceMission__station__Main__Operation__literal; - __Mission__spaceMission__station__pingTimeout__remainingTime := 10; - __Mission__spaceMission__station__pingEvent__isActive := true; - __Mission__spaceMission__station__Main__Operation__ReceiveData__activeState := __Mission__spaceMission__station__Main__Operation__ReceiveData__Waiting__literal; + assume ($Mission$spaceMission$station$startEvent$isActive); + assume (($Mission$spaceMission$station$Main$activeState == $Mission$spaceMission$station$Main$Idle$$literal)); + $Mission$spaceMission$station$Main$activeState := $Nothing$$literal; + $Mission$spaceMission$station$Main$activeState := $Mission$spaceMission$station$Main$Operation$$literal; + $Mission$spaceMission$station$pingTimeout$remainingTime := 10; + $Mission$spaceMission$station$pingEvent$isActive := true; + $Mission$spaceMission$station$Main$activeState := $Mission$spaceMission$station$Main$Operation$$literal; + $Mission$spaceMission$station$pingTimeout$remainingTime := 10; + $Mission$spaceMission$station$pingEvent$isActive := true; + $Mission$spaceMission$station$Main$Operation$ReceiveData$activeState := $Mission$spaceMission$station$Main$Operation$ReceiveData$Waiting$$literal; } or { - assume ((__Mission__spaceMission__station__startTimeout__remainingTime <= 0)); - assume ((__Mission__spaceMission__station__Main__activeState == __Mission__spaceMission__station__Main__Idle__literal)); - __Mission__spaceMission__station__Main__activeState := __Nothing__literal; - __Mission__spaceMission__station__Main__activeState := __Mission__spaceMission__station__Main__Operation__literal; - __Mission__spaceMission__station__pingTimeout__remainingTime := 10; - __Mission__spaceMission__station__pingEvent__isActive := true; - __Mission__spaceMission__station__Main__activeState := __Mission__spaceMission__station__Main__Operation__literal; - __Mission__spaceMission__station__pingTimeout__remainingTime := 10; - __Mission__spaceMission__station__pingEvent__isActive := true; - __Mission__spaceMission__station__Main__Operation__ReceiveData__activeState := __Mission__spaceMission__station__Main__Operation__ReceiveData__Waiting__literal; + assume (($Mission$spaceMission$station$startTimeout$remainingTime <= 0)); + assume (($Mission$spaceMission$station$Main$activeState == $Mission$spaceMission$station$Main$Idle$$literal)); + $Mission$spaceMission$station$Main$activeState := $Nothing$$literal; + $Mission$spaceMission$station$Main$activeState := $Mission$spaceMission$station$Main$Operation$$literal; + $Mission$spaceMission$station$pingTimeout$remainingTime := 10; + $Mission$spaceMission$station$pingEvent$isActive := true; + $Mission$spaceMission$station$Main$activeState := $Mission$spaceMission$station$Main$Operation$$literal; + $Mission$spaceMission$station$pingTimeout$remainingTime := 10; + $Mission$spaceMission$station$pingEvent$isActive := true; + $Mission$spaceMission$station$Main$Operation$ReceiveData$activeState := $Mission$spaceMission$station$Main$Operation$ReceiveData$Waiting$$literal; } or { - assume (__Mission__spaceMission__station__shutdownEvent__isActive); - assume ((__Mission__spaceMission__station__Main__activeState == __Mission__spaceMission__station__Main__Operation__literal)); - __Mission__spaceMission__station__Main__activeState := __Nothing__literal; - if ((__Mission__spaceMission__station__Main__Operation__ReceiveData__activeState == __Mission__spaceMission__station__Main__Operation__ReceiveData__Waiting__literal)) { - __Mission__spaceMission__station__Main__Operation__ReceiveData__activeState := __Nothing__literal; + assume ($Mission$spaceMission$station$shutdownEvent$isActive); + assume (($Mission$spaceMission$station$Main$activeState == $Mission$spaceMission$station$Main$Operation$$literal)); + $Mission$spaceMission$station$Main$activeState := $Nothing$$literal; + if (($Mission$spaceMission$station$Main$Operation$ReceiveData$activeState == $Mission$spaceMission$station$Main$Operation$ReceiveData$Waiting$$literal)) { + $Mission$spaceMission$station$Main$Operation$ReceiveData$activeState := $Nothing$$literal; } - __Mission__spaceMission__station__Main__activeState := __Mission__spaceMission__station__Main__Idle__literal; - __Mission__spaceMission__station__startTimeout__remainingTime := 30; + $Mission$spaceMission$station$Main$activeState := $Mission$spaceMission$station$Main$Idle$$literal; + $Mission$spaceMission$station$startTimeout$remainingTime := 30; } or { - assume ((__Mission__spaceMission__station__pingTimeout__remainingTime <= 0)); - assume ((__Mission__spaceMission__station__Main__activeState == __Mission__spaceMission__station__Main__Operation__literal)); - __Mission__spaceMission__station__Main__activeState := __Nothing__literal; - if ((__Mission__spaceMission__station__Main__Operation__ReceiveData__activeState == __Mission__spaceMission__station__Main__Operation__ReceiveData__Waiting__literal)) { - __Mission__spaceMission__station__Main__Operation__ReceiveData__activeState := __Nothing__literal; + assume (($Mission$spaceMission$station$pingTimeout$remainingTime <= 0)); + assume (($Mission$spaceMission$station$Main$activeState == $Mission$spaceMission$station$Main$Operation$$literal)); + $Mission$spaceMission$station$Main$activeState := $Nothing$$literal; + if (($Mission$spaceMission$station$Main$Operation$ReceiveData$activeState == $Mission$spaceMission$station$Main$Operation$ReceiveData$Waiting$$literal)) { + $Mission$spaceMission$station$Main$Operation$ReceiveData$activeState := $Nothing$$literal; } - __Mission__spaceMission__station__Main__activeState := __Mission__spaceMission__station__Main__Operation__literal; - __Mission__spaceMission__station__pingTimeout__remainingTime := 10; - __Mission__spaceMission__station__pingEvent__isActive := true; - __Mission__spaceMission__station__Main__activeState := __Mission__spaceMission__station__Main__Operation__literal; - __Mission__spaceMission__station__pingTimeout__remainingTime := 10; - __Mission__spaceMission__station__pingEvent__isActive := true; - __Mission__spaceMission__station__Main__Operation__ReceiveData__activeState := __Mission__spaceMission__station__Main__Operation__ReceiveData__Waiting__literal; + $Mission$spaceMission$station$Main$activeState := $Mission$spaceMission$station$Main$Operation$$literal; + $Mission$spaceMission$station$pingTimeout$remainingTime := 10; + $Mission$spaceMission$station$pingEvent$isActive := true; + $Mission$spaceMission$station$Main$activeState := $Mission$spaceMission$station$Main$Operation$$literal; + $Mission$spaceMission$station$pingTimeout$remainingTime := 10; + $Mission$spaceMission$station$pingEvent$isActive := true; + $Mission$spaceMission$station$Main$Operation$ReceiveData$activeState := $Mission$spaceMission$station$Main$Operation$ReceiveData$Waiting$$literal; } or { - assume (! (((((__Mission__spaceMission__station__startEvent__isActive && (__Mission__spaceMission__station__Main__activeState == __Mission__spaceMission__station__Main__Idle__literal)) || ((__Mission__spaceMission__station__startTimeout__remainingTime <= 0) && (__Mission__spaceMission__station__Main__activeState == __Mission__spaceMission__station__Main__Idle__literal))) || ((__Mission__spaceMission__station__shutdownEvent__isActive && (__Mission__spaceMission__station__Main__activeState == __Mission__spaceMission__station__Main__Operation__literal)) && ((__Mission__spaceMission__station__Main__Operation__ReceiveData__activeState == __Mission__spaceMission__station__Main__Operation__ReceiveData__Waiting__literal) || ! ((__Mission__spaceMission__station__Main__Operation__ReceiveData__activeState == __Mission__spaceMission__station__Main__Operation__ReceiveData__Waiting__literal))))) || (((__Mission__spaceMission__station__pingTimeout__remainingTime <= 0) && (__Mission__spaceMission__station__Main__activeState == __Mission__spaceMission__station__Main__Operation__literal)) && ((__Mission__spaceMission__station__Main__Operation__ReceiveData__activeState == __Mission__spaceMission__station__Main__Operation__ReceiveData__Waiting__literal) || ! ((__Mission__spaceMission__station__Main__Operation__ReceiveData__activeState == __Mission__spaceMission__station__Main__Operation__ReceiveData__Waiting__literal))))))); + assume (! ((((($Mission$spaceMission$station$startEvent$isActive && ($Mission$spaceMission$station$Main$activeState == $Mission$spaceMission$station$Main$Idle$$literal)) || (($Mission$spaceMission$station$startTimeout$remainingTime <= 0) && ($Mission$spaceMission$station$Main$activeState == $Mission$spaceMission$station$Main$Idle$$literal))) || (($Mission$spaceMission$station$shutdownEvent$isActive && ($Mission$spaceMission$station$Main$activeState == $Mission$spaceMission$station$Main$Operation$$literal)) && (($Mission$spaceMission$station$Main$Operation$ReceiveData$activeState == $Mission$spaceMission$station$Main$Operation$ReceiveData$Waiting$$literal) || ! (($Mission$spaceMission$station$Main$Operation$ReceiveData$activeState == $Mission$spaceMission$station$Main$Operation$ReceiveData$Waiting$$literal))))) || ((($Mission$spaceMission$station$pingTimeout$remainingTime <= 0) && ($Mission$spaceMission$station$Main$activeState == $Mission$spaceMission$station$Main$Operation$$literal)) && (($Mission$spaceMission$station$Main$Operation$ReceiveData$activeState == $Mission$spaceMission$station$Main$Operation$ReceiveData$Waiting$$literal) || ! (($Mission$spaceMission$station$Main$Operation$ReceiveData$activeState == $Mission$spaceMission$station$Main$Operation$ReceiveData$Waiting$$literal))))))); choice { - assume ((__Mission__spaceMission__station__Main__activeState == __Mission__spaceMission__station__Main__Operation__literal)); + assume (($Mission$spaceMission$station$Main$activeState == $Mission$spaceMission$station$Main$Operation$$literal)); choice { - assume (__Mission__spaceMission__station__dataEvent__isActive); - assume ((__Mission__spaceMission__station__Main__Operation__ReceiveData__activeState == __Mission__spaceMission__station__Main__Operation__ReceiveData__Waiting__literal)); - __Mission__spaceMission__station__Main__Operation__ReceiveData__activeState := __Nothing__literal; - __Mission__spaceMission__station__receivedData := (__Mission__spaceMission__station__receivedData + 10); - __Mission__spaceMission__station__pingEvent__isActive := true; - __Mission__spaceMission__station__Main__Operation__ReceiveData__activeState := __Mission__spaceMission__station__Main__Operation__ReceiveData__Waiting__literal; + assume ($Mission$spaceMission$station$dataEvent$isActive); + assume (($Mission$spaceMission$station$Main$Operation$ReceiveData$activeState == $Mission$spaceMission$station$Main$Operation$ReceiveData$Waiting$$literal)); + $Mission$spaceMission$station$Main$Operation$ReceiveData$activeState := $Nothing$$literal; + $Mission$spaceMission$station$receivedData := ($Mission$spaceMission$station$receivedData + 10); + $Mission$spaceMission$station$pingEvent$isActive := true; + $Mission$spaceMission$station$Main$Operation$ReceiveData$activeState := $Mission$spaceMission$station$Main$Operation$ReceiveData$Waiting$$literal; } or { - assume (! ((__Mission__spaceMission__station__dataEvent__isActive && (__Mission__spaceMission__station__Main__Operation__ReceiveData__activeState == __Mission__spaceMission__station__Main__Operation__ReceiveData__Waiting__literal)))); + assume (! (($Mission$spaceMission$station$dataEvent$isActive && ($Mission$spaceMission$station$Main$Operation$ReceiveData$activeState == $Mission$spaceMission$station$Main$Operation$ReceiveData$Waiting$$literal)))); } } or { - assume (! (((__Mission__spaceMission__station__Main__activeState == __Mission__spaceMission__station__Main__Operation__literal) && ((__Mission__spaceMission__station__dataEvent__isActive && (__Mission__spaceMission__station__Main__Operation__ReceiveData__activeState == __Mission__spaceMission__station__Main__Operation__ReceiveData__Waiting__literal)) || ! ((__Mission__spaceMission__station__dataEvent__isActive && (__Mission__spaceMission__station__Main__Operation__ReceiveData__activeState == __Mission__spaceMission__station__Main__Operation__ReceiveData__Waiting__literal))))))); + assume (! ((($Mission$spaceMission$station$Main$activeState == $Mission$spaceMission$station$Main$Operation$$literal) && (($Mission$spaceMission$station$dataEvent$isActive && ($Mission$spaceMission$station$Main$Operation$ReceiveData$activeState == $Mission$spaceMission$station$Main$Operation$ReceiveData$Waiting$$literal)) || ! (($Mission$spaceMission$station$dataEvent$isActive && ($Mission$spaceMission$station$Main$Operation$ReceiveData$activeState == $Mission$spaceMission$station$Main$Operation$ReceiveData$Waiting$$literal))))))); } } - __Mission__spaceMission__station__dataEvent__isActive := false; - __Mission__spaceMission__station__startEvent__isActive := false; - __Mission__spaceMission__station__shutdownEvent__isActive := false; - __Mission__spaceMission__spacecraft__dataEvent__isActive := false; + $Mission$spaceMission$station$dataEvent$isActive := false; + $Mission$spaceMission$station$startEvent$isActive := false; + $Mission$spaceMission$station$shutdownEvent$isActive := false; + $Mission$spaceMission$spacecraft$dataEvent$isActive := false; choice { - assume (((__Mission__spaceMission__spacecraft__recharging == false) && ! (((__Mission__spaceMission__spacecraft__data <= 0) || (__Mission__spaceMission__spacecraft__batteryCharge < 40))))); - assume (__Mission__spaceMission__spacecraft__pingEvent__isActive); - assume ((__Mission__spaceMission__spacecraft__Communication__activeState == __Mission__spaceMission__spacecraft__Communication__WaitingPing__literal)); - __Mission__spaceMission__spacecraft__Communication__activeState := __Nothing__literal; - __Mission__spaceMission__spacecraft__Communication__activeState := __Mission__spaceMission__spacecraft__Communication__Transmitting__literal; - __Mission__spaceMission__spacecraft__Communication__activeState := __Mission__spaceMission__spacecraft__Communication__Transmitting__literal; - __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__activeState := __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__Sending__literal; - __Mission__spaceMission__spacecraft__transmitTimeout__remainingTime := 4; - __Mission__spaceMission__spacecraft__Communication__activeState := __Mission__spaceMission__spacecraft__Communication__Transmitting__literal; - __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__activeState := __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__Consuming__literal; - __Mission__spaceMission__spacecraft__consumeTimeout__remainingTime := 2; + assume ((($Mission$spaceMission$spacecraft$recharging == false) && ! ((($Mission$spaceMission$spacecraft$data <= 0) || ($Mission$spaceMission$spacecraft$batteryCharge < 40))))); + assume ($Mission$spaceMission$spacecraft$pingEvent$isActive); + assume (($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$WaitingPing$$literal)); + $Mission$spaceMission$spacecraft$Communication$activeState := $Nothing$$literal; + $Mission$spaceMission$spacecraft$Communication$activeState := $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal; + $Mission$spaceMission$spacecraft$Communication$activeState := $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal; + $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState := $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal; + $Mission$spaceMission$spacecraft$transmitTimeout$remainingTime := 4; + $Mission$spaceMission$spacecraft$Communication$activeState := $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal; + $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState := $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal; + $Mission$spaceMission$spacecraft$consumeTimeout$remainingTime := 2; } or { - assume ((__Mission__spaceMission__spacecraft__batteryCharge < 40)); - assume ((__Mission__spaceMission__spacecraft__consumeTimeout__remainingTime <= 0)); - assume ((__Mission__spaceMission__spacecraft__Communication__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__literal)); - __Mission__spaceMission__spacecraft__Communication__activeState := __Nothing__literal; - if ((__Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__Sending__literal)) { - __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__activeState := __Nothing__literal; + assume (($Mission$spaceMission$spacecraft$batteryCharge < 40)); + assume (($Mission$spaceMission$spacecraft$consumeTimeout$remainingTime <= 0)); + assume (($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal)); + $Mission$spaceMission$spacecraft$Communication$activeState := $Nothing$$literal; + if (($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal)) { + $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState := $Nothing$$literal; } - if ((__Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__Consuming__literal)) { - __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__activeState := __Nothing__literal; + if (($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal)) { + $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState := $Nothing$$literal; } - __Mission__spaceMission__spacecraft__Communication__activeState := __Mission__spaceMission__spacecraft__Communication__WaitingPing__literal; + $Mission$spaceMission$spacecraft$Communication$activeState := $Mission$spaceMission$spacecraft$Communication$WaitingPing$$literal; } or { - assume (((__Mission__spaceMission__spacecraft__data <= 0) || (__Mission__spaceMission__spacecraft__batteryCharge < 40))); - assume ((__Mission__spaceMission__spacecraft__transmitTimeout__remainingTime <= 0)); - assume ((__Mission__spaceMission__spacecraft__Communication__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__literal)); - __Mission__spaceMission__spacecraft__Communication__activeState := __Nothing__literal; - if ((__Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__Sending__literal)) { - __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__activeState := __Nothing__literal; + assume ((($Mission$spaceMission$spacecraft$data <= 0) || ($Mission$spaceMission$spacecraft$batteryCharge < 40))); + assume (($Mission$spaceMission$spacecraft$transmitTimeout$remainingTime <= 0)); + assume (($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal)); + $Mission$spaceMission$spacecraft$Communication$activeState := $Nothing$$literal; + if (($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal)) { + $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState := $Nothing$$literal; } - if ((__Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__Consuming__literal)) { - __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__activeState := __Nothing__literal; + if (($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal)) { + $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState := $Nothing$$literal; } - __Mission__spaceMission__spacecraft__Communication__activeState := __Mission__spaceMission__spacecraft__Communication__WaitingPing__literal; + $Mission$spaceMission$spacecraft$Communication$activeState := $Mission$spaceMission$spacecraft$Communication$WaitingPing$$literal; } or { - assume (! (((((((__Mission__spaceMission__spacecraft__recharging == false) && ! (((__Mission__spaceMission__spacecraft__data <= 0) || (__Mission__spaceMission__spacecraft__batteryCharge < 40)))) && __Mission__spaceMission__spacecraft__pingEvent__isActive) && (__Mission__spaceMission__spacecraft__Communication__activeState == __Mission__spaceMission__spacecraft__Communication__WaitingPing__literal)) || ((((__Mission__spaceMission__spacecraft__batteryCharge < 40) && (__Mission__spaceMission__spacecraft__consumeTimeout__remainingTime <= 0)) && (__Mission__spaceMission__spacecraft__Communication__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__literal)) && (((__Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__Sending__literal) || ! ((__Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__Sending__literal))) && ((__Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__Consuming__literal) || ! ((__Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__Consuming__literal)))))) || (((((__Mission__spaceMission__spacecraft__data <= 0) || (__Mission__spaceMission__spacecraft__batteryCharge < 40)) && (__Mission__spaceMission__spacecraft__transmitTimeout__remainingTime <= 0)) && (__Mission__spaceMission__spacecraft__Communication__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__literal)) && (((__Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__Sending__literal) || ! ((__Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__Sending__literal))) && ((__Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__Consuming__literal) || ! ((__Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__Consuming__literal)))))))); + assume (! ((((((($Mission$spaceMission$spacecraft$recharging == false) && ! ((($Mission$spaceMission$spacecraft$data <= 0) || ($Mission$spaceMission$spacecraft$batteryCharge < 40)))) && $Mission$spaceMission$spacecraft$pingEvent$isActive) && ($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$WaitingPing$$literal)) || (((($Mission$spaceMission$spacecraft$batteryCharge < 40) && ($Mission$spaceMission$spacecraft$consumeTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal)) && ((($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal) || ! (($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal))) && (($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal) || ! (($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal)))))) || ((((($Mission$spaceMission$spacecraft$data <= 0) || ($Mission$spaceMission$spacecraft$batteryCharge < 40)) && ($Mission$spaceMission$spacecraft$transmitTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal)) && ((($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal) || ! (($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal))) && (($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal) || ! (($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal)))))))); choice { - assume ((__Mission__spaceMission__spacecraft__Communication__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__literal)); + assume (($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal)); choice { - assume (! (((__Mission__spaceMission__spacecraft__data <= 0) || (__Mission__spaceMission__spacecraft__batteryCharge < 40)))); - assume ((__Mission__spaceMission__spacecraft__transmitTimeout__remainingTime <= 0)); - assume ((__Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__Sending__literal)); - __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__activeState := __Nothing__literal; - __Mission__spaceMission__spacecraft__data := (__Mission__spaceMission__spacecraft__data - 10); - __Mission__spaceMission__spacecraft__dataEvent__isActive := true; - __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__activeState := __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__Sending__literal; - __Mission__spaceMission__spacecraft__transmitTimeout__remainingTime := 4; + assume (! ((($Mission$spaceMission$spacecraft$data <= 0) || ($Mission$spaceMission$spacecraft$batteryCharge < 40)))); + assume (($Mission$spaceMission$spacecraft$transmitTimeout$remainingTime <= 0)); + assume (($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal)); + $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState := $Nothing$$literal; + $Mission$spaceMission$spacecraft$data := ($Mission$spaceMission$spacecraft$data - 10); + $Mission$spaceMission$spacecraft$dataEvent$isActive := true; + $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState := $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal; + $Mission$spaceMission$spacecraft$transmitTimeout$remainingTime := 4; } or { - assume (! (((! (((__Mission__spaceMission__spacecraft__data <= 0) || (__Mission__spaceMission__spacecraft__batteryCharge < 40))) && (__Mission__spaceMission__spacecraft__transmitTimeout__remainingTime <= 0)) && (__Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__Sending__literal)))); + assume (! (((! ((($Mission$spaceMission$spacecraft$data <= 0) || ($Mission$spaceMission$spacecraft$batteryCharge < 40))) && ($Mission$spaceMission$spacecraft$transmitTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal)))); } choice { - assume (! ((__Mission__spaceMission__spacecraft__batteryCharge < 40))); - assume ((__Mission__spaceMission__spacecraft__consumeTimeout__remainingTime <= 0)); - assume ((__Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__Consuming__literal)); - __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__activeState := __Nothing__literal; - __Mission__spaceMission__spacecraft__batteryCharge := (__Mission__spaceMission__spacecraft__batteryCharge - 10); - __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__activeState := __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__Consuming__literal; - __Mission__spaceMission__spacecraft__consumeTimeout__remainingTime := 2; + assume (! (($Mission$spaceMission$spacecraft$batteryCharge < 40))); + assume (($Mission$spaceMission$spacecraft$consumeTimeout$remainingTime <= 0)); + assume (($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal)); + $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState := $Nothing$$literal; + $Mission$spaceMission$spacecraft$batteryCharge := ($Mission$spaceMission$spacecraft$batteryCharge - 10); + $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState := $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal; + $Mission$spaceMission$spacecraft$consumeTimeout$remainingTime := 2; } or { - assume (! (((! ((__Mission__spaceMission__spacecraft__batteryCharge < 40)) && (__Mission__spaceMission__spacecraft__consumeTimeout__remainingTime <= 0)) && (__Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__Consuming__literal)))); + assume (! (((! (($Mission$spaceMission$spacecraft$batteryCharge < 40)) && ($Mission$spaceMission$spacecraft$consumeTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal)))); } } or { - assume (! (((__Mission__spaceMission__spacecraft__Communication__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__literal) && ((((! (((__Mission__spaceMission__spacecraft__data <= 0) || (__Mission__spaceMission__spacecraft__batteryCharge < 40))) && (__Mission__spaceMission__spacecraft__transmitTimeout__remainingTime <= 0)) && (__Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__Sending__literal)) || ! (((! (((__Mission__spaceMission__spacecraft__data <= 0) || (__Mission__spaceMission__spacecraft__batteryCharge < 40))) && (__Mission__spaceMission__spacecraft__transmitTimeout__remainingTime <= 0)) && (__Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__SendData__Sending__literal)))) && (((! ((__Mission__spaceMission__spacecraft__batteryCharge < 40)) && (__Mission__spaceMission__spacecraft__consumeTimeout__remainingTime <= 0)) && (__Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__Consuming__literal)) || ! (((! ((__Mission__spaceMission__spacecraft__batteryCharge < 40)) && (__Mission__spaceMission__spacecraft__consumeTimeout__remainingTime <= 0)) && (__Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__activeState == __Mission__spaceMission__spacecraft__Communication__Transmitting__ConsumePower__Consuming__literal)))))))); + assume (! ((($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal) && ((((! ((($Mission$spaceMission$spacecraft$data <= 0) || ($Mission$spaceMission$spacecraft$batteryCharge < 40))) && ($Mission$spaceMission$spacecraft$transmitTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal)) || ! (((! ((($Mission$spaceMission$spacecraft$data <= 0) || ($Mission$spaceMission$spacecraft$batteryCharge < 40))) && ($Mission$spaceMission$spacecraft$transmitTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal)))) && (((! (($Mission$spaceMission$spacecraft$batteryCharge < 40)) && ($Mission$spaceMission$spacecraft$consumeTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal)) || ! (((! (($Mission$spaceMission$spacecraft$batteryCharge < 40)) && ($Mission$spaceMission$spacecraft$consumeTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal)))))))); } } choice { - assume ((__Mission__spaceMission__spacecraft__batteryCharge < 80)); - assume ((__Mission__spaceMission__spacecraft__checkBatteryTimeout__remainingTime <= 0)); - assume ((__Mission__spaceMission__spacecraft__Battery__activeState == __Mission__spaceMission__spacecraft__Battery__NotRecharging__literal)); - __Mission__spaceMission__spacecraft__Battery__activeState := __Nothing__literal; - __Mission__spaceMission__spacecraft__Battery__activeState := __Mission__spaceMission__spacecraft__Battery__Recharging__literal; - __Mission__spaceMission__spacecraft__rechargeTimeout__remainingTime := 3; - __Mission__spaceMission__spacecraft__recharging := true; + assume (($Mission$spaceMission$spacecraft$batteryCharge < 80)); + assume (($Mission$spaceMission$spacecraft$checkBatteryTimeout$remainingTime <= 0)); + assume (($Mission$spaceMission$spacecraft$Battery$activeState == $Mission$spaceMission$spacecraft$Battery$NotRecharging$$literal)); + $Mission$spaceMission$spacecraft$Battery$activeState := $Nothing$$literal; + $Mission$spaceMission$spacecraft$Battery$activeState := $Mission$spaceMission$spacecraft$Battery$Recharging$$literal; + $Mission$spaceMission$spacecraft$rechargeTimeout$remainingTime := 3; + $Mission$spaceMission$spacecraft$recharging := true; } or { - assume ((__Mission__spaceMission__spacecraft__batteryCharge < 100)); - assume ((__Mission__spaceMission__spacecraft__rechargeTimeout__remainingTime <= 0)); - assume ((__Mission__spaceMission__spacecraft__Battery__activeState == __Mission__spaceMission__spacecraft__Battery__Recharging__literal)); - __Mission__spaceMission__spacecraft__Battery__activeState := __Nothing__literal; - __Mission__spaceMission__spacecraft__batteryCharge := (__Mission__spaceMission__spacecraft__batteryCharge + 10); - __Mission__spaceMission__spacecraft__Battery__activeState := __Mission__spaceMission__spacecraft__Battery__Recharging__literal; - __Mission__spaceMission__spacecraft__rechargeTimeout__remainingTime := 3; - __Mission__spaceMission__spacecraft__recharging := true; + assume (($Mission$spaceMission$spacecraft$batteryCharge < 100)); + assume (($Mission$spaceMission$spacecraft$rechargeTimeout$remainingTime <= 0)); + assume (($Mission$spaceMission$spacecraft$Battery$activeState == $Mission$spaceMission$spacecraft$Battery$Recharging$$literal)); + $Mission$spaceMission$spacecraft$Battery$activeState := $Nothing$$literal; + $Mission$spaceMission$spacecraft$batteryCharge := ($Mission$spaceMission$spacecraft$batteryCharge + 10); + $Mission$spaceMission$spacecraft$Battery$activeState := $Mission$spaceMission$spacecraft$Battery$Recharging$$literal; + $Mission$spaceMission$spacecraft$rechargeTimeout$remainingTime := 3; + $Mission$spaceMission$spacecraft$recharging := true; } or { - assume ((__Mission__spaceMission__spacecraft__batteryCharge >= 100)); - assume ((__Mission__spaceMission__spacecraft__rechargeTimeout__remainingTime <= 0)); - assume ((__Mission__spaceMission__spacecraft__Battery__activeState == __Mission__spaceMission__spacecraft__Battery__Recharging__literal)); - __Mission__spaceMission__spacecraft__Battery__activeState := __Nothing__literal; - __Mission__spaceMission__spacecraft__Battery__activeState := __Mission__spaceMission__spacecraft__Battery__NotRecharging__literal; - __Mission__spaceMission__spacecraft__checkBatteryTimeout__remainingTime := 3; - __Mission__spaceMission__spacecraft__recharging := false; + assume (($Mission$spaceMission$spacecraft$batteryCharge >= 100)); + assume (($Mission$spaceMission$spacecraft$rechargeTimeout$remainingTime <= 0)); + assume (($Mission$spaceMission$spacecraft$Battery$activeState == $Mission$spaceMission$spacecraft$Battery$Recharging$$literal)); + $Mission$spaceMission$spacecraft$Battery$activeState := $Nothing$$literal; + $Mission$spaceMission$spacecraft$Battery$activeState := $Mission$spaceMission$spacecraft$Battery$NotRecharging$$literal; + $Mission$spaceMission$spacecraft$checkBatteryTimeout$remainingTime := 3; + $Mission$spaceMission$spacecraft$recharging := false; } or { - assume (! ((((((__Mission__spaceMission__spacecraft__batteryCharge < 80) && (__Mission__spaceMission__spacecraft__checkBatteryTimeout__remainingTime <= 0)) && (__Mission__spaceMission__spacecraft__Battery__activeState == __Mission__spaceMission__spacecraft__Battery__NotRecharging__literal)) || (((__Mission__spaceMission__spacecraft__batteryCharge < 100) && (__Mission__spaceMission__spacecraft__rechargeTimeout__remainingTime <= 0)) && (__Mission__spaceMission__spacecraft__Battery__activeState == __Mission__spaceMission__spacecraft__Battery__Recharging__literal))) || (((__Mission__spaceMission__spacecraft__batteryCharge >= 100) && (__Mission__spaceMission__spacecraft__rechargeTimeout__remainingTime <= 0)) && (__Mission__spaceMission__spacecraft__Battery__activeState == __Mission__spaceMission__spacecraft__Battery__Recharging__literal))))); + assume (! (((((($Mission$spaceMission$spacecraft$batteryCharge < 80) && ($Mission$spaceMission$spacecraft$checkBatteryTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Battery$activeState == $Mission$spaceMission$spacecraft$Battery$NotRecharging$$literal)) || ((($Mission$spaceMission$spacecraft$batteryCharge < 100) && ($Mission$spaceMission$spacecraft$rechargeTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Battery$activeState == $Mission$spaceMission$spacecraft$Battery$Recharging$$literal))) || ((($Mission$spaceMission$spacecraft$batteryCharge >= 100) && ($Mission$spaceMission$spacecraft$rechargeTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Battery$activeState == $Mission$spaceMission$spacecraft$Battery$Recharging$$literal))))); } - __Mission__spaceMission__spacecraft__pingEvent__isActive := false; - if (__Mission__spaceMission__station__pingEvent__isActive) { - __Mission__spaceMission__spacecraft__pingEvent__isActive := true; + $Mission$spaceMission$spacecraft$pingEvent$isActive := false; + if ($Mission$spaceMission$station$pingEvent$isActive) { + $Mission$spaceMission$spacecraft$pingEvent$isActive := true; } - if (__Mission__spaceMission__spacecraft__dataEvent__isActive) { - __Mission__spaceMission__station__dataEvent__isActive := true; + if ($Mission$spaceMission$spacecraft$dataEvent$isActive) { + $Mission$spaceMission$station$dataEvent$isActive := true; } - if ((__Mission__spaceMission__station__pingTimeout__remainingTime > 0)) { - __Mission__spaceMission__station__pingTimeout__remainingTime := (__Mission__spaceMission__station__pingTimeout__remainingTime - 1); + if (($Mission$spaceMission$station$pingTimeout$remainingTime > 0)) { + $Mission$spaceMission$station$pingTimeout$remainingTime := ($Mission$spaceMission$station$pingTimeout$remainingTime - 1); } - if ((__Mission__spaceMission__station__startTimeout__remainingTime > 0)) { - __Mission__spaceMission__station__startTimeout__remainingTime := (__Mission__spaceMission__station__startTimeout__remainingTime - 1); + if (($Mission$spaceMission$station$startTimeout$remainingTime > 0)) { + $Mission$spaceMission$station$startTimeout$remainingTime := ($Mission$spaceMission$station$startTimeout$remainingTime - 1); } - if ((__Mission__spaceMission__spacecraft__checkBatteryTimeout__remainingTime > 0)) { - __Mission__spaceMission__spacecraft__checkBatteryTimeout__remainingTime := (__Mission__spaceMission__spacecraft__checkBatteryTimeout__remainingTime - 1); + if (($Mission$spaceMission$spacecraft$checkBatteryTimeout$remainingTime > 0)) { + $Mission$spaceMission$spacecraft$checkBatteryTimeout$remainingTime := ($Mission$spaceMission$spacecraft$checkBatteryTimeout$remainingTime - 1); } - if ((__Mission__spaceMission__spacecraft__rechargeTimeout__remainingTime > 0)) { - __Mission__spaceMission__spacecraft__rechargeTimeout__remainingTime := (__Mission__spaceMission__spacecraft__rechargeTimeout__remainingTime - 1); + if (($Mission$spaceMission$spacecraft$rechargeTimeout$remainingTime > 0)) { + $Mission$spaceMission$spacecraft$rechargeTimeout$remainingTime := ($Mission$spaceMission$spacecraft$rechargeTimeout$remainingTime - 1); } - if ((__Mission__spaceMission__spacecraft__consumeTimeout__remainingTime > 0)) { - __Mission__spaceMission__spacecraft__consumeTimeout__remainingTime := (__Mission__spaceMission__spacecraft__consumeTimeout__remainingTime - 1); + if (($Mission$spaceMission$spacecraft$consumeTimeout$remainingTime > 0)) { + $Mission$spaceMission$spacecraft$consumeTimeout$remainingTime := ($Mission$spaceMission$spacecraft$consumeTimeout$remainingTime - 1); } - if ((__Mission__spaceMission__spacecraft__transmitTimeout__remainingTime > 0)) { - __Mission__spaceMission__spacecraft__transmitTimeout__remainingTime := (__Mission__spaceMission__spacecraft__transmitTimeout__remainingTime - 1); + if (($Mission$spaceMission$spacecraft$transmitTimeout$remainingTime > 0)) { + $Mission$spaceMission$spacecraft$transmitTimeout$remainingTime := ($Mission$spaceMission$spacecraft$transmitTimeout$remainingTime - 1); } } init { - __Mission__spaceMission__station__Main__activeState := __Mission__spaceMission__station__Main__Idle__literal; - __Mission__spaceMission__station__startTimeout__remainingTime := 30; - __Mission__spaceMission__spacecraft__Communication__activeState := __Mission__spaceMission__spacecraft__Communication__WaitingPing__literal; - __Mission__spaceMission__spacecraft__Battery__activeState := __Mission__spaceMission__spacecraft__Battery__NotRecharging__literal; - __Mission__spaceMission__spacecraft__checkBatteryTimeout__remainingTime := 3; - __Mission__spaceMission__spacecraft__recharging := false; + $Mission$spaceMission$station$Main$activeState := $Mission$spaceMission$station$Main$Idle$$literal; + $Mission$spaceMission$station$startTimeout$remainingTime := 30; + $Mission$spaceMission$spacecraft$Communication$activeState := $Mission$spaceMission$spacecraft$Communication$WaitingPing$$literal; + $Mission$spaceMission$spacecraft$Battery$activeState := $Mission$spaceMission$spacecraft$Battery$NotRecharging$$literal; + $Mission$spaceMission$spacecraft$checkBatteryTimeout$remainingTime := 3; + $Mission$spaceMission$spacecraft$recharging := false; } env {} diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Feature/FeatureRedefinition/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Feature/FeatureRedefinition/expected.xsts index 0532bff..2183c47 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Feature/FeatureRedefinition/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Feature/FeatureRedefinition/expected.xsts @@ -5,10 +5,10 @@ */ -var __Mission__x : boolean +var $Mission$x : boolean trans { - __Mission__x := true; + $Mission$x := true; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Feature/FeatureSubseting/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Feature/FeatureSubseting/expected.xsts index 0532bff..2183c47 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Feature/FeatureSubseting/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Feature/FeatureSubseting/expected.xsts @@ -5,10 +5,10 @@ */ -var __Mission__x : boolean +var $Mission$x : boolean trans { - __Mission__x := true; + $Mission$x := true; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Feature/ReferenceSubseting/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Feature/ReferenceSubseting/expected.xsts index 0532bff..2183c47 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Feature/ReferenceSubseting/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Feature/ReferenceSubseting/expected.xsts @@ -5,10 +5,10 @@ */ -var __Mission__x : boolean +var $Mission$x : boolean trans { - __Mission__x := true; + $Mission$x := true; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/MultipleVariables/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/MultipleVariables/expected.xsts index 673a679..1c37995 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/MultipleVariables/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/MultipleVariables/expected.xsts @@ -4,26 +4,26 @@ * SPDX-License-Identifier: EPL-2.0 */ -type __Mission__holder__atom__type : { - __Mission__holder__a__literal, - __Mission__holder__b__literal, - __Mission__holder__c__literal, - __Nothing__literal +type $Mission$holder$atom$$type : { + $Mission$holder$a$$literal, + $Mission$holder$b$$literal, + $Mission$holder$c$$literal, + $Nothing$$literal } -var __Mission__holder__current : __Mission__holder__atom__type = __Nothing__literal -var __Mission__holder__currentTwo : __Mission__holder__atom__type = __Nothing__literal +var $Mission$holder$current : $Mission$holder$atom$$type = $Nothing$$literal +var $Mission$holder$currentTwo : $Mission$holder$atom$$type = $Nothing$$literal trans { - __Mission__holder__current := __Mission__holder__b__literal; + $Mission$holder$current := $Mission$holder$b$$literal; } init { - __Mission__holder__current := __Mission__holder__a__literal; + $Mission$holder$current := $Mission$holder$a$$literal; } env {} prop { - (__Mission__holder__current != __Mission__holder__b__literal) + ($Mission$holder$current != $Mission$holder$b$$literal) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/MultipleVariablesDifferentFeature/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/MultipleVariablesDifferentFeature/expected.xsts index 26598f8..83dd280 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/MultipleVariablesDifferentFeature/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/MultipleVariablesDifferentFeature/expected.xsts @@ -4,33 +4,33 @@ * SPDX-License-Identifier: EPL-2.0 */ -type __Mission__holder__atom__type : { - __Mission__holder__a__literal, - __Mission__holder__b__literal, - __Mission__holder__c__literal, - __Nothing__literal +type $Mission$holder$atom$$type : { + $Mission$holder$a$$literal, + $Mission$holder$b$$literal, + $Mission$holder$c$$literal, + $Nothing$$literal } -type __Mission__holder2__atom__type : { - __Mission__holder2__a__literal, - __Mission__holder2__b__literal, - __Mission__holder2__c__literal, - __Nothing__literal +type $Mission$holder2$atom$$type : { + $Mission$holder2$a$$literal, + $Mission$holder2$b$$literal, + $Mission$holder2$c$$literal, + $Nothing$$literal } -var __Mission__holder__current : __Mission__holder__atom__type = __Nothing__literal -var __Mission__holder2__current : __Mission__holder2__atom__type = __Nothing__literal +var $Mission$holder$current : $Mission$holder$atom$$type = $Nothing$$literal +var $Mission$holder2$current : $Mission$holder2$atom$$type = $Nothing$$literal trans { - __Mission__holder__current := __Mission__holder__b__literal; - __Mission__holder2__current := __Mission__holder2__a__literal; + $Mission$holder$current := $Mission$holder$b$$literal; + $Mission$holder2$current := $Mission$holder2$a$$literal; } init { - __Mission__holder__current := __Mission__holder__a__literal; + $Mission$holder$current := $Mission$holder$a$$literal; } env {} prop { - (__Mission__holder__current != __Mission__holder__b__literal) + ($Mission$holder$current != $Mission$holder$b$$literal) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/SingleVariable/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/SingleVariable/expected.xsts index f8772e1..4fb9155 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/SingleVariable/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/SingleVariable/expected.xsts @@ -4,24 +4,24 @@ * SPDX-License-Identifier: EPL-2.0 */ -type __Mission__holder__atom__type : { - __Mission__holder__a__literal, - __Mission__holder__b__literal, - __Mission__holder__c__literal +type $Mission$holder$atom$$type : { + $Mission$holder$a$$literal, + $Mission$holder$b$$literal, + $Mission$holder$c$$literal } -var __Mission__holder__current : __Mission__holder__atom__type +var $Mission$holder$current : $Mission$holder$atom$$type trans { - __Mission__holder__current := __Mission__holder__b__literal; + $Mission$holder$current := $Mission$holder$b$$literal; } init { - __Mission__holder__current := __Mission__holder__a__literal; + $Mission$holder$current := $Mission$holder$a$$literal; } env {} prop { - (__Mission__holder__current != __Mission__holder__b__literal) + ($Mission$holder$current != $Mission$holder$b$$literal) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/VariableWithNothing/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/VariableWithNothing/expected.xsts index f9068ca..e19c205 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/VariableWithNothing/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/VariableWithNothing/expected.xsts @@ -4,25 +4,25 @@ * SPDX-License-Identifier: EPL-2.0 */ -type __Mission__holder__atom__type : { - __Mission__holder__a__literal, - __Mission__holder__b__literal, - __Mission__holder__c__literal, - __Nothing__literal +type $Mission$holder$atom$$type : { + $Mission$holder$a$$literal, + $Mission$holder$b$$literal, + $Mission$holder$c$$literal, + $Nothing$$literal } -var __Mission__holder__current : __Mission__holder__atom__type +var $Mission$holder$current : $Mission$holder$atom$$type trans { - __Mission__holder__current := __Mission__holder__b__literal; + $Mission$holder$current := $Mission$holder$b$$literal; } init { - __Mission__holder__current := __Nothing__literal; + $Mission$holder$current := $Nothing$$literal; } env {} prop { - (__Mission__holder__current != __Mission__holder__b__literal) + ($Mission$holder$current != $Mission$holder$b$$literal) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/VariableWithNothingExpression/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/VariableWithNothingExpression/expected.xsts index 9588c62..4955ec0 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/VariableWithNothingExpression/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/FeatureTyping/VariableWithNothingExpression/expected.xsts @@ -4,25 +4,25 @@ * SPDX-License-Identifier: EPL-2.0 */ -type __Mission__holder__atom__type : { - __Mission__holder__a__literal, - __Mission__holder__b__literal, - __Mission__holder__c__literal, - __Nothing__literal +type $Mission$holder$atom$$type : { + $Mission$holder$a$$literal, + $Mission$holder$b$$literal, + $Mission$holder$c$$literal, + $Nothing$$literal } -var __Mission__holder__current : __Mission__holder__atom__type = __Nothing__literal +var $Mission$holder$current : $Mission$holder$atom$$type = $Nothing$$literal trans { - __Mission__holder__current := __Mission__holder__b__literal; + $Mission$holder$current := $Mission$holder$b$$literal; } init { - __Mission__holder__current := __Nothing__literal; + $Mission$holder$current := $Nothing$$literal; } env {} prop { - (__Mission__holder__current != __Mission__holder__b__literal) + ($Mission$holder$current != $Mission$holder$b$$literal) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Import/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Import/expected.xsts index 5ead21f..0b9eaf7 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Import/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Import/expected.xsts @@ -5,8 +5,8 @@ */ -var __Mission__c__i : integer -var __Mission__d__i : integer +var $Mission$c$i : integer +var $Mission$d$i : integer trans { } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/BaseTypeFeature/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/BaseTypeFeature/expected.xsts index 9146e62..81b045c 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/BaseTypeFeature/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/BaseTypeFeature/expected.xsts @@ -5,10 +5,10 @@ */ -var __Mission__holder__child__x : integer +var $Mission$holder$child$x : integer trans { - __Mission__holder__child__x := 10; + $Mission$holder$child$x := 10; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/ChildTypeFeature/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/ChildTypeFeature/expected.xsts index 9146e62..81b045c 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/ChildTypeFeature/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/ChildTypeFeature/expected.xsts @@ -5,10 +5,10 @@ */ -var __Mission__holder__child__x : integer +var $Mission$holder$child$x : integer trans { - __Mission__holder__child__x := 10; + $Mission$holder$child$x := 10; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/MultipleOverrides/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/MultipleOverrides/expected.xsts index 7be2862..97c6551 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/MultipleOverrides/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/MultipleOverrides/expected.xsts @@ -5,10 +5,10 @@ */ -var __Mission__holder__child__x : integer +var $Mission$holder$child$x : integer trans { - __Mission__holder__child__x := 30; + $Mission$holder$child$x := 30; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/MultipleTypes/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/MultipleTypes/expected.xsts index 22acc20..d363660 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/MultipleTypes/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/MultipleTypes/expected.xsts @@ -5,10 +5,10 @@ */ -var __Mission__holder__child__x : integer +var $Mission$holder$child$x : integer trans { - __Mission__holder__child__x := 0; + $Mission$holder$child$x := 0; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/NonVirtualTransformationIsNotOverridden/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/NonVirtualTransformationIsNotOverridden/expected.xsts index 9146e62..81b045c 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/NonVirtualTransformationIsNotOverridden/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/NonVirtualTransformationIsNotOverridden/expected.xsts @@ -5,10 +5,10 @@ */ -var __Mission__holder__child__x : integer +var $Mission$holder$child$x : integer trans { - __Mission__holder__child__x := 10; + $Mission$holder$child$x := 10; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/VirtualTransformationIsOverridden/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/VirtualTransformationIsOverridden/expected.xsts index 9146e62..81b045c 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/VirtualTransformationIsOverridden/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Inheritance/VirtualTransformationIsOverridden/expected.xsts @@ -5,10 +5,10 @@ */ -var __Mission__holder__child__x : integer +var $Mission$holder$child$x : integer trans { - __Mission__holder__child__x := 10; + $Mission$holder$child$x := 10; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/Arguments/Boolean/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/Arguments/Boolean/expected.xsts index 3f0fb80..df3c45e 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/Arguments/Boolean/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/Arguments/Boolean/expected.xsts @@ -5,18 +5,18 @@ */ -var __Mission__a__x : boolean +var $Mission$a$x : boolean trans { - __Mission__a__x := true; + $Mission$a$x := true; } init { - __Mission__a__x := false; + $Mission$a$x := false; } env {} prop { - (__Mission__a__x != true) + ($Mission$a$x != true) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/Arguments/Integer/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/Arguments/Integer/expected.xsts index 9adb3f2..32609d9 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/Arguments/Integer/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/Arguments/Integer/expected.xsts @@ -5,18 +5,18 @@ */ -var __Mission__a__x : integer +var $Mission$a$x : integer trans { - __Mission__a__x := 10; + $Mission$a$x := 10; } init { - __Mission__a__x := 0; + $Mission$a$x := 0; } env {} prop { - (__Mission__a__x != 10) + ($Mission$a$x != 10) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineCallOfMultipleTransitions/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineCallOfMultipleTransitions/expected.xsts index 336f6ed..ad8e6d2 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineCallOfMultipleTransitions/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineCallOfMultipleTransitions/expected.xsts @@ -5,22 +5,22 @@ */ -var __Mission__a__x : integer +var $Mission$a$x : integer trans { choice { - __Mission__a__x := (__Mission__a__x + 1); + $Mission$a$x := ($Mission$a$x + 1); } or { - __Mission__a__x := (__Mission__a__x - 1); + $Mission$a$x := ($Mission$a$x - 1); } } init { - __Mission__a__x := 0; + $Mission$a$x := 0; } env {} prop { - (__Mission__a__x != 10) + ($Mission$a$x != 10) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineCallWithParameters/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineCallWithParameters/expected.xsts index 2e1b77d..41a70a7 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineCallWithParameters/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineCallWithParameters/expected.xsts @@ -5,10 +5,10 @@ */ -var __Mission__holder__x : integer +var $Mission$holder$x : integer trans { - __Mission__holder__x := 10; + $Mission$holder$x := 10; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineCompositeChoice/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineCompositeChoice/expected.xsts index 73d6bb9..e0eb108 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineCompositeChoice/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineCompositeChoice/expected.xsts @@ -5,14 +5,14 @@ */ -var __Mission__composite__a__x : integer -var __Mission__composite__b__x : integer +var $Mission$composite$a$x : integer +var $Mission$composite$b$x : integer trans { choice { - __Mission__composite__a__x := (__Mission__composite__a__x + 1); + $Mission$composite$a$x := ($Mission$composite$a$x + 1); } or { - __Mission__composite__b__x := (__Mission__composite__b__x + 1); + $Mission$composite$b$x := ($Mission$composite$b$x + 1); } } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineCompositeSequence/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineCompositeSequence/expected.xsts index 46b649e..4afb821 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineCompositeSequence/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineCompositeSequence/expected.xsts @@ -5,12 +5,12 @@ */ -var __Mission__composite__a__x : integer -var __Mission__composite__b__x : integer +var $Mission$composite$a$x : integer +var $Mission$composite$b$x : integer trans { - __Mission__composite__a__x := (__Mission__composite__a__x + 1); - __Mission__composite__b__x := (__Mission__composite__b__x + 1); + $Mission$composite$a$x := ($Mission$composite$a$x + 1); + $Mission$composite$b$x := ($Mission$composite$b$x + 1); } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineFunctor/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineFunctor/expected.xsts index 623a667..c968744 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineFunctor/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineFunctor/expected.xsts @@ -5,10 +5,10 @@ */ -var __Mission__callable__x : integer +var $Mission$callable$x : integer trans { - __Mission__callable__x := 0; + $Mission$callable$x := 0; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineIfFalse/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineIfFalse/expected.xsts index eb3f6b4..5e4c624 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineIfFalse/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineIfFalse/expected.xsts @@ -5,18 +5,18 @@ */ -var __Mission__x : integer +var $Mission$x : integer trans { - assume ((__Mission__x != 0)); + assume (($Mission$x != 0)); } init { - __Mission__x := 0; + $Mission$x := 0; } env {} prop { - (__Mission__x != 10) + ($Mission$x != 10) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineIfTrue/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineIfTrue/expected.xsts index 10db5b9..cea57f9 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineIfTrue/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineIfTrue/expected.xsts @@ -5,19 +5,19 @@ */ -var __Mission__x : integer +var $Mission$x : integer trans { - __Mission__x := (__Mission__x + 1); - assume ((__Mission__x != 0)); + $Mission$x := ($Mission$x + 1); + assume (($Mission$x != 0)); } init { - __Mission__x := 0; + $Mission$x := 0; } env {} prop { - (__Mission__x != 10) + ($Mission$x != 10) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineStaticRecursion/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineStaticRecursion/expected.xsts index 9c0dbb1..295c045 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineStaticRecursion/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/InlineStaticRecursion/expected.xsts @@ -5,21 +5,21 @@ */ -var __Mission__a__x : integer -var __Mission__a__b__x : integer -var __Mission__a__b__c__x : integer -var __Mission__a__b__c__d__x : integer -var __Mission__a__b__c__d__e__x : integer -var __Mission__a__b__c__d__e__f__x : integer +var $Mission$a$x : integer +var $Mission$a$b$x : integer +var $Mission$a$b$c$x : integer +var $Mission$a$b$c$d$x : integer +var $Mission$a$b$c$d$e$x : integer +var $Mission$a$b$c$d$e$f$x : integer trans { - __Mission__a__x := 1; - __Mission__a__b__x := 1; - __Mission__a__b__c__x := 1; + $Mission$a$x := 1; + $Mission$a$b$x := 1; + $Mission$a$b$c$x := 1; } init { - __Mission__a__x := 0; + $Mission$a$x := 0; } env {} diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/MultipleInlineCalls/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/MultipleInlineCalls/expected.xsts index 2865f21..40be9a3 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/MultipleInlineCalls/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/MultipleInlineCalls/expected.xsts @@ -5,24 +5,24 @@ */ -var __Mission__a__x : integer -var __Mission__b__x : integer -var __Mission__c__x : integer +var $Mission$a$x : integer +var $Mission$b$x : integer +var $Mission$c$x : integer trans { - __Mission__a__x := (__Mission__a__x + 1); - __Mission__b__x := (__Mission__b__x + 1); - __Mission__c__x := (__Mission__c__x + 1); + $Mission$a$x := ($Mission$a$x + 1); + $Mission$b$x := ($Mission$b$x + 1); + $Mission$c$x := ($Mission$c$x + 1); } init { - __Mission__a__x := 0; - __Mission__b__x := 0; - __Mission__c__x := 0; + $Mission$a$x := 0; + $Mission$b$x := 0; + $Mission$c$x := 0; } env {} prop { - (__Mission__a__x != __Mission__b__x) + ($Mission$a$x != $Mission$b$x) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/SingleInlineCall/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/SingleInlineCall/expected.xsts index 8ed7410..8f7d405 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/SingleInlineCall/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/SingleInlineCall/expected.xsts @@ -5,18 +5,18 @@ */ -var __Mission__a__x : integer +var $Mission$a$x : integer trans { - __Mission__a__x := (__Mission__a__x + 1); + $Mission$a$x := ($Mission$a$x + 1); } init { - __Mission__a__x := 0; + $Mission$a$x := 0; } env {} prop { - (__Mission__a__x != 10) + ($Mission$a$x != 10) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/StaticInline/MultiHierarchical/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/StaticInline/MultiHierarchical/expected.xsts index afd035f..cf48125 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/StaticInline/MultiHierarchical/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/InlineTransition/StaticInline/MultiHierarchical/expected.xsts @@ -5,12 +5,12 @@ */ -var __Mission__b__x : integer = 0 -var __Mission__c__x : integer = 0 +var $Mission$b$x : integer = 0 +var $Mission$c$x : integer = 0 trans { - assume ((__Mission__b__x == 2)); - __Mission__c__x := 10; + assume (($Mission$b$x == 2)); + $Mission$c$x := 10; } init { @@ -21,4 +21,3 @@ env {} prop { true } - \ No newline at end of file diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/FlatTargetWithMultipleInstantiations/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/FlatTargetWithMultipleInstantiations/expected.xsts index a22cec9..58b8f20 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/FlatTargetWithMultipleInstantiations/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/FlatTargetWithMultipleInstantiations/expected.xsts @@ -5,21 +5,21 @@ */ -var __Mission__a__x : integer -var __Mission__b__x : integer +var $Mission$a$x : integer +var $Mission$b$x : integer trans { - __Mission__a__x := (__Mission__a__x + 1); - __Mission__b__x := (__Mission__b__x - 1); + $Mission$a$x := ($Mission$a$x + 1); + $Mission$b$x := ($Mission$b$x - 1); } init { - __Mission__a__x := 0; - __Mission__b__x := 10; + $Mission$a$x := 0; + $Mission$b$x := 10; } env {} prop { - (__Mission__a__x != __Mission__b__x) + ($Mission$a$x != $Mission$b$x) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/FlatTargetWithSingleInstantiation/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/FlatTargetWithSingleInstantiation/expected.xsts index dcfffa3..efe239b 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/FlatTargetWithSingleInstantiation/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/FlatTargetWithSingleInstantiation/expected.xsts @@ -5,18 +5,18 @@ */ -var __Mission__simple__x : integer +var $Mission$simple$x : integer trans { - __Mission__simple__x := (__Mission__simple__x + 1); + $Mission$simple$x := ($Mission$simple$x + 1); } init { - __Mission__simple__x := 0; + $Mission$simple$x := 0; } env {} prop { - (__Mission__simple__x != 10) + ($Mission$simple$x != 10) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/ManyLayerCompositeInstantiation/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/ManyLayerCompositeInstantiation/expected.xsts index dfa4b36..51ea448 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/ManyLayerCompositeInstantiation/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/ManyLayerCompositeInstantiation/expected.xsts @@ -5,38 +5,38 @@ */ -var __Mission__composite__x : integer -var __Mission__composite__a__x : integer -var __Mission__composite__b__x : integer -var __Mission__composite__a__a__x : integer -var __Mission__composite__a__b__x : integer -var __Mission__composite__b__a__x : integer -var __Mission__composite__b__b__x : integer -var __Mission__composite__a__a__a__x : integer -var __Mission__composite__a__a__b__x : integer -var __Mission__composite__a__b__a__x : integer -var __Mission__composite__a__b__b__x : integer -var __Mission__composite__b__a__a__x : integer -var __Mission__composite__b__a__b__x : integer -var __Mission__composite__b__b__a__x : integer -var __Mission__composite__b__b__b__x : integer +var $Mission$composite$x : integer +var $Mission$composite$a$x : integer +var $Mission$composite$b$x : integer +var $Mission$composite$a$a$x : integer +var $Mission$composite$a$b$x : integer +var $Mission$composite$b$a$x : integer +var $Mission$composite$b$b$x : integer +var $Mission$composite$a$a$a$x : integer +var $Mission$composite$a$a$b$x : integer +var $Mission$composite$a$b$a$x : integer +var $Mission$composite$a$b$b$x : integer +var $Mission$composite$b$a$a$x : integer +var $Mission$composite$b$a$b$x : integer +var $Mission$composite$b$b$a$x : integer +var $Mission$composite$b$b$b$x : integer trans { - __Mission__composite__x := 0; - __Mission__composite__a__x := 0; - __Mission__composite__a__a__x := 0; - __Mission__composite__a__a__a__x := 0; - __Mission__composite__a__a__b__x := 0; - __Mission__composite__a__b__x := 0; - __Mission__composite__a__b__a__x := 0; - __Mission__composite__a__b__b__x := 0; - __Mission__composite__b__x := 0; - __Mission__composite__b__a__x := 0; - __Mission__composite__b__a__a__x := 0; - __Mission__composite__b__a__b__x := 0; - __Mission__composite__b__b__x := 0; - __Mission__composite__b__b__a__x := 0; - __Mission__composite__b__b__b__x := 0; + $Mission$composite$x := 0; + $Mission$composite$a$x := 0; + $Mission$composite$a$a$x := 0; + $Mission$composite$a$a$a$x := 0; + $Mission$composite$a$a$b$x := 0; + $Mission$composite$a$b$x := 0; + $Mission$composite$a$b$a$x := 0; + $Mission$composite$a$b$b$x := 0; + $Mission$composite$b$x := 0; + $Mission$composite$b$a$x := 0; + $Mission$composite$b$a$a$x := 0; + $Mission$composite$b$a$b$x := 0; + $Mission$composite$b$b$x := 0; + $Mission$composite$b$b$a$x := 0; + $Mission$composite$b$b$b$x := 0; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/ManyLayerCompositeReferenceBinding/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/ManyLayerCompositeReferenceBinding/expected.xsts index 9792b4e..b41a69b 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/ManyLayerCompositeReferenceBinding/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/ManyLayerCompositeReferenceBinding/expected.xsts @@ -5,25 +5,25 @@ */ -var __Mission__composite__x : integer -var __Mission__composite__a__x : integer -var __Mission__composite__b__x : integer -var __Mission__composite__a__a__x : integer -var __Mission__composite__a__b__x : integer -var __Mission__composite__b__a__x : integer -var __Mission__composite__b__b__x : integer -var __Mission__composite__a__a__a__x : integer -var __Mission__composite__a__a__b__x : integer -var __Mission__composite__a__b__a__x : integer -var __Mission__composite__a__b__b__x : integer -var __Mission__composite__b__a__a__x : integer -var __Mission__composite__b__a__b__x : integer -var __Mission__composite__b__b__a__x : integer -var __Mission__composite__b__b__b__x : integer +var $Mission$composite$x : integer +var $Mission$composite$a$x : integer +var $Mission$composite$b$x : integer +var $Mission$composite$a$a$x : integer +var $Mission$composite$a$b$x : integer +var $Mission$composite$b$a$x : integer +var $Mission$composite$b$b$x : integer +var $Mission$composite$a$a$a$x : integer +var $Mission$composite$a$a$b$x : integer +var $Mission$composite$a$b$a$x : integer +var $Mission$composite$a$b$b$x : integer +var $Mission$composite$b$a$a$x : integer +var $Mission$composite$b$a$b$x : integer +var $Mission$composite$b$b$a$x : integer +var $Mission$composite$b$b$b$x : integer trans { - __Mission__composite__a__b__a__x := 0; - __Mission__composite__x := 0; + $Mission$composite$a$b$a$x := 0; + $Mission$composite$x := 0; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/MultipleInstancesInOneReference/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/MultipleInstancesInOneReference/expected.xsts index 5c920a6..ccdea43 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/MultipleInstancesInOneReference/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/MultipleInstancesInOneReference/expected.xsts @@ -5,15 +5,15 @@ */ -var __Mission__composite__a__x : integer = 0 -var __Mission__composite__b__x : integer = 0 -var __Mission__composite__c__x : integer = 0 -var __Mission__composite__d__x : integer = 0 +var $Mission$composite$a$x : integer = 0 +var $Mission$composite$b$x : integer = 0 +var $Mission$composite$c$x : integer = 0 +var $Mission$composite$d$x : integer = 0 trans { - __Mission__composite__a__x := (__Mission__composite__a__x + 1); - __Mission__composite__b__x := (__Mission__composite__b__x + 1); - __Mission__composite__d__x := (__Mission__composite__d__x + 1); + $Mission$composite$a$x := ($Mission$composite$a$x + 1); + $Mission$composite$b$x := ($Mission$composite$b$x + 1); + $Mission$composite$d$x := ($Mission$composite$d$x + 1); } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/ReferenceBinding/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/ReferenceBinding/expected.xsts index 98875e8..640d3cc 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/ReferenceBinding/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/ReferenceBinding/expected.xsts @@ -5,11 +5,11 @@ */ -var __Mission__composite__a__x : integer = 0 -var __Mission__composite__b__x : integer = 0 +var $Mission$composite$a$x : integer = 0 +var $Mission$composite$b$x : integer = 0 trans { - __Mission__composite__b__x := (__Mission__composite__b__x + 1); + $Mission$composite$b$x := ($Mission$composite$b$x + 1); } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/ReferenceBindingToUpper/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/ReferenceBindingToUpper/expected.xsts index 1fdc076..217281e 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/ReferenceBindingToUpper/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/ReferenceBindingToUpper/expected.xsts @@ -5,12 +5,12 @@ */ -var __Mission__composite__a__aAtom__x : integer -var __Mission__composite__b__bAtom__x : integer +var $Mission$composite$a$aAtom$x : integer +var $Mission$composite$b$bAtom$x : integer trans { - __Mission__composite__a__aAtom__x := 10; - __Mission__composite__b__bAtom__x := 10; + $Mission$composite$a$aAtom$x := 10; + $Mission$composite$b$bAtom$x := 10; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/TwoLayerCompositeInstantiation/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/TwoLayerCompositeInstantiation/expected.xsts index b9a7779..43a79c6 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/TwoLayerCompositeInstantiation/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/TwoLayerCompositeInstantiation/expected.xsts @@ -5,8 +5,8 @@ */ -var __Mission__composite__a__x : integer -var __Mission__composite__b__x : integer +var $Mission$composite$a$x : integer +var $Mission$composite$b$x : integer trans { assume (false); diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/TwoLayerCompositeReferenceBinding/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/TwoLayerCompositeReferenceBinding/expected.xsts index 5e3cac6..7857c24 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Instance/TwoLayerCompositeReferenceBinding/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Instance/TwoLayerCompositeReferenceBinding/expected.xsts @@ -5,12 +5,12 @@ */ -var __Mission__a1__x : integer -var __Mission__a2__x : integer +var $Mission$a1$x : integer +var $Mission$a2$x : integer trans { - __Mission__a1__x := 1; - __Mission__a2__x := 1; + $Mission$a1$x := 1; + $Mission$a2$x := 1; } init { diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Pattern/Simple/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Pattern/Simple/expected.xsts index f30d79d..9a7f696 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Pattern/Simple/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Pattern/Simple/expected.xsts @@ -5,12 +5,12 @@ */ -var __Mission__a__x : integer -var __Mission__b__x : integer +var $Mission$a$x : integer +var $Mission$b$x : integer trans { - __Mission__a__x := 10; - __Mission__b__x := 10; + $Mission$a$x := 10; + $Mission$b$x := 10; } init { @@ -19,5 +19,5 @@ init { env {} prop { - (__Mission__a__x != __Mission__b__x) + ($Mission$a$x != $Mission$b$x) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Target/BooleanVariable/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Target/BooleanVariable/expected.xsts index fd39be7..053e1bf 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Target/BooleanVariable/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Target/BooleanVariable/expected.xsts @@ -5,18 +5,18 @@ */ -var __Mission__y : boolean +var $Mission$y : boolean trans { - __Mission__y := true; + $Mission$y := true; } init { - __Mission__y := false; + $Mission$y := false; } env {} prop { - (__Mission__y == false) + ($Mission$y == false) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Target/EnumVariable/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Target/EnumVariable/expected.xsts index 8b5c3da..f97025d 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Target/EnumVariable/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Target/EnumVariable/expected.xsts @@ -10,18 +10,18 @@ type TimeUnit : { Hours } -var __Mission__unit : TimeUnit +var $Mission$unit : TimeUnit trans { - __Mission__unit := Minutes; + $Mission$unit := Minutes; } init { - __Mission__unit := Seconds; + $Mission$unit := Seconds; } env {} prop { - (__Mission__unit == Seconds) + ($Mission$unit == Seconds) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Target/IntegerVariable/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Target/IntegerVariable/expected.xsts index 8a92720..287a348 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Target/IntegerVariable/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Target/IntegerVariable/expected.xsts @@ -5,18 +5,18 @@ */ -var __Mission__x : integer +var $Mission$x : integer trans { - __Mission__x := (__Mission__x + 1); + $Mission$x := ($Mission$x + 1); } init { - __Mission__x := 0; + $Mission$x := 0; } env {} prop { - (__Mission__x != 10) + ($Mission$x != 10) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Transition/AssignmentOperation/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Transition/AssignmentOperation/expected.xsts index fd39be7..053e1bf 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Transition/AssignmentOperation/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Transition/AssignmentOperation/expected.xsts @@ -5,18 +5,18 @@ */ -var __Mission__y : boolean +var $Mission$y : boolean trans { - __Mission__y := true; + $Mission$y := true; } init { - __Mission__y := false; + $Mission$y := false; } env {} prop { - (__Mission__y == false) + ($Mission$y == false) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Transition/Assumption/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Transition/Assumption/expected.xsts index b9cf525..199c725 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Transition/Assumption/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Transition/Assumption/expected.xsts @@ -5,19 +5,19 @@ */ -var __Mission__y : boolean -var __Mission__x : integer +var $Mission$y : boolean +var $Mission$x : integer trans { - assume ((__Mission__y == false)); + assume (($Mission$y == false)); } init { - __Mission__y := false; + $Mission$y := false; } env {} prop { - (__Mission__y == false) + ($Mission$y == false) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Transition/Choice/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Transition/Choice/expected.xsts index 4f9432a..c11f557 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Transition/Choice/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Transition/Choice/expected.xsts @@ -5,23 +5,23 @@ */ -var __Mission__y : boolean -var __Mission__x : integer +var $Mission$y : boolean +var $Mission$x : integer trans { choice { - __Mission__y := true; + $Mission$y := true; } or { - __Mission__x := 10; + $Mission$x := 10; } } init { - __Mission__y := false; + $Mission$y := false; } env {} prop { - (__Mission__y == false) + ($Mission$y == false) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Transition/ChoiceElse/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Transition/ChoiceElse/expected.xsts index 4e8a358..4a88f5f 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Transition/ChoiceElse/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Transition/ChoiceElse/expected.xsts @@ -5,28 +5,28 @@ */ -var __Mission__y : boolean -var __Mission__x : integer +var $Mission$y : boolean +var $Mission$x : integer trans { choice { - assume ((__Mission__x == 10)); - __Mission__y := true; + assume (($Mission$x == 10)); + $Mission$y := true; } or { - assume ((__Mission__x == 10)); - __Mission__x := 10; + assume (($Mission$x == 10)); + $Mission$x := 10; } or { - assume (! (((__Mission__x == 10) || (__Mission__x == 10)))); - __Mission__x := 0; + assume (! ((($Mission$x == 10) || ($Mission$x == 10)))); + $Mission$x := 0; } } init { - __Mission__y := false; + $Mission$y := false; } env {} prop { - (__Mission__y == false) + ($Mission$y == false) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Transition/HavocOperation/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Transition/HavocOperation/expected.xsts index 4f6a678..cd9b56a 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Transition/HavocOperation/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Transition/HavocOperation/expected.xsts @@ -5,18 +5,18 @@ */ -var __Mission__y : boolean +var $Mission$y : boolean trans { - havoc __Mission__y; + havoc $Mission$y; } init { - __Mission__y := false; + $Mission$y := false; } env {} prop { - (__Mission__y == false) + ($Mission$y == false) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Transition/If/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Transition/If/expected.xsts index 545c9a2..7c67213 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Transition/If/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Transition/If/expected.xsts @@ -5,24 +5,24 @@ */ -var __Mission__y : boolean -var __Mission__x : integer +var $Mission$y : boolean +var $Mission$x : integer trans { - __Mission__y := true; - if (__Mission__y) { - __Mission__x := 10; + $Mission$y := true; + if ($Mission$y) { + $Mission$x := 10; } else { - __Mission__x := 0; + $Mission$x := 0; } } init { - __Mission__y := false; + $Mission$y := false; } env {} prop { - (__Mission__y == false) + ($Mission$y == false) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Transition/Sequence/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Transition/Sequence/expected.xsts index 589c2f1..159e6b6 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Transition/Sequence/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Transition/Sequence/expected.xsts @@ -5,20 +5,20 @@ */ -var __Mission__y : boolean -var __Mission__x : integer +var $Mission$y : boolean +var $Mission$x : integer trans { - __Mission__y := true; - __Mission__x := 10; + $Mission$y := true; + $Mission$x := 10; } init { - __Mission__y := false; + $Mission$y := false; } env {} prop { - (__Mission__y == false) + ($Mission$y == false) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Variable/Initializer/Boolean/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Variable/Initializer/Boolean/expected.xsts index a5c303b..34edd74 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Variable/Initializer/Boolean/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Variable/Initializer/Boolean/expected.xsts @@ -5,7 +5,7 @@ */ -var __Mission__a__x : boolean = true +var $Mission$a$x : boolean = true trans { } @@ -16,5 +16,5 @@ init { env {} prop { - (__Mission__a__x != true) + ($Mission$a$x != true) } diff --git a/subprojects/semantifyr/TestModels/Automated/Simple/Variable/Initializer/Integer/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Simple/Variable/Initializer/Integer/expected.xsts index 2fea2e0..7b6f2cf 100644 --- a/subprojects/semantifyr/TestModels/Automated/Simple/Variable/Initializer/Integer/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Simple/Variable/Initializer/Integer/expected.xsts @@ -5,7 +5,7 @@ */ -var __Mission__a__x : integer = 10 +var $Mission$a$x : integer = 10 trans { } @@ -16,5 +16,5 @@ init { env {} prop { - (__Mission__a__x != 10) + ($Mission$a$x != 10) } diff --git a/subprojects/semantifyr/TestModels/Automated/SysMLv2/Action/Decision/expected.xsts b/subprojects/semantifyr/TestModels/Automated/SysMLv2/Action/Decision/expected.xsts index dda1551..efe14a3 100644 --- a/subprojects/semantifyr/TestModels/Automated/SysMLv2/Action/Decision/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/SysMLv2/Action/Decision/expected.xsts @@ -5,100 +5,100 @@ */ -var __Mission__behavior__start__performing : boolean = false -var __Mission__behavior__s_then_f__activated : boolean = false -var __Mission__behavior__fork__performing : boolean = false -var __Mission__behavior__f_then_p1__activated : boolean = false -var __Mission__behavior__f_then_p2__activated : boolean = false -var __Mission__behavior__paint1__performing : boolean = false -var __Mission__behavior__p1_then_d1__activated : boolean = false -var __Mission__behavior__dry1__performing : boolean = false -var __Mission__behavior__d1_then_j__activated : boolean = false -var __Mission__behavior__paint2__performing : boolean = false -var __Mission__behavior__p2_then_d2__activated : boolean = false -var __Mission__behavior__dry2__performing : boolean = false -var __Mission__behavior__d2_then_j__activated : boolean = false -var __Mission__behavior__join__performing : boolean = false -var __Mission__behavior__j_then_s__activated : boolean = false -var __Mission__behavior__ship__performing : boolean = false +var $Mission$behavior$start$performing : boolean = false +var $Mission$behavior$s_then_f$activated : boolean = false +var $Mission$behavior$fork$performing : boolean = false +var $Mission$behavior$f_then_p1$activated : boolean = false +var $Mission$behavior$f_then_p2$activated : boolean = false +var $Mission$behavior$paint1$performing : boolean = false +var $Mission$behavior$p1_then_d1$activated : boolean = false +var $Mission$behavior$dry1$performing : boolean = false +var $Mission$behavior$d1_then_j$activated : boolean = false +var $Mission$behavior$paint2$performing : boolean = false +var $Mission$behavior$p2_then_d2$activated : boolean = false +var $Mission$behavior$dry2$performing : boolean = false +var $Mission$behavior$d2_then_j$activated : boolean = false +var $Mission$behavior$join$performing : boolean = false +var $Mission$behavior$j_then_s$activated : boolean = false +var $Mission$behavior$ship$performing : boolean = false trans { choice { - assume ((__Mission__behavior__start__performing == false)); - __Mission__behavior__start__performing := true; + assume (($Mission$behavior$start$performing == false)); + $Mission$behavior$start$performing := true; } or { - assume (__Mission__behavior__start__performing); - assume ((__Mission__behavior__s_then_f__activated == false)); - __Mission__behavior__s_then_f__activated := true; - __Mission__behavior__start__performing := false; + assume ($Mission$behavior$start$performing); + assume (($Mission$behavior$s_then_f$activated == false)); + $Mission$behavior$s_then_f$activated := true; + $Mission$behavior$start$performing := false; } or { - assume ((__Mission__behavior__fork__performing == false)); - assume (__Mission__behavior__s_then_f__activated); - __Mission__behavior__s_then_f__activated := false; - __Mission__behavior__fork__performing := true; + assume (($Mission$behavior$fork$performing == false)); + assume ($Mission$behavior$s_then_f$activated); + $Mission$behavior$s_then_f$activated := false; + $Mission$behavior$fork$performing := true; } or { - assume (__Mission__behavior__fork__performing); - __Mission__behavior__fork__performing := false; + assume ($Mission$behavior$fork$performing); + $Mission$behavior$fork$performing := false; } or { - assume ((__Mission__behavior__paint1__performing == false)); - assume (__Mission__behavior__f_then_p1__activated); - __Mission__behavior__f_then_p1__activated := false; - __Mission__behavior__paint1__performing := true; + assume (($Mission$behavior$paint1$performing == false)); + assume ($Mission$behavior$f_then_p1$activated); + $Mission$behavior$f_then_p1$activated := false; + $Mission$behavior$paint1$performing := true; } or { - assume (__Mission__behavior__paint1__performing); - assume ((__Mission__behavior__p1_then_d1__activated == false)); - __Mission__behavior__p1_then_d1__activated := true; - __Mission__behavior__paint1__performing := false; + assume ($Mission$behavior$paint1$performing); + assume (($Mission$behavior$p1_then_d1$activated == false)); + $Mission$behavior$p1_then_d1$activated := true; + $Mission$behavior$paint1$performing := false; } or { - assume ((__Mission__behavior__dry1__performing == false)); - assume (__Mission__behavior__p1_then_d1__activated); - __Mission__behavior__p1_then_d1__activated := false; - __Mission__behavior__dry1__performing := true; + assume (($Mission$behavior$dry1$performing == false)); + assume ($Mission$behavior$p1_then_d1$activated); + $Mission$behavior$p1_then_d1$activated := false; + $Mission$behavior$dry1$performing := true; } or { - assume (__Mission__behavior__dry1__performing); - assume ((__Mission__behavior__d1_then_j__activated == false)); - __Mission__behavior__d1_then_j__activated := true; - __Mission__behavior__dry1__performing := false; + assume ($Mission$behavior$dry1$performing); + assume (($Mission$behavior$d1_then_j$activated == false)); + $Mission$behavior$d1_then_j$activated := true; + $Mission$behavior$dry1$performing := false; } or { - assume ((__Mission__behavior__paint2__performing == false)); - assume (__Mission__behavior__f_then_p2__activated); - __Mission__behavior__f_then_p2__activated := false; - __Mission__behavior__paint2__performing := true; + assume (($Mission$behavior$paint2$performing == false)); + assume ($Mission$behavior$f_then_p2$activated); + $Mission$behavior$f_then_p2$activated := false; + $Mission$behavior$paint2$performing := true; } or { - assume (__Mission__behavior__paint2__performing); - assume ((__Mission__behavior__p2_then_d2__activated == false)); - __Mission__behavior__p2_then_d2__activated := true; - __Mission__behavior__paint2__performing := false; + assume ($Mission$behavior$paint2$performing); + assume (($Mission$behavior$p2_then_d2$activated == false)); + $Mission$behavior$p2_then_d2$activated := true; + $Mission$behavior$paint2$performing := false; } or { - assume ((__Mission__behavior__dry2__performing == false)); - assume (__Mission__behavior__p2_then_d2__activated); - __Mission__behavior__p2_then_d2__activated := false; - __Mission__behavior__dry2__performing := true; + assume (($Mission$behavior$dry2$performing == false)); + assume ($Mission$behavior$p2_then_d2$activated); + $Mission$behavior$p2_then_d2$activated := false; + $Mission$behavior$dry2$performing := true; } or { - assume (__Mission__behavior__dry2__performing); - assume ((__Mission__behavior__d2_then_j__activated == false)); - __Mission__behavior__d2_then_j__activated := true; - __Mission__behavior__dry2__performing := false; + assume ($Mission$behavior$dry2$performing); + assume (($Mission$behavior$d2_then_j$activated == false)); + $Mission$behavior$d2_then_j$activated := true; + $Mission$behavior$dry2$performing := false; } or { - assume ((__Mission__behavior__join__performing == false)); - assume (__Mission__behavior__d1_then_j__activated); - __Mission__behavior__d1_then_j__activated := false; - assume (__Mission__behavior__d2_then_j__activated); - __Mission__behavior__d2_then_j__activated := false; - __Mission__behavior__join__performing := true; + assume (($Mission$behavior$join$performing == false)); + assume ($Mission$behavior$d1_then_j$activated); + $Mission$behavior$d1_then_j$activated := false; + assume ($Mission$behavior$d2_then_j$activated); + $Mission$behavior$d2_then_j$activated := false; + $Mission$behavior$join$performing := true; } or { - assume (__Mission__behavior__join__performing); - assume ((__Mission__behavior__j_then_s__activated == false)); - __Mission__behavior__j_then_s__activated := true; - __Mission__behavior__join__performing := false; + assume ($Mission$behavior$join$performing); + assume (($Mission$behavior$j_then_s$activated == false)); + $Mission$behavior$j_then_s$activated := true; + $Mission$behavior$join$performing := false; } or { - assume ((__Mission__behavior__ship__performing == false)); - assume (__Mission__behavior__j_then_s__activated); - __Mission__behavior__j_then_s__activated := false; - __Mission__behavior__ship__performing := true; + assume (($Mission$behavior$ship$performing == false)); + assume ($Mission$behavior$j_then_s$activated); + $Mission$behavior$j_then_s$activated := false; + $Mission$behavior$ship$performing := true; } or { - assume (__Mission__behavior__ship__performing); - __Mission__behavior__ship__performing := false; + assume ($Mission$behavior$ship$performing); + $Mission$behavior$ship$performing := false; } } diff --git a/subprojects/semantifyr/TestModels/Automated/SysMLv2/Action/Fork/expected.xsts b/subprojects/semantifyr/TestModels/Automated/SysMLv2/Action/Fork/expected.xsts index dda1551..efe14a3 100644 --- a/subprojects/semantifyr/TestModels/Automated/SysMLv2/Action/Fork/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/SysMLv2/Action/Fork/expected.xsts @@ -5,100 +5,100 @@ */ -var __Mission__behavior__start__performing : boolean = false -var __Mission__behavior__s_then_f__activated : boolean = false -var __Mission__behavior__fork__performing : boolean = false -var __Mission__behavior__f_then_p1__activated : boolean = false -var __Mission__behavior__f_then_p2__activated : boolean = false -var __Mission__behavior__paint1__performing : boolean = false -var __Mission__behavior__p1_then_d1__activated : boolean = false -var __Mission__behavior__dry1__performing : boolean = false -var __Mission__behavior__d1_then_j__activated : boolean = false -var __Mission__behavior__paint2__performing : boolean = false -var __Mission__behavior__p2_then_d2__activated : boolean = false -var __Mission__behavior__dry2__performing : boolean = false -var __Mission__behavior__d2_then_j__activated : boolean = false -var __Mission__behavior__join__performing : boolean = false -var __Mission__behavior__j_then_s__activated : boolean = false -var __Mission__behavior__ship__performing : boolean = false +var $Mission$behavior$start$performing : boolean = false +var $Mission$behavior$s_then_f$activated : boolean = false +var $Mission$behavior$fork$performing : boolean = false +var $Mission$behavior$f_then_p1$activated : boolean = false +var $Mission$behavior$f_then_p2$activated : boolean = false +var $Mission$behavior$paint1$performing : boolean = false +var $Mission$behavior$p1_then_d1$activated : boolean = false +var $Mission$behavior$dry1$performing : boolean = false +var $Mission$behavior$d1_then_j$activated : boolean = false +var $Mission$behavior$paint2$performing : boolean = false +var $Mission$behavior$p2_then_d2$activated : boolean = false +var $Mission$behavior$dry2$performing : boolean = false +var $Mission$behavior$d2_then_j$activated : boolean = false +var $Mission$behavior$join$performing : boolean = false +var $Mission$behavior$j_then_s$activated : boolean = false +var $Mission$behavior$ship$performing : boolean = false trans { choice { - assume ((__Mission__behavior__start__performing == false)); - __Mission__behavior__start__performing := true; + assume (($Mission$behavior$start$performing == false)); + $Mission$behavior$start$performing := true; } or { - assume (__Mission__behavior__start__performing); - assume ((__Mission__behavior__s_then_f__activated == false)); - __Mission__behavior__s_then_f__activated := true; - __Mission__behavior__start__performing := false; + assume ($Mission$behavior$start$performing); + assume (($Mission$behavior$s_then_f$activated == false)); + $Mission$behavior$s_then_f$activated := true; + $Mission$behavior$start$performing := false; } or { - assume ((__Mission__behavior__fork__performing == false)); - assume (__Mission__behavior__s_then_f__activated); - __Mission__behavior__s_then_f__activated := false; - __Mission__behavior__fork__performing := true; + assume (($Mission$behavior$fork$performing == false)); + assume ($Mission$behavior$s_then_f$activated); + $Mission$behavior$s_then_f$activated := false; + $Mission$behavior$fork$performing := true; } or { - assume (__Mission__behavior__fork__performing); - __Mission__behavior__fork__performing := false; + assume ($Mission$behavior$fork$performing); + $Mission$behavior$fork$performing := false; } or { - assume ((__Mission__behavior__paint1__performing == false)); - assume (__Mission__behavior__f_then_p1__activated); - __Mission__behavior__f_then_p1__activated := false; - __Mission__behavior__paint1__performing := true; + assume (($Mission$behavior$paint1$performing == false)); + assume ($Mission$behavior$f_then_p1$activated); + $Mission$behavior$f_then_p1$activated := false; + $Mission$behavior$paint1$performing := true; } or { - assume (__Mission__behavior__paint1__performing); - assume ((__Mission__behavior__p1_then_d1__activated == false)); - __Mission__behavior__p1_then_d1__activated := true; - __Mission__behavior__paint1__performing := false; + assume ($Mission$behavior$paint1$performing); + assume (($Mission$behavior$p1_then_d1$activated == false)); + $Mission$behavior$p1_then_d1$activated := true; + $Mission$behavior$paint1$performing := false; } or { - assume ((__Mission__behavior__dry1__performing == false)); - assume (__Mission__behavior__p1_then_d1__activated); - __Mission__behavior__p1_then_d1__activated := false; - __Mission__behavior__dry1__performing := true; + assume (($Mission$behavior$dry1$performing == false)); + assume ($Mission$behavior$p1_then_d1$activated); + $Mission$behavior$p1_then_d1$activated := false; + $Mission$behavior$dry1$performing := true; } or { - assume (__Mission__behavior__dry1__performing); - assume ((__Mission__behavior__d1_then_j__activated == false)); - __Mission__behavior__d1_then_j__activated := true; - __Mission__behavior__dry1__performing := false; + assume ($Mission$behavior$dry1$performing); + assume (($Mission$behavior$d1_then_j$activated == false)); + $Mission$behavior$d1_then_j$activated := true; + $Mission$behavior$dry1$performing := false; } or { - assume ((__Mission__behavior__paint2__performing == false)); - assume (__Mission__behavior__f_then_p2__activated); - __Mission__behavior__f_then_p2__activated := false; - __Mission__behavior__paint2__performing := true; + assume (($Mission$behavior$paint2$performing == false)); + assume ($Mission$behavior$f_then_p2$activated); + $Mission$behavior$f_then_p2$activated := false; + $Mission$behavior$paint2$performing := true; } or { - assume (__Mission__behavior__paint2__performing); - assume ((__Mission__behavior__p2_then_d2__activated == false)); - __Mission__behavior__p2_then_d2__activated := true; - __Mission__behavior__paint2__performing := false; + assume ($Mission$behavior$paint2$performing); + assume (($Mission$behavior$p2_then_d2$activated == false)); + $Mission$behavior$p2_then_d2$activated := true; + $Mission$behavior$paint2$performing := false; } or { - assume ((__Mission__behavior__dry2__performing == false)); - assume (__Mission__behavior__p2_then_d2__activated); - __Mission__behavior__p2_then_d2__activated := false; - __Mission__behavior__dry2__performing := true; + assume (($Mission$behavior$dry2$performing == false)); + assume ($Mission$behavior$p2_then_d2$activated); + $Mission$behavior$p2_then_d2$activated := false; + $Mission$behavior$dry2$performing := true; } or { - assume (__Mission__behavior__dry2__performing); - assume ((__Mission__behavior__d2_then_j__activated == false)); - __Mission__behavior__d2_then_j__activated := true; - __Mission__behavior__dry2__performing := false; + assume ($Mission$behavior$dry2$performing); + assume (($Mission$behavior$d2_then_j$activated == false)); + $Mission$behavior$d2_then_j$activated := true; + $Mission$behavior$dry2$performing := false; } or { - assume ((__Mission__behavior__join__performing == false)); - assume (__Mission__behavior__d1_then_j__activated); - __Mission__behavior__d1_then_j__activated := false; - assume (__Mission__behavior__d2_then_j__activated); - __Mission__behavior__d2_then_j__activated := false; - __Mission__behavior__join__performing := true; + assume (($Mission$behavior$join$performing == false)); + assume ($Mission$behavior$d1_then_j$activated); + $Mission$behavior$d1_then_j$activated := false; + assume ($Mission$behavior$d2_then_j$activated); + $Mission$behavior$d2_then_j$activated := false; + $Mission$behavior$join$performing := true; } or { - assume (__Mission__behavior__join__performing); - assume ((__Mission__behavior__j_then_s__activated == false)); - __Mission__behavior__j_then_s__activated := true; - __Mission__behavior__join__performing := false; + assume ($Mission$behavior$join$performing); + assume (($Mission$behavior$j_then_s$activated == false)); + $Mission$behavior$j_then_s$activated := true; + $Mission$behavior$join$performing := false; } or { - assume ((__Mission__behavior__ship__performing == false)); - assume (__Mission__behavior__j_then_s__activated); - __Mission__behavior__j_then_s__activated := false; - __Mission__behavior__ship__performing := true; + assume (($Mission$behavior$ship$performing == false)); + assume ($Mission$behavior$j_then_s$activated); + $Mission$behavior$j_then_s$activated := false; + $Mission$behavior$ship$performing := true; } or { - assume (__Mission__behavior__ship__performing); - __Mission__behavior__ship__performing := false; + assume ($Mission$behavior$ship$performing); + $Mission$behavior$ship$performing := false; } } diff --git a/subprojects/semantifyr/TestModels/Automated/SysMLv2/Action/Simple/expected.xsts b/subprojects/semantifyr/TestModels/Automated/SysMLv2/Action/Simple/expected.xsts index 4ffe342..34da600 100644 --- a/subprojects/semantifyr/TestModels/Automated/SysMLv2/Action/Simple/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/SysMLv2/Action/Simple/expected.xsts @@ -5,51 +5,51 @@ */ -var __Mission__behavior__start__performing : boolean = false -var __Mission__behavior__s_then_p1__activated : boolean = false -var __Mission__behavior__paint1__performing : boolean = false -var __Mission__behavior__p1_then_d1__activated : boolean = false -var __Mission__behavior__dry1__performing : boolean = false -var __Mission__behavior__d1_then_s__activated : boolean = false -var __Mission__behavior__ship__performing : boolean = false +var $Mission$behavior$start$performing : boolean = false +var $Mission$behavior$s_then_p1$activated : boolean = false +var $Mission$behavior$paint1$performing : boolean = false +var $Mission$behavior$p1_then_d1$activated : boolean = false +var $Mission$behavior$dry1$performing : boolean = false +var $Mission$behavior$d1_then_s$activated : boolean = false +var $Mission$behavior$ship$performing : boolean = false trans { choice { - assume ((__Mission__behavior__start__performing == false)); - __Mission__behavior__start__performing := true; + assume (($Mission$behavior$start$performing == false)); + $Mission$behavior$start$performing := true; } or { - assume (__Mission__behavior__start__performing); - assume ((__Mission__behavior__s_then_p1__activated == false)); - __Mission__behavior__s_then_p1__activated := true; - __Mission__behavior__start__performing := false; + assume ($Mission$behavior$start$performing); + assume (($Mission$behavior$s_then_p1$activated == false)); + $Mission$behavior$s_then_p1$activated := true; + $Mission$behavior$start$performing := false; } or { - assume ((__Mission__behavior__paint1__performing == false)); - assume (__Mission__behavior__s_then_p1__activated); - __Mission__behavior__s_then_p1__activated := false; - __Mission__behavior__paint1__performing := true; + assume (($Mission$behavior$paint1$performing == false)); + assume ($Mission$behavior$s_then_p1$activated); + $Mission$behavior$s_then_p1$activated := false; + $Mission$behavior$paint1$performing := true; } or { - assume (__Mission__behavior__paint1__performing); - assume ((__Mission__behavior__p1_then_d1__activated == false)); - __Mission__behavior__p1_then_d1__activated := true; - __Mission__behavior__paint1__performing := false; + assume ($Mission$behavior$paint1$performing); + assume (($Mission$behavior$p1_then_d1$activated == false)); + $Mission$behavior$p1_then_d1$activated := true; + $Mission$behavior$paint1$performing := false; } or { - assume ((__Mission__behavior__dry1__performing == false)); - assume (__Mission__behavior__p1_then_d1__activated); - __Mission__behavior__p1_then_d1__activated := false; - __Mission__behavior__dry1__performing := true; + assume (($Mission$behavior$dry1$performing == false)); + assume ($Mission$behavior$p1_then_d1$activated); + $Mission$behavior$p1_then_d1$activated := false; + $Mission$behavior$dry1$performing := true; } or { - assume (__Mission__behavior__dry1__performing); - assume ((__Mission__behavior__d1_then_s__activated == false)); - __Mission__behavior__d1_then_s__activated := true; - __Mission__behavior__dry1__performing := false; + assume ($Mission$behavior$dry1$performing); + assume (($Mission$behavior$d1_then_s$activated == false)); + $Mission$behavior$d1_then_s$activated := true; + $Mission$behavior$dry1$performing := false; } or { - assume ((__Mission__behavior__ship__performing == false)); - assume (__Mission__behavior__d1_then_s__activated); - __Mission__behavior__d1_then_s__activated := false; - __Mission__behavior__ship__performing := true; + assume (($Mission$behavior$ship$performing == false)); + assume ($Mission$behavior$d1_then_s$activated); + $Mission$behavior$d1_then_s$activated := false; + $Mission$behavior$ship$performing := true; } or { - assume (__Mission__behavior__ship__performing); - __Mission__behavior__ship__performing := false; + assume ($Mission$behavior$ship$performing); + $Mission$behavior$ship$performing := false; } } diff --git a/subprojects/semantifyr/src/main/kotlin/utils/Namings.kt b/subprojects/semantifyr/src/main/kotlin/utils/Namings.kt index 34bf98e..02d2036 100644 --- a/subprojects/semantifyr/src/main/kotlin/utils/Namings.kt +++ b/subprojects/semantifyr/src/main/kotlin/utils/Namings.kt @@ -6,8 +6,8 @@ import hu.bme.mit.semantifyr.oxsts.model.oxsts.Variable @Suppress("MemberVisibilityCanBePrivate") object Namings { - const val SYNTHETIC_SEPARATOR = "__" - const val SYNTHETIC_ELEMENT_PREFIX = "__" + const val SYNTHETIC_SEPARATOR = "$" + const val SYNTHETIC_ELEMENT_PREFIX = "$$" const val LITERAL_SUFFIX = "${SYNTHETIC_ELEMENT_PREFIX}literal" const val TYPE_SUFFIX = "${SYNTHETIC_ELEMENT_PREFIX}type" diff --git a/subprojects/xsts.lang/src/main/java/hu/bme/mit/semantifyr/xsts/lang/Xsts.xtext b/subprojects/xsts.lang/src/main/java/hu/bme/mit/semantifyr/xsts/lang/Xsts.xtext index 2288c78..df7e9e7 100644 --- a/subprojects/xsts.lang/src/main/java/hu/bme/mit/semantifyr/xsts/lang/Xsts.xtext +++ b/subprojects/xsts.lang/src/main/java/hu/bme/mit/semantifyr/xsts/lang/Xsts.xtext @@ -239,3 +239,5 @@ BooleanValue returns Ecore::EBoolean: SignedInt returns Ecore::EInt: ('-')? INT ; + +terminal ID: '^'?('a'..'z'|'A'..'Z'|'_'|'$') ('a'..'z'|'A'..'Z'|'_'|'0'..'9'|'$')*; From bbea6887314c5feb502cfc2465eb05d3735ca07d Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Tue, 12 Nov 2024 19:28:45 +0100 Subject: [PATCH 11/27] Added SignedInt to Cex --- .../src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext index d1c2b4b..46ab45b 100644 --- a/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext +++ b/subprojects/cex.lang/src/main/java/hu/bme/mit/semantifyr/cex/lang/Cex.xtext @@ -59,11 +59,15 @@ LiteralBoolean: ; LiteralInteger: - value = INT + value = SignedInt ; BooleanValue returns Ecore::EBoolean: 'true' | 'false' ; +SignedInt returns Ecore::EInt: + ('-')? INT +; + terminal ID: '^'?('a'..'z'|'A'..'Z'|'_'|'$') ('a'..'z'|'A'..'Z'|'_'|'0'..'9'|'$')*; From 295ebe41584a7e4bc982c6ac29b1e53aae77b306 Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Tue, 12 Nov 2024 19:29:02 +0100 Subject: [PATCH 12/27] Added additional formattings to OXSTS --- .../lang/formatting2/OxstsFormatter.java | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/formatting2/OxstsFormatter.java b/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/formatting2/OxstsFormatter.java index e117ff8..1f6e178 100644 --- a/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/formatting2/OxstsFormatter.java +++ b/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/formatting2/OxstsFormatter.java @@ -158,18 +158,37 @@ protected void format(IfOperation operation, IFormattableDocument document) { protected void format(AssumptionOperation operation, IFormattableDocument document) { document.prepend(regionFor(operation).keyword("assume"), this::newLine); + document.append(regionFor(operation).keyword("("), this::noSpace); + document.prepend(regionFor(operation).keyword(")"), this::noSpace); + + document.format(operation.getExpression()); } protected void format(HavocOperation operation, IFormattableDocument document) { document.prepend(regionFor(operation).keyword("havoc"), this::newLine); + document.append(regionFor(operation).keyword("("), this::noSpace); + document.prepend(regionFor(operation).keyword(")"), this::noSpace); + + document.format(operation.getReferenceExpression()); } protected void format(AssignmentOperation operation, IFormattableDocument document) { document.prepend(regionFor(operation).feature(OxstsPackage.Literals.ASSIGNMENT_OPERATION__REFERENCE), this::newLine); + + document.format(operation.getReference()); + document.format(operation.getExpression()); } protected void format(InlineCall operation, IFormattableDocument document) { - document.prepend(regionFor(operation).keyword("inline"), this::newLine); + if (operation.isStatic()) { + document.prepend(regionFor(operation).keyword("static"), this::newLine); + } else { + document.prepend(regionFor(operation).keyword("inline"), this::newLine); + } + + document.prepend(regionFor(operation).keyword("("), this::noSpace); + document.append(regionFor(operation).keyword("("), this::noSpace); + document.prepend(regionFor(operation).keyword(")"), this::noSpace); } protected void format(InlineChoice operation, IFormattableDocument document) { @@ -240,6 +259,21 @@ protected void format(PatternConstraint constraint, IFormattableDocument documen } } + protected void format(OperatorExpression expression, IFormattableDocument document) { + for (Expression operand : expression.getOperands()) { + document.format(operand); + } + } + + protected void format(ChainReferenceExpression expression, IFormattableDocument document) { + document.prepend(allRegionsFor(expression).keyword("."), this::noSpace); + document.append(allRegionsFor(expression).keyword("."), this::noSpace); + + for (var expr : expression.getChains()) { + document.format(expr); + } + } + protected void setupBrackets(EObject eObject, IFormattableDocument document) { document.prepend(regionFor(eObject).keyword("{"), this::oneSpace); document.prepend(regionFor(eObject).keyword("}"), this::newLine); From 0696fd40754a2bafb23eb4e729a1e7bd2048878f Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Tue, 12 Nov 2024 19:29:37 +0100 Subject: [PATCH 13/27] Extracted Oxsts logic from OxstsScopeProvider --- .../lang/scoping/OxstsScopeProvider.java | 97 +------------- .../oxsts/model/oxsts/OxstsUtils.java | 122 ++++++++++++++++++ 2 files changed, 125 insertions(+), 94 deletions(-) create mode 100644 subprojects/oxsts.model/src/main/java/hu/bme/mit/semantifyr/oxsts/model/oxsts/OxstsUtils.java diff --git a/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/scoping/OxstsScopeProvider.java b/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/scoping/OxstsScopeProvider.java index 7fec501..a21cfbf 100644 --- a/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/scoping/OxstsScopeProvider.java +++ b/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/scoping/OxstsScopeProvider.java @@ -19,6 +19,9 @@ import java.util.Collections; import java.util.List; +import static hu.bme.mit.semantifyr.oxsts.model.oxsts.OxstsUtils.getAccessibleElements; +import static hu.bme.mit.semantifyr.oxsts.model.oxsts.OxstsUtils.getReferredElement; + /** * This class contains custom scoping description. *

@@ -116,98 +119,4 @@ protected IScope scopeElement(EObject element, EReference reference) { return Scopes.scopeFor(accessibleElements, QualifiedName.wrapper(this::customNameProvider), super.getScope(element, reference)); } - protected List getAccessibleElements(EObject element) { - if (element == null) { - return Collections.emptyList(); - } - - var parent = element.eContainer(); - var elements = new ArrayList(); - - if (element instanceof Package _package) { - elements.addAll(getLocalScope(_package)); - elements.addAll(_package.getImports().stream().flatMap(it -> - getLocalScope(it.getPackage()).stream() - ).toList()); - } else if (element instanceof Type type) { - elements.addAll(getInheritedElements(type)); - } else if (element instanceof Feature feature) { - elements.addAll(getInheritedElements(feature.getTyping())); - } else if (element instanceof Parameter parameter) { - elements.addAll(getInheritedElements(parameter.getType())); - } else if (element instanceof Argument argument) { - elements.addAll(getInheritedElements(argument.getTyping())); - } - - elements.addAll(getAccessibleElements(parent)); - - return elements; - } - - protected List getLocalScope(Package _package) { - var elements = new ArrayList(); - elements.addAll(_package.getTypes().stream().map(it -> (Element) it).toList()); - elements.addAll(_package.getEnums().stream().map(it -> (Element) it).toList()); - elements.addAll(_package.getPatterns().stream().map(it -> (Element) it).toList()); - return elements; - } - - protected List getInheritedElements(Typing typing) { - var elements = new ArrayList(); - - if (typing == null) { - return elements; - } - - if (typing instanceof ReferenceTyping referenceTyping) { - var chain = referenceTyping.getReference(); - var lastExpression = chain.getChains().get(chain.getChains().size() - 1); - var referencedElement = getReferredElement(lastExpression); - if (referencedElement instanceof Type type) { - elements.addAll(getInheritedElements(type)); - } - } - - return elements; - } - - protected List getInheritedElements(Type type) { - if (type == null) { - return List.of(); - } - - var supertype = type.getSupertype(); - var elements = new ArrayList(); - - elements.addAll(type.getFeatures()); - elements.addAll(type.getVariables()); - elements.addAll(type.getProperties()); - elements.addAll(type.getTransitions()); - elements.addAll(type.getInitTransition()); - elements.addAll(type.getHavocTransition()); - elements.addAll(type.getMainTransition()); - - elements.addAll(getInheritedElements(supertype)); - - return elements; - } - - protected Element getReferredElement(ReferenceExpression expression) { - if (expression instanceof DeclarationReferenceExpression declarationReference) { - return declarationReference.getElement(); - } else if (expression instanceof ChainReferenceExpression chainReference) { - return getReferredElement(chainReference.getChains().get(chainReference.getChains().size() - 1)); - } else { - return null; - } - } - - protected Element getReferredElement(ChainingExpression expression) { - if (expression instanceof DeclarationReferenceExpression declarationReferenceExpression) { - return declarationReferenceExpression.getElement(); - } - - throw new IllegalStateException(""); - } - } diff --git a/subprojects/oxsts.model/src/main/java/hu/bme/mit/semantifyr/oxsts/model/oxsts/OxstsUtils.java b/subprojects/oxsts.model/src/main/java/hu/bme/mit/semantifyr/oxsts/model/oxsts/OxstsUtils.java new file mode 100644 index 0000000..06fc051 --- /dev/null +++ b/subprojects/oxsts.model/src/main/java/hu/bme/mit/semantifyr/oxsts/model/oxsts/OxstsUtils.java @@ -0,0 +1,122 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 The Semantifyr Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package hu.bme.mit.semantifyr.oxsts.model.oxsts; + +import org.eclipse.emf.ecore.EObject; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class OxstsUtils { + + public static List getAccessibleElements(EObject element) { + if (element == null) { + return Collections.emptyList(); + } + + var parent = element.eContainer(); + var elements = new ArrayList(); + + elements.addAll(getLocalAccessibleElements(element)); + elements.addAll(getAccessibleElements(parent)); + + return elements; + } + + public static List getLocalAccessibleElements(EObject element) { + if (element == null) { + return Collections.emptyList(); + } + + var elements = new ArrayList(); + + switch (element) { + case Package _package -> { + elements.addAll(getLocalAccessibleElements(_package)); + elements.addAll(_package.getImports().stream().flatMap(it -> + getLocalAccessibleElements(it.getPackage()).stream() + ).toList()); + } + case Type type -> elements.addAll(getInheritedElements(type)); + case Feature feature -> elements.addAll(getInheritedElements(feature.getTyping())); + case Parameter parameter -> elements.addAll(getInheritedElements(parameter.getType())); + case Argument argument -> elements.addAll(getInheritedElements(argument.getTyping())); + default -> { + } + } + + return elements; + } + + public static List getLocalAccessibleElements(Package _package) { + var elements = new ArrayList(); + elements.addAll(_package.getTypes().stream().map(it -> (Element) it).toList()); + elements.addAll(_package.getEnums().stream().map(it -> (Element) it).toList()); + elements.addAll(_package.getPatterns().stream().map(it -> (Element) it).toList()); + return elements; + } + + public static List getInheritedElements(Typing typing) { + var elements = new ArrayList(); + + if (typing == null) { + return elements; + } + + if (typing instanceof ReferenceTyping referenceTyping) { + var chain = referenceTyping.getReference(); + var lastExpression = chain.getChains().get(chain.getChains().size() - 1); + var referencedElement = getReferredElement(lastExpression); + if (referencedElement instanceof Type type) { + elements.addAll(getInheritedElements(type)); + } + } + + return elements; + } + + public static List getInheritedElements(Type type) { + if (type == null) { + return List.of(); + } + + var supertype = type.getSupertype(); + var elements = new ArrayList(); + + elements.addAll(type.getFeatures()); + elements.addAll(type.getVariables()); + elements.addAll(type.getProperties()); + elements.addAll(type.getTransitions()); + elements.addAll(type.getInitTransition()); + elements.addAll(type.getHavocTransition()); + elements.addAll(type.getMainTransition()); + + elements.addAll(getInheritedElements(supertype)); + + return elements; + } + + public static Element getReferredElement(ReferenceExpression expression) { + if (expression instanceof DeclarationReferenceExpression declarationReference) { + return declarationReference.getElement(); + } else if (expression instanceof ChainReferenceExpression chainReference) { + return getReferredElement(chainReference.getChains().getLast()); + } else { + return null; + } + } + + public static Element getReferredElement(ChainingExpression expression) { + if (expression instanceof DeclarationReferenceExpression declarationReferenceExpression) { + return declarationReferenceExpression.getElement(); + } + + throw new IllegalStateException(""); + } + +} From 30a971dad7ed3cc4f18a87f78eb8f6182d1f8e4e Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Tue, 12 Nov 2024 19:33:56 +0100 Subject: [PATCH 14/27] Added basic Cex Witness generator --- .../semantifyr-vscode/src/extension.ts | 17 +- .../syntaxes/xsts.tmLanguage.json | 2 +- .../main/kotlin/commands/BaseVerifyCommand.kt | 5 +- .../src/main/kotlin/commands/VerifyCommand.kt | 37 +++- .../src/main/kotlin/theta/CexReader.kt | 6 + .../src/main/kotlin/theta/WitnessCreator.kt | 183 ++++++++++++++++++ .../src/main/kotlin/utils/OxstsFactory.kt | 20 +- .../main/kotlin/utils/OxstsReferenceUtils.kt | 35 ++++ .../src/main/kotlin/utils/OxstsUtils.kt | 4 + 9 files changed, 302 insertions(+), 7 deletions(-) create mode 100644 subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt create mode 100644 subprojects/semantifyr/src/main/kotlin/utils/OxstsReferenceUtils.kt diff --git a/subprojects/semantifyr-vscode/src/extension.ts b/subprojects/semantifyr-vscode/src/extension.ts index e3dc248..ea1c825 100644 --- a/subprojects/semantifyr-vscode/src/extension.ts +++ b/subprojects/semantifyr-vscode/src/extension.ts @@ -45,7 +45,13 @@ class OxstsCodeLensProvider implements vscode.CodeLensProvider { codeLenses.push(new vscode.CodeLens(range, { title: 'Verify', command: 'semantifyr.verifyTarget', - arguments: [targetName, document] + arguments: [targetName, document, true] + })); + + codeLenses.push(new vscode.CodeLens(range, { + title: 'Verify (no Witness)', + command: 'semantifyr.verifyTarget', + arguments: [targetName, document, false] })); } @@ -121,7 +127,7 @@ export function activate(context: ExtensionContext) { ); context.subscriptions.push( - vscode.commands.registerCommand('semantifyr.verifyTarget', (targetName: string, document: vscode.TextDocument) => { + vscode.commands.registerCommand('semantifyr.verifyTarget', (targetName: string, document: vscode.TextDocument, generateWitness: boolean) => { const documentPath = document.uri.fsPath; const documentDirectory = path.dirname(documentPath); const workspaceFolders = vscode.workspace.workspaceFolders; @@ -135,7 +141,12 @@ export function activate(context: ExtensionContext) { cancellable: false }, () => { return new Promise((resolve, reject) => { - const process = childProcess.spawn(runner, [commandArg, compilerExecutable, 'verify', documentPath, workspaceFolder, targetName]); + const args = [commandArg, compilerExecutable, 'verify', documentPath, workspaceFolder, targetName] + if (generateWitness) { + args.push("--witness") + } + + const process = childProcess.spawn(runner, args); outputChannel.clear(); diff --git a/subprojects/semantifyr-vscode/syntaxes/xsts.tmLanguage.json b/subprojects/semantifyr-vscode/syntaxes/xsts.tmLanguage.json index 4fbb67f..576763a 100644 --- a/subprojects/semantifyr-vscode/syntaxes/xsts.tmLanguage.json +++ b/subprojects/semantifyr-vscode/syntaxes/xsts.tmLanguage.json @@ -43,7 +43,7 @@ "patterns": [ { "name": "storage.type.xsts", - "match": "\\b(Integer|Boolean|Self|Nothing)\\b" + "match": "\\b(integer|boolean)\\b" } ] }, diff --git a/subprojects/semantifyr/src/main/kotlin/commands/BaseVerifyCommand.kt b/subprojects/semantifyr/src/main/kotlin/commands/BaseVerifyCommand.kt index b803f1d..985acb2 100644 --- a/subprojects/semantifyr/src/main/kotlin/commands/BaseVerifyCommand.kt +++ b/subprojects/semantifyr/src/main/kotlin/commands/BaseVerifyCommand.kt @@ -9,6 +9,7 @@ import com.github.ajalt.clikt.parameters.options.option import com.github.ajalt.clikt.parameters.types.file import com.github.ajalt.clikt.parameters.types.long import hu.bme.mit.semantifyr.oxsts.semantifyr.theta.ThetaExecutor +import hu.bme.mit.semantifyr.oxsts.semantifyr.theta.ThetaRuntimeDetails import org.slf4j.Logger import java.io.File import java.util.concurrent.TimeUnit @@ -29,7 +30,7 @@ abstract class BaseVerifyCommand(name: String) : CliktCommand(name) { ), ) - fun runVerification(xstsPath: String) { + fun runVerification(xstsPath: String): ThetaRuntimeDetails { val xstsFile = File(xstsPath) logger.info("Executing Theta (v$thetaVersion) on $xstsPath") @@ -47,6 +48,8 @@ abstract class BaseVerifyCommand(name: String) : CliktCommand(name) { val runtimeDetails = thetaExecutor.run(workingDirectory, fileName) logger.info("Verification result: isUnsafe = ${runtimeDetails.isUnsafe}") + + return runtimeDetails } } diff --git a/subprojects/semantifyr/src/main/kotlin/commands/VerifyCommand.kt b/subprojects/semantifyr/src/main/kotlin/commands/VerifyCommand.kt index b468a93..883b685 100644 --- a/subprojects/semantifyr/src/main/kotlin/commands/VerifyCommand.kt +++ b/subprojects/semantifyr/src/main/kotlin/commands/VerifyCommand.kt @@ -1,12 +1,20 @@ package hu.bme.mit.semantifyr.oxsts.semantifyr.commands import com.github.ajalt.clikt.parameters.arguments.argument +import com.github.ajalt.clikt.parameters.options.default +import com.github.ajalt.clikt.parameters.options.option +import com.github.ajalt.clikt.parameters.types.boolean import com.github.ajalt.clikt.parameters.types.file import hu.bme.mit.semantifyr.oxsts.semantifyr.reader.OxstsReader import hu.bme.mit.semantifyr.oxsts.semantifyr.reader.prepareOxsts import hu.bme.mit.semantifyr.oxsts.semantifyr.serialization.XstsSerializer +import hu.bme.mit.semantifyr.oxsts.semantifyr.theta.CexReader +import hu.bme.mit.semantifyr.oxsts.semantifyr.theta.ThetaRuntimeDetails +import hu.bme.mit.semantifyr.oxsts.semantifyr.theta.WitnessCreator +import hu.bme.mit.semantifyr.oxsts.semantifyr.theta.prepareCex import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.XstsTransformer import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.loggerFactory +import org.eclipse.emf.common.util.URI import java.io.File class VerifyCommand : BaseVerifyCommand("verify") { @@ -15,6 +23,7 @@ class VerifyCommand : BaseVerifyCommand("verify") { val libraryDirectory by argument().file(mustExist = true, canBeDir = true) val targetName by argument() + val witness by option("-w", "--witness").boolean().default(false) override fun run() { logger.info("Preparing Xtext Language") @@ -39,7 +48,33 @@ class VerifyCommand : BaseVerifyCommand("verify") { logger.info("Producing xsts file to $output") - runVerification(output) + val result = runVerification(output) + + if (witness) { + generateWitness(result, reader) + } + } + + private fun generateWitness( + result: ThetaRuntimeDetails, + reader: OxstsReader + ) { + logger.info("Generating witness from ${result.cexPath}") + + prepareCex() + + val cexReader = CexReader() + val cex = cexReader.readCexFile(File(result.cexPath)) + + val witnessCreator = WitnessCreator(reader) + + val witnessPath = model.path.replace(".oxsts", ".cex.oxsts") + val resource = reader.resourceSet.createResource(URI.createFileURI(witnessPath)) + resource.contents += witnessCreator.createWitness(targetName, cex) + + resource.save(null) + + logger.info("Saved witness to $witnessPath") } } diff --git a/subprojects/semantifyr/src/main/kotlin/theta/CexReader.kt b/subprojects/semantifyr/src/main/kotlin/theta/CexReader.kt index 1663384..f656125 100644 --- a/subprojects/semantifyr/src/main/kotlin/theta/CexReader.kt +++ b/subprojects/semantifyr/src/main/kotlin/theta/CexReader.kt @@ -1,3 +1,9 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 The Semantifyr Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + package hu.bme.mit.semantifyr.oxsts.semantifyr.theta import hu.bme.mit.semantifyr.cex.lang.CexStandaloneSetup diff --git a/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt b/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt new file mode 100644 index 0000000..9fa875d --- /dev/null +++ b/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt @@ -0,0 +1,183 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 The Semantifyr Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package hu.bme.mit.semantifyr.oxsts.semantifyr.theta + +import hu.bme.mit.semantifyr.cex.lang.cex.Cex +import hu.bme.mit.semantifyr.cex.lang.cex.ExplState +import hu.bme.mit.semantifyr.cex.lang.cex.ExplVariableState +import hu.bme.mit.semantifyr.cex.lang.cex.ExplVariableValue +import hu.bme.mit.semantifyr.cex.lang.cex.LiteralBoolean +import hu.bme.mit.semantifyr.cex.lang.cex.LiteralEnum +import hu.bme.mit.semantifyr.cex.lang.cex.LiteralInteger +import hu.bme.mit.semantifyr.cex.lang.cex.State +import hu.bme.mit.semantifyr.oxsts.model.oxsts.AssumptionOperation +import hu.bme.mit.semantifyr.oxsts.model.oxsts.Expression +import hu.bme.mit.semantifyr.oxsts.model.oxsts.Target +import hu.bme.mit.semantifyr.oxsts.semantifyr.reader.OxstsReader +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.Namings +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.NothingInstance +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.OxstsFactory +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.findInitTransition +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.findMainTransition +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.fullyQualifiedName +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.resolvePath +import java.io.File + +fun ExplVariableValue.toExpression(target: Target): Expression { + return when (this) { + is LiteralEnum -> toExpression(target) + is LiteralBoolean -> OxstsFactory.createLiteralBoolean(isValue) + is LiteralInteger -> OxstsFactory.createLiteralInteger(value) + else -> error("Unkown VariableValue: $this") + } +} + +fun LiteralEnum.toExpression(target: Target): Expression { + val instanceFullyQualifiedName = value.removeSuffix(Namings.LITERAL_SUFFIX) + + if (instanceFullyQualifiedName == NothingInstance.fullyQualifiedName) { + return OxstsFactory.createChainReferenceExpression(OxstsFactory.createNothingReference()) + } + + return target.resolvePath(instanceFullyQualifiedName) +} + +class OxstsVariableState( + variableState: ExplVariableState, + target: Target +) { + val reference = target.resolvePath(variableState.variable) + val value = variableState.value.toExpression(target) +} +fun ExplVariableState.toOxstsVariableState(target: Target) = OxstsVariableState(this, target) + +class OxstsWitnessState( + state: ExplState, + target: Target +) { + val variableStates = state.variableStates.map { + it.toOxstsVariableState(target) + } +} +fun ExplState.toOxstsWitnessState(target: Target) = OxstsWitnessState(this, target) + +fun State.toOxstsWitnessState(target: Target): OxstsWitnessState { + return when (this) { + is ExplState -> toOxstsWitnessState(target) + else -> error("") + } +} + +fun OxstsVariableState.toAssumption(): AssumptionOperation { + return OxstsFactory.createEqualityAssumption(reference, value) +} + +fun OxstsWitnessState.toAssumptionOperations(): List { + return variableStates.map { + it.toAssumption() + } +} + +class Witness( + cex: Cex, + target: Target +) { + +// val initialState = cex.states.single { +// it.isPreInit +// }.state.toOxstsWitnessState(target) + + val initializedState = cex.states.first { + it.isPostInit && it.isLastInternal + }.state.toOxstsWitnessState(target) + + val transitionStates = cex.states.asSequence().drop(1).filter { // first state is the init transition + it.isPostInit && it.isLastInternal + }.map { + it.state.toOxstsWitnessState(target) + } + +} + +fun Cex.toWitness(target: Target) = Witness(this, target) + +class WitnessMapping( + val target: Target +) { + + val witnessPackage by lazy { + OxstsFactory.createPackage().also { + it.name = "Witness" + } + } + + val witnessType by lazy { + OxstsFactory.createTarget().also { + witnessPackage.types += it + + it.name = "${target.name}_Witness" + it.supertype = target + } + } + + val stateVariable by lazy { + OxstsFactory.createVariable().also { + witnessType.variables += it + + it.name = "state" + it.typing = OxstsFactory.createIntegerType() + it.expression = OxstsFactory.createLiteralInteger(-1) + } + } + + fun transform(cex: Cex) { + val witness = cex.toWitness(target) + + witnessType.initTransition += OxstsFactory.createSequentialTransition { + operation += OxstsFactory.createInlineCall(OxstsFactory.createChainReferenceExpression(target.findInitTransition()), isStatic = true) + + operation += witness.initializedState.toAssumptionOperations() + } + + witnessType.mainTransition += OxstsFactory.createSequentialTransition { + for (transitionState in witness.transitionStates) { + operation += OxstsFactory.createInlineCall(OxstsFactory.createChainReferenceExpression(target.findMainTransition()), isStatic = true) + + operation += transitionState.toAssumptionOperations() + } + } + } + +} + +class WitnessCreator( + private val reader: OxstsReader +) { + + fun createWitness(targetName: String, cex: Cex): hu.bme.mit.semantifyr.oxsts.model.oxsts.Package { + val target = reader.rootElements.flatMap { it.types }.filterIsInstance().first { + it.name == targetName + } + + val mapping = WitnessMapping(target) + + mapping.transform(cex) + + return mapping.witnessPackage + } + +} + + +fun main() { + prepareCex() + val reader = CexReader() + val cex = reader.readCexFile(File("C:\\Users\\Armin\\work\\ftsrg\\semantifyr\\subprojects\\semantifyr\\TestModels\\Automated\\Gamma\\Spacecraft\\artifacts\\Spacecraft_batteryCharge_100_Unsafe\\Spacecraft_batteryCharge_100_Unsafe0.cex")) + + + +} diff --git a/subprojects/semantifyr/src/main/kotlin/utils/OxstsFactory.kt b/subprojects/semantifyr/src/main/kotlin/utils/OxstsFactory.kt index b87117a..19c53b6 100644 --- a/subprojects/semantifyr/src/main/kotlin/utils/OxstsFactory.kt +++ b/subprojects/semantifyr/src/main/kotlin/utils/OxstsFactory.kt @@ -26,6 +26,8 @@ import hu.bme.mit.semantifyr.oxsts.model.oxsts.Operation import hu.bme.mit.semantifyr.oxsts.model.oxsts.OrOperator import hu.bme.mit.semantifyr.oxsts.model.oxsts.ReferenceExpression import hu.bme.mit.semantifyr.oxsts.model.oxsts.ReferenceTyping +import hu.bme.mit.semantifyr.oxsts.model.oxsts.SequenceOperation +import hu.bme.mit.semantifyr.oxsts.model.oxsts.Transition import hu.bme.mit.semantifyr.oxsts.model.oxsts.impl.OxstsFactoryImpl object OxstsFactory : OxstsFactoryImpl() { @@ -33,6 +35,12 @@ object OxstsFactory : OxstsFactoryImpl() { return createAssumptionOperation(createLiteralBoolean(true)) } + inline fun createSequentialTransition(creator: SequenceOperation.() -> Unit): Transition { + return createTransition().also { + it.operation += createSequenceOperation().also(creator) + } + } + fun createEnumLiteral(name: String): EnumLiteral { return createEnumLiteral().also { it.name = name @@ -91,9 +99,10 @@ object OxstsFactory : OxstsFactoryImpl() { } } - fun createInlineCall(referenceExpression: ReferenceExpression): InlineCall { + fun createInlineCall(referenceExpression: ReferenceExpression, isStatic: Boolean = false): InlineCall { return createInlineCall().also { it.reference = referenceExpression + it.isStatic = isStatic } } @@ -135,4 +144,13 @@ object OxstsFactory : OxstsFactoryImpl() { } } + fun createEqualityAssumption(referenceExpression: ReferenceExpression, expression: Expression): AssumptionOperation { + return createAssumptionOperation( + createEqualityOperator().also { + it.operands += referenceExpression + it.operands += expression + } + ) + } + } diff --git a/subprojects/semantifyr/src/main/kotlin/utils/OxstsReferenceUtils.kt b/subprojects/semantifyr/src/main/kotlin/utils/OxstsReferenceUtils.kt new file mode 100644 index 0000000..635e109 --- /dev/null +++ b/subprojects/semantifyr/src/main/kotlin/utils/OxstsReferenceUtils.kt @@ -0,0 +1,35 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 The Semantifyr Authors + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package hu.bme.mit.semantifyr.oxsts.semantifyr.utils + +import hu.bme.mit.semantifyr.oxsts.model.oxsts.DeclarationReferenceExpression +import hu.bme.mit.semantifyr.oxsts.model.oxsts.Element +import hu.bme.mit.semantifyr.oxsts.model.oxsts.OxstsUtils +import hu.bme.mit.semantifyr.oxsts.model.oxsts.ReferenceExpression + +fun Element.resolveElement(name: String): DeclarationReferenceExpression { + val accessibleElements = OxstsUtils.getAccessibleElements(this) + + val element = accessibleElements.filterIsInstance().first { + it.name == name + } + + return OxstsFactory.createDeclarationReferenceExpression(element) +} + +fun Element.resolvePath(path: String): ReferenceExpression { + val segments = path.split(Namings.SYNTHETIC_SEPARATOR).drop(2) // first is 'this' + val chains = mutableListOf() + var lastElement = this + + for (segment in segments) { + chains += lastElement.resolveElement(segment) + lastElement = chains.last().element + } + + return OxstsFactory.createChainReferenceExpression(chains) +} diff --git a/subprojects/semantifyr/src/main/kotlin/utils/OxstsUtils.kt b/subprojects/semantifyr/src/main/kotlin/utils/OxstsUtils.kt index 4e972fc..f3247f7 100644 --- a/subprojects/semantifyr/src/main/kotlin/utils/OxstsUtils.kt +++ b/subprojects/semantifyr/src/main/kotlin/utils/OxstsUtils.kt @@ -95,6 +95,10 @@ fun ChainReferenceExpression.appendWith(chainReferenceExpression: ChainReference val ChainReferenceExpression.isStaticReference get() = referencedElementOrNull()?.isStatic ?: false +fun ChainingExpression.toReferenceExpression(): ChainReferenceExpression { + return OxstsFactory.createChainReferenceExpression(this) +} + val Element.isStatic get() = when (this) { is EnumLiteral -> true From 1a0d0165a9ca654adfeaa5aeb09fefedc353ed27 Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Wed, 13 Nov 2024 15:35:01 +0100 Subject: [PATCH 15/27] Added Summary generation (default) --- .../src/main/kotlin/theta/WitnessCreator.kt | 123 +++++++++++++++--- .../src/main/kotlin/utils/CollectionUtils.kt | 70 ++++++++++ .../src/main/kotlin/utils/OxstsFactory.kt | 8 ++ 3 files changed, 184 insertions(+), 17 deletions(-) diff --git a/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt b/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt index 9fa875d..baa84ce 100644 --- a/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt +++ b/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt @@ -14,13 +14,18 @@ import hu.bme.mit.semantifyr.cex.lang.cex.LiteralBoolean import hu.bme.mit.semantifyr.cex.lang.cex.LiteralEnum import hu.bme.mit.semantifyr.cex.lang.cex.LiteralInteger import hu.bme.mit.semantifyr.cex.lang.cex.State +import hu.bme.mit.semantifyr.cex.lang.cex.XstsState +import hu.bme.mit.semantifyr.oxsts.model.oxsts.AssignmentOperation import hu.bme.mit.semantifyr.oxsts.model.oxsts.AssumptionOperation import hu.bme.mit.semantifyr.oxsts.model.oxsts.Expression import hu.bme.mit.semantifyr.oxsts.model.oxsts.Target import hu.bme.mit.semantifyr.oxsts.semantifyr.reader.OxstsReader +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.MultiMap import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.Namings import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.NothingInstance import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.OxstsFactory +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils._package +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.copy import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.findInitTransition import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.findMainTransition import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.fullyQualifiedName @@ -59,21 +64,20 @@ class OxstsWitnessState( state: ExplState, target: Target ) { + val id = maxId++ val variableStates = state.variableStates.map { it.toOxstsVariableState(target) } -} -fun ExplState.toOxstsWitnessState(target: Target) = OxstsWitnessState(this, target) -fun State.toOxstsWitnessState(target: Target): OxstsWitnessState { - return when (this) { - is ExplState -> toOxstsWitnessState(target) - else -> error("") + companion object { + private var maxId = 0; } } +fun ExplState.toOxstsWitnessState(target: Target) = OxstsWitnessState(this, target) + fun OxstsVariableState.toAssumption(): AssumptionOperation { - return OxstsFactory.createEqualityAssumption(reference, value) + return OxstsFactory.createEqualityAssumption(reference.copy(), value.copy()) } fun OxstsWitnessState.toAssumptionOperations(): List { @@ -82,23 +86,66 @@ fun OxstsWitnessState.toAssumptionOperations(): List { } } +val XstsState.isTran + get() = isPostInit && isLastInternal + class Witness( cex: Cex, target: Target ) { + val stateMap = mutableMapOf() + // val initialState = cex.states.single { // it.isPreInit // }.state.toOxstsWitnessState(target) val initializedState = cex.states.first { - it.isPostInit && it.isLastInternal - }.state.toOxstsWitnessState(target) + it.isTran + }.state.transform(target) - val transitionStates = cex.states.asSequence().drop(1).filter { // first state is the init transition - it.isPostInit && it.isLastInternal + val transitionStates = cex.states.drop(1).filter { // first state is the init transition + it.isTran }.map { - it.state.toOxstsWitnessState(target) + it.state.transform(target) + } + + val edgeMap = MultiMap().also { + for (edge in cex.edges) { + it.put(edge.from.state, edge.to.state) + } + } + + val transitions = MultiMap().also { + val tranEdges = cex.edges.filter { + it.from.isTran + } + + if (tranEdges.isEmpty()) { + for (index in 1..< transitionStates.size) { + val sourceState = transitionStates[index - 1] + val targetState = transitionStates[index] + + it.put(sourceState, targetState) + } + } else { + for (edge in tranEdges) { + val sourceState = edge.from.state.transform(target) + val environmentTarget = edge.to.state + val tranTargets = edgeMap[environmentTarget].map { + it.transform(target) + } + + it.putAll(sourceState, tranTargets) + } + } + } + + fun State.transform(target: Target) = stateMap.getOrPut(this) { + when (this) { + is ExplState -> toOxstsWitnessState(target) + else -> error("") + } } } @@ -111,7 +158,7 @@ class WitnessMapping( val witnessPackage by lazy { OxstsFactory.createPackage().also { - it.name = "Witness" + it.name = "${target._package.name}_Witness" } } @@ -138,20 +185,62 @@ class WitnessMapping( val witness = cex.toWitness(target) witnessType.initTransition += OxstsFactory.createSequentialTransition { + operation += stateVariableAssumption(-1) + operation += OxstsFactory.createInlineCall(OxstsFactory.createChainReferenceExpression(target.findInitTransition()), isStatic = true) operation += witness.initializedState.toAssumptionOperations() + + operation += stateVariableAssignment(0) } - witnessType.mainTransition += OxstsFactory.createSequentialTransition { - for (transitionState in witness.transitionStates) { - operation += OxstsFactory.createInlineCall(OxstsFactory.createChainReferenceExpression(target.findMainTransition()), isStatic = true) +// witnessType.mainTransition += OxstsFactory.createSequentialTransition { +// for (transitionState in witness.transitionStates) { +// operation += OxstsFactory.createInlineCall(OxstsFactory.createChainReferenceExpression(target.findMainTransition()), isStatic = true) +// +// operation += transitionState.toAssumptionOperations() +// } +// } - operation += transitionState.toAssumptionOperations() + witnessType.mainTransition += OxstsFactory.createSequentialTransition { + operation += OxstsFactory.createChoiceOperation().also { + for (transitionState in witness.transitionStates) { + it.operation += OxstsFactory.createSequenceOperation().also { + it.operation += stateVariableAssumption(transitionState.id) + + it.operation += OxstsFactory.createInlineCall(OxstsFactory.createChainReferenceExpression(target.findMainTransition()), isStatic = true) + + it.operation += transitionState.toAssumptionOperations() + + if (!witness.transitions[transitionState].isEmpty()) { + it.operation += OxstsFactory.createChoiceOperation().also { + for (nextState in witness.transitions[transitionState]) { + it.operation += OxstsFactory.createSequenceOperation().also { + it.operation += stateVariableAssignment(nextState.id) + } + } + } + } + } + } } } } + fun stateVariableAssumption(value: Int): AssumptionOperation { + return OxstsFactory.createEqualityAssumption( + referenceExpression = OxstsFactory.createChainReferenceExpression(stateVariable), + expression = OxstsFactory.createLiteralInteger(value) + ) + } + + fun stateVariableAssignment(value: Int): AssignmentOperation { + return OxstsFactory.createAssignmentOperation( + referenceExpression = OxstsFactory.createChainReferenceExpression(stateVariable), + expression = OxstsFactory.createLiteralInteger(value) + ) + } + } class WitnessCreator( diff --git a/subprojects/semantifyr/src/main/kotlin/utils/CollectionUtils.kt b/subprojects/semantifyr/src/main/kotlin/utils/CollectionUtils.kt index 005e97a..afda2a9 100644 --- a/subprojects/semantifyr/src/main/kotlin/utils/CollectionUtils.kt +++ b/subprojects/semantifyr/src/main/kotlin/utils/CollectionUtils.kt @@ -7,3 +7,73 @@ package hu.bme.mit.semantifyr.oxsts.semantifyr.utils inline fun > C.except(other: T) = asSequence().filter { it != other }.toSet() + +class MultiMap { + private val map = hashMapOf>() + + var size: Int = 0 + private set + val values: Collection> + get() = map.values + val flatValues: Collection + get() = map.values.flatten() + + fun isEmpty(): Boolean { + return map.isEmpty() + } + + operator fun get(key: K): Collection { + return map[key] ?: emptyList() + } + + fun containsValue(value: V): Boolean { + return flatValues.contains(value) + } + + fun putAll(key: K, value: Collection) { + val list = map.getOrPut(key) { + mutableListOf() + } + list.addAll(value) + + size += value.size + } + + fun put(key: K, value: V) { + val list = map.getOrPut(key) { + mutableListOf() + } + + list.add(value) + + size++ + } + + fun remove(key: K, value: V): Boolean { + if (map.containsKey(key)) { + val list = map[key]!! + + val removed = list.remove(value) + + if (list.isEmpty()) { + map.remove(key) + } + + if (removed) { + size-- + } + + return removed + } + + return false + } + + fun containsKey(key: K) = map.containsKey(key) + + fun remove(key: K) { + val removed = map.remove(key) + size -= removed?.size ?: 0 + } + +} diff --git a/subprojects/semantifyr/src/main/kotlin/utils/OxstsFactory.kt b/subprojects/semantifyr/src/main/kotlin/utils/OxstsFactory.kt index 19c53b6..23d3468 100644 --- a/subprojects/semantifyr/src/main/kotlin/utils/OxstsFactory.kt +++ b/subprojects/semantifyr/src/main/kotlin/utils/OxstsFactory.kt @@ -7,6 +7,7 @@ package hu.bme.mit.semantifyr.oxsts.semantifyr.utils import hu.bme.mit.semantifyr.oxsts.model.oxsts.AndOperator +import hu.bme.mit.semantifyr.oxsts.model.oxsts.AssignmentOperation import hu.bme.mit.semantifyr.oxsts.model.oxsts.Association import hu.bme.mit.semantifyr.oxsts.model.oxsts.AssumptionOperation import hu.bme.mit.semantifyr.oxsts.model.oxsts.ChainReferenceExpression @@ -153,4 +154,11 @@ object OxstsFactory : OxstsFactoryImpl() { ) } + fun createAssignmentOperation(referenceExpression: ReferenceExpression, expression: Expression): AssignmentOperation { + return createAssignmentOperation().also { + it.reference = referenceExpression + it.expression = expression + } + } + } From 304915278615175eeda340c1d6cb8823ec29a091 Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Wed, 13 Nov 2024 16:12:00 +0100 Subject: [PATCH 16/27] Added generateWitness as flag option --- .../semantifyr/src/main/kotlin/commands/VerifyCommand.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/subprojects/semantifyr/src/main/kotlin/commands/VerifyCommand.kt b/subprojects/semantifyr/src/main/kotlin/commands/VerifyCommand.kt index 883b685..6c6bf5b 100644 --- a/subprojects/semantifyr/src/main/kotlin/commands/VerifyCommand.kt +++ b/subprojects/semantifyr/src/main/kotlin/commands/VerifyCommand.kt @@ -1,9 +1,8 @@ package hu.bme.mit.semantifyr.oxsts.semantifyr.commands import com.github.ajalt.clikt.parameters.arguments.argument -import com.github.ajalt.clikt.parameters.options.default +import com.github.ajalt.clikt.parameters.options.flag import com.github.ajalt.clikt.parameters.options.option -import com.github.ajalt.clikt.parameters.types.boolean import com.github.ajalt.clikt.parameters.types.file import hu.bme.mit.semantifyr.oxsts.semantifyr.reader.OxstsReader import hu.bme.mit.semantifyr.oxsts.semantifyr.reader.prepareOxsts @@ -23,7 +22,7 @@ class VerifyCommand : BaseVerifyCommand("verify") { val libraryDirectory by argument().file(mustExist = true, canBeDir = true) val targetName by argument() - val witness by option("-w", "--witness").boolean().default(false) + val generateWitness by option("-w", "--witness").flag() override fun run() { logger.info("Preparing Xtext Language") @@ -50,7 +49,7 @@ class VerifyCommand : BaseVerifyCommand("verify") { val result = runVerification(output) - if (witness) { + if (generateWitness && result.isUnsafe) { generateWitness(result, reader) } } From 54321657a174fbd437467a0b36d1292bc962af36 Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Wed, 13 Nov 2024 16:17:21 +0100 Subject: [PATCH 17/27] Drop was skipping the first state, not the first transition state --- .../semantifyr/src/main/kotlin/theta/WitnessCreator.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt b/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt index baa84ce..51df862 100644 --- a/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt +++ b/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt @@ -104,9 +104,9 @@ class Witness( it.isTran }.state.transform(target) - val transitionStates = cex.states.drop(1).filter { // first state is the init transition + val transitionStates = cex.states.filter { // first state is the init transition it.isTran - }.map { + }.drop(1).map { it.state.transform(target) } From 29d2a1975db6a35d08ae31986e60b0cc27ece2da Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Wed, 13 Nov 2024 16:19:27 +0100 Subject: [PATCH 18/27] States are now optional to support short witnesses --- .../src/main/kotlin/theta/WitnessCreator.kt | 42 +++++++++++-------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt b/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt index 51df862..afb0cd0 100644 --- a/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt +++ b/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt @@ -100,9 +100,9 @@ class Witness( // it.isPreInit // }.state.toOxstsWitnessState(target) - val initializedState = cex.states.first { + val initializedState = cex.states.firstOrNull { it.isTran - }.state.transform(target) + }?.state?.transform(target) val transitionStates = cex.states.filter { // first state is the init transition it.isTran @@ -189,9 +189,13 @@ class WitnessMapping( operation += OxstsFactory.createInlineCall(OxstsFactory.createChainReferenceExpression(target.findInitTransition()), isStatic = true) - operation += witness.initializedState.toAssumptionOperations() + if (witness.initializedState != null) { + operation += witness.initializedState.toAssumptionOperations() + } - operation += stateVariableAssignment(0) + if (witness.transitionStates.any()) { + operation += stateVariableAssignment(witness.transitionStates.first().id) + } } // witnessType.mainTransition += OxstsFactory.createSequentialTransition { @@ -203,20 +207,22 @@ class WitnessMapping( // } witnessType.mainTransition += OxstsFactory.createSequentialTransition { - operation += OxstsFactory.createChoiceOperation().also { - for (transitionState in witness.transitionStates) { - it.operation += OxstsFactory.createSequenceOperation().also { - it.operation += stateVariableAssumption(transitionState.id) - - it.operation += OxstsFactory.createInlineCall(OxstsFactory.createChainReferenceExpression(target.findMainTransition()), isStatic = true) - - it.operation += transitionState.toAssumptionOperations() - - if (!witness.transitions[transitionState].isEmpty()) { - it.operation += OxstsFactory.createChoiceOperation().also { - for (nextState in witness.transitions[transitionState]) { - it.operation += OxstsFactory.createSequenceOperation().also { - it.operation += stateVariableAssignment(nextState.id) + if (witness.transitionStates.any()) { + operation += OxstsFactory.createChoiceOperation().also { + for (transitionState in witness.transitionStates) { + it.operation += OxstsFactory.createSequenceOperation().also { + it.operation += stateVariableAssumption(transitionState.id) + + it.operation += OxstsFactory.createInlineCall(OxstsFactory.createChainReferenceExpression(target.findMainTransition()), isStatic = true) + + it.operation += transitionState.toAssumptionOperations() + + if (!witness.transitions[transitionState].isEmpty()) { + it.operation += OxstsFactory.createChoiceOperation().also { + for (nextState in witness.transitions[transitionState]) { + it.operation += OxstsFactory.createSequenceOperation().also { + it.operation += stateVariableAssignment(nextState.id) + } } } } From 25b5ce6229ca15af06dd340ff300691a08e214a6 Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Wed, 13 Nov 2024 16:19:56 +0100 Subject: [PATCH 19/27] Use the original package name instead of a new one --- subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt b/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt index afb0cd0..140ec91 100644 --- a/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt +++ b/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt @@ -158,7 +158,7 @@ class WitnessMapping( val witnessPackage by lazy { OxstsFactory.createPackage().also { - it.name = "${target._package.name}_Witness" + it.name = target._package.name } } From c2945be25d58031509a0e75d1a271000610a8bb0 Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Wed, 13 Nov 2024 16:51:09 +0100 Subject: [PATCH 20/27] Added additional formatting to OxstsFormatter --- .../oxsts/lang/formatting2/OxstsFormatter.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/formatting2/OxstsFormatter.java b/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/formatting2/OxstsFormatter.java index 1f6e178..9b639cc 100644 --- a/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/formatting2/OxstsFormatter.java +++ b/subprojects/oxsts.lang/src/main/java/hu/bme/mit/semantifyr/oxsts/lang/formatting2/OxstsFormatter.java @@ -173,7 +173,9 @@ protected void format(HavocOperation operation, IFormattableDocument document) { } protected void format(AssignmentOperation operation, IFormattableDocument document) { - document.prepend(regionFor(operation).feature(OxstsPackage.Literals.ASSIGNMENT_OPERATION__REFERENCE), this::newLine); + var reference = (ChainReferenceExpression) operation.getReference(); + var firstDeclaration = (DeclarationReferenceExpression) reference.getChains().getFirst(); + document.prepend(regionFor(firstDeclaration).feature(OxstsPackage.Literals.DECLARATION_REFERENCE_EXPRESSION__ELEMENT), this::newLine); document.format(operation.getReference()); document.format(operation.getExpression()); @@ -269,6 +271,18 @@ protected void format(ChainReferenceExpression expression, IFormattableDocument document.prepend(allRegionsFor(expression).keyword("."), this::noSpace); document.append(allRegionsFor(expression).keyword("."), this::noSpace); + for (var expr : expression.getChains().stream().skip(1).toList()) { + if (expr instanceof DeclarationReferenceExpression declarationReferenceExpression) { + document.prepend(regionFor(declarationReferenceExpression).feature(OxstsPackage.Literals.DECLARATION_REFERENCE_EXPRESSION__ELEMENT), this::noSpace); + } + } + + for (var expr : expression.getChains().stream().limit(expression.getChains().size() - 1).toList()) { + if (expr instanceof DeclarationReferenceExpression declarationReferenceExpression) { + document.append(regionFor(declarationReferenceExpression).feature(OxstsPackage.Literals.DECLARATION_REFERENCE_EXPRESSION__ELEMENT), this::noSpace); + } + } + for (var expr : expression.getChains()) { document.format(expr); } From 128e83b98ccd09e7e4335f355b2ab41cef7c3273 Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Wed, 13 Nov 2024 17:17:48 +0100 Subject: [PATCH 21/27] Filtering check should not assume anything --- .../src/main/kotlin/transformation/rewrite/OperationInliner.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/semantifyr/src/main/kotlin/transformation/rewrite/OperationInliner.kt b/subprojects/semantifyr/src/main/kotlin/transformation/rewrite/OperationInliner.kt index aa7599c..3f5b07c 100644 --- a/subprojects/semantifyr/src/main/kotlin/transformation/rewrite/OperationInliner.kt +++ b/subprojects/semantifyr/src/main/kotlin/transformation/rewrite/OperationInliner.kt @@ -110,7 +110,7 @@ class OperationInliner( private fun Operation.rewriteToArguments(arguments: List, bindings: List): Operation { val references = EcoreUtil2.getAllContents(this, true).asSequence().filterIsInstance().filter { - arguments.contains(it.chains.first().referencedElement()) + arguments.contains(it.chains.firstOrNull()?.referencedElementOrNull()) }.toList() for (reference in references) { From 91f0f5debef584d5f534a722854b77617c390c9c Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Tue, 26 Nov 2024 14:05:12 +0100 Subject: [PATCH 22/27] #18 Node download, skip vsce package --- .../semantifyr-vscode/build.gradle.kts | 52 ++++++++++--------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/subprojects/semantifyr-vscode/build.gradle.kts b/subprojects/semantifyr-vscode/build.gradle.kts index 95a662d..c9746dc 100644 --- a/subprojects/semantifyr-vscode/build.gradle.kts +++ b/subprojects/semantifyr-vscode/build.gradle.kts @@ -12,6 +12,10 @@ plugins { alias(libs.plugins.gradle.node) } +node { + download = true +} + val distributionClasspath by configurations.creating { isCanBeConsumed = false isCanBeResolved = true @@ -47,32 +51,32 @@ tasks { outputs.dir("dist") } - val packageExtension by registering(Exec::class) { - inputs.files(cloneDistribution.get().outputs) - inputs.files(compile.get().outputs) - inputs.dir("node_modules") - - outputs.dir(project.layout.buildDirectory.dir("vscode")) - - if (Os.isFamily(Os.FAMILY_WINDOWS)) { - commandLine( - "cmd", - "/c", - "node_modules\\.bin\\vsce.cmd", - "package", - "--out", project.layout.buildDirectory.dir("vscode").get().asFile.absolutePath, - ) - } else { - commandLine( - "sh", - "-c", - "node_modules/.bin/vsce package --out " + project.layout.buildDirectory.dir("vscode").get().asFile.absolutePath, - ) - } - } +// val packageExtension by registering(Exec::class) { +// inputs.files(cloneDistribution.get().outputs) +// inputs.files(compile.get().outputs) +// inputs.dir("node_modules") +// +// outputs.dir(project.layout.buildDirectory.dir("vscode")) +// +// if (Os.isFamily(Os.FAMILY_WINDOWS)) { +// commandLine( +// "cmd", +// "/c", +// "node_modules\\.bin\\vsce.cmd", +// "package", +// "--out", project.layout.buildDirectory.dir("vscode").get().asFile.absolutePath, +// ) +// } else { +// commandLine( +// "sh", +// "-c", +// "node_modules/.bin/vsce package --out " + project.layout.buildDirectory.dir("vscode").get().asFile.absolutePath, +// ) +// } +// } assemble { - inputs.files(packageExtension.get().outputs) + inputs.files(compile.get().outputs) } clean { From 3935b8b44aeb34227e12c805ad46271b1246cedb Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Thu, 23 Jan 2025 15:34:58 +0100 Subject: [PATCH 23/27] #18 Updated CEX Witness creator --- .../src/main/kotlin/theta/WitnessCreator.kt | 148 +++++++++--------- 1 file changed, 73 insertions(+), 75 deletions(-) diff --git a/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt b/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt index 140ec91..46ac782 100644 --- a/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt +++ b/subprojects/semantifyr/src/main/kotlin/theta/WitnessCreator.kt @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2023-2024 The Semantifyr Authors + * SPDX-FileCopyrightText: 2023-2025 The Semantifyr Authors * * SPDX-License-Identifier: EPL-2.0 */ @@ -17,9 +17,13 @@ import hu.bme.mit.semantifyr.cex.lang.cex.State import hu.bme.mit.semantifyr.cex.lang.cex.XstsState import hu.bme.mit.semantifyr.oxsts.model.oxsts.AssignmentOperation import hu.bme.mit.semantifyr.oxsts.model.oxsts.AssumptionOperation +import hu.bme.mit.semantifyr.oxsts.model.oxsts.ChoiceOperation import hu.bme.mit.semantifyr.oxsts.model.oxsts.Expression +import hu.bme.mit.semantifyr.oxsts.model.oxsts.SequenceOperation import hu.bme.mit.semantifyr.oxsts.model.oxsts.Target +import hu.bme.mit.semantifyr.oxsts.model.oxsts.Transition import hu.bme.mit.semantifyr.oxsts.semantifyr.reader.OxstsReader +import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.optimization.OperationOptimizer.optimize import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.MultiMap import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.Namings import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.NothingInstance @@ -30,7 +34,6 @@ import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.findInitTransition import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.findMainTransition import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.fullyQualifiedName import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.resolvePath -import java.io.File fun ExplVariableValue.toExpression(target: Target): Expression { return when (this) { @@ -60,6 +63,10 @@ class OxstsVariableState( } fun ExplVariableState.toOxstsVariableState(target: Target) = OxstsVariableState(this, target) +fun OxstsVariableState.toAssumption(): AssumptionOperation { + return OxstsFactory.createEqualityAssumption(reference.copy(), value.copy()) +} + class OxstsWitnessState( state: ExplState, target: Target @@ -75,11 +82,6 @@ class OxstsWitnessState( } fun ExplState.toOxstsWitnessState(target: Target) = OxstsWitnessState(this, target) - -fun OxstsVariableState.toAssumption(): AssumptionOperation { - return OxstsFactory.createEqualityAssumption(reference.copy(), value.copy()) -} - fun OxstsWitnessState.toAssumptionOperations(): List { return variableStates.map { it.toAssumption() @@ -94,7 +96,7 @@ class Witness( target: Target ) { - val stateMap = mutableMapOf() + private val stateMap = mutableMapOf() // val initialState = cex.states.single { // it.isPreInit @@ -104,29 +106,37 @@ class Witness( it.isTran }?.state?.transform(target) - val transitionStates = cex.states.filter { // first state is the init transition + val transitionStates = cex.states.filter { it.isTran - }.drop(1).map { + }.drop(1).map { // first state is the init transition it.state.transform(target) } - val edgeMap = MultiMap().also { + private val edgeMap = MultiMap().also { for (edge in cex.edges) { it.put(edge.from.state, edge.to.state) } } + val isSingleTrace = cex.edges.isEmpty() + val isSummary = !isSingleTrace + val transitions = MultiMap().also { val tranEdges = cex.edges.filter { it.from.isTran } if (tranEdges.isEmpty()) { - for (index in 1..< transitionStates.size) { - val sourceState = transitionStates[index - 1] - val targetState = transitionStates[index] + if (transitionStates.any()) { + if (initializedState != null) { + it.put(initializedState, transitionStates.first()) + } + for (index in 1.. toOxstsWitnessState(target) - else -> error("") + else -> error("Unknown State $this") } } @@ -152,8 +162,9 @@ class Witness( fun Cex.toWitness(target: Target) = Witness(this, target) -class WitnessMapping( - val target: Target +class OxstsWitness( + private val target: Target, + cex: Cex ) { val witnessPackage by lazy { @@ -162,7 +173,7 @@ class WitnessMapping( } } - val witnessType by lazy { + private val witnessType by lazy { OxstsFactory.createTarget().also { witnessPackage.types += it @@ -171,76 +182,75 @@ class WitnessMapping( } } - val stateVariable by lazy { + private val stateVariable by lazy { OxstsFactory.createVariable().also { witnessType.variables += it it.name = "state" it.typing = OxstsFactory.createIntegerType() - it.expression = OxstsFactory.createLiteralInteger(-1) } } - fun transform(cex: Cex) { + init { val witness = cex.toWitness(target) witnessType.initTransition += OxstsFactory.createSequentialTransition { - operation += stateVariableAssumption(-1) - - operation += OxstsFactory.createInlineCall(OxstsFactory.createChainReferenceExpression(target.findInitTransition()), isStatic = true) - if (witness.initializedState != null) { - operation += witness.initializedState.toAssumptionOperations() + operation += witness.createTransitionOperation(witness.initializedState, target.findInitTransition()) } + }.optimize() - if (witness.transitionStates.any()) { - operation += stateVariableAssignment(witness.transitionStates.first().id) + if (witness.isSingleTrace) { + witnessType.mainTransition += OxstsFactory.createSequentialTransition { + for (transitionState in witness.transitionStates) { + operation += witness.createTransitionOperation(transitionState, target.findMainTransition()) + } + }.optimize() + } else { + witnessType.mainTransition += OxstsFactory.createSequentialTransition { + if (witness.transitionStates.any()) { + operation += OxstsFactory.createChoiceOperation().also { + for (transitionState in witness.transitionStates) { + it.operation += witness.createTransitionOperation(transitionState, target.findMainTransition()) + } + } + } + }.optimize() + } + } + + private fun Witness.createTransitionOperation(transitionState: OxstsWitnessState, transition: Transition): SequenceOperation { + return OxstsFactory.createSequenceOperation().also { + it.operation += stateVariableAssumption(transitionState.id) + + it.operation += OxstsFactory.createInlineCall(OxstsFactory.createChainReferenceExpression(transition), isStatic = true) + + it.operation += transitionState.toAssumptionOperations() + + if (transitions[transitionState].any()) { + it.operation += createStateTransitionChoiceOperation(transitionState) } } + } -// witnessType.mainTransition += OxstsFactory.createSequentialTransition { -// for (transitionState in witness.transitionStates) { -// operation += OxstsFactory.createInlineCall(OxstsFactory.createChainReferenceExpression(target.findMainTransition()), isStatic = true) -// -// operation += transitionState.toAssumptionOperations() -// } -// } - - witnessType.mainTransition += OxstsFactory.createSequentialTransition { - if (witness.transitionStates.any()) { - operation += OxstsFactory.createChoiceOperation().also { - for (transitionState in witness.transitionStates) { - it.operation += OxstsFactory.createSequenceOperation().also { - it.operation += stateVariableAssumption(transitionState.id) - - it.operation += OxstsFactory.createInlineCall(OxstsFactory.createChainReferenceExpression(target.findMainTransition()), isStatic = true) - - it.operation += transitionState.toAssumptionOperations() - - if (!witness.transitions[transitionState].isEmpty()) { - it.operation += OxstsFactory.createChoiceOperation().also { - for (nextState in witness.transitions[transitionState]) { - it.operation += OxstsFactory.createSequenceOperation().also { - it.operation += stateVariableAssignment(nextState.id) - } - } - } - } - } - } + private fun Witness.createStateTransitionChoiceOperation(transitionState: OxstsWitnessState): ChoiceOperation { + return OxstsFactory.createChoiceOperation().also { + for (nextState in transitions[transitionState]) { + it.operation += OxstsFactory.createSequenceOperation().also { + it.operation += stateVariableAssignment(nextState.id) } } } } - fun stateVariableAssumption(value: Int): AssumptionOperation { + private fun stateVariableAssumption(value: Int): AssumptionOperation { return OxstsFactory.createEqualityAssumption( referenceExpression = OxstsFactory.createChainReferenceExpression(stateVariable), expression = OxstsFactory.createLiteralInteger(value) ) } - fun stateVariableAssignment(value: Int): AssignmentOperation { + private fun stateVariableAssignment(value: Int): AssignmentOperation { return OxstsFactory.createAssignmentOperation( referenceExpression = OxstsFactory.createChainReferenceExpression(stateVariable), expression = OxstsFactory.createLiteralInteger(value) @@ -258,21 +268,9 @@ class WitnessCreator( it.name == targetName } - val mapping = WitnessMapping(target) - - mapping.transform(cex) + val oxstsWitness = OxstsWitness(target, cex) - return mapping.witnessPackage + return oxstsWitness.witnessPackage } } - - -fun main() { - prepareCex() - val reader = CexReader() - val cex = reader.readCexFile(File("C:\\Users\\Armin\\work\\ftsrg\\semantifyr\\subprojects\\semantifyr\\TestModels\\Automated\\Gamma\\Spacecraft\\artifacts\\Spacecraft_batteryCharge_100_Unsafe\\Spacecraft_batteryCharge_100_Unsafe0.cex")) - - - -} From 5dca2d50184e7e49f8bf13f37c6e31f87df96d1d Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Thu, 23 Jan 2025 15:36:34 +0100 Subject: [PATCH 24/27] Updated PetriNet model --- .../TestModels/Automated/Example/PetriNet/model.oxsts | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/subprojects/semantifyr/TestModels/Automated/Example/PetriNet/model.oxsts b/subprojects/semantifyr/TestModels/Automated/Example/PetriNet/model.oxsts index c13993a..1588fe8 100644 --- a/subprojects/semantifyr/TestModels/Automated/Example/PetriNet/model.oxsts +++ b/subprojects/semantifyr/TestModels/Automated/Example/PetriNet/model.oxsts @@ -70,13 +70,7 @@ target Mission { } } - init { - - } - - tran asdf { - - } + init { } tran { inline petriNet.main() From 93a749a4bb91e0350516eb3c2979861c9e47bfca Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Thu, 23 Jan 2025 15:37:20 +0100 Subject: [PATCH 25/27] Added missing input dependency --- .../semantifyr-vscode/build.gradle.kts | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/subprojects/semantifyr-vscode/build.gradle.kts b/subprojects/semantifyr-vscode/build.gradle.kts index c9746dc..8f56e92 100644 --- a/subprojects/semantifyr-vscode/build.gradle.kts +++ b/subprojects/semantifyr-vscode/build.gradle.kts @@ -39,6 +39,8 @@ val cloneDistribution by tasks.registering(Sync::class) { tasks { val compile by registering(NpmTask::class) { + inputs.dir(project.layout.projectDirectory.dir("src")) + inputs.file(project.layout.projectDirectory.file("esbuild.js")) inputs.files(npmInstall.get().outputs) npmCommand.set( @@ -51,32 +53,34 @@ tasks { outputs.dir("dist") } -// val packageExtension by registering(Exec::class) { -// inputs.files(cloneDistribution.get().outputs) -// inputs.files(compile.get().outputs) -// inputs.dir("node_modules") -// -// outputs.dir(project.layout.buildDirectory.dir("vscode")) -// -// if (Os.isFamily(Os.FAMILY_WINDOWS)) { -// commandLine( -// "cmd", -// "/c", -// "node_modules\\.bin\\vsce.cmd", -// "package", -// "--out", project.layout.buildDirectory.dir("vscode").get().asFile.absolutePath, -// ) -// } else { -// commandLine( -// "sh", -// "-c", -// "node_modules/.bin/vsce package --out " + project.layout.buildDirectory.dir("vscode").get().asFile.absolutePath, -// ) -// } -// } + val packageExtension by registering(Exec::class) { + inputs.files(cloneDistribution.get().outputs) + inputs.files(compile.get().outputs) + inputs.files(npmInstall.get().outputs) + + outputs.dir(project.layout.buildDirectory.dir("vscode")) + + if (Os.isFamily(Os.FAMILY_WINDOWS)) { + commandLine( + "cmd", + "/c", + "node_modules\\.bin\\vsce.cmd", + "package", + "--out", project.layout.buildDirectory.dir("vscode").get().asFile.absolutePath, + ) + } else { + commandLine( + "sh", + "-c", + "node_modules/.bin/vsce package --out " + project.layout.buildDirectory.dir("vscode").get().asFile.absolutePath, + ) + } + } assemble { + inputs.files(cloneDistribution.get().outputs) inputs.files(compile.get().outputs) + inputs.files(packageExtension.get().outputs) } clean { From ed4ba58b2ec0d83b02bfe5eac39139856e09693b Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Thu, 23 Jan 2025 19:07:00 +0100 Subject: [PATCH 26/27] Refactored OXSTS model optimization --- .../kotlin/transformation/XstsTransformer.kt | 14 +- .../optimization/ExpressionOptimizer.kt | 83 +++-- .../optimization/OperationOptimizer.kt | 308 ++++++++++++------ .../src/main/kotlin/utils/EcoreUtils.kt | 2 + .../src/main/kotlin/utils/OxstsUtils.kt | 18 + 5 files changed, 271 insertions(+), 154 deletions(-) diff --git a/subprojects/semantifyr/src/main/kotlin/transformation/XstsTransformer.kt b/subprojects/semantifyr/src/main/kotlin/transformation/XstsTransformer.kt index 0e35176..e6e56e3 100644 --- a/subprojects/semantifyr/src/main/kotlin/transformation/XstsTransformer.kt +++ b/subprojects/semantifyr/src/main/kotlin/transformation/XstsTransformer.kt @@ -82,15 +82,17 @@ class XstsTransformer( logger.info("Optimizing XSTS model") - xsts.init.optimize() - xsts.transition.optimize() - xsts.property.invariant.optimize() + xsts.optimize() if (rewriteChoice) { logger.info("Rewriting choice-else operations") xsts.init.rewriteChoiceElse() xsts.transition.rewriteChoiceElse() + + logger.info("Optimizing XSTS model") + + xsts.optimize() } logger.info("Transformation done!") @@ -98,6 +100,12 @@ class XstsTransformer( return xsts } + private fun XSTS.optimize() { + init.optimize() + transition.optimize() + property.invariant.optimize() + } + private fun Transition.inlineOperations(rootInstance: Instance) { val processorQueue = LinkedList(operation) diff --git a/subprojects/semantifyr/src/main/kotlin/transformation/optimization/ExpressionOptimizer.kt b/subprojects/semantifyr/src/main/kotlin/transformation/optimization/ExpressionOptimizer.kt index db9ea09..1d0bf80 100644 --- a/subprojects/semantifyr/src/main/kotlin/transformation/optimization/ExpressionOptimizer.kt +++ b/subprojects/semantifyr/src/main/kotlin/transformation/optimization/ExpressionOptimizer.kt @@ -8,13 +8,15 @@ package hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.optimization import hu.bme.mit.semantifyr.oxsts.model.oxsts.AndOperator import hu.bme.mit.semantifyr.oxsts.model.oxsts.Expression -import hu.bme.mit.semantifyr.oxsts.model.oxsts.LiteralBoolean import hu.bme.mit.semantifyr.oxsts.model.oxsts.OperatorExpression import hu.bme.mit.semantifyr.oxsts.model.oxsts.OrOperator import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.evaluation.BooleanData import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.evaluation.IntegerData import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.evaluation.SharedExpressionEvaluator import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.OxstsFactory +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.eAllContentsOfType +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.isConstantFalse +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.isConstantTrue import org.eclipse.xtext.EcoreUtil2 object ExpressionOptimizer { @@ -25,23 +27,24 @@ object ExpressionOptimizer { do { optimized = optimizeInternal() - anyOptimized = anyOptimized || optimized + if (optimized) { + anyOptimized = true + } } while (optimized) return anyOptimized } private fun Expression.optimizeInternal(): Boolean { - return rewriteTrueOr() || - rewriteFalseAnd() || + return rewriteConstantTrueOr() || + rewriteConstantFalseAnd() || rewriteRedundantOr() || - rewriteRedundantAnd() || - evaluateConstantOperator() + rewriteRedundantAnd() /*|| + evaluateConstantOperator()*/ } private fun Expression.evaluateConstantOperator(): Boolean { - // any of its operands is true - val constantOperator = EcoreUtil2.getAllContentsOfType(this, OperatorExpression::class.java).firstOrNull { + val constantOperator = eAllContentsOfType().firstOrNull { SharedExpressionEvaluator.isConstantEvaluable(it) } @@ -62,86 +65,74 @@ object ExpressionOptimizer { return true } - private fun Expression.rewriteTrueOr(): Boolean { + private fun Expression.rewriteConstantTrueOr(): Boolean { // any of its operands is true - val trueOr = EcoreUtil2.getAllContentsOfType(this, OrOperator::class.java).firstOrNull { - it.operands.any { - it is LiteralBoolean && it.isValue - } + val constantTrueOr = eAllContentsOfType().firstOrNull { + it.operands.any { it.isConstantTrue } } - if (trueOr == null) { + if (constantTrueOr == null) { return false } - EcoreUtil2.replace(trueOr, OxstsFactory.createLiteralBoolean(true)) + EcoreUtil2.replace(constantTrueOr, OxstsFactory.createLiteralBoolean(true)) return true } - private fun Expression.rewriteFalseAnd(): Boolean { + private fun Expression.rewriteConstantFalseAnd(): Boolean { // any of its operands is false - val falseAnd = EcoreUtil2.getAllContentsOfType(this, AndOperator::class.java).firstOrNull { - it.operands.any { - it is LiteralBoolean && !it.isValue - } + val constantFalseAnd = eAllContentsOfType().firstOrNull { + it.operands.any { it.isConstantFalse } } - if (falseAnd == null) { + if (constantFalseAnd == null) { return false } - EcoreUtil2.replace(falseAnd, OxstsFactory.createLiteralBoolean(true)) + EcoreUtil2.replace(constantFalseAnd, OxstsFactory.createLiteralBoolean(false)) return true } private fun Expression.rewriteRedundantOr(): Boolean { // or, that only depends on one of its arguments, the other is "false" - val redundantOr = EcoreUtil2.getAllContentsOfType(this, OrOperator::class.java).firstOrNull { - it.operands.any { - it is LiteralBoolean && !it.isValue - } + val redundantOr = eAllContentsOfType().firstOrNull { + it.operands.any { it.isConstantFalse } } if (redundantOr == null) { return false } - val operand = redundantOr.operands.first { - it is LiteralBoolean && !it.isValue - } - val operandIndex = redundantOr.operands.indexOf(operand) - val otherOperandIndex = 1 - operandIndex - val otherOperand = redundantOr.operands[otherOperandIndex] - - EcoreUtil2.replace(redundantOr, otherOperand) + val operand = redundantOr.operands.first { it.isConstantFalse } + replaceRedundantOperand(redundantOr, operand) return true } private fun Expression.rewriteRedundantAnd(): Boolean { // and, that only depends on one of its arguments, the other is "true" - val redundantAnd = EcoreUtil2.getAllContentsOfType(this, AndOperator::class.java).firstOrNull { - it.operands.any { - it is LiteralBoolean && it.isValue - } + val redundantAnd = eAllContentsOfType().firstOrNull { + it.operands.any { it.isConstantTrue } } if (redundantAnd == null) { return false } - val operand = redundantAnd.operands.first { - it is LiteralBoolean && it.isValue - } - val operandIndex = redundantAnd.operands.indexOf(operand) - val otherOperandIndex = 1 - operandIndex - val otherOperand = redundantAnd.operands[otherOperandIndex] - - EcoreUtil2.replace(redundantAnd, otherOperand) + val operand = redundantAnd.operands.first { it.isConstantTrue } + replaceRedundantOperand(redundantAnd, operand) return true } + private fun replaceRedundantOperand(operator: OperatorExpression, operand: Expression) { + val operandIndex = operator.operands.indexOf(operand) + val otherOperandIndex = 1 - operandIndex + val otherOperand = operator.operands[otherOperandIndex] + + EcoreUtil2.replace(operator, otherOperand) + } + } diff --git a/subprojects/semantifyr/src/main/kotlin/transformation/optimization/OperationOptimizer.kt b/subprojects/semantifyr/src/main/kotlin/transformation/optimization/OperationOptimizer.kt index c4af6aa..536588b 100644 --- a/subprojects/semantifyr/src/main/kotlin/transformation/optimization/OperationOptimizer.kt +++ b/subprojects/semantifyr/src/main/kotlin/transformation/optimization/OperationOptimizer.kt @@ -11,58 +11,68 @@ import hu.bme.mit.semantifyr.oxsts.model.oxsts.AssumptionOperation import hu.bme.mit.semantifyr.oxsts.model.oxsts.ChoiceOperation import hu.bme.mit.semantifyr.oxsts.model.oxsts.HavocOperation import hu.bme.mit.semantifyr.oxsts.model.oxsts.IfOperation -import hu.bme.mit.semantifyr.oxsts.model.oxsts.LiteralBoolean import hu.bme.mit.semantifyr.oxsts.model.oxsts.Operation import hu.bme.mit.semantifyr.oxsts.model.oxsts.SequenceOperation import hu.bme.mit.semantifyr.oxsts.model.oxsts.Transition import hu.bme.mit.semantifyr.oxsts.semantifyr.transformation.optimization.ExpressionOptimizer.optimize +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.OxstsFactory +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.eAllContentsOfType +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.isConstantFalse +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.isConstantFalseOperation +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.isConstantTrue +import hu.bme.mit.semantifyr.oxsts.semantifyr.utils.isConstantTrueOperation import org.eclipse.xtext.EcoreUtil2 object OperationOptimizer { - fun Transition.optimize(): Boolean { - var optimized = false - + fun Transition.optimize(): Transition { for (operation in operation) { - optimized = optimized || operation.optimize() + operation.optimize() } - return optimized - } + // optimization results in possibly consistent, but "not well-formed" model + fixWellFormednessProblems() - private fun Operation.optimize(): Boolean { - var anyOptimization = false - var optimized: Boolean + return this + } - do { - optimized = optimizeInternal() - anyOptimization = anyOptimization || optimized - } while (optimized) + private fun Operation.optimize() { + var workRemaining = true - return anyOptimization + while (workRemaining) { + workRemaining = optimizeInternal() + } } private fun Operation.optimizeInternal(): Boolean { - return rewriteSingleBranchChoices() || - removeTrueAssumptions() || - propagateFalseAssumptions() || - removeEmptySequences() || - removeEmptyChoices() || - removeEmptyIfs() || - removeRedundantChoiceElse() || - flattenSequences() || - flattenChoices() || - removeFalseElseBranches() || - removeFalseBranches() || - optimizeExpressions() + return removeTrueAssumptions() || + removeEmptySequences() || + removeEmptyChoices() || + removeEmptyIfs() || + removeRedundantChoiceElseBranch() || + + rewriteSingleBranchChoices() || + rewriteSingleStepSequences() || + + flattenNestedSequences() || + flattenNestedChoices() || + + rewriteConstantGuardIfs() || + + optimizeExpressions() || + + removeConstantFalseElseBranches() || + propagateConstantFalseSequenceSteps() || + propagateConstantFalseChoiceBranches() || + propagateConstantFalseIfBranches() } private fun Operation.optimizeExpressions(): Boolean { var optimized = false - val ifs = EcoreUtil2.getAllContentsOfType(this, IfOperation::class.java) - val assumptions = EcoreUtil2.getAllContentsOfType(this, AssumptionOperation::class.java) - val assignments = EcoreUtil2.getAllContentsOfType(this, AssignmentOperation::class.java) + val ifs = eAllContentsOfType() + val assumptions = eAllContentsOfType() + val assignments = eAllContentsOfType() val expressions = ifs.map { it.guard } + assumptions.map { it.expression } + assignments.map { it.expression } @@ -73,8 +83,26 @@ object OperationOptimizer { return optimized } + private fun Operation.rewriteConstantGuardIfs(): Boolean { + val ifOperation = eAllContentsOfType().firstOrNull { + it.guard.isConstantTrue || it.guard.isConstantFalse + } + + if (ifOperation == null) { + return false + } + + if (ifOperation.guard.isConstantTrue) { + EcoreUtil2.replace(ifOperation, ifOperation.body) + } else { + EcoreUtil2.replace(ifOperation, ifOperation.`else`) + } + + return true + } + private fun Operation.rewriteSingleBranchChoices(): Boolean { - val choice = EcoreUtil2.getAllContentsOfType(this, ChoiceOperation::class.java).firstOrNull { + val choice = eAllContentsOfType().firstOrNull { it.operation.size == 1 && it.`else` == null } @@ -87,185 +115,225 @@ object OperationOptimizer { return true } - private fun Operation.flattenSequences(): Boolean { - val sequence = EcoreUtil2.getAllContentsOfType(this, SequenceOperation::class.java).firstOrNull { - it.operation.size == 1 + private fun Operation.flattenNestedSequences(): Boolean { + val sequence = eAllContentsOfType().firstOrNull { + it.operation.any { it is SequenceOperation } } if (sequence == null) { return false } - EcoreUtil2.replace(sequence, sequence.operation.single()) + val internalSequence = sequence.operation.first { + it is SequenceOperation + } as SequenceOperation + + val index = sequence.operation.indexOf(internalSequence) + sequence.operation.addAll(index, internalSequence.operation) + EcoreUtil2.remove(internalSequence) return true } - private fun Operation.flattenChoices(): Boolean { - val choice = EcoreUtil2.getAllContentsOfType(this, ChoiceOperation::class.java).firstOrNull { - it.eContainer() is ChoiceOperation && it.isRemovable() + private fun Operation.rewriteSingleStepSequences(): Boolean { + val sequence = eAllContentsOfType().firstOrNull { + it.operation.size == 1 } - if (choice == null) { + if (sequence == null) { return false } - val container = choice.eContainer() as ChoiceOperation - container.operation += choice.operation + EcoreUtil2.replace(sequence, sequence.operation.single()) return true } - private fun Operation.removeTrueAssumptions(): Boolean { - val assumptions = EcoreUtil2.getAllContentsOfType(this, AssumptionOperation::class.java).filter { - it.isTrueOperation + private fun Operation.flattenNestedChoices(): Boolean { + val choice = eAllContentsOfType().firstOrNull { + it.operation.any { + it is ChoiceOperation && it.`else` == null + } } - if (assumptions.isEmpty()) { + if (choice == null) { return false } - for (assumption in assumptions) { - EcoreUtil2.remove(assumption) - } + val internalChoice = choice.operation.first { + it is ChoiceOperation && it.`else` == null + } as ChoiceOperation + + choice.operation += internalChoice.operation return true } - private fun Operation.propagateFalseAssumptions(): Boolean { - val falseAssumption = EcoreUtil2.getAllContentsOfType(this, AssumptionOperation::class.java).firstOrNull { - it.isFalseOperation + private fun Operation.removeTrueAssumptions(): Boolean { + val assumption = eAllContentsOfType().firstOrNull { + it.isConstantTrueOperation } - if (falseAssumption == null) { + if (assumption == null) { return false } - val parent = falseAssumption.eContainer() + EcoreUtil2.remove(assumption) - if (parent !is SequenceOperation) { + return true + } + + private fun Operation.propagateConstantFalseIfBranches(): Boolean { + val ifOperation = eAllContentsOfType().firstOrNull { + it.body.isConstantFalseOperation && it.`else` != null && it.`else`.isConstantFalseOperation + } + + if (ifOperation == null) { return false } - EcoreUtil2.replace(parent, falseAssumption) + EcoreUtil2.replace(ifOperation, ifOperation.body) return true } - private fun Operation.removeEmptyIfs(): Boolean { - val emptyIfs = EcoreUtil2.getAllContentsOfType(this, IfOperation::class.java).filter { - it.body == null && it.`else` == null + private fun Operation.propagateConstantFalseSequenceSteps(): Boolean { + val sequence = eAllContentsOfType().firstOrNull { + it.operation.any { it.isConstantFalseOperation } } - if (emptyIfs.isEmpty()) { + if (sequence == null) { return false } - for (emptyIf in emptyIfs) { - EcoreUtil2.remove(emptyIf) + val assumption = sequence.operation.first { + it.isConstantFalseOperation } + EcoreUtil2.replace(sequence, assumption) + return true } - private fun Operation.removeFalseElseBranches(): Boolean { - val choices = EcoreUtil2.getAllContentsOfType(this, ChoiceOperation::class.java).filter { - it.`else`.let { - it is AssumptionOperation && it.isFalseOperation - } + private fun Operation.removeConstantFalseElseBranches(): Boolean { + val choice = eAllContentsOfType().firstOrNull { + it.`else` != null && it.`else`.isConstantFalseOperation } - if (choices.isEmpty()) { + if (choice == null) { return false } - for (choice in choices) { - choice.`else` = null - } + choice.`else` = null return true } - private fun Operation.removeFalseBranches(): Boolean { - val choice = EcoreUtil2.getAllContentsOfType(this, ChoiceOperation::class.java).firstOrNull { - it.operation.any { - it is AssumptionOperation && it.isFalseOperation - } + private fun Operation.propagateConstantFalseChoiceBranches(): Boolean { + val choice = eAllContentsOfType().firstOrNull { + it.operation.any { it.isConstantFalseOperation } } if (choice == null) { return false } - val assumption = choice.operation.first { it is AssumptionOperation && it.isFalseOperation } + val assumption = choice.operation.first { + it.isConstantFalseOperation + } - if (choice.operation.size > 1) { + if (choice.operation.size > 1) { // there are other branches EcoreUtil2.remove(assumption) - } else if (choice.`else` != null) { + } else if (choice.`else` != null) { // this is the only branch, but there is an else branch EcoreUtil2.replace(assumption, choice.`else`) - } else { + } else { // the whole choice is not executable EcoreUtil2.replace(choice, assumption) } return true } + private fun Operation.removeRedundantChoiceElseBranch(): Boolean { + val redundantChoiceElse = eAllContentsOfType().firstOrNull { it -> + it.`else` != null && it.operation.all { it.isAlwaysExecutable() } + } + + if (redundantChoiceElse == null) { + return false + } + + redundantChoiceElse.`else` = null + + return true + } + private fun Operation.removeEmptySequences(): Boolean { - val emptySequences = EcoreUtil2.getAllContentsOfType(this, SequenceOperation::class.java).filter { + val emptySequence = eAllContentsOfType().firstOrNull { it.operation.isEmpty() && it.isRemovable() } - if (emptySequences.isEmpty()) { + if (emptySequence == null) { return false } - for (emptySequence in emptySequences) { - EcoreUtil2.remove(emptySequence) - } + EcoreUtil2.remove(emptySequence) return true } private fun Operation.removeEmptyChoices(): Boolean { - val emptyChoices = EcoreUtil2.getAllContentsOfType(this, ChoiceOperation::class.java).filter { - it.operation.isEmpty() && it.isRemovable() + val emptyChoice = eAllContentsOfType().firstOrNull { + it.operation.isEmpty() && it.`else` == null && it.isRemovable() } - if (emptyChoices.isEmpty()) { + if (emptyChoice == null) { return false } - for (emptyChoice in emptyChoices) { - EcoreUtil2.remove(emptyChoice) - } + EcoreUtil2.remove(emptyChoice) return true } - private fun Operation.removeRedundantChoiceElse(): Boolean { - val redundantChoiceElse = EcoreUtil2.getAllContentsOfType(this, ChoiceOperation::class.java).firstOrNull { it -> - it.`else` != null && it.operation.all { it.isAlwaysExecutable() } + private fun Operation.removeEmptyIfs(): Boolean { + val emptyIf = eAllContentsOfType().firstOrNull { + it.body == null && it.`else` == null && it.isRemovable() } - if (redundantChoiceElse == null) { + if (emptyIf == null) { return false } - redundantChoiceElse.`else` = null + EcoreUtil2.remove(emptyIf) return true } + // Upper-approximation of if this operation is never not executable. + // False does NOT mean this operation is never executable! private fun Operation.isAlwaysExecutable(): Boolean { return when (this) { - is AssumptionOperation -> false + is AssumptionOperation -> isConstantTrueOperation is AssignmentOperation -> true is HavocOperation -> true - is IfOperation -> body.isAlwaysExecutable() || (`else`?.isAlwaysExecutable() ?: false) + is IfOperation -> { + if (guard.isConstantFalse) { + true + } else if (`else` == null) { + body.isAlwaysExecutable() + } else { + body.isAlwaysExecutable() && `else`.isAlwaysExecutable() + } + } is ChoiceOperation -> { - (operation.map { it.isAlwaysExecutable() }.reduceOrNull { l, r -> l || r } ?: true) || (`else`?.isAlwaysExecutable() ?: false) + if (operation.isEmpty()) { + `else` == null || `else`.isAlwaysExecutable() + } else { + operation.any { it.isAlwaysExecutable() } || + `else`?.isAlwaysExecutable() == true + } } - is SequenceOperation -> operation.map { it.isAlwaysExecutable() }.reduceOrNull { l, r -> l && r } ?: true + is SequenceOperation -> operation.all { it.isAlwaysExecutable() } else -> error("Unknown operation $this") } } @@ -285,11 +353,41 @@ object OperationOptimizer { } } -} + private fun Transition.fixWellFormednessProblems() { + for (operation in operation) { + // transition operations must be wrapped in sequences + operation.ensureWrapped() + + // choice branch-else must be wrapped in sequences + operation.eAllContentsOfType().forEach { + it.ensureBranchesWrapped() + } + + // if body-else must be wrapped in sequences + operation.eAllContentsOfType().forEach { + it.ensureBranchesWrapped() + } + } + } -@Suppress("SimplifyBooleanWithConstants") -private val AssumptionOperation.isFalseOperation - get() = expression is LiteralBoolean && (expression as LiteralBoolean).isValue == false + private fun ChoiceOperation.ensureBranchesWrapped() { + for (branch in operation) { + branch.ensureWrapped() + } + `else`?.ensureWrapped() + } -private val AssumptionOperation.isTrueOperation - get() = expression is LiteralBoolean && (expression as LiteralBoolean).isValue + private fun IfOperation.ensureBranchesWrapped() { + body.ensureWrapped() + `else`?.ensureWrapped() + } + + private fun Operation.ensureWrapped() { + if (this is SequenceOperation) return + + val wrapper = OxstsFactory.createSequenceOperation() + EcoreUtil2.replace(this, wrapper) + wrapper.operation += this + } + +} diff --git a/subprojects/semantifyr/src/main/kotlin/utils/EcoreUtils.kt b/subprojects/semantifyr/src/main/kotlin/utils/EcoreUtils.kt index 11a3091..ac8bfd2 100644 --- a/subprojects/semantifyr/src/main/kotlin/utils/EcoreUtils.kt +++ b/subprojects/semantifyr/src/main/kotlin/utils/EcoreUtils.kt @@ -11,3 +11,5 @@ import org.eclipse.xtext.EcoreUtil2 fun T.copy() = EcoreUtil2.copy(this) fun Collection.copy() = map { it.copy() } + +inline fun EObject.eAllContentsOfType() = eAllContents().asSequence().filterIsInstance() diff --git a/subprojects/semantifyr/src/main/kotlin/utils/OxstsUtils.kt b/subprojects/semantifyr/src/main/kotlin/utils/OxstsUtils.kt index f3247f7..6cae126 100644 --- a/subprojects/semantifyr/src/main/kotlin/utils/OxstsUtils.kt +++ b/subprojects/semantifyr/src/main/kotlin/utils/OxstsUtils.kt @@ -6,6 +6,7 @@ package hu.bme.mit.semantifyr.oxsts.semantifyr.utils +import hu.bme.mit.semantifyr.oxsts.model.oxsts.AssumptionOperation import hu.bme.mit.semantifyr.oxsts.model.oxsts.BaseType import hu.bme.mit.semantifyr.oxsts.model.oxsts.BooleanType import hu.bme.mit.semantifyr.oxsts.model.oxsts.ChainReferenceExpression @@ -15,9 +16,12 @@ import hu.bme.mit.semantifyr.oxsts.model.oxsts.DataType import hu.bme.mit.semantifyr.oxsts.model.oxsts.DeclarationReferenceExpression import hu.bme.mit.semantifyr.oxsts.model.oxsts.Element import hu.bme.mit.semantifyr.oxsts.model.oxsts.EnumLiteral +import hu.bme.mit.semantifyr.oxsts.model.oxsts.Expression import hu.bme.mit.semantifyr.oxsts.model.oxsts.Feature import hu.bme.mit.semantifyr.oxsts.model.oxsts.Instance import hu.bme.mit.semantifyr.oxsts.model.oxsts.IntegerType +import hu.bme.mit.semantifyr.oxsts.model.oxsts.LiteralBoolean +import hu.bme.mit.semantifyr.oxsts.model.oxsts.Operation import hu.bme.mit.semantifyr.oxsts.model.oxsts.Package import hu.bme.mit.semantifyr.oxsts.model.oxsts.Pattern import hu.bme.mit.semantifyr.oxsts.model.oxsts.PatternConstraint @@ -272,3 +276,17 @@ fun Pattern.allReferencedPatterns(): Set { return patterns } + + +val Operation.isConstantFalseOperation + get() = this is AssumptionOperation && expression.isConstantFalse + +val Operation.isConstantTrueOperation + get() = this is AssumptionOperation && expression.isConstantTrue + +@Suppress("SimplifyBooleanWithConstants") +val Expression.isConstantFalse + get() = this is LiteralBoolean && isValue == false + +val Expression.isConstantTrue + get() = this is LiteralBoolean && isValue From 53c4699517d5f42d38ea6074e1cb4a0b64addfc7 Mon Sep 17 00:00:00 2001 From: Armin Zavada Date: Thu, 23 Jan 2025 19:12:20 +0100 Subject: [PATCH 27/27] Updated expected models --- .../TestModels/Automated/Gamma/Crossroads/expected.xsts | 6 +++--- .../TestModels/Automated/Gamma/Spacecraft/expected.xsts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/subprojects/semantifyr/TestModels/Automated/Gamma/Crossroads/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Gamma/Crossroads/expected.xsts index ddc30b4..b107731 100644 --- a/subprojects/semantifyr/TestModels/Automated/Gamma/Crossroads/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Gamma/Crossroads/expected.xsts @@ -118,7 +118,7 @@ trans { $Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState := $Mission$crossroad$controller$Main$Operating$OperatingRegion$Init$$literal; $Mission$crossroad$controller$trafficTimeout$remainingTime := 1; } or { - assume (! (((($Mission$crossroad$controller$policeEvent$isActive && ($Mission$crossroad$controller$Main$activeState == $Mission$crossroad$controller$Main$Operating$$literal)) && (((((($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$Init$$literal) || ! (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$Init$$literal))) && (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnA$$literal) || ! (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnA$$literal)))) && (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingA$$literal) || ! (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingA$$literal)))) && (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnB$$literal) || ! (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnB$$literal)))) && (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingB$$literal) || ! (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingB$$literal))))) || ($Mission$crossroad$controller$policeEvent$isActive && ($Mission$crossroad$controller$Main$activeState == $Mission$crossroad$controller$Main$Interrupted$$literal))))); + assume (! (((((((($Mission$crossroad$controller$policeEvent$isActive && ($Mission$crossroad$controller$Main$activeState == $Mission$crossroad$controller$Main$Operating$$literal)) && (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$Init$$literal) || ! (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$Init$$literal)))) && (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnA$$literal) || ! (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnA$$literal)))) && (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingA$$literal) || ! (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingA$$literal)))) && (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnB$$literal) || ! (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$TrafficOnB$$literal)))) && (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingB$$literal) || ! (($Mission$crossroad$controller$Main$Operating$OperatingRegion$activeState == $Mission$crossroad$controller$Main$Operating$OperatingRegion$StoppingB$$literal)))) || ($Mission$crossroad$controller$policeEvent$isActive && ($Mission$crossroad$controller$Main$activeState == $Mission$crossroad$controller$Main$Interrupted$$literal))))); choice { assume (($Mission$crossroad$controller$Main$activeState == $Mission$crossroad$controller$Main$Operating$$literal)); choice { @@ -203,7 +203,7 @@ trans { $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState := $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Red$$literal; $Mission$crossroad$trafficLightA$displayRedEvent$isActive := true; } or { - assume (! (((($Mission$crossroad$trafficLightA$policeEvent$isActive && ($Mission$crossroad$trafficLightA$Main$activeState == $Mission$crossroad$trafficLightA$Main$Normal$$literal)) && (((($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Red$$literal) || ! (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Red$$literal))) && (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Green$$literal) || ! (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Green$$literal)))) && (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Yellow$$literal) || ! (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Yellow$$literal))))) || (($Mission$crossroad$trafficLightA$policeEvent$isActive && ($Mission$crossroad$trafficLightA$Main$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$$literal)) && ((($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Black$$literal) || ! (($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Black$$literal))) && (($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Yellow$$literal) || ! (($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Yellow$$literal)))))))); + assume (! (((((($Mission$crossroad$trafficLightA$policeEvent$isActive && ($Mission$crossroad$trafficLightA$Main$activeState == $Mission$crossroad$trafficLightA$Main$Normal$$literal)) && (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Red$$literal) || ! (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Red$$literal)))) && (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Green$$literal) || ! (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Green$$literal)))) && (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Yellow$$literal) || ! (($Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightA$Main$Normal$NormalRegion$Yellow$$literal)))) || ((($Mission$crossroad$trafficLightA$policeEvent$isActive && ($Mission$crossroad$trafficLightA$Main$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$$literal)) && (($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Black$$literal) || ! (($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Black$$literal)))) && (($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Yellow$$literal) || ! (($Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightA$Main$Interrupted$InterruptedRegion$Yellow$$literal))))))); choice { assume (($Mission$crossroad$trafficLightA$Main$activeState == $Mission$crossroad$trafficLightA$Main$Normal$$literal)); choice { @@ -289,7 +289,7 @@ trans { $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState := $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Red$$literal; $Mission$crossroad$trafficLightB$displayRedEvent$isActive := true; } or { - assume (! (((($Mission$crossroad$trafficLightB$policeEvent$isActive && ($Mission$crossroad$trafficLightB$Main$activeState == $Mission$crossroad$trafficLightB$Main$Normal$$literal)) && (((($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Red$$literal) || ! (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Red$$literal))) && (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Green$$literal) || ! (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Green$$literal)))) && (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Yellow$$literal) || ! (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Yellow$$literal))))) || (($Mission$crossroad$trafficLightB$policeEvent$isActive && ($Mission$crossroad$trafficLightB$Main$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$$literal)) && ((($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Black$$literal) || ! (($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Black$$literal))) && (($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Yellow$$literal) || ! (($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Yellow$$literal)))))))); + assume (! (((((($Mission$crossroad$trafficLightB$policeEvent$isActive && ($Mission$crossroad$trafficLightB$Main$activeState == $Mission$crossroad$trafficLightB$Main$Normal$$literal)) && (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Red$$literal) || ! (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Red$$literal)))) && (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Green$$literal) || ! (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Green$$literal)))) && (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Yellow$$literal) || ! (($Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$activeState == $Mission$crossroad$trafficLightB$Main$Normal$NormalRegion$Yellow$$literal)))) || ((($Mission$crossroad$trafficLightB$policeEvent$isActive && ($Mission$crossroad$trafficLightB$Main$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$$literal)) && (($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Black$$literal) || ! (($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Black$$literal)))) && (($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Yellow$$literal) || ! (($Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$activeState == $Mission$crossroad$trafficLightB$Main$Interrupted$InterruptedRegion$Yellow$$literal))))))); choice { assume (($Mission$crossroad$trafficLightB$Main$activeState == $Mission$crossroad$trafficLightB$Main$Normal$$literal)); choice { diff --git a/subprojects/semantifyr/TestModels/Automated/Gamma/Spacecraft/expected.xsts b/subprojects/semantifyr/TestModels/Automated/Gamma/Spacecraft/expected.xsts index 641ca2a..b31abd7 100644 --- a/subprojects/semantifyr/TestModels/Automated/Gamma/Spacecraft/expected.xsts +++ b/subprojects/semantifyr/TestModels/Automated/Gamma/Spacecraft/expected.xsts @@ -163,7 +163,7 @@ trans { } $Mission$spaceMission$spacecraft$Communication$activeState := $Mission$spaceMission$spacecraft$Communication$WaitingPing$$literal; } or { - assume (! ((((((($Mission$spaceMission$spacecraft$recharging == false) && ! ((($Mission$spaceMission$spacecraft$data <= 0) || ($Mission$spaceMission$spacecraft$batteryCharge < 40)))) && $Mission$spaceMission$spacecraft$pingEvent$isActive) && ($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$WaitingPing$$literal)) || (((($Mission$spaceMission$spacecraft$batteryCharge < 40) && ($Mission$spaceMission$spacecraft$consumeTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal)) && ((($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal) || ! (($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal))) && (($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal) || ! (($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal)))))) || ((((($Mission$spaceMission$spacecraft$data <= 0) || ($Mission$spaceMission$spacecraft$batteryCharge < 40)) && ($Mission$spaceMission$spacecraft$transmitTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal)) && ((($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal) || ! (($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal))) && (($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal) || ! (($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal)))))))); + assume (! ((((((($Mission$spaceMission$spacecraft$recharging == false) && ! ((($Mission$spaceMission$spacecraft$data <= 0) || ($Mission$spaceMission$spacecraft$batteryCharge < 40)))) && $Mission$spaceMission$spacecraft$pingEvent$isActive) && ($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$WaitingPing$$literal)) || ((((($Mission$spaceMission$spacecraft$batteryCharge < 40) && ($Mission$spaceMission$spacecraft$consumeTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal)) && (($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal) || ! (($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal)))) && (($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal) || ! (($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal))))) || (((((($Mission$spaceMission$spacecraft$data <= 0) || ($Mission$spaceMission$spacecraft$batteryCharge < 40)) && ($Mission$spaceMission$spacecraft$transmitTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal)) && (($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal) || ! (($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal)))) && (($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal) || ! (($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal))))))); choice { assume (($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal)); choice { @@ -190,7 +190,7 @@ trans { assume (! (((! (($Mission$spaceMission$spacecraft$batteryCharge < 40)) && ($Mission$spaceMission$spacecraft$consumeTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal)))); } } or { - assume (! ((($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal) && ((((! ((($Mission$spaceMission$spacecraft$data <= 0) || ($Mission$spaceMission$spacecraft$batteryCharge < 40))) && ($Mission$spaceMission$spacecraft$transmitTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal)) || ! (((! ((($Mission$spaceMission$spacecraft$data <= 0) || ($Mission$spaceMission$spacecraft$batteryCharge < 40))) && ($Mission$spaceMission$spacecraft$transmitTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal)))) && (((! (($Mission$spaceMission$spacecraft$batteryCharge < 40)) && ($Mission$spaceMission$spacecraft$consumeTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal)) || ! (((! (($Mission$spaceMission$spacecraft$batteryCharge < 40)) && ($Mission$spaceMission$spacecraft$consumeTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal)))))))); + assume (! (((($Mission$spaceMission$spacecraft$Communication$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$$literal) && (((! ((($Mission$spaceMission$spacecraft$data <= 0) || ($Mission$spaceMission$spacecraft$batteryCharge < 40))) && ($Mission$spaceMission$spacecraft$transmitTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal)) || ! (((! ((($Mission$spaceMission$spacecraft$data <= 0) || ($Mission$spaceMission$spacecraft$batteryCharge < 40))) && ($Mission$spaceMission$spacecraft$transmitTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$SendData$Sending$$literal))))) && (((! (($Mission$spaceMission$spacecraft$batteryCharge < 40)) && ($Mission$spaceMission$spacecraft$consumeTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal)) || ! (((! (($Mission$spaceMission$spacecraft$batteryCharge < 40)) && ($Mission$spaceMission$spacecraft$consumeTimeout$remainingTime <= 0)) && ($Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$activeState == $Mission$spaceMission$spacecraft$Communication$Transmitting$ConsumePower$Consuming$$literal))))))); } } choice {