diff options
Diffstat (limited to 'Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/FileSystemTest.java')
-rw-r--r-- | Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/FileSystemTest.java | 135 |
1 files changed, 70 insertions, 65 deletions
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/FileSystemTest.java b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/FileSystemTest.java index 7579bd98..8c7923be 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/FileSystemTest.java +++ b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/icse/FileSystemTest.java | |||
@@ -25,6 +25,7 @@ import org.eclipse.emf.ecore.EObject; | |||
25 | import org.eclipse.emf.ecore.resource.Resource; | 25 | import org.eclipse.emf.ecore.resource.Resource; |
26 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; | 26 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; |
27 | import org.eclipse.xtend2.lib.StringConcatenation; | 27 | import org.eclipse.xtend2.lib.StringConcatenation; |
28 | import org.eclipse.xtext.xbase.lib.Exceptions; | ||
28 | import org.eclipse.xtext.xbase.lib.InputOutput; | 29 | import org.eclipse.xtext.xbase.lib.InputOutput; |
29 | import org.eclipse.xtext.xbase.lib.ObjectExtensions; | 30 | import org.eclipse.xtext.xbase.lib.ObjectExtensions; |
30 | import org.eclipse.xtext.xbase.lib.Procedures.Procedure1; | 31 | import org.eclipse.xtext.xbase.lib.Procedures.Procedure1; |
@@ -32,70 +33,74 @@ import org.eclipse.xtext.xbase.lib.Procedures.Procedure1; | |||
32 | @SuppressWarnings("all") | 33 | @SuppressWarnings("all") |
33 | public class FileSystemTest { | 34 | public class FileSystemTest { |
34 | public static void main(final String[] args) { | 35 | public static void main(final String[] args) { |
35 | final Ecore2Logic ecore2Logic = new Ecore2Logic(); | 36 | try { |
36 | final Viatra2Logic viatra2Logic = new Viatra2Logic(ecore2Logic); | 37 | final Ecore2Logic ecore2Logic = new Ecore2Logic(); |
37 | final InstanceModel2Logic instanceModel2Logic = new InstanceModel2Logic(); | 38 | final Viatra2Logic viatra2Logic = new Viatra2Logic(ecore2Logic); |
38 | StringConcatenation _builder = new StringConcatenation(); | 39 | final InstanceModel2Logic instanceModel2Logic = new InstanceModel2Logic(); |
39 | _builder.append("initialModels/"); | 40 | StringConcatenation _builder = new StringConcatenation(); |
40 | final FileSystemWorkspace inputs = new FileSystemWorkspace(_builder.toString(), ""); | 41 | _builder.append("initialModels/"); |
41 | StringConcatenation _builder_1 = new StringConcatenation(); | 42 | final FileSystemWorkspace inputs = new FileSystemWorkspace(_builder.toString(), ""); |
42 | _builder_1.append("output/FileSystemTest/"); | 43 | StringConcatenation _builder_1 = new StringConcatenation(); |
43 | final FileSystemWorkspace workspace = new FileSystemWorkspace(_builder_1.toString(), ""); | 44 | _builder_1.append("output/FileSystemTest/"); |
44 | workspace.initAndClear(); | 45 | final FileSystemWorkspace workspace = new FileSystemWorkspace(_builder_1.toString(), ""); |
45 | final Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE; | 46 | workspace.initAndClear(); |
46 | final Map<String, Object> map = reg.getExtensionToFactoryMap(); | 47 | final Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE; |
47 | XMIResourceFactoryImpl _xMIResourceFactoryImpl = new XMIResourceFactoryImpl(); | 48 | final Map<String, Object> map = reg.getExtensionToFactoryMap(); |
48 | map.put("logicproblem", _xMIResourceFactoryImpl); | 49 | XMIResourceFactoryImpl _xMIResourceFactoryImpl = new XMIResourceFactoryImpl(); |
49 | InputOutput.<String>println("Input and output workspaces are created"); | 50 | map.put("logicproblem", _xMIResourceFactoryImpl); |
50 | final EcoreMetamodelDescriptor metamodel = GeneralTest.loadMetamodel(filesystemPackage.eINSTANCE); | 51 | InputOutput.<String>println("Input and output workspaces are created"); |
51 | final EList<EObject> partialModel = GeneralTest.loadPartialModel(inputs, "fs/filesystemInstance.xmi"); | 52 | final EcoreMetamodelDescriptor metamodel = GeneralTest.loadMetamodel(filesystemPackage.eINSTANCE); |
52 | InputOutput.<String>println("DSL loaded"); | 53 | final EList<EObject> partialModel = GeneralTest.loadPartialModel(inputs, "fs/filesystemInstance.xmi"); |
53 | Ecore2LogicConfiguration _ecore2LogicConfiguration = new Ecore2LogicConfiguration(); | 54 | InputOutput.<String>println("DSL loaded"); |
54 | final TracedOutput<LogicProblem, Ecore2Logic_Trace> modelGenerationProblem = ecore2Logic.transformMetamodel(metamodel, _ecore2LogicConfiguration); | 55 | Ecore2LogicConfiguration _ecore2LogicConfiguration = new Ecore2LogicConfiguration(); |
55 | LogicProblem problem = modelGenerationProblem.getOutput(); | 56 | final TracedOutput<LogicProblem, Ecore2Logic_Trace> modelGenerationProblem = ecore2Logic.transformMetamodel(metamodel, _ecore2LogicConfiguration); |
56 | problem = instanceModel2Logic.transform(modelGenerationProblem, partialModel).getOutput(); | 57 | LogicProblem problem = modelGenerationProblem.getOutput(); |
57 | workspace.writeModel(problem, "FileSystem.logicproblem"); | 58 | problem = instanceModel2Logic.transform(modelGenerationProblem, partialModel).getOutput(); |
58 | InputOutput.<String>println("Problem created"); | 59 | workspace.writeModel(problem, "FileSystem.logicproblem"); |
59 | long startTime = System.currentTimeMillis(); | 60 | InputOutput.<String>println("Problem created"); |
60 | VampireSolver reasoner = null; | 61 | long startTime = System.currentTimeMillis(); |
61 | VampireSolver _vampireSolver = new VampireSolver(); | 62 | VampireSolver reasoner = null; |
62 | reasoner = _vampireSolver; | 63 | VampireSolver _vampireSolver = new VampireSolver(); |
63 | final HashMap<Class, Integer> classMapMin = new HashMap<Class, Integer>(); | 64 | reasoner = _vampireSolver; |
64 | classMapMin.put(Dir.class, Integer.valueOf(10)); | 65 | final HashMap<Class, Integer> classMapMin = new HashMap<Class, Integer>(); |
65 | classMapMin.put(File.class, Integer.valueOf(5)); | 66 | classMapMin.put(Dir.class, Integer.valueOf(10)); |
66 | final Map<Type, Integer> typeMapMin = GeneralTest.getTypeMap(classMapMin, metamodel, ecore2Logic, modelGenerationProblem.getTrace()); | 67 | classMapMin.put(File.class, Integer.valueOf(5)); |
67 | final HashMap<Class, Integer> classMapMax = new HashMap<Class, Integer>(); | 68 | final Map<Type, Integer> typeMapMin = GeneralTest.getTypeMap(classMapMin, metamodel, ecore2Logic, modelGenerationProblem.getTrace()); |
68 | classMapMax.put(File.class, Integer.valueOf(15)); | 69 | final HashMap<Class, Integer> classMapMax = new HashMap<Class, Integer>(); |
69 | classMapMax.put(Dir.class, Integer.valueOf(15)); | 70 | classMapMax.put(File.class, Integer.valueOf(15)); |
70 | final Map<Type, Integer> typeMapMax = GeneralTest.getTypeMap(classMapMax, metamodel, ecore2Logic, modelGenerationProblem.getTrace()); | 71 | classMapMax.put(Dir.class, Integer.valueOf(15)); |
71 | VampireSolverConfiguration _vampireSolverConfiguration = new VampireSolverConfiguration(); | 72 | final Map<Type, Integer> typeMapMax = GeneralTest.getTypeMap(classMapMax, metamodel, ecore2Logic, modelGenerationProblem.getTrace()); |
72 | final Procedure1<VampireSolverConfiguration> _function = (VampireSolverConfiguration it) -> { | 73 | VampireSolverConfiguration _vampireSolverConfiguration = new VampireSolverConfiguration(); |
73 | it.documentationLevel = DocumentationLevel.FULL; | 74 | final Procedure1<VampireSolverConfiguration> _function = (VampireSolverConfiguration it) -> { |
74 | it.typeScopes.minNewElements = 10; | 75 | it.documentationLevel = DocumentationLevel.FULL; |
75 | it.typeScopes.maxNewElements = 25; | 76 | it.typeScopes.minNewElements = 10; |
76 | int _size = typeMapMin.size(); | 77 | it.typeScopes.maxNewElements = 25; |
77 | boolean _notEquals = (_size != 0); | 78 | int _size = typeMapMin.size(); |
78 | if (_notEquals) { | 79 | boolean _notEquals = (_size != 0); |
79 | it.typeScopes.minNewElementsByType = typeMapMin; | 80 | if (_notEquals) { |
80 | } | 81 | it.typeScopes.minNewElementsByType = typeMapMin; |
81 | int _size_1 = typeMapMin.size(); | 82 | } |
82 | boolean _notEquals_1 = (_size_1 != 0); | 83 | int _size_1 = typeMapMin.size(); |
83 | if (_notEquals_1) { | 84 | boolean _notEquals_1 = (_size_1 != 0); |
84 | it.typeScopes.maxNewElementsByType = typeMapMax; | 85 | if (_notEquals_1) { |
85 | } | 86 | it.typeScopes.maxNewElementsByType = typeMapMax; |
86 | it.contCycleLevel = 5; | 87 | } |
87 | it.uniquenessDuplicates = false; | 88 | it.contCycleLevel = 5; |
88 | }; | 89 | it.uniquenessDuplicates = false; |
89 | final VampireSolverConfiguration vampireConfig = ObjectExtensions.<VampireSolverConfiguration>operator_doubleArrow(_vampireSolverConfiguration, _function); | 90 | }; |
90 | LogicResult solution = reasoner.solve(problem, vampireConfig, workspace, "FS"); | 91 | final VampireSolverConfiguration vampireConfig = ObjectExtensions.<VampireSolverConfiguration>operator_doubleArrow(_vampireSolverConfiguration, _function); |
91 | long _currentTimeMillis = System.currentTimeMillis(); | 92 | LogicResult solution = reasoner.solve(problem, vampireConfig, workspace); |
92 | long _minus = (_currentTimeMillis - startTime); | 93 | long _currentTimeMillis = System.currentTimeMillis(); |
93 | long totalTimeMin = (_minus / 60000); | 94 | long _minus = (_currentTimeMillis - startTime); |
94 | long _currentTimeMillis_1 = System.currentTimeMillis(); | 95 | long totalTimeMin = (_minus / 60000); |
95 | long _minus_1 = (_currentTimeMillis_1 - startTime); | 96 | long _currentTimeMillis_1 = System.currentTimeMillis(); |
96 | long _divide = (_minus_1 / 1000); | 97 | long _minus_1 = (_currentTimeMillis_1 - startTime); |
97 | long totalTimeSec = (_divide % 60); | 98 | long _divide = (_minus_1 / 1000); |
98 | InputOutput.<String>println("Problem solved"); | 99 | long totalTimeSec = (_divide % 60); |
99 | InputOutput.<String>println(((("Time was: " + Long.valueOf(totalTimeMin)) + ":") + Long.valueOf(totalTimeSec))); | 100 | InputOutput.<String>println("Problem solved"); |
101 | InputOutput.<String>println(((("Time was: " + Long.valueOf(totalTimeMin)) + ":") + Long.valueOf(totalTimeSec))); | ||
102 | } catch (Throwable _e) { | ||
103 | throw Exceptions.sneakyThrow(_e); | ||
104 | } | ||
100 | } | 105 | } |
101 | } | 106 | } |