From 26b051b0cfdb51e345e758447c64be682f60d479 Mon Sep 17 00:00:00 2001 From: Arnaud Dieumegard Date: Thu, 17 Jan 2019 16:06:59 +0100 Subject: [PATCH] Added N-Version programming pattern description + mapping to simple seim model in examples. --- examples/pseim.examples/.project | 7 +++++++ .../pseim.examples/n-version-programming/model.seimx | 11 +++++++++++ .../n-version-programming/model_nverg.mapping | 12 ++++++++++++ .../n-version-programming/nverg.pseimx | 11 +++++++++++ 4 files changed, 41 insertions(+) create mode 100644 examples/pseim.examples/n-version-programming/model.seimx create mode 100644 examples/pseim.examples/n-version-programming/model_nverg.mapping create mode 100644 examples/pseim.examples/n-version-programming/nverg.pseimx diff --git a/examples/pseim.examples/.project b/examples/pseim.examples/.project index 23ac598..d3c996c 100644 --- a/examples/pseim.examples/.project +++ b/examples/pseim.examples/.project @@ -15,4 +15,11 @@ org.eclipse.sirius.nature.modelingproject org.eclipse.xtext.ui.shared.xtextNature + + + EXAMPLES + 2 + PARENT-3-PROJECT_LOC/PATTERNS/CAML/EXAMPLES + + diff --git a/examples/pseim.examples/n-version-programming/model.seimx b/examples/pseim.examples/n-version-programming/model.seimx new file mode 100644 index 0000000..a6eab65 --- /dev/null +++ b/examples/pseim.examples/n-version-programming/model.seimx @@ -0,0 +1,11 @@ +model test { + component comp (in i1, in i2, out o1) { + component sc1(in i1, in i2, out o1, out o2) + component sc2(in i1, in i2, out o) + i1 -> sc1.i1 + i2 -> sc1.i2 + sc1.o1 -> sc2.i1 + sc1.o2 -> sc2.i2 + sc2.o -> o1 + } +} \ No newline at end of file diff --git a/examples/pseim.examples/n-version-programming/model_nverg.mapping b/examples/pseim.examples/n-version-programming/model_nverg.mapping new file mode 100644 index 0000000..14405c3 --- /dev/null +++ b/examples/pseim.examples/n-version-programming/model_nverg.mapping @@ -0,0 +1,12 @@ +transform test using nverG { + multiplicity + nverG.nb_in -> 2 + nverG.nb_vin -> 6 + nverG.nb_out -> 2 + nverG.nb_comp -> 3 + components + test.comp -> nverG.top + ports + test.comp.sc1.i1, test.comp.sc1.i2 -> nverG.top.i + test.comp.sc1.o1, test.comp.sc1.o2 -> nverG.top.o +} \ No newline at end of file diff --git a/examples/pseim.examples/n-version-programming/nverg.pseimx b/examples/pseim.examples/n-version-programming/nverg.pseimx new file mode 100644 index 0000000..90387fa --- /dev/null +++ b/examples/pseim.examples/n-version-programming/nverg.pseimx @@ -0,0 +1,11 @@ +pattern nverG (nb_in, nb_out, nb_comp, nb_vin) { + component top (in i[nb_in], out o[nb_out]) { + component split[nb_in](in i[1], out o[nb_comp]) + component comp[nb_comp](in i[nb_in], out o[nb_out]) + component vote[1](in i[nb_vin], out o[nb_out]) + i -{Transpose}-> split.i + split.o -{Transpose}-> comp.i + comp.o -{FlattenC}-> vote.i + vote.o -{Identity}-> o + } +} \ No newline at end of file