diff options
author | 2023-09-06 19:05:10 +0200 | |
---|---|---|
committer | 2023-09-06 19:05:10 +0200 | |
commit | 895b26df7a806a2136c2f7a46d56b542326e561f (patch) | |
tree | 52915b0bdb44a3b5d4c150050e89d987383e17e0 /subprojects/store-dse/src/test | |
parent | refactor: rename store-dse-visualization (diff) | |
download | refinery-895b26df7a806a2136c2f7a46d56b542326e561f.tar.gz refinery-895b26df7a806a2136c2f7a46d56b542326e561f.tar.zst refinery-895b26df7a806a2136c2f7a46d56b542326e561f.zip |
feat(dse): transformation rule builder
Diffstat (limited to 'subprojects/store-dse/src/test')
-rw-r--r-- | subprojects/store-dse/src/test/java/tools/refinery/store/dse/CRAExamplesTest.java | 54 |
1 files changed, 26 insertions, 28 deletions
diff --git a/subprojects/store-dse/src/test/java/tools/refinery/store/dse/CRAExamplesTest.java b/subprojects/store-dse/src/test/java/tools/refinery/store/dse/CRAExamplesTest.java index 36517709..0c50718e 100644 --- a/subprojects/store-dse/src/test/java/tools/refinery/store/dse/CRAExamplesTest.java +++ b/subprojects/store-dse/src/test/java/tools/refinery/store/dse/CRAExamplesTest.java | |||
@@ -5,13 +5,11 @@ | |||
5 | */ | 5 | */ |
6 | package tools.refinery.store.dse; | 6 | package tools.refinery.store.dse; |
7 | 7 | ||
8 | import tools.refinery.store.dse.transition.TransformationRule; | ||
9 | import tools.refinery.store.query.dnf.Query; | 8 | import tools.refinery.store.query.dnf.Query; |
10 | import tools.refinery.store.query.dnf.RelationalQuery; | 9 | import tools.refinery.store.query.dnf.RelationalQuery; |
11 | import tools.refinery.store.query.view.AnySymbolView; | 10 | import tools.refinery.store.query.view.AnySymbolView; |
12 | import tools.refinery.store.query.view.KeyOnlyView; | 11 | import tools.refinery.store.query.view.KeyOnlyView; |
13 | import tools.refinery.store.representation.Symbol; | 12 | import tools.refinery.store.representation.Symbol; |
14 | import tools.refinery.store.tuple.Tuple; | ||
15 | 13 | ||
16 | import java.util.List; | 14 | import java.util.List; |
17 | 15 | ||
@@ -107,19 +105,19 @@ class CRAExamplesTest { | |||
107 | encapsulatesView.call(c1, f) | 105 | encapsulatesView.call(c1, f) |
108 | )); | 106 | )); |
109 | 107 | ||
110 | private static final TransformationRule assignFeatureRule = new TransformationRule("AssignFeature", | 108 | // private static final Rule assignFeatureRule = new Rule("AssignFeature", |
111 | assignFeaturePrecondition, | 109 | // assignFeaturePrecondition, |
112 | (model) -> { | 110 | // (model) -> { |
113 | // var isEncapsulatedByInterpretation = model.getInterpretation(isEncapsulatedBy); | 111 | //// var isEncapsulatedByInterpretation = model.getInterpretation(isEncapsulatedBy); |
114 | var encapsulatesInterpretation = model.getInterpretation(encapsulates); | 112 | // var encapsulatesInterpretation = model.getInterpretation(encapsulates); |
115 | return ((Tuple activation) -> { | 113 | // return ((Tuple activation) -> { |
116 | var feature = activation.get(0); | 114 | // var feature = activation.get(0); |
117 | var classElement = activation.get(1); | 115 | // var classElement = activation.get(1); |
118 | 116 | // | |
119 | // isEncapsulatedByInterpretation.put(Tuple.of(feature, classElement), true); | 117 | //// isEncapsulatedByInterpretation.put(Tuple.of(feature, classElement), true); |
120 | encapsulatesInterpretation.put(Tuple.of(classElement, feature), true); | 118 | // encapsulatesInterpretation.put(Tuple.of(classElement, feature), true); |
121 | }); | 119 | // }); |
122 | }); | 120 | // }); |
123 | 121 | ||
124 | // private static final TransformationRule deleteEmptyClassRule = new TransformationRule("DeleteEmptyClass", | 122 | // private static final TransformationRule deleteEmptyClassRule = new TransformationRule("DeleteEmptyClass", |
125 | // deleteEmptyClassPrecondition, | 123 | // deleteEmptyClassPrecondition, |
@@ -158,19 +156,19 @@ class CRAExamplesTest { | |||
158 | // }); | 156 | // }); |
159 | // }); | 157 | // }); |
160 | 158 | ||
161 | private static final TransformationRule moveFeatureRule = new TransformationRule("MoveFeature", | 159 | // private static final Rule moveFeatureRule = new Rule("MoveFeature", |
162 | moveFeaturePrecondition, | 160 | // moveFeaturePrecondition, |
163 | (model) -> { | 161 | // (model) -> { |
164 | var encapsulatesInterpretation = model.getInterpretation(encapsulates); | 162 | // var encapsulatesInterpretation = model.getInterpretation(encapsulates); |
165 | return ((Tuple activation) -> { | 163 | // return ((Tuple activation) -> { |
166 | var classElement1 = activation.get(0); | 164 | // var classElement1 = activation.get(0); |
167 | var classElement2 = activation.get(1); | 165 | // var classElement2 = activation.get(1); |
168 | var feature = activation.get(2); | 166 | // var feature = activation.get(2); |
169 | 167 | // | |
170 | encapsulatesInterpretation.put(Tuple.of(classElement1, feature), false); | 168 | // encapsulatesInterpretation.put(Tuple.of(classElement1, feature), false); |
171 | encapsulatesInterpretation.put(Tuple.of(classElement2, feature), true); | 169 | // encapsulatesInterpretation.put(Tuple.of(classElement2, feature), true); |
172 | }); | 170 | // }); |
173 | }); | 171 | // }); |
174 | 172 | ||
175 | // @Test | 173 | // @Test |
176 | // @Disabled("This test is only for debugging purposes") | 174 | // @Disabled("This test is only for debugging purposes") |