diff options
author | 2019-10-07 00:35:42 -0400 | |
---|---|---|
committer | 2020-06-07 19:42:47 -0400 | |
commit | b503c81bee920c18806af25393d0a90b8f77dba6 (patch) | |
tree | 9b70f606bfa7fa450457c04714e045e5ac5f6199 /Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse | |
parent | VAMPIRE: fix model generation (diff) | |
download | VIATRA-Generator-b503c81bee920c18806af25393d0a90b8f77dba6.tar.gz VIATRA-Generator-b503c81bee920c18806af25393d0a90b8f77dba6.tar.zst VIATRA-Generator-b503c81bee920c18806af25393d0a90b8f77dba6.zip |
VAMPIRE: Implement Vampire measurement code
Diffstat (limited to 'Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse')
8 files changed, 208 insertions, 16 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 a30b7cfc..4880c751 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 a818eb7e..8ad6dfed 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 b913bd4b..164e6c2f 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 4a9e17e1..46cad7ee 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 3dcefc79..eeb7c77a 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/EcoreTest.java b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/EcoreTest.java index 01503783..7019f162 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/EcoreTest.java +++ b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/EcoreTest.java | |||
@@ -1,9 +1,68 @@ | |||
1 | package ca.mcgill.ecse.dslreasoner.vampire.icse; | 1 | package ca.mcgill.ecse.dslreasoner.vampire.icse; |
2 | 2 | ||
3 | import ca.mcgill.ecse.dslreasoner.standalone.test.filesystem.filesystemPackage; | ||
4 | import ca.mcgill.ecse.dslreasoner.vampire.icse.GeneralTest; | ||
5 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireSolver; | ||
6 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireSolverConfiguration; | ||
7 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic; | ||
8 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2LogicConfiguration; | ||
9 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic_Trace; | ||
10 | import hu.bme.mit.inf.dslreasoner.ecore2logic.EcoreMetamodelDescriptor; | ||
11 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.DocumentationLevel; | ||
12 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicReasoner; | ||
13 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.TracedOutput; | ||
14 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem; | ||
15 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicResult; | ||
16 | import hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore; | ||
17 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2Logic; | ||
18 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2Logic; | ||
19 | import hu.bme.mit.inf.dslreasoner.workspace.FileSystemWorkspace; | ||
20 | import org.eclipse.emf.common.util.EList; | ||
21 | import org.eclipse.emf.ecore.EObject; | ||
22 | import org.eclipse.xtend2.lib.StringConcatenation; | ||
23 | import org.eclipse.xtext.xbase.lib.Exceptions; | ||
24 | import org.eclipse.xtext.xbase.lib.InputOutput; | ||
25 | import org.eclipse.xtext.xbase.lib.ObjectExtensions; | ||
26 | import org.eclipse.xtext.xbase.lib.Procedures.Procedure1; | ||
27 | |||
3 | @SuppressWarnings("all") | 28 | @SuppressWarnings("all") |
4 | public class EcoreTest { | 29 | public class EcoreTest { |
5 | public static void main(final String[] args) { | 30 | public static void main(final String[] args) { |
6 | throw new Error("Unresolved compilation problems:" | 31 | try { |
7 | + "\nInvalid number of arguments. The method solve(LogicProblem, LogicSolverConfiguration, ReasonerWorkspace) is not applicable for the arguments (LogicProblem,VampireSolverConfiguration,FileSystemWorkspace,String)"); | 32 | StringConcatenation _builder = new StringConcatenation(); |
33 | _builder.append("initialModels/"); | ||
34 | final FileSystemWorkspace inputs = new FileSystemWorkspace(_builder.toString(), ""); | ||
35 | StringConcatenation _builder_1 = new StringConcatenation(); | ||
36 | _builder_1.append("output/FEcoreTest/"); | ||
37 | final FileSystemWorkspace workspace = new FileSystemWorkspace(_builder_1.toString(), ""); | ||
38 | workspace.initAndClear(); | ||
39 | InputOutput.<String>println("Input and output workspaces are created"); | ||
40 | final EcoreMetamodelDescriptor metamodel = GeneralTest.loadMetamodel(filesystemPackage.eINSTANCE); | ||
41 | final EList<EObject> partialModel = GeneralTest.loadPartialModel(inputs, "fs/filesystemInstance.xmi"); | ||
42 | final Object queries = null; | ||
43 | InputOutput.<String>println("DSL loaded"); | ||
44 | final Ecore2Logic ecore2Logic = new Ecore2Logic(); | ||
45 | final Logic2Ecore logic2Ecore = new Logic2Ecore(ecore2Logic); | ||
46 | final Viatra2Logic viatra2Logic = new Viatra2Logic(ecore2Logic); | ||
47 | final InstanceModel2Logic instanceModel2Logic = new InstanceModel2Logic(); | ||
48 | Ecore2LogicConfiguration _ecore2LogicConfiguration = new Ecore2LogicConfiguration(); | ||
49 | final TracedOutput<LogicProblem, Ecore2Logic_Trace> modelGenerationProblem = ecore2Logic.transformMetamodel(metamodel, _ecore2LogicConfiguration); | ||
50 | final TracedOutput<LogicProblem, Ecore2Logic_Trace> modelExtensionProblem = instanceModel2Logic.transform(modelGenerationProblem, partialModel); | ||
51 | final LogicProblem logicProblem = modelGenerationProblem.getOutput(); | ||
52 | InputOutput.<String>println("Problem created"); | ||
53 | LogicResult solution = null; | ||
54 | LogicReasoner reasoner = null; | ||
55 | VampireSolver _vampireSolver = new VampireSolver(); | ||
56 | reasoner = _vampireSolver; | ||
57 | VampireSolverConfiguration _vampireSolverConfiguration = new VampireSolverConfiguration(); | ||
58 | final Procedure1<VampireSolverConfiguration> _function = (VampireSolverConfiguration it) -> { | ||
59 | it.documentationLevel = DocumentationLevel.FULL; | ||
60 | }; | ||
61 | final VampireSolverConfiguration vampireConfig = ObjectExtensions.<VampireSolverConfiguration>operator_doubleArrow(_vampireSolverConfiguration, _function); | ||
62 | solution = reasoner.solve(logicProblem, vampireConfig, workspace); | ||
63 | InputOutput.<String>println("Problem solved"); | ||
64 | } catch (Throwable _e) { | ||
65 | throw Exceptions.sneakyThrow(_e); | ||
66 | } | ||
8 | } | 67 | } |
9 | } | 68 | } |
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 26252d6c..8cd08fd8 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 | |||
@@ -8,7 +8,6 @@ import functionalarchitecture.Function; | |||
8 | import functionalarchitecture.FunctionalArchitectureModel; | 8 | import functionalarchitecture.FunctionalArchitectureModel; |
9 | import functionalarchitecture.FunctionalOutput; | 9 | import functionalarchitecture.FunctionalOutput; |
10 | import functionalarchitecture.FunctionalarchitecturePackage; | 10 | import functionalarchitecture.FunctionalarchitecturePackage; |
11 | import hu.bme.mit.inf.dslreasoner.domains.transima.fam.FamPatterns; | ||
12 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic; | 11 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic; |
13 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2LogicConfiguration; | 12 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2LogicConfiguration; |
14 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic_Trace; | 13 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic_Trace; |
@@ -22,8 +21,6 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicResult; | |||
22 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult; | 21 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult; |
23 | import hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore; | 22 | import hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore; |
24 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2Logic; | 23 | 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; | ||
27 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2Logic; | 24 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2Logic; |
28 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2PartialInterpretation; | 25 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2PartialInterpretation; |
29 | import hu.bme.mit.inf.dslreasoner.workspace.FileSystemWorkspace; | 26 | import hu.bme.mit.inf.dslreasoner.workspace.FileSystemWorkspace; |
@@ -63,14 +60,12 @@ public class FAMTest { | |||
63 | InputOutput.<String>println("Input and output workspaces are created"); | 60 | InputOutput.<String>println("Input and output workspaces are created"); |
64 | final EcoreMetamodelDescriptor metamodel = GeneralTest.loadMetamodel(FunctionalarchitecturePackage.eINSTANCE); | 61 | final EcoreMetamodelDescriptor metamodel = GeneralTest.loadMetamodel(FunctionalarchitecturePackage.eINSTANCE); |
65 | final EList<EObject> partialModel = GeneralTest.loadPartialModel(inputs, "FAM/FaModel.xmi"); | 62 | final EList<EObject> partialModel = GeneralTest.loadPartialModel(inputs, "FAM/FaModel.xmi"); |
66 | final ViatraQuerySetDescriptor queries = GeneralTest.loadQueries(metamodel, FamPatterns.instance()); | 63 | final Object queries = null; |
67 | InputOutput.<String>println("DSL loaded"); | 64 | InputOutput.<String>println("DSL loaded"); |
68 | Ecore2LogicConfiguration _ecore2LogicConfiguration = new Ecore2LogicConfiguration(); | 65 | Ecore2LogicConfiguration _ecore2LogicConfiguration = new Ecore2LogicConfiguration(); |
69 | final TracedOutput<LogicProblem, Ecore2Logic_Trace> modelGenerationProblem = ecore2Logic.transformMetamodel(metamodel, _ecore2LogicConfiguration); | 66 | final TracedOutput<LogicProblem, Ecore2Logic_Trace> modelGenerationProblem = ecore2Logic.transformMetamodel(metamodel, _ecore2LogicConfiguration); |
70 | LogicProblem problem = modelGenerationProblem.getOutput(); | 67 | LogicProblem problem = modelGenerationProblem.getOutput(); |
71 | problem = instanceModel2Logic.transform(modelGenerationProblem, partialModel).getOutput(); | 68 | problem = instanceModel2Logic.transform(modelGenerationProblem, partialModel).getOutput(); |
72 | Viatra2LogicConfiguration _viatra2LogicConfiguration = new Viatra2LogicConfiguration(); | ||
73 | problem = viatra2Logic.transformQueries(queries, modelGenerationProblem, _viatra2LogicConfiguration).getOutput(); | ||
74 | workspace.writeModel(problem, "Fam.logicproblem"); | 69 | workspace.writeModel(problem, "Fam.logicproblem"); |
75 | InputOutput.<String>println("Problem created"); | 70 | InputOutput.<String>println("Problem created"); |
76 | long startTime = System.currentTimeMillis(); | 71 | long startTime = System.currentTimeMillis(); |
@@ -91,16 +86,12 @@ public class FAMTest { | |||
91 | it.documentationLevel = DocumentationLevel.FULL; | 86 | it.documentationLevel = DocumentationLevel.FULL; |
92 | it.typeScopes.minNewElements = 8; | 87 | it.typeScopes.minNewElements = 8; |
93 | it.typeScopes.maxNewElements = 10; | 88 | it.typeScopes.maxNewElements = 10; |
94 | int _size = typeMapMin.size(); | ||
95 | boolean _notEquals = (_size != 0); | ||
96 | if (_notEquals) { | ||
97 | it.typeScopes.minNewElementsByType = typeMapMin; | ||
98 | } | ||
99 | it.contCycleLevel = 5; | 89 | it.contCycleLevel = 5; |
100 | it.uniquenessDuplicates = false; | 90 | it.uniquenessDuplicates = false; |
101 | }; | 91 | }; |
102 | final VampireSolverConfiguration vampireConfig = ObjectExtensions.<VampireSolverConfiguration>operator_doubleArrow(_vampireSolverConfiguration, _function); | 92 | final VampireSolverConfiguration vampireConfig = ObjectExtensions.<VampireSolverConfiguration>operator_doubleArrow(_vampireSolverConfiguration, _function); |
103 | LogicResult solution = reasoner.solve(problem, vampireConfig, workspace); | 93 | LogicResult solution = reasoner.solve(problem, vampireConfig, workspace); |
94 | InputOutput.<String>println("Problem solved"); | ||
104 | List<? extends LogicModelInterpretation> interpretations = reasoner.getInterpretations(((ModelResult) solution)); | 95 | List<? extends LogicModelInterpretation> interpretations = reasoner.getInterpretations(((ModelResult) solution)); |
105 | InputOutput.<Class<? extends List>>print(interpretations.getClass()); | 96 | InputOutput.<Class<? extends List>>print(interpretations.getClass()); |
106 | for (final LogicModelInterpretation interpretation : interpretations) { | 97 | for (final LogicModelInterpretation interpretation : interpretations) { |
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/YakinduTest.java b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/YakinduTest.java index f8502439..616868a6 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/YakinduTest.java +++ b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/YakinduTest.java | |||
@@ -1,10 +1,152 @@ | |||
1 | package ca.mcgill.ecse.dslreasoner.vampire.icse; | 1 | package ca.mcgill.ecse.dslreasoner.vampire.icse; |
2 | 2 | ||
3 | import ca.mcgill.ecse.dslreasoner.standalone.test.fam.queries.FamPatterns; | ||
4 | import ca.mcgill.ecse.dslreasoner.vampire.icse.GeneralTest; | ||
5 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireSolver; | ||
6 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireSolverConfiguration; | ||
7 | import ca.mcgill.ecse.dslreasoner.vampireLanguage.VampireModel; | ||
8 | import functionalarchitecture.FunctionalarchitecturePackage; | ||
9 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic; | ||
10 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2LogicConfiguration; | ||
11 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic_Trace; | ||
12 | import hu.bme.mit.inf.dslreasoner.ecore2logic.EcoreMetamodelDescriptor; | ||
13 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.DocumentationLevel; | ||
14 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.TracedOutput; | ||
15 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem; | ||
16 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicResult; | ||
17 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult; | ||
18 | import hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore; | ||
19 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2Logic; | ||
20 | import hu.bme.mit.inf.dslreasoner.viatra2logic.ViatraQuerySetDescriptor; | ||
21 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2Logic; | ||
22 | import hu.bme.mit.inf.dslreasoner.workspace.FileSystemWorkspace; | ||
23 | import java.io.PrintWriter; | ||
24 | import java.util.Map; | ||
25 | import org.eclipse.emf.common.util.EList; | ||
26 | import org.eclipse.emf.common.util.URI; | ||
27 | import org.eclipse.emf.ecore.EObject; | ||
28 | import org.eclipse.emf.ecore.resource.Resource; | ||
29 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; | ||
30 | import org.eclipse.xtend2.lib.StringConcatenation; | ||
31 | import org.eclipse.xtext.xbase.lib.Exceptions; | ||
32 | import org.eclipse.xtext.xbase.lib.InputOutput; | ||
33 | import org.eclipse.xtext.xbase.lib.ObjectExtensions; | ||
34 | import org.eclipse.xtext.xbase.lib.Procedures.Procedure1; | ||
35 | |||
3 | @SuppressWarnings("all") | 36 | @SuppressWarnings("all") |
4 | public class YakinduTest { | 37 | public class YakinduTest { |
5 | public static void main(final String[] args) { | 38 | public static void main(final String[] args) { |
6 | throw new Error("Unresolved compilation problems:" | 39 | try { |
7 | + "\nThe method or field yakinduPackage is undefined" | 40 | final Ecore2Logic ecore2Logic = new Ecore2Logic(); |
8 | + "\neINSTANCE cannot be resolved"); | 41 | final Logic2Ecore logic2Ecore = new Logic2Ecore(ecore2Logic); |
42 | final Viatra2Logic viatra2Logic = new Viatra2Logic(ecore2Logic); | ||
43 | final InstanceModel2Logic instanceModel2Logic = new InstanceModel2Logic(); | ||
44 | StringConcatenation _builder = new StringConcatenation(); | ||
45 | _builder.append("initialModels/"); | ||
46 | final FileSystemWorkspace inputs = new FileSystemWorkspace(_builder.toString(), ""); | ||
47 | StringConcatenation _builder_1 = new StringConcatenation(); | ||
48 | _builder_1.append("output/YakinduTest/"); | ||
49 | final FileSystemWorkspace workspace = new FileSystemWorkspace(_builder_1.toString(), ""); | ||
50 | workspace.initAndClear(); | ||
51 | final Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE; | ||
52 | final Map<String, Object> map = reg.getExtensionToFactoryMap(); | ||
53 | XMIResourceFactoryImpl _xMIResourceFactoryImpl = new XMIResourceFactoryImpl(); | ||
54 | map.put("logicproblem", _xMIResourceFactoryImpl); | ||
55 | InputOutput.<String>println("Input and output workspaces are created"); | ||
56 | final EcoreMetamodelDescriptor metamodel = GeneralTest.loadMetamodel(FunctionalarchitecturePackage.eINSTANCE); | ||
57 | final EList<EObject> partialModel = GeneralTest.loadPartialModel(inputs, "FAM/FaModel.xmi"); | ||
58 | final ViatraQuerySetDescriptor queries = GeneralTest.loadQueries(metamodel, FamPatterns.instance()); | ||
59 | InputOutput.<String>println("DSL loaded"); | ||
60 | int MAX = 150; | ||
61 | int START = 10; | ||
62 | int INC = 20; | ||
63 | int REPS = 1; | ||
64 | final int EXACT = (-1); | ||
65 | if ((EXACT != (-1))) { | ||
66 | MAX = EXACT; | ||
67 | START = EXACT; | ||
68 | INC = 1; | ||
69 | REPS = 5; | ||
70 | } | ||
71 | URI _workspaceURI = workspace.getWorkspaceURI(); | ||
72 | String _plus = (_workspaceURI + "//yakinduStats.csv"); | ||
73 | PrintWriter writer = new PrintWriter(_plus); | ||
74 | writer.append("size,"); | ||
75 | for (int x = 0; (x < REPS); x++) { | ||
76 | writer.append((("t" + Integer.valueOf(x)) + ",")); | ||
77 | } | ||
78 | writer.append("avg\n"); | ||
79 | double totalTime = 0.0; | ||
80 | double totFound = 0.0; | ||
81 | boolean modelFound = true; | ||
82 | LogicResult solution = null; | ||
83 | { | ||
84 | int i = START; | ||
85 | boolean _while = (i <= MAX); | ||
86 | while (_while) { | ||
87 | { | ||
88 | final int num = ((i - START) / INC); | ||
89 | InputOutput.<String>print((((("Generation " + Integer.valueOf(num)) + ": SIZE=") + Integer.valueOf(i)) + " Attempt: ")); | ||
90 | String _plus_1 = (Integer.valueOf(i) + ","); | ||
91 | writer.append(_plus_1); | ||
92 | totalTime = 0.0; | ||
93 | totFound = 0.0; | ||
94 | modelFound = true; | ||
95 | for (int j = 0; (j < REPS); j++) { | ||
96 | { | ||
97 | InputOutput.<Integer>print(Integer.valueOf(j)); | ||
98 | Ecore2LogicConfiguration _ecore2LogicConfiguration = new Ecore2LogicConfiguration(); | ||
99 | final TracedOutput<LogicProblem, Ecore2Logic_Trace> modelGenerationProblem = ecore2Logic.transformMetamodel(metamodel, _ecore2LogicConfiguration); | ||
100 | LogicProblem problem = modelGenerationProblem.getOutput(); | ||
101 | problem = instanceModel2Logic.transform(modelGenerationProblem, partialModel).getOutput(); | ||
102 | workspace.writeModel(problem, "Yakindu.logicproblem"); | ||
103 | long startTime = System.currentTimeMillis(); | ||
104 | VampireSolver reasoner = null; | ||
105 | VampireSolver _vampireSolver = new VampireSolver(); | ||
106 | reasoner = _vampireSolver; | ||
107 | final int size = i; | ||
108 | final int inc = INC; | ||
109 | VampireSolverConfiguration _vampireSolverConfiguration = new VampireSolverConfiguration(); | ||
110 | final Procedure1<VampireSolverConfiguration> _function = (VampireSolverConfiguration it) -> { | ||
111 | it.documentationLevel = DocumentationLevel.FULL; | ||
112 | it.typeScopes.minNewElements = (size - inc); | ||
113 | it.typeScopes.maxNewElements = size; | ||
114 | it.contCycleLevel = 5; | ||
115 | it.uniquenessDuplicates = false; | ||
116 | }; | ||
117 | final VampireSolverConfiguration vampireConfig = ObjectExtensions.<VampireSolverConfiguration>operator_doubleArrow(_vampireSolverConfiguration, _function); | ||
118 | solution = reasoner.solve(problem, vampireConfig, workspace); | ||
119 | Object _get = ((ModelResult) solution).getRepresentation().get(0); | ||
120 | final VampireModel soln = ((VampireModel) _get); | ||
121 | int _transformationTime = solution.getStatistics().getTransformationTime(); | ||
122 | final double time = (_transformationTime / 1000.0); | ||
123 | String _plus_2 = (Double.valueOf(time) + ","); | ||
124 | writer.append(_plus_2); | ||
125 | InputOutput.<String>print((("(" + Double.valueOf(time)) + ")..")); | ||
126 | double _talTime = totalTime; | ||
127 | totalTime = (_talTime + time); | ||
128 | double _tFound = totFound; | ||
129 | totFound = (_tFound + 1); | ||
130 | } | ||
131 | } | ||
132 | InputOutput.println(); | ||
133 | double avg = 0.0; | ||
134 | if ((totFound == 0)) { | ||
135 | avg = (-1); | ||
136 | } else { | ||
137 | avg = (totalTime / totFound); | ||
138 | } | ||
139 | writer.append(Double.valueOf(avg).toString()); | ||
140 | writer.append("\n"); | ||
141 | } | ||
142 | int _i = i; | ||
143 | i = (_i + INC); | ||
144 | _while = (i <= MAX); | ||
145 | } | ||
146 | } | ||
147 | writer.close(); | ||
148 | } catch (Throwable _e) { | ||
149 | throw Exceptions.sneakyThrow(_e); | ||
150 | } | ||
9 | } | 151 | } |
10 | } | 152 | } |