diff options
author | 2019-09-08 16:12:55 -0400 | |
---|---|---|
committer | 2020-06-07 19:42:29 -0400 | |
commit | 4aee5bcc86b9e6b515fbbdac030df42147be7dc1 (patch) | |
tree | ce9f8aa1cf0ab33d4304b9ce3a0abf4beb7b757a /Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse | |
parent | VAMPIRE: complete first version of VampireModelInterpretation (diff) | |
download | VIATRA-Generator-4aee5bcc86b9e6b515fbbdac030df42147be7dc1.tar.gz VIATRA-Generator-4aee5bcc86b9e6b515fbbdac030df42147be7dc1.tar.zst VIATRA-Generator-4aee5bcc86b9e6b515fbbdac030df42147be7dc1.zip |
VAMPIRE: Implement wf constraint handling
Diffstat (limited to 'Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse')
6 files changed, 14 insertions, 18 deletions
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.EcoreTest.xtendbin b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.EcoreTest.xtendbin index 771e1d1a..775c1663 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.EcoreTest.xtendbin +++ b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.EcoreTest.xtendbin | |||
Binary files differ | |||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.FAMTest.xtendbin b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.FAMTest.xtendbin index ad844992..4e802213 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.FAMTest.xtendbin +++ b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.FAMTest.xtendbin | |||
Binary files differ | |||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.FileSystemTest.xtendbin b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.FileSystemTest.xtendbin index 7dcb4392..f7e42672 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.FileSystemTest.xtendbin +++ b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.FileSystemTest.xtendbin | |||
Binary files differ | |||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.GeneralTest.xtendbin b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.GeneralTest.xtendbin index dc040005..ae8b52eb 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.GeneralTest.xtendbin +++ b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.GeneralTest.xtendbin | |||
Binary files differ | |||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.YakinduTest.xtendbin b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.YakinduTest.xtendbin index 2bb8be0d..73b1182c 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.YakinduTest.xtendbin +++ b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/.YakinduTest.xtendbin | |||
Binary files differ | |||
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/FAMTest.java b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/FAMTest.java index 8ef096d9..7f6dfcd5 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/FAMTest.java +++ b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/FAMTest.java | |||
@@ -3,10 +3,12 @@ package ca.mcgill.ecse.dslreasoner.vampire.icse; | |||
3 | import ca.mcgill.ecse.dslreasoner.vampire.icse.GeneralTest; | 3 | import ca.mcgill.ecse.dslreasoner.vampire.icse.GeneralTest; |
4 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireSolver; | 4 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireSolver; |
5 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireSolverConfiguration; | 5 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireSolverConfiguration; |
6 | import functionalarchitecture.FAMTerminator; | ||
6 | import functionalarchitecture.Function; | 7 | import functionalarchitecture.Function; |
7 | import functionalarchitecture.FunctionalArchitectureModel; | 8 | import functionalarchitecture.FunctionalArchitectureModel; |
8 | import functionalarchitecture.FunctionalOutput; | 9 | import functionalarchitecture.FunctionalOutput; |
9 | import functionalarchitecture.FunctionalarchitecturePackage; | 10 | import functionalarchitecture.FunctionalarchitecturePackage; |
11 | import hu.bme.mit.inf.dslreasoner.domains.transima.fam.FamPatterns; | ||
10 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic; | 12 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic; |
11 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2LogicConfiguration; | 13 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2LogicConfiguration; |
12 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic_Trace; | 14 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic_Trace; |
@@ -20,12 +22,10 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicResult; | |||
20 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult; | 22 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult; |
21 | import hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore; | 23 | import hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore; |
22 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2Logic; | 24 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2Logic; |
25 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2LogicConfiguration; | ||
26 | import hu.bme.mit.inf.dslreasoner.viatra2logic.ViatraQuerySetDescriptor; | ||
23 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2Logic; | 27 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2Logic; |
24 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2PartialInterpretation; | 28 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2PartialInterpretation; |
25 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation; | ||
26 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretation2Gml; | ||
27 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretationVisualisation; | ||
28 | import hu.bme.mit.inf.dslreasoner.visualisation.pi2graphviz.GraphvizVisualiser; | ||
29 | import hu.bme.mit.inf.dslreasoner.workspace.FileSystemWorkspace; | 29 | import hu.bme.mit.inf.dslreasoner.workspace.FileSystemWorkspace; |
30 | import java.util.HashMap; | 30 | import java.util.HashMap; |
31 | import java.util.List; | 31 | import java.util.List; |
@@ -37,7 +37,6 @@ import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; | |||
37 | import org.eclipse.xtend2.lib.StringConcatenation; | 37 | import org.eclipse.xtend2.lib.StringConcatenation; |
38 | import org.eclipse.xtext.xbase.lib.Exceptions; | 38 | import org.eclipse.xtext.xbase.lib.Exceptions; |
39 | import org.eclipse.xtext.xbase.lib.InputOutput; | 39 | import org.eclipse.xtext.xbase.lib.InputOutput; |
40 | import org.eclipse.xtext.xbase.lib.IteratorExtensions; | ||
41 | import org.eclipse.xtext.xbase.lib.ObjectExtensions; | 40 | import org.eclipse.xtext.xbase.lib.ObjectExtensions; |
42 | import org.eclipse.xtext.xbase.lib.Procedures.Procedure1; | 41 | import org.eclipse.xtext.xbase.lib.Procedures.Procedure1; |
43 | 42 | ||
@@ -64,12 +63,14 @@ public class FAMTest { | |||
64 | InputOutput.<String>println("Input and output workspaces are created"); | 63 | InputOutput.<String>println("Input and output workspaces are created"); |
65 | final EcoreMetamodelDescriptor metamodel = GeneralTest.loadMetamodel(FunctionalarchitecturePackage.eINSTANCE); | 64 | final EcoreMetamodelDescriptor metamodel = GeneralTest.loadMetamodel(FunctionalarchitecturePackage.eINSTANCE); |
66 | final EList<EObject> partialModel = GeneralTest.loadPartialModel(inputs, "FAM/FaModel.xmi"); | 65 | final EList<EObject> partialModel = GeneralTest.loadPartialModel(inputs, "FAM/FaModel.xmi"); |
67 | final Object queries = null; | 66 | final ViatraQuerySetDescriptor queries = GeneralTest.loadQueries(metamodel, FamPatterns.instance()); |
68 | InputOutput.<String>println("DSL loaded"); | 67 | InputOutput.<String>println("DSL loaded"); |
69 | Ecore2LogicConfiguration _ecore2LogicConfiguration = new Ecore2LogicConfiguration(); | 68 | Ecore2LogicConfiguration _ecore2LogicConfiguration = new Ecore2LogicConfiguration(); |
70 | final TracedOutput<LogicProblem, Ecore2Logic_Trace> modelGenerationProblem = ecore2Logic.transformMetamodel(metamodel, _ecore2LogicConfiguration); | 69 | final TracedOutput<LogicProblem, Ecore2Logic_Trace> modelGenerationProblem = ecore2Logic.transformMetamodel(metamodel, _ecore2LogicConfiguration); |
71 | LogicProblem problem = modelGenerationProblem.getOutput(); | 70 | LogicProblem problem = modelGenerationProblem.getOutput(); |
72 | problem = instanceModel2Logic.transform(modelGenerationProblem, partialModel).getOutput(); | 71 | problem = instanceModel2Logic.transform(modelGenerationProblem, partialModel).getOutput(); |
72 | Viatra2LogicConfiguration _viatra2LogicConfiguration = new Viatra2LogicConfiguration(); | ||
73 | problem = viatra2Logic.transformQueries(queries, modelGenerationProblem, _viatra2LogicConfiguration).getOutput(); | ||
73 | workspace.writeModel(problem, "Fam.logicproblem"); | 74 | workspace.writeModel(problem, "Fam.logicproblem"); |
74 | InputOutput.<String>println("Problem created"); | 75 | InputOutput.<String>println("Problem created"); |
75 | long startTime = System.currentTimeMillis(); | 76 | long startTime = System.currentTimeMillis(); |
@@ -77,7 +78,7 @@ public class FAMTest { | |||
77 | VampireSolver _vampireSolver = new VampireSolver(); | 78 | VampireSolver _vampireSolver = new VampireSolver(); |
78 | reasoner = _vampireSolver; | 79 | reasoner = _vampireSolver; |
79 | final HashMap<Class, Integer> classMapMin = new HashMap<Class, Integer>(); | 80 | final HashMap<Class, Integer> classMapMin = new HashMap<Class, Integer>(); |
80 | classMapMin.put(FunctionalOutput.class, Integer.valueOf(3)); | 81 | classMapMin.put(FAMTerminator.class, Integer.valueOf(1)); |
81 | final Map<Type, Integer> typeMapMin = GeneralTest.getTypeMap(classMapMin, metamodel, ecore2Logic, modelGenerationProblem.getTrace()); | 82 | final Map<Type, Integer> typeMapMin = GeneralTest.getTypeMap(classMapMin, metamodel, ecore2Logic, modelGenerationProblem.getTrace()); |
82 | final HashMap<Class, Integer> classMapMax = new HashMap<Class, Integer>(); | 83 | final HashMap<Class, Integer> classMapMax = new HashMap<Class, Integer>(); |
83 | classMapMax.put(FunctionalArchitectureModel.class, Integer.valueOf(3)); | 84 | classMapMax.put(FunctionalArchitectureModel.class, Integer.valueOf(3)); |
@@ -90,27 +91,22 @@ public class FAMTest { | |||
90 | it.documentationLevel = DocumentationLevel.FULL; | 91 | it.documentationLevel = DocumentationLevel.FULL; |
91 | it.typeScopes.minNewElements = 4; | 92 | it.typeScopes.minNewElements = 4; |
92 | it.typeScopes.maxNewElements = 5; | 93 | it.typeScopes.maxNewElements = 5; |
94 | int _size = typeMapMin.size(); | ||
95 | boolean _notEquals = (_size != 0); | ||
96 | if (_notEquals) { | ||
97 | it.typeScopes.minNewElementsByType = typeMapMin; | ||
98 | } | ||
93 | it.contCycleLevel = 5; | 99 | it.contCycleLevel = 5; |
94 | it.uniquenessDuplicates = false; | 100 | it.uniquenessDuplicates = false; |
95 | }; | 101 | }; |
96 | final VampireSolverConfiguration vampireConfig = ObjectExtensions.<VampireSolverConfiguration>operator_doubleArrow(_vampireSolverConfiguration, _function); | 102 | final VampireSolverConfiguration vampireConfig = ObjectExtensions.<VampireSolverConfiguration>operator_doubleArrow(_vampireSolverConfiguration, _function); |
97 | LogicResult solution = reasoner.solve(problem, vampireConfig, workspace); | 103 | LogicResult solution = reasoner.solve(problem, vampireConfig, workspace); |
98 | List<? extends LogicModelInterpretation> interpretations = reasoner.getInterpretations(((ModelResult) solution)); | 104 | List<? extends LogicModelInterpretation> interpretations = reasoner.getInterpretations(((ModelResult) solution)); |
105 | InputOutput.<Class<? extends List>>print(interpretations.getClass()); | ||
99 | for (final LogicModelInterpretation interpretation : interpretations) { | 106 | for (final LogicModelInterpretation interpretation : interpretations) { |
100 | { | 107 | { |
101 | final EObject model = logic2Ecore.transformInterpretation(interpretation, modelGenerationProblem.getTrace()); | 108 | final EObject model = logic2Ecore.transformInterpretation(interpretation, modelGenerationProblem.getTrace()); |
102 | workspace.writeModel(model, "model.xmi"); | 109 | workspace.writeModel(model, "model.xmi"); |
103 | final PartialInterpretation representation = im2pi.transform(modelGenerationProblem, IteratorExtensions.<EObject>toList(model.eAllContents()), false); | ||
104 | if ((representation instanceof PartialInterpretation)) { | ||
105 | final PartialInterpretation2Gml vis1 = new PartialInterpretation2Gml(); | ||
106 | final String gml = vis1.transform(representation); | ||
107 | workspace.writeText("model.gml", gml); | ||
108 | final GraphvizVisualiser vis2 = new GraphvizVisualiser(); | ||
109 | final PartialInterpretationVisualisation dot = vis2.visualiseConcretization(representation); | ||
110 | dot.writeToFile(workspace, "model.png"); | ||
111 | } else { | ||
112 | InputOutput.<String>println("ERROR"); | ||
113 | } | ||
114 | } | 110 | } |
115 | } | 111 | } |
116 | long _currentTimeMillis = System.currentTimeMillis(); | 112 | long _currentTimeMillis = System.currentTimeMillis(); |