diff options
Diffstat (limited to 'Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/ScopePropagatorStrategy.xtend')
-rw-r--r-- | Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/ScopePropagatorStrategy.xtend | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/ScopePropagatorStrategy.xtend b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/ScopePropagatorStrategy.xtend new file mode 100644 index 00000000..3165917a --- /dev/null +++ b/Solvers/VIATRA-Solver/hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra/src/hu/bme/mit/inf/dslreasoner/viatrasolver/logic2viatra/cardinality/ScopePropagatorStrategy.xtend | |||
@@ -0,0 +1,71 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality | ||
2 | |||
3 | import org.eclipse.xtend.lib.annotations.Data | ||
4 | import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor | ||
5 | |||
6 | enum PolyhedralScopePropagatorConstraints { | ||
7 | TypeHierarchy, | ||
8 | Relational | ||
9 | } | ||
10 | |||
11 | enum PolyhedralScopePropagatorSolver { | ||
12 | Z3Real, | ||
13 | Z3Integer, | ||
14 | Cbc, | ||
15 | Clp | ||
16 | } | ||
17 | |||
18 | abstract class ScopePropagatorStrategy { | ||
19 | public static val None = new Simple("None") | ||
20 | |||
21 | public static val Basic = new Simple("Basic") | ||
22 | |||
23 | public static val BasicTypeHierarchy = new Simple("BasicTypeHierarchy") | ||
24 | |||
25 | private new() { | ||
26 | } | ||
27 | |||
28 | def boolean requiresUpperBoundIndexing() | ||
29 | |||
30 | static class Simple extends ScopePropagatorStrategy { | ||
31 | val String name | ||
32 | |||
33 | @FinalFieldsConstructor | ||
34 | private new() { | ||
35 | } | ||
36 | |||
37 | override requiresUpperBoundIndexing() { | ||
38 | false | ||
39 | } | ||
40 | |||
41 | override toString() { | ||
42 | name | ||
43 | } | ||
44 | } | ||
45 | |||
46 | @Data | ||
47 | static class Polyhedral extends ScopePropagatorStrategy { | ||
48 | public static val UNLIMITED_TIME = -1 | ||
49 | |||
50 | val PolyhedralScopePropagatorConstraints constraints | ||
51 | val PolyhedralScopePropagatorSolver solver | ||
52 | val boolean updateHeuristic | ||
53 | val double timeoutSeconds | ||
54 | |||
55 | @FinalFieldsConstructor | ||
56 | new() { | ||
57 | } | ||
58 | |||
59 | new(PolyhedralScopePropagatorConstraints constraints, PolyhedralScopePropagatorSolver solver, boolean updateHeuristic) { | ||
60 | this(constraints, solver, updateHeuristic, UNLIMITED_TIME) | ||
61 | } | ||
62 | |||
63 | new(PolyhedralScopePropagatorConstraints constraints, PolyhedralScopePropagatorSolver solver) { | ||
64 | this(constraints, solver, true) | ||
65 | } | ||
66 | |||
67 | override requiresUpperBoundIndexing() { | ||
68 | constraints == PolyhedralScopePropagatorConstraints.Relational | ||
69 | } | ||
70 | } | ||
71 | } | ||