Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-05-16 09:11:25 -0400
committerEd Willink2016-05-18 09:17:57 -0400
commitd90d2b3c7f5537c694a954a28ca05db7eae4b3af (patch)
treec03826d41a02cbff48ee54e95d6d312608652b1f
parentdb78d5ad470cc6fd6afed40e47d03d527a1eaea8 (diff)
downloadorg.eclipse.qvtd-d90d2b3c7f5537c694a954a28ca05db7eae4b3af.tar.gz
org.eclipse.qvtd-d90d2b3c7f5537c694a954a28ca05db7eae4b3af.tar.xz
org.eclipse.qvtd-d90d2b3c7f5537c694a954a28ca05db7eae4b3af.zip
[486722] Ensure QVTi variables are declared in their domains
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicRegion2Mapping.java146
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/utilities/AssignmentComparator.java138
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/utilities/QVTcoreBaseASSaverNormalizeVisitor.java18
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/BasicQVTiExecutor.java6
4 files changed, 202 insertions, 106 deletions
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicRegion2Mapping.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicRegion2Mapping.java
index a26980bf9..eb8ef23c1 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicRegion2Mapping.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicRegion2Mapping.java
@@ -86,14 +86,15 @@ import org.eclipse.qvtd.pivot.qvtbase.utilities.QVTbaseUtil;
import org.eclipse.qvtd.pivot.qvtcorebase.Area;
import org.eclipse.qvtd.pivot.qvtcorebase.Assignment;
import org.eclipse.qvtd.pivot.qvtcorebase.BottomPattern;
-import org.eclipse.qvtd.pivot.qvtcorebase.CorePattern;
import org.eclipse.qvtd.pivot.qvtcorebase.GuardPattern;
import org.eclipse.qvtd.pivot.qvtcorebase.PropertyAssignment;
import org.eclipse.qvtd.pivot.qvtcorebase.RealizedVariable;
import org.eclipse.qvtd.pivot.qvtcorebase.VariableAssignment;
import org.eclipse.qvtd.pivot.qvtcorebase.analysis.DomainUsage;
+import org.eclipse.qvtd.pivot.qvtcorebase.utilities.AssignmentComparator;
import org.eclipse.qvtd.pivot.qvtimperative.ConnectionVariable;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeArea;
+import org.eclipse.qvtd.pivot.qvtimperative.ImperativeBottomPattern;
import org.eclipse.qvtd.pivot.qvtimperative.ImperativeDomain;
import org.eclipse.qvtd.pivot.qvtimperative.MappingCallBinding;
import org.eclipse.qvtd.pivot.qvtimperative.MappingStatement;
@@ -196,8 +197,7 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
if ((initExpression instanceof PrimitiveLiteralExp) || hasRealizedVariableReference(initExpression) || conditionalNodes.contains(node)) {
return initExpression;
}
- @SuppressWarnings("null")@NonNull BottomPattern bottomPattern = mapping.getBottomPattern();
- theVariable = createUnrealizedVariable(bottomPattern, node, initExpression);
+ theVariable = createBottomVariable(node, initExpression);
}
return PivotUtil.createVariableExp(theVariable);
}
@@ -495,7 +495,8 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
assert bottomPattern != null;
Type variableType = pVariable.getType();
assert variableType != null;
- Variable iVariable = PivotUtil.createVariable(getSafeName(pVariable.getName()), variableType, pVariable.isIsRequired(), null);
+ String safeName = getSafeName(ClassUtil.nonNullState(pVariable.getName()));
+ Variable iVariable = PivotUtil.createVariable(safeName, variableType, pVariable.isIsRequired(), null);
bottomPattern.getVariable().add(iVariable);
// Variable oldVariable = node2variable.put(node, iVariable);
// assert oldVariable == null;
@@ -518,9 +519,7 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
if ((oldTypedElement instanceof Variable) && (((Variable)oldTypedElement).getOwnedInit() == null)) {
// for (@NonNull Edge edge : node.getIncomingEdges()) {
// if (edge.isArgument() || edge.isCast()) {
- BottomPattern bottomPattern = mapping.getBottomPattern();
- assert bottomPattern != null;
- theVariable = createUnrealizedVariable(bottomPattern, node, null);
+ theVariable = createBottomVariable(node, null);
// break;
// }
// }
@@ -689,6 +688,33 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
}
}
} */
+
+ private @NonNull Variable createBottomVariable(@NonNull Node node, @Nullable OCLExpression initExpression) {
+ Area area = getArea(node.getClassDatumAnalysis());
+ Type variableType = node.getCompleteClass().getPrimaryClass();
+ assert variableType != null;
+ boolean isRequired = true;
+ for (@NonNull TypedElement typedElement : node.getTypedElements()) {
+ if (!typedElement.isIsRequired()) {
+ isRequired = false;
+ }
+ }
+ if ((initExpression != null) && initExpression.isIsRequired()) {
+ isRequired = true;
+ }
+ Variable variable = PivotUtil.createVariable(getSafeName(node), variableType, isRequired, null);
+
+
+ BottomPattern bottomPattern = area.getBottomPattern();
+ bottomPattern.getVariable().add(variable);
+ if (initExpression != null) {
+ VariableAssignment variableAssignment = helper.createVariableAssignment(variable, initExpression);
+ mapping.getBottomPattern().getAssignment().add(variableAssignment);
+ }
+ Variable oldVariable = node2variable.put(node, variable);
+ assert oldVariable == null;
+ return variable;
+ }
private void createClassPropertyAssignments(@NonNull Iterable<@NonNull List<@NonNull NavigationEdge>> classAssignments) {
for (@NonNull List<@NonNull NavigationEdge> edges : classAssignments) {
@@ -783,6 +809,18 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
}
}
+ private @NonNull Variable createGuardVariable(@NonNull Node guardNode) {
+ Area area = getArea(guardNode.getClassDatumAnalysis());
+ GuardPattern guardPattern = area.getGuardPattern();
+ assert guardPattern != null;
+ Type variableType = guardNode.getCompleteClass().getPrimaryClass();
+ Variable guardVariable = PivotUtil.createVariable(getSafeName(guardNode), variableType, true, null);
+ guardPattern.getVariable().add(guardVariable);
+ Variable oldVariable = node2variable.put(guardNode, guardVariable);
+ assert oldVariable == null;
+ return guardVariable;
+ }
+
/**
* Identify the headNodes/guardNodes and create a guard variable for each guard node.
*/
@@ -839,13 +877,7 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
}
Collections.sort(guardNodes, NameUtil.NAMEABLE_COMPARATOR);
for (@NonNull Node guardNode : guardNodes) {
- ClassDatumAnalysis classDatumAnalysis = guardNode.getClassDatumAnalysis();
- TypedModel typedModel = visitor.getQVTiTypedModel(classDatumAnalysis.getTypedModel());
- ImperativeDomain domain = typedModel2domain.get(typedModel);
- assert domain != null;
- GuardPattern guardPattern = domain.getGuardPattern();
- assert guardPattern != null;
- createUnrealizedVariable(guardPattern, guardNode, null);
+ createGuardVariable(guardNode);
}
//
// Create any connectionVariable guards
@@ -915,7 +947,7 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
* Recurse over the guard nodes and loaded/predicates region and convert the edges to predicates and non-guard nodes to unrealized variables.
*/
private void createNavigablePredicates() {
- String name = region.getName();
+ @SuppressWarnings("unused")String name = region.getName();
//
// Categorize the relevant navigation edges
//
@@ -1068,8 +1100,6 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
//
// Convert the traversed edges to unrealized variables and initializers.
//
- BottomPattern bottomPattern = mapping.getBottomPattern();
- assert bottomPattern != null;
for (@NonNull NavigationEdge traversedEdge : traversedEdges) {
Node sourceNode = traversedEdge.getSource();
Node targetNode = traversedEdge.getTarget();
@@ -1079,12 +1109,12 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
if (targetNode.isAttributeNode()) {
Variable attributeVariable = node2variable.get(targetNode);
assert attributeVariable == null;
- createUnrealizedVariable(bottomPattern, targetNode, source2targetExp);
+ createBottomVariable(targetNode, source2targetExp);
}
else {
Variable classVariable = node2variable.get(targetNode);
assert classVariable == null;
- createUnrealizedVariable(bottomPattern, targetNode, source2targetExp);
+ createBottomVariable(targetNode, source2targetExp);
/* }
else {
OCLExpression ownedInit = classVariable.getOwnedInit();
@@ -1232,6 +1262,7 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
private void createPropertyAssignments() {
Map<@NonNull Node, @NonNull List<@NonNull NavigationEdge>> classAssignments = null;
+ ImperativeBottomPattern bottomPattern = (ImperativeBottomPattern) mapping.getBottomPattern();
for (@NonNull NavigationEdge edge : region.getRealizedNavigationEdges()) {
Node sourceNode = edge.getSource();
Node targetNode = edge.getTarget();
@@ -1244,7 +1275,7 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
}
if (valueExp != null) {
PropertyAssignment propertyAssignment = QVTimperativeUtil.createPropertyAssignment(slotVariableExp, property, valueExp);
- mapping.getBottomPattern().getAssignment().add(propertyAssignment);
+ bottomPattern.getAssignment().add(propertyAssignment);
}
else {
System.err.println("No assignment in " + this + " to " + slotVariableExp);
@@ -1267,44 +1298,9 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
Collection<@NonNull List<@NonNull NavigationEdge>> values = classAssignments.values();
createClassPropertyAssignments(values);
}
- @SuppressWarnings("null") EList<@NonNull Assignment> bottomAssignments = mapping.getBottomPattern().getAssignment();
- ECollections.sort(bottomAssignments, new Comparator<@NonNull Assignment>()
- {
- @Override
- public int compare(@NonNull Assignment o1, @NonNull Assignment o2) {
- if (o1 instanceof PropertyAssignment) {
- if (o2 instanceof PropertyAssignment) {
- Property p1 = ((PropertyAssignment)o1).getTargetProperty();
- Property p2 = ((PropertyAssignment)o2).getTargetProperty();
- String n1 = p1.getName();
- String n2 = p2.getName();
- int diff = ClassUtil.safeCompareTo(n1, n2);
- if (diff != 0) {
- return diff;
- }
- n1 = p1.toString();
- n2 = p2.toString();
- return ClassUtil.safeCompareTo(n1, n2);
- }
- else {
- return -1;
- }
- }
- else if (o1 instanceof VariableAssignment) {
- if (o2 instanceof PropertyAssignment) {
- return -1;
- }
- else if (o2 instanceof VariableAssignment) {
- Variable v1 = ((VariableAssignment)o1).getTargetVariable();
- Variable v2 = ((VariableAssignment)o2).getTargetVariable();
- String n1 = v1.getName();
- String n2 = v2.getName();
- return ClassUtil.safeCompareTo(n1, n2);
- }
- }
- return 0;
- }
- });
+ @SuppressWarnings("null")
+ @NonNull EList<@NonNull Assignment> bottomAssignments = bottomPattern.getOrderedAssignment();
+ ECollections.sort(bottomAssignments, new AssignmentComparator(bottomAssignments));
}
private void createRealizedVariables() {
@@ -1361,32 +1357,6 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
createMappingStatements(calls);
}
}
-
- private @NonNull Variable createUnrealizedVariable(@NonNull CorePattern pattern, @NonNull Node node, @Nullable OCLExpression initExpression) {
- Type variableType = node.getCompleteClass().getPrimaryClass();
- assert variableType != null;
- boolean isRequired = true;
- for (@NonNull TypedElement typedElement : node.getTypedElements()) {
- if (!typedElement.isIsRequired()) {
- isRequired = false;
- }
- }
- if (initExpression != null) {
-// Type initType = initExpression.getType();
-// assert variableType != null;
-// if (!initType.conformsTo(visitor.getStandardLibrary(), variableType)) { // Let CG sort it out as a predicate
-// initExpression = createOclAsTypeCallExp(initExpression, variableType);
-// }
- if (initExpression.isIsRequired()) {
- isRequired = true;
- }
- }
- Variable variable = PivotUtil.createVariable(getSafeName(node), variableType, isRequired, initExpression);
- pattern.getVariable().add(variable);
- Variable oldVariable = node2variable.put(node, variable);
- assert oldVariable == null;
- return variable;
- }
private @NonNull OCLExpression createVariableExp(@NonNull Node node) {
if (node.isNull()) {
@@ -1398,9 +1368,7 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
for (@NonNull Edge edge : node.getIncomingEdges()) {
if (edge.isArgument() || edge.isCast()) {
OCLExpression initExpression = edge.getSource().getTypedElements().iterator().next().accept(expressionCreator);
- BottomPattern bottomPattern = mapping.getBottomPattern();
- assert bottomPattern != null;
- variable = createUnrealizedVariable(bottomPattern, node, initExpression);
+ variable = createBottomVariable(node, initExpression);
break;
}
}
@@ -1412,9 +1380,7 @@ public class BasicRegion2Mapping extends AbstractRegion2Mapping
boolean isNavigation = edge.isNavigation();
if (isPredicated && !isNavigable && isNavigation) {
OCLExpression initExpression = edge.getSource().getTypedElements().iterator().next().accept(expressionCreator);
- BottomPattern bottomPattern = mapping.getBottomPattern();
- assert bottomPattern != null;
- variable = createUnrealizedVariable(bottomPattern, node, initExpression);
+ variable = createBottomVariable(node, initExpression);
break;
}
}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/utilities/AssignmentComparator.java b/plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/utilities/AssignmentComparator.java
new file mode 100644
index 000000000..cff302971
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/utilities/AssignmentComparator.java
@@ -0,0 +1,138 @@
+/*******************************************************************************
+ * Copyright (c) 2016 Willink Transformations and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * E.D.Willink - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.qvtd.pivot.qvtcorebase.utilities;
+
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.ocl.pivot.Property;
+import org.eclipse.ocl.pivot.Variable;
+import org.eclipse.ocl.pivot.VariableDeclaration;
+import org.eclipse.ocl.pivot.VariableExp;
+import org.eclipse.ocl.pivot.utilities.ClassUtil;
+import org.eclipse.qvtd.pivot.qvtbase.utilities.TreeIterable;
+import org.eclipse.qvtd.pivot.qvtcorebase.Assignment;
+import org.eclipse.qvtd.pivot.qvtcorebase.PropertyAssignment;
+import org.eclipse.qvtd.pivot.qvtcorebase.VariableAssignment;
+
+/**
+ * AssignmentComparator supports sorting an assignment list into VariableAssignments first, least dependent first, alphabetical order.
+ */
+public class AssignmentComparator implements Comparator<@NonNull Assignment>
+{
+ private final @NonNull List<@NonNull Assignment> assignments;
+ private @Nullable Map<@NonNull Variable, @NonNull Set<@NonNull Variable>> variable2referencedVariables = null;
+
+ public AssignmentComparator(@NonNull List<@NonNull Assignment> assignments) {
+ this.assignments = assignments;
+ }
+
+ @Override
+ public int compare(@NonNull Assignment o1, @NonNull Assignment o2) {
+ if (o1 instanceof PropertyAssignment) {
+ if (o2 instanceof PropertyAssignment) {
+ Property p1 = ((PropertyAssignment)o1).getTargetProperty();
+ Property p2 = ((PropertyAssignment)o2).getTargetProperty();
+ String n1 = p1.getName();
+ String n2 = p2.getName();
+ int diff = ClassUtil.safeCompareTo(n1, n2);
+ if (diff != 0) {
+ return diff;
+ }
+ n1 = p1.toString();
+ n2 = p2.toString();
+ return ClassUtil.safeCompareTo(n1, n2);
+ }
+ else {
+ return 1;
+ }
+ }
+ else if (o1 instanceof VariableAssignment) {
+ if (o2 instanceof PropertyAssignment) {
+ return -1;
+ }
+ else if (o2 instanceof VariableAssignment) {
+ Map<@NonNull Variable, @NonNull Set<@NonNull Variable>> variable2referencedVariables2 = variable2referencedVariables;
+ if (variable2referencedVariables2 == null) {
+ variable2referencedVariables2 = variable2referencedVariables = computeReferencedVariableClosure();
+ }
+ Variable v1 = ((VariableAssignment)o1).getTargetVariable();
+ Variable v2 = ((VariableAssignment)o2).getTargetVariable();
+ Set<@NonNull Variable> r1 = variable2referencedVariables2.get(v1);
+ Set<@NonNull Variable> r2 = variable2referencedVariables2.get(v2);
+ assert (r1 != null) && (r2 != null);
+ int diff = r1.size() - r2.size();
+ if (diff != 0) {
+ return diff;
+ }
+ String n1 = v1.getName();
+ String n2 = v2.getName();
+ return ClassUtil.safeCompareTo(n1, n2);
+ }
+ }
+ return 0;
+ }
+
+ private @NonNull Map<@NonNull Variable, @NonNull Set<@NonNull Variable>> computeReferencedVariableClosure() {
+ Map<@NonNull Variable, @NonNull Set<@NonNull Variable>> variable2referencedVariables2;
+ variable2referencedVariables2 = new HashMap<@NonNull Variable, @NonNull Set<@NonNull Variable>>();
+ //
+ // Compute the direct references of each variable
+ //
+ for (@NonNull Assignment assignment : assignments) {
+ if (assignment instanceof VariableAssignment) {
+ VariableAssignment variableAssignment = (VariableAssignment)assignment;
+ Variable variable = ClassUtil.nonNullState(variableAssignment.getTargetVariable());
+ Set<@NonNull Variable> referencedVariables = new HashSet<@NonNull Variable>();
+ for (EObject eObject : new TreeIterable(ClassUtil.nonNullState(variableAssignment.getValue()), true)) {
+ if (eObject instanceof VariableExp) {
+ VariableDeclaration referredVariable = ((VariableExp)eObject).getReferredVariable();
+ if (referredVariable instanceof Variable) {
+ referencedVariables.add((Variable)referredVariable);
+ }
+ }
+ else if (eObject instanceof Variable) {
+ referencedVariables.add((Variable)eObject);
+ }
+ }
+ variable2referencedVariables2.put(variable, referencedVariables);
+ }
+ }
+ //
+ // Aggregate the closure
+ //
+ while (true) {
+ boolean more = false;
+ for (@NonNull Variable variable : variable2referencedVariables2.keySet()) {
+ Set<@NonNull Variable> referencedVariables = variable2referencedVariables2.get(variable);
+ assert referencedVariables != null;
+ for (@NonNull Variable referencedVariable : new ArrayList<@NonNull Variable>(referencedVariables)) {
+ Set<@NonNull Variable> referencedReferencedVariables = variable2referencedVariables2.get(referencedVariable);
+ if ((referencedReferencedVariables != null) && referencedVariables.addAll(referencedReferencedVariables)) {
+ more = true;
+ }
+ }
+ }
+ if (!more) {
+ break;
+ }
+ }
+ return variable2referencedVariables2;
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/utilities/QVTcoreBaseASSaverNormalizeVisitor.java b/plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/utilities/QVTcoreBaseASSaverNormalizeVisitor.java
index d9f4076c4..3ffdba662 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/utilities/QVTcoreBaseASSaverNormalizeVisitor.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/utilities/QVTcoreBaseASSaverNormalizeVisitor.java
@@ -11,6 +11,7 @@
package org.eclipse.qvtd.pivot.qvtcorebase.utilities;
import java.util.Comparator;
+import java.util.List;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
@@ -25,20 +26,6 @@ import org.eclipse.qvtd.pivot.qvtcorebase.util.AbstractQVTcoreBaseASSaverNormali
public class QVTcoreBaseASSaverNormalizeVisitor extends AbstractQVTcoreBaseASSaverNormalizeVisitor
{
- protected static final class AssignmentComparator implements Comparator<@NonNull Assignment>
- {
- public static final @NonNull Comparator<@NonNull Assignment> INSTANCE = new AssignmentComparator();
-
- @Override
- public int compare(@NonNull Assignment o1, @NonNull Assignment o2) {
- String n1 = o1.toString();
- String n2 = o2.toString();
- if (n1 == null) n1 = "";
- if (n2 == null) n2 = "";
- return n1.compareTo(n2);
- }
- }
-
protected static final class PredicateComparator implements Comparator<@NonNull Predicate>
{
public static final @NonNull Comparator<@NonNull Predicate> INSTANCE = new PredicateComparator();
@@ -59,7 +46,8 @@ public class QVTcoreBaseASSaverNormalizeVisitor extends AbstractQVTcoreBaseASSav
@Override
public @Nullable Object visitBottomPattern(@NonNull BottomPattern object) {
- ClassUtil.sort(ClassUtil.nullFree(object.getAssignment()), AssignmentComparator.INSTANCE);
+ List<@NonNull Assignment> assignments = ClassUtil.nullFree(object.getAssignment());
+ ClassUtil.sort(assignments, new AssignmentComparator(assignments));
ClassUtil.sort(ClassUtil.nullFree(object.getRealizedVariable()), NameUtil.NAMEABLE_COMPARATOR);
return super.visitBottomPattern(object);
}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/BasicQVTiExecutor.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/BasicQVTiExecutor.java
index c5238cdbf..d4309ddb1 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/BasicQVTiExecutor.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/BasicQVTiExecutor.java
@@ -209,7 +209,11 @@ public class BasicQVTiExecutor extends AbstractExecutor implements QVTiExecutor
assert checkableBottomPattern.getEnforcementOperation().isEmpty();
assert checkableBottomPattern.getPredicate().isEmpty();
assert checkableBottomPattern.getRealizedVariable().isEmpty();
- assert checkableBottomPattern.getVariable().isEmpty();
+// assert checkableBottomPattern.getVariable().isEmpty();
+ for (@NonNull Variable rVar : ClassUtil.nullFree(checkableBottomPattern.getVariable())) {
+ OCLExpression ownedInit = rVar.getOwnedInit();
+ assert ownedInit == null;
+ }
}
else {
CoreDomain enforceableDomain = (CoreDomain)domain;

Back to the top