diff options
author | 2023-12-06 23:52:07 +0100 | |
---|---|---|
committer | 2023-12-08 21:48:48 +0100 | |
commit | d40ec70132ebb324873cb8c3868eb65309f46f8c (patch) | |
tree | 31c9ca6e5454f61868b4123574b723b33ecc704e /subprojects/store-reasoning-scope/src/test | |
parent | chore: upgrade to Eclipse 2023-12 (diff) | |
download | refinery-d40ec70132ebb324873cb8c3868eb65309f46f8c.tar.gz refinery-d40ec70132ebb324873cb8c3868eb65309f46f8c.tar.zst refinery-d40ec70132ebb324873cb8c3868eb65309f46f8c.zip |
feat: state-based store for cross references
Efficiently store cross references even if default ref(*, *): false.
Uses propagation rules instead of view queries to reason about type constraints
and multiplicity.
Diffstat (limited to 'subprojects/store-reasoning-scope/src/test')
-rw-r--r-- | subprojects/store-reasoning-scope/src/test/java/tools/refinery/store/reasoning/scope/PredicateScopeTest.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/subprojects/store-reasoning-scope/src/test/java/tools/refinery/store/reasoning/scope/PredicateScopeTest.java b/subprojects/store-reasoning-scope/src/test/java/tools/refinery/store/reasoning/scope/PredicateScopeTest.java index a2c56a6b..5ee97ce1 100644 --- a/subprojects/store-reasoning-scope/src/test/java/tools/refinery/store/reasoning/scope/PredicateScopeTest.java +++ b/subprojects/store-reasoning-scope/src/test/java/tools/refinery/store/reasoning/scope/PredicateScopeTest.java | |||
@@ -27,7 +27,6 @@ import tools.refinery.store.reasoning.translator.containment.ContainmentHierarch | |||
27 | import tools.refinery.store.reasoning.translator.metamodel.Metamodel; | 27 | import tools.refinery.store.reasoning.translator.metamodel.Metamodel; |
28 | import tools.refinery.store.reasoning.translator.metamodel.MetamodelTranslator; | 28 | import tools.refinery.store.reasoning.translator.metamodel.MetamodelTranslator; |
29 | import tools.refinery.store.reasoning.translator.multiobject.MultiObjectTranslator; | 29 | import tools.refinery.store.reasoning.translator.multiobject.MultiObjectTranslator; |
30 | import tools.refinery.store.reasoning.translator.multiplicity.ConstrainedMultiplicity; | ||
31 | import tools.refinery.store.representation.TruthValue; | 30 | import tools.refinery.store.representation.TruthValue; |
32 | import tools.refinery.store.representation.cardinality.CardinalityIntervals; | 31 | import tools.refinery.store.representation.cardinality.CardinalityIntervals; |
33 | import tools.refinery.store.statecoding.StateCoderAdapter; | 32 | import tools.refinery.store.statecoding.StateCoderAdapter; |
@@ -109,10 +108,16 @@ class PredicateScopeTest { | |||
109 | private ModelStore createStore() { | 108 | private ModelStore createStore() { |
110 | var metamodel = Metamodel.builder() | 109 | var metamodel = Metamodel.builder() |
111 | .type(index) | 110 | .type(index) |
112 | .reference(next, index, false, | 111 | .reference(next, builder -> builder |
113 | ConstrainedMultiplicity.of(CardinalityIntervals.LONE, nextInvalidMultiplicity), index, prev) | 112 | .source(index) |
114 | .reference(prev, index, false, | 113 | .target(index) |
115 | ConstrainedMultiplicity.of(CardinalityIntervals.LONE, prevInvalidMultiplicity), index, next) | 114 | .multiplicity(CardinalityIntervals.LONE, nextInvalidMultiplicity) |
115 | .opposite(prev)) | ||
116 | .reference(prev, builder -> builder | ||
117 | .source(index) | ||
118 | .target(index) | ||
119 | .multiplicity(CardinalityIntervals.LONE, prevInvalidMultiplicity) | ||
120 | .opposite(next)) | ||
116 | .build(); | 121 | .build(); |
117 | return ModelStore.builder() | 122 | return ModelStore.builder() |
118 | .with(QueryInterpreterAdapter.builder()) | 123 | .with(QueryInterpreterAdapter.builder()) |