diff --git a/chi/org.eclipse.escet.chi.documentation/asciidoc/release-notes.asciidoc b/chi/org.eclipse.escet.chi.documentation/asciidoc/release-notes.asciidoc index 6dcfc55e7c51ee899fce53420334895cf280d09b..47dd7c05a374d29dca52c3e944fa024fb1a949e6 100644 --- a/chi/org.eclipse.escet.chi.documentation/asciidoc/release-notes.asciidoc +++ b/chi/org.eclipse.escet.chi.documentation/asciidoc/release-notes.asciidoc @@ -26,6 +26,16 @@ See also the Eclipse ESCET link:https://eclipse.org/escet/{escet-website-version TBD +New features: + +* The Chi text editor now has theming support, and comes with a dark theme in addition to the existing light theme. +The text editor now automatically uses its dark theme when the Eclipse built-in dark theme is used, and uses a light theme otherwise. +The text editor theming behavior can be configured via the Eclipse Preferences dialog (issue {escet-issue}347[#347]). + +Improvements and fixes: + +* The Chi text editor light theme's default color has changed from a near-black slightly-brown color to pure black (issue {escet-issue}347[#347]). + === Version 0.6 (2022-07-07) Improvements and fixes: diff --git a/chi/org.eclipse.escet.chi.texteditor/META-INF/MANIFEST.MF b/chi/org.eclipse.escet.chi.texteditor/META-INF/MANIFEST.MF index 40e26e1a08598d75f22f58cb85e3dfadcdedafdc..87783255fd07672b058368c4abba4cfc26e49c49 100644 --- a/chi/org.eclipse.escet.chi.texteditor/META-INF/MANIFEST.MF +++ b/chi/org.eclipse.escet.chi.texteditor/META-INF/MANIFEST.MF @@ -17,6 +17,8 @@ Require-Bundle: org.eclipse.escet.chi.parser;bundle-version="0.7.0", org.eclipse.ui.editors;bundle-version="3.13.0", org.eclipse.escet.setext.texteditorbase;bundle-version="0.7.0", org.eclipse.escet.setext.runtime;bundle-version="0.7.0", - org.eclipse.escet.common.java;bundle-version="0.7.0" + org.eclipse.escet.common.java;bundle-version="0.7.0", + org.eclipse.ui.ide;bundle-version="3.18.200", + org.eclipse.escet.common.app.framework;bundle-version="0.7.0" Automatic-Module-Name: org.eclipse.escet.chi.texteditor Export-Package: org.eclipse.escet.chi.texteditor diff --git a/chi/org.eclipse.escet.chi.texteditor/plugin.xml b/chi/org.eclipse.escet.chi.texteditor/plugin.xml index 654781b32571247bcc8ef6eefc5c66c3d7cce87b..49cf0039c0832b6113318fb8d0416d5dbf7fd71d 100644 --- a/chi/org.eclipse.escet.chi.texteditor/plugin.xml +++ b/chi/org.eclipse.escet.chi.texteditor/plugin.xml @@ -39,4 +39,13 @@ + + + + + diff --git a/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiSourceViewerConfig.java b/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiSourceViewerConfig.java index cbe091757458dfc6a8e77479e212b51c99267ec0..b0266d3c4224273f978557d5b53ae419f7f21249 100644 --- a/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiSourceViewerConfig.java +++ b/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiSourceViewerConfig.java @@ -13,27 +13,45 @@ package org.eclipse.escet.chi.texteditor; +import static org.eclipse.escet.chi.texteditor.ChiTextEditorStylable.COMMENT_SL; +import static org.eclipse.escet.chi.texteditor.ChiTextEditorStylable.STRING; +import static org.eclipse.escet.chi.texteditor.ChiTextEditorStylable.STRING_ESCAPE; + import org.eclipse.escet.setext.texteditorbase.GenericSourceViewerConfiguration; import org.eclipse.escet.setext.texteditorbase.scanners.FormatStringScanner; import org.eclipse.escet.setext.texteditorbase.scanners.SingleStyleScanner; +import org.eclipse.escet.setext.texteditorbase.themes.TextEditorTheme; import org.eclipse.jface.text.presentation.PresentationReconciler; import org.eclipse.jface.text.rules.ITokenScanner; /** Chi text editor source viewer configuration. */ public class ChiSourceViewerConfig extends GenericSourceViewerConfiguration { + /** The theme to use. */ + private final TextEditorTheme theme; + + /** + * Constructor for the {@link ChiSourceViewerConfig} class. + * + * @param theme The theme to use. + */ + public ChiSourceViewerConfig(TextEditorTheme theme) { + this.theme = theme; + } + @Override protected void addDamagersRepairers(PresentationReconciler reconciler) { // DEFAULT. - ITokenScanner scanner = new ChiTextScanner(colorManager); + ITokenScanner scanner = new ChiTextScanner(theme, colorManager); addDamagerRepairer(reconciler, scanner, DEFAULT_CONTENT_TYPE); // COMMENT_SL. - ITokenScanner commentSlScanner = new SingleStyleScanner(ChiStyles.COMMENT_SL.createToken(colorManager)); + ITokenScanner commentSlScanner = new SingleStyleScanner(theme.getStyle(COMMENT_SL).createToken(colorManager)); addDamagerRepairer(reconciler, commentSlScanner, "__chi_comment_sl"); // STRING (string literals, paths, format patterns, etc). - ITokenScanner stringScanner = new FormatStringScanner(ChiStyles.STRING.createToken(colorManager), - ChiStyles.STRING_ESCAPE.createToken(colorManager), ChiStyles.STRING_ESCAPE.createToken(colorManager)); + ITokenScanner stringScanner = new FormatStringScanner(theme.getStyle(STRING).createToken(colorManager), + theme.getStyle(STRING_ESCAPE).createToken(colorManager), + theme.getStyle(STRING_ESCAPE).createToken(colorManager)); addDamagerRepairer(reconciler, stringScanner, "__chi_string"); } } diff --git a/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiStyles.java b/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiStyles.java deleted file mode 100644 index 561a2e3498e2741cf091de12e291b9f600adfba5..0000000000000000000000000000000000000000 --- a/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiStyles.java +++ /dev/null @@ -1,47 +0,0 @@ -////////////////////////////////////////////////////////////////////////////// -// Copyright (c) 2010, 2022 Contributors to the Eclipse Foundation -// -// See the NOTICE file(s) distributed with this work for additional -// information regarding copyright ownership. -// -// This program and the accompanying materials are made available -// under the terms of the MIT License which is available at -// https://opensource.org/licenses/MIT -// -// SPDX-License-Identifier: MIT -////////////////////////////////////////////////////////////////////////////// - -package org.eclipse.escet.chi.texteditor; - -import org.eclipse.escet.setext.texteditorbase.Style; -import org.eclipse.swt.SWT; - -/** Styles for the Chi text editor. */ -public interface ChiStyles { - /** Default style. */ - Style DEFAULT = new Style(64, 32, 32); - - /** Identifiers style. */ - Style IDENTIFIER = new Style(0, 0, 0); - - /** Single line comment style. */ - Style COMMENT_SL = new Style(128, 128, 128, SWT.ITALIC); - - /** String literal style. */ - Style STRING = new Style(192, 0, 0); - - /** String literal escape style. */ - Style STRING_ESCAPE = new Style(255, 128, 0); - - /** Keyword style. */ - Style KEYWORD = new Style(0, 0, 255); - - /** Standard library function keyword style. */ - Style STDLIBFUNC = new Style(128, 0, 255); - - /** Operator style. */ - Style OPERATOR = new Style(0, 97, 192); - - /** Number literal style. */ - Style NUMBER = new Style(0, 97, 0); -} diff --git a/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextEditor.java b/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextEditor.java index fd0c4c0d09807dcf7059504051a474e79cfde45b..257d7fc71a620f3cb4747a43dd46a110b671f6a2 100644 --- a/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextEditor.java +++ b/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextEditor.java @@ -22,10 +22,11 @@ import org.eclipse.escet.chi.typecheck.ChiTypeChecker; import org.eclipse.escet.setext.texteditorbase.GenericTextEditor; /** Chi text editor for Eclipse. */ -public class ChiTextEditor extends GenericTextEditor, Specification> { +public class ChiTextEditor extends GenericTextEditor, Specification, ChiTextEditorStylable> { /** Constructor for the {@link ChiTextEditor} class. */ public ChiTextEditor() { - super(new ChiPartitionScanner(), new ChiSourceViewerConfig(), ChiParser.class, ChiTypeChecker.class, + super(new ChiPartitionScanner(), theme -> new ChiSourceViewerConfig(theme), new ChiTextEditorDarkTheme(), + new ChiTextEditorLightTheme(), ChiParser.class, ChiTypeChecker.class, "org.eclipse.escet.chi.texteditor.ChiSyntaxError", "org.eclipse.escet.chi.texteditor.ChiSemanticError", "#"); } diff --git a/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextEditorDarkTheme.java b/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextEditorDarkTheme.java new file mode 100644 index 0000000000000000000000000000000000000000..ce40607b2d9012bce52fcbfd70064f6362df4410 --- /dev/null +++ b/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextEditorDarkTheme.java @@ -0,0 +1,46 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.chi.texteditor; + +import org.eclipse.escet.setext.texteditorbase.Style; +import org.eclipse.escet.setext.texteditorbase.themes.TextEditorTheme; +import org.eclipse.swt.SWT; + +/** Chi text editor dark theme. */ +public class ChiTextEditorDarkTheme implements TextEditorTheme { + @Override + public Style getStyle(ChiTextEditorStylable stylable) { + switch (stylable) { + case DEFAULT: + return new Style(240, 240, 240); + case IDENTIFIER: + return new Style(240, 240, 240); + case COMMENT_SL: + return new Style(150, 150, 150, SWT.ITALIC); + case STRING: + return new Style(235, 64, 64); + case STRING_ESCAPE: + return new Style(235, 150, 40); + case KEYWORD: + return new Style(0, 164, 255); + case STDLIBFUNC: + return new Style(210, 110, 255); + case OPERATOR: + return new Style(64, 210, 210); + case NUMBER: + return new Style(24, 225, 24); + } + throw new AssertionError(); + } +} diff --git a/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextEditorLightTheme.java b/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextEditorLightTheme.java new file mode 100644 index 0000000000000000000000000000000000000000..0cbfd393216f45288206321c27c41686f8a1e7ed --- /dev/null +++ b/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextEditorLightTheme.java @@ -0,0 +1,46 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.chi.texteditor; + +import org.eclipse.escet.setext.texteditorbase.Style; +import org.eclipse.escet.setext.texteditorbase.themes.TextEditorTheme; +import org.eclipse.swt.SWT; + +/** Chi text editor light theme. */ +public class ChiTextEditorLightTheme implements TextEditorTheme { + @Override + public Style getStyle(ChiTextEditorStylable stylable) { + switch (stylable) { + case DEFAULT: + return new Style(0, 0, 0); + case IDENTIFIER: + return new Style(0, 0, 0); + case COMMENT_SL: + return new Style(128, 128, 128, SWT.ITALIC); + case STRING: + return new Style(192, 0, 0); + case STRING_ESCAPE: + return new Style(255, 128, 0); + case KEYWORD: + return new Style(0, 0, 255); + case STDLIBFUNC: + return new Style(128, 0, 255); + case OPERATOR: + return new Style(0, 97, 192); + case NUMBER: + return new Style(0, 97, 0); + } + throw new AssertionError(); + } +} diff --git a/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextEditorPreferencePage.java b/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextEditorPreferencePage.java new file mode 100644 index 0000000000000000000000000000000000000000..92cf648d5a5561aa8697b249ee6b170755c7065e --- /dev/null +++ b/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextEditorPreferencePage.java @@ -0,0 +1,21 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.chi.texteditor; + +import org.eclipse.escet.setext.texteditorbase.GenericTextEditorPreferencePage; + +/** Chi text editor preference page. */ +public class ChiTextEditorPreferencePage extends GenericTextEditorPreferencePage { + // Base class provides all functionality. +} diff --git a/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextEditorStylable.java b/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextEditorStylable.java new file mode 100644 index 0000000000000000000000000000000000000000..e062be7f29497846c2ca38408603001ca3744de5 --- /dev/null +++ b/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextEditorStylable.java @@ -0,0 +1,44 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2010, 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.chi.texteditor; + +/** Chi text editor stylable. */ +public enum ChiTextEditorStylable { + /** Default. */ + DEFAULT, + + /** Identifier. */ + IDENTIFIER, + + /** Single-line comment. */ + COMMENT_SL, + + /** String literal. */ + STRING, + + /** String literal escape sequence. */ + STRING_ESCAPE, + + /** Keyword. */ + KEYWORD, + + /** Standard library function. */ + STDLIBFUNC, + + /** Operator. */ + OPERATOR, + + /** Number literal. */ + NUMBER, +} diff --git a/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextScanner.java b/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextScanner.java index 427d0d6a67584136d33ee825b629e22660d7f7bb..51271e16f238fa7c7cd9b0360a8e59e0213df335 100644 --- a/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextScanner.java +++ b/chi/org.eclipse.escet.chi.texteditor/src/org/eclipse/escet/chi/texteditor/ChiTextScanner.java @@ -13,6 +13,13 @@ package org.eclipse.escet.chi.texteditor; +import static org.eclipse.escet.chi.texteditor.ChiTextEditorStylable.DEFAULT; +import static org.eclipse.escet.chi.texteditor.ChiTextEditorStylable.IDENTIFIER; +import static org.eclipse.escet.chi.texteditor.ChiTextEditorStylable.KEYWORD; +import static org.eclipse.escet.chi.texteditor.ChiTextEditorStylable.NUMBER; +import static org.eclipse.escet.chi.texteditor.ChiTextEditorStylable.OPERATOR; +import static org.eclipse.escet.chi.texteditor.ChiTextEditorStylable.STDLIBFUNC; + import org.eclipse.escet.chi.parser.ChiScanner; import org.eclipse.escet.setext.texteditorbase.ColorManager; import org.eclipse.escet.setext.texteditorbase.detectors.GenericWhitespaceDetector; @@ -20,6 +27,7 @@ import org.eclipse.escet.setext.texteditorbase.rules.IdentifiersRule; import org.eclipse.escet.setext.texteditorbase.rules.IntNumberRule; import org.eclipse.escet.setext.texteditorbase.rules.KeywordsRule; import org.eclipse.escet.setext.texteditorbase.rules.RealNumberRule; +import org.eclipse.escet.setext.texteditorbase.themes.TextEditorTheme; import org.eclipse.jface.text.rules.IRule; import org.eclipse.jface.text.rules.RuleBasedScanner; import org.eclipse.jface.text.rules.WhitespaceRule; @@ -29,9 +37,10 @@ public class ChiTextScanner extends RuleBasedScanner { /** * Constructor for the {@link ChiScanner} class. * + * @param theme The theme to use. * @param manager The color manager to use to create the color tokens. */ - public ChiTextScanner(ColorManager manager) { + public ChiTextScanner(TextEditorTheme theme, ColorManager manager) { String[] keywords = ChiScanner.getKeywords("Keywords"); String[] types = ChiScanner.getKeywords("Types"); String[] constants = ChiScanner.getKeywords("Constants"); @@ -50,17 +59,17 @@ public class ChiTextScanner extends RuleBasedScanner { // Construct and set predicate rules. Make sure we also have a default // token. IRule[] rules = new IRule[] { // - new KeywordsRule(allKeywords, ChiStyles.KEYWORD.createToken(manager)), - new KeywordsRule(stdlibfuncs, ChiStyles.STDLIBFUNC.createToken(manager)), - new KeywordsRule(operators, ChiStyles.OPERATOR.createToken(manager)), - new IdentifiersRule(ChiStyles.IDENTIFIER.createToken(manager)), - new RealNumberRule(ChiStyles.NUMBER.createToken(manager)), - new IntNumberRule(ChiStyles.NUMBER.createToken(manager)), + new KeywordsRule(allKeywords, theme.getStyle(KEYWORD).createToken(manager)), + new KeywordsRule(stdlibfuncs, theme.getStyle(STDLIBFUNC).createToken(manager)), + new KeywordsRule(operators, theme.getStyle(OPERATOR).createToken(manager)), + new IdentifiersRule(theme.getStyle(IDENTIFIER).createToken(manager)), + new RealNumberRule(theme.getStyle(NUMBER).createToken(manager)), + new IntNumberRule(theme.getStyle(NUMBER).createToken(manager)), new WhitespaceRule(new GenericWhitespaceDetector()), // }; setRules(rules); - setDefaultReturnToken(ChiStyles.DEFAULT.createToken(manager)); + setDefaultReturnToken(theme.getStyle(DEFAULT).createToken(manager)); } } diff --git a/cif/org.eclipse.escet.cif.cif2yed/src/org/eclipse/escet/cif/cif2yed/CifToYedDiagram.java b/cif/org.eclipse.escet.cif.cif2yed/src/org/eclipse/escet/cif/cif2yed/CifToYedDiagram.java index c6e92083b5881d6bc3de2a0c1d1e19dc06e1d10b..f3a2c5e8739eb4190a23ba39f955819124fa2ac2 100644 --- a/cif/org.eclipse.escet.cif.cif2yed/src/org/eclipse/escet/cif/cif2yed/CifToYedDiagram.java +++ b/cif/org.eclipse.escet.cif.cif2yed/src/org/eclipse/escet/cif/cif2yed/CifToYedDiagram.java @@ -31,6 +31,7 @@ import org.eclipse.escet.cif.cif2yed.options.SyntaxHighlightingOption; import org.eclipse.escet.cif.cif2yed.options.TransparentEdgeLabelsOption; import org.eclipse.escet.cif.metamodel.cif.Specification; import org.eclipse.escet.cif.texteditor.CifCodeHighlighter; +import org.eclipse.escet.cif.texteditor.CifTextEditorLightTheme; import org.eclipse.escet.common.app.framework.AppEnv; import org.eclipse.escet.common.app.framework.exceptions.UnsupportedException; import org.eclipse.escet.common.java.Assert; @@ -97,7 +98,7 @@ public abstract class CifToYedDiagram { highlight = SyntaxHighlightingOption.applyHighlighting(); if (highlight) { AppEnv.checkGuiAvailable("apply syntax highlighting in the CIF to yEd transformer"); - highlighter = new CifCodeHighlighter(); + highlighter = new CifCodeHighlighter(new CifTextEditorLightTheme()); } Assert.ifAndOnlyIf(highlight, highlighter != null); diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/CifPreconditionChecker.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/CifPreconditionChecker.java index fe13fe6706a7de1dba9f157bc055fef41548f28f..807b7199d05df0c43f9b5942518a9c6de2a17579 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/CifPreconditionChecker.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/CifPreconditionChecker.java @@ -13,8 +13,8 @@ package org.eclipse.escet.cif.common; -import java.util.Collections; import java.util.List; +import java.util.Set; import java.util.stream.Collectors; import org.eclipse.escet.cif.common.checkers.CifCheck; @@ -22,6 +22,7 @@ import org.eclipse.escet.cif.common.checkers.CifCheckViolations; import org.eclipse.escet.cif.common.checkers.CifChecker; import org.eclipse.escet.cif.metamodel.cif.Specification; import org.eclipse.escet.common.app.framework.exceptions.UnsupportedException; +import org.eclipse.escet.common.java.Sets; import org.eclipse.escet.common.java.Strings; /** @@ -61,10 +62,11 @@ public class CifPreconditionChecker extends CifChecker { // Report unsupported specification, if there are any precondition violations. if (violations.hasViolations()) { - List messages = violations.getViolations().map(v -> "Unsupported " + v.toString()) - .collect(Collectors.toList()); - Collections.sort(messages, Strings.SORTER); - String msg = toolName + " failed due to unsatisfied preconditions:\n - " + String.join("\n - ", messages); + Set messages = violations.getViolations().map(v -> "Unsupported " + v.toString()) + .collect(Collectors.toSet()); + List sortedMessages = Sets.sortedgeneric(messages, Strings.SORTER); + String msg = toolName + " failed due to unsatisfied preconditions:\n - " + + String.join("\n - ", sortedMessages); throw new UnsupportedException(msg); } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/CifTextUtils.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/CifTextUtils.java index ccddbc5d3d5515972d74e5eb90eddd2e9d2b54bf..27b03b0eed572b7a76eac56d8d71e60ebd9e6f7f 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/CifTextUtils.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/CifTextUtils.java @@ -27,9 +27,11 @@ import org.eclipse.escet.cif.metamodel.cif.AlgParameter; import org.eclipse.escet.cif.metamodel.cif.ComplexComponent; import org.eclipse.escet.cif.metamodel.cif.Component; import org.eclipse.escet.cif.metamodel.cif.ComponentDef; +import org.eclipse.escet.cif.metamodel.cif.ComponentInst; import org.eclipse.escet.cif.metamodel.cif.ComponentParameter; import org.eclipse.escet.cif.metamodel.cif.Equation; import org.eclipse.escet.cif.metamodel.cif.EventParameter; +import org.eclipse.escet.cif.metamodel.cif.Group; import org.eclipse.escet.cif.metamodel.cif.Invariant; import org.eclipse.escet.cif.metamodel.cif.LocationParameter; import org.eclipse.escet.cif.metamodel.cif.Parameter; @@ -50,6 +52,7 @@ import org.eclipse.escet.cif.metamodel.cif.declarations.EnumDecl; import org.eclipse.escet.cif.metamodel.cif.declarations.EnumLiteral; import org.eclipse.escet.cif.metamodel.cif.declarations.Event; import org.eclipse.escet.cif.metamodel.cif.declarations.InputVariable; +import org.eclipse.escet.cif.metamodel.cif.declarations.TypeDecl; import org.eclipse.escet.cif.metamodel.cif.expressions.AlgVariableExpression; import org.eclipse.escet.cif.metamodel.cif.expressions.BaseFunctionExpression; import org.eclipse.escet.cif.metamodel.cif.expressions.BinaryExpression; @@ -1597,4 +1600,102 @@ public class CifTextUtils { return getComponentText2((ComplexComponent)locOrComp); } } + + /** + * Returns a description of the type of named object that is provided: + *
    + *
  • {@link AlgVariable}: {@code "algebraic variable"} or {@code "algebraic parameter"}
  • + *
  • {@link Automaton}: {@code "automaton"} or {@code "automaton definition"}
  • + *
  • {@link ComponentDef}: {@code "automaton definition"} or {@code "group definition"}
  • + *
  • {@link ComponentInst}: {@code "component instantiation"}
  • + *
  • {@link Constant}: {@code "constant"}
  • + *
  • {@link ContVariable}: {@code "continuous variable"}
  • + *
  • {@link DiscVariable}: {@code "discrete variable"}, {@code "function variable"} or + * {@code "function parameter"}
  • + *
  • {@link EnumDecl}: {@code "enumeration declaration"}
  • + *
  • {@link EnumLiteral}: {@code "enumeration literal"}
  • + *
  • {@link Event}: {@code "event"} or {@code "event parameter"}
  • + *
  • {@link Function}: {@code "user-defined function"}
  • + *
  • {@link FunctionParameter}: {@code "function parameter"}
  • + *
  • {@link Group}: {@code "group"} or {@code "group definition"}
  • + *
  • {@link InputVariable}: {@code "input variable"}
  • + *
  • {@link Invariant}: {@code "invariant"}
  • + *
  • {@link Location}: {@code "location"} or {@code "location parameter"}
  • + *
  • {@link Parameter}: {@code "algebraic parameter"}, {@code "component parameter"}, {@code "event parameter"} or + * {@code "location parameter"}
  • + *
  • {@link TypeDecl}: {@code "type declaration"}
  • + *
+ * + * @param obj The {@link #hasName named object}. + * @return The object type description. + * @see #hasName + */ + public static String getTypeDescriptionForNamedObject(PositionObject obj) { + Assert.check(hasName(obj)); + + if (obj instanceof AlgVariable) { + return (obj.eContainer() instanceof Parameter) ? "algebraic parameter" : "algebraic variable"; + } else if (obj instanceof Automaton) { + return (obj.eContainer() instanceof ComponentDef) ? "automaton definition" : "automaton"; + } else if (obj instanceof ComponentDef) { + ComplexComponent body = ((ComponentDef)obj).getBody(); + if (body instanceof Automaton) { + return "automaton definition"; + } else if (body instanceof Group) { + return "group definition"; + } else { + throw new RuntimeException("Unknown component definition body: " + body); + } + } else if (obj instanceof ComponentInst) { + return "component instantiation"; + } else if (obj instanceof Constant) { + return "constant"; + } else if (obj instanceof ContVariable) { + return "continuous variable"; + } else if (obj instanceof DiscVariable) { + if (obj.eContainer() instanceof Function) { + return "function variable"; + } else if (obj.eContainer() instanceof FunctionParameter) { + return "function parameter"; + } else { + Assert.check(obj.eContainer() instanceof Automaton); + return "discrete variable"; + } + } else if (obj instanceof EnumDecl) { + return "enumeration declaration"; + } else if (obj instanceof EnumLiteral) { + return "enumeration literal"; + } else if (obj instanceof Event) { + return (obj.eContainer() instanceof Parameter) ? "event parameter" : "event"; + } else if (obj instanceof Function) { + return "user-defined function"; + } else if (obj instanceof FunctionParameter) { + return "function parameter"; + } else if (obj instanceof Group) { + // Specifications don't have a name, and are thus not supported. + return (obj.eContainer() instanceof ComponentDef) ? "group definition" : "group"; + } else if (obj instanceof InputVariable) { + return "input variable"; + } else if (obj instanceof Invariant) { + return "invariant"; + } else if (obj instanceof Location) { + return (obj.eContainer() instanceof Parameter) ? "location parameter" : "location"; + } else if (obj instanceof Parameter) { + if (obj instanceof AlgParameter) { + return "algebraic parameter"; + } else if (obj instanceof ComponentParameter) { + return "component parameter"; + } else if (obj instanceof EventParameter) { + return "event parameter"; + } else if (obj instanceof LocationParameter) { + return "location parameter"; + } else { + throw new RuntimeException("Unexpected component definition parameter: " + obj); + } + } else if (obj instanceof TypeDecl) { + return "type declaration"; + } else { + throw new RuntimeException("Unexpected object: " + obj); + } + } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/CifCheckViolation.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/CifCheckViolation.java index ffb3c84f488774a4df8ebab20551fe54106f1e1d..132f783f15d29bac397ecbbb473c50167d20b9e0 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/CifCheckViolation.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/CifCheckViolation.java @@ -18,34 +18,90 @@ import static org.eclipse.escet.common.java.Strings.fmt; import java.util.Objects; import org.eclipse.escet.cif.common.CifTextUtils; +import org.eclipse.escet.cif.common.checkers.messages.CifCheckViolationMessage; +import org.eclipse.escet.cif.metamodel.cif.Specification; import org.eclipse.escet.common.java.Assert; import org.eclipse.escet.common.position.metamodel.position.PositionObject; /** CIF check condition violation. */ public class CifCheckViolation { /** - * The named CIF object for which the violation is reported, or {@code null} to report it for the CIF specification. + * The provided CIF object for which the violation is to be reported. May be {@code null} to report for the CIF + * specification. Is never a {@link Specification}. If it is not a named CIF object, the violation is reported on + * its closest named ancestor. */ - private final PositionObject cifObject; + private final PositionObject providedReportObject; + + /** + * The named CIF object on which the violation is to be reported, or {@code null} to report it on the CIF + * specification. + */ + private final PositionObject actualReportObject; /** The message describing the violation. */ - private final String message; + private final CifCheckViolationMessage message; /** * Constructor for the {@link CifCheckViolation} class. * - * @param cifObject The named CIF object for which the violation is reported, or {@code null} to report it for the - * CIF specification. - * @param message The message describing the violation. E.g., {@code "event is a channel"}, - * {@code "automaton is a kindless automaton, lacking a supervisory kind"} or - * {@code "specification has no automata"}. + * @param cifObject The CIF object for which the violation is to be reported. Note that: + *
    + *
  • If this object itself is not named, then the {@link CifTextUtils#getNamedSelfOrAncestor closest named + * ancestor} is used instead.
  • + *
  • If the object itself is not named, and has no named ancestor, the specification is used.
  • + *
  • To report a violation on an entire specification, either a {@link Specification} or {@code null} may be + * provided.
  • + *
+ * @param message The message describing the violation. The concatenated message should in principle not start with + * a capital letter, nor end with a period to end the sentence. + * @see CifCheckViolations#add */ - public CifCheckViolation(PositionObject cifObject, String message) { - this.cifObject = cifObject; + public CifCheckViolation(PositionObject cifObject, CifCheckViolationMessage message) { + // Store provided object. Normalize to single representation (null) for specifications. + this.providedReportObject = (cifObject instanceof Specification) ? null : cifObject; + + // Store report object. Never a 'Specification'. May be 'null'. + this.actualReportObject = (providedReportObject == null) ? null + : CifTextUtils.getNamedSelfOrAncestor(providedReportObject); + Assert.implies(this.actualReportObject != null, CifTextUtils.hasName(actualReportObject)); + + // Store message. this.message = message; - if (cifObject != null) { - Assert.check(CifTextUtils.hasName(cifObject), cifObject); + } + + /** + * Is the violation being reported on the provided CIF object? + * + * @return {@code true} if the violation being reported on the provided CIF object, {@code false} if it is being + * reported on an ancestor of that object. + */ + public boolean isReportOnSelf() { + return providedReportObject == actualReportObject; + } + + /** + * Is the violation being reported on a CIF specification? + * + * @return {@code true} if it is being reported on a CIF specification, {@code false} if it is being reported on + * some named CIF object. + */ + public boolean isReportOnSpecification() { + return actualReportObject == null; + } + + /** + * Returns the named CIF object on which the violation is to be reported. + * + * @return The named CIF object on which the violation is to be reported. + * @throws IllegalStateException If the violation is to be reported pm the CIF specification, rather than on a named + * CIF object. + * @see #isReportOnSpecification + */ + public PositionObject getReportObject() { + if (actualReportObject == null) { + throw new IllegalStateException(); } + return actualReportObject; } @Override @@ -57,17 +113,20 @@ public class CifCheckViolation { return false; } CifCheckViolation that = (CifCheckViolation)obj; - return this.cifObject == that.cifObject && this.message.equals(that.message); + return this.providedReportObject == that.providedReportObject + && this.actualReportObject == that.actualReportObject && this.message.equals(that.message); } @Override public int hashCode() { - return Objects.hash(cifObject, message); + return Objects.hash(providedReportObject, actualReportObject, message); } @Override public String toString() { - String name = (cifObject == null) ? "specification" : "\"" + CifTextUtils.getAbsName(cifObject) + "\""; - return fmt("%s: %s.", name, message); + String name = (actualReportObject == null) ? "specification" + : "\"" + CifTextUtils.getAbsName(actualReportObject) + "\""; + String messageText = message.getMessageText(this); + return fmt("%s: %s.", name, messageText); } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/CifCheckViolations.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/CifCheckViolations.java index 765f72490c935a31408a38ee392bd9f12df50eb5..718c8a4b228aa3788b394db96f92fb86b1393aea 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/CifCheckViolations.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/CifCheckViolations.java @@ -15,9 +15,15 @@ package org.eclipse.escet.cif.common.checkers; import static org.eclipse.escet.common.java.Sets.set; +import java.util.Arrays; import java.util.Set; import java.util.stream.Stream; +import org.eclipse.escet.cif.common.CifTextUtils; +import org.eclipse.escet.cif.common.checkers.messages.CifCheckViolationMessage; +import org.eclipse.escet.cif.common.checkers.messages.SequenceMessage; +import org.eclipse.escet.cif.metamodel.cif.Specification; +import org.eclipse.escet.common.java.Assert; import org.eclipse.escet.common.position.metamodel.position.PositionObject; /** CIF check condition violations. */ @@ -46,13 +52,24 @@ public class CifCheckViolations { /** * Add a violation. * - * @param cifObject The named CIF object for which the violation is reported, or {@code null} to report it for the - * CIF specification. - * @param message The message describing the violation. E.g., {@code "event is a channel"}, - * {@code "automaton is a kindless automaton, lacking a supervisory kind"} or - * {@code "specification has no automata"}. + * @param cifObject The CIF object for which the violation is to be reported. Note that: + *
    + *
  • If this object itself is not named, then the {@link CifTextUtils#getNamedSelfOrAncestor closest named + * ancestor} is used instead.
  • + *
  • If the object itself is not named, and has no named ancestor, the specification is used.
  • + *
  • To report a violation on an entire specification, either a {@link Specification} or {@code null} may be + * provided.
  • + *
+ * @param messages The non-empty sequence of concatenated messages describing the violation.The message texts of the + * messages are trimmed and concatenated, with a space being added in between each two message texts if needed. + * The concatenated message text should in principle not start with a capital letter, nor end with a period to + * end the sentence. + * @see CifCheckViolation#CifCheckViolation */ - public void add(PositionObject cifObject, String message) { + public void add(PositionObject cifObject, CifCheckViolationMessage... messages) { + Assert.check(messages.length > 0); + CifCheckViolationMessage message = (messages.length == 1) ? messages[0] + : new SequenceMessage(Arrays.asList(messages)); violations.add(new CifCheckViolation(cifObject, message)); } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/AutNoKindlessCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/AutNoKindlessCheck.java index 46d40c1c4a279545dfbc6c246c5f3258a4b57620..70ee46135b8ba1932bc08ccef8a36d7b65315048 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/AutNoKindlessCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/AutNoKindlessCheck.java @@ -15,6 +15,8 @@ package org.eclipse.escet.cif.common.checkers.checks; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; +import org.eclipse.escet.cif.common.checkers.messages.ReportObjectTypeDescrMessage; import org.eclipse.escet.cif.metamodel.cif.SupKind; import org.eclipse.escet.cif.metamodel.cif.automata.Automaton; @@ -23,7 +25,8 @@ public class AutNoKindlessCheck extends CifCheck { @Override protected void preprocessAutomaton(Automaton aut, CifCheckViolations violations) { if (aut.getKind() == SupKind.NONE) { - violations.add(aut, "automaton is a kindless automaton, lacking a supervisory kind"); + violations.add(aut, new ReportObjectTypeDescrMessage(), + new LiteralMessage("is a kindless automaton, lacking a supervisory kind")); } } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/AutOnlyWithOneInitLocCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/AutOnlyWithOneInitLocCheck.java index dd49665c7919315a04e360aadeddf0e46ed922cc..bffa61b0b1f5faa2dfbd453438fafdda03c71d6d 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/AutOnlyWithOneInitLocCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/AutOnlyWithOneInitLocCheck.java @@ -14,19 +14,21 @@ package org.eclipse.escet.cif.common.checkers.checks; import static org.eclipse.escet.cif.common.CifEvalUtils.evalPreds; -import static org.eclipse.escet.common.java.Strings.fmt; import org.eclipse.emf.ecore.EObject; import org.eclipse.escet.cif.common.CifEvalException; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.IfReportOnAncestorMessage; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; +import org.eclipse.escet.cif.common.checkers.messages.ReportObjectTypeDescrMessage; import org.eclipse.escet.cif.metamodel.cif.LocationParameter; import org.eclipse.escet.cif.metamodel.cif.automata.Automaton; import org.eclipse.escet.cif.metamodel.cif.automata.Location; import org.eclipse.escet.common.app.framework.exceptions.UnsupportedException; /** - * CIF check that allows automata only if they have exactly one initial location. Automata for which this can not be + * CIF check that allows automata only if they have exactly one initial location. Automata for which this cannot be * determined statically, are also not allowed. */ public class AutOnlyWithOneInitLocCheck extends CifCheck { @@ -46,9 +48,11 @@ public class AutOnlyWithOneInitLocCheck extends CifCheck { protected void postprocessAutomaton(Automaton aut, CifCheckViolations violations) { // There must be exactly one initial location. if (initLocCount == 0) { - violations.add(aut, "automaton has no initial location"); + violations.add(aut, new ReportObjectTypeDescrMessage(), + new LiteralMessage("has no initial location")); } else if (initLocCount > 1) { - violations.add(aut, fmt("automata has multiple (%d) initial locations", initLocCount)); + violations.add(aut, new ReportObjectTypeDescrMessage(), + new LiteralMessage("has multiple (%,d) initial locations", initLocCount)); } // Skip if check is disabled (negative value). } @@ -68,18 +72,16 @@ public class AutOnlyWithOneInitLocCheck extends CifCheck { initial = loc.getInitials().isEmpty() ? false : evalPreds(loc.getInitials(), true, true); } catch (UnsupportedException e) { // Can only fail if there is at least one predicate. - errMsg = "as one of its initialization predicates can not be statically evaluated"; + errMsg = "as one of its initialization predicates cannot be statically evaluated"; } catch (CifEvalException e) { // Can only fail if there is at least one predicate. errMsg = "as evaluating one of its initialization predicates resulted in an evaluation error"; } if (errMsg != null) { - if (loc.getName() != null) { - violations.add(loc, "failed to determine whether this is an initial location, " + errMsg); - } else { - violations.add((Automaton)loc.eContainer(), - "failed to determine whether the automaton's location is an initial location, " + errMsg); - } + // Report violation on the location, or on its automaton in case the location has no name. + violations.add(loc, new LiteralMessage("failed to determine whether the"), + new IfReportOnAncestorMessage("automaton's"), + new LiteralMessage("location is an initial location,"), new LiteralMessage(errMsg)); // Disable initial location count checking. initLocCount = -1; diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/CompNoInitPredsCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/CompNoInitPredsCheck.java index dca9c7640e3e8d15690adf91c79569d915295465..34e4fee0d338517591bc9b3b365428a1e3efcce8 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/CompNoInitPredsCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/CompNoInitPredsCheck.java @@ -15,6 +15,8 @@ package org.eclipse.escet.cif.common.checkers.checks; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; +import org.eclipse.escet.cif.common.checkers.messages.ReportObjectTypeDescrMessage; import org.eclipse.escet.cif.metamodel.cif.ComplexComponent; /** @@ -25,7 +27,8 @@ public class CompNoInitPredsCheck extends CifCheck { @Override protected void preprocessComplexComponent(ComplexComponent comp, CifCheckViolations violations) { if (!comp.getInitials().isEmpty()) { - violations.add(comp, "component contains an initialization predicate"); + violations.add(comp, new ReportObjectTypeDescrMessage(), + new LiteralMessage("contains an initialization predicate")); } } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/CompOnlyVarValueMarkerPredsCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/CompOnlyVarValueMarkerPredsCheck.java index 25a6583a4ebfe31546d5b06bda42e6bf9a9592fb..a69a4f675f1b76de4293572ee5012acbf72ed590 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/CompOnlyVarValueMarkerPredsCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/CompOnlyVarValueMarkerPredsCheck.java @@ -19,6 +19,8 @@ import java.util.Map; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; +import org.eclipse.escet.cif.common.checkers.messages.ReportObjectTypeDescrMessage; import org.eclipse.escet.cif.metamodel.cif.ComplexComponent; import org.eclipse.escet.cif.metamodel.cif.declarations.DiscVariable; import org.eclipse.escet.cif.metamodel.cif.expressions.BinaryExpression; @@ -39,14 +41,14 @@ public class CompOnlyVarValueMarkerPredsCheck extends CifCheck { for (Expression marked: comp.getMarkeds()) { // The only supported form is 'discrete_variable = marked_value'. if (!(marked instanceof BinaryExpression)) { - violations.add(comp, "component has a marker predicate that is not of the form " - + "\"discrete_variable = marked_value\""); + violations.add(comp, new ReportObjectTypeDescrMessage(), new LiteralMessage( + "has a marker predicate that is not of the form \"discrete_variable = marked_value\"")); continue; } BinaryExpression bexpr = (BinaryExpression)marked; if (bexpr.getOperator() != BinaryOperator.EQUAL || !(bexpr.getLeft() instanceof DiscVariableExpression)) { - violations.add(comp, "component has a marker predicate that is not of the form " - + "\"discrete_variable = marked_value\""); + violations.add(comp, new ReportObjectTypeDescrMessage(), new LiteralMessage( + "has a marker predicate that is not of the form \"discrete_variable = marked_value\"")); continue; } @@ -58,7 +60,8 @@ public class CompOnlyVarValueMarkerPredsCheck extends CifCheck { if (previousValue == null) { markeds.put(var, newValue); } else { - violations.add(var, "discrete variable has multiple predicates to specify its marked values"); + violations.add(var, + new LiteralMessage("discrete variable has multiple predicates that specify its marked values")); } } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/CompStateInvsOnlyReqsCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/CompStateInvsOnlyReqsCheck.java index 5c83307ed4bae468ab9bd8754f48333dce66c960..cf9547f2172e86e505936dd09a97343197f11d3e 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/CompStateInvsOnlyReqsCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/CompStateInvsOnlyReqsCheck.java @@ -13,11 +13,11 @@ package org.eclipse.escet.cif.common.checkers.checks; -import static org.eclipse.escet.common.java.Strings.fmt; - import org.eclipse.escet.cif.common.CifTextUtils; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; +import org.eclipse.escet.cif.common.checkers.messages.ReportObjectTypeDescrMessage; import org.eclipse.escet.cif.metamodel.cif.ComplexComponent; import org.eclipse.escet.cif.metamodel.cif.InvKind; import org.eclipse.escet.cif.metamodel.cif.Invariant; @@ -32,7 +32,8 @@ public class CompStateInvsOnlyReqsCheck extends CifCheck { SupKind supKind = inv.getSupKind(); if (supKind != SupKind.REQUIREMENT) { String kindTxt = (supKind == SupKind.NONE) ? "kindless" : CifTextUtils.kindToStr(supKind); - violations.add(comp, fmt("component has a %s state invariant", kindTxt)); + violations.add(comp, new ReportObjectTypeDescrMessage(), + new LiteralMessage("has a %s state invariant", kindTxt)); } } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EdgeNoIfUpdatesCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EdgeNoIfUpdatesCheck.java index 2eedaa4ebde2ecb2a00cebe472d6c28323dbad17..1d52ef1590a3fe3c4970b4beb2346719f37fa232 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EdgeNoIfUpdatesCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EdgeNoIfUpdatesCheck.java @@ -13,13 +13,11 @@ package org.eclipse.escet.cif.common.checkers.checks; -import org.eclipse.emf.ecore.EObject; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; -import org.eclipse.escet.cif.metamodel.cif.automata.Automaton; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; +import org.eclipse.escet.cif.common.checkers.messages.ReportObjectTypeDescrMessage; import org.eclipse.escet.cif.metamodel.cif.automata.IfUpdate; -import org.eclipse.escet.cif.metamodel.cif.automata.Location; -import org.eclipse.escet.common.java.Assert; /** * CIF check that does not allow 'if' updates on edges. @@ -29,19 +27,8 @@ import org.eclipse.escet.common.java.Assert; public class EdgeNoIfUpdatesCheck extends CifCheck { @Override protected void preprocessIfUpdate(IfUpdate update, CifCheckViolations violations) { - // Get location. - EObject ancestor = update; - while (!(ancestor instanceof Location)) { - ancestor = ancestor.eContainer(); - } - Assert.check(ancestor instanceof Location); - Location loc = (Location)ancestor; - - // Report violation. - if (loc.getName() != null) { - violations.add(loc, "location has an edge with an 'if' update"); - } else { - violations.add((Automaton)loc.eContainer(), "automaton has an edge with an 'if' update"); - } + // Report violation on the closest named ancestor of the 'if' update: a location or an automaton. + violations.add(update, new ReportObjectTypeDescrMessage(), + new LiteralMessage("has an edge with an 'if' update")); } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EdgeNoMultiAssignCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EdgeNoMultiAssignCheck.java index 532c552947c587b761c4dedb6898cd35b63fdded..620eabb4074a3f8485415334e05090bd3f3ffb94 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EdgeNoMultiAssignCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EdgeNoMultiAssignCheck.java @@ -13,14 +13,12 @@ package org.eclipse.escet.cif.common.checkers.checks; -import org.eclipse.emf.ecore.EObject; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; +import org.eclipse.escet.cif.common.checkers.messages.ReportObjectTypeDescrMessage; import org.eclipse.escet.cif.metamodel.cif.automata.Assignment; -import org.eclipse.escet.cif.metamodel.cif.automata.Automaton; -import org.eclipse.escet.cif.metamodel.cif.automata.Location; import org.eclipse.escet.cif.metamodel.cif.expressions.TupleExpression; -import org.eclipse.escet.common.java.Assert; /** * CIF check that does not allow multi-assignments on edges. This check does not disallow multiple assignments on a @@ -32,20 +30,9 @@ public class EdgeNoMultiAssignCheck extends CifCheck { @Override protected void preprocessAssignment(Assignment asgn, CifCheckViolations violations) { if (asgn.getAddressable() instanceof TupleExpression) { - // Get location. - EObject ancestor = asgn; - while (!(ancestor instanceof Location)) { - ancestor = ancestor.eContainer(); - } - Assert.check(ancestor instanceof Location); - Location loc = (Location)ancestor; - - // Report violation. - if (loc.getName() != null) { - violations.add(loc, "location has an edge with a multi-assignment"); - } else { - violations.add((Automaton)loc.eContainer(), "automaton has an edge with a multi-assignment"); - } + // Report violation on the closest named ancestor of the assignment: a location or an automaton. + violations.add(asgn, new ReportObjectTypeDescrMessage(), + new LiteralMessage("has an edge with a multi-assignment")); } } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EdgeNoPartialVarAssignCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EdgeNoPartialVarAssignCheck.java index b2728f89b326013b42a0e73562eda0df0f494b85..5feea06abf3a27289732ad423f54fc1d2f28e1d0 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EdgeNoPartialVarAssignCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EdgeNoPartialVarAssignCheck.java @@ -13,14 +13,12 @@ package org.eclipse.escet.cif.common.checkers.checks; -import org.eclipse.emf.ecore.EObject; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; +import org.eclipse.escet.cif.common.checkers.messages.ReportObjectTypeDescrMessage; import org.eclipse.escet.cif.metamodel.cif.automata.Assignment; -import org.eclipse.escet.cif.metamodel.cif.automata.Automaton; -import org.eclipse.escet.cif.metamodel.cif.automata.Location; import org.eclipse.escet.cif.metamodel.cif.expressions.ProjectionExpression; -import org.eclipse.escet.common.java.Assert; /** * CIF check that does not allow partial variable assignments on edges. @@ -31,20 +29,9 @@ public class EdgeNoPartialVarAssignCheck extends CifCheck { @Override protected void preprocessAssignment(Assignment asgn, CifCheckViolations violations) { if (asgn.getAddressable() instanceof ProjectionExpression) { - // Get location. - EObject ancestor = asgn; - while (!(ancestor instanceof Location)) { - ancestor = ancestor.eContainer(); - } - Assert.check(ancestor instanceof Location); - Location loc = (Location)ancestor; - - // Report violation. - if (loc.getName() != null) { - violations.add(loc, "location has an edge with a partial variable assignment"); - } else { - violations.add((Automaton)loc.eContainer(), "automaton has an edge with a partial variable assignment"); - } + // Report violation on the closest named ancestor of the assignment: a location or an automaton. + violations.add(asgn, new ReportObjectTypeDescrMessage(), + new LiteralMessage("has an edge with a partial variable assignment")); } } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EdgeNoUrgentCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EdgeNoUrgentCheck.java index 7944e41d566f874e0610bb1930bf280daf30e375..28c8a37da228626f68c6f26857dfa8cb8a3ff51c 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EdgeNoUrgentCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EdgeNoUrgentCheck.java @@ -15,21 +15,17 @@ package org.eclipse.escet.cif.common.checkers.checks; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; -import org.eclipse.escet.cif.metamodel.cif.automata.Automaton; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; +import org.eclipse.escet.cif.common.checkers.messages.ReportObjectTypeDescrMessage; import org.eclipse.escet.cif.metamodel.cif.automata.Edge; -import org.eclipse.escet.cif.metamodel.cif.automata.Location; /** CIF check that does not allow urgent edges. */ public class EdgeNoUrgentCheck extends CifCheck { @Override protected void preprocessEdge(Edge edge, CifCheckViolations violations) { if (edge.isUrgent()) { - Location loc = (Location)edge.eContainer(); - if (loc.getName() != null) { - violations.add(loc, "location has an urgent edge"); - } else { - violations.add((Automaton)loc.eContainer(), "automaton has an urgent edge"); - } + // Report violation on the closest named ancestor of the edge: a location or an automaton. + violations.add(edge, new ReportObjectTypeDescrMessage(), new LiteralMessage("has an urgent edge")); } } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EventNoChannelsCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EventNoChannelsCheck.java index c0e9c3087355ef6c6448947372363ff76c9ba60e..9a83a5ecee80db4afadb3b6b22d44796b7a2f4e3 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EventNoChannelsCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EventNoChannelsCheck.java @@ -15,6 +15,8 @@ package org.eclipse.escet.cif.common.checkers.checks; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; +import org.eclipse.escet.cif.common.checkers.messages.ReportObjectTypeDescrMessage; import org.eclipse.escet.cif.metamodel.cif.declarations.Event; /** CIF check that does not allow channels. */ @@ -22,7 +24,9 @@ public class EventNoChannelsCheck extends CifCheck { @Override protected void preprocessEvent(Event event, CifCheckViolations violations) { if (event.getType() != null) { - violations.add(event, "event is a channel (has a data type)"); + // Report violation on the event or event parameter. + violations.add(event, new ReportObjectTypeDescrMessage(), + new LiteralMessage("is a channel (has a data type)")); } } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EventNoTauCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EventNoTauCheck.java index 1674be782ae59fc55084732579a0405f88e31714..76c77c8384752864c31124cf72bbff5bbb858049 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EventNoTauCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EventNoTauCheck.java @@ -13,13 +13,11 @@ package org.eclipse.escet.cif.common.checkers.checks; -import org.eclipse.escet.cif.common.CifEdgeUtils; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; -import org.eclipse.escet.cif.metamodel.cif.automata.Automaton; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; +import org.eclipse.escet.cif.common.checkers.messages.ReportObjectTypeDescrMessage; import org.eclipse.escet.cif.metamodel.cif.automata.Edge; -import org.eclipse.escet.cif.metamodel.cif.automata.EdgeEvent; -import org.eclipse.escet.cif.metamodel.cif.automata.Location; import org.eclipse.escet.cif.metamodel.cif.expressions.TauExpression; /** @@ -31,27 +29,18 @@ public class EventNoTauCheck extends CifCheck { @Override protected void preprocessTauExpression(TauExpression tauExpr, CifCheckViolations violations) { // Explicit tau. - EdgeEvent edgeEvent = (EdgeEvent)tauExpr.eContainer(); - Edge edge = (Edge)edgeEvent.eContainer(); - Location loc = CifEdgeUtils.getSource(edge); - if (loc.getName() != null) { - violations.add(loc, "location has an edge with explicitly event \"tau\" on it"); - } else { - violations.add((Automaton)loc.eContainer(), "automaton has an edge with explicitly event \"tau\" on it"); - } + // Report violation on the closest named ancestor of the tau expression: a location or an automaton. + violations.add(tauExpr, new ReportObjectTypeDescrMessage(), + new LiteralMessage("has an edge with an explicit \"tau\" event on it")); } @Override protected void preprocessEdge(Edge edge, CifCheckViolations violations) { // Implicit tau. if (edge.getEvents().isEmpty()) { - Location loc = CifEdgeUtils.getSource(edge); - if (loc.getName() != null) { - violations.add(loc, "location has an edge with implicitly event \"tau\" on it"); - } else { - violations.add((Automaton)loc.eContainer(), - "automaton has an edge with implicitly event \"tau\" on it"); - } + // Report violation on the closest named ancestor of the edge: a location or an automaton. + violations.add(edge, new ReportObjectTypeDescrMessage(), + new LiteralMessage("has an edge with an implicit \"tau\" event on it")); } } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EventOnlyWithControllabilityCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EventOnlyWithControllabilityCheck.java index 55dfe5d265964d30a34531c2d84f988e3df93646..72b4d5a2ec8de67e9d191c13372625eb7c642116 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EventOnlyWithControllabilityCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/EventOnlyWithControllabilityCheck.java @@ -13,13 +13,11 @@ package org.eclipse.escet.cif.common.checkers.checks; -import org.eclipse.escet.cif.common.CifEdgeUtils; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; -import org.eclipse.escet.cif.metamodel.cif.automata.Automaton; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; +import org.eclipse.escet.cif.common.checkers.messages.ReportObjectTypeDescrMessage; import org.eclipse.escet.cif.metamodel.cif.automata.Edge; -import org.eclipse.escet.cif.metamodel.cif.automata.EdgeEvent; -import org.eclipse.escet.cif.metamodel.cif.automata.Location; import org.eclipse.escet.cif.metamodel.cif.declarations.Event; import org.eclipse.escet.cif.metamodel.cif.expressions.TauExpression; @@ -32,37 +30,26 @@ public class EventOnlyWithControllabilityCheck extends CifCheck { @Override protected void preprocessEvent(Event event, CifCheckViolations violations) { if (event.getControllable() == null) { - violations.add(event, "event is not declared as controllable or uncontrollable"); + violations.add(event, new ReportObjectTypeDescrMessage(), + new LiteralMessage("is not declared as controllable or uncontrollable")); } } @Override protected void preprocessTauExpression(TauExpression tauExpr, CifCheckViolations violations) { // Explicit tau. - EdgeEvent edgeEvent = (EdgeEvent)tauExpr.eContainer(); - Edge edge = (Edge)edgeEvent.eContainer(); - Location loc = CifEdgeUtils.getSource(edge); - if (loc.getName() != null) { - violations.add(loc, "location has an edge with explicitly event \"tau\" on it, " - + "which is not controllable or uncontrollable"); - } else { - violations.add((Automaton)loc.eContainer(), "automaton has an edge with explicitly event \"tau\" on it, " - + "which is not controllable or uncontrollable"); - } + // Report violation on the closest named ancestor of the tau expression: a location or an automaton. + violations.add(tauExpr, new ReportObjectTypeDescrMessage(), new LiteralMessage( + "has an edge with an explicit \"tau\" event on it, which is not controllable or uncontrollable")); } @Override protected void preprocessEdge(Edge edge, CifCheckViolations violations) { // Implicit tau. if (edge.getEvents().isEmpty()) { - Location loc = CifEdgeUtils.getSource(edge); - if (loc.getName() != null) { - violations.add(loc, "location has an edge with implicitly event \"tau\" on it, " - + "which is not controllable or uncontrollable"); - } else { - violations.add((Automaton)loc.eContainer(), "automaton has an edge with implicitly event \"tau\" on " - + "it, which is not controllable or uncontrollable"); - } + // Report violation on the closest named ancestor of the edge: a location or an automaton. + violations.add(edge, new ReportObjectTypeDescrMessage(), new LiteralMessage( + "has an edge with an implicit \"tau\" event on it, which is not controllable or uncontrollable")); } } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/ExprNoSpecificBinaryExprsCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/ExprNoSpecificBinaryExprsCheck.java index 1c0e5f4a80dd5dc967265cbba6fac1289a5a88b0..48d342b3164da5e7ceb0928d3356dd8b45fc193a 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/ExprNoSpecificBinaryExprsCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/ExprNoSpecificBinaryExprsCheck.java @@ -14,10 +14,8 @@ package org.eclipse.escet.cif.common.checkers.checks; import static org.eclipse.escet.cif.common.CifTextUtils.exprToStr; -import static org.eclipse.escet.cif.common.CifTextUtils.getNamedSelfOrAncestor; import static org.eclipse.escet.cif.common.CifTextUtils.operatorToStr; import static org.eclipse.escet.cif.common.CifTextUtils.typeToStr; -import static org.eclipse.escet.common.java.Strings.fmt; import java.util.Arrays; import java.util.EnumSet; @@ -25,6 +23,7 @@ import java.util.EnumSet; import org.eclipse.escet.cif.common.CifTypeUtils; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; import org.eclipse.escet.cif.metamodel.cif.expressions.BinaryExpression; import org.eclipse.escet.cif.metamodel.cif.expressions.BinaryOperator; import org.eclipse.escet.cif.metamodel.cif.types.CifType; @@ -426,7 +425,7 @@ public class ExprNoSpecificBinaryExprsCheck extends CifCheck { * @param violations The violations collected so far. Is modified in-place. */ private void addExprViolationOperator(BinaryExpression binExpr, CifCheckViolations violations) { - violations.add(getNamedSelfOrAncestor(binExpr), fmt("uses binary operator \"%s\" in binary expression \"%s\"", + violations.add(binExpr, new LiteralMessage("uses binary operator \"%s\" in binary expression \"%s\"", operatorToStr(binExpr.getOperator()), exprToStr(binExpr))); } @@ -439,9 +438,9 @@ public class ExprNoSpecificBinaryExprsCheck extends CifCheck { private void addExprViolationOperand(BinaryExpression binExpr, CifCheckViolations violations) { CifType ltype = CifTypeUtils.normalizeType(binExpr.getLeft().getType()); CifType rtype = CifTypeUtils.normalizeType(binExpr.getRight().getType()); - violations.add(getNamedSelfOrAncestor(binExpr), - fmt("uses binary operator \"%s\" on operands of types \"%s\" and \"%s\" in binary expression \"%s\"", - operatorToStr(binExpr.getOperator()), typeToStr(ltype), typeToStr(rtype), exprToStr(binExpr))); + violations.add(binExpr, new LiteralMessage( + "uses binary operator \"%s\" on operands of types \"%s\" and \"%s\" in binary expression \"%s\"", + operatorToStr(binExpr.getOperator()), typeToStr(ltype), typeToStr(rtype), exprToStr(binExpr))); } /** The binary operator, or binary operator operating on certain operand types, to disallow. */ diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/ExprNoSpecificExprsCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/ExprNoSpecificExprsCheck.java index 98277f50640550adff5836d3946c16cb6e6f1edf..eb860a3a67ebd5d087f269615de9068ab3dd1cdf 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/ExprNoSpecificExprsCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/ExprNoSpecificExprsCheck.java @@ -14,8 +14,6 @@ package org.eclipse.escet.cif.common.checkers.checks; import static org.eclipse.escet.cif.common.CifTextUtils.exprToStr; -import static org.eclipse.escet.cif.common.CifTextUtils.getNamedSelfOrAncestor; -import static org.eclipse.escet.common.java.Strings.fmt; import java.util.Arrays; import java.util.EnumSet; @@ -25,6 +23,7 @@ import org.eclipse.escet.cif.common.CifTypeUtils; import org.eclipse.escet.cif.common.RangeCompat; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; import org.eclipse.escet.cif.metamodel.cif.ComplexComponent; import org.eclipse.escet.cif.metamodel.cif.expressions.AlgVariableExpression; import org.eclipse.escet.cif.metamodel.cif.expressions.BinaryExpression; @@ -388,7 +387,7 @@ public class ExprNoSpecificExprsCheck extends CifCheck { * @param violations The violations collected so far. Is modified in-place. */ private void addExprViolation(Expression expr, String description, CifCheckViolations violations) { - violations.add(getNamedSelfOrAncestor(expr), fmt("uses %s \"%s\"", description, exprToStr(expr))); + violations.add(expr, new LiteralMessage("uses %s \"%s\"", description, exprToStr(expr))); } /** The expression to disallow. */ diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/ExprNoSpecificUnaryExprsCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/ExprNoSpecificUnaryExprsCheck.java index d65ea8a3abb905988e93faf902a6e4b97931564e..1a23527ca7c0ed08146bdbf37502a60ac76ba482 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/ExprNoSpecificUnaryExprsCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/ExprNoSpecificUnaryExprsCheck.java @@ -14,10 +14,8 @@ package org.eclipse.escet.cif.common.checkers.checks; import static org.eclipse.escet.cif.common.CifTextUtils.exprToStr; -import static org.eclipse.escet.cif.common.CifTextUtils.getNamedSelfOrAncestor; import static org.eclipse.escet.cif.common.CifTextUtils.operatorToStr; import static org.eclipse.escet.cif.common.CifTextUtils.typeToStr; -import static org.eclipse.escet.common.java.Strings.fmt; import java.util.Arrays; import java.util.EnumSet; @@ -25,6 +23,7 @@ import java.util.EnumSet; import org.eclipse.escet.cif.common.CifTypeUtils; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; import org.eclipse.escet.cif.metamodel.cif.expressions.UnaryExpression; import org.eclipse.escet.cif.metamodel.cif.expressions.UnaryOperator; import org.eclipse.escet.cif.metamodel.cif.types.CifType; @@ -131,7 +130,7 @@ public class ExprNoSpecificUnaryExprsCheck extends CifCheck { * @param violations The violations collected so far. Is modified in-place. */ private void addExprViolationOperator(UnaryExpression unExpr, CifCheckViolations violations) { - violations.add(getNamedSelfOrAncestor(unExpr), fmt("uses unary operator \"%s\" in unary expression \"%s\"", + violations.add(unExpr, new LiteralMessage("uses unary operator \"%s\" in unary expression \"%s\"", operatorToStr(unExpr.getOperator()), exprToStr(unExpr))); } @@ -143,8 +142,8 @@ public class ExprNoSpecificUnaryExprsCheck extends CifCheck { */ private void addExprViolationOperand(UnaryExpression unExpr, CifCheckViolations violations) { CifType ctype = CifTypeUtils.normalizeType(unExpr.getChild().getType()); - violations.add(getNamedSelfOrAncestor(unExpr), - fmt("uses unary operator \"%s\" on an operand of type \"%s\" in unary expression \"%s\"", + violations.add(unExpr, + new LiteralMessage("uses unary operator \"%s\" on an operand of type \"%s\" in unary expression \"%s\"", operatorToStr(unExpr.getOperator()), typeToStr(ctype), exprToStr(unExpr))); } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/FuncNoUserDefinedCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/FuncNoUserDefinedCheck.java index a59976225cf2f0a79767f2537735efb98a11e4a9..51cae6cae3cfb463968ec41520c8d0856b043456 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/FuncNoUserDefinedCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/FuncNoUserDefinedCheck.java @@ -15,12 +15,13 @@ package org.eclipse.escet.cif.common.checkers.checks; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; import org.eclipse.escet.cif.metamodel.cif.functions.Function; /** CIF check that does not allow user-defined functions. */ public class FuncNoUserDefinedCheck extends CifCheck { @Override protected void preprocessFunction(Function func, CifCheckViolations violations) { - violations.add(func, "function is a user-defined function"); + violations.add(func, new LiteralMessage("function is a user-defined function")); } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/InvNoKindlessStateEvtExclCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/InvNoKindlessStateEvtExclCheck.java index 245176737ffd5410b5c5e43f23d7eba10e93f686..9ac34d46bd0bd8cbefba704ed07491a15a337077 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/InvNoKindlessStateEvtExclCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/InvNoKindlessStateEvtExclCheck.java @@ -15,43 +15,25 @@ package org.eclipse.escet.cif.common.checkers.checks; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; -import org.eclipse.escet.cif.metamodel.cif.ComplexComponent; +import org.eclipse.escet.cif.common.checkers.messages.IfReportOnAncestorMessage; +import org.eclipse.escet.cif.common.checkers.messages.IfReportOnSelfMessage; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; +import org.eclipse.escet.cif.common.checkers.messages.ReportObjectTypeDescrMessage; import org.eclipse.escet.cif.metamodel.cif.InvKind; import org.eclipse.escet.cif.metamodel.cif.Invariant; import org.eclipse.escet.cif.metamodel.cif.SupKind; -import org.eclipse.escet.cif.metamodel.cif.automata.Automaton; -import org.eclipse.escet.cif.metamodel.cif.automata.Location; /** CIF check that does not allow kindless state/event exclusion invariants (without a supervisory kind). */ public class InvNoKindlessStateEvtExclCheck extends CifCheck { @Override - protected void preprocessComplexComponent(ComplexComponent comp, CifCheckViolations violations) { - for (Invariant inv: comp.getInvariants()) { - if (inv.getInvKind() == InvKind.EVENT_NEEDS || inv.getInvKind() == InvKind.EVENT_DISABLES) { - SupKind supKind = inv.getSupKind(); - if (supKind == SupKind.NONE) { - violations.add(comp, - "component has a kindless state/event exclusion invariant, lacking a supervisory kind"); - } - } - } - } - - @Override - protected void preprocessLocation(Location loc, CifCheckViolations violations) { - for (Invariant inv: loc.getInvariants()) { - if (inv.getInvKind() == InvKind.EVENT_NEEDS || inv.getInvKind() == InvKind.EVENT_DISABLES) { - SupKind supKind = inv.getSupKind(); - if (supKind == SupKind.NONE) { - if (loc.getName() != null) { - violations.add(loc, - "location has a kindless state/event exclusion invariant, lacking a supervisory kind"); - } else { - violations.add((Automaton)loc.eContainer(), - "automaton has a location with a kindless state/event exclusion invariant, " - + "lacking a supervisory kind"); - } - } + protected void preprocessInvariant(Invariant inv, CifCheckViolations violations) { + if (inv.getInvKind() == InvKind.EVENT_NEEDS || inv.getInvKind() == InvKind.EVENT_DISABLES) { + SupKind supKind = inv.getSupKind(); + if (supKind == SupKind.NONE) { + // The closest named ancestor of the invariant is the invariant itself, or a location or a component. + violations.add(inv, new ReportObjectTypeDescrMessage(), new IfReportOnAncestorMessage("has"), + new IfReportOnSelfMessage("is"), + new LiteralMessage("a kindless state/event exclusion invariant, lacking a supervisory kind")); } } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/LocNoStateInvsCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/LocNoStateInvsCheck.java index 9d43737632a74c6977d0fb4457105febd9c7cd3f..1140db93c0b9b835c72ae869a2e0c0a49bfc2cba 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/LocNoStateInvsCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/LocNoStateInvsCheck.java @@ -13,33 +13,25 @@ package org.eclipse.escet.cif.common.checkers.checks; -import org.eclipse.emf.ecore.EObject; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.IfReportOnAncestorMessage; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; +import org.eclipse.escet.cif.common.checkers.messages.ReportObjectTypeDescrMessage; import org.eclipse.escet.cif.metamodel.cif.InvKind; import org.eclipse.escet.cif.metamodel.cif.Invariant; -import org.eclipse.escet.cif.metamodel.cif.LocationParameter; -import org.eclipse.escet.cif.metamodel.cif.automata.Automaton; import org.eclipse.escet.cif.metamodel.cif.automata.Location; /** CIF check that does not allow state invariants in locations. */ public class LocNoStateInvsCheck extends CifCheck { @Override protected void preprocessLocation(Location loc, CifCheckViolations violations) { - // Skip location parameters. - EObject parent = loc.eContainer(); - if (parent instanceof LocationParameter) { - return; - } - - // Check for violation. + // Note that location parameters never have invariants. for (Invariant inv: loc.getInvariants()) { if (inv.getInvKind() == InvKind.STATE) { - if (loc.getName() != null) { - violations.add(loc, "location has a state invariant"); - } else { - violations.add((Automaton)loc.eContainer(), "automaton has a location with a state invariant"); - } + // Report violation on the location, or on its automaton in case the location has no name. + violations.add(loc, new ReportObjectTypeDescrMessage(), new LiteralMessage("has"), + new IfReportOnAncestorMessage("a location with"), new LiteralMessage("a state invariant")); } } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/LocNoUrgentCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/LocNoUrgentCheck.java index 040c8f8928181bae775d9eeb5bbc58821d46685d..8de7572e24a242b18cc31d6774bd17b6e8c1ee9c 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/LocNoUrgentCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/LocNoUrgentCheck.java @@ -13,30 +13,22 @@ package org.eclipse.escet.cif.common.checkers.checks; -import org.eclipse.emf.ecore.EObject; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; -import org.eclipse.escet.cif.metamodel.cif.LocationParameter; -import org.eclipse.escet.cif.metamodel.cif.automata.Automaton; +import org.eclipse.escet.cif.common.checkers.messages.IfReportOnAncestorMessage; +import org.eclipse.escet.cif.common.checkers.messages.IfReportOnSelfMessage; +import org.eclipse.escet.cif.common.checkers.messages.ReportObjectTypeDescrMessage; import org.eclipse.escet.cif.metamodel.cif.automata.Location; /** CIF check that does not allow urgent locations. */ public class LocNoUrgentCheck extends CifCheck { @Override protected void preprocessLocation(Location loc, CifCheckViolations violations) { - // Skip location parameters. - EObject parent = loc.eContainer(); - if (parent instanceof LocationParameter) { - return; - } - - // Check for violation. + // Note that location parameters are never urgent. if (loc.isUrgent()) { - if (loc.getName() != null) { - violations.add(loc, "location is urgent"); - } else { - violations.add((Automaton)loc.eContainer(), "automaton has an urgent location"); - } + // Report violation on the location, or on its automaton in case the location has no name. + violations.add(loc, new ReportObjectTypeDescrMessage(), + new IfReportOnAncestorMessage("has an urgent location"), new IfReportOnSelfMessage("is urgent")); } } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/LocOnlyStaticEvalMarkerPredsCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/LocOnlyStaticEvalMarkerPredsCheck.java index c221a24e6a4ea309163c85ca3541989f4596f3dc..c90b6105ab0f967b5890ac020fabf5bc14418239 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/LocOnlyStaticEvalMarkerPredsCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/LocOnlyStaticEvalMarkerPredsCheck.java @@ -15,12 +15,12 @@ package org.eclipse.escet.cif.common.checkers.checks; import static org.eclipse.escet.cif.common.CifEvalUtils.evalPreds; -import org.eclipse.emf.ecore.EObject; import org.eclipse.escet.cif.common.CifEvalException; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; -import org.eclipse.escet.cif.metamodel.cif.LocationParameter; -import org.eclipse.escet.cif.metamodel.cif.automata.Automaton; +import org.eclipse.escet.cif.common.checkers.messages.IfReportOnAncestorMessage; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; +import org.eclipse.escet.cif.common.checkers.messages.ReportObjectTypeDescrMessage; import org.eclipse.escet.cif.metamodel.cif.automata.Location; import org.eclipse.escet.common.app.framework.exceptions.UnsupportedException; @@ -28,31 +28,21 @@ import org.eclipse.escet.common.app.framework.exceptions.UnsupportedException; public class LocOnlyStaticEvalMarkerPredsCheck extends CifCheck { @Override protected void preprocessLocation(Location loc, CifCheckViolations violations) { - // Skip location parameters. - EObject parent = loc.eContainer(); - if (parent instanceof LocationParameter) { - return; - } - - // Check for violation. + // Note that location parameters never have marker predicates. if (!loc.getMarkeds().isEmpty()) { try { evalPreds(loc.getMarkeds(), false, true); } catch (UnsupportedException e) { - if (loc.getName() != null) { - violations.add(loc, "location has a marker predicate that can not be evaluated statically"); - } else { - violations.add((Automaton)loc.eContainer(), - "automaton has a location with a marker predicate that can not be evaluated statically"); - } + // Report violation on the location, or on its automaton in case the location has no name. + violations.add(loc, new ReportObjectTypeDescrMessage(), new LiteralMessage("has"), + new IfReportOnAncestorMessage("a location with"), + new LiteralMessage("a marker predicate that cannot be evaluated statically")); } catch (CifEvalException e) { - if (loc.getName() != null) { - violations.add(loc, - "static evaluation of a marker predicate in the location resulted in an evaluation error"); - } else { - violations.add((Automaton)loc.eContainer(), "static evaluation of a marker predicate in the " - + "location of the automaton resulted in an evaluation error"); - } + // Report violation on the location, or on its automaton in case the location has no name. + violations.add(loc, new ReportObjectTypeDescrMessage(), new LiteralMessage("has"), + new IfReportOnAncestorMessage("a location with"), + new LiteralMessage("a marker predicate that cannot be evaluated statically, " + + "as the evaluation resulted in an evaluation error")); } } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/TypeNoSpecificTypesCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/TypeNoSpecificTypesCheck.java index fab1da6dc66e75d7874a412e4034e58ffb6705a3..311f9b58f266bf8d7baf6aed429f60b8e914bc99 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/TypeNoSpecificTypesCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/TypeNoSpecificTypesCheck.java @@ -13,9 +13,7 @@ package org.eclipse.escet.cif.common.checkers.checks; -import static org.eclipse.escet.cif.common.CifTextUtils.getNamedSelfOrAncestor; import static org.eclipse.escet.cif.common.CifTextUtils.typeToStr; -import static org.eclipse.escet.common.java.Strings.fmt; import java.util.Arrays; import java.util.EnumSet; @@ -23,6 +21,7 @@ import java.util.EnumSet; import org.eclipse.escet.cif.common.CifTypeUtils; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; import org.eclipse.escet.cif.metamodel.cif.types.CifType; import org.eclipse.escet.cif.metamodel.cif.types.ComponentDefType; import org.eclipse.escet.cif.metamodel.cif.types.ComponentType; @@ -164,7 +163,7 @@ public class TypeNoSpecificTypesCheck extends CifCheck { * @param violations The violations collected so far. Is modified in-place. */ private void addTypeViolation(CifType type, String description, CifCheckViolations violations) { - violations.add(getNamedSelfOrAncestor(type), fmt("uses %s \"%s\"", description, typeToStr(type))); + violations.add(type, new LiteralMessage("uses %s \"%s\"", description, typeToStr(type))); } /** The type, or sub-type, to disallow. */ diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/VarNoContinuousCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/VarNoContinuousCheck.java index bb1e343b11ebb94fc7b7fd5ac9e62ffed4a5c25e..cb2a51f20f926dfa1f6b66039f42be3cd3497ff8 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/VarNoContinuousCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/VarNoContinuousCheck.java @@ -15,12 +15,13 @@ package org.eclipse.escet.cif.common.checkers.checks; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; import org.eclipse.escet.cif.metamodel.cif.declarations.ContVariable; /** CIF check that does not allow continuous variables. */ public class VarNoContinuousCheck extends CifCheck { @Override protected void preprocessContVariable(ContVariable var, CifCheckViolations violations) { - violations.add(var, "variable is a continuous variable"); + violations.add(var, new LiteralMessage("variable is a continuous variable")); } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/VarNoDiscWithMultiInitValuesCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/VarNoDiscWithMultiInitValuesCheck.java index 839580cba054edb2cd2ac8c94af8241d525ee4b5..07c3ab963e866d4d5fff40f9203341d0ca5938b9 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/VarNoDiscWithMultiInitValuesCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/VarNoDiscWithMultiInitValuesCheck.java @@ -13,11 +13,10 @@ package org.eclipse.escet.cif.common.checkers.checks; -import static org.eclipse.escet.common.java.Strings.fmt; - import org.eclipse.emf.ecore.EObject; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; import org.eclipse.escet.cif.metamodel.cif.ComplexComponent; import org.eclipse.escet.cif.metamodel.cif.declarations.DiscVariable; @@ -31,7 +30,7 @@ public class VarNoDiscWithMultiInitValuesCheck extends CifCheck { return; } - // Ignore variables implicit default value. + // Ignore variables with implicit default value. if (var.getValue() == null) { return; } @@ -39,9 +38,11 @@ public class VarNoDiscWithMultiInitValuesCheck extends CifCheck { // Check number of potential initial values. int count = var.getValue().getValues().size(); if (count == 0) { // 0 means 'any' initial value. - violations.add(var, "discrete variable has multiple potential initial values (any value in its domain)"); + violations.add(var, new LiteralMessage( + "discrete variable has multiple potential initial values (any value in its domain)")); } else if (count > 1) { - violations.add(var, fmt("discrete variable has multiple (%d) potential initial values", count)); + violations.add(var, + new LiteralMessage("discrete variable has multiple (%,d) potential initial values", count)); } } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/VarNoInputCheck.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/VarNoInputCheck.java index b67e71fedb641f3415fd0e7ae16c02edf3a02708..d22903a34250fd1f0b88697cfa99aa5073b7b29a 100644 --- a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/VarNoInputCheck.java +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/checks/VarNoInputCheck.java @@ -15,12 +15,13 @@ package org.eclipse.escet.cif.common.checkers.checks; import org.eclipse.escet.cif.common.checkers.CifCheck; import org.eclipse.escet.cif.common.checkers.CifCheckViolations; +import org.eclipse.escet.cif.common.checkers.messages.LiteralMessage; import org.eclipse.escet.cif.metamodel.cif.declarations.InputVariable; /** CIF check that does not allow input variables. */ public class VarNoInputCheck extends CifCheck { @Override protected void preprocessInputVariable(InputVariable var, CifCheckViolations violations) { - violations.add(var, "variable is an input variable"); + violations.add(var, new LiteralMessage("variable is an input variable")); } } diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/CifCheckViolationMessage.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/CifCheckViolationMessage.java new file mode 100644 index 0000000000000000000000000000000000000000..1ea3c6df005b897736fab685de47cfab143399e1 --- /dev/null +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/CifCheckViolationMessage.java @@ -0,0 +1,33 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.common.checkers.messages; + +import org.eclipse.escet.cif.common.checkers.CifCheckViolation; + +/** A CIF check violation message. */ +public abstract class CifCheckViolationMessage { + /** + * Returns the violation message text. + * + * @param violation The CIF check violation. + * @return The violation message text. + */ + public abstract String getMessageText(CifCheckViolation violation); + + @Override + public abstract boolean equals(Object obj); + + @Override + public abstract int hashCode(); +} diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/IfReportOnAncestorMessage.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/IfReportOnAncestorMessage.java new file mode 100644 index 0000000000000000000000000000000000000000..388c3697ea3729d8837db505a66f8969b6d3875a --- /dev/null +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/IfReportOnAncestorMessage.java @@ -0,0 +1,69 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.common.checkers.messages; + +import org.eclipse.escet.cif.common.checkers.CifCheckViolation; +import org.eclipse.escet.common.java.Strings; + +/** + * Message that is conditional on the violation being reported on an ancestor of the object, rather than on the object + * itself. Is an empty message if the violation is reported on the object itself. + */ +public class IfReportOnAncestorMessage extends CifCheckViolationMessage { + /** The message to use if the violation is reported on an ancestor of the object. */ + private final CifCheckViolationMessage message; + + /** + * Constructor for the {@link IfReportOnAncestorMessage} class. + * + * @param messagePattern The message text format pattern, to use if the violation is reported on an ancestor of the + * object. + * @param args The message text format arguments. + * @see Strings#fmt + */ + public IfReportOnAncestorMessage(String messagePattern, Object... args) { + this(new LiteralMessage(messagePattern, args)); + } + + /** + * Constructor for the {@link IfReportOnAncestorMessage} class. + * + * @param message The message to use if the violation is reported on an ancestor of the object. + */ + public IfReportOnAncestorMessage(CifCheckViolationMessage message) { + this.message = message; + } + + @Override + public String getMessageText(CifCheckViolation violation) { + return violation.isReportOnSelf() ? "" : message.getMessageText(violation); + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if (!(other instanceof IfReportOnAncestorMessage)) { + return false; + } + IfReportOnAncestorMessage that = (IfReportOnAncestorMessage)other; + return this.message.equals(that.message); + } + + @Override + public int hashCode() { + return message.hashCode(); + } +} diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/IfReportOnSelfMessage.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/IfReportOnSelfMessage.java new file mode 100644 index 0000000000000000000000000000000000000000..21d77f5a63e785c427445caad663d56c0fca7c60 --- /dev/null +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/IfReportOnSelfMessage.java @@ -0,0 +1,68 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.common.checkers.messages; + +import org.eclipse.escet.cif.common.checkers.CifCheckViolation; +import org.eclipse.escet.common.java.Strings; + +/** + * Message that is conditional on the violation being reported on the object itself, rather than on one of its + * ancestors. Is an empty message if the violation is reported on one of the ancestors of the object. + */ +public class IfReportOnSelfMessage extends CifCheckViolationMessage { + /** The message to use if the violation is reported on the object itself. */ + private final CifCheckViolationMessage message; + + /** + * Constructor for the {@link IfReportOnSelfMessage} class. + * + * @param messagePattern The message text format pattern, to use if the violation is reported on the object itself. + * @param args The message text format arguments. + * @see Strings#fmt + */ + public IfReportOnSelfMessage(String messagePattern, Object... args) { + this(new LiteralMessage(messagePattern, args)); + } + + /** + * Constructor for the {@link IfReportOnSelfMessage} class. + * + * @param message The message to use if the violation is reported on the object itself. + */ + public IfReportOnSelfMessage(CifCheckViolationMessage message) { + this.message = message; + } + + @Override + public String getMessageText(CifCheckViolation violation) { + return violation.isReportOnSelf() ? message.getMessageText(violation) : ""; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if (!(other instanceof IfReportOnSelfMessage)) { + return false; + } + IfReportOnSelfMessage that = (IfReportOnSelfMessage)other; + return this.message.equals(that.message); + } + + @Override + public int hashCode() { + return message.hashCode(); + } +} diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/LiteralMessage.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/LiteralMessage.java new file mode 100644 index 0000000000000000000000000000000000000000..c4366167b2183cced70a74da5196b8593d5b0cde --- /dev/null +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/LiteralMessage.java @@ -0,0 +1,58 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.common.checkers.messages; + +import static org.eclipse.escet.common.java.Strings.fmt; + +import org.eclipse.escet.cif.common.checkers.CifCheckViolation; +import org.eclipse.escet.common.java.Strings; + +/** A literal message. */ +public class LiteralMessage extends CifCheckViolationMessage { + /** The message text. */ + private final String message; + + /** + * Constructor for the {@link LiteralMessage} class. + * + * @param messagePattern The message text format pattern. + * @param args The message text format arguments. + * @see Strings#fmt + */ + public LiteralMessage(String messagePattern, Object... args) { + this.message = fmt(messagePattern, args); + } + + @Override + public String getMessageText(CifCheckViolation violation) { + return message; + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if (!(other instanceof LiteralMessage)) { + return false; + } + LiteralMessage that = (LiteralMessage)other; + return this.message.equals(that.message); + } + + @Override + public int hashCode() { + return message.hashCode(); + } +} diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/ReportObjectTypeDescrMessage.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/ReportObjectTypeDescrMessage.java new file mode 100644 index 0000000000000000000000000000000000000000..8f66b6c6d1a62a19215e45ce396f7c5747df7747 --- /dev/null +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/ReportObjectTypeDescrMessage.java @@ -0,0 +1,48 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.common.checkers.messages; + +import org.eclipse.escet.cif.common.CifTextUtils; +import org.eclipse.escet.cif.common.checkers.CifCheckViolation; + +/** + * Message describing the {@link CifCheckViolation#getReportObject report object}, the CIF object on which the violation + * is reported. + * + *

+ * If the message is reported on the specification, {@code "the top level scope of the specification"} is used as + * description. Otherwise, {@link CifTextUtils#getTypeDescriptionForNamedObject} is called on the report object to + * obtain the description. + *

+ */ +public class ReportObjectTypeDescrMessage extends CifCheckViolationMessage { + @Override + public String getMessageText(CifCheckViolation violation) { + return violation.isReportOnSpecification() ? "the top level scope of the specification" + : CifTextUtils.getTypeDescriptionForNamedObject(violation.getReportObject()); + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + return other instanceof SequenceMessage; + } + + @Override + public int hashCode() { + return 0; + } +} diff --git a/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/SequenceMessage.java b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/SequenceMessage.java new file mode 100644 index 0000000000000000000000000000000000000000..ce6c6b1cb658497bd994db9f60e638e588571f3b --- /dev/null +++ b/cif/org.eclipse.escet.cif.common/src/org/eclipse/escet/cif/common/checkers/messages/SequenceMessage.java @@ -0,0 +1,69 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.common.checkers.messages; + +import java.util.List; + +import org.eclipse.escet.cif.common.checkers.CifCheckViolation; +import org.eclipse.escet.common.java.Assert; + +/** A message that is a concatenation of a non-empty sequence of messages. */ +public class SequenceMessage extends CifCheckViolationMessage { + /** The non-empty sequence of messages. */ + private final List messages; + + /** + * Constructor for the {@link SequenceMessage} class. + * + * @param messages The non-empty sequence of messages. The message texts of the messages are trimmed and + * concatenated, with a space being added in between each two message texts if needed. + */ + public SequenceMessage(List messages) { + Assert.check(!messages.isEmpty()); + this.messages = messages; + } + + @Override + public String getMessageText(CifCheckViolation violation) { + StringBuilder concatenatedText = new StringBuilder(); + for (CifCheckViolationMessage message: messages) { + String messageText = message.getMessageText(violation); + messageText = messageText.trim(); + if (!messageText.isEmpty()) { // Only add if not empty. + if (concatenatedText.length() > 0) { // Add separator if there is any text already present. + concatenatedText.append(" "); + } + concatenatedText.append(messageText); + } + } + return concatenatedText.toString(); + } + + @Override + public boolean equals(Object other) { + if (other == this) { + return true; + } + if (!(other instanceof SequenceMessage)) { + return false; + } + SequenceMessage that = (SequenceMessage)other; + return this.messages.equals(that.messages); + } + + @Override + public int hashCode() { + return messages.hashCode(); + } +} diff --git a/cif/org.eclipse.escet.cif.documentation/asciidoc/release-notes.asciidoc b/cif/org.eclipse.escet.cif.documentation/asciidoc/release-notes.asciidoc index ebaddd3e40c881113f6282fba520ff751fb0f8c9..93c2afee0b2059c5b137e733b6a27d435337dbf6 100644 --- a/cif/org.eclipse.escet.cif.documentation/asciidoc/release-notes.asciidoc +++ b/cif/org.eclipse.escet.cif.documentation/asciidoc/release-notes.asciidoc @@ -30,7 +30,11 @@ New features: * The CIF controller property checker can now also check whether controllers satisfy the confluence property. As the checker now has multiple properties that it can check, each property check can be individually enabled and disabled, and all checks are enabled by default (issue {escet-issue}145[#145]). +* The CIF examples contain a new bridge example, to showcase the real-world usage of CIF for synthesis-based engineering (issue {escet-issue}419[#419]). * Two new CIF benchmarking models have been added (issue {escet-issue}364[#364]). +* The CIF text editor now has theming support, and comes with a dark theme in addition to the existing light theme. +The text editor now automatically uses its dark theme when the Eclipse built-in dark theme is used, and uses a light theme otherwise. +The text editor theming behavior can be configured via the Eclipse Preferences dialog (issue {escet-issue}347[#347]). Improvements and fixes: @@ -40,6 +44,10 @@ This new information in synthesis dump files is now also taken into account by t * The CIF controller checker output has been improved in terms of readability (issue {escet-issue}145[#145]). * The CIF controller checker option descriptions and UI have been slightly improved (issue {escet-issue}145[#145]). * The CIF controller checker documentation has been improved (issue {escet-issue}145[#145]). +* The CIF to Supremica transformation precondition check has improved output and no longer crashes on reporting certain precondition violations. +The preconditions themselves have not changed (issues {escet-issue}398[#398] and {escet-issue}416[#416]). +* The CIF text editor light theme's default color has changed from a near-black slightly-brown color to pure black (issue {escet-issue}347[#347]). +* The CIF to yEd transformer syntax highligher's default color has changed from a near-black slightly-brown color to pure black (issue {escet-issue}347[#347]). === Version 0.6 (2022-07-07) diff --git a/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/_source.txt b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/_source.txt new file mode 100644 index 0000000000000000000000000000000000000000..83b6439827384ea358cc84c92a10afd50e222513 --- /dev/null +++ b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/_source.txt @@ -0,0 +1,18 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +Model source: Ferdie Reijnen, Eva-Britt Leliveld, Joanna van de Mortel-Fronczak, John van Dinther, Jacobus Rooda and +Wan Fokkink, "Synthesized fault-tolerant supervisory controllers, with an application to a rotating bridge", +In: Computers in Industry, volume 130, article 103473, 2021, doi: https://doi.org/10.1016/j.compind.2021.103473. + +Model repository: https://github.com/ffhreijnen/OBB. diff --git a/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/diagnosers/diagnoser_templates.cif b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/diagnosers/diagnoser_templates.cif new file mode 100644 index 0000000000000000000000000000000000000000..2de5aad091c8cd9319a7827103fd6d56a7f4c6e4 --- /dev/null +++ b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/diagnosers/diagnoser_templates.cif @@ -0,0 +1,95 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +// Discrepancy diagnoser. +automaton def DiscrepancyDiagnoser(alg bool I, Q, Reset; alg real t_f): + alg bool fault = StaysOff; + cont t = 0.0 der if Diagnosing: -1 else 0 end; + + location NoDefect: + initial; + edge when I != Q do t := t_f goto Diagnosing; + + location Diagnosing: + edge when I = Q goto NoDefect; + edge when t <= 0 and I != Q and Q goto StaysOff; + edge when t <= 0 and I != Q and not Q goto StaysOn; + + location StaysOff: + edge when Reset goto NoDefect; + + location StaysOn: + edge when Reset goto NoDefect; +end + +// Duration monitoring diagnoser. +automaton def DurationMonitoringDiagnoser(alg bool I_o, I_c, Q_o, Q_c, Reset; alg real t_o, t_c): + alg bool fault = Stuck; + cont t = 0.0 der if DiagnosingOpening or DiagnosingClosing: -1 else 0 end; + + location NoDefect: + initial; + edge when Q_o do t := t_o goto DiagnosingOpening; + edge when Q_c do t := t_c goto DiagnosingClosing; + + location DiagnosingOpening: + edge when t <= 0 and Q_o and not I_o goto Stuck; + edge when not Q_o goto NoDefect; + + location DiagnosingClosing: + edge when t <= 0 and Q_c and not I_c goto Stuck; + edge when not Q_c goto NoDefect; + + location Stuck: + edge when Reset goto NoDefect; +end + +// Unexpected movement diagnoser. +automaton def UnexpectedMovementDiagnoser(alg bool I, Q, Reset; alg real t_f): + alg bool fault = UnexpectedMovement; + cont t = 0.0 der if Diagnosing: -1 else 0 end; + + location NoEndPos: + initial; + edge when I and not Q goto EndPos; + + location EndPos: + edge when not I and not Q do t := t_f goto Diagnosing; + edge when Q goto NoEndPos; + + location Diagnosing: + edge when t <= 0 and not I and not Q goto UnexpectedMovement; + edge when I goto EndPos; + edge when Q goto NoEndPos; + + location UnexpectedMovement: + edge when Reset goto NoEndPos; +end + +// Boom barrier diagnoser. +group def BoomBarrier(alg bool Q_opening, Q_closing, Opened_regular, Closed_regular, Opened_safe, Closed_safe, Reset; alg real ltBB_opening, ltBB_closing, discBB): + alg bool fault = DiagnoseBBStuck.fault or DiagnoseBBUndesiredClosed.fault or DiagnoseBBUndesiredOpen.fault; + + DiagnoseBBStuck: DurationMonitoringDiagnoser(Opened_regular, Closed_regular, Q_opening, Q_closing, Reset, ltBB_opening, ltBB_closing); + DiagnoseBBUndesiredClosed: UnexpectedMovementDiagnoser(Opened_safe, Q_closing, Reset, discBB); + DiagnoseBBUndesiredOpen: UnexpectedMovementDiagnoser(Closed_safe, Q_opening, Reset, discBB); +end + +// Vessel traffic light diagnoser. +group def VesselTrafficLight(alg bool I_Red, I_Green, I_Red2, Q_Red, Q_RedGreen, Q_Green, Q_Red2, Q_Activated, Reset; alg real t_f): + alg bool fault = DiagnoseRed.fault; + + DiagnoseRed: DiscrepancyDiagnoser(I_Red, (Q_Red or Q_RedGreen or Q_Red2) and Q_Activated, Reset, t_f); + DiagnoseGreen: DiscrepancyDiagnoser(I_Green, (Q_Green or Q_RedGreen) and Q_Activated, Reset, t_f); + DiagnoseRed2: DiscrepancyDiagnoser(I_Red2, (Q_Red2 ) and Q_Activated, Reset, t_f); +end diff --git a/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/diagnosers/diagnosers.cif b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/diagnosers/diagnosers.cif new file mode 100644 index 0000000000000000000000000000000000000000..8c56061cecab62b1e326c91ffa9de552c2645ce3 --- /dev/null +++ b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/diagnosers/diagnosers.cif @@ -0,0 +1,483 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +import "diagnoser_templates.cif"; + +// Discrepancy fault times. +const real Tdisc_BB = 1; // End position boom barriers. +const real Tdisc_Bridge = 1; // End position bridge. +const real Tdisc_Lamp = 2; // Lamp. +const real Tdisc_LM = 2.5; // Locking mechanism. + +// Max duration monitoring. +const real Tmax_BBOpening = 15; // Opening the boom barriers. +const real Tmax_BBClosing = 15; // Closing the boom barriers. +const real Tmax_LockingMLock = 50; // Locking the locking mechanism. +const real Tmax_LockingMUnlock = 50; // Unlocking the locking mechanism. + +// Min duration monitoring. +const real Tmin_BridgeClose = 1.8; // Minimal time between BeforeBeforeClosed and BeforeClosed. +const real Tmin_BridgeOpen = 1.8; // Minimal time between BeforeBeforeOpen and BeforeOpen. + +// Stop signs. +group StopSigns: + DiagnoseSS1: DiscrepancyDiagnoser(sup.StopSigns.S1.On, sup.StopSigns.Actuator.On, sup.ResetButton.ResetFaults, Tdisc_Lamp); + DiagnoseSS2: DiscrepancyDiagnoser(sup.StopSigns.S2.On, sup.StopSigns.Actuator.On, sup.ResetButton.ResetFaults, Tdisc_Lamp); + DiagnoseSS3: DiscrepancyDiagnoser(sup.StopSigns.S3.On, sup.StopSigns.Actuator.On, sup.ResetButton.ResetFaults, Tdisc_Lamp); + DiagnoseSS4: DiscrepancyDiagnoser(sup.StopSigns.S4.On, sup.StopSigns.Actuator.On, sup.ResetButton.ResetFaults, Tdisc_Lamp); + DiagnoseSS5: DiscrepancyDiagnoser(sup.StopSigns.S5.On, sup.StopSigns.Actuator.On, sup.ResetButton.ResetFaults, Tdisc_Lamp); + + alg bool fault123 = DiagnoseSS1.fault or DiagnoseSS2.fault or DiagnoseSS3.fault; + alg bool fault45 = DiagnoseSS4.fault or DiagnoseSS5.fault; +end + +// Boom barriers. +BB1: BoomBarrier(sup.BB1.Actuator.Opening, sup.BB1.Actuator.Closing, sup.BB1.NotOpen.Off, sup.BB1.NotClosed.Off, sup.BB1.Open.On, sup.BB1.Closed.On, sup.ResetButton.ResetFaults, Tmax_BBOpening, Tmax_BBClosing, Tdisc_BB); +BB2: BoomBarrier(sup.BB2.Actuator.Opening, sup.BB2.Actuator.Closing, sup.BB2.NotOpen.Off, sup.BB2.NotClosed.Off, sup.BB2.Open.On, sup.BB2.Closed.On, sup.ResetButton.ResetFaults, Tmax_BBOpening, Tmax_BBClosing, Tdisc_BB); + +// Vessel traffic lights. +VTL1: VesselTrafficLight(sup.VTL1.Red.On, sup.VTL1.Green.On, sup.VTL1.Red2.On, sup.VTL1.Actuator.Red, sup.VTL1.Actuator.RedGreen, sup.VTL1.Actuator.Green, sup.VTL1.Actuator.RedRed, sup.VTL1.Activated.On, sup.ResetButton.ResetFaults, Tdisc_Lamp); +VTL2: VesselTrafficLight(sup.VTL2.Red.On, sup.VTL2.Green.On, sup.VTL2.Red2.On, sup.VTL2.Actuator.Red, sup.VTL2.Actuator.RedGreen, sup.VTL2.Actuator.Green, sup.VTL2.Actuator.RedRed, sup.VTL2.Activated.On, sup.ResetButton.ResetFaults, Tdisc_Lamp); +VTL3: VesselTrafficLight(sup.VTL3.Red.On, sup.VTL3.Green.On, sup.VTL3.Red2.On, sup.VTL3.Actuator.Red, sup.VTL3.Actuator.RedGreen, sup.VTL3.Actuator.Green, sup.VTL3.Actuator.RedRed, sup.VTL3.Activated.On, sup.ResetButton.ResetFaults, Tdisc_Lamp); +VTL4: VesselTrafficLight(sup.VTL4.Red.On, sup.VTL4.Green.On, sup.VTL4.Red2.On, sup.VTL4.Actuator.Red, sup.VTL4.Actuator.RedGreen, sup.VTL4.Actuator.Green, sup.VTL4.Actuator.RedRed, sup.VTL4.Activated.On, sup.ResetButton.ResetFaults, Tdisc_Lamp); +VTL5: VesselTrafficLight(sup.VTL5.Red.On, sup.VTL5.Green.On, sup.VTL5.Red2.On, sup.VTL5.Actuator.Red, sup.VTL5.Actuator.RedGreen, sup.VTL5.Actuator.Green, sup.VTL5.Actuator.RedRed, sup.VTL5.Activated.On, sup.ResetButton.ResetFaults, Tdisc_Lamp); +VTL6: VesselTrafficLight(sup.VTL6.Red.On, sup.VTL6.Green.On, sup.VTL6.Red2.On, sup.VTL6.Actuator.Red, sup.VTL6.Actuator.RedGreen, sup.VTL6.Actuator.Green, sup.VTL6.Actuator.RedRed, sup.VTL6.Activated.On, sup.ResetButton.ResetFaults, Tdisc_Lamp); +VTL7: VesselTrafficLight(sup.VTL7.Red.On, sup.VTL7.Green.On, sup.VTL7.Red2.On, sup.VTL7.Actuator.Red, sup.VTL7.Actuator.RedGreen, sup.VTL7.Actuator.Green, sup.VTL7.Actuator.RedRed, sup.VTL7.Activated.On, sup.ResetButton.ResetFaults, Tdisc_Lamp); +VTL8: VesselTrafficLight(sup.VTL8.Red.On, sup.VTL8.Green.On, sup.VTL8.Red2.On, sup.VTL8.Actuator.Red, sup.VTL8.Actuator.RedGreen, sup.VTL8.Actuator.Green, sup.VTL8.Actuator.RedRed, sup.VTL8.Activated.On, sup.ResetButton.ResetFaults, Tdisc_Lamp); + +// Locking mechanism. +group LM: + Diagnose_LockingMechanismStuck: DurationMonitoringDiagnoser(sup.LM.Locked.On, sup.LM.Unlocked.On, sup.LM.Valve.Lock, sup.LM.Valve.Unlock, sup.ResetButton.ResetFaults, Tmax_LockingMLock, Tmax_LockingMUnlock); + Diagnose_LockingMechanismUndesiredUnlock: UnexpectedMovementDiagnoser(sup.LM.Locked.On, sup.LM.Valve.Unlock and sup.LM.Pump.On, sup.ResetButton.ResetFaults, Tdisc_LM); +end + +// Bridge deck. +group BD: + automaton TimerBeforeBeforeOpen: + cont t = 0.0 der -1; + + location Off: + initial; + edge when sup.BD.BBOpen.On do t:= Tmin_BridgeOpen goto Running; + + location Running: + edge when sup.BD.BBOpen.Off goto Off; + edge when t <= 0 goto Timeout; + + location Timeout: + edge when sup.BD.BBOpen.Off goto Off; + end + + automaton TimerBeforeBeforeClosed: + cont t = 0.0 der -1; + + location Off: + initial; + edge when sup.BD.BBClosed.On do t:= Tmin_BridgeClose goto Running; + + location Running: + edge when sup.BD.BBClosed.Off goto Off; + edge when t <= 0 goto Timeout; + + location Timeout: + edge when sup.BD.BBClosed.Off goto Off; + end + + automaton DeceleratingDiagnoser: + alg bool Q_opening = sup.BD.Direction.Opening; + alg bool Q_closing = sup.BD.Direction.Closing; + + location idle: + initial; + edge when Q_opening and TimerBeforeBeforeOpen.Running and sup.BD.BOpen.On goto fault; + edge when Q_closing and TimerBeforeBeforeClosed.Running and sup.BD.BClosed.On goto fault; + + location fault: + edge when sup.ResetButton.ResetFaults goto idle; + end + + DiagnoseUnexpectedClose: UnexpectedMovementDiagnoser(sup.BD.Open.On, sup.BR.Sensor.Released, sup.ResetButton.ResetFaults, Tdisc_Bridge); + DiagnoseUnexpectedOpening: UnexpectedMovementDiagnoser(sup.BD.Closed.On and sup.BD.Closed2.On, sup.BR.Sensor.Released, sup.ResetButton.ResetFaults, Tdisc_Bridge); + + alg bool fault = DeceleratingDiagnoser.fault or DiagnoseUnexpectedClose.fault or DiagnoseUnexpectedOpening.fault; +end + +// Supervisor skeleton/coupling. +group sup: + group StopSigns: + group S1: + input bool On; + end + + group S2: + input bool On; + end + + group S3: + input bool On; + end + + group S4: + input bool On; + end + + group S5: + input bool On; + end + + group Actuator: + input bool On; + end + + alg bool S1StaysOff = .StopSigns.DiagnoseSS1.StaysOff; + alg bool S2StaysOff = .StopSigns.DiagnoseSS2.StaysOff; + alg bool S3StaysOff = .StopSigns.DiagnoseSS3.StaysOff; + alg bool S4StaysOff = .StopSigns.DiagnoseSS4.StaysOff; + alg bool S5StaysOff = .StopSigns.DiagnoseSS5.StaysOff; + end + + group BB1: + group Actuator: + input bool Opening, Closing; + end + + group Open: + input bool On; + end + + group Closed: + input bool On; + end + + group NotOpen: + input bool Off; + end + + group NotClosed: + input bool Off; + end + + alg bool Stuck = .BB1.DiagnoseBBStuck.fault; + alg bool UndesiredClosed = .BB1.DiagnoseBBUndesiredClosed.fault; + alg bool UndesiredOpen = .BB1.DiagnoseBBUndesiredOpen.fault; + end + + group BB2: + group Actuator: + input bool Opening, Closing; + end + + group Open: + input bool On; + end + + group Closed: + input bool On; + end + + group NotOpen: + input bool Off; + end + + group NotClosed: + input bool Off; + end + + alg bool Stuck = .BB2.DiagnoseBBStuck.fault; + alg bool UndesiredClosed = .BB2.DiagnoseBBUndesiredClosed.fault; + alg bool UndesiredOpen = .BB2.DiagnoseBBUndesiredOpen.fault; + end + + group VTL1: + group Activated: + input bool On; + end + + group Red: + input bool On; + end + + group Green: + input bool On; + end + + group Red2: + input bool On; + end + + alg bool RedStaysOff = .VTL1.DiagnoseRed.StaysOff; + alg bool GreenStaysOff = .VTL1.DiagnoseGreen.StaysOff; + alg bool Red2StaysOff = .VTL1.DiagnoseRed2.StaysOff; + + group Actuator: + input bool Red, RedRed, RedGreen, Green; + end + end + + group VTL2: + group Activated: + input bool On; + end + + group Red: + input bool On; + end + + group Green: + input bool On; + end + + group Red2: + input bool On; + end + + alg bool RedStaysOff = .VTL2.DiagnoseRed.StaysOff; + alg bool GreenStaysOff = .VTL2.DiagnoseGreen.StaysOff; + alg bool Red2StaysOff = .VTL2.DiagnoseRed2.StaysOff; + + group Actuator: + input bool Red, RedRed, RedGreen, Green; + end + end + + group VTL3: + group Activated: + input bool On; + end + + group Red: + input bool On; + end + + group Green: + input bool On; + end + + group Red2: + input bool On; + end + + alg bool RedStaysOff = .VTL3.DiagnoseRed.StaysOff; + alg bool GreenStaysOff = .VTL3.DiagnoseGreen.StaysOff; + alg bool Red2StaysOff = .VTL3.DiagnoseRed2.StaysOff; + + group Actuator: + input bool Red, RedRed, RedGreen, Green; + end + end + + group VTL4: + group Activated: + input bool On; + end + + group Red: + input bool On; + end + + group Green: + input bool On; + end + + group Red2: + input bool On; + end + + alg bool RedStaysOff = .VTL4.DiagnoseRed.StaysOff; + alg bool GreenStaysOff = .VTL4.DiagnoseGreen.StaysOff; + alg bool Red2StaysOff = .VTL4.DiagnoseRed2.StaysOff; + + group Actuator: + input bool Red, RedRed, RedGreen, Green; + end + end + + group VTL5: + group Activated: + input bool On; + end + + group Red: + input bool On; + end + + group Green: + input bool On; + end + + group Red2: + input bool On; + end + + alg bool RedStaysOff = .VTL5.DiagnoseRed.StaysOff; + alg bool GreenStaysOff = .VTL5.DiagnoseGreen.StaysOff; + alg bool Red2StaysOff = .VTL5.DiagnoseRed2.StaysOff; + + group Actuator: + input bool Red, RedRed, RedGreen, Green; + end + end + + group VTL6: + group Activated: + input bool On; + end + + group Red: + input bool On; + end + + group Green: + input bool On; + end + + group Red2: + input bool On; + end + + alg bool RedStaysOff = .VTL6.DiagnoseRed.StaysOff; + alg bool GreenStaysOff = .VTL6.DiagnoseGreen.StaysOff; + alg bool Red2StaysOff = .VTL6.DiagnoseRed2.StaysOff; + + group Actuator: + input bool Red, RedRed, RedGreen, Green; + end + end + + group VTL7: + group Activated: + input bool On; + end + + group Red: + input bool On; + end + + group Green: + input bool On; + end + + group Red2: + input bool On; + end + + alg bool RedStaysOff = .VTL7.DiagnoseRed.StaysOff; + alg bool GreenStaysOff = .VTL7.DiagnoseGreen.StaysOff; + alg bool Red2StaysOff = .VTL7.DiagnoseRed2.StaysOff; + + group Actuator: + input bool Red, RedRed, RedGreen, Green; + end + end + + group VTL8: + group Activated: + input bool On; + end + + group Red: + input bool On; + end + + group Green: + input bool On; + end + + group Red2: + input bool On; + end + + alg bool RedStaysOff = .VTL8.DiagnoseRed.StaysOff; + alg bool GreenStaysOff = .VTL8.DiagnoseGreen.StaysOff; + alg bool Red2StaysOff = .VTL8.DiagnoseRed2.StaysOff; + + group Actuator: + input bool Red, RedRed, RedGreen, Green; + end + end + + group LM: + group Valve: + input bool Lock, Unlock; + end + + group Pump: + input bool On; + end + + group Locked: + input bool On; + end + + group Unlocked: + input bool On; + end + + alg bool Stuck = .LM.Diagnose_LockingMechanismStuck.fault; + alg bool UndesiredUnlock = .LM.Diagnose_LockingMechanismUndesiredUnlock.fault; + end + + group BD: + group Closed2: + input bool On; + end + + group Closed: + input bool On; + end + + group BClosed: + input bool On; + end + + group BBClosed: + input bool On; + input bool Off; + end + + group BBOpen: + input bool On; + input bool Off; + end + + group BOpen: + input bool On; + end + + group Open: + input bool On; + end + + group Motor: + input bool On; + end + + group Direction: + input bool Opening, Closing; + end + + alg bool NotDecelerating = .BD.DeceleratingDiagnoser.fault; + alg bool UndesiredClosed = .BD.DiagnoseUnexpectedClose.fault; + alg bool UndesiredOpen = .BD.DiagnoseUnexpectedOpening.fault; + end + + group BR: + group Sensor: + input bool Released; + end + end + + group ResetButton: + input bool ResetFaults; + end +end diff --git a/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/do1_synthesize.tooldef b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/do1_synthesize.tooldef new file mode 100644 index 0000000000000000000000000000000000000000..5ee1c8d3058ba6082667c14541becba1898772ad --- /dev/null +++ b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/do1_synthesize.tooldef @@ -0,0 +1,30 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +// Synthesize the supervisor. + +from "lib:cif" import *; + +mkdir("_generated", force=true); + +outln("Synthesizing supervisor..."); + +cifdatasynth( + "synthesis/plant_and_requirement.cif", + "-o _generated/supervisor.cif", + "-n sup", + "-t normal", + "-m debug", +); + +outln("Supervisor synthesized."); diff --git a/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/do2_simulate.tooldef b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/do2_simulate.tooldef new file mode 100644 index 0000000000000000000000000000000000000000..c5842cf77b152841ca1b3d68cece7f4ca29dcc28 --- /dev/null +++ b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/do2_simulate.tooldef @@ -0,0 +1,44 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +// Simulate the synthesized supervisor. + +from "lib:cif" import *; + +// Make sure that the supervisor has been synthesized. +if not exists("_generated/supervisor.cif"): + errln("ERROR: Please first synthesize the supervisor before executing the simulation script."); + exit 1; +end + +// Merge supervisor with diagnosers and various simulation models. +outln("Preparing simulation model..."); +cifmerge( + "_generated/supervisor.cif", + "diagnosers/diagnosers.cif", + "simulation/plant_and_sim_and_viz.cif", + "simulation/ui_and_viz.cif", + "simulation/timers.cif", + "-o _generated/simulation.cif", +); + +// Simulate controlled system. +outln("Starting simulation..."); +cifsim( + "_generated/simulation.cif", + "--input-mode=svg", + "--auto-algo=first", + "--frame-rate=10", + "--speed=3", + "--max-delay=10.0", +); diff --git a/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/plant.cif b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/plant.cif new file mode 100644 index 0000000000000000000000000000000000000000..539e99f233428667d98db5d67e3f1ab6d044b227 --- /dev/null +++ b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/plant.cif @@ -0,0 +1,668 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +// Stop signs. +group StopSigns: + // Actuator. + automaton Actuator: + controllable c_on, c_emrgOn, c_off; + + location Off: + initial; + edge c_on goto On; + edge c_emrgOn goto On; + + location On: + edge c_off goto Off; + end + + // Sensors. + automaton S1: + uncontrollable u_on, u_off; + alg bool onGuard = Actuator.On and not S1Fault.Defect; + + location Off: + initial; + edge u_on when onGuard goto On; + + location On: + edge u_off when not onGuard goto Off; + end + + automaton S2: + uncontrollable u_on, u_off; + alg bool onGuard = Actuator.On and not S2Fault.Defect; + + location Off: + initial; + edge u_on when onGuard goto On; + + location On: + edge u_off when not onGuard goto Off; + end + + automaton S3: + uncontrollable u_on, u_off; + alg bool onGuard = Actuator.On and not S3Fault.Defect; + + location Off: + initial; + edge u_on when onGuard goto On; + + location On: + edge u_off when not onGuard goto Off; + end + + automaton S4: + uncontrollable u_on, u_off; + alg bool onGuard = Actuator.On and not S4Fault.Defect; + + location Off: + initial; + edge u_on when onGuard goto On; + + location On: + edge u_off when not onGuard goto Off; + end + + automaton S5: + uncontrollable u_on, u_off; + alg bool onGuard = Actuator.On and not S5Fault.Defect; + + location Off: + initial; + edge u_on when onGuard goto On; + + location On: + edge u_off when not onGuard goto Off; + end + + // Sensor faults. + S1Fault: Fault(); + S2Fault: Fault(); + S3Fault: Fault(); + S4Fault: Fault(); + S5Fault: Fault(); + + automaton def Fault(): + disc bool Defect; + uncontrollable u_f; + + location: + initial; + edge u_f do Defect := not Defect; + end +end + +// Boom barriers. +group BB: + // Lights. + automaton L: + controllable c_on, c_emrgOn, c_off; + + location Off: + initial; + edge c_on goto On; + edge c_emrgOn goto On; + + location On: + edge c_off goto Off; + end + + // Light alternation. + automaton Alternate: + controllable c_mode1, c_mode2; + + location Mode1: + initial; + edge c_mode2 goto Mode2; + + location Mode2: + edge c_mode1 goto Mode1; + end +end + +group def BoomBarrier(): + // Position. + group Position: + cont d = 0.0 der if d <= 100 and Actuator.Closing and not Fault.Stuck: +20 + elif d <= 100 and Fault.UndesiredClose: + 2 + elif d >= 0 and Actuator.Opening and not Fault.Stuck: -20 + elif d >= 0 and Fault.UndesiredOpen: - 2 + else 0.0 + end; + end + + // Actuator. + automaton Actuator: + controllable c_open, c_close, c_stop, c_emrgStop; + + location Idle: + initial; + edge c_open goto Opening; + edge c_close goto Closing; + + location Opening: + edge c_stop, c_emrgStop goto Idle; + + location Closing: + edge c_stop, c_emrgStop goto Idle; + end + + // Sensors. + automaton Open: + uncontrollable u_open_on, u_open_off; + + location On: + initial; + edge u_open_off when Position.d > 0.0 goto Off; + + location Off: + edge u_open_on when Position.d <= 0.0 goto On; + end + + automaton Closed: + uncontrollable u_closed_on, u_closed_off; + + location On: + edge u_closed_off when Position.d < 100.0 goto Off; + + location Off: + initial; + edge u_closed_on when Position.d >= 100.0 goto On; + end + + automaton NotOpen: + uncontrollable u_notOpen_on, u_notOpen_off; + + location Off: + initial; + edge u_notOpen_on when Position.d > 5.0 goto On; + + location On: + edge u_notOpen_off when Position.d <= 5.0 goto Off; + end + + automaton NotClosed: + uncontrollable u_notClosed_on, u_notClosed_off; + + location Off: + edge u_notClosed_on when Position.d < 95.0 goto On; + + location On: + initial; + edge u_notClosed_off when Position.d >= 95.0 goto Off; + end + + // Faults. + automaton Fault: + uncontrollable u_f3, u_f4_closed, u_f4_open; + disc bool Stuck = false; + disc bool UndesiredClose = false; + disc bool UndesiredOpen = false; + + location: + initial; + edge u_f3 do Stuck := not Stuck; + edge u_f4_closed do UndesiredClose := not UndesiredClose; + edge u_f4_open do UndesiredOpen := not UndesiredOpen; + end +end + +BB1: BoomBarrier(); +BB2: BoomBarrier(); + +// Vessel traffic lights. +group def VesselTrafficLight(): + // Actuators. + automaton Actuator: + controllable c_red, c_redGreen, c_redRed, c_green, c_emrg; + + location RedRed: + edge c_red goto Red; + + location Red: + initial; marked; + edge c_redGreen goto RedGreen; + edge c_redRed goto RedRed; + + location RedGreen: + edge c_red goto Red; + edge c_green goto Green; + edge c_emrg goto Red; + + location Green: + edge c_red goto Red; + edge c_emrg goto Red; + end + + automaton Activated: + controllable c_on, c_off; + + location On: + initial; marked; + edge c_off goto Off; + + location Off: + edge c_on goto On; + end + + // Sensors. + automaton Red: + uncontrollable u_red_on, u_red_off; + alg bool onGuard = not VTL_defect.RedLampDefect and (Actuator.Red or Actuator.RedGreen or Actuator.RedRed) and Activated.On; + + location Off: + edge u_red_on when onGuard goto On; + + location On: + initial; + edge u_red_off when not onGuard goto Off; + end + + automaton Green: + uncontrollable u_green_on, u_green_off; + alg bool onGuard = not VTL_defect.GreenLampDefect and (Actuator.Green or Actuator.RedGreen) and Activated.On; + + location Off: + initial; + edge u_green_on when onGuard goto On; + + location On: + edge u_green_off when not onGuard goto Off; + end + + automaton Red2: + uncontrollable u_red2_on, u_red2_off; + alg bool onGuard = not VTL_defect.Red2LampDefect and Actuator.RedRed and Activated.On; + + location Off: + initial; + edge u_red2_on when onGuard goto On; + + location On: + marked; + edge u_red2_off when not onGuard goto Off; + end + + // Defects. + automaton VTL_defect: + uncontrollable u_f2, u_f2_1, u_f2_2; + disc bool RedLampDefect = false; + disc bool GreenLampDefect = false; + disc bool Red2LampDefect = false; + + location: + initial; + edge u_f2 do RedLampDefect := not RedLampDefect; + edge u_f2_1 do GreenLampDefect := not GreenLampDefect; + edge u_f2_2 do Red2LampDefect := not Red2LampDefect; + end +end + +VTL1: VesselTrafficLight(); +VTL2: VesselTrafficLight(); +VTL3: VesselTrafficLight(); +VTL4: VesselTrafficLight(); +VTL5: VesselTrafficLight(); +VTL6: VesselTrafficLight(); +VTL7: VesselTrafficLight(); +VTL8: VesselTrafficLight(); + +// Brake. +group BR: + // Position. + group Position: + cont t = 1.0 der if Actuator.Apply and t < 1.0: +1.0 + elif Actuator.Release and t > 0.0: -1.0 + else 0.0 + end; + end + + // Actuator. + automaton Actuator: + controllable c_release, c_apply, c_emrgStop; + + location Apply: + initial; + edge c_release goto Release; + + location Release: + edge c_apply, c_emrgStop goto Apply; + end + + // Sensors. + automaton Sensor: + uncontrollable u_released, u_applied; + + location Applied: + initial; marked; + edge u_released when Position.t <= 0.0 goto Released; + + location Released: + edge u_applied when Position.t >= 1.0 goto Applied; + end + + automaton Release: + uncontrollable u_release, u_apply; + cont t der if WarmUp: -1.0 else 0.0 end; + + location Off: + initial; + edge when BD.Motor.On and not BD.Direction.Idle do t:= 2.0 goto WarmUp; + + location WarmUp: + edge u_release when t <= 0.0 goto On; + + location On: + edge u_apply when BD.Motor.Off or BD.Direction.Idle goto Off; + end +end + +// Locking mechanism. +group LM: + // Position. + group Position: + cont h = 2.0 der if h < 2.0 and Pump.On and Valve.Lock and not LM_disturbance.LM_stuck: +1.0 + elif h > 0.0 and Pump.On and Valve.Unlock and not LM_disturbance.LM_stuck: -1.0 + elif h > 0.0 and LM_disturbance.LM_unlock: -0.2 + elif h < 2.0 and LM_disturbance.LM_lock: +0.2 + else 0.0 + end; + end + + // Actuators. + automaton Valve: + controllable c_lock, c_unlock, c_stop, c_emrgStop; + + location Idle: + initial; + edge c_lock goto Lock; + edge c_unlock goto Unlock; + + location Lock: + edge c_stop, c_emrgStop goto Idle; + + location Unlock: + edge c_stop, c_emrgStop goto Idle; + end + + automaton Pump: + controllable c_on, c_off, c_emrgStop; + + location Off: + initial; + edge c_on goto On; + + location On: + edge c_off, c_emrgStop goto Off; + end + + // Sensors. + plant Locked: + uncontrollable u_locked_on, u_locked_off; + + location Off: + edge u_locked_on when Position.h >= 2.0 goto On; + + location On: + initial; marked; + edge u_locked_off when Position.h < 2.0 goto Off; + end + + plant Unlocked: + uncontrollable u_unlocked_on, u_unlocked_off; + + location Off: + initial; marked; + edge u_unlocked_on when Position.h <= 0.0 goto On; + + location On: + edge u_unlocked_off when Position.h > 0.0 goto Off; + end + + // Faults. + automaton LM_disturbance: + uncontrollable u_f7, u_f8, u_f8b; + disc bool LM_unlock = false; + disc bool LM_stuck = false; + disc bool LM_lock = false; + + location: + initial; + edge u_f7 do LM_stuck := not LM_stuck; + edge u_f8 do LM_unlock := not LM_unlock; + edge u_f8b do LM_lock := not LM_lock; + end +end + +// Bridge deck. +group BD: + // Position. + group Position: + cont d = 0.0 der if BR.Sensor.Applied and not UndesiredMovement.Close and not UndesiredMovement.Open: 0.0 + elif d <= 100 and Motor.On and Direction.Opening and Speed.Fast: +10 + elif d <= 100 and Motor.On and Direction.Opening and DeceleratingFault.Fault: +10 + elif d <= 100 and Motor.On and Direction.Opening and Speed.Slow: + 5 + elif d >= 0 and Motor.On and Direction.Closing and Speed.Fast: -10 + elif d >= 0 and Motor.On and Direction.Closing and DeceleratingFault.Fault: -10 + elif d >= 0 and Motor.On and Direction.Closing and Speed.Slow: - 5 + elif d >= 0 and UndesiredMovement.Close: -10 + elif d <= 100 and UndesiredMovement.Open: +10 + else 0.0 + end; + end + + // Motor. + automaton Motor: + controllable c_on, c_off, c_emrgStop; + + location Off: + initial; + edge c_on goto On; + + location On: + edge c_off, c_emrgStop goto Off; + end + + // Frequency converter. + automaton Direction: + controllable c_open, c_close, c_stop, c_emrgStop; + + location Idle: + initial; + edge c_open goto Opening; + edge c_close goto Closing; + + location Opening: + edge c_stop, c_emrgStop goto Idle; + + location Closing: + edge c_stop, c_emrgStop goto Idle; + end + + // Frequency converter speed. + automaton Speed: + controllable c_stop, c_fast, c_slow, c_emrgStop; + + location Idle: // 0% + initial; + edge c_fast goto Fast; + edge c_slow goto Slow; + + location Fast: // 100% + edge c_stop, c_emrgStop goto Idle; + edge c_slow goto Slow; + + location Slow: // 19% + edge c_stop, c_emrgStop goto Idle; + edge c_fast goto Fast; + end + + // Sensors. + const real C = 0.0, BC = 10, BBC = 25, // Closed, before closed, before before closed. + O = 100.0, BO = 90, BBO = 75; // Open, before open, before before open. + + automaton Closed2: + uncontrollable u_closed2_on, u_closed2_off; + + location Off: + edge u_closed2_on when Position.d <= C goto On; + + location On: + initial; + edge u_closed2_off when Position.d > C goto Off; + end + + plant Closed: + uncontrollable u_closed_on, u_closed_off; + + location Off: + edge u_closed_on when Position.d <= C goto On; + + location On: + initial; marked; + edge u_closed_off when Position.d > C goto Off; + end + + plant BClosed: + uncontrollable u_bClosed_on, u_bClosed_off; + + location Off: + edge u_bClosed_on when Position.d <= BC goto On; + + location On: + initial; marked; + edge u_bClosed_off when Position.d > BC goto Off; + end + + plant BBClosed: + uncontrollable u_bbClosed_on, u_bbClosed_off; + + location Off: + edge u_bbClosed_on when Position.d <= BBC goto On; + + location On: + initial; marked; + edge u_bbClosed_off when Position.d > BBC goto Off; + end + + plant BBOpen: + uncontrollable u_bbOpen_on, u_bbOpen_off; + + location Off: + initial; marked; + edge u_bbOpen_on when Position.d >= BBO goto On; + + location On: + edge u_bbOpen_off when Position.d < BBO goto Off; + end + + plant BOpen: + uncontrollable u_bOpen_on, u_bOpen_off; + + location Off: + initial; marked; + edge u_bOpen_on when Position.d >= BO goto On; + + location On: + edge u_bOpen_off when Position.d < BO goto Off; + end + + plant Open: + uncontrollable u_open_on, u_open_off; + + location Off: + initial; marked; + edge u_open_on when Position.d >= O goto On; + + location On: + edge u_open_off when Position.d < O goto Off; + end + + // Faults. + automaton UndesiredMovement: + uncontrollable u_f6_open, u_f6_closed; + disc bool Open = false; + disc bool Close = false; + + location: + initial; + edge u_f6_open do Open := not Open; + edge u_f6_closed do Close := not Close; + end + + automaton DeceleratingFault: + uncontrollable u_f5; + disc bool Fault = false; + + location: + initial; + edge u_f5 do Fault := not Fault; + end +end + +// Supervisor skeleton. +group sup: + group StopSigns: + input bool S1StaysOff, S2StaysOff, S3StaysOff, S4StaysOff, S5StaysOff; + end + + group BB1: + input bool Stuck, UndesiredClosed, UndesiredOpen; + end + + group BB2: + input bool Stuck, UndesiredClosed, UndesiredOpen; + end + + group VTL1: + input bool RedStaysOff, GreenStaysOff, Red2StaysOff; + end + + group VTL2: + input bool RedStaysOff, GreenStaysOff, Red2StaysOff; + end + + group VTL3: + input bool RedStaysOff, GreenStaysOff, Red2StaysOff; + end + + group VTL4: + input bool RedStaysOff, GreenStaysOff, Red2StaysOff; + end + + group VTL5: + input bool RedStaysOff, GreenStaysOff, Red2StaysOff; + end + + group VTL6: + input bool RedStaysOff, GreenStaysOff, Red2StaysOff; + end + + group VTL7: + input bool RedStaysOff, GreenStaysOff, Red2StaysOff; + end + + group VTL8: + input bool RedStaysOff, GreenStaysOff, Red2StaysOff; + end + + group LM: + input bool Stuck, UndesiredUnlock; + end + + group BD: + input bool NotDecelerating, UndesiredOpen, UndesiredClosed; + end +end diff --git a/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/plant.svg b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/plant.svg new file mode 100644 index 0000000000000000000000000000000000000000..8468f971c3b7c81072a23deaafb734a6509b7c62 --- /dev/null +++ b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/plant.svg @@ -0,0 +1,2264 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Hoevense Kanaaldijk + Hoevense Kanaaldijk + Oisterwijksebaan + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + N + + + + Motor + + Lock + + Unlock + + Close + + Open + + Fast + + Slow + + Pump + + Brake release + SS2 + SS1 + SS3 + VTL3 + VTL4 + VTL7 + VTL8 + SS4 + SS5 + BB2 + VTL5 + VTL6 + VTL1 + VTL2 + BB1 + + Reset diagnosers + + + + Red lamp VTL7 stays off + + Red lamp VTL6 stays off + + + Red lamp VTL8 stays off + + + + + Bridge not decelerating + BB1 stuck + BB2 stuck + + BB1 undesired close + + BB2 undesired close + + LM stuck + + LM undesired unlock + + BB1 undesired open + + BB2 undesired open + + + Bridge undesired open + + Bridge undesired close + LM lock + + + + Red lamp VTL1 stays off + Red lamp VTL2 stays off + Red lamp VTL3 stays off + Red lamp VTL4 stays off + + Red lamp VTL5 stays off + SS2 stays off + + SS1 stays off + + + SS3 stays off + + SS4 stays off + SS5 stays off + + + + + + Green lamp VTL7 stays off + + Green lamp VTL6 stays off + + + Green lamp VTL8 stays off + Green lamp VTL1 stays off + Green lamp VTL2 stays off + Green lamp VTL3 stays off + Green lamp VTL4 stays off + + Green lamp VTL5 stays off + + + + + Red2 lamp VTL7 stays off + + Red2 lamp VTL6 stays off + + + Red2 lamp VTL8 stays off + Red2 lamp VTL1 stays off + Red2 lamp VTL2 stays off + Red2 lamp VTL3 stays off + Red2 lamp VTL4 stays off + + Red2 lamp VTL5 stays off + + + + + + + + + + + Override + Force faults in the system + + diff --git a/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/plant_and_sim.cif b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/plant_and_sim.cif new file mode 100644 index 0000000000000000000000000000000000000000..fbad321a90db7eb44785fc1fc1dff72a8e46d413 --- /dev/null +++ b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/plant_and_sim.cif @@ -0,0 +1,43 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +import "plant.cif"; + +// Reset button. +automaton ResetButton: + disc bool ResetFaults = false; + uncontrollable u_reset; + + location: + initial; + edge u_reset do ResetFaults := not ResetFaults; +end + +// Override switch. +automaton OverrideSwitch: + uncontrollable u_turn_on, u_turn_off; + + location Off: + initial; marked; + edge u_turn_on goto On; + + location On: + edge u_turn_off goto Off; +end + +// Supervisor skeleton. +group sup: + group ResetButton: + alg bool ResetFaults = .ResetButton.ResetFaults; + end +end diff --git a/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/plant_and_sim_and_viz.cif b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/plant_and_sim_and_viz.cif new file mode 100644 index 0000000000000000000000000000000000000000..683defa4a8184606299422308838dff5fbf26b09 --- /dev/null +++ b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/plant_and_sim_and_viz.cif @@ -0,0 +1,214 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +import "plant_and_sim.cif"; +svgfile "plant.svg"; + +// Overrule switch. +svgin id "overruleSwitch_off" event OverrideSwitch.u_turn_off; +svgin id "overruleSwitch_on" event OverrideSwitch.u_turn_on; + +svgout id "overruleSwitch_off" attr "fill" value if OverrideSwitch.Off: "none" else "green" end; +svgout id "overruleSwitch_on" attr "fill" value if OverrideSwitch.On: "none" else "red" end; + +// Vessel traffic lights. +group def V_VTL(alg bool enabled; alg string svgOutID, color): + svgout id svgOutID attr "fill" value if enabled: color else "#e6e6e6" end; +end + +V_StopSign1: V_VTL(StopSigns.S1.On, "Stop1", "red"); +V_StopSign2: V_VTL(StopSigns.S2.On, "Stop2", "red"); +V_StopSign3: V_VTL(StopSigns.S3.On, "Stop3", "red"); +V_StopSign4: V_VTL(StopSigns.S4.On, "Stop4", "red"); +V_StopSign5: V_VTL(StopSigns.S5.On, "Stop5", "red"); + +V_VTL1_R: V_VTL(VTL1.Red.On, "VTL1_R", "red"); +V_VTL1_G: V_VTL(VTL1.Green.On, "VTL1_G", "green"); +V_VTL1_S: V_VTL(VTL1.Red2.On, "VTL1_S", "red"); + +V_VTL2_R: V_VTL(VTL2.Red.On, "VTL2_R", "red"); +V_VTL2_G: V_VTL(VTL2.Green.On, "VTL2_G", "green"); +V_VTL2_S: V_VTL(VTL2.Red2.On, "VTL2_S", "red"); + +V_VTL3_R: V_VTL(VTL3.Red.On, "VTL3_R", "red"); +V_VTL3_G: V_VTL(VTL3.Green.On, "VTL3_G", "green"); +V_VTL3_S: V_VTL(VTL3.Red2.On, "VTL3_S", "red"); + +V_VTL4_R: V_VTL(VTL4.Red.On, "VTL4_R", "red"); +V_VTL4_G: V_VTL(VTL4.Green.On, "VTL4_G", "green"); +V_VTL4_S: V_VTL(VTL4.Red2.On, "VTL4_S", "red"); + +V_VTL5_R: V_VTL(VTL5.Red.On, "VTL5_R", "red"); +V_VTL5_G: V_VTL(VTL5.Green.On, "VTL5_G", "green"); +V_VTL5_S: V_VTL(VTL5.Red2.On, "VTL5_S", "red"); + +V_VTL6_R: V_VTL(VTL6.Red.On, "VTL6_R", "red"); +V_VTL6_G: V_VTL(VTL6.Green.On, "VTL6_G", "green"); +V_VTL6_S: V_VTL(VTL6.Red2.On, "VTL6_S", "red"); + +V_VTL7_R: V_VTL(VTL7.Red.On, "VTL7_R", "red"); +V_VTL7_G: V_VTL(VTL7.Green.On, "VTL7_G", "green"); +V_VTL7_S: V_VTL(VTL7.Red2.On, "VTL7_S", "red"); + +V_VTL8_R: V_VTL(VTL8.Red.On, "VTL8_R", "red"); +V_VTL8_G: V_VTL(VTL8.Green.On, "VTL8_G", "green"); +V_VTL8_S: V_VTL(VTL8.Red2.On, "VTL8_S", "red"); + +// Boom barriers. +group def V_BoomBarrier(alg bool open, on, flash; alg int svgOutID; alg real degree): + svgout id "BB" + svgOutID attr "visibility" value if open: "hidden" else "visible" end; + svgout id "BB" + svgOutID + "_1" attr "fill" value if on and flash: "red" else "#e6e6e6" end; + svgout id "BB" + svgOutID + "_2" attr "fill" value if on and not flash: "red" else "#e6e6e6" end; + svgout id "BB" + svgOutID + "_3" attr "fill" value if on: "red" else "#e6e6e6" end; + svgout id "BBW" + svgOutID attr "width" value scale(degree, 0, 100, 84, 0.1); +end + +V_BoomBarrier1: V_BoomBarrier(BB1.Open.On, BB.L.On, BB.Alternate.Mode2, 1, BB1.Position.d); +V_BoomBarrier2: V_BoomBarrier(BB2.Open.On, BB.L.On, BB.Alternate.Mode2, 2, BB2.Position.d); + +// Bridge. +group V_bridge: + svgout id "bridge" attr "transform" value fmt("rotate(%s,386.5,468)", scale(BD.Position.d, 0, 100, 0, 90)); +end + +// Other indicators. +svgout id "FC" attr "fill" value if BD.Motor.On: "green" else "red" end; +svgout id "vLock" attr "fill" value if LM.Valve.Lock: "green" else "red" end; +svgout id "vUnlock" attr "fill" value if LM.Valve.Unlock: "green" else "red" end; +svgout id "vClose" attr "fill" value if BD.Direction.Closing: "green" else "red" end; +svgout id "vOpen" attr "fill" value if BD.Direction.Opening: "green" else "red" end; +svgout id "vFast" attr "fill" value if BD.Speed.Fast: "green" else "red" end; +svgout id "vSlow" attr "fill" value if BD.Speed.Slow: "green" else "red" end; +svgout id "vPump" attr "fill" value if LM.Pump.On: "green" else "red" end; +svgout id "vBrake" attr "fill" value if BR.Actuator.Release: "green" else "red" end; + +// Fault introduction buttons. +group def FaultButton(alg string label; uncontrollable event defect; alg bool state): + svgin id label event defect; + svgout id label attr "fill" value if state: "darkorange" else "lightgrey" end; +end + +group Faults: + S1_Fault: FaultButton("button_S1_defect", StopSigns.S1Fault.u_f, StopSigns.S1Fault.Defect); + S2_Fault: FaultButton("button_S2_defect", StopSigns.S2Fault.u_f, StopSigns.S2Fault.Defect); + S3_Fault: FaultButton("button_S3_defect", StopSigns.S3Fault.u_f, StopSigns.S3Fault.Defect); + S4_Fault: FaultButton("button_S4_defect", StopSigns.S4Fault.u_f, StopSigns.S4Fault.Defect); + S5_Fault: FaultButton("button_S5_defect", StopSigns.S5Fault.u_f, StopSigns.S5Fault.Defect); + + VTL1_RedFault: FaultButton("button_VTL1_defect", VTL1.VTL_defect.u_f2, VTL1.VTL_defect.RedLampDefect); + VTL2_RedFault: FaultButton("button_VTL2_defect", VTL2.VTL_defect.u_f2, VTL2.VTL_defect.RedLampDefect); + VTL3_RedFault: FaultButton("button_VTL3_defect", VTL3.VTL_defect.u_f2, VTL3.VTL_defect.RedLampDefect); + VTL4_RedFault: FaultButton("button_VTL4_defect", VTL4.VTL_defect.u_f2, VTL4.VTL_defect.RedLampDefect); + VTL5_RedFault: FaultButton("button_VTL5_defect", VTL5.VTL_defect.u_f2, VTL5.VTL_defect.RedLampDefect); + VTL6_RedFault: FaultButton("button_VTL6_defect", VTL6.VTL_defect.u_f2, VTL6.VTL_defect.RedLampDefect); + VTL7_RedFault: FaultButton("button_VTL7_defect", VTL7.VTL_defect.u_f2, VTL7.VTL_defect.RedLampDefect); + VTL8_RedFault: FaultButton("button_VTL8_defect", VTL8.VTL_defect.u_f2, VTL8.VTL_defect.RedLampDefect); + + VTL1_GreenFault: FaultButton("button_VTL1_green_defect", VTL1.VTL_defect.u_f2_1, VTL1.VTL_defect.GreenLampDefect); + VTL2_GreenFault: FaultButton("button_VTL2_green_defect", VTL2.VTL_defect.u_f2_1, VTL2.VTL_defect.GreenLampDefect); + VTL3_GreenFault: FaultButton("button_VTL3_green_defect", VTL3.VTL_defect.u_f2_1, VTL3.VTL_defect.GreenLampDefect); + VTL4_GreenFault: FaultButton("button_VTL4_green_defect", VTL4.VTL_defect.u_f2_1, VTL4.VTL_defect.GreenLampDefect); + VTL5_GreenFault: FaultButton("button_VTL5_green_defect", VTL5.VTL_defect.u_f2_1, VTL5.VTL_defect.GreenLampDefect); + VTL6_GreenFault: FaultButton("button_VTL6_green_defect", VTL6.VTL_defect.u_f2_1, VTL6.VTL_defect.GreenLampDefect); + VTL7_GreenFault: FaultButton("button_VTL7_green_defect", VTL7.VTL_defect.u_f2_1, VTL7.VTL_defect.GreenLampDefect); + VTL8_GreenFault: FaultButton("button_VTL8_green_defect", VTL8.VTL_defect.u_f2_1, VTL8.VTL_defect.GreenLampDefect); + + VTL1_Red2Fault: FaultButton("button_VTL1_red2_defect", VTL1.VTL_defect.u_f2_2, VTL1.VTL_defect.Red2LampDefect); + VTL2_Red2Fault: FaultButton("button_VTL2_red2_defect", VTL2.VTL_defect.u_f2_2, VTL2.VTL_defect.Red2LampDefect); + VTL3_Red2Fault: FaultButton("button_VTL3_red2_defect", VTL3.VTL_defect.u_f2_2, VTL3.VTL_defect.Red2LampDefect); + VTL4_Red2Fault: FaultButton("button_VTL4_red2_defect", VTL4.VTL_defect.u_f2_2, VTL4.VTL_defect.Red2LampDefect); + VTL5_Red2Fault: FaultButton("button_VTL5_red2_defect", VTL5.VTL_defect.u_f2_2, VTL5.VTL_defect.Red2LampDefect); + VTL6_Red2Fault: FaultButton("button_VTL6_red2_defect", VTL6.VTL_defect.u_f2_2, VTL6.VTL_defect.Red2LampDefect); + VTL7_Red2Fault: FaultButton("button_VTL7_red2_defect", VTL7.VTL_defect.u_f2_2, VTL7.VTL_defect.Red2LampDefect); + VTL8_Red2Fault: FaultButton("button_VTL8_red2_defect", VTL8.VTL_defect.u_f2_2, VTL8.VTL_defect.Red2LampDefect); + + BB1_Fault: FaultButton("button_BB1_defect", BB1.Fault.u_f3, BB1.Fault.Stuck); + BB2_Fault: FaultButton("button_BB2_defect", BB2.Fault.u_f3, BB2.Fault.Stuck); + + BB1_UndesiredClosed: FaultButton("button_BB1_close", BB1.Fault.u_f4_closed, BB1.Fault.UndesiredClose); + BB1_UndesiredOpen: FaultButton("button_BB1_open", BB1.Fault.u_f4_open, BB1.Fault.UndesiredOpen); + + BB2_UndesiredClosed: FaultButton("button_BB2_close", BB2.Fault.u_f4_closed, BB2.Fault.UndesiredClose); + BB2_UndesiredOpen: FaultButton("button_BB2_open", BB2.Fault.u_f4_open, BB2.Fault.UndesiredOpen); + + LM_Stuck: FaultButton("button_lockingMechanism_stuck", LM.LM_disturbance.u_f7, LM.LM_disturbance.LM_stuck); + LM_Unlock: FaultButton("button_lockingMechanism_unlock", LM.LM_disturbance.u_f8, LM.LM_disturbance.LM_unlock); + LM_Lock: FaultButton("button_lockingMechanism_lock", LM.LM_disturbance.u_f8b, LM.LM_disturbance.LM_lock); + + Bridge_NotDecelerating: FaultButton("button_FC_defect", BD.DeceleratingFault.u_f5, BD.DeceleratingFault.Fault); + Bridge_UndesiredOpen: FaultButton("button_bridge_undesired_open", BD.UndesiredMovement.u_f6_open, BD.UndesiredMovement.Open); + Bridge_UndesiredClosed: FaultButton("button_bridge_undesired_close", BD.UndesiredMovement.u_f6_closed, BD.UndesiredMovement.Close); +end + +V_ResetButton: FaultButton("ResetButton", ResetButton.u_reset, sup.ResetButton.ResetFaults); + +// Diagnosers. +group def Diagnose(alg string label; alg bool state): + svgout id label attr "fill" value if state: "darkorange" else "black" end; +end + +group V_Diagnosers: + // Stop signs. + SS1Fault: Diagnose("SS1_defect", sup.StopSigns.S1StaysOff); + SS2Fault: Diagnose("SS2_defect", sup.StopSigns.S2StaysOff); + SS3Fault: Diagnose("SS3_defect", sup.StopSigns.S3StaysOff); + SS4Fault: Diagnose("SS4_defect", sup.StopSigns.S4StaysOff); + SS5Fault: Diagnose("SS5_defect", sup.StopSigns.S5StaysOff); + + // Vessel traffic lights, red lamp. + VTL1RedStaysOff: Diagnose("Red_VTL1_defect", sup.VTL1.RedStaysOff); + VTL2RedStaysOff: Diagnose("Red_VTL2_defect", sup.VTL2.RedStaysOff); + VTL3RedStaysOff: Diagnose("Red_VTL3_defect", sup.VTL3.RedStaysOff); + VTL4RedStaysOff: Diagnose("Red_VTL4_defect", sup.VTL4.RedStaysOff); + VTL5RedStaysOff: Diagnose("Red_VTL5_defect", sup.VTL5.RedStaysOff); + VTL6RedStaysOff: Diagnose("Red_VTL6_defect", sup.VTL6.RedStaysOff); + VTL7RedStaysOff: Diagnose("Red_VTL7_defect", sup.VTL7.RedStaysOff); + VTL8RedStaysOff: Diagnose("Red_VTL8_defect", sup.VTL8.RedStaysOff); + + // Vessel traffic lights, green lamp. + VTL1GreenStaysOff: Diagnose("Green_VTL1_defect", sup.VTL1.GreenStaysOff); + VTL2GreenStaysOff: Diagnose("Green_VTL2_defect", sup.VTL2.GreenStaysOff); + VTL3GreenStaysOff: Diagnose("Green_VTL3_defect", sup.VTL3.GreenStaysOff); + VTL4GreenStaysOff: Diagnose("Green_VTL4_defect", sup.VTL4.GreenStaysOff); + VTL5GreenStaysOff: Diagnose("Green_VTL5_defect", sup.VTL5.GreenStaysOff); + VTL6GreenStaysOff: Diagnose("Green_VTL6_defect", sup.VTL6.GreenStaysOff); + VTL7GreenStaysOff: Diagnose("Green_VTL7_defect", sup.VTL7.GreenStaysOff); + VTL8GreenStaysOff: Diagnose("Green_VTL8_defect", sup.VTL8.GreenStaysOff); + + // Vessel traffic lights, red2 lamp. + VTL1Red2StaysOff: Diagnose("Red2_VTL1_defect", sup.VTL1.Red2StaysOff); + VTL2Red2StaysOff: Diagnose("Red2_VTL2_defect", sup.VTL2.Red2StaysOff); + VTL3Red2StaysOff: Diagnose("Red2_VTL3_defect", sup.VTL3.Red2StaysOff); + VTL4Red2StaysOff: Diagnose("Red2_VTL4_defect", sup.VTL4.Red2StaysOff); + VTL5Red2StaysOff: Diagnose("Red2_VTL5_defect", sup.VTL5.Red2StaysOff); + VTL6Red2StaysOff: Diagnose("Red2_VTL6_defect", sup.VTL6.Red2StaysOff); + VTL7Red2StaysOff: Diagnose("Red2_VTL7_defect", sup.VTL7.Red2StaysOff); + VTL8Red2StaysOff: Diagnose("Red2_VTL8_defect", sup.VTL8.Red2StaysOff); + + // Boom barriers. + BB1Fault: Diagnose("BB1_Defect", sup.BB1.Stuck); + BB2Fault: Diagnose("BB2_Defect", sup.BB2.Stuck); + BB1UndesiredClose: Diagnose("BB1_UndesiredClose", sup.BB1.UndesiredClosed); + BB2UndesiredClose: Diagnose("BB2_UndesiredClose", sup.BB2.UndesiredClosed); + BB1UndesiredOpen: Diagnose("BB1_UndesiredOpen", sup.BB1.UndesiredOpen); + BB2UndesiredOpen: Diagnose("BB2_UndesiredOpen", sup.BB2.UndesiredOpen); + + // Locking mechanism. + LMStuck: Diagnose("LockingMechanism_stuck", sup.LM.Stuck); + LMUnlock: Diagnose("LockingMechanism_unlock", sup.LM.UndesiredUnlock); + + // Bridge. + BDNotDecelerating: Diagnose("FC_defect", sup.BD.NotDecelerating); + BDUndesiredOpen: Diagnose("Bridge_undesired_open", sup.BD.UndesiredOpen); + BDUndesiredClosed: Diagnose("Bridge_undesired_close", sup.BD.UndesiredClosed); +end diff --git a/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/timers.cif b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/timers.cif new file mode 100644 index 0000000000000000000000000000000000000000..a3eaa2b05f882a45dc4a7a611c1c243b5bc4374e --- /dev/null +++ b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/timers.cif @@ -0,0 +1,53 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +// Basic timers. +automaton def Timer(alg real duration): + controllable c_start; + uncontrollable u_timeout; + cont t = 0.0 der -1; + + location: + initial; + edge c_start do t := duration; + edge u_timeout when t <= 0; +end + +SSsOnTimer: Timer(16.4); + +BBsOpenTimer: Timer(3.0); +BB1OpenTimer: Timer(0.6); +BB1ClosedTimer: Timer(0.3); +BB2OpenTimer: Timer(0.6); +BB2ClosedTimer: Timer(0.3); + +LMLockedTimer: Timer(0.5); +LMUnlockedTimer100: Timer(0.1); +LMUnlockedTimer3: Timer(3.0); + +BDClosedTimer: Timer(3.0); + +// Boom barrier timer. +group BB: + group Alternate: // Light alternation. + controllable c_mode1, c_mode2; + end + + plant Switcher: // Light switcher timer. + cont t = 0.0 der -1; + + location: initial; + edge Alternate.c_mode2 when t <= 0 do t := 1000; + edge Alternate.c_mode1 when t <= 0 do t := 1; + end +end diff --git a/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/ui.cif b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/ui.cif new file mode 100644 index 0000000000000000000000000000000000000000..7c9173d77edaadaf3dd15da8c78e1635ebadfcae --- /dev/null +++ b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/ui.cif @@ -0,0 +1,149 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +// Bridge. +group BridgeCommands: + uncontrollable u_closeLT, u_openLT, u_openB, u_closeB, u_closeBB, u_stop; +end + +// Vessel traffic lights. +uncontrollable u_r2, u_r2Off; + +group def VTLCommands(): + uncontrollable u_red, u_green; +end + +CommandVTL12: VTLCommands(); +CommandVTL34: VTLCommands(); +CommandVTL56: VTLCommands(); +CommandVTL78: VTLCommands(); + +// Emergency stop. +plant EmergencyStop: + uncontrollable u_emerg_on, u_emerg_off; + + location Inactive: + initial; marked; + edge u_emerg_on goto Active; + + location Active: + edge u_emerg_off goto Inactive; +end + +// Supervisor skeleton. +group sup: + group StopSigns: + group Actuator: + input bool On; + end + end + + group BB1: + group NotClosed: + input bool Off; + end + + group Actuator: + input bool Idle; + end + end + + group BB2: + group NotClosed: + input bool Off; + end + + group Actuator: + input bool Idle; + end + end + + group BD: + group Closed: + input bool On; + end + + group Open: + input bool On; + end + end + + group BridgeCommands: + input bool CloseLT_act, CloseLT_obl, + OpenLT_act, OpenLT_obl, + Stop_act, Stop_obl, + CloseBB_act, CloseBB_obl, + OpenB_act, OpenB_obl, + CloseB_act, CloseB_obl, + Window1Closeable, Window1Visible, + Window2Closeable, Window2Visible; + end + + group def supVTLCommands(): + input bool Red, RedRed, RedGreen, Green; + end + + CommandVTL12: supVTLCommands(); + CommandVTL34: supVTLCommands(); + CommandVTL56: supVTLCommands(); + CommandVTL78: supVTLCommands(); +end + +group StopSigns: + input bool fault123; + input bool fault45; +end + +group BB1: + input bool fault; +end + +group BB2: + input bool fault; +end + +group VTL1: + input bool fault; +end + +group VTL2: + input bool fault; +end + +group VTL3: + input bool fault; +end + +group VTL4: + input bool fault; +end + +group VTL5: + input bool fault; +end + +group VTL6: + input bool fault; +end + +group VTL7: + input bool fault; +end + +group VTL8: + input bool fault; +end + +group BD: + input bool fault; +end diff --git a/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/ui.svg b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/ui.svg new file mode 100644 index 0000000000000000000000000000000000000000..510d6676de1526568942e41bdb172d2852bedede --- /dev/null +++ b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/ui.svg @@ -0,0 +1,780 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + Hoevense Kanaaldijk + Hoevense Kanaaldijk + Oisterwijksebaan + N + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Close LT + + + Barriers + + + Stop + + + + Close Barriers + + + + Open LT + + + + + + + + + + + + + + Open Bridge + + + Bridge + + + Stop + + + + Close Bridge + + + + Open LT + + + + + + + + + + + EmergencyStop + + + + + + + + + + EmergencyStop + + diff --git a/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/ui_and_viz.cif b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/ui_and_viz.cif new file mode 100644 index 0000000000000000000000000000000000000000..933d4711a9ecd9222b25cbd466c5a05f783ce834 --- /dev/null +++ b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/simulation/ui_and_viz.cif @@ -0,0 +1,150 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +import "ui.cif"; +svgfile "ui.svg"; + +// Emergency stop. +svgout id "EmergencyStop" attr "visibility" value if EmergencyStop.Active: "visible" else "hidden" end; + +// Vessel traffic lights. +group def V_VTLButton(alg string n; uncontrollable u_r, u_g; alg bool redRed, red, redGreen, green, fault): + svgfile "ui.svg"; + + svgin id "VTL" + n + "_R" event if redRed: u_r2Off else u_r end; + svgin id "VTL" + n + "_G" event u_g; + svgin id "VTL" + n + "_S" event u_r2; + + svgout id "VTL" + n + "_R" attr "fill" value if redRed or red or redGreen: "#ff0000" else "#999999" end; + svgout id "VTL" + n + "_G" attr "fill" value if redGreen or green: "#009900" else "#999999" end; + svgout id "VTL" + n + "_S" attr "fill" value if redRed: "#ff0000" else "#999999" end; + svgout id "VTL" + n attr "fill" value if fault: "#ff0000" else "black" end; +end + +V_ButtonVTL12: V_VTLButton("12", CommandVTL12.u_red, CommandVTL12.u_green, sup.CommandVTL12.RedRed, sup.CommandVTL12.Red, sup.CommandVTL12.RedGreen, sup.CommandVTL12.Green, VTL1.fault and VTL2.fault); +V_ButtonVTL34: V_VTLButton("34", CommandVTL34.u_red, CommandVTL34.u_green, sup.CommandVTL34.RedRed, sup.CommandVTL34.Red, sup.CommandVTL34.RedGreen, sup.CommandVTL34.Green, VTL3.fault and VTL4.fault); +V_ButtonVTL56: V_VTLButton("56", CommandVTL56.u_red, CommandVTL56.u_green, sup.CommandVTL56.RedRed, sup.CommandVTL56.Red, sup.CommandVTL56.RedGreen, sup.CommandVTL56.Green, VTL5.fault and VTL6.fault); +V_ButtonVTL78: V_VTLButton("78", CommandVTL78.u_red, CommandVTL78.u_green, sup.CommandVTL78.RedRed, sup.CommandVTL78.Red, sup.CommandVTL78.RedGreen, sup.CommandVTL78.Green, VTL7.fault and VTL8.fault); + +// Stop signs. +group V_StopSigns: + svgfile "ui.svg"; + + svgout id "SS1" attr "fill" value if sup.StopSigns.Actuator.On: "#ff0000" else "#999999" end; + svgout id "SS4" attr "fill" value if sup.StopSigns.Actuator.On: "#ff0000" else "#999999" end; + svgout id "SS123" attr "fill" value if StopSigns.fault123: "#ff0000" else "black" end; + svgout id "SS45" attr "fill" value if StopSigns.fault45: "#ff0000" else "black" end; +end + +// Boom barriers. +group V_BB1: + svgfile "ui.svg"; + + svgout id "BB1" attr "fill" value if BB1.fault: "#ff0000" elif not sup.BB1.Actuator.Idle: "#ffff00" else "#ffffff" end; + svgout id "BB1in" attr "fill" value if BB1.fault: "#ff0000" elif not sup.BB1.Actuator.Idle: "#ffff00" elif sup.BB1.NotClosed.Off: "#ffffff" else "#999999" end; +end + +group V_BB2: + svgfile "ui.svg"; + + svgout id "BB2" attr "fill" value if BB2.fault: "#ff0000" elif not sup.BB2.Actuator.Idle: "#ffff00" else "#ffffff" end; + svgout id "BB2in" attr "fill" value if BB2.fault: "#ff0000" elif not sup.BB2.Actuator.Idle: "#ffff00" elif sup.BB2.NotClosed.Off: "#ffffff" else "#999999" end; +end + +// Bridge. +group V_Bridge: + svgfile "ui.svg"; + + svgout id "bridge" attr "fill" value if BD.fault: "#ff0000" elif sup.BridgeCommands.OpenB_act or sup.BridgeCommands.CloseB_act: "#ffff00" else "#ffffff" end; + svgout id "bridge" attr "transform" value fmt("rotate(%s,-280,565)", if sup.BD.Closed.On: 0 elif sup.BD.Open.On: 90 else 45 end); +end + +// SCADA. +group V_SCADA: + svgfile "ui.svg"; + + // Buttons. + svgin id "CloseLT" event BridgeCommands.u_closeLT; + svgin id "CloseBB" event BridgeCommands.u_closeBB; + svgin id "OpenLT1" event BridgeCommands.u_openLT; + svgin id "OpenLT2" event BridgeCommands.u_openLT; + svgin id "OpenB" event BridgeCommands.u_openB; + svgin id "CloseB" event BridgeCommands.u_closeB; + svgin id "BStop1" event BridgeCommands.u_stop; + svgin id "BStop2" event BridgeCommands.u_stop; + svgin id "ButtonEmergencyStop" event if EmergencyStop.Inactive: EmergencyStop.u_emerg_on else EmergencyStop.u_emerg_off end; + + // Active/non-active buttons. + svgout id "ButtonEmergencyStop" attr "fill" value if EmergencyStop.Inactive: "green" else "red" end; + + svgout id "CloseLTB" attr "fill" value if sup.BridgeCommands.CloseLT_act: "yellow" + else "#e6e6e6" + end; + svgout id "CloseBBB" attr "fill" value if sup.BridgeCommands.CloseBB_act: "yellow" + else "#e6e6e6" + end; + svgout id "OpenLT1B" attr "fill" value if sup.BridgeCommands.OpenLT_act: "yellow" + else "#e6e6e6" + end; + svgout id "OpenLT2B" attr "fill" value if sup.BridgeCommands.OpenLT_act: "yellow" + else "#e6e6e6" + end; + svgout id "OpenB-B" attr "fill" value if sup.BridgeCommands.OpenB_act: "yellow" + else "#e6e6e6" + end; + svgout id "CloseB-B" attr "fill" value if sup.BridgeCommands.CloseB_act: "yellow" + else "#e6e6e6" + end; + svgout id "Stop1B" attr "fill" value if sup.BridgeCommands.Stop_act: "red" + elif sup.BridgeCommands.Stop_obl: "pink" + else "#e6e6e6" + end; + svgout id "Stop2B" attr "fill" value if sup.BridgeCommands.Stop_act: "red" + elif sup.BridgeCommands.Stop_obl: "pink" + else "#e6e6e6" + end; + + // Operable/inoperable buttons. + svgout id "CloseLT" attr "opacity" value if sup.BridgeCommands.CloseLT_obl: "1.0" else "0.2" end; + svgout id "CloseBB" attr "opacity" value if sup.BridgeCommands.CloseBB_obl: "1.0" else "0.2" end; + svgout id "OpenLT1" attr "opacity" value if sup.BridgeCommands.OpenLT_obl: "1.0" else "0.2" end; + svgout id "OpenLT2" attr "opacity" value if sup.BridgeCommands.OpenLT_obl: "1.0" else "0.2" end; + svgout id "OpenB" attr "opacity" value if sup.BridgeCommands.OpenB_obl: "1.0" else "0.2" end; + svgout id "CloseB" attr "opacity" value if sup.BridgeCommands.CloseB_obl: "1.0" else "0.2" end; + svgout id "BStop1" attr "opacity" value if sup.BridgeCommands.Stop_obl: "1.0" else "0.2" end; + svgout id "BStop2" attr "opacity" value if sup.BridgeCommands.Stop_obl: "1.0" else "0.2" end; +end + +// Windows. +automaton Windows: + event showW1, showW2, hideW1, hideW2; + monitor showW1, showW2; + disc bool W1 = false, W2 = false; + + location: initial; + edge showW1 when sup.BridgeCommands.Window1Visible do W1 := true; + edge showW2 when sup.BridgeCommands.Window2Visible do W2 := true; + edge hideW1 do W1 := false; + edge hideW2 do W2 := false; + + svgfile "ui.svg"; + + svgout id "W1close" attr "visibility" value if sup.BridgeCommands.Window1Closeable and W1: "visible" else "hidden" end; + svgout id "W2close" attr "visibility" value if sup.BridgeCommands.Window2Closeable and W2: "visible" else "hidden" end; + svgout id "Window1" attr "visibility" value if W1: "visible" else "hidden" end; + svgout id "Window2" attr "visibility" value if W2: "visible" else "hidden" end; + + svgin id "bridge" event if sup.BridgeCommands.Window1Visible: showW1 else showW2 end; + svgin id "W1close" event hideW1; + svgin id "W2close" event hideW2; +end diff --git a/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/synthesis/plant.cif b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/synthesis/plant.cif new file mode 100644 index 0000000000000000000000000000000000000000..56a6d6673cdf59f7bfeb0893cb4044f9ebf1c4c0 --- /dev/null +++ b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/synthesis/plant.cif @@ -0,0 +1,680 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +import "plant_templates.cif"; + +// Stop signs. +group StopSigns: + // Actuator. + plant Actuator: + controllable c_on, c_emrgOn, c_off; + + location Off: + initial; marked; + edge c_on goto On; + edge c_emrgOn goto On; + + location On: + edge c_off goto Off; + end + + // Sensors. + plant S1: + uncontrollable u_on, u_off; + + location Off: + initial; marked; + edge u_on goto On; + + location On: + edge u_off goto Off; + end + + plant S2: + uncontrollable u_on, u_off; + + location Off: + initial; marked; + edge u_on goto On; + + location On: + edge u_off goto Off; + end + + plant S3: + uncontrollable u_on, u_off; + + location Off: + initial; marked; + edge u_on goto On; + + location On: + edge u_off goto Off; + end + + plant S4: + uncontrollable u_on, u_off; + + location Off: + initial; marked; + edge u_on goto On; + + location On: + edge u_off goto Off; + end + + plant S5: + uncontrollable u_on, u_off; + + location Off: + initial; marked; + edge u_on goto On; + + location On: + edge u_off goto Off; + end + + // Sensor faults. + input bool S1StaysOff, S2StaysOff, S3StaysOff, S4StaysOff, S5StaysOff; +end + +SSsOnTimer: Timer(StopSigns.S1.On and StopSigns.S4.On); + +// Boom barriers. +group BB: + // Lights. + plant L: + controllable c_on, c_emrgOn, c_off; + + location Off: + initial; marked; + edge c_on goto On; + edge c_emrgOn goto On; + + location On: + edge c_off goto Off; + end + + // Light alternation. + plant Alternate: + controllable c_mode1, c_mode2; + + location Mode1: + initial; marked; + edge c_mode2 goto Mode2; + + location Mode2: + marked; + edge c_mode1 goto Mode1; + end +end + +group def BoomBarrier(): + // Actuator. + plant Actuator: + controllable c_open, c_close, c_stop, c_emrgStop; + + location Idle: + initial; marked; + edge c_open goto Opening; + edge c_close goto Closing; + + location Opening: + edge c_stop, c_emrgStop goto Idle; + + location Closing: + edge c_stop, c_emrgStop goto Idle; + end + + // Sensors. + plant Open: + uncontrollable u_open_on, u_open_off; + + location Off: + edge u_open_on goto On; + + location On: + initial; marked; + edge u_open_off goto Off; + end + + plant Closed: + uncontrollable u_closed_on, u_closed_off; + + location Off: + initial; marked; + edge u_closed_on goto On; + + location On: + edge u_closed_off goto Off; + end + + plant NotOpen: + uncontrollable u_notOpen_on, u_notOpen_off; + + location Off: + initial; marked; + edge u_notOpen_on goto On; + + location On: + edge u_notOpen_off goto Off; + end + + plant NotClosed: + uncontrollable u_notClosed_on, u_notClosed_off; + + location Off: + edge u_notClosed_on goto On; + + location On: + initial; marked; + edge u_notClosed_off goto Off; + end + + // Faults. + input bool Stuck, UndesiredClosed, UndesiredOpen; +end + +BB1: BoomBarrier(); +BB2: BoomBarrier(); + +BBsOpenTimer: Timer(BB1.Open.On and BB2.Open.On); +BB1OpenTimer: Timer(BB1.Open.On); +BB1ClosedTimer: Timer(BB1.Closed.On); +BB2OpenTimer: Timer(BB2.Open.On); +BB2ClosedTimer: Timer(BB2.Closed.On); + +// Vessel traffic lights. +group def VesselTrafficLight(): + // Actuators. + plant Actuator: + controllable c_red, c_redGreen, c_redRed, c_green, c_emrg; + + location RedRed: + edge c_red goto Red; + + location Red: + initial; marked; + edge c_redGreen goto RedGreen; + edge c_redRed goto RedRed; + + location RedGreen: + edge c_red goto Red; + edge c_green goto Green; + edge c_emrg goto Red; + + location Green: + edge c_red goto Red; + edge c_emrg goto Red; + end + + plant Activated: + controllable c_on, c_off; + + location On: + initial; marked; + edge c_off goto Off; + + location Off: + edge c_on goto On; + end + + // Sensors. + plant Red: + uncontrollable u_red_on, u_red_off; + + location Off: + edge u_red_on goto On; + + location On: + initial; marked; + edge u_red_off goto Off; + end + + plant Green: + uncontrollable u_green_on, u_green_off; + + location Off: + initial; marked; + edge u_green_on goto On; + + location On: + edge u_green_off goto Off; + end + + plant Red2: + uncontrollable u_red2_on, u_red2_off; + + location Off: + initial; marked; + edge u_red2_on goto On; + + location On: + marked; + edge u_red2_off goto Off; + end + + alg bool RedAspect = Red.On and Green.Off; + alg bool RedGreenAspect = Red.On and Green.On; + + // Defects. + input bool RedStaysOff, GreenStaysOff, Red2StaysOff; + alg bool Fault = RedStaysOff or GreenStaysOff or Red2StaysOff; +end + +VTL1: VesselTrafficLight(); +VTL2: VesselTrafficLight(); +VTL3: VesselTrafficLight(); +VTL4: VesselTrafficLight(); +VTL5: VesselTrafficLight(); +VTL6: VesselTrafficLight(); +VTL7: VesselTrafficLight(); +VTL8: VesselTrafficLight(); + +// Brake. +group BR: + // Actuator. + plant Actuator: + controllable c_release, c_apply, c_emrgStop; + + location Apply: + initial; marked; + edge c_release goto Release; + + location Release: + edge c_apply goto Apply; + edge c_emrgStop goto Apply; + end + + // Sensors. + plant Sensor: + uncontrollable u_released, u_applied; + + location Applied: + initial; marked; + edge u_released goto Released; + + location Released: + edge u_applied goto Applied; + end + + plant Release: + uncontrollable u_release, u_apply; + + location Off: + initial; marked; + edge u_release goto On; + + location On: + edge u_apply goto Off; + end +end + +// Locking mechanism. +group LM: + // Actuators. + plant Valve: + controllable c_lock, c_unlock, c_stop, c_emrgStop; + + location Idle: + initial; marked; + edge c_lock goto Lock; + edge c_unlock goto Unlock; + + location Lock: + edge c_stop, c_emrgStop goto Idle; + + location Unlock: + edge c_stop, c_emrgStop goto Idle; + end + + plant Pump: + controllable c_on, c_off, c_emrgStop; + + location Off: + initial; marked; + edge c_on goto On; + + location On: + edge c_off, c_emrgStop goto Off; + end + + // Sensors. + plant Locked: + uncontrollable u_locked_on, u_locked_off; + + location Off: + edge u_locked_on goto On; + + location On: + initial; marked; + edge u_locked_off goto Off; + end + + plant Unlocked: + uncontrollable u_unlocked_on, u_unlocked_off; + + location Off: + initial; marked; + edge u_unlocked_on goto On; + + location On: + edge u_unlocked_off goto Off; + end + + // Faults. + input bool Stuck, UndesiredUnlock; +end + +LMLockedTimer: Timer(LM.Locked.On); +LMUnlockedTimer100: Timer(LM.Unlocked.On); +LMUnlockedTimer3: Timer(LM.Unlocked.On); + +// Bridge deck. +group BD: + // Motor. + plant Motor: + controllable c_on, c_off, c_emrgStop; + + location Off: + initial; marked; + edge c_on goto On; + + location On: + edge c_off goto Off; + edge c_emrgStop goto Off; + end + + // Frequency converter. + plant Direction: + controllable c_open, c_close, c_stop, c_emrgStop; + + location Idle: + initial; marked; + edge c_open goto Opening; + edge c_close goto Closing; + + location Opening: + edge c_stop, c_emrgStop goto Idle; + + location Closing: + edge c_stop, c_emrgStop goto Idle; + end + + // Frequency converter speed. + plant Speed: + controllable c_stop, c_fast, c_slow, c_emrgStop; + + location Idle: // 0% + initial; marked; + edge c_fast goto Fast; + edge c_slow goto Slow; + + location Fast: // 100% + edge c_stop, c_emrgStop goto Idle; + edge c_slow goto Slow; + + location Slow: // 19% + edge c_stop, c_emrgStop goto Idle; + edge c_fast goto Fast; + end + + // Sensors. + plant Closed2: + uncontrollable u_closed2_on, u_closed2_off; + + location Off: + edge u_closed2_on goto On; + + location On: + initial; marked; + edge u_closed2_off goto Off; + end + + plant Closed: + uncontrollable u_closed_on, u_closed_off; + + location Off: + edge u_closed_on goto On; + + location On: + initial; marked; + edge u_closed_off goto Off; + end + + plant BClosed: + uncontrollable u_bClosed_on, u_bClosed_off; + + location Off: + edge u_bClosed_on goto On; + + location On: + initial; marked; + edge u_bClosed_off goto Off; + end + + plant BBClosed: + uncontrollable u_bbClosed_on, u_bbClosed_off; + + location Off: + edge u_bbClosed_on goto On; + + location On: + initial; marked; + edge u_bbClosed_off goto Off; + end + + plant BBOpen: + uncontrollable u_bbOpen_on, u_bbOpen_off; + + location Off: + initial; marked; + edge u_bbOpen_on goto On; + + location On: + edge u_bbOpen_off goto Off; + end + + plant BOpen: + uncontrollable u_bOpen_on, u_bOpen_off; + + location Off: + initial; marked; + edge u_bOpen_on goto On; + + location On: + edge u_bOpen_off goto Off; + end + + plant Open: + uncontrollable u_open_on, u_open_off; + + location Off: + initial; marked; + edge u_open_on goto On; + + location On: + edge u_open_off goto Off; + end + + // Faults. + input bool NotDecelerating, UndesiredClosed, UndesiredOpen; +end + +BDClosedTimer: Timer(BD.Closed.On); + +// Bridge commands. +plant BridgeCommands: + alg bool CloseLT = L11; + alg bool OpenLT = L13; + alg bool CloseBB = L15; + alg bool OpenBB = L17 or L13; + alg bool StopBB = L16; + alg bool OpenB = L21; + alg bool CloseB = L23; + alg bool StopB = L22; + + alg bool CloseLT_act = L11; + alg bool CloseLT_obl = L10 or L11 or L12 or StopSignsOn; + alg bool OpenLT_act = L13 or L17; + alg bool OpenLT_obl = L12 or L14 or L16 or L17 or L20; + alg bool Stop_act = L12 or L16 or L22; + alg bool Stop_obl = L11 or L12 or L13 or L15 or L16 or L17 or L21 or L22 or L23; + alg bool CloseBB_act = L15; + alg bool CloseBB_obl = L14 or L15 or L16; + alg bool OpenB_act = L21; + alg bool OpenB_obl = L20 or L21 or L22; + alg bool CloseB_act = L23; + alg bool CloseB_obl = L22 or L23 or L31; + alg bool Window1Closeable = L10 or L14 or L20 or L30 or L31; + alg bool Window2Closeable = L10 or L14 or L20 or L30 or L31; + alg bool Window1Visible = L10 or L11 or L12 or L13 or L14 or L15 or L16 or L17; + alg bool Window2Visible = L20 or L21 or L22 or L23 or L30 or L31; + + monitor u_closeLT, u_openLT, u_openB, u_closeB, u_closeBB, u_stop; + uncontrollable u_closeLT, u_openLT, u_openB, u_closeB, u_closeBB, u_stop, + Done_u_closeLT, Done_u_openLT, Done_u_closeBB, Done_BarrierOpen, + Done_u_openBRed, Done_u_openBNotRed, Done_u_closeB, Done_8, Done_9, + u_emerg; + + // When all signs have a red lamp enabled, and no green lamp. + alg bool Red = (VTL1.RedAspect or VTL2.RedAspect) and (VTL3.RedAspect or VTL4.RedAspect) and + (VTL5.RedAspect or VTL6.RedAspect) and (VTL7.RedAspect or VTL8.RedAspect) and + VTL1.Green.Off and VTL2.Green.Off and VTL3.Green.Off and VTL4.Green.Off and + VTL5.Green.Off and VTL6.Green.Off and VTL7.Green.Off and VTL8.Green.Off; + alg bool closeBBd = BB1.Closed.On and BB2.Closed.On; + alg bool BridgeMayNotMove = (VTL1.Fault and VTL2.Fault) or (VTL3.Fault and VTL4.Fault) or + (VTL5.Fault and VTL6.Fault) or (VTL7.Fault and VTL8.Fault) or + not closeBBd; + alg bool StopSignsOn = StopSigns.S1.On and StopSigns.S4.On and SSsOnTimer.Finished; + + location L10: // Land traffic open. + initial; marked; + edge u_closeLT goto L11; + + location L11: // Land traffic close. + edge u_stop goto L12; + edge u_emerg when emergency goto L12; + edge Done_u_closeLT when StopSignsOn goto L14; + + location L12: // Land traffic stop. + edge u_closeLT goto L11; + edge u_openLT goto L13; + + location L13: // Land traffic open. + edge u_stop goto L12; + edge u_emerg when emergency goto L12; + edge Done_u_openLT when StopSigns.Actuator.Off goto L10; + + location L14: // Land traffic closed. + edge u_openLT goto L13; + edge u_closeBB when StopSignsOn goto L15; + + location L15: // Barriers closed. + edge u_stop goto L16; + edge u_emerg when EmergencyStop.Active goto L16; + edge Done_u_closeBB when BB1.Closed.On and BB2.Closed.On goto L20; + + location L16: // Barriers stopped. + edge u_closeBB goto L15; + edge u_openLT goto L17; + + location L17: // Barriers open. + edge Done_BarrierOpen when BB1.Open.On and BB2.Open.On goto L13; + edge u_stop goto L16; + edge u_emerg when EmergencyStop.Active goto L16; + + location L20: // Barriers closed. + edge u_openB when not BridgeMayNotMove or OverrideSwitch.On goto L21; + edge u_openLT goto L17; + + location L21: // Bridge opening. + edge u_stop goto L22; + edge u_emerg when EmergencyStop.Active goto L22; + edge Done_u_openBRed when Red and BD.Open.On goto L31; + edge Done_u_openBNotRed when not Red and BD.Open.On goto L30; + + location L22: // Bridge stopped. + edge u_openB goto L21; + edge u_closeB goto L23; + + location L23: // Bridge closing. + edge u_stop goto L22; + edge u_emerg when EmergencyStop.Active goto L22; + edge Done_u_closeB when BD.Closed.On and LM.Locked.On goto L20; + + location L30: // Bridge closed, not red aspects. + edge Done_8 when Red or OverrideSwitch.On goto L31; + + location L31: // Bridge closed, red aspects. + edge u_closeB goto L23; + edge Done_9 when not Red and not OverrideSwitch.On goto L30; +end + +// Vessel traffic lights commands. +uncontrollable u_r2, u_r2Off; + +CommandVTL12: VTLCommands(not CommandVTL34.Green and BD.Open.On and (not VTL3.RedStaysOff or not VTL4.RedStaysOff), + not VTL3.Actuator.RedGreen and not VTL4.Actuator.RedGreen and not BridgeCommands.CloseB_act, + CommandVTL12.Red and CommandVTL34.Red and CommandVTL56.Red and CommandVTL78.Red, + BridgeCommands.StopB or EmergencyStop.Active, + BridgeCommands.Done_u_openBRed, + BridgeCommands.Done_u_openBNotRed, + u_r2, u_r2Off); +CommandVTL34: VTLCommands(not CommandVTL12.Green and BD.Open.On and (not VTL1.RedStaysOff or not VTL2.RedStaysOff), + not VTL1.Actuator.RedGreen and not VTL2.Actuator.RedGreen and not BridgeCommands.CloseB_act, + CommandVTL12.Red and CommandVTL34.Red and CommandVTL56.Red and CommandVTL78.Red, + BridgeCommands.StopB or EmergencyStop.Active, + BridgeCommands.Done_u_openBRed, + BridgeCommands.Done_u_openBNotRed, + u_r2, u_r2Off); +CommandVTL56: VTLCommands(not CommandVTL78.Green and BD.Open.On and (not VTL7.RedStaysOff or not VTL8.RedStaysOff), + not VTL7.Actuator.RedGreen and not VTL8.Actuator.RedGreen and not BridgeCommands.CloseB_act, + CommandVTL12.Red and CommandVTL34.Red and CommandVTL56.Red and CommandVTL78.Red, + BridgeCommands.StopB or EmergencyStop.Active, + BridgeCommands.Done_u_openBRed, + BridgeCommands.Done_u_openBNotRed, + u_r2, u_r2Off); +CommandVTL78: VTLCommands(not CommandVTL56.Green and BD.Open.On and (not VTL5.RedStaysOff or not VTL6.RedStaysOff), + not VTL5.Actuator.RedGreen and not VTL6.Actuator.RedGreen and not BridgeCommands.CloseB_act, + CommandVTL12.Red and CommandVTL34.Red and CommandVTL56.Red and CommandVTL78.Red, + BridgeCommands.StopB or EmergencyStop.Active, + BridgeCommands.Done_u_openBRed, + BridgeCommands.Done_u_openBNotRed, + u_r2, u_r2Off); + +// Emergency stop. +alg bool emergency = EmergencyStop.Active or BD.NotDecelerating or BD.UndesiredClosed; + +plant EmergencyStop: + uncontrollable u_emerg_on, u_emerg_off; + + location Inactive: + initial; marked; + edge u_emerg_on goto Active; + + location Active: + edge u_emerg_off goto Inactive; +end + +// Override switch. +plant OverrideSwitch: + uncontrollable u_turn_on, u_turn_off; + + location Off: + initial; marked; + edge u_turn_on goto On; + + location On: + edge u_turn_off goto Off; +end diff --git a/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/synthesis/plant_and_requirement.cif b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/synthesis/plant_and_requirement.cif new file mode 100644 index 0000000000000000000000000000000000000000..301554a5ae417999ef7910dca80b2c464f7ff635 --- /dev/null +++ b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/synthesis/plant_and_requirement.cif @@ -0,0 +1,358 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +import "plant.cif"; + +// Safety requirements. +group SafetyRequirements: + group SR2: // Stop signs and boom barriers. + requirement BB1.Actuator.c_close needs StopSigns.S1.On and StopSigns.S4.On and SSsOnTimer.Finished; + requirement BB2.Actuator.c_close needs StopSigns.S1.On and StopSigns.S4.On and SSsOnTimer.Finished; + end + + group SR4: // Boom barriers and bridge. + requirement LM.Pump.c_on needs BB1.Closed.On and BB2.Closed.On; + requirement BD.Motor.c_on needs BB1.Closed.On and BB2.Closed.On; + requirement BR.Actuator.c_release needs BB1.Closed.On and BB2.Closed.On; + requirement LM.Valve.c_lock needs BB1.Closed.On and BB2.Closed.On; + requirement LM.Valve.c_unlock needs BB1.Closed.On and BB2.Closed.On; + requirement BD.Direction.c_open needs BB1.Closed.On and BB2.Closed.On; + requirement BD.Direction.c_close needs BB1.Closed.On and BB2.Closed.On; + end + + group SR5: // Bridge and vessel traffic lights. + requirement VTL1.Actuator.c_green needs BD.Open.On and BR.Sensor.Applied and BR.Actuator.Apply; + requirement VTL2.Actuator.c_green needs BD.Open.On and BR.Sensor.Applied and BR.Actuator.Apply; + requirement VTL3.Actuator.c_green needs BD.Open.On and BR.Sensor.Applied and BR.Actuator.Apply; + requirement VTL4.Actuator.c_green needs BD.Open.On and BR.Sensor.Applied and BR.Actuator.Apply; + requirement VTL5.Actuator.c_green needs BD.Open.On and BR.Sensor.Applied and BR.Actuator.Apply; + requirement VTL6.Actuator.c_green needs BD.Open.On and BR.Sensor.Applied and BR.Actuator.Apply; + requirement VTL7.Actuator.c_green needs BD.Open.On and BR.Sensor.Applied and BR.Actuator.Apply; + requirement VTL8.Actuator.c_green needs BD.Open.On and BR.Sensor.Applied and BR.Actuator.Apply; + end + + group SR6A: // VTL 1-2 and VTL 3-4. + requirement VTL3.Actuator.c_green needs (VTL1.RedAspect or VTL2.RedAspect) and (not VTL1.RedStaysOff or not VTL2.RedStaysOff); + requirement VTL4.Actuator.c_green needs (VTL1.RedAspect or VTL2.RedAspect) and (not VTL1.RedStaysOff or not VTL2.RedStaysOff); + + requirement VTL3.Actuator.c_redGreen needs not VTL1.RedGreenAspect and not VTL2.RedGreenAspect; + requirement VTL4.Actuator.c_redGreen needs not VTL1.RedGreenAspect and not VTL2.RedGreenAspect; + end + + group SR6B: // VTL 3-4 and VTL 1-2. + requirement VTL1.Actuator.c_green needs (VTL3.RedAspect or VTL4.RedAspect) and (not VTL3.RedStaysOff or not VTL4.RedStaysOff); + requirement VTL2.Actuator.c_green needs (VTL3.RedAspect or VTL4.RedAspect) and (not VTL3.RedStaysOff or not VTL4.RedStaysOff); + + requirement VTL1.Actuator.c_redGreen needs not VTL3.RedGreenAspect and not VTL4.RedGreenAspect; + requirement VTL2.Actuator.c_redGreen needs not VTL3.RedGreenAspect and not VTL4.RedGreenAspect; + end + + group SR6C: // VTL 5-6 and VTL 7-8. + requirement VTL7.Actuator.c_green needs (VTL5.RedAspect or VTL6.RedAspect) and (not VTL5.RedStaysOff or not VTL6.RedStaysOff); + requirement VTL8.Actuator.c_green needs (VTL5.RedAspect or VTL6.RedAspect) and (not VTL5.RedStaysOff or not VTL6.RedStaysOff); + + requirement VTL7.Actuator.c_redGreen needs not VTL5.RedGreenAspect and not VTL6.RedGreenAspect; + requirement VTL8.Actuator.c_redGreen needs not VTL5.RedGreenAspect and not VTL6.RedGreenAspect; + end + + group SR6D: // VTL 7-8 and VTL 5-6. + requirement VTL5.Actuator.c_green needs (VTL7.RedAspect or VTL8.RedAspect) and (not VTL7.RedStaysOff or not VTL8.RedStaysOff); + requirement VTL6.Actuator.c_green needs (VTL7.RedAspect or VTL8.RedAspect) and (not VTL7.RedStaysOff or not VTL8.RedStaysOff); + + requirement VTL5.Actuator.c_redGreen needs not VTL7.RedGreenAspect and not VTL8.RedGreenAspect; + requirement VTL6.Actuator.c_redGreen needs not VTL7.RedGreenAspect and not VTL8.RedGreenAspect; + end + + group SR7: // Vessel traffic lights and bridge. + alg bool redLampShown = (VTL1.Red.On or VTL2.Red.On ) and (not VTL1.RedStaysOff or not VTL2.RedStaysOff) and + (VTL3.Red.On or VTL4.Red.On ) and (not VTL3.RedStaysOff or not VTL4.RedStaysOff) and + (VTL5.Red.On or VTL6.Red.On ) and (not VTL5.RedStaysOff or not VTL6.RedStaysOff) and + (VTL7.Red.On or VTL8.Red.On ) and (not VTL7.RedStaysOff or not VTL8.RedStaysOff); + alg bool RedAspectShown = (VTL1.RedAspect or VTL2.RedAspect) and (not VTL1.RedStaysOff or not VTL2.RedStaysOff) and + (VTL3.RedAspect or VTL4.RedAspect) and (not VTL3.RedStaysOff or not VTL4.RedStaysOff) and + (VTL5.RedAspect or VTL6.RedAspect) and (not VTL5.RedStaysOff or not VTL6.RedStaysOff) and + (VTL7.RedAspect or VTL8.RedAspect) and (not VTL7.RedStaysOff or not VTL8.RedStaysOff); + + + requirement BD.Motor.c_on needs RedAspectShown or OverrideSwitch.On; + requirement BR.Actuator.c_release needs redLampShown or OverrideSwitch.On; + requirement LM.Pump.c_on needs redLampShown or OverrideSwitch.On; + requirement LM.Valve.c_lock needs redLampShown or OverrideSwitch.On; + requirement LM.Valve.c_unlock needs redLampShown or OverrideSwitch.On; + requirement BD.Direction.c_open needs redLampShown or OverrideSwitch.On; + requirement BD.Direction.c_close needs redLampShown or OverrideSwitch.On; + end + + group SR8: // Bridge and boom barriers. + requirement BB1.Actuator.c_open needs BD.Closed2.On and LM.Locked.On; + requirement BB2.Actuator.c_open needs BD.Closed2.On and LM.Locked.On; + end + + group SR10: // Boom barriers and stop signs. + requirement StopSigns.Actuator.c_off needs BB1.Open.On and BB2.Open.On and BBsOpenTimer.Finished; + requirement BB.L.c_off needs BB1.Open.On and BB2.Open.On and BBsOpenTimer.Finished; + end + + group SR11: // Undesired movements and stop signs. + requirement StopSigns.Actuator.c_emrgOn needs BB1.UndesiredClosed or BB2.UndesiredClosed or BD.UndesiredOpen or LM.UndesiredUnlock; + requirement BB.L.c_emrgOn needs BB1.UndesiredClosed or BB2.UndesiredClosed or BD.UndesiredOpen or LM.UndesiredUnlock; + + requirement StopSigns.Actuator.c_off needs not BB1.UndesiredClosed and not BB2.UndesiredClosed and not BD.UndesiredOpen and not LM.UndesiredUnlock; + requirement BB.L.c_off needs not BB1.UndesiredClosed and not BB2.UndesiredClosed and not BD.UndesiredOpen and not LM.UndesiredUnlock; + end + + group SR13a: // Dangerous vessel traffic light aspects 1. + requirement VTL1.Activated.c_off needs VTL1.RedStaysOff; + requirement VTL1.Activated.c_on needs not VTL1.RedStaysOff; + end + + group SR13b: // Dangerous vessel traffic light aspects 2. + requirement VTL2.Activated.c_off needs VTL2.RedStaysOff; + requirement VTL2.Activated.c_on needs not VTL2.RedStaysOff; + end + + group SR13c: // Dangerous vessel traffic light aspects 3. + requirement VTL3.Activated.c_off needs VTL3.RedStaysOff; + requirement VTL3.Activated.c_on needs not VTL3.RedStaysOff; + end + + group SR13d: // Dangerous vessel traffic light aspects 4. + requirement VTL4.Activated.c_off needs VTL4.RedStaysOff; + requirement VTL4.Activated.c_on needs not VTL4.RedStaysOff; + end + + group SR13e: // Dangerous vessel traffic light aspects 5. + requirement VTL5.Activated.c_off needs VTL5.RedStaysOff; + requirement VTL5.Activated.c_on needs not VTL5.RedStaysOff; + end + + group SR13f: // Dangerous vessel traffic light aspects 6. + requirement VTL6.Activated.c_off needs VTL6.RedStaysOff; + requirement VTL6.Activated.c_on needs not VTL6.RedStaysOff; + end + + group SR13g: // Dangerous vessel traffic light aspects 7. + requirement VTL7.Activated.c_off needs VTL7.RedStaysOff; + requirement VTL7.Activated.c_on needs not VTL7.RedStaysOff; + end + + group SR13h: // Dangerous vessel traffic light aspects 8. + requirement VTL8.Activated.c_off needs VTL8.RedStaysOff; + requirement VTL8.Activated.c_on needs not VTL8.RedStaysOff; + end +end + +// Functional requirements. +group FunctionalRequirements: + // Don't close when already closed. + requirement BB1.Actuator.c_close needs BB1.NotClosed.On; + requirement BB2.Actuator.c_close needs BB2.NotClosed.On; + + // Don't close when stuck. + requirement BB1.Actuator.c_close needs not BB1.Stuck; + requirement BB2.Actuator.c_close needs not BB2.Stuck; + + // Don't open when open. + requirement BB1.Actuator.c_open needs BB1.NotOpen.On; + requirement BB2.Actuator.c_open needs BB2.NotOpen.On; + + // Don't open when stuck. + requirement BB1.Actuator.c_open needs not BB1.Stuck; + requirement BB2.Actuator.c_open needs not BB2.Stuck; + + // Stop when: + // - Closed for 300 ms, or + // - Open for 600 ms, or + // - Stuck. + requirement BB1.Actuator.c_stop needs + (BB1.Actuator.Closing and BB1ClosedTimer.Finished and BB1.NotClosed.Off) or + (BB1.Actuator.Opening and BB1OpenTimer.Finished and BB1.NotOpen.Off) or + BB1.Stuck; + requirement BB2.Actuator.c_stop needs + (BB2.Actuator.Closing and BB2ClosedTimer.Finished and BB2.NotClosed.Off) or + (BB2.Actuator.Opening and BB2OpenTimer.Finished and BB2.NotOpen.Off) or + BB2.Stuck; + + // Brake may be released when: + // - The release brake signal is switched on. + requirement BR.Actuator.c_release needs BR.Release.On; + + // Brake may be applied when: + // - The release brake signal is switched off. + requirement BR.Actuator.c_apply needs BR.Release.Off; + + // Locking mechanism may unlock when: + // - Not unlocked. + // - Motor is idle. + requirement LM.Valve.c_unlock needs + not LM.Unlocked.On and + BD.Direction.Idle; + + // Locking mechanism may lock when: + // - Not locked. + // - Bridge is closed (2x). + // - Brake is applied. + // - Motor is idle. + requirement LM.Valve.c_lock needs + not LM.Locked.On and + BD.Closed.On and + BD.Closed2.On and + BR.Sensor.Applied and + BD.Direction.Idle; + + // Locking mechanism may stop when: + // - Unlocked for 100 ms, or + // - Locked for 500 ms. + requirement LM.Valve.c_stop needs + (LM.Valve.Unlock and LMUnlockedTimer100.Finished and LM.Unlocked.On) or + (LM.Valve.Lock and LMLockedTimer.Finished and LM.Locked.On); + + // Pump may start when: + // - Valve is not idle. + requirement LM.Pump.c_on needs + not LM.Valve.Idle; + + // Pump may stop when: + // - Valve is idle. + requirement LM.Pump.c_off needs + LM.Valve.Idle; + + // Motor may switch off when: + // - Not both barriers are closed, or + // - More than two red lamps are off (when the override switch is not present). + requirement BD.Motor.c_off needs + not (BB1.Closed.On and BB2.Closed.On) or + (not SafetyRequirements.SR7.redLampShown and not OverrideSwitch.On); + + // Bridge may open when: + // - Not open. + // - Unlocked for 3 s. + requirement BD.Direction.c_open needs + not BD.Open.On and + LMUnlockedTimer3.Finished and + LM.Unlocked.On; + + // Bridge may close when: + // - Not closed. + // - Unlocked. + requirement BD.Direction.c_close needs + not BD.Closed.On and + LM.Unlocked.On; + + // The bridge may stop when: + // - Open, or + // - Closed for 3s. + requirement BD.Direction.c_stop needs + (BD.Open.On and BD.Direction.Opening) or + (BD.Closed.On and BDClosedTimer.Finished and BD.Direction.Closing); + + // Speed may go to fast when: + // - Opening and not BBOpen, BOpen, or Open, or + // - Closing and not BBClosed, BClosed, or Closed. + requirement BD.Speed.c_fast needs + BD.Direction.Opening and BD.Open.Off and BD.BOpen.Off and BD.BBOpen.Off or + BD.Direction.Closing and BD.Closed.Off and BD.BClosed.Off and BD.BBClosed.Off; + + // Speed may got to slow when: + // - Fast is not allowed. + // - Opening and not open. + // - Closing and not closed. + requirement BD.Speed.c_slow needs + not(BD.Direction.Opening and BD.Open.Off and BD.BOpen.Off and BD.BBOpen.Off or + BD.Direction.Closing and BD.Closed.Off and BD.BClosed.Off and BD.BBClosed.Off); + requirement BD.Speed.c_slow needs + BD.Direction.Opening and BD.Open.Off or + BD.Direction.Closing and BD.Closed.Off; + + // Speed may go to idle when: + // - Direction is idle. + requirement BD.Speed.c_stop needs + BD.Direction.Idle; +end + +// GUI. +group GUI: + // Emergency stop. + group EmergencyStops: + requirement BB1.Actuator.c_emrgStop needs emergency or BridgeCommands.StopBB; + requirement BB2.Actuator.c_emrgStop needs emergency or BridgeCommands.StopBB; + requirement BR.Actuator.c_emrgStop needs emergency or BridgeCommands.StopB; + requirement LM.Valve.c_emrgStop needs emergency or BridgeCommands.StopB; + requirement LM.Pump.c_emrgStop needs emergency or BridgeCommands.StopB; + requirement BD.Motor.c_emrgStop needs emergency or BridgeCommands.StopB; + requirement BD.Direction.c_emrgStop needs emergency or BridgeCommands.StopB; + requirement BD.Speed.c_emrgStop needs emergency or BridgeCommands.StopB; + + requirement BB1.Actuator.c_open needs not emergency; + requirement BB1.Actuator.c_close needs not emergency; + requirement BB2.Actuator.c_open needs not emergency; + requirement BB2.Actuator.c_close needs not emergency; + requirement BR.Actuator.c_release needs not emergency; + requirement LM.Valve.c_unlock needs not emergency; + requirement LM.Valve.c_lock needs not emergency; + requirement LM.Pump.c_on needs not emergency; + requirement BD.Direction.c_open needs not emergency; + requirement BD.Direction.c_close needs not emergency; + requirement BD.Speed.c_fast needs not emergency; + requirement BD.Speed.c_slow needs not emergency; + requirement BD.Motor.c_on needs not emergency; + + requirement BR.Actuator.c_release needs not BridgeCommands.StopB; + requirement BD.Motor.c_on needs not BridgeCommands.StopB; + requirement LM.Pump.c_on needs not BridgeCommands.StopB; + requirement BD.Speed.c_fast needs not BridgeCommands.StopB; + requirement BD.Speed.c_slow needs not BridgeCommands.StopB; + end + + // Land traffic close. + requirement StopSigns.Actuator.c_on needs BridgeCommands.CloseLT; + requirement BB.L.c_on needs BridgeCommands.CloseLT; + + // Barriers close. + requirement BB1.Actuator.c_close needs BridgeCommands.CloseBB; + requirement BB2.Actuator.c_close needs BridgeCommands.CloseBB; + + // Bridge open. + requirement BD.Direction.c_open needs BridgeCommands.OpenB; + requirement LM.Valve.c_unlock needs BridgeCommands.OpenB; + + // Bridge close. + requirement BD.Direction.c_close needs BridgeCommands.CloseB; + requirement LM.Valve.c_lock needs BridgeCommands.CloseB; + + // Barriers open. + requirement BB1.Actuator.c_open needs BridgeCommands.OpenBB; + requirement BB2.Actuator.c_open needs BridgeCommands.OpenBB; + + // Land traffic open. + requirement StopSigns.Actuator.c_off needs BridgeCommands.OpenLT or BridgeCommands.L10; + requirement BB.L.c_off needs BridgeCommands.OpenLT or BridgeCommands.L10; + + // Vessel traffic lights. + group def GUI_VTL(VTLCommands Button; controllable c_red, c_redGreen, c_redRed, c_green, c_emrgStop): + requirement c_red needs Button.Red; + requirement c_redRed needs Button.RedRed; + requirement c_redGreen needs Button.RedGreen and not emergency; + requirement c_green needs Button.Green and not emergency; + requirement c_emrgStop needs emergency; + end + + GUI_VTL1: GUI_VTL(CommandVTL12, VTL1.Actuator.c_red, VTL1.Actuator.c_redGreen, VTL1.Actuator.c_redRed, VTL1.Actuator.c_green, VTL1.Actuator.c_emrg); + GUI_VTL2: GUI_VTL(CommandVTL12, VTL2.Actuator.c_red, VTL2.Actuator.c_redGreen, VTL2.Actuator.c_redRed, VTL2.Actuator.c_green, VTL2.Actuator.c_emrg); + GUI_VTL3: GUI_VTL(CommandVTL34, VTL3.Actuator.c_red, VTL3.Actuator.c_redGreen, VTL3.Actuator.c_redRed, VTL3.Actuator.c_green, VTL3.Actuator.c_emrg); + GUI_VTL4: GUI_VTL(CommandVTL34, VTL4.Actuator.c_red, VTL4.Actuator.c_redGreen, VTL4.Actuator.c_redRed, VTL4.Actuator.c_green, VTL4.Actuator.c_emrg); + GUI_VTL5: GUI_VTL(CommandVTL56, VTL5.Actuator.c_red, VTL5.Actuator.c_redGreen, VTL5.Actuator.c_redRed, VTL5.Actuator.c_green, VTL5.Actuator.c_emrg); + GUI_VTL6: GUI_VTL(CommandVTL56, VTL6.Actuator.c_red, VTL6.Actuator.c_redGreen, VTL6.Actuator.c_redRed, VTL6.Actuator.c_green, VTL6.Actuator.c_emrg); + GUI_VTL7: GUI_VTL(CommandVTL78, VTL7.Actuator.c_red, VTL7.Actuator.c_redGreen, VTL7.Actuator.c_redRed, VTL7.Actuator.c_green, VTL7.Actuator.c_emrg); + GUI_VTL8: GUI_VTL(CommandVTL78, VTL8.Actuator.c_red, VTL8.Actuator.c_redGreen, VTL8.Actuator.c_redRed, VTL8.Actuator.c_green, VTL8.Actuator.c_emrg); +end diff --git a/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/synthesis/plant_templates.cif b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/synthesis/plant_templates.cif new file mode 100644 index 0000000000000000000000000000000000000000..2fca18cbc93da986e90b226e756b36d1ffd3ff24 --- /dev/null +++ b/cif/org.eclipse.escet.cif.examples/examples/synthesis/bridge/synthesis/plant_templates.cif @@ -0,0 +1,56 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +// Timer. +plant def Timer(alg bool startCondition): + controllable c_start, c_stop; + uncontrollable u_timeout; + + location Off: + marked; initial; + edge c_start when startCondition goto Running; + + location Running: + edge c_stop when not startCondition goto Off; + edge u_timeout goto Finished; + + location Finished: + marked; + edge c_stop when not startCondition goto Off; +end + +// Vessel traffic light commands. +plant def VTLCommands(alg bool greenOk, redGreenOk, allRed, emrgStop; + uncontrollable u_auto_green1, u_auto_green2, u_redRed, u_r2Off + ): + monitor u_red, u_green, u_redRed, u_auto_green1, u_auto_green2; + uncontrollable u_red, u_green, u_emerg; + + location RedRed: + edge u_r2Off goto Red; + + location Red: + initial; marked; + edge u_green when redGreenOk goto RedGreen; + edge u_redRed when allRed goto RedRed; + + location RedGreen: + edge u_red goto Red; + edge u_emerg when emrgStop goto Red; + edge u_green when greenOk goto Green; + edge u_auto_green1, u_auto_green2 when greenOk goto Green; + + location Green: + edge u_red goto Red; + edge u_emerg when emrgStop goto Red; +end diff --git a/cif/org.eclipse.escet.cif.tests/META-INF/MANIFEST.MF b/cif/org.eclipse.escet.cif.tests/META-INF/MANIFEST.MF index 16aa4e08b8bf224f99feb8b2c8c969e70f5fd6ad..b3d5d38fd00d12a11d942c776540ce9a81a7493d 100644 --- a/cif/org.eclipse.escet.cif.tests/META-INF/MANIFEST.MF +++ b/cif/org.eclipse.escet.cif.tests/META-INF/MANIFEST.MF @@ -26,6 +26,14 @@ Require-Bundle: org.junit;bundle-version="4.12.0", org.eclipse.escet.cif.simulator;bundle-version="0.7.0", org.eclipse.escet.cif.cif2cif.app;bundle-version="0.7.0", org.eclipse.escet.common.java;bundle-version="0.7.0", - org.eclipse.escet.cif.controllercheck;bundle-version="0.2.0" + org.eclipse.escet.cif.controllercheck;bundle-version="0.7.0", + org.eclipse.escet.cif.io;bundle-version="0.7.0", + org.eclipse.escet.cif.metamodel;bundle-version="0.7.0", + org.eclipse.escet.setext.runtime;bundle-version="0.7.0", + org.eclipse.escet.cif.parser;bundle-version="0.7.0", + org.eclipse.escet.common.typechecker;bundle-version="0.7.0", + org.eclipse.escet.cif.common;bundle-version="0.7.0", + org.eclipse.escet.cif.metamodel.java;bundle-version="0.7.0", + org.apache.commons.lang3;bundle-version="3.1.0" Export-Package: org.eclipse.escet.cif.tests Automatic-Module-Name: org.eclipse.escet.cif.tests diff --git a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/CifTest.java b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/CifTest.java index be3dbe260c291a65ded3ba20f87aa9a0ad80129a..4ef7a143d7b7ce0dc2437d1af685a10fb5281493 100644 --- a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/CifTest.java +++ b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/CifTest.java @@ -24,6 +24,12 @@ public class CifTest extends ToolDefBasedPluginUnitTest { test("tests/test_tchecker.tooldef"); } + /** Common checks tests. */ + @Test + public void testCommonChecks() { + test("tests/test_common_checks.tooldef"); + } + /** Pretty print and elimination of component definition/instantiation tests. */ @Test public void testPprintElimCdef() { diff --git a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/CifCommonChecksTestApp.java b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/CifCommonChecksTestApp.java new file mode 100644 index 0000000000000000000000000000000000000000..f38c25b518f7b145ecaf9823c16433cd44010e43 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/CifCommonChecksTestApp.java @@ -0,0 +1,166 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2010, 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.tests.common.checkers; + +import static org.eclipse.escet.common.java.Lists.list; + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.escet.cif.common.CifPreconditionChecker; +import org.eclipse.escet.cif.common.checkers.CifCheck; +import org.eclipse.escet.cif.io.CifReader; +import org.eclipse.escet.cif.metamodel.cif.Specification; +import org.eclipse.escet.common.app.framework.Application; +import org.eclipse.escet.common.app.framework.io.AppStreams; +import org.eclipse.escet.common.app.framework.options.InputFileOption; +import org.eclipse.escet.common.app.framework.options.OptionCategory; +import org.eclipse.escet.common.app.framework.options.Options; +import org.eclipse.escet.common.app.framework.options.StringOption; +import org.eclipse.escet.common.app.framework.output.IOutputComponent; +import org.eclipse.escet.common.app.framework.output.OutputProvider; +import org.eclipse.escet.common.java.Assert; + +/** CIF common checks test application. */ +public class CifCommonChecksTestApp extends Application { + /** + * Constructor for the {@link CifCommonChecksTestApp} class. + * + * @param streams The streams to use for input, output, and error streams. + */ + public CifCommonChecksTestApp(AppStreams streams) { + super(streams); + } + + @Override + public String getAppName() { + return "CIF common checks tester"; + } + + @Override + public String getAppDescription() { + return "Tests common checks on CIF specification."; + } + + @Override + protected int runInternal() { + // Read CIF specification. + CifReader cifReader = new CifReader().init(); + Specification spec = cifReader.read(); + if (isTerminationRequested()) { + return 0; + } + + // Add configured check. + List checks = list(); + String simpleCheckClassName = CifCheckClassNameToTestOption.getCheckClassNameToTest(); + String[] packageNames = { // + CifCheck.class.getPackageName() + ".checks", // Common checks package. + getClass().getPackageName() // Test checks package. + }; + for (String packageName: packageNames) { + // Get class name and load the class. + String fullCheckClassName = packageName + "." + simpleCheckClassName; + Class cls; + try { + cls = getClass().getClassLoader().loadClass(fullCheckClassName); + } catch (ClassNotFoundException e) { + // Try next package. + continue; + } + + // Instantiate the check. + CifCheck check; + try { + check = (CifCheck)cls.getDeclaredConstructor().newInstance(); + } catch (ReflectiveOperationException | IllegalArgumentException | SecurityException e) { + throw new RuntimeException("Failed to instantiate class: " + fullCheckClassName); + } + + // Add the check. + checks.add(check); + } + Assert.check(!checks.isEmpty(), "Class not found in packages: " + Arrays.toString(packageNames)); + + // Perform check. + new CifPreconditionChecker(checks).reportPreconditionViolations(spec, "CIF common checks tester"); + + // All done. + return 0; + } + + @Override + protected OutputProvider getProvider() { + return new OutputProvider<>(); + } + + @Override + protected OptionCategory getAllOptions() { + OptionCategory generalOpts = getGeneralOptionCategory(); + + OptionCategory transOpts = new OptionCategory("Checks", "Check options.", list(), list( + Options.getInstance(InputFileOption.class), Options.getInstance(CifCheckClassNameToTestOption.class))); + + OptionCategory options = new OptionCategory("CIF Common Checks Tester Options", + "All options for the CIF common checks tester.", list(generalOpts, transOpts), list()); + + return options; + } + + /** CIF check class name option. */ + public static class CifCheckClassNameToTestOption extends StringOption { + /** Constructor for the {@link CifCheckClassNameToTestOption} class. */ + public CifCheckClassNameToTestOption() { + super( + // name + "Check", + + // description + "Specify the name of the check class to test.", + + // cmdShort + null, + + // cmdLong + "check-class-name", + + // cmdValue + "NAME", + + // defaultValue + null, + + // emptyAsNull + true, + + // showInDialog + false, + + // optDialogDescr + null, + + // optDialogLabelText + null); + } + + /** + * Returns the name of the check class to test. + * + * @return The name of the check class to test. + */ + public static String getCheckClassNameToTest() { + return Options.get(CifCheckClassNameToTestOption.class); + } + } +} diff --git a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificBinaryExprsCheckLevel0.java b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificBinaryExprsCheckLevel0.java new file mode 100644 index 0000000000000000000000000000000000000000..e1ffa6c8d7c9575fdef69e389ba877d95b4723fc --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificBinaryExprsCheckLevel0.java @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.tests.common.checkers; + +import java.util.Arrays; +import java.util.EnumSet; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.eclipse.escet.cif.common.checkers.checks.ExprNoSpecificBinaryExprsCheck; + +/** + * {@link ExprNoSpecificBinaryExprsCheck} with all level 0 disalloweds enabled. + * + *

+ * The different levels allow testing more logic (increased code coverage). E.g., disallowing + * {@link NoSpecificBinaryOp#GREATER_EQUAL} includes disallowing {@link NoSpecificBinaryOp#GREATER_EQUAL_INTS}, meaning + * that if the former is disallowed, the latter is not checked. The former has level 1 (one underscore in the enum + * literal name) and the latter has level 2 (two underscores in the enum literal name), so testing these disalloweds + * separately leads to increased code coverage. + *

+ */ +@SuppressWarnings("javadoc") +public class ExprNoSpecificBinaryExprsCheckLevel0 extends ExprNoSpecificBinaryExprsCheck { + /** Constructor for the {@link ExprNoSpecificBinaryExprsCheckLevel0} class. */ + public ExprNoSpecificBinaryExprsCheckLevel0() { + super(Arrays.stream(NoSpecificBinaryOp.values()).filter(v -> StringUtils.countMatches(v.name(), "_") == 0) + .collect(Collectors.toCollection(() -> EnumSet.noneOf(NoSpecificBinaryOp.class)))); + } +} diff --git a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificBinaryExprsCheckLevel1.java b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificBinaryExprsCheckLevel1.java new file mode 100644 index 0000000000000000000000000000000000000000..ec9475654802a21563a6d303d4e34093db3e7d0b --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificBinaryExprsCheckLevel1.java @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.tests.common.checkers; + +import java.util.Arrays; +import java.util.EnumSet; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.eclipse.escet.cif.common.checkers.checks.ExprNoSpecificBinaryExprsCheck; + +/** + * {@link ExprNoSpecificBinaryExprsCheck} with all level 1 disalloweds enabled. + * + *

+ * The different levels allow testing more logic (increased code coverage). E.g., disallowing + * {@link NoSpecificBinaryOp#GREATER_EQUAL} includes disallowing {@link NoSpecificBinaryOp#GREATER_EQUAL_INTS}, meaning + * that if the former is disallowed, the latter is not checked. The former has level 1 (one underscore in the enum + * literal name) and the latter has level 2 (two underscores in the enum literal name), so testing these disalloweds + * separately leads to increased code coverage. + *

+ */ +@SuppressWarnings("javadoc") +public class ExprNoSpecificBinaryExprsCheckLevel1 extends ExprNoSpecificBinaryExprsCheck { + /** Constructor for the {@link ExprNoSpecificBinaryExprsCheckLevel1} class. */ + public ExprNoSpecificBinaryExprsCheckLevel1() { + super(Arrays.stream(NoSpecificBinaryOp.values()).filter(v -> StringUtils.countMatches(v.name(), "_") == 1) + .collect(Collectors.toCollection(() -> EnumSet.noneOf(NoSpecificBinaryOp.class)))); + } +} diff --git a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificBinaryExprsCheckLevel2.java b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificBinaryExprsCheckLevel2.java new file mode 100644 index 0000000000000000000000000000000000000000..bdbae108f7a3c0b729aa2c1d8df9a9216b73b2fc --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificBinaryExprsCheckLevel2.java @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.tests.common.checkers; + +import java.util.Arrays; +import java.util.EnumSet; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.eclipse.escet.cif.common.checkers.checks.ExprNoSpecificBinaryExprsCheck; + +/** + * {@link ExprNoSpecificBinaryExprsCheck} with all level 2 disalloweds enabled. + * + *

+ * The different levels allow testing more logic (increased code coverage). E.g., disallowing + * {@link NoSpecificBinaryOp#GREATER_EQUAL} includes disallowing {@link NoSpecificBinaryOp#GREATER_EQUAL_INTS}, meaning + * that if the former is disallowed, the latter is not checked. The former has level 1 (one underscore in the enum + * literal name) and the latter has level 2 (two underscores in the enum literal name), so testing these disalloweds + * separately leads to increased code coverage. + *

+ */ +@SuppressWarnings("javadoc") +public class ExprNoSpecificBinaryExprsCheckLevel2 extends ExprNoSpecificBinaryExprsCheck { + /** Constructor for the {@link ExprNoSpecificBinaryExprsCheckLevel2} class. */ + public ExprNoSpecificBinaryExprsCheckLevel2() { + super(Arrays.stream(NoSpecificBinaryOp.values()).filter(v -> StringUtils.countMatches(v.name(), "_") == 2) + .collect(Collectors.toCollection(() -> EnumSet.noneOf(NoSpecificBinaryOp.class)))); + } +} diff --git a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificBinaryExprsCheckLevel3.java b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificBinaryExprsCheckLevel3.java new file mode 100644 index 0000000000000000000000000000000000000000..17581e9dd75991ff9f10a687dc78b051cde50cc1 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificBinaryExprsCheckLevel3.java @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.tests.common.checkers; + +import java.util.Arrays; +import java.util.EnumSet; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.eclipse.escet.cif.common.checkers.checks.ExprNoSpecificBinaryExprsCheck; + +/** + * {@link ExprNoSpecificBinaryExprsCheck} with all level 3 disalloweds enabled. * + * + *

+ * The different levels allow testing more logic (increased code coverage). E.g., disallowing + * {@link NoSpecificBinaryOp#GREATER_EQUAL} includes disallowing {@link NoSpecificBinaryOp#GREATER_EQUAL_INTS}, meaning + * that if the former is disallowed, the latter is not checked. The former has level 1 (one underscore in the enum + * literal name) and the latter has level 2 (two underscores in the enum literal name), so testing these disalloweds + * separately leads to increased code coverage. + *

+ */ +@SuppressWarnings("javadoc") +public class ExprNoSpecificBinaryExprsCheckLevel3 extends ExprNoSpecificBinaryExprsCheck { + /** Constructor for the {@link ExprNoSpecificBinaryExprsCheckLevel3} class. */ + public ExprNoSpecificBinaryExprsCheckLevel3() { + super(Arrays.stream(NoSpecificBinaryOp.values()).filter(v -> StringUtils.countMatches(v.name(), "_") == 3) + .collect(Collectors.toCollection(() -> EnumSet.noneOf(NoSpecificBinaryOp.class)))); + } +} diff --git a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificExprsCheckLevel1.java b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificExprsCheckLevel1.java new file mode 100644 index 0000000000000000000000000000000000000000..d68a5ff5556a36f6f9ebe48c59b1d263dd0d64f0 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificExprsCheckLevel1.java @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.tests.common.checkers; + +import java.util.Arrays; +import java.util.EnumSet; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.eclipse.escet.cif.common.checkers.checks.ExprNoSpecificExprsCheck; + +/** + * {@link ExprNoSpecificExprsCheck} with all level 0 + 1 disalloweds enabled. + * + *

+ * The different levels allow testing more logic (increased code coverage). E.g., disallowing + * {@link NoSpecificExpr#PROJECTION_EXPRS} includes disallowing {@link NoSpecificExpr#PROJECTION_EXPRS_LISTS}, meaning + * that if the former is disallowed, the latter is not checked. The former has level 1 (one underscore in the enum + * literal name) and the latter has level 2 (two underscores in the enum literal name), so testing these disalloweds + * separately leads to increased code coverage. + *

+ */ +@SuppressWarnings("javadoc") +public class ExprNoSpecificExprsCheckLevel1 extends ExprNoSpecificExprsCheck { + /** Constructor for the {@link ExprNoSpecificExprsCheckLevel1} class. */ + public ExprNoSpecificExprsCheckLevel1() { + super(Arrays.stream(NoSpecificExpr.values()).filter(v -> StringUtils.countMatches(v.name(), "_") <= 1) + .collect(Collectors.toCollection(() -> EnumSet.noneOf(NoSpecificExpr.class)))); + } +} diff --git a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificExprsCheckLevel2.java b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificExprsCheckLevel2.java new file mode 100644 index 0000000000000000000000000000000000000000..0212286f6a59a92519729ea5593423d9eb817e44 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificExprsCheckLevel2.java @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.tests.common.checkers; + +import java.util.Arrays; +import java.util.EnumSet; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.eclipse.escet.cif.common.checkers.checks.ExprNoSpecificExprsCheck; + +/** + * {@link ExprNoSpecificExprsCheck} with all level 2 disalloweds enabled. + * + *

+ * The different levels allow testing more logic (increased code coverage). E.g., disallowing + * {@link NoSpecificExpr#PROJECTION_EXPRS} includes disallowing {@link NoSpecificExpr#PROJECTION_EXPRS_LISTS}, meaning + * that if the former is disallowed, the latter is not checked. The former has level 1 (one underscore in the enum + * literal name) and the latter has level 2 (two underscores in the enum literal name), so testing these disalloweds + * separately leads to increased code coverage. + *

+ */ +@SuppressWarnings("javadoc") +public class ExprNoSpecificExprsCheckLevel2 extends ExprNoSpecificExprsCheck { + /** Constructor for the {@link ExprNoSpecificExprsCheckLevel2} class. */ + public ExprNoSpecificExprsCheckLevel2() { + super(Arrays.stream(NoSpecificExpr.values()).filter(v -> StringUtils.countMatches(v.name(), "_") == 2) + .collect(Collectors.toCollection(() -> EnumSet.noneOf(NoSpecificExpr.class)))); + } +} diff --git a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificExprsCheckLevel3.java b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificExprsCheckLevel3.java new file mode 100644 index 0000000000000000000000000000000000000000..da993c16ac54b052514ed55efd7908fbe24dbe74 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificExprsCheckLevel3.java @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.tests.common.checkers; + +import java.util.Arrays; +import java.util.EnumSet; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.eclipse.escet.cif.common.checkers.checks.ExprNoSpecificExprsCheck; + +/** + * {@link ExprNoSpecificExprsCheck} with all level 3 disalloweds enabled. + * + *

+ * The different levels allow testing more logic (increased code coverage). E.g., disallowing + * {@link NoSpecificExpr#PROJECTION_EXPRS} includes disallowing {@link NoSpecificExpr#PROJECTION_EXPRS_LISTS}, meaning + * that if the former is disallowed, the latter is not checked. The former has level 1 (one underscore in the enum + * literal name) and the latter has level 2 (two underscores in the enum literal name), so testing these disalloweds + * separately leads to increased code coverage. + *

+ */ +@SuppressWarnings("javadoc") +public class ExprNoSpecificExprsCheckLevel3 extends ExprNoSpecificExprsCheck { + /** Constructor for the {@link ExprNoSpecificExprsCheckLevel3} class. */ + public ExprNoSpecificExprsCheckLevel3() { + super(Arrays.stream(NoSpecificExpr.values()).filter(v -> StringUtils.countMatches(v.name(), "_") == 3) + .collect(Collectors.toCollection(() -> EnumSet.noneOf(NoSpecificExpr.class)))); + } +} diff --git a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificExprsCheckLevel4.java b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificExprsCheckLevel4.java new file mode 100644 index 0000000000000000000000000000000000000000..84bef36da03b396a05682063e0a5677692bd9c2d --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificExprsCheckLevel4.java @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.tests.common.checkers; + +import java.util.Arrays; +import java.util.EnumSet; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.eclipse.escet.cif.common.checkers.checks.ExprNoSpecificExprsCheck; + +/** + * {@link ExprNoSpecificExprsCheck} with all level 4 and higher disalloweds enabled. + * + *

+ * The different levels allow testing more logic (increased code coverage). E.g., disallowing + * {@link NoSpecificExpr#PROJECTION_EXPRS} includes disallowing {@link NoSpecificExpr#PROJECTION_EXPRS_LISTS}, meaning + * that if the former is disallowed, the latter is not checked. The former has level 1 (one underscore in the enum + * literal name) and the latter has level 2 (two underscores in the enum literal name), so testing these disalloweds + * separately leads to increased code coverage. + *

+ */ +@SuppressWarnings("javadoc") +public class ExprNoSpecificExprsCheckLevel4 extends ExprNoSpecificExprsCheck { + /** Constructor for the {@link ExprNoSpecificExprsCheckLevel4} class. */ + public ExprNoSpecificExprsCheckLevel4() { + super(Arrays.stream(NoSpecificExpr.values()).filter(v -> StringUtils.countMatches(v.name(), "_") >= 4) + .collect(Collectors.toCollection(() -> EnumSet.noneOf(NoSpecificExpr.class)))); + } +} diff --git a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificUnaryExprsCheckLevel0.java b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificUnaryExprsCheckLevel0.java new file mode 100644 index 0000000000000000000000000000000000000000..6bc032ceec5ea009feb3d18acb902ac511d976f6 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificUnaryExprsCheckLevel0.java @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.tests.common.checkers; + +import java.util.Arrays; +import java.util.EnumSet; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.eclipse.escet.cif.common.checkers.checks.ExprNoSpecificUnaryExprsCheck; + +/** + * {@link ExprNoSpecificUnaryExprsCheck} with all level 0 disalloweds enabled. + * + *

+ * The different levels allow testing more logic (increased code coverage). E.g., disallowing + * {@link NoSpecificUnaryOp#PLUS} includes disallowing {@link NoSpecificUnaryOp#PLUS_INTS}, meaning that if the former + * is disallowed, the latter is not checked. The former has level 0 (zero underscores in the enum literal name) and the + * latter has level 1 (one underscore in the enum literal name), so testing these disalloweds separately leads to + * increased code coverage. + *

+ */ +@SuppressWarnings("javadoc") +public class ExprNoSpecificUnaryExprsCheckLevel0 extends ExprNoSpecificUnaryExprsCheck { + /** Constructor for the {@link ExprNoSpecificUnaryExprsCheckLevel0} class. */ + public ExprNoSpecificUnaryExprsCheckLevel0() { + super(Arrays.stream(NoSpecificUnaryOp.values()).filter(v -> StringUtils.countMatches(v.name(), "_") == 0) + .collect(Collectors.toCollection(() -> EnumSet.noneOf(NoSpecificUnaryOp.class)))); + } +} diff --git a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificUnaryExprsCheckLevel1.java b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificUnaryExprsCheckLevel1.java new file mode 100644 index 0000000000000000000000000000000000000000..f1b0807453e375a409e7198b83232c8f084c01e0 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificUnaryExprsCheckLevel1.java @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.tests.common.checkers; + +import java.util.Arrays; +import java.util.EnumSet; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.eclipse.escet.cif.common.checkers.checks.ExprNoSpecificUnaryExprsCheck; + +/** + * {@link ExprNoSpecificUnaryExprsCheck} with all level 1 disalloweds enabled. + * + *

+ * The different levels allow testing more logic (increased code coverage). E.g., disallowing + * {@link NoSpecificUnaryOp#PLUS} includes disallowing {@link NoSpecificUnaryOp#PLUS_INTS}, meaning that if the former + * is disallowed, the latter is not checked. The former has level 0 (zero underscores in the enum literal name) and the + * latter has level 1 (one underscore in the enum literal name), so testing these disalloweds separately leads to + * increased code coverage. + *

+ */ +@SuppressWarnings("javadoc") +public class ExprNoSpecificUnaryExprsCheckLevel1 extends ExprNoSpecificUnaryExprsCheck { + /** Constructor for the {@link ExprNoSpecificUnaryExprsCheckLevel1} class. */ + public ExprNoSpecificUnaryExprsCheckLevel1() { + super(Arrays.stream(NoSpecificUnaryOp.values()).filter(v -> StringUtils.countMatches(v.name(), "_") == 1) + .collect(Collectors.toCollection(() -> EnumSet.noneOf(NoSpecificUnaryOp.class)))); + } +} diff --git a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificUnaryExprsCheckLevel2.java b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificUnaryExprsCheckLevel2.java new file mode 100644 index 0000000000000000000000000000000000000000..f20457baf586d74e1e0790ac3365ef49143b7002 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/ExprNoSpecificUnaryExprsCheckLevel2.java @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.tests.common.checkers; + +import java.util.Arrays; +import java.util.EnumSet; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.eclipse.escet.cif.common.checkers.checks.ExprNoSpecificUnaryExprsCheck; + +/** + * {@link ExprNoSpecificUnaryExprsCheck} with all level 2 and higher disalloweds enabled. + * + *

+ * The different levels allow testing more logic (increased code coverage). E.g., disallowing + * {@link NoSpecificUnaryOp#PLUS} includes disallowing {@link NoSpecificUnaryOp#PLUS_INTS}, meaning that if the former + * is disallowed, the latter is not checked. The former has level 0 (zero underscores in the enum literal name) and the + * latter has level 1 (one underscore in the enum literal name), so testing these disalloweds separately leads to + * increased code coverage. + *

+ */ +@SuppressWarnings("javadoc") +public class ExprNoSpecificUnaryExprsCheckLevel2 extends ExprNoSpecificUnaryExprsCheck { + /** Constructor for the {@link ExprNoSpecificUnaryExprsCheckLevel2} class. */ + public ExprNoSpecificUnaryExprsCheckLevel2() { + super(Arrays.stream(NoSpecificUnaryOp.values()).filter(v -> StringUtils.countMatches(v.name(), "_") >= 2) + .collect(Collectors.toCollection(() -> EnumSet.noneOf(NoSpecificUnaryOp.class)))); + } +} diff --git a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/TypeNoSpecificTypesCheckLevel1.java b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/TypeNoSpecificTypesCheckLevel1.java new file mode 100644 index 0000000000000000000000000000000000000000..fd5892948187d84be92e9098c56070c98f578280 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/TypeNoSpecificTypesCheckLevel1.java @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.tests.common.checkers; + +import java.util.Arrays; +import java.util.EnumSet; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.eclipse.escet.cif.common.checkers.checks.TypeNoSpecificTypesCheck; + +/** + * {@link TypeNoSpecificTypesCheck} with all level 0 + 1 disalloweds enabled. + * + *

+ * The different levels allow testing more logic (increased code coverage). E.g., disallowing + * {@link NoSpecificType#INT_TYPES} includes disallowing {@link NoSpecificType#INT_TYPES_RANGELESS}, meaning that if the + * former is disallowed, the latter is not checked. The former has level 1 (one underscore in the enum literal name) and + * the latter has level 2 (two underscores in the enum literal name), so testing these disalloweds separately leads to + * increased code coverage. + *

+ */ +@SuppressWarnings("javadoc") +public class TypeNoSpecificTypesCheckLevel1 extends TypeNoSpecificTypesCheck { + /** Constructor for the {@link TypeNoSpecificTypesCheckLevel1} class. */ + public TypeNoSpecificTypesCheckLevel1() { + super(Arrays.stream(NoSpecificType.values()).filter(v -> StringUtils.countMatches(v.name(), "_") <= 1) + .collect(Collectors.toCollection(() -> EnumSet.noneOf(NoSpecificType.class)))); + } +} diff --git a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/TypeNoSpecificTypesCheckLevel2.java b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/TypeNoSpecificTypesCheckLevel2.java new file mode 100644 index 0000000000000000000000000000000000000000..951ad986ecb15e908e8dcd768da54d5eaa801d4e --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/TypeNoSpecificTypesCheckLevel2.java @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.tests.common.checkers; + +import java.util.Arrays; +import java.util.EnumSet; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.eclipse.escet.cif.common.checkers.checks.TypeNoSpecificTypesCheck; + +/** + * {@link TypeNoSpecificTypesCheck} with all level 2 disalloweds enabled. + * + *

+ * The different levels allow testing more logic (increased code coverage). E.g., disallowing + * {@link NoSpecificType#INT_TYPES} includes disallowing {@link NoSpecificType#INT_TYPES_RANGELESS}, meaning that if the + * former is disallowed, the latter is not checked. The former has level 1 (one underscore in the enum literal name) and + * the latter has level 2 (two underscores in the enum literal name), so testing these disalloweds separately leads to + * increased code coverage. + *

+ */ +@SuppressWarnings("javadoc") +public class TypeNoSpecificTypesCheckLevel2 extends TypeNoSpecificTypesCheck { + /** Constructor for the {@link TypeNoSpecificTypesCheckLevel2} class. */ + public TypeNoSpecificTypesCheckLevel2() { + super(Arrays.stream(NoSpecificType.values()).filter(v -> StringUtils.countMatches(v.name(), "_") == 2) + .collect(Collectors.toCollection(() -> EnumSet.noneOf(NoSpecificType.class)))); + } +} diff --git a/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/TypeNoSpecificTypesCheckLevel3.java b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/TypeNoSpecificTypesCheckLevel3.java new file mode 100644 index 0000000000000000000000000000000000000000..15261d09cfa72711bba421bb22cc38b8d65d750d --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/src-test/org/eclipse/escet/cif/tests/common/checkers/TypeNoSpecificTypesCheckLevel3.java @@ -0,0 +1,41 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +package org.eclipse.escet.cif.tests.common.checkers; + +import java.util.Arrays; +import java.util.EnumSet; +import java.util.stream.Collectors; + +import org.apache.commons.lang3.StringUtils; +import org.eclipse.escet.cif.common.checkers.checks.TypeNoSpecificTypesCheck; + +/** + * {@link TypeNoSpecificTypesCheck} with all level 3 and higher disalloweds enabled. + * + *

+ * The different levels allow testing more logic (increased code coverage). E.g., disallowing + * {@link NoSpecificType#INT_TYPES} includes disallowing {@link NoSpecificType#INT_TYPES_RANGELESS}, meaning that if the + * former is disallowed, the latter is not checked. The former has level 1 (one underscore in the enum literal name) and + * the latter has level 2 (two underscores in the enum literal name), so testing these disalloweds separately leads to + * increased code coverage. + *

+ */ +@SuppressWarnings("javadoc") +public class TypeNoSpecificTypesCheckLevel3 extends TypeNoSpecificTypesCheck { + /** Constructor for the {@link TypeNoSpecificTypesCheckLevel3} class. */ + public TypeNoSpecificTypesCheckLevel3() { + super(Arrays.stream(NoSpecificType.values()).filter(v -> StringUtils.countMatches(v.name(), "_") >= 3) + .collect(Collectors.toCollection(() -> EnumSet.noneOf(NoSpecificType.class)))); + } +} diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2supremica/invalid1.cif b/cif/org.eclipse.escet.cif.tests/tests/cif2supremica/invalid1.cif index f06ff01810eebecdcfd7e5ead72e715436cbd4af..ecc8d60049c51bfe46197d85dde28d8ca6ef55f8 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2supremica/invalid1.cif +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2supremica/invalid1.cif @@ -66,12 +66,12 @@ group g: initial; end - initial 1=1; // Initial in component. + initial 1 = 1; // Initialization predicate in component. - marked not false; // Marker in component: not bin expr. - marked 1 > 2; // Marked in component: not '=' bin expr. - marked 2 = 2; // Marked in component: not 'dvar = value'. - marked p0.cnt = 1.2; // Marked in component: not 'dvar = value'. + marked not false; // Marker predicate in component: not bin expr. + marked 1 > 2; // Marker predicate in component: not '=' bin expr. + marked 2 = 2; // Marker predicate in component: not 'dvar = value'. + marked p0.cnt = 1.2; // Marker predicate in component: not 'dvar = value'. marked p0.x1 = 1; // Duplicate marker predicate. marked p0.x1 = 1; // Duplicate marker predicate. @@ -91,3 +91,10 @@ group g: return p; end end + +invariant 11 = 11; // Non-requirement invariant in top level scope of specification. +initial 2 = 2; // Initialization predicate in top level scope of specification. +marked 3 > 4; // Marker predicate in top level scope of specification. +marked true; // Marker predicate in top level scope of specification. + +invariant g.e1 needs 3 = 3; // Kindless state/event exclusion invariant in top level scope of the specification. diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2supremica/invalid1.cif.cif2supremica.err b/cif/org.eclipse.escet.cif.tests/tests/cif2supremica/invalid1.cif.cif2supremica.err index 764cb6f2599f4933803b869f391cf8ed84fdd9e4..913f06f5edcb53db42cca247636927aa4352175a 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2supremica/invalid1.cif.cif2supremica.err +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2supremica/invalid1.cif.cif2supremica.err @@ -1,11 +1,11 @@ WARNING: File "cif2supremica/invalid1.cif": Semantic warning at line 31, column 9: Automaton "g.p0" has no initial location. ERROR: CIF to Supremica transformation failed due to unsatisfied preconditions: - - Unsupported "g": component contains an initialization predicate. - - Unsupported "g": component has a kindless state invariant. - - Unsupported "g": component has a kindless state/event exclusion invariant, lacking a supervisory kind. - - Unsupported "g": component has a marker predicate that is not of the form "discrete_variable = marked_value". - - Unsupported "g": component has a plant state invariant. - - Unsupported "g": component has a supervisor state invariant. + - Unsupported "g": group contains an initialization predicate. + - Unsupported "g": group has a kindless state invariant. + - Unsupported "g": group has a kindless state/event exclusion invariant, lacking a supervisory kind. + - Unsupported "g": group has a marker predicate that is not of the form "discrete_variable = marked_value". + - Unsupported "g": group has a plant state invariant. + - Unsupported "g": group has a supervisor state invariant. - Unsupported "g": uses list literal "[false, true]". - Unsupported "g": uses list literal "[false]". - Unsupported "g": uses list literal "[true]". @@ -14,8 +14,8 @@ ERROR: CIF to Supremica transformation failed due to unsatisfied preconditions: - Unsupported "g": uses list type "list[2] bool". - Unsupported "g": uses real number literal "1.2". - Unsupported "g": uses real type "real". - - Unsupported "g.a": automaton has an edge with explicitly event "tau" on it, which is not controllable or uncontrollable. - - Unsupported "g.a": automaton has an edge with implicitly event "tau" on it, which is not controllable or uncontrollable. + - Unsupported "g.a": automaton has an edge with an explicit "tau" event on it, which is not controllable or uncontrollable. + - Unsupported "g.a": automaton has an edge with an implicit "tau" event on it, which is not controllable or uncontrollable. - Unsupported "g.a": automaton is a kindless automaton, lacking a supervisory kind. - Unsupported "g.e1": event is not declared as controllable or uncontrollable. - Unsupported "g.e2": event is a channel (has a data type). @@ -35,16 +35,16 @@ ERROR: CIF to Supremica transformation failed due to unsatisfied preconditions: - Unsupported "g.p0.cnt": uses real type "real". - Unsupported "g.p0.cnt": variable is a continuous variable. - Unsupported "g.p0.inp": variable is an input variable. - - Unsupported "g.p0.lb": discrete variable has multiple predicates to specify its marked values. + - Unsupported "g.p0.lb": discrete variable has multiple predicates that specify its marked values. - Unsupported "g.p0.lb": uses list literal "[true]". - Unsupported "g.p0.lb": uses list type "list bool". - Unsupported "g.p0.lb": uses list type "list[1] bool". - Unsupported "g.p0.x1": discrete variable has multiple (2) potential initial values. - - Unsupported "g.p0.x1": discrete variable has multiple predicates to specify its marked values. + - Unsupported "g.p0.x1": discrete variable has multiple predicates that specify its marked values. - Unsupported "g.p0.x2": discrete variable has multiple potential initial values (any value in its domain). + - Unsupported "g.p1": automaton has a location with a marker predicate that cannot be evaluated statically, as the evaluation resulted in an evaluation error. - Unsupported "g.p1": automaton has a location with a state invariant. - Unsupported "g.p1": failed to determine whether the automaton's location is an initial location, as evaluating one of its initialization predicates resulted in an evaluation error. - - Unsupported "g.p1": static evaluation of a marker predicate in the location of the automaton resulted in an evaluation error. - Unsupported "g.p1": uses binary operator ">" on operands of types "real" and "int[0..0]" in binary expression "sqrt(-1.0) > 0". - Unsupported "g.p1": uses binary operator ">" on operands of types "real" and "int[0..0]" in binary expression "sqrt(-2.0) > 0". - Unsupported "g.p1": uses function call "sqrt(-1.0)". @@ -55,5 +55,9 @@ ERROR: CIF to Supremica transformation failed due to unsatisfied preconditions: - Unsupported "g.p1": uses real type "real". - Unsupported "g.p1": uses unary operator "-" on an operand of type "real" in unary expression "-1.0". - Unsupported "g.p1": uses unary operator "-" on an operand of type "real" in unary expression "-2.0". - - Unsupported "g.p2": automata has multiple (2) initial locations. + - Unsupported "g.p2": automaton has multiple (2) initial locations. - Unsupported "g.snd": automaton has an urgent edge. + - Unsupported specification: the top level scope of the specification contains an initialization predicate. + - Unsupported specification: the top level scope of the specification has a kindless state invariant. + - Unsupported specification: the top level scope of the specification has a kindless state/event exclusion invariant, lacking a supervisory kind. + - Unsupported specification: the top level scope of the specification has a marker predicate that is not of the form "discrete_variable = marked_value". diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2supremica/invalid3.cif.cif2supremica.err b/cif/org.eclipse.escet.cif.tests/tests/cif2supremica/invalid3.cif.cif2supremica.err index 861b059d3ff593e79cf029b190f91a7f1746942a..1a5a567c1c8efe82e65a4e3b2c7b8321ff4957fa 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2supremica/invalid3.cif.cif2supremica.err +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2supremica/invalid3.cif.cif2supremica.err @@ -1,3 +1,3 @@ ERROR: CIF to Supremica transformation failed due to unsatisfied preconditions: - - Unsupported "p": failed to determine whether the automaton's location is an initial location, as one of its initialization predicates can not be statically evaluated. + - Unsupported "p": failed to determine whether the automaton's location is an initial location, as one of its initialization predicates cannot be statically evaluated. - Unsupported "p.b": discrete variable has multiple potential initial values (any value in its domain). diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/all_colors.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/all_colors.model.graphml index 8a6359698759eacba0fc7e3a2e9366869134623f..5a31072992878d201b0fb5a3db891ebb2ef860ac 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/all_colors.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/all_colors.model.graphml @@ -56,7 +56,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">evt1</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">evt1;</span></html> @@ -207,14 +207,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Grp2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Grp2()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Grp2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Grp2()</span></html> @@ -229,14 +229,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Aut2</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">param2</span><span style="color:#402020;">;</span>&nbsp;<span style="color:#0000ff;">location</span>&nbsp;<span style="color:#000000;">param3</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Aut2(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">param2;</span>&nbsp;<span style="color:#0000ff;">location</span>&nbsp;<span style="color:#000000;">param3)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Aut2</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">param2</span><span style="color:#402020;">;</span>&nbsp;<span style="color:#0000ff;">location</span>&nbsp;<span style="color:#000000;">param3</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Aut2(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">param2;</span>&nbsp;<span style="color:#0000ff;">location</span>&nbsp;<span style="color:#000000;">param3)</span></html> @@ -356,7 +356,7 @@ Instantiations - <html><span style="color:#000000;">aut2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Aut2</span><span style="color:#402020;">(</span><span style="color:#000000;">grp1.aut1.evt1</span><span style="color:#402020;">,</span>&nbsp;<span style="color:#000000;">grp1.aut1.loc</span><span style="color:#402020;">);</span></html> + <html><span style="color:#000000;">aut2:</span>&nbsp;<span style="color:#000000;">Aut2(grp1.aut1.evt1,</span>&nbsp;<span style="color:#000000;">grp1.aut1.loc);</span></html> @@ -383,7 +383,7 @@ Instantiations - <html><span style="color:#000000;">grp2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Grp2</span><span style="color:#402020;">();</span></html> + <html><span style="color:#000000;">grp2:</span>&nbsp;<span style="color:#000000;">Grp2();</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/all_colors.relations.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/all_colors.relations.graphml index ff3c6d41285f668ef574a42eafa7b7be1a907f8d..a9c01005bd8c412a26194fccb9a6ba875f532625 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/all_colors.relations.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/all_colors.relations.graphml @@ -114,14 +114,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Grp2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Grp2()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Grp2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Grp2()</span></html> @@ -138,14 +138,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Aut2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Aut2()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Aut2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Aut2()</span></html> @@ -231,14 +231,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">aut2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Aut2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">aut2:</span>&nbsp;<span style="color:#000000;">Aut2()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">aut2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Aut2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">aut2:</span>&nbsp;<span style="color:#000000;">Aut2()</span></html> @@ -362,14 +362,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">grp2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Grp2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">grp2:</span>&nbsp;<span style="color:#000000;">Grp2()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">grp2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Grp2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">grp2:</span>&nbsp;<span style="color:#000000;">Grp2()</span></html> @@ -419,14 +419,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">aut2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Aut2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">aut2:</span>&nbsp;<span style="color:#000000;">Aut2()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">aut2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Aut2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">aut2:</span>&nbsp;<span style="color:#000000;">Aut2()</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_auts.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_auts.model.graphml index 7b66eb52f804318cb72e0ce6cd6ee9a3b9d62a98..1331aa7db7540b93f6a95fab161bcc8b2aeca48b 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_auts.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_auts.model.graphml @@ -60,7 +60,7 @@ - <html><span style="color:#000000;">e</span><span style="color:#402020;">!</span><span style="color:#006100;">5</span></html> + <html><span style="color:#000000;">e!</span><span style="color:#006100;">5</span></html> @@ -122,7 +122,7 @@ - <html><span style="color:#000000;">e</span><span style="color:#402020;">?</span></html> + <html><span style="color:#000000;">e?</span></html> @@ -198,7 +198,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">e;</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_auts.relations.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_auts.relations.graphml index 3bdd6ab9a2f7f5547e299cb7edb7977ec6ea8c42..904f62181c59916df745698eced671ba64b5d4d8 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_auts.relations.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_auts.relations.graphml @@ -33,7 +33,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span>&nbsp;<span style="color:#000000;">!?~</span></html> @@ -102,7 +102,7 @@ - <html><span style="color:#402020;">?</span></html> + <html><span style="color:#000000;">?</span></html> @@ -137,7 +137,7 @@ - <html><span style="color:#402020;">!</span></html> + <html><span style="color:#000000;">!</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_def_inst.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_def_inst.model.graphml index 6c6bdb04c85dab2686b63505334974702f64a48d..b2ed04aff4946ef014710794d23f3c7748b301fb 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_def_inst.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_def_inst.model.graphml @@ -10,14 +10,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Send</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">s</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Send(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">s)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Send</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">s</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Send(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">s)</span></html> @@ -60,7 +60,7 @@ - <html><span style="color:#000000;">s</span><span style="color:#402020;">!</span><span style="color:#006100;">5</span></html> + <html><span style="color:#000000;">s!</span><span style="color:#006100;">5</span></html> @@ -72,14 +72,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Recv</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">r</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Recv(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">r)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Recv</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">r</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Recv(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">r)</span></html> @@ -122,7 +122,7 @@ - <html><span style="color:#000000;">r</span><span style="color:#402020;">?</span></html> + <html><span style="color:#000000;">r?</span></html> @@ -134,14 +134,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Sync</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Sync(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">c)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Sync</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Sync(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">c)</span></html> @@ -198,7 +198,7 @@ Instantiations - <html><span style="color:#000000;">send</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Send</span><span style="color:#402020;">(</span><span style="color:#000000;">e</span><span style="color:#402020;">);</span><br><span style="color:#000000;">recv</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Recv</span><span style="color:#402020;">(</span><span style="color:#000000;">e</span><span style="color:#402020;">);</span><br><span style="color:#000000;">sync</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Sync</span><span style="color:#402020;">(</span><span style="color:#000000;">e</span><span style="color:#402020;">);</span></html> + <html><span style="color:#000000;">send:</span>&nbsp;<span style="color:#000000;">Send(e);</span><br><span style="color:#000000;">recv:</span>&nbsp;<span style="color:#000000;">Recv(e);</span><br><span style="color:#000000;">sync:</span>&nbsp;<span style="color:#000000;">Sync(e);</span></html> @@ -223,7 +223,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">e;</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_def_inst.relations.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_def_inst.relations.graphml index a7d492388c1c792a4502d740ca9fcdfb85f82336..727c22d870dd35d9022cc2ed6186c7cff44e512b 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_def_inst.relations.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_def_inst.relations.graphml @@ -12,14 +12,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Send</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Send()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Send</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Send()</span></html> @@ -33,7 +33,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">s</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">s</span>&nbsp;<span style="color:#000000;">!?~</span></html> @@ -45,7 +45,7 @@ - <html><span style="color:#402020;">!</span></html> + <html><span style="color:#000000;">!</span></html> @@ -59,14 +59,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Recv</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Recv()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Recv</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Recv()</span></html> @@ -80,7 +80,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">r</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">r</span>&nbsp;<span style="color:#000000;">!?~</span></html> @@ -92,7 +92,7 @@ - <html><span style="color:#402020;">?</span></html> + <html><span style="color:#000000;">?</span></html> @@ -106,14 +106,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Sync</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Sync()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Sync</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">Sync()</span></html> @@ -177,14 +177,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">send</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Send</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">send:</span>&nbsp;<span style="color:#000000;">Send()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">send</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Send</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">send:</span>&nbsp;<span style="color:#000000;">Send()</span></html> @@ -198,7 +198,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">s</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">s</span>&nbsp;<span style="color:#000000;">!?~</span></html> @@ -213,14 +213,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">recv</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Recv</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">recv:</span>&nbsp;<span style="color:#000000;">Recv()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">recv</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Recv</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">recv:</span>&nbsp;<span style="color:#000000;">Recv()</span></html> @@ -234,7 +234,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">r</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">r</span>&nbsp;<span style="color:#000000;">!?~</span></html> @@ -249,14 +249,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">sync</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Sync</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">sync:</span>&nbsp;<span style="color:#000000;">Sync()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">sync</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">Sync</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">sync:</span>&nbsp;<span style="color:#000000;">Sync()</span></html> @@ -284,7 +284,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span>&nbsp;<span style="color:#000000;">!?~</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_sync.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_sync.model.graphml index 093f1029da9e2a4066314636b4ef0be58378a65a..464859238401114a7846fbef0104500b01f0c103 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_sync.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_sync.model.graphml @@ -69,7 +69,7 @@ - <html><span style="color:#000000;">h</span><span style="color:#402020;">!</span><span style="color:#006100;">5</span></html> + <html><span style="color:#000000;">h!</span><span style="color:#006100;">5</span></html> @@ -140,7 +140,7 @@ - <html><span style="color:#000000;">h</span><span style="color:#402020;">?</span></html> + <html><span style="color:#000000;">h?</span></html> @@ -225,7 +225,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">h</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e;</span><br><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">h;</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_sync.relations.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_sync.relations.graphml index 16078b309ebc77b58360761ac24deae282dbff6d..ad203bd220818e9de27fa48c1df4b61630595f7a 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_sync.relations.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comm_sync.relations.graphml @@ -57,7 +57,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">h</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">h</span>&nbsp;<span style="color:#000000;">!?~</span></html> @@ -149,7 +149,7 @@ - <html><span style="color:#402020;">?</span></html> + <html><span style="color:#000000;">?</span></html> @@ -195,7 +195,7 @@ - <html><span style="color:#402020;">!</span></html> + <html><span style="color:#000000;">!</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comp_param.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comp_param.model.graphml index 33a87ae0cbd2a55c14cfe96d297fdb16b907925d..bc470baacce39d70c85cb4968dc8642286fe723b 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comp_param.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/comp_param.model.graphml @@ -32,14 +32,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G7</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G7()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G7</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G7()</span></html> @@ -100,7 +100,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e10</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e10;</span></html> @@ -184,14 +184,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G2</span><span style="color:#402020;">(</span><span style="color:#000000;">g6.G7</span>&nbsp;<span style="color:#000000;">p3</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G2(g6.G7</span>&nbsp;<span style="color:#000000;">p3)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G2</span><span style="color:#402020;">(</span><span style="color:#000000;">g6.G7</span>&nbsp;<span style="color:#000000;">p3</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G2(g6.G7</span>&nbsp;<span style="color:#000000;">p3)</span></html> @@ -228,14 +228,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A5</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A5()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A5</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A5()</span></html> @@ -292,7 +292,7 @@ Instantiations - <html><span style="color:#000000;">a5</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A5</span><span style="color:#402020;">();</span></html> + <html><span style="color:#000000;">a5:</span>&nbsp;<span style="color:#000000;">A5();</span></html> @@ -323,7 +323,7 @@ Instantiations - <html><span style="color:#000000;">g2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">g1.G2</span><span style="color:#402020;">(</span><span style="color:#000000;">g7</span><span style="color:#402020;">);</span><br><span style="color:#000000;">g7</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">g6.G7</span><span style="color:#402020;">();</span></html> + <html><span style="color:#000000;">g2:</span>&nbsp;<span style="color:#000000;">g1.G2(g7);</span><br><span style="color:#000000;">g7:</span>&nbsp;<span style="color:#000000;">g6.G7();</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_all.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_all.model.graphml index 2a470266ea56b5687627f93269eb742c8deb3eed..3a16df5d5ba91cf6d89950316d3e3a3da578a122 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_all.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_all.model.graphml @@ -34,7 +34,7 @@ Declarations - <html><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">real</span>&nbsp;<span style="color:#000000;">v</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">z</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">real</span>&nbsp;<span style="color:#000000;">v</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">z;</span><br><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e;</span></html> @@ -87,7 +87,7 @@ - <html><span style="color:#000000;">e</span><br><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">v</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">0</span></html> + <html><span style="color:#000000;">e</span><br><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">v</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">0</span></html> @@ -149,7 +149,7 @@ - <html><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">a.v</span>&nbsp;<span style="color:#402020;">&lt;=</span>&nbsp;<span style="color:#006100;">0</span></html> + <html><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">a.v</span>&nbsp;<span style="color:#000000;">&lt;=</span>&nbsp;<span style="color:#006100;">0</span></html> @@ -169,7 +169,7 @@ - <html><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">a.v</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">0</span></html> + <html><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">a.v</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">0</span></html> @@ -183,7 +183,7 @@ Declarations - <html><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">real</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#0000ff;">if</span>&nbsp;<span style="color:#000000;">b.l1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#402020;">+</span>&nbsp;<span style="color:#006100;">1.0</span>&nbsp;<span style="color:#0000ff;">elif</span>&nbsp;<span style="color:#000000;">b.l2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#402020;">+</span>&nbsp;<span style="color:#006100;">2.0</span>&nbsp;<span style="color:#0000ff;">else</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#402020;">+</span>&nbsp;<span style="color:#006100;">3.0</span>&nbsp;<span style="color:#0000ff;">end</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">input</span>&nbsp;<span style="color:#0000ff;">real</span>&nbsp;<span style="color:#000000;">y</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">z</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#0000ff;">der</span>&nbsp;<span style="color:#000000;">y</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">real</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#0000ff;">if</span>&nbsp;<span style="color:#000000;">b.l1:</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#000000;">+</span>&nbsp;<span style="color:#006100;">1.0</span>&nbsp;<span style="color:#0000ff;">elif</span>&nbsp;<span style="color:#000000;">b.l2:</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#000000;">+</span>&nbsp;<span style="color:#006100;">2.0</span>&nbsp;<span style="color:#0000ff;">else</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#000000;">+</span>&nbsp;<span style="color:#006100;">3.0</span>&nbsp;<span style="color:#0000ff;">end</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">input</span>&nbsp;<span style="color:#0000ff;">real</span>&nbsp;<span style="color:#000000;">y;</span><br><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">z</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#0000ff;">der</span>&nbsp;<span style="color:#000000;">y;</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_basic.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_basic.model.graphml index 4bf83f7a33dd2e6195fd74a9f7e7d983546b8cb6..537ccb18e11889cbd23ec45305a87293ea9682b3 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_basic.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_basic.model.graphml @@ -32,14 +32,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#0000ff;">location</span>&nbsp;<span style="color:#000000;">loc</span><span style="color:#402020;">;</span>&nbsp;<span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A(</span><span style="color:#0000ff;">location</span>&nbsp;<span style="color:#000000;">loc;</span>&nbsp;<span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#0000ff;">location</span>&nbsp;<span style="color:#000000;">loc</span><span style="color:#402020;">;</span>&nbsp;<span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A(</span><span style="color:#0000ff;">location</span>&nbsp;<span style="color:#000000;">loc;</span>&nbsp;<span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p)</span></html> @@ -56,7 +56,7 @@ Declarations - <html><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">0</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">0</span><span style="color:#000000;">;</span></html> @@ -109,7 +109,7 @@ - <html><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">1</span></html> + <html><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">1</span></html> @@ -143,7 +143,7 @@ Instantiations - <html><span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#000000;">a2.l1</span><span style="color:#402020;">,</span>&nbsp;<span style="color:#000000;">y</span><span style="color:#402020;">);</span><br><span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#000000;">a1.l2</span><span style="color:#402020;">,</span>&nbsp;<span style="color:#000000;">x</span><span style="color:#402020;">);</span></html> + <html><span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A(a2.l1,</span>&nbsp;<span style="color:#000000;">y);</span><br><span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A(a1.l2,</span>&nbsp;<span style="color:#000000;">x);</span></html> @@ -168,7 +168,7 @@ Declarations - <html><span style="color:#0000ff;">input</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">y</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">input</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">y;</span></html> @@ -197,7 +197,7 @@ Declarations - <html><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">g.y</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">g.y;</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_basic.relations.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_basic.relations.graphml index 1eefaf7dbd834b5579ab602cb8b1b8565daae614..a2ac4ce4e333eac521fe45b4bb82562b938ccfc8 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_basic.relations.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_basic.relations.graphml @@ -110,14 +110,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> @@ -216,14 +216,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A()</span></html> @@ -276,14 +276,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A()</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_refs.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_refs.model.graphml index 9f55574ceba5df9bd2b96c275e05da65154ad570..3a4a0a3036ac22b17266b184fe456a865ef9e50a 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_refs.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_refs.model.graphml @@ -10,14 +10,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A(</span><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A(</span><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p)</span></html> @@ -34,7 +34,7 @@ Declarations - <html><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">v</span><span style="color:#402020;">;</span><br><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">v</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">v;</span><br><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">v</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">p;</span></html> @@ -87,7 +87,7 @@ - <html><span style="color:#0000ff;">do</span>&nbsp;<span style="color:#000000;">v</span>&nbsp;<span style="color:#402020;">:=</span>&nbsp;<span style="color:#000000;">p</span></html> + <html><span style="color:#0000ff;">do</span>&nbsp;<span style="color:#000000;">v</span>&nbsp;<span style="color:#000000;">:=</span>&nbsp;<span style="color:#000000;">p</span></html> @@ -99,14 +99,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">(</span><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G(</span><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">(</span><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G(</span><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p)</span></html> @@ -123,7 +123,7 @@ Declarations - <html><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">pp</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">*</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">;</span><br><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">+</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">0</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">pp</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">*</span>&nbsp;<span style="color:#000000;">p;</span><br><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">+</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">0</span><span style="color:#000000;">;</span></html> @@ -174,7 +174,7 @@ Declarations - <html><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c3</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c3;</span></html> @@ -198,7 +198,7 @@ - <html><span style="color:#000000;">l1</span><br><br><span style="color:#0000ff;">equation</span>&nbsp;<span style="color:#000000;">c3</span><span style="color:#402020;">'</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">r</span><span style="color:#402020;">;</span></html> + <html><span style="color:#000000;">l1</span><br><br><span style="color:#0000ff;">equation</span>&nbsp;<span style="color:#000000;">c3'</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">r;</span></html> @@ -236,7 +236,7 @@ - <html><span style="color:#000000;">l2</span><br><br><span style="color:#0000ff;">equation</span>&nbsp;<span style="color:#000000;">c3</span><span style="color:#402020;">'</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">r</span><span style="color:#402020;">;</span></html> + <html><span style="color:#000000;">l2</span><br><br><span style="color:#0000ff;">equation</span>&nbsp;<span style="color:#000000;">c3'</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">r;</span></html> @@ -274,7 +274,7 @@ Declarations - <html><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c4</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c4;</span></html> @@ -298,7 +298,7 @@ - <html><span style="color:#0000ff;">equation</span>&nbsp;<span style="color:#000000;">c4</span><span style="color:#402020;">'</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">r</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">equation</span>&nbsp;<span style="color:#000000;">c4'</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">r;</span></html> @@ -354,7 +354,7 @@ Declarations - <html><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">z</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">y</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#402020;">+</span>&nbsp;<span style="color:#000000;">z</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#006100;">5</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">z</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">y;</span><br><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#000000;">+</span>&nbsp;<span style="color:#000000;">z;</span><br><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#006100;">5</span><span style="color:#000000;">;</span></html> @@ -378,7 +378,7 @@ - <html><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">0</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">0</span><span style="color:#000000;">;</span></html> @@ -434,7 +434,7 @@ Declarations - <html><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">bool</span>&nbsp;<span style="color:#000000;">b1</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">l1</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">bool</span>&nbsp;<span style="color:#000000;">b1</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">l1;</span></html> @@ -458,7 +458,7 @@ - <html><span style="color:#000000;">l1</span><br><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">b1</span><span style="color:#402020;">;</span></html> + <html><span style="color:#000000;">l1</span><br><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">b1;</span></html> @@ -501,7 +501,7 @@ Instantiations - <html><span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#000000;">a2.v</span><span style="color:#402020;">);</span><br><span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#000000;">a2.v</span><span style="color:#402020;">);</span><br><span style="color:#000000;">g1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">(</span><span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">+</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">+</span>&nbsp;<span style="color:#000000;">y</span><span style="color:#402020;">);</span><br><span style="color:#000000;">g2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">(</span><span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">*</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#402020;">*</span>&nbsp;<span style="color:#000000;">y</span><span style="color:#402020;">);</span></html> + <html><span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A(a2.v);</span><br><span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A(a2.v);</span><br><span style="color:#000000;">g1:</span>&nbsp;<span style="color:#000000;">G(x</span>&nbsp;<span style="color:#000000;">+</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">+</span>&nbsp;<span style="color:#000000;">y);</span><br><span style="color:#000000;">g2:</span>&nbsp;<span style="color:#000000;">G(x</span>&nbsp;<span style="color:#000000;">*</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#000000;">*</span>&nbsp;<span style="color:#000000;">y);</span></html> @@ -526,7 +526,7 @@ Declarations - <html><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#402020;">[</span><span style="color:#006100;">9</span><span style="color:#402020;">..</span><span style="color:#006100;">9</span><span style="color:#402020;">]</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#402020;">+</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#402020;">+</span>&nbsp;<span style="color:#000000;">y</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#402020;">[</span><span style="color:#006100;">3</span><span style="color:#402020;">..</span><span style="color:#006100;">3</span><span style="color:#402020;">]</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#006100;">3</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">func</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">f</span><span style="color:#402020;">(</span><span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">a</span><span style="color:#402020;">;</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">b</span><span style="color:#402020;">):</span><br>&nbsp;&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">c</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">a</span>&nbsp;<span style="color:#402020;">+</span>&nbsp;<span style="color:#000000;">b</span><span style="color:#402020;">;</span><br>&nbsp;&nbsp;<span style="color:#0000ff;">return</span>&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">end</span><br><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">z</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">f</span><span style="color:#402020;">(</span><span style="color:#000000;">x</span><span style="color:#402020;">,</span>&nbsp;<span style="color:#000000;">y</span><span style="color:#402020;">);</span><br><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">real</span>&nbsp;<span style="color:#000000;">r</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#006100;">5.0</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c1</span>&nbsp;<span style="color:#0000ff;">der</span>&nbsp;<span style="color:#000000;">r</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c2</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c5</span>&nbsp;<span style="color:#0000ff;">der</span>&nbsp;<span style="color:#000000;">c6</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c6</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">c5</span>&nbsp;<span style="color:#0000ff;">der</span>&nbsp;<span style="color:#006100;">1.0</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c7</span>&nbsp;<span style="color:#0000ff;">der</span>&nbsp;<span style="color:#000000;">c7</span><span style="color:#402020;">;</span><br><br><span style="color:#0000ff;">equation</span>&nbsp;<span style="color:#000000;">c2</span><span style="color:#402020;">'</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">r</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#000000;">[</span><span style="color:#006100;">9</span><span style="color:#000000;">..</span><span style="color:#006100;">9</span><span style="color:#000000;">]</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#000000;">+</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#000000;">+</span>&nbsp;<span style="color:#000000;">y;</span><br><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#000000;">[</span><span style="color:#006100;">3</span><span style="color:#000000;">..</span><span style="color:#006100;">3</span><span style="color:#000000;">]</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#006100;">3</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">func</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">f(</span><span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">a;</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">b):</span><br>&nbsp;&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">c</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">a</span>&nbsp;<span style="color:#000000;">+</span>&nbsp;<span style="color:#000000;">b;</span><br>&nbsp;&nbsp;<span style="color:#0000ff;">return</span>&nbsp;<span style="color:#000000;">c;</span><br><span style="color:#0000ff;">end</span><br><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">z</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">f(x,</span>&nbsp;<span style="color:#000000;">y);</span><br><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">real</span>&nbsp;<span style="color:#000000;">r</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#006100;">5.0</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c1</span>&nbsp;<span style="color:#0000ff;">der</span>&nbsp;<span style="color:#000000;">r;</span><br><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c2;</span><br><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c5</span>&nbsp;<span style="color:#0000ff;">der</span>&nbsp;<span style="color:#000000;">c6;</span><br><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c6</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">c5</span>&nbsp;<span style="color:#0000ff;">der</span>&nbsp;<span style="color:#006100;">1.0</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c7</span>&nbsp;<span style="color:#0000ff;">der</span>&nbsp;<span style="color:#000000;">c7;</span><br><br><span style="color:#0000ff;">equation</span>&nbsp;<span style="color:#000000;">c2'</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">r;</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_refs.relations.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_refs.relations.graphml index 2a2c2c1f47811665344b473b5cbf5e73f935580d..9f4ceba29b4ff176ae7007da83ceab1f9454600a 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_refs.relations.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/data_refs.relations.graphml @@ -12,14 +12,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> @@ -80,14 +80,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G()</span></html> @@ -162,14 +162,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A()</span></html> @@ -198,14 +198,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A()</span></html> @@ -330,14 +330,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">g1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">g1:</span>&nbsp;<span style="color:#000000;">G()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">g1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">g1:</span>&nbsp;<span style="color:#000000;">G()</span></html> @@ -366,14 +366,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">g2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">g2:</span>&nbsp;<span style="color:#000000;">G()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">g2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">g2:</span>&nbsp;<span style="color:#000000;">G()</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/empty_comps.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/empty_comps.model.graphml index d86134a0e7300221aa840ad4ad09a54594614b6b..8c0bbc496208bd785c07e1b0b488be80ee3f9533 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/empty_comps.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/empty_comps.model.graphml @@ -10,14 +10,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> @@ -63,14 +63,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">(</span><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">y</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C(</span><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">y)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">(</span><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">y</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C(</span><span style="color:#0000ff;">alg</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">y)</span></html> @@ -109,7 +109,7 @@ Declarations - <html><span style="color:#0000ff;">const</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#402020;">[</span><span style="color:#006100;">5</span><span style="color:#402020;">..</span><span style="color:#006100;">5</span><span style="color:#402020;">]</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#006100;">5</span><span style="color:#402020;">;</span><br><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#000000;">y</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">const</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#000000;">[</span><span style="color:#006100;">5</span><span style="color:#000000;">..</span><span style="color:#006100;">5</span><span style="color:#000000;">]</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#006100;">5</span><span style="color:#000000;">;</span><br><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#000000;">y;</span></html> @@ -138,14 +138,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">D</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">D(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">D</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">D(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e)</span></html> @@ -184,7 +184,7 @@ Declarations - <html><span style="color:#0000ff;">const</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#402020;">[</span><span style="color:#006100;">5</span><span style="color:#402020;">..</span><span style="color:#006100;">5</span><span style="color:#402020;">]</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#006100;">5</span><span style="color:#402020;">;</span><br><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#006100;">5</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">const</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#000000;">[</span><span style="color:#006100;">5</span><span style="color:#000000;">..</span><span style="color:#006100;">5</span><span style="color:#000000;">]</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#006100;">5</span><span style="color:#000000;">;</span><br><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#006100;">5</span><span style="color:#000000;">;</span></html> @@ -298,14 +298,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">E</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">E()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">E</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">E()</span></html> @@ -561,7 +561,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e;</span></html> @@ -719,7 +719,7 @@ Declarations - <html><span style="color:#0000ff;">const</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#402020;">[</span><span style="color:#006100;">5</span><span style="color:#402020;">..</span><span style="color:#006100;">5</span><span style="color:#402020;">]</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#006100;">5</span><span style="color:#402020;">;</span><br><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#006100;">5</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">const</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#000000;">[</span><span style="color:#006100;">5</span><span style="color:#000000;">..</span><span style="color:#006100;">5</span><span style="color:#000000;">]</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#006100;">5</span><span style="color:#000000;">;</span><br><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#006100;">5</span><span style="color:#000000;">;</span></html> @@ -752,7 +752,7 @@ Instantiations - <html><span style="color:#000000;">b</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">();</span><br><span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">(</span><span style="color:#006100;">5</span><span style="color:#402020;">);</span><br><span style="color:#000000;">d1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">D</span><span style="color:#402020;">(</span><span style="color:#000000;">g6.g7.e</span><span style="color:#402020;">);</span><br><span style="color:#000000;">d2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">D</span><span style="color:#402020;">(</span><span style="color:#000000;">ee</span><span style="color:#402020;">);</span><br><span style="color:#000000;">e</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">E</span><span style="color:#402020;">();</span></html> + <html><span style="color:#000000;">b:</span>&nbsp;<span style="color:#000000;">B();</span><br><span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">C(</span><span style="color:#006100;">5</span><span style="color:#000000;">);</span><br><span style="color:#000000;">d1:</span>&nbsp;<span style="color:#000000;">D(g6.g7.e);</span><br><span style="color:#000000;">d2:</span>&nbsp;<span style="color:#000000;">D(ee);</span><br><span style="color:#000000;">e:</span>&nbsp;<span style="color:#000000;">E();</span></html> @@ -777,7 +777,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ee</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ee;</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/empty_comps.relations.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/empty_comps.relations.graphml index 4766fb3d634880b2c9ee1f0e35afdffc0f9b52e9..a9ad6c449889d9d85304eaf9d791bfe9cfc0a160 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/empty_comps.relations.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/empty_comps.relations.graphml @@ -12,14 +12,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C()</span></html> @@ -82,14 +82,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">D</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">D()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">D</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">D()</span></html> @@ -296,14 +296,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">d1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">D</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">d1:</span>&nbsp;<span style="color:#000000;">D()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">d1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">D</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">d1:</span>&nbsp;<span style="color:#000000;">D()</span></html> @@ -332,14 +332,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">d2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">D</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">d2:</span>&nbsp;<span style="color:#000000;">D()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">d2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">D</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">d2:</span>&nbsp;<span style="color:#000000;">D()</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_local_use.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_local_use.model.graphml index 46508906054f433231320d4d16acae96de5f6503..6e48605362d867c97a7395a1aaee1fbecf297659 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_local_use.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_local_use.model.graphml @@ -10,14 +10,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e2</span><span style="color:#402020;">;</span>&nbsp;<span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">h2</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e2;</span>&nbsp;<span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">h2)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e2</span><span style="color:#402020;">;</span>&nbsp;<span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">h2</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e2;</span>&nbsp;<span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">h2)</span></html> @@ -69,7 +69,7 @@ - <html><span style="color:#000000;">h2</span><span style="color:#402020;">?</span></html> + <html><span style="color:#000000;">h2?</span></html> @@ -105,7 +105,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e;</span></html> @@ -167,7 +167,7 @@ - <html><span style="color:#000000;">h</span><span style="color:#402020;">!</span><span style="color:#006100;">5</span></html> + <html><span style="color:#000000;">h!</span><span style="color:#006100;">5</span></html> @@ -252,7 +252,7 @@ Instantiations - <html><span style="color:#000000;">b</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">(</span><span style="color:#000000;">a.e</span><span style="color:#402020;">,</span>&nbsp;<span style="color:#000000;">h</span><span style="color:#402020;">);</span></html> + <html><span style="color:#000000;">b:</span>&nbsp;<span style="color:#000000;">B(a.e,</span>&nbsp;<span style="color:#000000;">h);</span></html> @@ -277,7 +277,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">h</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">h;</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_local_use.relations.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_local_use.relations.graphml index cadcdc28e88b3cade7ee0651c27e491a04906f64..bd3a57da3f010807a42f109f71f0f07849351f2b 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_local_use.relations.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_local_use.relations.graphml @@ -12,14 +12,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> @@ -45,7 +45,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">h2</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">h2</span>&nbsp;<span style="color:#000000;">!?~</span></html> @@ -57,7 +57,7 @@ - <html><span style="color:#402020;">?</span></html> + <html><span style="color:#000000;">?</span></html> @@ -127,7 +127,7 @@ - <html><span style="color:#402020;">!</span></html> + <html><span style="color:#000000;">!</span></html> @@ -164,14 +164,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b:</span>&nbsp;<span style="color:#000000;">B()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b:</span>&nbsp;<span style="color:#000000;">B()</span></html> @@ -197,7 +197,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">h2</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">h2</span>&nbsp;<span style="color:#000000;">!?~</span></html> @@ -257,7 +257,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">h</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">h</span>&nbsp;<span style="color:#000000;">!?~</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_param_directions.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_param_directions.model.graphml index 9c552923d99f90bb4f1786ef188d8c14a56e58a0..4c8e82582f2f36e02f88dbc9fe4675344bab7f02 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_param_directions.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_param_directions.model.graphml @@ -10,14 +10,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">X</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">X(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">X</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">X(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p)</span></html> @@ -72,14 +72,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">N</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">N(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">N</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">N(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p)</span></html> @@ -134,14 +134,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">S</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">!)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">S(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p!)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">S</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">!)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">S(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p!)</span></html> @@ -184,7 +184,7 @@ - <html><span style="color:#000000;">p</span><span style="color:#402020;">!</span><span style="color:#006100;">1</span></html> + <html><span style="color:#000000;">p!</span><span style="color:#006100;">1</span></html> @@ -196,14 +196,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">R</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">?)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">R(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p?)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">R</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">?)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">R(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p?)</span></html> @@ -246,7 +246,7 @@ - <html><span style="color:#000000;">p</span><span style="color:#402020;">?</span></html> + <html><span style="color:#000000;">p?</span></html> @@ -258,14 +258,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">~)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p~)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">~)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p~)</span></html> @@ -320,14 +320,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SR</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">!?)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SR(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p!?)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SR</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">!?)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SR(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p!?)</span></html> @@ -370,7 +370,7 @@ - <html><span style="color:#000000;">p</span><span style="color:#402020;">?</span></html> + <html><span style="color:#000000;">p?</span></html> @@ -382,14 +382,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SC</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">!~)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SC(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p!~)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SC</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">!~)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SC(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p!~)</span></html> @@ -444,14 +444,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">RC</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">?~)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">RC(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p?~)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">RC</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">?~)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">RC(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p?~)</span></html> @@ -506,14 +506,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SRC</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">!?~)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SRC(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p!?~)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SRC</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p</span><span style="color:#402020;">!?~)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SRC(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">p!?~)</span></html> @@ -570,7 +570,7 @@ Instantiations - <html><span style="color:#000000;">x</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">X</span><span style="color:#402020;">(</span><span style="color:#000000;">e</span><span style="color:#402020;">);</span><br><span style="color:#000000;">n</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">N</span><span style="color:#402020;">(</span><span style="color:#000000;">e</span><span style="color:#402020;">);</span><br><span style="color:#000000;">s</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">S</span><span style="color:#402020;">(</span><span style="color:#000000;">e</span><span style="color:#402020;">);</span><br><span style="color:#000000;">r</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">R</span><span style="color:#402020;">(</span><span style="color:#000000;">e</span><span style="color:#402020;">);</span><br><span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">(</span><span style="color:#000000;">e</span><span style="color:#402020;">);</span><br><span style="color:#000000;">sr</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">SR</span><span style="color:#402020;">(</span><span style="color:#000000;">e</span><span style="color:#402020;">);</span><br><span style="color:#000000;">sc</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">SC</span><span style="color:#402020;">(</span><span style="color:#000000;">e</span><span style="color:#402020;">);</span><br><span style="color:#000000;">rc</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">RC</span><span style="color:#402020;">(</span><span style="color:#000000;">e</span><span style="color:#402020;">);</span><br><span style="color:#000000;">src</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">SRC</span><span style="color:#402020;">(</span><span style="color:#000000;">e</span><span style="color:#402020;">);</span></html> + <html><span style="color:#000000;">x:</span>&nbsp;<span style="color:#000000;">X(e);</span><br><span style="color:#000000;">n:</span>&nbsp;<span style="color:#000000;">N(e);</span><br><span style="color:#000000;">s:</span>&nbsp;<span style="color:#000000;">S(e);</span><br><span style="color:#000000;">r:</span>&nbsp;<span style="color:#000000;">R(e);</span><br><span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">C(e);</span><br><span style="color:#000000;">sr:</span>&nbsp;<span style="color:#000000;">SR(e);</span><br><span style="color:#000000;">sc:</span>&nbsp;<span style="color:#000000;">SC(e);</span><br><span style="color:#000000;">rc:</span>&nbsp;<span style="color:#000000;">RC(e);</span><br><span style="color:#000000;">src:</span>&nbsp;<span style="color:#000000;">SRC(e);</span></html> @@ -595,7 +595,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">e;</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_param_directions.relations.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_param_directions.relations.graphml index 9e66812eca24c6d6a39b301c70b19eb4e502f33b..6d57f2ad321868228b42b27ede0c0f8a4adab95f 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_param_directions.relations.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_param_directions.relations.graphml @@ -12,14 +12,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">X</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">X()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">X</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">X()</span></html> @@ -59,14 +59,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">N</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">N()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">N</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">N()</span></html> @@ -80,7 +80,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">!?~</span></html> @@ -106,14 +106,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">S</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">S()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">S</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">S()</span></html> @@ -127,7 +127,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">!</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">!</span></html> @@ -139,7 +139,7 @@ - <html><span style="color:#402020;">!</span></html> + <html><span style="color:#000000;">!</span></html> @@ -153,14 +153,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">R</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">R()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">R</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">R()</span></html> @@ -174,7 +174,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">?</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">?</span></html> @@ -186,7 +186,7 @@ - <html><span style="color:#402020;">?</span></html> + <html><span style="color:#000000;">?</span></html> @@ -200,14 +200,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C()</span></html> @@ -221,7 +221,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">~</span></html> @@ -247,14 +247,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SR</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SR()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SR</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SR()</span></html> @@ -268,7 +268,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">!?</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">!?</span></html> @@ -280,7 +280,7 @@ - <html><span style="color:#402020;">?</span></html> + <html><span style="color:#000000;">?</span></html> @@ -294,14 +294,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SC</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SC()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SC</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SC()</span></html> @@ -315,7 +315,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">!~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">!~</span></html> @@ -341,14 +341,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">RC</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">RC()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">RC</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">RC()</span></html> @@ -362,7 +362,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">?~</span></html> @@ -388,14 +388,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SRC</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SRC()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SRC</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">SRC()</span></html> @@ -409,7 +409,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">!?~</span></html> @@ -459,14 +459,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">x</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">X</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">x:</span>&nbsp;<span style="color:#000000;">X()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">x</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">X</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">x:</span>&nbsp;<span style="color:#000000;">X()</span></html> @@ -495,14 +495,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">n</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">N</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">n:</span>&nbsp;<span style="color:#000000;">N()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">n</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">N</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">n:</span>&nbsp;<span style="color:#000000;">N()</span></html> @@ -516,7 +516,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">!?~</span></html> @@ -531,14 +531,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">s</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">S</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">s:</span>&nbsp;<span style="color:#000000;">S()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">s</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">S</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">s:</span>&nbsp;<span style="color:#000000;">S()</span></html> @@ -552,7 +552,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">!</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">!</span></html> @@ -567,14 +567,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">r</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">R</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">r:</span>&nbsp;<span style="color:#000000;">R()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">r</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">R</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">r:</span>&nbsp;<span style="color:#000000;">R()</span></html> @@ -588,7 +588,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">?</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">?</span></html> @@ -603,14 +603,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">C()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">C()</span></html> @@ -624,7 +624,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">~</span></html> @@ -639,14 +639,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">sr</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">SR</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">sr:</span>&nbsp;<span style="color:#000000;">SR()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">sr</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">SR</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">sr:</span>&nbsp;<span style="color:#000000;">SR()</span></html> @@ -660,7 +660,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">!?</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">!?</span></html> @@ -675,14 +675,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">sc</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">SC</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">sc:</span>&nbsp;<span style="color:#000000;">SC()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">sc</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">SC</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">sc:</span>&nbsp;<span style="color:#000000;">SC()</span></html> @@ -696,7 +696,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">!~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">!~</span></html> @@ -711,14 +711,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">rc</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">RC</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">rc:</span>&nbsp;<span style="color:#000000;">RC()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">rc</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">RC</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">rc:</span>&nbsp;<span style="color:#000000;">RC()</span></html> @@ -732,7 +732,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">?~</span></html> @@ -747,14 +747,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">src</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">SRC</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">src:</span>&nbsp;<span style="color:#000000;">SRC()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">src</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">SRC</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">src:</span>&nbsp;<span style="color:#000000;">SRC()</span></html> @@ -768,7 +768,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">p</span>&nbsp;<span style="color:#000000;">!?~</span></html> @@ -782,7 +782,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span>&nbsp;<span style="color:#000000;">!?~</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_params.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_params.model.graphml index d11db44e2bbae8803893181ffb4f522c034329c6..15977dd244b2fb6b4bb35211c0b4909f40265abe 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_params.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_params.model.graphml @@ -10,14 +10,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e)</span></html> @@ -34,7 +34,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ea</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ea;</span></html> @@ -99,14 +99,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e)</span></html> @@ -123,7 +123,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">eb</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">eb;</span></html> @@ -190,7 +190,7 @@ Instantiations - <html><span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#000000;">a1.ea</span><span style="color:#402020;">);</span><br><span style="color:#000000;">b1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">(</span><span style="color:#000000;">b1.eb</span><span style="color:#402020;">);</span><br><span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#000000;">b2.eb</span><span style="color:#402020;">);</span><br><span style="color:#000000;">b2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">(</span><span style="color:#000000;">a2.ea</span><span style="color:#402020;">);</span></html> + <html><span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A(a1.ea);</span><br><span style="color:#000000;">b1:</span>&nbsp;<span style="color:#000000;">B(b1.eb);</span><br><span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A(b2.eb);</span><br><span style="color:#000000;">b2:</span>&nbsp;<span style="color:#000000;">B(a2.ea);</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_params.relations.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_params.relations.graphml index c33223dc84ca617fd83a75d3a6feccc97c4dacbe..9ba00648f2dd8d98023676e1db953ff1d72a2f08 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_params.relations.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_params.relations.graphml @@ -12,14 +12,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> @@ -71,14 +71,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> @@ -154,14 +154,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A()</span></html> @@ -202,14 +202,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b2:</span>&nbsp;<span style="color:#000000;">B()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b2:</span>&nbsp;<span style="color:#000000;">B()</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_complex.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_complex.model.graphml index 8e8a4b189b64f951f6aeb8454d6a3d7265ead621..fd7de6bc3b27d63fd2460004ae64ddf506538fee 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_complex.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_complex.model.graphml @@ -32,14 +32,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> @@ -56,7 +56,7 @@ Instantiations - <html><span style="color:#000000;">b</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">gB.B</span><span style="color:#402020;">();</span></html> + <html><span style="color:#000000;">b:</span>&nbsp;<span style="color:#000000;">gB.B();</span></html> @@ -105,14 +105,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> @@ -129,7 +129,7 @@ Instantiations - <html><span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">gC.C</span><span style="color:#402020;">();</span></html> + <html><span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">gC.C();</span></html> @@ -178,14 +178,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C()</span></html> @@ -202,7 +202,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e;</span></html> @@ -293,7 +293,7 @@ Instantiations - <html><span style="color:#000000;">a</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">gA.A</span><span style="color:#402020;">();</span></html> + <html><span style="color:#000000;">a:</span>&nbsp;<span style="color:#000000;">gA.A();</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_complex.relations.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_complex.relations.graphml index cd8455a7706b870aaa5c428a8423eb1ed8c81441..1af686672e46b9d29f27d163b1e6297f07353cb1 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_complex.relations.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_complex.relations.graphml @@ -56,14 +56,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">gA.A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a:</span>&nbsp;<span style="color:#000000;">gA.A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">gA.A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a:</span>&nbsp;<span style="color:#000000;">gA.A()</span></html> @@ -78,14 +78,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">gB.B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b:</span>&nbsp;<span style="color:#000000;">gB.B()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">gB.B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b:</span>&nbsp;<span style="color:#000000;">gB.B()</span></html> @@ -100,14 +100,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">gC.C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">gC.C()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">gC.C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">gC.C()</span></html> @@ -164,14 +164,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C()</span></html> @@ -235,14 +235,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> @@ -257,14 +257,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">gC.C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">gC.C()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">gC.C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">gC.C()</span></html> @@ -318,14 +318,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> @@ -340,14 +340,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">gB.B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b:</span>&nbsp;<span style="color:#000000;">gB.B()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">gB.B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b:</span>&nbsp;<span style="color:#000000;">gB.B()</span></html> @@ -362,14 +362,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">gC.C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">gC.C()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">gC.C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">gC.C()</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_cross.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_cross.model.graphml index e7376a530f5f249bf5367e3c234f95362358b228..fdb1a8a17f714f60811ea727a46b89cfadf24a4d 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_cross.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_cross.model.graphml @@ -10,14 +10,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A1</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A1()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A1</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A1()</span></html> @@ -34,7 +34,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e1</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e1;</span></html> @@ -99,14 +99,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A2()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A2()</span></html> @@ -123,7 +123,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e2</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e2;</span></html> @@ -190,7 +190,7 @@ Instantiations - <html><span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A1</span><span style="color:#402020;">();</span><br><span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A2</span><span style="color:#402020;">();</span></html> + <html><span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A1();</span><br><span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A2();</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_cross.relations.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_cross.relations.graphml index e420241b2cf76f54a09d886c2c5b83b2ae713a3f..2ef0dbd6084e2d1138d8073c413e12e45ba22d9e 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_cross.relations.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_cross.relations.graphml @@ -12,14 +12,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A1</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A1()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A1</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A1()</span></html> @@ -59,14 +59,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A2()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A2()</span></html> @@ -130,14 +130,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A1</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A1()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A1</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A1()</span></html> @@ -177,14 +177,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A2()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A2</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A2()</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_def_in_def.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_def_in_def.model.graphml index 5f6063136e36a431673203fc401844eeecde0d7a..d5b44792e1c253c05b9d48abe1cd38d04d47c42d 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_def_in_def.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_def_in_def.model.graphml @@ -10,14 +10,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ea</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ea)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ea</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ea)</span></html> @@ -32,14 +32,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">eb</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">eb)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">eb</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">eb)</span></html> @@ -54,14 +54,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ec</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ec)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ec</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ec)</span></html> @@ -118,7 +118,7 @@ Instantiations - <html><span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">(</span><span style="color:#000000;">eb</span><span style="color:#402020;">);</span></html> + <html><span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">C(eb);</span></html> @@ -145,7 +145,7 @@ Instantiations - <html><span style="color:#000000;">b</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">(</span><span style="color:#000000;">ea</span><span style="color:#402020;">);</span></html> + <html><span style="color:#000000;">b:</span>&nbsp;<span style="color:#000000;">B(ea);</span></html> @@ -170,7 +170,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e;</span></html> @@ -199,7 +199,7 @@ Instantiations - <html><span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#000000;">a2.e</span><span style="color:#402020;">);</span><br><span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#000000;">a1.e</span><span style="color:#402020;">);</span></html> + <html><span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A(a2.e);</span><br><span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A(a1.e);</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_def_in_def.relations.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_def_in_def.relations.graphml index 8a5e18c29eadcfce2b0fb2d3f523dab71d9a256a..7114a979b99b58f5c954ab65449052666d6bdcce 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_def_in_def.relations.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_def_in_def.relations.graphml @@ -12,14 +12,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> @@ -48,14 +48,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> @@ -84,14 +84,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C()</span></html> @@ -155,14 +155,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">C()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">C()</span></html> @@ -239,14 +239,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b:</span>&nbsp;<span style="color:#000000;">B()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b:</span>&nbsp;<span style="color:#000000;">B()</span></html> @@ -335,14 +335,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A()</span></html> @@ -383,14 +383,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A()</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_passed_along.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_passed_along.model.graphml index ef4b4ebf64ad44df2f34c9914404b4e7caa0e29f..d708e7710bbb85a50231a8ed670a9ae767156c88 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_passed_along.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_passed_along.model.graphml @@ -10,14 +10,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ea</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ea)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ea</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ea)</span></html> @@ -34,7 +34,7 @@ Instantiations - <html><span style="color:#000000;">b</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">(</span><span style="color:#000000;">ea</span><span style="color:#402020;">);</span></html> + <html><span style="color:#000000;">b:</span>&nbsp;<span style="color:#000000;">B(ea);</span></html> @@ -59,7 +59,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e;</span></html> @@ -86,14 +86,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">eb</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">eb)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">eb</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">eb)</span></html> @@ -110,7 +110,7 @@ Instantiations - <html><span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">(</span><span style="color:#000000;">eb</span><span style="color:#402020;">);</span></html> + <html><span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">C(eb);</span></html> @@ -135,14 +135,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ec</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ec)</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ec</span><span style="color:#402020;">)</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C(</span><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">ec)</span></html> @@ -199,7 +199,7 @@ Instantiations - <html><span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#000000;">a2.e</span><span style="color:#402020;">);</span><br><span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">(</span><span style="color:#000000;">a1.e</span><span style="color:#402020;">);</span></html> + <html><span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A(a2.e);</span><br><span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A(a1.e);</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_passed_along.relations.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_passed_along.relations.graphml index cb8032cb5593f634c998cdab637de17b880985bb..317e843c8be8ae19b79bbcc347c48767dd68c920 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_passed_along.relations.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_passed_along.relations.graphml @@ -12,14 +12,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> @@ -58,14 +58,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b:</span>&nbsp;<span style="color:#000000;">B()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">b:</span>&nbsp;<span style="color:#000000;">B()</span></html> @@ -96,14 +96,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> @@ -130,14 +130,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">C()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">c:</span>&nbsp;<span style="color:#000000;">C()</span></html> @@ -168,14 +168,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">C()</span></html> @@ -239,14 +239,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A()</span></html> @@ -287,14 +287,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A()</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_via_inst.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_via_inst.model.graphml index c442be6f216adc84b70aa13c1035c4094b090a77..025e5d1de5c18e38c90e75798ea7b976a08dd824 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_via_inst.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_via_inst.model.graphml @@ -10,14 +10,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> @@ -34,7 +34,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e;</span></html> @@ -61,14 +61,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> @@ -147,7 +147,7 @@ Instantiations - <html><span style="color:#000000;">a</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">();</span></html> + <html><span style="color:#000000;">a:</span>&nbsp;<span style="color:#000000;">A();</span></html> @@ -174,7 +174,7 @@ Instantiations - <html><span style="color:#000000;">b1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">();</span><br><span style="color:#000000;">b2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">();</span></html> + <html><span style="color:#000000;">b1:</span>&nbsp;<span style="color:#000000;">B();</span><br><span style="color:#000000;">b2:</span>&nbsp;<span style="color:#000000;">B();</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_via_inst.relations.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_via_inst.relations.graphml index a08aeeaf23963198ccc7916c5016d2bed66e28ce..bab239b3f9d3c36b31749131376fde557fc70899 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_via_inst.relations.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/evt_ref_via_inst.relations.graphml @@ -18,14 +18,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">B()</span></html> @@ -75,14 +75,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a:</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#000000;">a:</span>&nbsp;<span style="color:#000000;">A()</span></html> @@ -113,14 +113,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/inits.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/inits.model.graphml index e3ab77583d60ee6b21ab621da91c380a87203b40..13d4445f19f405e77fa77d0632bb8025a974c01a 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/inits.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/inits.model.graphml @@ -34,7 +34,7 @@ Declarations - <html><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#402020;">[</span><span style="color:#006100;">0</span><span style="color:#402020;">..</span><span style="color:#006100;">10</span><span style="color:#402020;">]</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#0061c0;">in</span>&nbsp;<span style="color:#0000ff;">any</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#402020;">[</span><span style="color:#006100;">0</span><span style="color:#402020;">..</span><span style="color:#006100;">10</span><span style="color:#402020;">]</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#0061c0;">in</span>&nbsp;<span style="color:#0000ff;">any</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#000000;">[</span><span style="color:#006100;">0</span><span style="color:#000000;">..</span><span style="color:#006100;">10</span><span style="color:#000000;">]</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#0061c0;">in</span>&nbsp;<span style="color:#0000ff;">any</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#000000;">[</span><span style="color:#006100;">0</span><span style="color:#000000;">..</span><span style="color:#006100;">10</span><span style="color:#000000;">]</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#0061c0;">in</span>&nbsp;<span style="color:#0000ff;">any</span><span style="color:#000000;">;</span></html> @@ -175,7 +175,7 @@ - <html><span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">1</span><span style="color:#402020;">,</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#402020;">&lt;</span>&nbsp;<span style="color:#006100;">2</span></html> + <html><span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">1</span><span style="color:#000000;">,</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#000000;">&lt;</span>&nbsp;<span style="color:#006100;">2</span></html> @@ -189,7 +189,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e;</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/insts.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/insts.model.graphml index 1358a953b4406867da134bec65524ef94f72ebb9..bb8785f1c0486038069bb0eb0e6d1a56e5a89612 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/insts.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/insts.model.graphml @@ -10,14 +10,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">automaton</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">A()</span></html> @@ -63,14 +63,14 @@ - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G()</span></html> - <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">()</span></html> + <html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:#0000ff;">group</span>&nbsp;<span style="color:#0000ff;">def</span>&nbsp;<span style="color:#000000;">G()</span></html> @@ -88,7 +88,7 @@ Instantiations - <html><span style="color:#000000;">a1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">();</span><br><span style="color:#000000;">a2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">();</span><br><span style="color:#000000;">a3</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">();</span><br><span style="color:#000000;">a4</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">();</span><br><span style="color:#000000;">a5</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">A</span><span style="color:#402020;">();</span><br><span style="color:#000000;">g1</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">();</span><br><span style="color:#000000;">g2</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">();</span><br><span style="color:#000000;">g3</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">();</span><br><span style="color:#000000;">g4</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">();</span><br><span style="color:#000000;">g5</span><span style="color:#402020;">:</span>&nbsp;<span style="color:#000000;">G</span><span style="color:#402020;">();</span></html> + <html><span style="color:#000000;">a1:</span>&nbsp;<span style="color:#000000;">A();</span><br><span style="color:#000000;">a2:</span>&nbsp;<span style="color:#000000;">A();</span><br><span style="color:#000000;">a3:</span>&nbsp;<span style="color:#000000;">A();</span><br><span style="color:#000000;">a4:</span>&nbsp;<span style="color:#000000;">A();</span><br><span style="color:#000000;">a5:</span>&nbsp;<span style="color:#000000;">A();</span><br><span style="color:#000000;">g1:</span>&nbsp;<span style="color:#000000;">G();</span><br><span style="color:#000000;">g2:</span>&nbsp;<span style="color:#000000;">G();</span><br><span style="color:#000000;">g3:</span>&nbsp;<span style="color:#000000;">G();</span><br><span style="color:#000000;">g4:</span>&nbsp;<span style="color:#000000;">G();</span><br><span style="color:#000000;">g5:</span>&nbsp;<span style="color:#000000;">G();</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/locs_edges.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/locs_edges.model.graphml index ef3f863cc5c91d8a8603c73359beb1489c508070..7f30446e3a9bc9aeb419e4c7314d578ff2df5fe6 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/locs_edges.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/locs_edges.model.graphml @@ -34,7 +34,7 @@ Declarations - <html><span style="color:#0000ff;">controllable</span>&nbsp;<span style="color:#006100;">c_add</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">controllable</span>&nbsp;<span style="color:#006100;">c_remove</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">uncontrollable</span>&nbsp;<span style="color:#800000;">u_added</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">uncontrollable</span>&nbsp;<span style="color:#800000;">u_removed</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#c06100;">e_update</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#c06100;">e_snd</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#c06100;">e_rcv</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#402020;">[</span><span style="color:#006100;">0</span><span style="color:#402020;">..</span><span style="color:#006100;">10</span><span style="color:#402020;">]</span>&nbsp;<span style="color:#000000;">x</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#402020;">[</span><span style="color:#006100;">0</span><span style="color:#402020;">..</span><span style="color:#006100;">10</span><span style="color:#402020;">]</span>&nbsp;<span style="color:#000000;">y</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#402020;">[</span><span style="color:#006100;">0</span><span style="color:#402020;">..</span><span style="color:#006100;">10</span><span style="color:#402020;">]</span>&nbsp;<span style="color:#000000;">z</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">controllable</span>&nbsp;<span style="color:#006100;">c_add</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">controllable</span>&nbsp;<span style="color:#006100;">c_remove</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">uncontrollable</span>&nbsp;<span style="color:#800000;">u_added</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">uncontrollable</span>&nbsp;<span style="color:#800000;">u_removed</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#c06100;">e_update</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#c06100;">e_snd</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#c06100;">e_rcv</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#000000;">[</span><span style="color:#006100;">0</span><span style="color:#000000;">..</span><span style="color:#006100;">10</span><span style="color:#000000;">]</span>&nbsp;<span style="color:#000000;">x;</span><br><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#000000;">[</span><span style="color:#006100;">0</span><span style="color:#000000;">..</span><span style="color:#006100;">10</span><span style="color:#000000;">]</span>&nbsp;<span style="color:#000000;">y;</span><br><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#000000;">[</span><span style="color:#006100;">0</span><span style="color:#000000;">..</span><span style="color:#006100;">10</span><span style="color:#000000;">]</span>&nbsp;<span style="color:#000000;">z;</span></html> @@ -87,7 +87,7 @@ - <html><span style="color:#006100;">c_add</span><br><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">0</span></html> + <html><span style="color:#006100;">c_add</span><br><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">0</span></html> @@ -125,7 +125,7 @@ - <html><span style="color:#c06100;">e_snd</span><span style="color:#402020;">!</span><span style="color:#000000;">x</span><br><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">0</span><br><span style="color:#0000ff;">now</span><br><span style="color:#0000ff;">do</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#402020;">:=</span>&nbsp;<span style="color:#000000;">x</span></html> + <html><span style="color:#c06100;">e_snd</span><span style="color:#000000;">!x</span><br><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">0</span><br><span style="color:#0000ff;">now</span><br><span style="color:#0000ff;">do</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#000000;">:=</span>&nbsp;<span style="color:#000000;">x</span></html> @@ -134,7 +134,7 @@ - <html><span style="color:#c06100;">e_rcv</span><span style="color:#402020;">?</span><br><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#006100;">5</span><br><span style="color:#0000ff;">do</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">:=</span>&nbsp;<span style="color:#402020;">?</span></html> + <html><span style="color:#c06100;">e_rcv</span><span style="color:#000000;">?</span><br><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#006100;">5</span><br><span style="color:#0000ff;">do</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">:=</span>&nbsp;<span style="color:#000000;">?</span></html> @@ -154,7 +154,7 @@ - <html><span style="color:#800000;">u_added</span><span style="color:#402020;">,</span>&nbsp;<span style="color:#800000;">u_removed</span><br><span style="color:#0000ff;">do</span>&nbsp;<span style="color:#000000;">z</span>&nbsp;<span style="color:#402020;">:=</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#402020;">+</span>&nbsp;<span style="color:#006100;">1</span></html> + <html><span style="color:#800000;">u_added</span><span style="color:#000000;">,</span>&nbsp;<span style="color:#800000;">u_removed</span><br><span style="color:#0000ff;">do</span>&nbsp;<span style="color:#000000;">z</span>&nbsp;<span style="color:#000000;">:=</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#000000;">+</span>&nbsp;<span style="color:#006100;">1</span></html> @@ -163,7 +163,7 @@ - <html><span style="color:#000000;">loc4</span><br><br><span style="color:#0000ff;">marked</span><span style="color:#402020;">;</span></html> + <html><span style="color:#000000;">loc4</span><br><br><span style="color:#0000ff;">marked</span><span style="color:#000000;">;</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/locs_edges.relations.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/locs_edges.relations.graphml index 515238c3cdcd0f4028e499097e21cdf540b00a17..3e4a1dd6e724a64d15f6c3d4755d21bff570b899 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/locs_edges.relations.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/locs_edges.relations.graphml @@ -127,7 +127,7 @@ - <html><span style="color:#402020;">?</span></html> + <html><span style="color:#000000;">?</span></html> @@ -138,7 +138,7 @@ - <html><span style="color:#402020;">!</span></html> + <html><span style="color:#000000;">!</span></html> @@ -288,7 +288,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#c06100;">e_rcv</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#c06100;">e_rcv</span>&nbsp;<span style="color:#000000;">!?~</span></html> @@ -300,7 +300,7 @@ - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#c06100;">e_snd</span>&nbsp;<span style="color:#402020;">!?~</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#c06100;">e_snd</span>&nbsp;<span style="color:#000000;">!?~</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/model_filter_all.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/model_filter_all.model.graphml index 28ca0334020f9a4e746ce96e190877c7f475bd1c..599b830a4691a0e5cc363d238b507dc3f940433a 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/model_filter_all.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/model_filter_all.model.graphml @@ -34,7 +34,7 @@ Declarations - <html><span style="color:#0000ff;">alphabet</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">monitor</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span><br><br><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">x</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">const</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#402020;">[</span><span style="color:#006100;">1</span><span style="color:#402020;">..</span><span style="color:#006100;">1</span><span style="color:#402020;">]</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#006100;">1</span><span style="color:#402020;">;</span><br><br><span style="color:#0000ff;">initial</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">2</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">marked</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">2</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">2</span><span style="color:#402020;">;</span><br><br><span style="color:#0000ff;">print</span>&nbsp;<span style="color:#c00000;">&quot;b&quot;</span>&nbsp;<span style="color:#0000ff;">for</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">alphabet</span>&nbsp;<span style="color:#000000;">e;</span><br><span style="color:#0000ff;">monitor</span>&nbsp;<span style="color:#000000;">e;</span><br><br><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">x;</span><br><span style="color:#0000ff;">const</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#000000;">[</span><span style="color:#006100;">1</span><span style="color:#000000;">..</span><span style="color:#006100;">1</span><span style="color:#000000;">]</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#006100;">1</span><span style="color:#000000;">;</span><br><br><span style="color:#0000ff;">initial</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">2</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">marked</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">2</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">2</span><span style="color:#000000;">;</span><br><br><span style="color:#0000ff;">print</span>&nbsp;<span style="color:#c00000;">&quot;b&quot;</span>&nbsp;<span style="color:#0000ff;">for</span>&nbsp;<span style="color:#000000;">e;</span></html> @@ -87,7 +87,7 @@ - <html><span style="color:#000000;">e</span><br><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#000000;">y</span><br><span style="color:#0000ff;">now</span><br><span style="color:#0000ff;">do</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">:=</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">+</span>&nbsp;<span style="color:#006100;">1</span></html> + <html><span style="color:#000000;">e</span><br><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#000000;">y</span><br><span style="color:#0000ff;">now</span><br><span style="color:#0000ff;">do</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">:=</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">+</span>&nbsp;<span style="color:#006100;">1</span></html> @@ -123,7 +123,7 @@ Declarations - <html><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c;</span></html> @@ -147,7 +147,7 @@ - <html><span style="color:#000000;">loc1</span><br><br><span style="color:#0000ff;">equation</span>&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">'</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#006100;">5.0</span><span style="color:#402020;">;</span></html> + <html><span style="color:#000000;">loc1</span><br><br><span style="color:#0000ff;">equation</span>&nbsp;<span style="color:#000000;">c'</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#006100;">5.0</span><span style="color:#000000;">;</span></html> @@ -158,7 +158,7 @@ - <html><span style="color:#000000;">e</span><br><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">c</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">2</span><br><span style="color:#0000ff;">do</span>&nbsp;<span style="color:#000000;">c</span>&nbsp;<span style="color:#402020;">:=</span>&nbsp;<span style="color:#006100;">0.0</span></html> + <html><span style="color:#000000;">e</span><br><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">c</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">2</span><br><span style="color:#0000ff;">do</span>&nbsp;<span style="color:#000000;">c</span>&nbsp;<span style="color:#000000;">:=</span>&nbsp;<span style="color:#006100;">0.0</span></html> @@ -167,7 +167,7 @@ - <html><span style="color:#000000;">loc2</span><br><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">a.x</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">equation</span>&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">'</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#006100;">6.0</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">urgent</span><span style="color:#402020;">;</span></html> + <html><span style="color:#000000;">loc2</span><br><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">a.x</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#000000;">c;</span><br><span style="color:#0000ff;">equation</span>&nbsp;<span style="color:#000000;">c'</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#006100;">6.0</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">urgent</span><span style="color:#000000;">;</span></html> @@ -183,7 +183,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span><br><br><span style="color:#0000ff;">print</span>&nbsp;<span style="color:#c00000;">&quot;a&quot;</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e;</span><br><br><span style="color:#0000ff;">print</span>&nbsp;<span style="color:#c00000;">&quot;a&quot;</span><span style="color:#000000;">;</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/model_filter_default.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/model_filter_default.model.graphml index aa675d0556f8ba382c190fb74777563218f929b4..4978ea7964da43d853103fda3c25c0bceed495ff 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/model_filter_default.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/model_filter_default.model.graphml @@ -34,7 +34,7 @@ Declarations - <html><span style="color:#0000ff;">alphabet</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">monitor</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span><br><br><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">x</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">const</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#402020;">[</span><span style="color:#006100;">1</span><span style="color:#402020;">..</span><span style="color:#006100;">1</span><span style="color:#402020;">]</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#006100;">1</span><span style="color:#402020;">;</span><br><br><span style="color:#0000ff;">initial</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">2</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">marked</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">2</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">2</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">alphabet</span>&nbsp;<span style="color:#000000;">e;</span><br><span style="color:#0000ff;">monitor</span>&nbsp;<span style="color:#000000;">e;</span><br><br><span style="color:#0000ff;">disc</span>&nbsp;<span style="color:#0000ff;">int</span>&nbsp;<span style="color:#000000;">x;</span><br><span style="color:#0000ff;">const</span>&nbsp;<span style="color:#0000ff;">int</span><span style="color:#000000;">[</span><span style="color:#006100;">1</span><span style="color:#000000;">..</span><span style="color:#006100;">1</span><span style="color:#000000;">]</span>&nbsp;<span style="color:#000000;">y</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#006100;">1</span><span style="color:#000000;">;</span><br><br><span style="color:#0000ff;">initial</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">2</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">marked</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">2</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">2</span><span style="color:#000000;">;</span></html> @@ -87,7 +87,7 @@ - <html><span style="color:#000000;">e</span><br><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#000000;">y</span><br><span style="color:#0000ff;">now</span><br><span style="color:#0000ff;">do</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">:=</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">+</span>&nbsp;<span style="color:#006100;">1</span></html> + <html><span style="color:#000000;">e</span><br><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#000000;">y</span><br><span style="color:#0000ff;">now</span><br><span style="color:#0000ff;">do</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">:=</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">+</span>&nbsp;<span style="color:#006100;">1</span></html> @@ -123,7 +123,7 @@ Declarations - <html><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">c;</span></html> @@ -147,7 +147,7 @@ - <html><span style="color:#000000;">loc1</span><br><br><span style="color:#0000ff;">equation</span>&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">'</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#006100;">5.0</span><span style="color:#402020;">;</span></html> + <html><span style="color:#000000;">loc1</span><br><br><span style="color:#0000ff;">equation</span>&nbsp;<span style="color:#000000;">c'</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#006100;">5.0</span><span style="color:#000000;">;</span></html> @@ -158,7 +158,7 @@ - <html><span style="color:#000000;">e</span><br><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">c</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#006100;">2</span><br><span style="color:#0000ff;">do</span>&nbsp;<span style="color:#000000;">c</span>&nbsp;<span style="color:#402020;">:=</span>&nbsp;<span style="color:#006100;">0.0</span></html> + <html><span style="color:#000000;">e</span><br><span style="color:#0000ff;">when</span>&nbsp;<span style="color:#000000;">c</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#006100;">2</span><br><span style="color:#0000ff;">do</span>&nbsp;<span style="color:#000000;">c</span>&nbsp;<span style="color:#000000;">:=</span>&nbsp;<span style="color:#006100;">0.0</span></html> @@ -167,7 +167,7 @@ - <html><span style="color:#000000;">loc2</span><br><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">a.x</span>&nbsp;<span style="color:#402020;">&gt;</span>&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">equation</span>&nbsp;<span style="color:#000000;">c</span><span style="color:#402020;">'</span>&nbsp;<span style="color:#402020;">=</span>&nbsp;<span style="color:#006100;">6.0</span><span style="color:#402020;">;</span><br><span style="color:#0000ff;">urgent</span><span style="color:#402020;">;</span></html> + <html><span style="color:#000000;">loc2</span><br><br><span style="color:#0000ff;">invariant</span>&nbsp;<span style="color:#000000;">a.x</span>&nbsp;<span style="color:#000000;">&gt;</span>&nbsp;<span style="color:#000000;">c;</span><br><span style="color:#0000ff;">equation</span>&nbsp;<span style="color:#000000;">c'</span>&nbsp;<span style="color:#000000;">=</span>&nbsp;<span style="color:#006100;">6.0</span><span style="color:#000000;">;</span><br><span style="color:#0000ff;">urgent</span><span style="color:#000000;">;</span></html> @@ -183,7 +183,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e;</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/rel_cont_der.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/rel_cont_der.model.graphml index 3972df415148b95911549cdabef9c435a6f8ef1f..3cc8534c60a572281679844083d436d45fefe6ef 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/rel_cont_der.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/rel_cont_der.model.graphml @@ -12,7 +12,7 @@ Declarations - <html><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#0000ff;">der</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#402020;">+</span>&nbsp;<span style="color:#000000;">x</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">cont</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#0000ff;">der</span>&nbsp;<span style="color:#000000;">x</span>&nbsp;<span style="color:#000000;">+</span>&nbsp;<span style="color:#000000;">x;</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/small.model.graphml b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/small.model.graphml index 69eecb6dceef6720c8612d573840abc264309780..5700298aa9ea9b450da440b38adb664b3d50cc2f 100644 --- a/cif/org.eclipse.escet.cif.tests/tests/cif2yed/small.model.graphml +++ b/cif/org.eclipse.escet.cif.tests/tests/cif2yed/small.model.graphml @@ -34,7 +34,7 @@ Declarations - <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">event</span>&nbsp;<span style="color:#000000;">e;</span></html> @@ -58,7 +58,7 @@ - <html><span style="color:#0000ff;">marked</span><span style="color:#402020;">;</span></html> + <html><span style="color:#0000ff;">marked</span><span style="color:#000000;">;</span></html> diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/AutNoKindlessCheck.cif b/cif/org.eclipse.escet.cif.tests/tests/common_checks/AutNoKindlessCheck.cif new file mode 100644 index 0000000000000000000000000000000000000000..8495aa53702d8834397f59d440cc49c87c47f3c8 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/AutNoKindlessCheck.cif @@ -0,0 +1,94 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +automaton a1: + location: + initial; +end + +plant p1: + location: + initial; +end + +requirement r1: + location: + initial; +end + +supervisor s1: + location: + initial; +end + +automaton def A1(): + location: + initial; +end + +plant def P1(): + location: + initial; +end + +requirement def R1(): + location: + initial; +end + +supervisor def S1(): + location: + initial; +end + +group g: + automaton a1: + location: + initial; + end + + plant p1: + location: + initial; + end + + requirement r1: + location: + initial; + end + + supervisor s1: + location: + initial; + end + + automaton def A1(): + location: + initial; + end + + plant def P1(): + location: + initial; + end + + requirement def R1(): + location: + initial; + end + + supervisor def S1(): + location: + initial; + end +end diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/AutNoKindlessCheck.cif.check.err b/cif/org.eclipse.escet.cif.tests/tests/common_checks/AutNoKindlessCheck.cif.check.err new file mode 100644 index 0000000000000000000000000000000000000000..ff20491e00b113257db697f83c448322b3f9c8f4 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/AutNoKindlessCheck.cif.check.err @@ -0,0 +1,5 @@ +ERROR: CIF common checks tester failed due to unsatisfied preconditions: + - Unsupported "A1": automaton definition is a kindless automaton, lacking a supervisory kind. + - Unsupported "a1": automaton is a kindless automaton, lacking a supervisory kind. + - Unsupported "g.A1": automaton definition is a kindless automaton, lacking a supervisory kind. + - Unsupported "g.a1": automaton is a kindless automaton, lacking a supervisory kind. diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/AutOnlyWithOneInitLocCheck.cif b/cif/org.eclipse.escet.cif.tests/tests/common_checks/AutOnlyWithOneInitLocCheck.cif new file mode 100644 index 0000000000000000000000000000000000000000..c63cea26c7940155cd5be5433ba7846facad0d57 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/AutOnlyWithOneInitLocCheck.cif @@ -0,0 +1,151 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +event e; + +func int zero(): + return 0; +end + +group auts: + automaton one_init_loc: + location l1: + initial; + edge e goto l2; + location l2: + edge e goto l3; + location l3; + end + + automaton no_init_loc: + location l1: + initial false; + edge e goto l2; + location l2: + edge e goto l3; + location l3: + initial 1 = 2; + end + + automaton two_init_loc: + location l1: + initial; + edge e goto l2; + location l2: + initial true; + edge e goto l3; + location l3; + end + + automaton three_init_loc: + location l1: + initial; + edge e goto l2; + location l2: + initial true; + edge e goto l3; + location l3: + initial 1 = 1; + end + + automaton init_pred_non_static_eval_report_on_loc: + location loc: + initial zero() = 0; + end + + automaton init_pred_non_static_eval_report_on_aut: + location: + initial zero() = 0; + end + + automaton init_pred_eval_error_report_on_loc: + location loc: + initial 1 / 0 = 0; + end + + automaton init_pred_eval_error_report_on_aut: + location: + initial 1 / 0 = 0; + end +end + +group autdefs: + automaton def one_init_loc(): + location l1: + initial; + edge e goto l2; + location l2: + edge e goto l3; + location l3; + end + + automaton def no_init_loc(): + location l1: + initial false; + edge e goto l2; + location l2: + edge e goto l3; + location l3: + initial 1 = 2; + end + + automaton def two_init_loc(): + location l1: + initial; + edge e goto l2; + location l2: + initial true; + edge e goto l3; + location l3; + end + + automaton def three_init_loc(): + location l1: + initial; + edge e goto l2; + location l2: + initial true; + edge e goto l3; + location l3: + initial 1 = 1; + end + + automaton def init_pred_non_static_eval_report_on_loc(): + location loc: + initial zero() = 0; + end + + automaton def init_pred_non_static_eval_report_on_aut(): + location: + initial zero() = 0; + end + + automaton def init_pred_eval_error_report_on_loc(): + location loc: + initial 1 / 0 = 0; + end + + automaton def init_pred_eval_error_report_on_aut(): + location: + initial 1 / 0 = 0; + end +end + +automaton def loc_params_one_initial(location a, b): + location: + initial; +end + +automaton def loc_params_no_initial(location a, b): + location; +end diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/AutOnlyWithOneInitLocCheck.cif.check.err b/cif/org.eclipse.escet.cif.tests/tests/common_checks/AutOnlyWithOneInitLocCheck.cif.check.err new file mode 100644 index 0000000000000000000000000000000000000000..891d3cc2a25b0f6c81f25b96238fefd49b00e39f --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/AutOnlyWithOneInitLocCheck.cif.check.err @@ -0,0 +1,29 @@ +WARNING: File "common_checks/AutOnlyWithOneInitLocCheck.cif": Semantic warning at line 30, column 13: Automaton "auts.no_init_loc" has no initial location. +WARNING: File "common_checks/AutOnlyWithOneInitLocCheck.cif": Semantic warning at line 31, column 14: Location "l1" is not reachable from any of the initial locations of automaton "auts.no_init_loc". +WARNING: File "common_checks/AutOnlyWithOneInitLocCheck.cif": Semantic warning at line 34, column 14: Location "l2" is not reachable from any of the initial locations of automaton "auts.no_init_loc". +WARNING: File "common_checks/AutOnlyWithOneInitLocCheck.cif": Semantic warning at line 36, column 14: Location "l3" is not reachable from any of the initial locations of automaton "auts.no_init_loc". +WARNING: File "common_checks/AutOnlyWithOneInitLocCheck.cif": Semantic warning at line 92, column 17: Automaton "autdefs.no_init_loc" has no initial location. +WARNING: File "common_checks/AutOnlyWithOneInitLocCheck.cif": Semantic warning at line 93, column 14: Location "l1" is not reachable from any of the initial locations of automaton "autdefs.no_init_loc". +WARNING: File "common_checks/AutOnlyWithOneInitLocCheck.cif": Semantic warning at line 96, column 14: Location "l2" is not reachable from any of the initial locations of automaton "autdefs.no_init_loc". +WARNING: File "common_checks/AutOnlyWithOneInitLocCheck.cif": Semantic warning at line 98, column 14: Location "l3" is not reachable from any of the initial locations of automaton "autdefs.no_init_loc". +WARNING: File "common_checks/AutOnlyWithOneInitLocCheck.cif": Semantic warning at line 144, column 47: Location parameter "loc_params_one_initial.a" is not used anywhere in the specification. +WARNING: File "common_checks/AutOnlyWithOneInitLocCheck.cif": Semantic warning at line 144, column 50: Location parameter "loc_params_one_initial.b" is not used anywhere in the specification. +WARNING: File "common_checks/AutOnlyWithOneInitLocCheck.cif": Semantic warning at line 149, column 15: Automaton "loc_params_no_initial" has no initial location. +WARNING: File "common_checks/AutOnlyWithOneInitLocCheck.cif": Semantic warning at line 149, column 46: Location parameter "loc_params_no_initial.a" is not used anywhere in the specification. +WARNING: File "common_checks/AutOnlyWithOneInitLocCheck.cif": Semantic warning at line 149, column 49: Location parameter "loc_params_no_initial.b" is not used anywhere in the specification. +ERROR: CIF common checks tester failed due to unsatisfied preconditions: + - Unsupported "autdefs.init_pred_eval_error_report_on_aut": failed to determine whether the automaton's location is an initial location, as evaluating one of its initialization predicates resulted in an evaluation error. + - Unsupported "autdefs.init_pred_eval_error_report_on_loc.loc": failed to determine whether the location is an initial location, as evaluating one of its initialization predicates resulted in an evaluation error. + - Unsupported "autdefs.init_pred_non_static_eval_report_on_aut": failed to determine whether the automaton's location is an initial location, as one of its initialization predicates cannot be statically evaluated. + - Unsupported "autdefs.init_pred_non_static_eval_report_on_loc.loc": failed to determine whether the location is an initial location, as one of its initialization predicates cannot be statically evaluated. + - Unsupported "autdefs.no_init_loc": automaton definition has no initial location. + - Unsupported "autdefs.three_init_loc": automaton definition has multiple (3) initial locations. + - Unsupported "autdefs.two_init_loc": automaton definition has multiple (2) initial locations. + - Unsupported "auts.init_pred_eval_error_report_on_aut": failed to determine whether the automaton's location is an initial location, as evaluating one of its initialization predicates resulted in an evaluation error. + - Unsupported "auts.init_pred_eval_error_report_on_loc.loc": failed to determine whether the location is an initial location, as evaluating one of its initialization predicates resulted in an evaluation error. + - Unsupported "auts.init_pred_non_static_eval_report_on_aut": failed to determine whether the automaton's location is an initial location, as one of its initialization predicates cannot be statically evaluated. + - Unsupported "auts.init_pred_non_static_eval_report_on_loc.loc": failed to determine whether the location is an initial location, as one of its initialization predicates cannot be statically evaluated. + - Unsupported "auts.no_init_loc": automaton has no initial location. + - Unsupported "auts.three_init_loc": automaton has multiple (3) initial locations. + - Unsupported "auts.two_init_loc": automaton has multiple (2) initial locations. + - Unsupported "loc_params_no_initial": automaton definition has no initial location. diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompNoInitPredsCheck.cif b/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompNoInitPredsCheck.cif new file mode 100644 index 0000000000000000000000000000000000000000..053ed38f1874f74d45231c7c1c0e3e1ab602828d --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompNoInitPredsCheck.cif @@ -0,0 +1,35 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +initial 1 = 1; + +group g: + initial 2 = 2; + initial 3 = 3; + + automaton a: + initial 4 = 4; + location: + initial; + end + + automaton def A(): + initial 4 = 4; + location: + initial 5 = 5; + end + + group def G(): + initial 6 = 6; + end +end diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompNoInitPredsCheck.cif.check.err b/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompNoInitPredsCheck.cif.check.err new file mode 100644 index 0000000000000000000000000000000000000000..98acc05cb4dcb59d687db7b117165a17c83e7f1a --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompNoInitPredsCheck.cif.check.err @@ -0,0 +1,6 @@ +ERROR: CIF common checks tester failed due to unsatisfied preconditions: + - Unsupported "g": group contains an initialization predicate. + - Unsupported "g.a": automaton contains an initialization predicate. + - Unsupported "g.A": automaton definition contains an initialization predicate. + - Unsupported "g.G": group definition contains an initialization predicate. + - Unsupported specification: the top level scope of the specification contains an initialization predicate. diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompOnlyVarValueMarkerPredsCheck.cif b/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompOnlyVarValueMarkerPredsCheck.cif new file mode 100644 index 0000000000000000000000000000000000000000..cff8d8b60a5aa395e38ac76dffaa8ecd4bd4679a --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompOnlyVarValueMarkerPredsCheck.cif @@ -0,0 +1,98 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +automaton ok_marker: + disc bool v in any; + marked v = true; + location: + initial; +end + +automaton double_marker_in_aut: + disc bool v in any; + marked v = true; + marked v = false; + location: + initial; +end + +group double_marker_grp: + automaton double_marker_in_aut_and_grp: + disc bool v in any; + marked v = true; + location: + initial; + end + marked double_marker_in_aut_and_grp.v = false; +end + +automaton double_marker_in_aut_and_spec: + disc bool v in any; + marked v = true; + location: + initial; +end +marked double_marker_in_aut_and_spec.v = false; + +group six_marker: + automaton six_marker: + disc bool v in any; + marked v = true; + marked v = false; + location: + initial; + end + marked six_marker.v = true; + marked six_marker.v = false; +end +marked six_marker.six_marker.v = true; +marked six_marker.six_marker.v = false; + +automaton marker_not_binexpr: + disc bool v in any; + marked v; + location: + initial; +end + +automaton marker_not_equal_binexpr: + disc bool v in any; + marked v and v; + location: + initial; +end + +automaton marker_var_not_on_the_left: + disc bool v in any; + marked true = v; + location: + initial; +end + +// In the CIF metamodel, function parameters and local variables are represented as 'DiscVariable'. +func int func_param_and_local_var(int p): + int v = p; + v := v + 1; + return v; +end + +automaton def AutDef(): + disc int v in any; + marked v = 1; + location: + initial; +end +inst1: AutDef(); +inst2: AutDef(); +marked inst1.v = 2; +marked inst2.v = 3; diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompOnlyVarValueMarkerPredsCheck.cif.check.err b/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompOnlyVarValueMarkerPredsCheck.cif.check.err new file mode 100644 index 0000000000000000000000000000000000000000..bd432ac317af83ce2bfceb376e9f096923baf584 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompOnlyVarValueMarkerPredsCheck.cif.check.err @@ -0,0 +1,9 @@ +ERROR: CIF common checks tester failed due to unsatisfied preconditions: + - Unsupported "double_marker_grp.double_marker_in_aut_and_grp.v": discrete variable has multiple predicates that specify its marked values. + - Unsupported "double_marker_in_aut.v": discrete variable has multiple predicates that specify its marked values. + - Unsupported "double_marker_in_aut_and_spec.v": discrete variable has multiple predicates that specify its marked values. + - Unsupported "marker_not_binexpr": automaton has a marker predicate that is not of the form "discrete_variable = marked_value". + - Unsupported "marker_not_equal_binexpr": automaton has a marker predicate that is not of the form "discrete_variable = marked_value". + - Unsupported "marker_var_not_on_the_left": automaton has a marker predicate that is not of the form "discrete_variable = marked_value". + - Unsupported "six_marker.six_marker.v": discrete variable has multiple predicates that specify its marked values. + - Unsupported specification: the top level scope of the specification has a marker predicate that is not of the form "discrete_variable = marked_value". diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompStateInvsOnlyReqsCheck.cif b/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompStateInvsOnlyReqsCheck.cif new file mode 100644 index 0000000000000000000000000000000000000000..9989510c28a18ae16e6f3547c013de7a4a8bb060 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompStateInvsOnlyReqsCheck.cif @@ -0,0 +1,87 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +invariant 1 = 1; +invariant 2 = 2; +plant 3 = 3; +plant 4 = 4; + +group state_inv: + invariant 1 = 1; + + group p: + plant invariant 2 = 2; + end + + group req: + requirement invariant 3 = 3; + end + + group sup: + supervisor invariant 4 = 4; + end + + group def Kindless(): + invariant 1 = 1; + end + + group def Pl(): + plant invariant 2 = 2; + end + + group def Req(): + requirement invariant 3 = 3; + end + + automaton def Sup(): + supervisor invariant 4 = 4; + location: + initial; + end +end + +group state_event_excl_inv: + event e; + + invariant e needs 1 = 1; + + group p: + plant invariant e needs 2 = 2; + end + + group req: + requirement invariant e needs 3 = 3; + end + + group sup: + supervisor invariant e needs 4 = 4; + end + + group def Kindless(): + invariant e needs 1 = 1; + end + + group def Pl(): + plant invariant e needs 2 = 2; + end + + group def Req(): + requirement invariant e needs 3 = 3; + end + + automaton def Sup(): + supervisor invariant e needs 4 = 4; + location: + initial; + end +end diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompStateInvsOnlyReqsCheck.cif.check.err b/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompStateInvsOnlyReqsCheck.cif.check.err new file mode 100644 index 0000000000000000000000000000000000000000..6fc8b476a376f80447153824936e2b9d5b4a68db --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/CompStateInvsOnlyReqsCheck.cif.check.err @@ -0,0 +1,9 @@ +ERROR: CIF common checks tester failed due to unsatisfied preconditions: + - Unsupported "state_inv": group has a kindless state invariant. + - Unsupported "state_inv.Kindless": group definition has a kindless state invariant. + - Unsupported "state_inv.p": group has a plant state invariant. + - Unsupported "state_inv.Pl": group definition has a plant state invariant. + - Unsupported "state_inv.Sup": automaton definition has a supervisor state invariant. + - Unsupported "state_inv.sup": group has a supervisor state invariant. + - Unsupported specification: the top level scope of the specification has a kindless state invariant. + - Unsupported specification: the top level scope of the specification has a plant state invariant. diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoIfUpdatesCheck.cif b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoIfUpdatesCheck.cif new file mode 100644 index 0000000000000000000000000000000000000000..396bdaffba2552ffa954ea24ba13fd1d95e7b83d --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoIfUpdatesCheck.cif @@ -0,0 +1,94 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +event e; + +automaton a: + disc int va, vb; + disc list[3] int li; + + location l1: + initial; + edge e goto l2; // No update. + location l2: + edge e do va := 1, vb := 2 goto l3; // Multiple simple updates. + location l3: + edge e do (va, vb) := (1, 2) goto l4; // Multi-assignment. + location l4: + edge e do li[0] := 1 goto l5; // Partial assignment. + location l5: + edge e do if true: va := 1 end goto l1; // 'if' update. +end + +automaton multi_asgn: + disc int va, vb; + + location: + initial; + edge e do (va, vb) := (1, 2); // Multi-assignment. +end + +automaton partial_asgn: + disc list[3] int li; + + location: + initial; + edge e do li[0] := 1; // Partial assignment. +end + +automaton if_upd: + disc int v; + + location: + initial; + edge e do if true: v := 1 end; // 'if' update. +end + +group g: + automaton def A(): + disc int va, vb; + disc list[3] int li; + + location l1: + initial; + edge e goto l2; // No update. + location l2: + edge e do va := 1, vb := 2 goto l3; // Multiple simple updates. + location l3: + edge e do (va, vb) := (1, 2) goto l4; // Multi-assignment. + location l4: + edge e do li[0] := 1 goto l5; // Partial assignment. + location l5: + edge e do if true: va := 1 end goto l1; // 'if' update. + end +end + +automaton all: + disc int va, vb; + disc list[3] int li; + + location: + initial; + edge e; // No update. + edge e do va := 1, vb := 2; // Multiple simple updates. + edge e do va := 3, vb := 4; // Multiple simple updates. + + edge e do (va, vb) := (1, 2); // Multi-assignment. + edge e do (vb, va) := (3, 4); // Multi-assignment. + + edge e do li[0] := 1; // Partial assignment. + edge e do li[1] := 2; // Partial assignment. + + edge e do if true: va := 1 end; // 'if' update. + edge e do if true: va := 1 end; // 'if' update. +end diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoIfUpdatesCheck.cif.check.err b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoIfUpdatesCheck.cif.check.err new file mode 100644 index 0000000000000000000000000000000000000000..d984afdaeb1412c040c15d8eaf26bb3ccae91784 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoIfUpdatesCheck.cif.check.err @@ -0,0 +1,5 @@ +ERROR: CIF common checks tester failed due to unsatisfied preconditions: + - Unsupported "a.l5": location has an edge with an 'if' update. + - Unsupported "all": automaton has an edge with an 'if' update. + - Unsupported "g.A.l5": location has an edge with an 'if' update. + - Unsupported "if_upd": automaton has an edge with an 'if' update. diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoMultiAssignCheck.cif b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoMultiAssignCheck.cif new file mode 100644 index 0000000000000000000000000000000000000000..72fd3b4f6eed85473ac91675a95c1f4355b6777e --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoMultiAssignCheck.cif @@ -0,0 +1,95 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +event e; + +automaton a: + disc int va, vb; + disc list[3] int li; + + location l1: + initial; + edge e goto l2; // No update. + location l2: + edge e do va := 1, vb := 2 goto l3; // Multiple simple updates. + location l3: + edge e do (va, vb) := (1, 2) goto l4; // Multi-assignment. + location l4: + edge e do li[0] := 1 goto l5; // Partial assignment. + location l5: + edge e do if true: va := 1 end goto l1; // 'if' update. +end + +automaton multi_asgn: + disc int va, vb; + + location: + initial; + edge e do (va, vb) := (1, 2); // Multi-assignment. +end + +automaton partial_asgn: + disc list[3] int li; + + location: + initial; + edge e do li[0] := 1; // Partial assignment. +end + +automaton if_upd: + disc int v; + + location: + initial; + edge e do if true: v := 1 end; // 'if' update. +end + +group g: + automaton def A(): + disc int va, vb; + disc list[3] int li; + + location l1: + initial; + edge e goto l2; // No update. + location l2: + edge e do va := 1, vb := 2 goto l3; // Multiple simple updates. + location l3: + edge e do (va, vb) := (1, 2) goto l4; // Multi-assignment. + location l4: + edge e do li[0] := 1 goto l5; // Partial assignment. + location l5: + edge e do if true: va := 1 end goto l1; // 'if' update. + end +end + +automaton all: + disc int va, vb; + disc list[3] int li; + + location: + initial; + edge e; // No update. + + edge e do va := 1, vb := 2; // Multiple simple updates. + edge e do va := 3, vb := 4; // Multiple simple updates. + + edge e do (va, vb) := (1, 2); // Multi-assignment. + edge e do (vb, va) := (3, 4); // Multi-assignment. + + edge e do li[0] := 1; // Partial assignment. + edge e do li[1] := 2; // Partial assignment. + + edge e do if true: va := 1 end; // 'if' update. + edge e do if true: va := 1 end; // 'if' update. +end diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoMultiAssignCheck.cif.check.err b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoMultiAssignCheck.cif.check.err new file mode 100644 index 0000000000000000000000000000000000000000..6ace0e0ea131369e4fd33b259491782c2d76d26a --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoMultiAssignCheck.cif.check.err @@ -0,0 +1,5 @@ +ERROR: CIF common checks tester failed due to unsatisfied preconditions: + - Unsupported "a.l3": location has an edge with a multi-assignment. + - Unsupported "all": automaton has an edge with a multi-assignment. + - Unsupported "g.A.l3": location has an edge with a multi-assignment. + - Unsupported "multi_asgn": automaton has an edge with a multi-assignment. diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoPartialVarAssignCheck.cif b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoPartialVarAssignCheck.cif new file mode 100644 index 0000000000000000000000000000000000000000..72fd3b4f6eed85473ac91675a95c1f4355b6777e --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoPartialVarAssignCheck.cif @@ -0,0 +1,95 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +event e; + +automaton a: + disc int va, vb; + disc list[3] int li; + + location l1: + initial; + edge e goto l2; // No update. + location l2: + edge e do va := 1, vb := 2 goto l3; // Multiple simple updates. + location l3: + edge e do (va, vb) := (1, 2) goto l4; // Multi-assignment. + location l4: + edge e do li[0] := 1 goto l5; // Partial assignment. + location l5: + edge e do if true: va := 1 end goto l1; // 'if' update. +end + +automaton multi_asgn: + disc int va, vb; + + location: + initial; + edge e do (va, vb) := (1, 2); // Multi-assignment. +end + +automaton partial_asgn: + disc list[3] int li; + + location: + initial; + edge e do li[0] := 1; // Partial assignment. +end + +automaton if_upd: + disc int v; + + location: + initial; + edge e do if true: v := 1 end; // 'if' update. +end + +group g: + automaton def A(): + disc int va, vb; + disc list[3] int li; + + location l1: + initial; + edge e goto l2; // No update. + location l2: + edge e do va := 1, vb := 2 goto l3; // Multiple simple updates. + location l3: + edge e do (va, vb) := (1, 2) goto l4; // Multi-assignment. + location l4: + edge e do li[0] := 1 goto l5; // Partial assignment. + location l5: + edge e do if true: va := 1 end goto l1; // 'if' update. + end +end + +automaton all: + disc int va, vb; + disc list[3] int li; + + location: + initial; + edge e; // No update. + + edge e do va := 1, vb := 2; // Multiple simple updates. + edge e do va := 3, vb := 4; // Multiple simple updates. + + edge e do (va, vb) := (1, 2); // Multi-assignment. + edge e do (vb, va) := (3, 4); // Multi-assignment. + + edge e do li[0] := 1; // Partial assignment. + edge e do li[1] := 2; // Partial assignment. + + edge e do if true: va := 1 end; // 'if' update. + edge e do if true: va := 1 end; // 'if' update. +end diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoPartialVarAssignCheck.cif.check.err b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoPartialVarAssignCheck.cif.check.err new file mode 100644 index 0000000000000000000000000000000000000000..e6141e799947da9d9521d0d183bf69851708c715 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoPartialVarAssignCheck.cif.check.err @@ -0,0 +1,5 @@ +ERROR: CIF common checks tester failed due to unsatisfied preconditions: + - Unsupported "a.l4": location has an edge with a partial variable assignment. + - Unsupported "all": automaton has an edge with a partial variable assignment. + - Unsupported "g.A.l4": location has an edge with a partial variable assignment. + - Unsupported "partial_asgn": automaton has an edge with a partial variable assignment. diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoUrgentCheck.cif b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoUrgentCheck.cif new file mode 100644 index 0000000000000000000000000000000000000000..01aa74c3d572b37a1dd38ce715816cd16d478266 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoUrgentCheck.cif @@ -0,0 +1,40 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +event e; + +automaton a: + location l1: + initial; + edge e goto l2; // Non-urgent. + location l2: + edge e now goto l3; // Urgent. + location l3: + edge e goto l4; // Non-urgent. + location l4: + edge e now goto l1; // Urgent. +end + +group g: + automaton def A(): + location l1: + initial; + edge e goto l2; // Non-urgent. + location l2: + edge e now goto l3; // Urgent. + location l3: + edge e goto l4; // Non-urgent. + location l4: + edge e now goto l1; // Urgent. + end +end diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoUrgentCheck.cif.check.err b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoUrgentCheck.cif.check.err new file mode 100644 index 0000000000000000000000000000000000000000..87ec44bb83f1fb179a369bd4a87dc9696ff7893c --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeNoUrgentCheck.cif.check.err @@ -0,0 +1,5 @@ +ERROR: CIF common checks tester failed due to unsatisfied preconditions: + - Unsupported "a.l2": location has an urgent edge. + - Unsupported "a.l4": location has an urgent edge. + - Unsupported "g.A.l2": location has an urgent edge. + - Unsupported "g.A.l4": location has an urgent edge. diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeOnlySimpleAssignmentsCheck.cif b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeOnlySimpleAssignmentsCheck.cif new file mode 100644 index 0000000000000000000000000000000000000000..72fd3b4f6eed85473ac91675a95c1f4355b6777e --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeOnlySimpleAssignmentsCheck.cif @@ -0,0 +1,95 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +event e; + +automaton a: + disc int va, vb; + disc list[3] int li; + + location l1: + initial; + edge e goto l2; // No update. + location l2: + edge e do va := 1, vb := 2 goto l3; // Multiple simple updates. + location l3: + edge e do (va, vb) := (1, 2) goto l4; // Multi-assignment. + location l4: + edge e do li[0] := 1 goto l5; // Partial assignment. + location l5: + edge e do if true: va := 1 end goto l1; // 'if' update. +end + +automaton multi_asgn: + disc int va, vb; + + location: + initial; + edge e do (va, vb) := (1, 2); // Multi-assignment. +end + +automaton partial_asgn: + disc list[3] int li; + + location: + initial; + edge e do li[0] := 1; // Partial assignment. +end + +automaton if_upd: + disc int v; + + location: + initial; + edge e do if true: v := 1 end; // 'if' update. +end + +group g: + automaton def A(): + disc int va, vb; + disc list[3] int li; + + location l1: + initial; + edge e goto l2; // No update. + location l2: + edge e do va := 1, vb := 2 goto l3; // Multiple simple updates. + location l3: + edge e do (va, vb) := (1, 2) goto l4; // Multi-assignment. + location l4: + edge e do li[0] := 1 goto l5; // Partial assignment. + location l5: + edge e do if true: va := 1 end goto l1; // 'if' update. + end +end + +automaton all: + disc int va, vb; + disc list[3] int li; + + location: + initial; + edge e; // No update. + + edge e do va := 1, vb := 2; // Multiple simple updates. + edge e do va := 3, vb := 4; // Multiple simple updates. + + edge e do (va, vb) := (1, 2); // Multi-assignment. + edge e do (vb, va) := (3, 4); // Multi-assignment. + + edge e do li[0] := 1; // Partial assignment. + edge e do li[1] := 2; // Partial assignment. + + edge e do if true: va := 1 end; // 'if' update. + edge e do if true: va := 1 end; // 'if' update. +end diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeOnlySimpleAssignmentsCheck.cif.check.err b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeOnlySimpleAssignmentsCheck.cif.check.err new file mode 100644 index 0000000000000000000000000000000000000000..9237ade1c5f56736f8b72dde27f7e372d27a1dfc --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EdgeOnlySimpleAssignmentsCheck.cif.check.err @@ -0,0 +1,13 @@ +ERROR: CIF common checks tester failed due to unsatisfied preconditions: + - Unsupported "a.l3": location has an edge with a multi-assignment. + - Unsupported "a.l4": location has an edge with a partial variable assignment. + - Unsupported "a.l5": location has an edge with an 'if' update. + - Unsupported "all": automaton has an edge with a multi-assignment. + - Unsupported "all": automaton has an edge with a partial variable assignment. + - Unsupported "all": automaton has an edge with an 'if' update. + - Unsupported "g.A.l3": location has an edge with a multi-assignment. + - Unsupported "g.A.l4": location has an edge with a partial variable assignment. + - Unsupported "g.A.l5": location has an edge with an 'if' update. + - Unsupported "if_upd": automaton has an edge with an 'if' update. + - Unsupported "multi_asgn": automaton has an edge with a multi-assignment. + - Unsupported "partial_asgn": automaton has an edge with a partial variable assignment. diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventNoChannelsCheck.cif b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventNoChannelsCheck.cif new file mode 100644 index 0000000000000000000000000000000000000000..7fa7719fea3b7fb7cdc9ba69e09a840aafcde130 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventNoChannelsCheck.cif @@ -0,0 +1,34 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +event e; +event void c1; +event int c2; + +group g: + event e; + event void c1; + event int c2; + + automaton a: + event e; + controllable void c1; + uncontrollable int c2; + + location: + initial; + end +end + +group def G(event e; event void c1; event int c2): +end diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventNoChannelsCheck.cif.check.err b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventNoChannelsCheck.cif.check.err new file mode 100644 index 0000000000000000000000000000000000000000..2d25da5a522ec848f0291c4307b0c075cdb9671c --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventNoChannelsCheck.cif.check.err @@ -0,0 +1,21 @@ +WARNING: File "common_checks/EventNoChannelsCheck.cif": Semantic warning at line 14, column 7: Event "e" is not used anywhere in the specification. +WARNING: File "common_checks/EventNoChannelsCheck.cif": Semantic warning at line 15, column 12: Event "c1" is not used anywhere in the specification. +WARNING: File "common_checks/EventNoChannelsCheck.cif": Semantic warning at line 16, column 11: Event "c2" is not used anywhere in the specification. +WARNING: File "common_checks/EventNoChannelsCheck.cif": Semantic warning at line 19, column 9: Event "g.e" is not used anywhere in the specification. +WARNING: File "common_checks/EventNoChannelsCheck.cif": Semantic warning at line 20, column 14: Event "g.c1" is not used anywhere in the specification. +WARNING: File "common_checks/EventNoChannelsCheck.cif": Semantic warning at line 21, column 13: Event "g.c2" is not used anywhere in the specification. +WARNING: File "common_checks/EventNoChannelsCheck.cif": Semantic warning at line 24, column 11: Event "g.a.e" is not used anywhere in the specification. +WARNING: File "common_checks/EventNoChannelsCheck.cif": Semantic warning at line 25, column 23: Event "g.a.c1" is not used anywhere in the specification. +WARNING: File "common_checks/EventNoChannelsCheck.cif": Semantic warning at line 26, column 24: Event "g.a.c2" is not used anywhere in the specification. +WARNING: File "common_checks/EventNoChannelsCheck.cif": Semantic warning at line 33, column 19: Event parameter "G.e" is not used anywhere in the specification. +WARNING: File "common_checks/EventNoChannelsCheck.cif": Semantic warning at line 33, column 33: Event parameter "G.c1" is not used anywhere in the specification. +WARNING: File "common_checks/EventNoChannelsCheck.cif": Semantic warning at line 33, column 47: Event parameter "G.c2" is not used anywhere in the specification. +ERROR: CIF common checks tester failed due to unsatisfied preconditions: + - Unsupported "c1": event is a channel (has a data type). + - Unsupported "c2": event is a channel (has a data type). + - Unsupported "g.a.c1": event is a channel (has a data type). + - Unsupported "g.a.c2": event is a channel (has a data type). + - Unsupported "g.c1": event is a channel (has a data type). + - Unsupported "G.c1": event parameter is a channel (has a data type). + - Unsupported "g.c2": event is a channel (has a data type). + - Unsupported "G.c2": event parameter is a channel (has a data type). diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventNoTauCheck.cif b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventNoTauCheck.cif new file mode 100644 index 0000000000000000000000000000000000000000..0422d86d9ec91708298f52ddf18737578ae4221d --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventNoTauCheck.cif @@ -0,0 +1,35 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +automaton a1: + location: + initial; + edge when true; + edge tau; +end + +event e; + +automaton a2: + location l1: + initial; + edge when true goto l2; + location l2: + edge tau goto l3; + location l3: + edge tau, tau goto l4; + location l4: + edge e, tau goto l5; + location l5: + edge e goto l1; +end diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventNoTauCheck.cif.check.err b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventNoTauCheck.cif.check.err new file mode 100644 index 0000000000000000000000000000000000000000..d93c87dced2939f79fda1a62f1442ca03f5e683e --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventNoTauCheck.cif.check.err @@ -0,0 +1,9 @@ +WARNING: File "common_checks/EventNoTauCheck.cif": Semantic warning at line 30, column 10: Duplicate event "tau" on a single edge in automaton "a2". +WARNING: File "common_checks/EventNoTauCheck.cif": Semantic warning at line 30, column 15: Duplicate event "tau" on a single edge in automaton "a2". +ERROR: CIF common checks tester failed due to unsatisfied preconditions: + - Unsupported "a1": automaton has an edge with an explicit "tau" event on it. + - Unsupported "a1": automaton has an edge with an implicit "tau" event on it. + - Unsupported "a2.l1": location has an edge with an implicit "tau" event on it. + - Unsupported "a2.l2": location has an edge with an explicit "tau" event on it. + - Unsupported "a2.l3": location has an edge with an explicit "tau" event on it. + - Unsupported "a2.l4": location has an edge with an explicit "tau" event on it. diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventOnlyWithControllabilityCheck.cif b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventOnlyWithControllabilityCheck.cif new file mode 100644 index 0000000000000000000000000000000000000000..112e964b0236a569ce139490633bfb3ff66269bb --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventOnlyWithControllabilityCheck.cif @@ -0,0 +1,47 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +automaton tau_a1: + location: + initial; + edge when true; + edge tau; +end + +event e; + +automaton tau_a2: + location l1: + initial; + edge when true goto l2; + location l2: + edge tau goto l3; + location l3: + edge tau, tau goto l4; + location l4: + edge e, tau goto l5; + location l5: + edge e goto l1; +end + +group g: + event e; + controllable c; + uncontrollable u; + + automaton def A(event e2; controllable c2; uncontrollable u2): + location: + initial; + edge e, c, u, e2, c2, u2; + end +end diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventOnlyWithControllabilityCheck.cif.check.err b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventOnlyWithControllabilityCheck.cif.check.err new file mode 100644 index 0000000000000000000000000000000000000000..1f8d1f3fdf9a22f3bf06907d40e26ff73662704a --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/EventOnlyWithControllabilityCheck.cif.check.err @@ -0,0 +1,12 @@ +WARNING: File "common_checks/EventOnlyWithControllabilityCheck.cif": Semantic warning at line 30, column 10: Duplicate event "tau" on a single edge in automaton "tau_a2". +WARNING: File "common_checks/EventOnlyWithControllabilityCheck.cif": Semantic warning at line 30, column 15: Duplicate event "tau" on a single edge in automaton "tau_a2". +ERROR: CIF common checks tester failed due to unsatisfied preconditions: + - Unsupported "e": event is not declared as controllable or uncontrollable. + - Unsupported "g.A.e2": event parameter is not declared as controllable or uncontrollable. + - Unsupported "g.e": event is not declared as controllable or uncontrollable. + - Unsupported "tau_a1": automaton has an edge with an explicit "tau" event on it, which is not controllable or uncontrollable. + - Unsupported "tau_a1": automaton has an edge with an implicit "tau" event on it, which is not controllable or uncontrollable. + - Unsupported "tau_a2.l1": location has an edge with an implicit "tau" event on it, which is not controllable or uncontrollable. + - Unsupported "tau_a2.l2": location has an edge with an explicit "tau" event on it, which is not controllable or uncontrollable. + - Unsupported "tau_a2.l3": location has an edge with an explicit "tau" event on it, which is not controllable or uncontrollable. + - Unsupported "tau_a2.l4": location has an edge with an explicit "tau" event on it, which is not controllable or uncontrollable. diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel0.cif b/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel0.cif new file mode 100644 index 0000000000000000000000000000000000000000..ca310fd684fbd5a5d68ec110b34c20218bce031d --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel0.cif @@ -0,0 +1,211 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +// Top level scope. +invariant 1 < 2; + +// Group. +group grp: + invariant 1 < 2; +end + +// Nested group. +group nested_grp: + group nested_grp: + invariant 1 < 2; + end +end + +// With type declarations. +group type_decl: + type t = int; // rangeless int + alg t a = 1; + invariant a < a; // rangeless int +end + +// ADDITION. +group ADDITION_NUMBERS: + input int i; + invariant GG: 1 + 1 > 0; + invariant IG: i + 1 > 0; + invariant GI: 1 + i > 0; + invariant II: i + i > 0; + invariant GR: 1 + 1.0 > 0; + invariant RG: 1.0 + 1 > 0; + invariant RR: 1.0 + 1.0 > 0; +end + +// ADDITION_LISTS. +group ADDITION_LISTS: + invariant empty([1] + [1]); +end + +// ADDITION_STRINGS. +group ADDITION_STRINGS: + invariant "a" + "a" = "aa"; +end + +// ADDITION_DICTS. +group ADDITION_DICTS: + invariant empty({true: false} + {false: true}); +end + +// BI_CONDITIONAL. +group BI_CONDITIONAL: + invariant true <=> false; +end + +// CONJUNCTION. +group CONJUNCTION: + invariant BB: true and false; + invariant SS: empty({true} and {false}); +end + +// DISJUNCTION. +group DISJUNCTION: + invariant BB: true or false; + invariant SS: empty({true} or {false}); +end + +// DIVISION. +group DIVISION: + invariant II: 1 / 1 = 0; + invariant IR: 1 / 1.0 = 0; + invariant RI: 1.0 / 1 = 0; + invariant RR: 1.0 / 1.0 = 0; +end + +// ELEMENT_OF_LISTS. +group ELEMENT_OF_LISTS: + invariant 1 in [1]; +end + +// ELEMENT_OF_SETS. +group ELEMENT_OF_SETS: + invariant 1 in {1}; +end + +// ELEMENT_OF_DICTS. +group ELEMENT_OF_DICTS: + invariant 1 in {1: 2}; +end + +// EQUAL. +group EQUAL: + invariant 1 = 1; +end + +// GREATER_EQUAL. +group GREATER_EQUAL: + input int i; + invariant GG: 1 >= 1; + invariant II: i >= i; + invariant IR: 1 >= 1.0; + invariant RI: 1.0 >= 1; + invariant RR: 1.0 >= 1.0; +end + +// GREATER_THAN. +group GREATER_THAN: + input int i; + invariant GG: 1 > 1; + invariant II: i > i; + invariant IR: 1 > 1.0; + invariant RI: 1.0 > 1; + invariant RR: 1.0 > 1.0; +end + +// IMPLICATION. +group IMPLICATION: + invariant true => false; +end + +// INTEGER_DIVISION. +group INTEGER_DIVISION: + input int i; + invariant GG: 1 div 1 = 0; + invariant GI: 1 div i = 0; + invariant IG: i div 1 = 0; + invariant II: i div i = 0; +end + +// LESS_EQUAL. +group LESS_EQUAL: + input int i; + invariant GG: 1 <= 1; + invariant II: i <= i; + invariant IR: 1 <= 1.0; + invariant RI: 1.0 <= 1; + invariant RR: 1.0 <= 1.0; +end + +// LESS_THAN. +group LESS_THAN: + input int i; + invariant GG: 1 < 1; + invariant II: i < i; + invariant IR: 1 < 1.0; + invariant RI: 1.0 < 1; + invariant RR: 1.0 < 1.0; +end + +// MODULUS. +group MODULUS: + input int i; + invariant GG: 1 mod 1 = 0; + invariant GI: 1 mod i = 0; + invariant IG: 1 mod 1 = 0; + invariant II: i mod i = 0; +end + +// MULTIPLICATION. +group MULTIPLICATION: + input int i; + invariant GG: 1 * 1 = 0; + invariant II: i * i = 0; + invariant IR: 1 * 1.0 = 0; + invariant RI: 1.0 * 1 = 0; + invariant RR: 1.0 * 1.0 = 0; +end + +// SUBSET. +group SUBSET: + invariant {true} sub {false}; +end + +// SUBTRACTION_NUMBERS. +group SUBTRACTION_NUMBERS: + input int i; + invariant GG: 1 - 1 > 0; + invariant IG: i - 1 > 0; + invariant GI: 1 - i > 0; + invariant II: i - i > 0; + invariant GR: 1 - 1.0 > 0; + invariant RG: 1.0 - 1 > 0; + invariant RR: 1.0 - 1.0 > 0; +end + +// SUBTRACTION_CONTAINERS. +group SUBTRACTION_CONTAINERS: + input int i; + invariant SS: empty({true} - {false}); + invariant DD: empty({1: 2} - {1: 2}); + invariant DS: empty({1: 2} - {1}); + invariant DLG: empty({1: 2} - [1]); + invariant DLI: empty({1: 2} - [i]); +end + +// UNEQUAL. +group UNEQUAL: + invariant 1 != 1; +end diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel0.cif.check.err b/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel0.cif.check.err new file mode 100644 index 0000000000000000000000000000000000000000..13302ec4cfe210c021d3ff0ee8d0a513e4265c0d --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel0.cif.check.err @@ -0,0 +1,62 @@ +ERROR: CIF common checks tester failed due to unsatisfied preconditions: + - Unsupported "ADDITION_DICTS": uses binary operator "+" in binary expression "{true: false} + {false: true}". + - Unsupported "ADDITION_LISTS": uses binary operator "+" in binary expression "[1] + [1]". + - Unsupported "ADDITION_NUMBERS.GG": uses binary operator "+" in binary expression "1 + 1". + - Unsupported "ADDITION_NUMBERS.GI": uses binary operator "+" in binary expression "1 + ADDITION_NUMBERS.i". + - Unsupported "ADDITION_NUMBERS.GR": uses binary operator "+" in binary expression "1 + 1.0". + - Unsupported "ADDITION_NUMBERS.IG": uses binary operator "+" in binary expression "ADDITION_NUMBERS.i + 1". + - Unsupported "ADDITION_NUMBERS.II": uses binary operator "+" in binary expression "ADDITION_NUMBERS.i + ADDITION_NUMBERS.i". + - Unsupported "ADDITION_NUMBERS.RG": uses binary operator "+" in binary expression "1.0 + 1.0". + - Unsupported "ADDITION_NUMBERS.RR": uses binary operator "+" in binary expression "1.0 + 1.0". + - Unsupported "ADDITION_STRINGS": uses binary operator "+" in binary expression ""a" + "a"". + - Unsupported "ADDITION_STRINGS": uses binary operator "=" in binary expression ""a" + "a" = "aa"". + - Unsupported "CONJUNCTION.BB": uses binary operator "and" in binary expression "true and false". + - Unsupported "CONJUNCTION.SS": uses binary operator "and" in binary expression "{true} and {false}". + - Unsupported "DISJUNCTION.BB": uses binary operator "or" in binary expression "true or false". + - Unsupported "DISJUNCTION.SS": uses binary operator "or" in binary expression "{true} or {false}". + - Unsupported "DIVISION.II": uses binary operator "/" in binary expression "1 / 1". + - Unsupported "DIVISION.II": uses binary operator "=" in binary expression "1 / 1 = 0.0". + - Unsupported "DIVISION.IR": uses binary operator "/" in binary expression "1 / 1.0". + - Unsupported "DIVISION.IR": uses binary operator "=" in binary expression "1 / 1.0 = 0.0". + - Unsupported "DIVISION.RI": uses binary operator "/" in binary expression "1.0 / 1". + - Unsupported "DIVISION.RI": uses binary operator "=" in binary expression "1.0 / 1 = 0.0". + - Unsupported "DIVISION.RR": uses binary operator "/" in binary expression "1.0 / 1.0". + - Unsupported "DIVISION.RR": uses binary operator "=" in binary expression "1.0 / 1.0 = 0.0". + - Unsupported "EQUAL": uses binary operator "=" in binary expression "1 = 1". + - Unsupported "IMPLICATION": uses binary operator "=>" in binary expression "true => false". + - Unsupported "INTEGER_DIVISION.GG": uses binary operator "=" in binary expression "1 div 1 = 0". + - Unsupported "INTEGER_DIVISION.GI": uses binary operator "=" in binary expression "1 div INTEGER_DIVISION.i = 0". + - Unsupported "INTEGER_DIVISION.IG": uses binary operator "=" in binary expression "INTEGER_DIVISION.i div 1 = 0". + - Unsupported "INTEGER_DIVISION.II": uses binary operator "=" in binary expression "INTEGER_DIVISION.i div INTEGER_DIVISION.i = 0". + - Unsupported "MODULUS.GG": uses binary operator "=" in binary expression "1 mod 1 = 0". + - Unsupported "MODULUS.GG": uses binary operator "mod" in binary expression "1 mod 1". + - Unsupported "MODULUS.GI": uses binary operator "=" in binary expression "1 mod MODULUS.i = 0". + - Unsupported "MODULUS.GI": uses binary operator "mod" in binary expression "1 mod MODULUS.i". + - Unsupported "MODULUS.IG": uses binary operator "=" in binary expression "1 mod 1 = 0". + - Unsupported "MODULUS.IG": uses binary operator "mod" in binary expression "1 mod 1". + - Unsupported "MODULUS.II": uses binary operator "=" in binary expression "MODULUS.i mod MODULUS.i = 0". + - Unsupported "MODULUS.II": uses binary operator "mod" in binary expression "MODULUS.i mod MODULUS.i". + - Unsupported "MULTIPLICATION.GG": uses binary operator "*" in binary expression "1 * 1". + - Unsupported "MULTIPLICATION.GG": uses binary operator "=" in binary expression "1 * 1 = 0". + - Unsupported "MULTIPLICATION.II": uses binary operator "*" in binary expression "MULTIPLICATION.i * MULTIPLICATION.i". + - Unsupported "MULTIPLICATION.II": uses binary operator "=" in binary expression "MULTIPLICATION.i * MULTIPLICATION.i = 0". + - Unsupported "MULTIPLICATION.IR": uses binary operator "*" in binary expression "1 * 1.0". + - Unsupported "MULTIPLICATION.IR": uses binary operator "=" in binary expression "1 * 1.0 = 0.0". + - Unsupported "MULTIPLICATION.RI": uses binary operator "*" in binary expression "1.0 * 1". + - Unsupported "MULTIPLICATION.RI": uses binary operator "=" in binary expression "1.0 * 1 = 0.0". + - Unsupported "MULTIPLICATION.RR": uses binary operator "*" in binary expression "1.0 * 1.0". + - Unsupported "MULTIPLICATION.RR": uses binary operator "=" in binary expression "1.0 * 1.0 = 0.0". + - Unsupported "SUBSET": uses binary operator "sub" in binary expression "{true} sub {false}". + - Unsupported "SUBTRACTION_CONTAINERS.DD": uses binary operator "-" in binary expression "{1: 2} - {1: 2}". + - Unsupported "SUBTRACTION_CONTAINERS.DLG": uses binary operator "-" in binary expression "{1: 2} - [1]". + - Unsupported "SUBTRACTION_CONTAINERS.DLI": uses binary operator "-" in binary expression "{1: 2} - [SUBTRACTION_CONTAINERS.i]". + - Unsupported "SUBTRACTION_CONTAINERS.DS": uses binary operator "-" in binary expression "{1: 2} - {1}". + - Unsupported "SUBTRACTION_CONTAINERS.SS": uses binary operator "-" in binary expression "{true} - {false}". + - Unsupported "SUBTRACTION_NUMBERS.GG": uses binary operator "-" in binary expression "1 - 1". + - Unsupported "SUBTRACTION_NUMBERS.GI": uses binary operator "-" in binary expression "1 - SUBTRACTION_NUMBERS.i". + - Unsupported "SUBTRACTION_NUMBERS.GR": uses binary operator "-" in binary expression "1 - 1.0". + - Unsupported "SUBTRACTION_NUMBERS.IG": uses binary operator "-" in binary expression "SUBTRACTION_NUMBERS.i - 1". + - Unsupported "SUBTRACTION_NUMBERS.II": uses binary operator "-" in binary expression "SUBTRACTION_NUMBERS.i - SUBTRACTION_NUMBERS.i". + - Unsupported "SUBTRACTION_NUMBERS.RG": uses binary operator "-" in binary expression "1.0 - 1.0". + - Unsupported "SUBTRACTION_NUMBERS.RR": uses binary operator "-" in binary expression "1.0 - 1.0". + - Unsupported "UNEQUAL": uses binary operator "!=" in binary expression "1 != 1". diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel1.cif b/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel1.cif new file mode 100644 index 0000000000000000000000000000000000000000..725db5b1bb84da050abf106c097a126fe82334f9 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel1.cif @@ -0,0 +1,211 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +// Top level scope. +invariant 1 < 2; + +// Group. +group grp: + invariant 1 < 2; +end + +// Nested group. +group nested_grp: + group nested_grp: + invariant 1 < 2; + end +end + +// With type declarations. +group type_decl: + type t = int; // rangeless int + alg t a = 1; + invariant a < a; // rangeless int +end + +// ADDITION. +group ADDITION_NUMBERS: + input int i; + invariant GG: 1 + 1 > 0; + invariant IG: i + 1 > 0; + invariant GI: 1 + i > 0; + invariant II: i + i > 0; + invariant GR: 1 + 1.0 > 0; + invariant RG: 1.0 + 1 > 0; + invariant RR: 1.0 + 1.0 > 0; +end + +// ADDITION_LISTS. +group ADDITION_LISTS: + invariant empty([1] + [1]); +end + +// ADDITION_STRINGS. +group ADDITION_STRINGS: + invariant "a" + "a" = "aa"; +end + +// ADDITION_DICTS. +group ADDITION_DICTS: + invariant empty({true: false} + {false: true}); +end + +// BI_CONDITIONAL. +group BI_CONDITIONAL: + invariant true <=> false; +end + +// CONJUNCTION. +group CONJUNCTION: + invariant BB: true and false; + invariant SS: empty({true} and {false}); +end + +// DISJUNCTION. +group DISJUNCTION: + invariant BB: true or false; + invariant SS: empty({true} or {false}); +end + +// DIVISION. +group DIVISION: + invariant II: 1 / 1 = 0; + invariant IR: 1 / 1.0 = 0; + invariant RI: 1.0 / 1 = 0; + invariant RR: 1.0 / 1.0 = 0; +end + +// ELEMENT_OF_LISTS. +group ELEMENT_OF_LISTS: + invariant 1 in [1]; +end + +// ELEMENT_OF_SETS. +group ELEMENT_OF_SETS: + invariant 1 in {1}; +end + +// ELEMENT_OF_DICTS. +group ELEMENT_OF_DICTS: + invariant 1 in {1: 2}; +end + +// EQUAL. +group EQUAL: + invariant 1 = 1; +end + +// GREATER_EQUAL. +group GREATER_EQUAL: + input int i; + invariant GG: 1 >= 1; + invariant II: i >= i; + invariant IR: 1 >= 1.0; + invariant RI: 1.0 >= 1; + invariant RR: 1.0 >= 1.0; +end + +// GREATER_THAN. +group GREATER_THAN: + input int i; + invariant GG: 1 > 1; + invariant II: i > i; + invariant IR: 1 > 1.0; + invariant RI: 1.0 > 1; + invariant RR: 1.0 > 1.0; +end + +// IMPLICATION. +group IMPLICATION: + invariant true => false; +end + +// INTEGER_DIVISION. +group INTEGER_DIVISION: + input int i; + invariant GG: 1 div 1 = 0; + invariant GI: 1 div i = 0; + invariant IG: 1 div 1 = 0; + invariant II: i div i = 0; +end + +// LESS_EQUAL. +group LESS_EQUAL: + input int i; + invariant GG: 1 <= 1; + invariant II: i <= i; + invariant IR: 1 <= 1.0; + invariant RI: 1.0 <= 1; + invariant RR: 1.0 <= 1.0; +end + +// LESS_THAN. +group LESS_THAN: + input int i; + invariant GG: 1 < 1; + invariant II: i < i; + invariant IR: 1 < 1.0; + invariant RI: 1.0 < 1; + invariant RR: 1.0 < 1.0; +end + +// MODULUS. +group MODULUS: + input int i; + invariant GG: 1 mod 1 = 0; + invariant GI: 1 mod i = 0; + invariant IG: 1 mod 1 = 0; + invariant II: i mod i = 0; +end + +// MULTIPLICATION. +group MULTIPLICATION: + input int i; + invariant GG: 1 * 1 = 0; + invariant II: i * i = 0; + invariant IR: 1 * 1.0 = 0; + invariant RI: 1.0 * 1 = 0; + invariant RR: 1.0 * 1.0 = 0; +end + +// SUBSET. +group SUBSET: + invariant {true} sub {false}; +end + +// SUBTRACTION_NUMBERS. +group SUBTRACTION_NUMBERS: + input int i; + invariant GG: 1 - 1 > 0; + invariant IG: i - 1 > 0; + invariant GI: 1 - i > 0; + invariant II: i - i > 0; + invariant GR: 1 - 1.0 > 0; + invariant RG: 1.0 - 1 > 0; + invariant RR: 1.0 - 1.0 > 0; +end + +// SUBTRACTION_CONTAINERS. +group SUBTRACTION_CONTAINERS: + input int i; + invariant SS: empty({true} - {false}); + invariant DD: empty({1: 2} - {1: 2}); + invariant DS: empty({1: 2} - {1}); + invariant DLG: empty({1: 2} - [1]); + invariant DLI: empty({1: 2} - [i]); +end + +// UNEQUAL. +group UNEQUAL: + invariant 1 != 1; +end diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel1.cif.check.err b/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel1.cif.check.err new file mode 100644 index 0000000000000000000000000000000000000000..f38286b05075aa1c3dd79bb17c6dec4888a37b36 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel1.cif.check.err @@ -0,0 +1,80 @@ +ERROR: CIF common checks tester failed due to unsatisfied preconditions: + - Unsupported "ADDITION_DICTS": uses binary operator "+" on operands of types "dict(bool:bool)" and "dict(bool:bool)" in binary expression "{true: false} + {false: true}". + - Unsupported "ADDITION_LISTS": uses binary operator "+" on operands of types "list[1] int[1..1]" and "list[1] int[1..1]" in binary expression "[1] + [1]". + - Unsupported "ADDITION_NUMBERS.GG": uses binary operator "+" on operands of types "int[1..1]" and "int[1..1]" in binary expression "1 + 1". + - Unsupported "ADDITION_NUMBERS.GG": uses binary operator ">" in binary expression "1 + 1 > 0". + - Unsupported "ADDITION_NUMBERS.GI": uses binary operator "+" on operands of types "int[1..1]" and "int" in binary expression "1 + ADDITION_NUMBERS.i". + - Unsupported "ADDITION_NUMBERS.GI": uses binary operator ">" in binary expression "1 + ADDITION_NUMBERS.i > 0". + - Unsupported "ADDITION_NUMBERS.GR": uses binary operator "+" on operands of types "int[1..1]" and "real" in binary expression "1 + 1.0". + - Unsupported "ADDITION_NUMBERS.GR": uses binary operator ">" in binary expression "1 + 1.0 > 0". + - Unsupported "ADDITION_NUMBERS.IG": uses binary operator "+" on operands of types "int" and "int[1..1]" in binary expression "ADDITION_NUMBERS.i + 1". + - Unsupported "ADDITION_NUMBERS.IG": uses binary operator ">" in binary expression "ADDITION_NUMBERS.i + 1 > 0". + - Unsupported "ADDITION_NUMBERS.II": uses binary operator "+" on operands of types "int" and "int" in binary expression "ADDITION_NUMBERS.i + ADDITION_NUMBERS.i". + - Unsupported "ADDITION_NUMBERS.II": uses binary operator ">" in binary expression "ADDITION_NUMBERS.i + ADDITION_NUMBERS.i > 0". + - Unsupported "ADDITION_NUMBERS.RG": uses binary operator "+" on operands of types "real" and "real" in binary expression "1.0 + 1.0". + - Unsupported "ADDITION_NUMBERS.RG": uses binary operator ">" in binary expression "1.0 + 1.0 > 0". + - Unsupported "ADDITION_NUMBERS.RR": uses binary operator "+" on operands of types "real" and "real" in binary expression "1.0 + 1.0". + - Unsupported "ADDITION_NUMBERS.RR": uses binary operator ">" in binary expression "1.0 + 1.0 > 0". + - Unsupported "ADDITION_STRINGS": uses binary operator "+" on operands of types "string" and "string" in binary expression ""a" + "a"". + - Unsupported "BI_CONDITIONAL": uses binary operator "<=>" in binary expression "true <=> false". + - Unsupported "CONJUNCTION.SS": uses binary operator "and" on operands of types "set bool" and "set bool" in binary expression "{true} and {false}". + - Unsupported "DISJUNCTION.SS": uses binary operator "or" on operands of types "set bool" and "set bool" in binary expression "{true} or {false}". + - Unsupported "ELEMENT_OF_DICTS": uses binary operator "in" in binary expression "1 in {1: 2}". + - Unsupported "ELEMENT_OF_LISTS": uses binary operator "in" in binary expression "1 in [1]". + - Unsupported "ELEMENT_OF_SETS": uses binary operator "in" in binary expression "1 in {1}". + - Unsupported "GREATER_EQUAL.GG": uses binary operator ">=" in binary expression "1 >= 1". + - Unsupported "GREATER_EQUAL.II": uses binary operator ">=" in binary expression "GREATER_EQUAL.i >= GREATER_EQUAL.i". + - Unsupported "GREATER_EQUAL.IR": uses binary operator ">=" in binary expression "1 >= 1.0". + - Unsupported "GREATER_EQUAL.RI": uses binary operator ">=" in binary expression "1.0 >= 1". + - Unsupported "GREATER_EQUAL.RR": uses binary operator ">=" in binary expression "1.0 >= 1.0". + - Unsupported "GREATER_THAN.GG": uses binary operator ">" in binary expression "1 > 1". + - Unsupported "GREATER_THAN.II": uses binary operator ">" in binary expression "GREATER_THAN.i > GREATER_THAN.i". + - Unsupported "GREATER_THAN.IR": uses binary operator ">" in binary expression "1 > 1.0". + - Unsupported "GREATER_THAN.RI": uses binary operator ">" in binary expression "1.0 > 1". + - Unsupported "GREATER_THAN.RR": uses binary operator ">" in binary expression "1.0 > 1.0". + - Unsupported "grp": uses binary operator "<" in binary expression "1 < 2". + - Unsupported "INTEGER_DIVISION.GG": uses binary operator "div" in binary expression "1 div 1". + - Unsupported "INTEGER_DIVISION.GI": uses binary operator "div" in binary expression "1 div INTEGER_DIVISION.i". + - Unsupported "INTEGER_DIVISION.IG": uses binary operator "div" in binary expression "1 div 1". + - Unsupported "INTEGER_DIVISION.II": uses binary operator "div" in binary expression "INTEGER_DIVISION.i div INTEGER_DIVISION.i". + - Unsupported "LESS_EQUAL.GG": uses binary operator "<=" in binary expression "1 <= 1". + - Unsupported "LESS_EQUAL.II": uses binary operator "<=" in binary expression "LESS_EQUAL.i <= LESS_EQUAL.i". + - Unsupported "LESS_EQUAL.IR": uses binary operator "<=" in binary expression "1 <= 1.0". + - Unsupported "LESS_EQUAL.RI": uses binary operator "<=" in binary expression "1.0 <= 1". + - Unsupported "LESS_EQUAL.RR": uses binary operator "<=" in binary expression "1.0 <= 1.0". + - Unsupported "LESS_THAN.GG": uses binary operator "<" in binary expression "1 < 1". + - Unsupported "LESS_THAN.II": uses binary operator "<" in binary expression "LESS_THAN.i < LESS_THAN.i". + - Unsupported "LESS_THAN.IR": uses binary operator "<" in binary expression "1 < 1.0". + - Unsupported "LESS_THAN.RI": uses binary operator "<" in binary expression "1.0 < 1". + - Unsupported "LESS_THAN.RR": uses binary operator "<" in binary expression "1.0 < 1.0". + - Unsupported "MODULUS.GG": uses binary operator "mod" on operands of types "int[1..1]" and "int[1..1]" in binary expression "1 mod 1". + - Unsupported "MODULUS.GI": uses binary operator "mod" on operands of types "int[1..1]" and "int" in binary expression "1 mod MODULUS.i". + - Unsupported "MODULUS.IG": uses binary operator "mod" on operands of types "int[1..1]" and "int[1..1]" in binary expression "1 mod 1". + - Unsupported "MODULUS.II": uses binary operator "mod" on operands of types "int" and "int" in binary expression "MODULUS.i mod MODULUS.i". + - Unsupported "MULTIPLICATION.GG": uses binary operator "*" on operands of types "int[1..1]" and "int[1..1]" in binary expression "1 * 1". + - Unsupported "MULTIPLICATION.II": uses binary operator "*" on operands of types "int" and "int" in binary expression "MULTIPLICATION.i * MULTIPLICATION.i". + - Unsupported "MULTIPLICATION.IR": uses binary operator "*" on operands of types "int[1..1]" and "real" in binary expression "1 * 1.0". + - Unsupported "MULTIPLICATION.RI": uses binary operator "*" on operands of types "real" and "int[1..1]" in binary expression "1.0 * 1". + - Unsupported "MULTIPLICATION.RR": uses binary operator "*" on operands of types "real" and "real" in binary expression "1.0 * 1.0". + - Unsupported "nested_grp.nested_grp": uses binary operator "<" in binary expression "1 < 2". + - Unsupported "SUBTRACTION_CONTAINERS.DD": uses binary operator "-" on operands of types "dict(int[1..1]:int[2..2])" and "dict(int[1..1]:int[2..2])" in binary expression "{1: 2} - {1: 2}". + - Unsupported "SUBTRACTION_CONTAINERS.DLG": uses binary operator "-" on operands of types "dict(int[1..1]:int[2..2])" and "list[1] int[1..1]" in binary expression "{1: 2} - [1]". + - Unsupported "SUBTRACTION_CONTAINERS.DLI": uses binary operator "-" on operands of types "dict(int[1..1]:int[2..2])" and "list[1] int" in binary expression "{1: 2} - [SUBTRACTION_CONTAINERS.i]". + - Unsupported "SUBTRACTION_CONTAINERS.DS": uses binary operator "-" on operands of types "dict(int[1..1]:int[2..2])" and "set int[1..1]" in binary expression "{1: 2} - {1}". + - Unsupported "SUBTRACTION_CONTAINERS.SS": uses binary operator "-" on operands of types "set bool" and "set bool" in binary expression "{true} - {false}". + - Unsupported "SUBTRACTION_NUMBERS.GG": uses binary operator "-" on operands of types "int[1..1]" and "int[1..1]" in binary expression "1 - 1". + - Unsupported "SUBTRACTION_NUMBERS.GG": uses binary operator ">" in binary expression "1 - 1 > 0". + - Unsupported "SUBTRACTION_NUMBERS.GI": uses binary operator "-" on operands of types "int[1..1]" and "int" in binary expression "1 - SUBTRACTION_NUMBERS.i". + - Unsupported "SUBTRACTION_NUMBERS.GI": uses binary operator ">" in binary expression "1 - SUBTRACTION_NUMBERS.i > 0". + - Unsupported "SUBTRACTION_NUMBERS.GR": uses binary operator "-" on operands of types "int[1..1]" and "real" in binary expression "1 - 1.0". + - Unsupported "SUBTRACTION_NUMBERS.GR": uses binary operator ">" in binary expression "1 - 1.0 > 0". + - Unsupported "SUBTRACTION_NUMBERS.IG": uses binary operator "-" on operands of types "int" and "int[1..1]" in binary expression "SUBTRACTION_NUMBERS.i - 1". + - Unsupported "SUBTRACTION_NUMBERS.IG": uses binary operator ">" in binary expression "SUBTRACTION_NUMBERS.i - 1 > 0". + - Unsupported "SUBTRACTION_NUMBERS.II": uses binary operator "-" on operands of types "int" and "int" in binary expression "SUBTRACTION_NUMBERS.i - SUBTRACTION_NUMBERS.i". + - Unsupported "SUBTRACTION_NUMBERS.II": uses binary operator ">" in binary expression "SUBTRACTION_NUMBERS.i - SUBTRACTION_NUMBERS.i > 0". + - Unsupported "SUBTRACTION_NUMBERS.RG": uses binary operator "-" on operands of types "real" and "real" in binary expression "1.0 - 1.0". + - Unsupported "SUBTRACTION_NUMBERS.RG": uses binary operator ">" in binary expression "1.0 - 1.0 > 0". + - Unsupported "SUBTRACTION_NUMBERS.RR": uses binary operator "-" on operands of types "real" and "real" in binary expression "1.0 - 1.0". + - Unsupported "SUBTRACTION_NUMBERS.RR": uses binary operator ">" in binary expression "1.0 - 1.0 > 0". + - Unsupported "type_decl": uses binary operator "<" in binary expression "type_decl.a < type_decl.a". + - Unsupported specification: uses binary operator "<" in binary expression "1 < 2". diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel2.cif b/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel2.cif new file mode 100644 index 0000000000000000000000000000000000000000..725db5b1bb84da050abf106c097a126fe82334f9 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel2.cif @@ -0,0 +1,211 @@ +////////////////////////////////////////////////////////////////////////////// +// Copyright (c) 2022 Contributors to the Eclipse Foundation +// +// See the NOTICE file(s) distributed with this work for additional +// information regarding copyright ownership. +// +// This program and the accompanying materials are made available +// under the terms of the MIT License which is available at +// https://opensource.org/licenses/MIT +// +// SPDX-License-Identifier: MIT +////////////////////////////////////////////////////////////////////////////// + +// Top level scope. +invariant 1 < 2; + +// Group. +group grp: + invariant 1 < 2; +end + +// Nested group. +group nested_grp: + group nested_grp: + invariant 1 < 2; + end +end + +// With type declarations. +group type_decl: + type t = int; // rangeless int + alg t a = 1; + invariant a < a; // rangeless int +end + +// ADDITION. +group ADDITION_NUMBERS: + input int i; + invariant GG: 1 + 1 > 0; + invariant IG: i + 1 > 0; + invariant GI: 1 + i > 0; + invariant II: i + i > 0; + invariant GR: 1 + 1.0 > 0; + invariant RG: 1.0 + 1 > 0; + invariant RR: 1.0 + 1.0 > 0; +end + +// ADDITION_LISTS. +group ADDITION_LISTS: + invariant empty([1] + [1]); +end + +// ADDITION_STRINGS. +group ADDITION_STRINGS: + invariant "a" + "a" = "aa"; +end + +// ADDITION_DICTS. +group ADDITION_DICTS: + invariant empty({true: false} + {false: true}); +end + +// BI_CONDITIONAL. +group BI_CONDITIONAL: + invariant true <=> false; +end + +// CONJUNCTION. +group CONJUNCTION: + invariant BB: true and false; + invariant SS: empty({true} and {false}); +end + +// DISJUNCTION. +group DISJUNCTION: + invariant BB: true or false; + invariant SS: empty({true} or {false}); +end + +// DIVISION. +group DIVISION: + invariant II: 1 / 1 = 0; + invariant IR: 1 / 1.0 = 0; + invariant RI: 1.0 / 1 = 0; + invariant RR: 1.0 / 1.0 = 0; +end + +// ELEMENT_OF_LISTS. +group ELEMENT_OF_LISTS: + invariant 1 in [1]; +end + +// ELEMENT_OF_SETS. +group ELEMENT_OF_SETS: + invariant 1 in {1}; +end + +// ELEMENT_OF_DICTS. +group ELEMENT_OF_DICTS: + invariant 1 in {1: 2}; +end + +// EQUAL. +group EQUAL: + invariant 1 = 1; +end + +// GREATER_EQUAL. +group GREATER_EQUAL: + input int i; + invariant GG: 1 >= 1; + invariant II: i >= i; + invariant IR: 1 >= 1.0; + invariant RI: 1.0 >= 1; + invariant RR: 1.0 >= 1.0; +end + +// GREATER_THAN. +group GREATER_THAN: + input int i; + invariant GG: 1 > 1; + invariant II: i > i; + invariant IR: 1 > 1.0; + invariant RI: 1.0 > 1; + invariant RR: 1.0 > 1.0; +end + +// IMPLICATION. +group IMPLICATION: + invariant true => false; +end + +// INTEGER_DIVISION. +group INTEGER_DIVISION: + input int i; + invariant GG: 1 div 1 = 0; + invariant GI: 1 div i = 0; + invariant IG: 1 div 1 = 0; + invariant II: i div i = 0; +end + +// LESS_EQUAL. +group LESS_EQUAL: + input int i; + invariant GG: 1 <= 1; + invariant II: i <= i; + invariant IR: 1 <= 1.0; + invariant RI: 1.0 <= 1; + invariant RR: 1.0 <= 1.0; +end + +// LESS_THAN. +group LESS_THAN: + input int i; + invariant GG: 1 < 1; + invariant II: i < i; + invariant IR: 1 < 1.0; + invariant RI: 1.0 < 1; + invariant RR: 1.0 < 1.0; +end + +// MODULUS. +group MODULUS: + input int i; + invariant GG: 1 mod 1 = 0; + invariant GI: 1 mod i = 0; + invariant IG: 1 mod 1 = 0; + invariant II: i mod i = 0; +end + +// MULTIPLICATION. +group MULTIPLICATION: + input int i; + invariant GG: 1 * 1 = 0; + invariant II: i * i = 0; + invariant IR: 1 * 1.0 = 0; + invariant RI: 1.0 * 1 = 0; + invariant RR: 1.0 * 1.0 = 0; +end + +// SUBSET. +group SUBSET: + invariant {true} sub {false}; +end + +// SUBTRACTION_NUMBERS. +group SUBTRACTION_NUMBERS: + input int i; + invariant GG: 1 - 1 > 0; + invariant IG: i - 1 > 0; + invariant GI: 1 - i > 0; + invariant II: i - i > 0; + invariant GR: 1 - 1.0 > 0; + invariant RG: 1.0 - 1 > 0; + invariant RR: 1.0 - 1.0 > 0; +end + +// SUBTRACTION_CONTAINERS. +group SUBTRACTION_CONTAINERS: + input int i; + invariant SS: empty({true} - {false}); + invariant DD: empty({1: 2} - {1: 2}); + invariant DS: empty({1: 2} - {1}); + invariant DLG: empty({1: 2} - [1]); + invariant DLI: empty({1: 2} - [i]); +end + +// UNEQUAL. +group UNEQUAL: + invariant 1 != 1; +end diff --git a/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel2.cif.check.err b/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel2.cif.check.err new file mode 100644 index 0000000000000000000000000000000000000000..21f9c15f2ddbb47b64a5149eb329efbfec3417d2 --- /dev/null +++ b/cif/org.eclipse.escet.cif.tests/tests/common_checks/ExprNoSpecificBinaryExprsCheckLevel2.cif.check.err @@ -0,0 +1,64 @@ +ERROR: CIF common checks tester failed due to unsatisfied preconditions: + - Unsupported "ADDITION_NUMBERS.GG": uses binary operator "+" on operands of types "int[1..1]" and "int[1..1]" in binary expression "1 + 1". + - Unsupported "ADDITION_NUMBERS.GG": uses binary operator ">" on operands of types "int[2..2]" and "int[0..0]" in binary expression "1 + 1 > 0". + - Unsupported "ADDITION_NUMBERS.GI": uses binary operator "+" on operands of types "int[1..1]" and "int" in binary expression "1 + ADDITION_NUMBERS.i". + - Unsupported "ADDITION_NUMBERS.GI": uses binary operator ">" on operands of types "int" and "int[0..0]" in binary expression "1 + ADDITION_NUMBERS.i > 0". + - Unsupported "ADDITION_NUMBERS.GR": uses binary operator "+" on operands of types "int[1..1]" and "real" in binary expression "1 + 1.0". + - Unsupported "ADDITION_NUMBERS.GR": uses binary operator ">" on operands of types "real" and "int[0..0]" in binary expression "1 + 1.0 > 0". + - Unsupported "ADDITION_NUMBERS.IG": uses binary operator "+" on operands of types "int" and "int[1..1]" in binary expression "ADDITION_NUMBERS.i + 1". + - Unsupported "ADDITION_NUMBERS.IG": uses binary operator ">" on operands of types "int" and "int[0..0]" in binary expression "ADDITION_NUMBERS.i + 1 > 0". + - Unsupported "ADDITION_NUMBERS.II": uses binary operator "+" on operands of types "int" and "int" in binary expression "ADDITION_NUMBERS.i + ADDITION_NUMBERS.i". + - Unsupported "ADDITION_NUMBERS.II": uses binary operator ">" on operands of types "int" and "int[0..0]" in binary expression "ADDITION_NUMBERS.i + ADDITION_NUMBERS.i > 0". + - Unsupported "ADDITION_NUMBERS.RG": uses binary operator ">" on operands of types "real" and "int[0..0]" in binary expression "1.0 + 1.0 > 0". + - Unsupported "ADDITION_NUMBERS.RR": uses binary operator ">" on operands of types "real" and "int[0..0]" in binary expression "1.0 + 1.0 > 0". + - Unsupported "ELEMENT_OF_DICTS": uses binary operator "in" on operands of types "int[1..1]" and "dict(int[1..1]:int[2..2])" in binary expression "1 in {1: 2}". + - Unsupported "ELEMENT_OF_LISTS": uses binary operator "in" on operands of types "int[1..1]" and "list[1] int[1..1]" in binary expression "1 in [1]". + - Unsupported "ELEMENT_OF_SETS": uses binary operator "in" on operands of types "int[1..1]" and "set int[1..1]" in binary expression "1 in {1}". + - Unsupported "GREATER_EQUAL.GG": uses binary operator ">=" on operands of types "int[1..1]" and "int[1..1]" in binary expression "1 >= 1". + - Unsupported "GREATER_EQUAL.II": uses binary operator ">=" on operands of types "int" and "int" in binary expression "GREATER_EQUAL.i >= GREATER_EQUAL.i". + - Unsupported "GREATER_EQUAL.IR": uses binary operator ">=" on operands of types "int[1..1]" and "real" in binary expression "1 >= 1.0". + - Unsupported "GREATER_EQUAL.RI": uses binary operator ">=" on operands of types "real" and "int[1..1]" in binary expression "1.0 >= 1". + - Unsupported "GREATER_EQUAL.RR": uses binary operator ">=" on operands of types "real" and "real" in binary expression "1.0 >= 1.0". + - Unsupported "GREATER_THAN.GG": uses binary operator ">" on operands of types "int[1..1]" and "int[1..1]" in binary expression "1 > 1". + - Unsupported "GREATER_THAN.II": uses binary operator ">" on operands of types "int" and "int" in binary expression "GREATER_THAN.i > GREATER_THAN.i". + - Unsupported "GREATER_THAN.IR": uses binary operator ">" on operands of types "int[1..1]" and "real" in binary expression "1 > 1.0". + - Unsupported "GREATER_THAN.RI": uses binary operator ">" on operands of types "real" and "int[1..1]" in binary expression "1.0 > 1". + - Unsupported "GREATER_THAN.RR": uses binary operator ">" on operands of types "real" and "real" in binary expression "1.0 > 1.0". + - Unsupported "grp": uses binary operator "<" on operands of types "int[1..1]" and "int[2..2]" in binary expression "1 < 2". + - Unsupported "INTEGER_DIVISION.GG": uses binary operator "div" on operands of types "int[1..1]" and "int[1..1]" in binary expression "1 div 1". + - Unsupported "INTEGER_DIVISION.GI": uses binary operator "div" on operands of types "int[1..1]" and "int" in binary expression "1 div INTEGER_DIVISION.i". + - Unsupported "INTEGER_DIVISION.IG": uses binary operator "div" on