diff options
author | 2021-08-16 01:25:13 +0200 | |
---|---|---|
committer | 2021-08-16 01:25:13 +0200 | |
commit | 313e82e1ad410f80ca7a6fdd6bb86d35185634e1 (patch) | |
tree | 4de12d917c8029e97842ace2dd93da35813c918d /model-data | |
parent | Caching tuple1 objects (diff) | |
download | refinery-313e82e1ad410f80ca7a6fdd6bb86d35185634e1.tar.gz refinery-313e82e1ad410f80ca7a6fdd6bb86d35185634e1.tar.zst refinery-313e82e1ad410f80ca7a6fdd6bb86d35185634e1.zip |
Removed symbols as they were not on the right abstraction level
Diffstat (limited to 'model-data')
8 files changed, 11 insertions, 64 deletions
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/Relation.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/Relation.java index 28d00b2a..601ee118 100644 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/Relation.java +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/Relation.java | |||
@@ -2,27 +2,28 @@ package org.eclipse.viatra.solver.data.model.representation; | |||
2 | 2 | ||
3 | import org.eclipse.viatra.solver.data.model.Tuple; | 3 | import org.eclipse.viatra.solver.data.model.Tuple; |
4 | import org.eclipse.viatra.solver.data.model.TupleHashProvider; | 4 | import org.eclipse.viatra.solver.data.model.TupleHashProvider; |
5 | import org.eclipse.viatra.solver.data.model.symbols.Symbol; | ||
6 | 5 | ||
7 | public class Relation<D> extends DataRepresentation<Tuple, D> { | 6 | public class Relation<D> extends DataRepresentation<Tuple, D> { |
8 | private final Symbol symbol; | 7 | private final String name; |
8 | private final int arity; | ||
9 | 9 | ||
10 | public Relation(Symbol symbol, Class<D> domain, D defaultValue) { | 10 | public Relation(String name, int arity, Class<D> domain, D defaultValue) { |
11 | super(Tuple.class, TupleHashProvider.singleton(), domain, defaultValue); | 11 | super(Tuple.class, TupleHashProvider.singleton(), domain, defaultValue); |
12 | this.symbol = symbol; | 12 | this.name = name; |
13 | this.arity = arity; | ||
13 | } | 14 | } |
14 | 15 | ||
15 | @Override | 16 | @Override |
16 | public String getName() { | 17 | public String getName() { |
17 | return symbol.getName(); | 18 | return name; |
18 | } | 19 | } |
19 | 20 | ||
20 | public Symbol getSymbol() { | 21 | public int getArity() { |
21 | return symbol; | 22 | return arity; |
22 | } | 23 | } |
23 | 24 | ||
24 | @Override | 25 | @Override |
25 | public boolean isValidKey(Tuple key) { | 26 | public boolean isValidKey(Tuple key) { |
26 | return key.getSize() == symbol.getArity(); | 27 | return key.getSize() == getArity(); |
27 | } | 28 | } |
28 | } | 29 | } |
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/IntegerSymbol.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/IntegerSymbol.java deleted file mode 100644 index b5e0a326..00000000 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/IntegerSymbol.java +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | package org.eclipse.viatra.solver.data.model.symbols; | ||
2 | |||
3 | public class IntegerSymbol extends Symbol{ | ||
4 | |||
5 | public IntegerSymbol(String name, int arity) { | ||
6 | super(name, arity); | ||
7 | } | ||
8 | } | ||
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/PredicateSymbol.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/PredicateSymbol.java deleted file mode 100644 index 84e6aff6..00000000 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/PredicateSymbol.java +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | package org.eclipse.viatra.solver.data.model.symbols; | ||
2 | |||
3 | public class PredicateSymbol extends Symbol{ | ||
4 | |||
5 | public PredicateSymbol(String name, int arity) { | ||
6 | super(name, arity); | ||
7 | } | ||
8 | |||
9 | } | ||
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/RealSymbol.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/RealSymbol.java deleted file mode 100644 index 081d2196..00000000 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/RealSymbol.java +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | package org.eclipse.viatra.solver.data.model.symbols; | ||
2 | |||
3 | public class RealSymbol extends Symbol{ | ||
4 | |||
5 | public RealSymbol(String name, int arity) { | ||
6 | super(name, arity); | ||
7 | } | ||
8 | } | ||
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/Symbol.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/Symbol.java deleted file mode 100644 index 12ebed9e..00000000 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/Symbol.java +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | package org.eclipse.viatra.solver.data.model.symbols; | ||
2 | |||
3 | public class Symbol { | ||
4 | private final String name; | ||
5 | private final int arity; | ||
6 | |||
7 | public Symbol(String name, int arity) { | ||
8 | super(); | ||
9 | this.name = name; | ||
10 | this.arity = arity; | ||
11 | } | ||
12 | |||
13 | public String getName() { | ||
14 | return name; | ||
15 | } | ||
16 | public int getArity() { | ||
17 | return arity; | ||
18 | } | ||
19 | } | ||
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/SymbolComparator.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/SymbolComparator.java deleted file mode 100644 index ab7834f1..00000000 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/symbols/SymbolComparator.java +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | package org.eclipse.viatra.solver.data.model.symbols; | ||
2 | |||
3 | import java.util.Comparator; | ||
4 | |||
5 | public class SymbolComparator implements Comparator<Symbol>{ | ||
6 | @Override | ||
7 | public int compare(Symbol o1, Symbol o2) { | ||
8 | return o1.getName().compareTo(o2.getName()); | ||
9 | } | ||
10 | } | ||
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/query/view/FilteredRelationView.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/query/view/FilteredRelationView.java index 713673e2..9f71f8cf 100644 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/query/view/FilteredRelationView.java +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/query/view/FilteredRelationView.java | |||
@@ -35,6 +35,6 @@ public abstract class FilteredRelationView<D> extends RelationView<D>{ | |||
35 | 35 | ||
36 | @Override | 36 | @Override |
37 | public int getArity() { | 37 | public int getArity() { |
38 | return this.representation.getSymbol().getArity(); | 38 | return this.representation.getArity(); |
39 | } | 39 | } |
40 | } | 40 | } |
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/query/view/FunctionalRelationView.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/query/view/FunctionalRelationView.java index 03c25641..ee52972c 100644 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/query/view/FunctionalRelationView.java +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/query/view/FunctionalRelationView.java | |||
@@ -45,6 +45,6 @@ public class FunctionalRelationView<D> extends RelationView<D> { | |||
45 | 45 | ||
46 | @Override | 46 | @Override |
47 | public int getArity() { | 47 | public int getArity() { |
48 | return this.representation.getSymbol().getArity()+1; | 48 | return this.representation.getArity()+1; |
49 | } | 49 | } |
50 | } | 50 | } |