Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2019-11-06 07:49:53 -0500
committerEd Willink2019-11-06 12:46:39 -0500
commit66145cf27d77014aac8e270d76af0326a026080a (patch)
tree0a8d2219b7b89816c077c247106948213bdd771e /plugins
parent5c212d6ac12eb88395d71c8066b895871d63c98e (diff)
downloadorg.eclipse.qvtd-master.tar.gz
org.eclipse.qvtd-master.tar.xz
org.eclipse.qvtd-master.zip
[551954] Ensure when inputs are available for predication checkHEAD0.21.0M2master
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/AbstractPartitionFactory.java1
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/GlobalPredicatePartitionFactory.java24
2 files changed, 24 insertions, 1 deletions
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/AbstractPartitionFactory.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/AbstractPartitionFactory.java
index 3ab7e0265..c90ac92e5 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/AbstractPartitionFactory.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/AbstractPartitionFactory.java
@@ -68,6 +68,7 @@ public abstract class AbstractPartitionFactory<R extends Region> extends RegionH
* The default implementation accepts all edges just changing REALIZED to PREDICATED for already realized edges.
*/
protected abstract @Nullable Role resolveEdgeRole(@NonNull Role sourceNodeRole, @NonNull Edge edge, @NonNull Role targetNodeRole);
+
/**
* Resolve all the original region edges by adding to the partition provided the nodes at each end have already been added.
* The addition is mediated by resolveEdgeRole that may adjust the edgeRole or suppress the addition.
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/GlobalPredicatePartitionFactory.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/GlobalPredicatePartitionFactory.java
index 847f80330..60147ba82 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/GlobalPredicatePartitionFactory.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/GlobalPredicatePartitionFactory.java
@@ -18,7 +18,12 @@ import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.qvtd.compiler.internal.qvtm2qvts.QVTm2QVTs;
import org.eclipse.qvtd.compiler.internal.qvts2qvts.utilities.ReachabilityForest;
import org.eclipse.qvtd.compiler.internal.utilities.CompilerUtil;
+import org.eclipse.qvtd.pivot.qvtbase.Domain;
+import org.eclipse.qvtd.pivot.qvtbase.Rule;
+import org.eclipse.qvtd.pivot.qvtbase.TypedModel;
+import org.eclipse.qvtd.pivot.qvtrelation.utilities.QVTrelationUtil;
import org.eclipse.qvtd.pivot.qvtschedule.BasicPartition;
+import org.eclipse.qvtd.pivot.qvtschedule.ClassDatum;
import org.eclipse.qvtd.pivot.qvtschedule.Edge;
import org.eclipse.qvtd.pivot.qvtschedule.Node;
import org.eclipse.qvtd.pivot.qvtschedule.Role;
@@ -86,10 +91,27 @@ public class GlobalPredicatePartitionFactory extends AbstractSimplePartitionFact
// navigations are retained as is.
//
if (hasSynthesizedTrace) {
+ Rule rule = region.getReferredRule();
for (@NonNull Node whenNode : mappingPartitioner.getPredicatedWhenNodes()) {
if (!mappingPartitioner.hasCheckedNode(whenNode)) {
addNode(partition, whenNode); //, Role.SPECULATED);
}
+ for (@NonNull Edge edge : QVTscheduleUtil.getOutgoingEdges(whenNode)) {
+ // if (!edge.isSuccess()) {
+ Node targetNode = QVTscheduleUtil.getTargetNode(edge);
+ if (!mappingPartitioner.hasCheckedNode(targetNode)) {
+ ClassDatum classDatum = QVTscheduleUtil.getClassDatum(targetNode);
+ TypedModel typedModel = QVTscheduleUtil.getReferredTypedModel(classDatum);
+ Domain domain = QVTrelationUtil.basicGetDomain(rule, typedModel);
+ if (domain != null) {
+ boolean isInput = scheduleManager.isInputInRule(rule, domain);
+ if (isInput) {
+ addNode(partition, targetNode);
+ }
+ }
+ // }
+ }
+ }
}
}
else {
@@ -116,7 +138,7 @@ public class GlobalPredicatePartitionFactory extends AbstractSimplePartitionFact
//
// resolveDisambiguations();
//
- // Join up the edges.
+ // Join up the edges to satisfy reachability.
//
resolveEdges(partitionAnalysis);
}

Back to the top