diff options
author | 2019-01-15 12:44:33 -0500 | |
---|---|---|
committer | 2020-06-07 19:06:26 -0400 | |
commit | f87b4233437f0900c19f462b5e443a3c81b27b6e (patch) | |
tree | fa5af86016db54e24f54e3d801424eb1216efc2f /Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/VampireSolver.java | |
parent | Fix numeric-solver-at-end (diff) | |
download | VIATRA-Generator-f87b4233437f0900c19f462b5e443a3c81b27b6e.tar.gz VIATRA-Generator-f87b4233437f0900c19f462b5e443a3c81b27b6e.tar.zst VIATRA-Generator-f87b4233437f0900c19f462b5e443a3c81b27b6e.zip |
Initial workspace setup
Diffstat (limited to 'Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/VampireSolver.java')
-rw-r--r-- | Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/VampireSolver.java | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/VampireSolver.java b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/VampireSolver.java new file mode 100644 index 00000000..81cae109 --- /dev/null +++ b/Solvers/Vampire-Solver/ca.mcgill.ecse.dslreasoner.vampire.reasoner/xtend-gen/ca/mcgill/ecse/dslreasoner/vampire/reasoner/VampireSolver.java | |||
@@ -0,0 +1,80 @@ | |||
1 | package ca.mcgill.ecse.dslreasoner.vampire.reasoner; | ||
2 | |||
3 | import ca.mcgill.ecse.dslreasoner.VampireLanguageStandaloneSetup; | ||
4 | import ca.mcgill.ecse.dslreasoner.VampireLanguageStandaloneSetupGenerated; | ||
5 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.VampireSolverConfiguration; | ||
6 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Logic2VampireLanguageMapper; | ||
7 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Logic2VampireLanguageMapperTrace; | ||
8 | import ca.mcgill.ecse.dslreasoner.vampire.reasoner.builder.Logic2VampireLanguageMapper_TypeMapper_FilteredTypes; | ||
9 | import ca.mcgill.ecse.dslreasoner.vampireLanguage.VampireLanguagePackage; | ||
10 | import ca.mcgill.ecse.dslreasoner.vampireLanguage.VampireModel; | ||
11 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicModelInterpretation; | ||
12 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicReasoner; | ||
13 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicReasonerException; | ||
14 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicSolverConfiguration; | ||
15 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.TracedOutput; | ||
16 | import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem; | ||
17 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicResult; | ||
18 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult; | ||
19 | import hu.bme.mit.inf.dslreasoner.workspace.ReasonerWorkspace; | ||
20 | import java.io.PrintWriter; | ||
21 | import java.util.List; | ||
22 | import org.eclipse.xtend2.lib.StringConcatenation; | ||
23 | import org.eclipse.xtext.xbase.lib.Exceptions; | ||
24 | |||
25 | @SuppressWarnings("all") | ||
26 | public class VampireSolver extends LogicReasoner { | ||
27 | public VampireSolver() { | ||
28 | VampireLanguagePackage.eINSTANCE.eClass(); | ||
29 | final VampireLanguageStandaloneSetupGenerated x = new VampireLanguageStandaloneSetupGenerated(); | ||
30 | VampireLanguageStandaloneSetup.doSetup(); | ||
31 | } | ||
32 | |||
33 | private final Logic2VampireLanguageMapper forwardMapper = new Logic2VampireLanguageMapper(new Logic2VampireLanguageMapper_TypeMapper_FilteredTypes()); | ||
34 | |||
35 | private final String fileName = "problem.tptp"; | ||
36 | |||
37 | @Override | ||
38 | public LogicResult solve(final LogicProblem problem, final LogicSolverConfiguration configuration, final ReasonerWorkspace workspace) throws LogicReasonerException { | ||
39 | try { | ||
40 | final VampireSolverConfiguration vampireConfig = this.asConfig(configuration); | ||
41 | final long transformationStart = System.currentTimeMillis(); | ||
42 | final TracedOutput<VampireModel, Logic2VampireLanguageMapperTrace> result = this.forwardMapper.transformProblem(problem, vampireConfig); | ||
43 | final VampireModel vampireProblem = result.getOutput(); | ||
44 | final Logic2VampireLanguageMapperTrace forwardTrace = result.getTrace(); | ||
45 | String fileURI = null; | ||
46 | String vampireCode = null; | ||
47 | if (vampireConfig.writeToFile) { | ||
48 | fileURI = workspace.writeModel(vampireProblem, this.fileName).toFileString(); | ||
49 | } else { | ||
50 | vampireCode = workspace.writeModelToString(vampireProblem, this.fileName); | ||
51 | } | ||
52 | long _currentTimeMillis = System.currentTimeMillis(); | ||
53 | final long transformationTime = (_currentTimeMillis - transformationStart); | ||
54 | final PrintWriter out = new PrintWriter("output/files/vampireCode.tptp"); | ||
55 | out.println(vampireCode); | ||
56 | out.close(); | ||
57 | return null; | ||
58 | } catch (Throwable _e) { | ||
59 | throw Exceptions.sneakyThrow(_e); | ||
60 | } | ||
61 | } | ||
62 | |||
63 | public VampireSolverConfiguration asConfig(final LogicSolverConfiguration configuration) { | ||
64 | if ((configuration instanceof VampireSolverConfiguration)) { | ||
65 | return ((VampireSolverConfiguration)configuration); | ||
66 | } else { | ||
67 | StringConcatenation _builder = new StringConcatenation(); | ||
68 | _builder.append("The configuration have to be an "); | ||
69 | String _simpleName = VampireSolverConfiguration.class.getSimpleName(); | ||
70 | _builder.append(_simpleName); | ||
71 | _builder.append("!"); | ||
72 | throw new IllegalArgumentException(_builder.toString()); | ||
73 | } | ||
74 | } | ||
75 | |||
76 | @Override | ||
77 | public List<? extends LogicModelInterpretation> getInterpretations(final ModelResult modelResult) { | ||
78 | return null; | ||
79 | } | ||
80 | } | ||