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 | 64 |
1 files changed, 64 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..b0ed75cb --- /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,64 @@ | |||
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 Count = new Simple("Count") | ||
20 | |||
21 | public static val BasicTypeHierarchy = new Simple("BasicTypeHierarchy") | ||
22 | |||
23 | private new() { | ||
24 | } | ||
25 | |||
26 | def boolean requiresUpperBoundIndexing() | ||
27 | |||
28 | static class Simple extends ScopePropagatorStrategy { | ||
29 | val String name | ||
30 | |||
31 | @FinalFieldsConstructor | ||
32 | private new() { | ||
33 | } | ||
34 | |||
35 | override requiresUpperBoundIndexing() { | ||
36 | false | ||
37 | } | ||
38 | |||
39 | override toString() { | ||
40 | name | ||
41 | } | ||
42 | } | ||
43 | |||
44 | @Data | ||
45 | static class Polyhedral extends ScopePropagatorStrategy { | ||
46 | public static val UNLIMITED_TIME = -1 | ||
47 | |||
48 | val PolyhedralScopePropagatorConstraints constraints | ||
49 | val PolyhedralScopePropagatorSolver solver | ||
50 | val double timeoutSeconds | ||
51 | |||
52 | @FinalFieldsConstructor | ||
53 | new() { | ||
54 | } | ||
55 | |||
56 | new(PolyhedralScopePropagatorConstraints constraints, PolyhedralScopePropagatorSolver solver) { | ||
57 | this(constraints, solver, UNLIMITED_TIME) | ||
58 | } | ||
59 | |||
60 | override requiresUpperBoundIndexing() { | ||
61 | constraints == PolyhedralScopePropagatorConstraints.Relational | ||
62 | } | ||
63 | } | ||
64 | } | ||