diff options
Diffstat (limited to 'Tests/ca.mcgill.ecse.dslreasoner.vampire.test/src/ca')
-rw-r--r-- | Tests/ca.mcgill.ecse.dslreasoner.vampire.test/src/ca/mcgill/ecse/dslreasoner/vampire/icse/FAMTest.xtend | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/src/ca/mcgill/ecse/dslreasoner/vampire/icse/FAMTest.xtend b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/src/ca/mcgill/ecse/dslreasoner/vampire/icse/FAMTest.xtend index a7da818c..17f9ae5e 100644 --- a/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/src/ca/mcgill/ecse/dslreasoner/vampire/icse/FAMTest.xtend +++ b/Tests/ca.mcgill.ecse.dslreasoner.vampire.test/src/ca/mcgill/ecse/dslreasoner/vampire/icse/FAMTest.xtend | |||
@@ -1,5 +1,6 @@ | |||
1 | package ca.mcgill.ecse.dslreasoner.vampire.icse | 1 | package ca.mcgill.ecse.dslreasoner.vampire.icse |
2 | 2 | ||
3 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.BackendSolver | ||
3 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireSolver | 4 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireSolver |
4 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireSolverConfiguration | 5 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireSolverConfiguration |
5 | import functionalarchitecture.FAMTerminator | 6 | import functionalarchitecture.FAMTerminator |
@@ -8,7 +9,6 @@ import functionalarchitecture.FunctionalArchitectureModel | |||
8 | import functionalarchitecture.FunctionalInterface | 9 | import functionalarchitecture.FunctionalInterface |
9 | import functionalarchitecture.FunctionalOutput | 10 | import functionalarchitecture.FunctionalOutput |
10 | import functionalarchitecture.FunctionalarchitecturePackage | 11 | import functionalarchitecture.FunctionalarchitecturePackage |
11 | //import hu.bme.mit.inf.dslreasoner.domains.transima.fam.FamPatterns | ||
12 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic | 12 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic |
13 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2LogicConfiguration | 13 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2LogicConfiguration |
14 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.DocumentationLevel | 14 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.DocumentationLevel |
@@ -16,7 +16,6 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicResult | |||
16 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult | 16 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult |
17 | import hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore | 17 | import hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore |
18 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2Logic | 18 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2Logic |
19 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2LogicConfiguration | ||
20 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2Logic | 19 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2Logic |
21 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2PartialInterpretation | 20 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2PartialInterpretation |
22 | import hu.bme.mit.inf.dslreasoner.workspace.FileSystemWorkspace | 21 | import hu.bme.mit.inf.dslreasoner.workspace.FileSystemWorkspace |
@@ -46,7 +45,7 @@ class FAMTest { | |||
46 | 45 | ||
47 | // Load DSL | 46 | // Load DSL |
48 | val metamodel = GeneralTest.loadMetamodel(FunctionalarchitecturePackage.eINSTANCE) | 47 | val metamodel = GeneralTest.loadMetamodel(FunctionalarchitecturePackage.eINSTANCE) |
49 | val partialModel = GeneralTest.loadPartialModel(inputs, "FAM/FaModel.xmi") | 48 | // val partialModel = GeneralTest.loadPartialModel(inputs, "FAM/FaModel.xmi") |
50 | // val queries = GeneralTest.loadQueries(metamodel, FamPatterns.instance) | 49 | // val queries = GeneralTest.loadQueries(metamodel, FamPatterns.instance) |
51 | val queries = null | 50 | val queries = null |
52 | 51 | ||
@@ -54,7 +53,7 @@ class FAMTest { | |||
54 | 53 | ||
55 | val modelGenerationProblem = ecore2Logic.transformMetamodel(metamodel, new Ecore2LogicConfiguration()) | 54 | val modelGenerationProblem = ecore2Logic.transformMetamodel(metamodel, new Ecore2LogicConfiguration()) |
56 | var problem = modelGenerationProblem.output | 55 | var problem = modelGenerationProblem.output |
57 | problem = instanceModel2Logic.transform(modelGenerationProblem, partialModel).output | 56 | // problem = instanceModel2Logic.transform(modelGenerationProblem, partialModel).output |
58 | // problem = viatra2Logic.transformQueries(queries, modelGenerationProblem, new Viatra2LogicConfiguration).output | 57 | // problem = viatra2Logic.transformQueries(queries, modelGenerationProblem, new Viatra2LogicConfiguration).output |
59 | workspace.writeModel(problem, "Fam.logicproblem") | 58 | workspace.writeModel(problem, "Fam.logicproblem") |
60 | 59 | ||
@@ -96,6 +95,7 @@ class FAMTest { | |||
96 | it.typeScopes.maxNewElements = 10//25 | 95 | it.typeScopes.maxNewElements = 10//25 |
97 | // if(typeMapMin.size != 0) it.typeScopes.minNewElementsByType = typeMapMin | 96 | // if(typeMapMin.size != 0) it.typeScopes.minNewElementsByType = typeMapMin |
98 | // if(typeMapMax.size != 0) it.typeScopes.maxNewElementsByType = typeMapMax | 97 | // if(typeMapMax.size != 0) it.typeScopes.maxNewElementsByType = typeMapMax |
98 | it.solver = BackendSolver::LOCVAMP | ||
99 | it.contCycleLevel = 5 | 99 | it.contCycleLevel = 5 |
100 | it.uniquenessDuplicates = false | 100 | it.uniquenessDuplicates = false |
101 | ] | 101 | ] |
@@ -110,25 +110,25 @@ class FAMTest { | |||
110 | // Literal(modelGenerationProblem.trace, ecore2Logic.allLiteralsInScope(modelGenerationProblem.trace).get(0) ) | 110 | // Literal(modelGenerationProblem.trace, ecore2Logic.allLiteralsInScope(modelGenerationProblem.trace).get(0) ) |
111 | // ) | 111 | // ) |
112 | // println((ecore2Logic.allAttributesInScope(modelGenerationProblem.trace)).get(0).EAttributeType) | 112 | // println((ecore2Logic.allAttributesInScope(modelGenerationProblem.trace)).get(0).EAttributeType) |
113 | print(interpretations.class) | 113 | // print(interpretations.class) |
114 | for (interpretation : interpretations) { | 114 | // for (interpretation : interpretations) { |
115 | val model = logic2Ecore.transformInterpretation(interpretation, modelGenerationProblem.trace) | 115 | // val model = logic2Ecore.transformInterpretation(interpretation, modelGenerationProblem.trace) |
116 | workspace.writeModel(model, "model.xmi") | 116 | // workspace.writeModel(model, "model.xmi") |
117 | |||
118 | // val representation = im2pi.transform(modelGenerationProblem, model.eAllContents.toList, false)//solution.representation.get(0) // TODO: fix for multiple represenations | ||
119 | // if (representation instanceof PartialInterpretation) { | ||
120 | // val vis1 = new PartialInterpretation2Gml | ||
121 | // val gml = vis1.transform(representation) | ||
122 | // workspace.writeText("model.gml", gml) | ||
123 | // | 117 | // |
124 | // val vis2 = new GraphvizVisualiser | 118 | //// val representation = im2pi.transform(modelGenerationProblem, model.eAllContents.toList, false)//solution.representation.get(0) // TODO: fix for multiple represenations |
125 | // val dot = vis2.visualiseConcretization(representation) | 119 | //// if (representation instanceof PartialInterpretation) { |
126 | // dot.writeToFile(workspace, "model.png") | 120 | //// val vis1 = new PartialInterpretation2Gml |
127 | // } else { | 121 | //// val gml = vis1.transform(representation) |
128 | // println("ERROR") | 122 | //// workspace.writeText("model.gml", gml) |
129 | // } | 123 | //// |
130 | // look here: hu.bme.mit.inf.dslreasoner.application.execution.GenerationTaskExecutor | 124 | //// val vis2 = new GraphvizVisualiser |
131 | } | 125 | //// val dot = vis2.visualiseConcretization(representation) |
126 | //// dot.writeToFile(workspace, "model.png") | ||
127 | //// } else { | ||
128 | //// println("ERROR") | ||
129 | //// } | ||
130 | //// look here: hu.bme.mit.inf.dslreasoner.application.execution.GenerationTaskExecutor | ||
131 | // } | ||
132 | 132 | ||
133 | // transform interpretation to ecore, and it is easy from there | 133 | // transform interpretation to ecore, and it is easy from there |
134 | /*/ | 134 | /*/ |
@@ -147,7 +147,6 @@ class FAMTest { | |||
147 | var totalTimeMin = (System.currentTimeMillis - startTime) / 60000 | 147 | var totalTimeMin = (System.currentTimeMillis - startTime) / 60000 |
148 | var totalTimeSec = ((System.currentTimeMillis - startTime) / 1000) % 60 | 148 | var totalTimeSec = ((System.currentTimeMillis - startTime) / 1000) % 60 |
149 | 149 | ||
150 | println("Problem solved") | ||
151 | println("Time was: " + totalTimeMin + ":" + totalTimeSec) | 150 | println("Time was: " + totalTimeMin + ":" + totalTimeSec) |
152 | } | 151 | } |
153 | 152 | ||