diff options
author | 2017-07-02 23:33:40 +0200 | |
---|---|---|
committer | 2017-07-02 23:33:40 +0200 | |
commit | 487c4280fd8e764960ef9d2848b94fa67927c67a (patch) | |
tree | 3dae1b75129280e25ff94fd291b4326688677b5e /Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme | |
parent | Logic interpretation -> standard EMF instance model (diff) | |
download | VIATRA-Generator-487c4280fd8e764960ef9d2848b94fa67927c67a.tar.gz VIATRA-Generator-487c4280fd8e764960ef9d2848b94fa67927c67a.tar.zst VIATRA-Generator-487c4280fd8e764960ef9d2848b94fa67927c67a.zip |
Multiple model with interpretations
Diffstat (limited to 'Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme')
2 files changed, 21 insertions, 3 deletions
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicSolver.xtend b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicSolver.xtend index 2e3d57cf..7b384bc4 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicSolver.xtend +++ b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/LogicSolver.xtend | |||
@@ -4,13 +4,14 @@ import hu.bme.mit.inf.dslreasoner.logic.model.logicproblem.LogicProblem | |||
4 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicResult | 4 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicResult |
5 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult | 5 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult |
6 | import hu.bme.mit.inf.dslreasoner.workspace.ReasonerWorkspace | 6 | import hu.bme.mit.inf.dslreasoner.workspace.ReasonerWorkspace |
7 | import java.util.List | ||
7 | 8 | ||
8 | abstract class LogicReasoner { | 9 | abstract class LogicReasoner { |
9 | def abstract LogicResult solve( | 10 | def abstract LogicResult solve( |
10 | LogicProblem problem, | 11 | LogicProblem problem, |
11 | LogicSolverConfiguration configuration, | 12 | LogicSolverConfiguration configuration, |
12 | ReasonerWorkspace workspace) throws LogicReasonerException | 13 | ReasonerWorkspace workspace) throws LogicReasonerException |
13 | def abstract LogicModelInterpretation getInterpretation(ModelResult modelResult) | 14 | def abstract List<? extends LogicModelInterpretation> getInterpretations(ModelResult modelResult) |
14 | } | 15 | } |
15 | 16 | ||
16 | public class LogicReasonerException extends Exception { | 17 | public class LogicReasonerException extends Exception { |
@@ -34,14 +35,31 @@ abstract class LogicSolverConfiguration { | |||
34 | public var SolutionScope solutionScope = new SolutionScope | 35 | public var SolutionScope solutionScope = new SolutionScope |
35 | } | 36 | } |
36 | 37 | ||
38 | /** | ||
39 | * Defines the the size of the generated models. Constant <code>Unlimited</code> defines no upper limit to the type. | ||
40 | */ | ||
37 | public class TypeScopes{ | 41 | public class TypeScopes{ |
38 | public static val Unlimited = -1; | 42 | public static val Unlimited = -1; |
43 | |||
44 | /** | ||
45 | * Defines a limit for integers in the logic problem. | ||
46 | */ | ||
39 | public var maxIntScope = Unlimited | 47 | public var maxIntScope = Unlimited |
48 | /** | ||
49 | * Defines the minimal number of newly added elements. Default value is 0. | ||
50 | */ | ||
40 | public var minNewElements = 0 | 51 | public var minNewElements = 0 |
52 | /** | ||
53 | * Defines the maximal number of newly added elements. Default value is <code>TypeScopes.Unlimited</code>. | ||
54 | */ | ||
41 | public var maxNewElements = Unlimited | 55 | public var maxNewElements = Unlimited |
42 | } | 56 | } |
43 | 57 | ||
58 | /** | ||
59 | * Defines the required number of solutions for the problem. | ||
60 | * Constant <code>All</code> defines that all solution for the problem is requested. | ||
61 | */ | ||
44 | public class SolutionScope{ | 62 | public class SolutionScope{ |
45 | public static val Unlimited = -1; | 63 | public static val All = -1; |
46 | public var numberOfRequiredSolution = 1 | 64 | public var numberOfRequiredSolution = 1 |
47 | } \ No newline at end of file | 65 | } \ No newline at end of file |
diff --git a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/consistencychecker/TypeConsistencyChecker.xtend b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/consistencychecker/TypeConsistencyChecker.xtend index abb05e83..9148424c 100644 --- a/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/consistencychecker/TypeConsistencyChecker.xtend +++ b/Framework/hu.bme.mit.inf.dslreasoner.logic.model/src/hu/bme/mit/inf/dslreasoner/logic/model/builder/consistencychecker/TypeConsistencyChecker.xtend | |||
@@ -69,7 +69,7 @@ class TypeConsistencyChecker extends LogicReasoner{ | |||
69 | } | 69 | } |
70 | } | 70 | } |
71 | 71 | ||
72 | override getInterpretation(ModelResult modelResult) { | 72 | override getInterpretations(ModelResult modelResult) { |
73 | throw new UnsupportedOperationException('''This solver is unable to create interpretations!''') | 73 | throw new UnsupportedOperationException('''This solver is unable to create interpretations!''') |
74 | } | 74 | } |
75 | } \ No newline at end of file | 75 | } \ No newline at end of file |