diff options
author | 2023-08-29 12:05:08 +0200 | |
---|---|---|
committer | 2023-08-29 12:05:08 +0200 | |
commit | 5e21737b0a8a903d2e37e821a96a739eb7429fcd (patch) | |
tree | a6080f1daddb96d161f139aee7d92a47c021a9ed /subprojects | |
parent | chore(deps): bump frontend dependencies (diff) | |
download | refinery-5e21737b0a8a903d2e37e821a96a739eb7429fcd.tar.gz refinery-5e21737b0a8a903d2e37e821a96a739eb7429fcd.tar.zst refinery-5e21737b0a8a903d2e37e821a96a739eb7429fcd.zip |
refactor: rename invalidNumberOfContainers
Use a simplified name invalidContainer, since this pattern may match even if
there is a sufficient number of ERROR containers.
Diffstat (limited to 'subprojects')
5 files changed, 10 insertions, 11 deletions
diff --git a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/ModelInitializer.java b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/ModelInitializer.java index aaef3326..13e25d0a 100644 --- a/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/ModelInitializer.java +++ b/subprojects/language-semantics/src/main/java/tools/refinery/language/semantics/model/ModelInitializer.java | |||
@@ -115,8 +115,8 @@ public class ModelInitializer { | |||
115 | null, TruthValue.UNKNOWN)); | 115 | null, TruthValue.UNKNOWN)); |
116 | putRelationInfo(builtinSymbols.contains(), new RelationInfo(ContainmentHierarchyTranslator.CONTAINS_SYMBOL, | 116 | putRelationInfo(builtinSymbols.contains(), new RelationInfo(ContainmentHierarchyTranslator.CONTAINS_SYMBOL, |
117 | null, TruthValue.UNKNOWN)); | 117 | null, TruthValue.UNKNOWN)); |
118 | putRelationInfo(builtinSymbols.invalidNumberOfContainers(), | 118 | putRelationInfo(builtinSymbols.invalidContainer(), |
119 | new RelationInfo(ContainmentHierarchyTranslator.INVALID_NUMBER_OF_CONTAINERS, TruthValue.FALSE, | 119 | new RelationInfo(ContainmentHierarchyTranslator.INVALID_CONTAINER, TruthValue.FALSE, |
120 | TruthValue.FALSE)); | 120 | TruthValue.FALSE)); |
121 | collectNodes(); | 121 | collectNodes(); |
122 | collectPartialSymbols(); | 122 | collectPartialSymbols(); |
diff --git a/subprojects/language/src/main/java/tools/refinery/language/utils/BuiltinSymbols.java b/subprojects/language/src/main/java/tools/refinery/language/utils/BuiltinSymbols.java index 70a86b51..c87fa044 100644 --- a/subprojects/language/src/main/java/tools/refinery/language/utils/BuiltinSymbols.java +++ b/subprojects/language/src/main/java/tools/refinery/language/utils/BuiltinSymbols.java | |||
@@ -9,5 +9,5 @@ import tools.refinery.language.model.problem.*; | |||
9 | 9 | ||
10 | public record BuiltinSymbols(Problem problem, ClassDeclaration node, PredicateDefinition equals, | 10 | public record BuiltinSymbols(Problem problem, ClassDeclaration node, PredicateDefinition equals, |
11 | PredicateDefinition exists, ClassDeclaration contained, PredicateDefinition contains, | 11 | PredicateDefinition exists, ClassDeclaration contained, PredicateDefinition contains, |
12 | PredicateDefinition invalidNumberOfContainers) { | 12 | PredicateDefinition invalidContainer) { |
13 | } | 13 | } |
diff --git a/subprojects/language/src/main/java/tools/refinery/language/utils/ProblemDesugarer.java b/subprojects/language/src/main/java/tools/refinery/language/utils/ProblemDesugarer.java index 9f08654c..59e26561 100644 --- a/subprojects/language/src/main/java/tools/refinery/language/utils/ProblemDesugarer.java +++ b/subprojects/language/src/main/java/tools/refinery/language/utils/ProblemDesugarer.java | |||
@@ -43,9 +43,8 @@ public class ProblemDesugarer { | |||
43 | var exists = doGetDeclaration(builtin, PredicateDefinition.class, "exists"); | 43 | var exists = doGetDeclaration(builtin, PredicateDefinition.class, "exists"); |
44 | var contained = doGetDeclaration(builtin, ClassDeclaration.class, "contained"); | 44 | var contained = doGetDeclaration(builtin, ClassDeclaration.class, "contained"); |
45 | var contains = doGetDeclaration(builtin, PredicateDefinition.class, "contains"); | 45 | var contains = doGetDeclaration(builtin, PredicateDefinition.class, "contains"); |
46 | var invalidNumberOfContainers = doGetDeclaration(builtin, PredicateDefinition.class, | 46 | var invalidContainer = doGetDeclaration(builtin, PredicateDefinition.class, "invalidContainer"); |
47 | "invalidNumberOfContainers"); | 47 | return new BuiltinSymbols(builtin, node, equals, exists, contained, contains, invalidContainer); |
48 | return new BuiltinSymbols(builtin, node, equals, exists, contained, contains, invalidNumberOfContainers); | ||
49 | } | 48 | } |
50 | 49 | ||
51 | private <T extends Statement & NamedElement> T doGetDeclaration(Problem builtin, Class<T> type, String name) { | 50 | private <T extends Statement & NamedElement> T doGetDeclaration(Problem builtin, Class<T> type, String name) { |
diff --git a/subprojects/language/src/main/resources/tools/refinery/language/builtin.problem b/subprojects/language/src/main/resources/tools/refinery/language/builtin.problem index 8570e363..022c3167 100644 --- a/subprojects/language/src/main/resources/tools/refinery/language/builtin.problem +++ b/subprojects/language/src/main/resources/tools/refinery/language/builtin.problem | |||
@@ -13,4 +13,4 @@ abstract class contained extends node. | |||
13 | 13 | ||
14 | pred contains(container, contained contained). | 14 | pred contains(container, contained contained). |
15 | 15 | ||
16 | error invalidNumberOfContainers(contained contained). | 16 | error invalidContainer(contained contained). |
diff --git a/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/translator/containment/ContainmentHierarchyTranslator.java b/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/translator/containment/ContainmentHierarchyTranslator.java index 37eac022..dda9f2c8 100644 --- a/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/translator/containment/ContainmentHierarchyTranslator.java +++ b/subprojects/store-reasoning/src/main/java/tools/refinery/store/reasoning/translator/containment/ContainmentHierarchyTranslator.java | |||
@@ -42,7 +42,7 @@ import static tools.refinery.store.reasoning.literal.PartialLiterals.must; | |||
42 | 42 | ||
43 | public class ContainmentHierarchyTranslator implements ModelStoreConfiguration { | 43 | public class ContainmentHierarchyTranslator implements ModelStoreConfiguration { |
44 | public static final PartialRelation CONTAINED_SYMBOL = new PartialRelation("contained", 1); | 44 | public static final PartialRelation CONTAINED_SYMBOL = new PartialRelation("contained", 1); |
45 | public static final PartialRelation INVALID_NUMBER_OF_CONTAINERS = new PartialRelation("invalidNumberOfContainers", | 45 | public static final PartialRelation INVALID_CONTAINER = new PartialRelation("invalidContainer", |
46 | 1); | 46 | 1); |
47 | public static final PartialRelation CONTAINS_SYMBOL = new PartialRelation("contains", 2); | 47 | public static final PartialRelation CONTAINS_SYMBOL = new PartialRelation("contains", 2); |
48 | 48 | ||
@@ -97,7 +97,7 @@ public class ContainmentHierarchyTranslator implements ModelStoreConfiguration { | |||
97 | public void apply(ModelStoreBuilder storeBuilder) { | 97 | public void apply(ModelStoreBuilder storeBuilder) { |
98 | storeBuilder.symbol(containsStorage); | 98 | storeBuilder.symbol(containsStorage); |
99 | translateContains(storeBuilder); | 99 | translateContains(storeBuilder); |
100 | translateInvalidNumberOfContainers(storeBuilder); | 100 | translateInvalidContainer(storeBuilder); |
101 | for (var entry : containmentInfoMap.entrySet()) { | 101 | for (var entry : containmentInfoMap.entrySet()) { |
102 | var linkType = entry.getKey(); | 102 | var linkType = entry.getKey(); |
103 | var info = entry.getValue(); | 103 | var info = entry.getValue(); |
@@ -212,8 +212,8 @@ public class ContainmentHierarchyTranslator implements ModelStoreConfiguration { | |||
212 | )))); | 212 | )))); |
213 | } | 213 | } |
214 | 214 | ||
215 | private void translateInvalidNumberOfContainers(ModelStoreBuilder storeBuilder) { | 215 | private void translateInvalidContainer(ModelStoreBuilder storeBuilder) { |
216 | storeBuilder.with(new InvalidMultiplicityErrorTranslator(CONTAINED_SYMBOL, CONTAINS_SYMBOL, true, | 216 | storeBuilder.with(new InvalidMultiplicityErrorTranslator(CONTAINED_SYMBOL, CONTAINS_SYMBOL, true, |
217 | ConstrainedMultiplicity.of(CardinalityIntervals.ONE, INVALID_NUMBER_OF_CONTAINERS))); | 217 | ConstrainedMultiplicity.of(CardinalityIntervals.ONE, INVALID_CONTAINER))); |
218 | } | 218 | } |
219 | } | 219 | } |