Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2017-03-10 13:46:13 +0000
committerEd Willink2017-03-11 11:01:43 +0000
commitf7e4162a9dd7cc3ebf3417d7f636d3484a8afa5d (patch)
treef05018f910cc416f9e2c6000ad6a8b36688fc94b
parent1327402d7950a4d149cb1a461a33746fe152a0b0 (diff)
downloadorg.eclipse.qvtd-ewillink/512737.tar.gz
org.eclipse.qvtd-ewillink/512737.tar.xz
org.eclipse.qvtd-ewillink/512737.zip
Local corrolary edges can be realized in a speculated partitionewillink/512737
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/SpeculatedPartition.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/SpeculatedPartition.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/SpeculatedPartition.java
index 25ecdd37b..8f0b69403 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/SpeculatedPartition.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/SpeculatedPartition.java
@@ -161,6 +161,19 @@ class SpeculatedPartition extends AbstractPartition
return super.isComputable(sourceNodes, edge);
}
+ /**
+ * Return true if node is a corrolary of this mapping.
+ */
+ private boolean isLocalCorrolary(@NonNull Node node) {
+ assert node.isRealized();
+ for (@NonNull Edge edge : RegionUtil.getIncomingEdges(node)) {
+ if (edge.isRealized() && edge.isNavigation() && partitioner.isCorrolary(edge)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
@Override
protected boolean resolveComputations(@NonNull Node targetNode) {
if (tracedInputNodes.contains(targetNode)) {
@@ -238,7 +251,7 @@ class SpeculatedPartition extends AbstractPartition
for (@NonNull Edge edge : partitioner.getRealizedEdges()) {
if (!partitioner.hasRealizedEdge(edge) && !partitioner.isCorrolary(edge)) {
Node sourceNode = edge.getEdgeSource();
- if (!sourceNode.isRealized()) {
+ if (!sourceNode.isRealized() || isLocalCorrolary(sourceNode)) {
Node targetNode = edge.getEdgeTarget();
if (!targetNode.isRealized()) {
if (!hasNode(sourceNode)) {

Back to the top