Merge "Fix problem with dangling check of rules with multi-rules"
diff --git a/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/impl/EngineImpl.java b/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/impl/EngineImpl.java
index 7d4c949..50f382d 100644
--- a/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/impl/EngineImpl.java
+++ b/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/impl/EngineImpl.java
@@ -62,6 +62,7 @@
 import org.eclipse.emf.henshin.interpreter.matching.conditions.OrFormula;
 import org.eclipse.emf.henshin.interpreter.matching.conditions.XorFormula;
 import org.eclipse.emf.henshin.interpreter.matching.constraints.BinaryConstraint;
+import org.eclipse.emf.henshin.interpreter.matching.constraints.DanglingConstraint;
 import org.eclipse.emf.henshin.interpreter.matching.constraints.DomainSlot;
 import org.eclipse.emf.henshin.interpreter.matching.constraints.Solution;
 import org.eclipse.emf.henshin.interpreter.matching.constraints.SolutionFinder;
@@ -74,6 +75,7 @@
 import org.eclipse.emf.henshin.model.Formula;
 import org.eclipse.emf.henshin.model.Graph;
 import org.eclipse.emf.henshin.model.Mapping;
+import org.eclipse.emf.henshin.model.MappingList;
 import org.eclipse.emf.henshin.model.NestedCondition;
 import org.eclipse.emf.henshin.model.Node;
 import org.eclipse.emf.henshin.model.Not;
@@ -154,7 +156,8 @@
 	/**
 	 * Constructor.
 	 * 
-	 * @param globalJavaImports List of global Java imports to be used in the script engine.
+	 * @param globalJavaImports
+	 *            List of global Java imports to be used in the script engine.
 	 */
 	public EngineImpl(String... globalJavaImports) {
 
@@ -169,21 +172,25 @@
 		// Initialize the script engine:
 		scriptEngine = new ScriptEngineWrapper(globalJavaImports);
 
-		// Rule listener for automatically clearing caches when rules are changed at run-time:
+		// Rule listener for automatically clearing caches when rules are
+		// changed at run-time:
 		ruleListener = new RuleChangeListener();
 
 	}
 
 	/**
-	 * Change listener for rules. If a rule is changed externally, the listener drops all cached options for this rule.
-	 * This enables dynamic high-order transformation of rules.
+	 * Change listener for rules. If a rule is changed externally, the listener
+	 * drops all cached options for this rule. This enables dynamic high-order
+	 * transformation of rules.
 	 */
 	private final class RuleChangeListener extends EContentAdapter {
 
 		/*
 		 * (non-Javadoc)
 		 * 
-		 * @see org.eclipse.emf.ecore.util.EContentAdapter#notifyChanged(org.eclipse .emf.common.notify.Notification)
+		 * @see
+		 * org.eclipse.emf.ecore.util.EContentAdapter#notifyChanged(org.eclipse
+		 * .emf.common.notify.Notification)
 		 */
 		@Override
 		public void notifyChanged(Notification notification) {
@@ -211,8 +218,10 @@
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see org.eclipse.emf.henshin.interpreter.Engine#findMatches(org.eclipse.emf .henshin.model.Rule,
-	 * org.eclipse.emf.henshin.interpreter.EGraph, org.eclipse.emf.henshin.interpreter.Match)
+	 * @see
+	 * org.eclipse.emf.henshin.interpreter.Engine#findMatches(org.eclipse.emf
+	 * .henshin.model.Rule, org.eclipse.emf.henshin.interpreter.EGraph,
+	 * org.eclipse.emf.henshin.interpreter.Match)
 	 */
 	@Override
 	public Iterable<Match> findMatches(Rule rule, EGraph graph, Match partialMatch) {
@@ -248,9 +257,12 @@
 		/**
 		 * Default constructor.
 		 * 
-		 * @param rule Rule to be matched.
-		 * @param graph Object graph.
-		 * @param partialMatch Partial match.
+		 * @param rule
+		 *            Rule to be matched.
+		 * @param graph
+		 *            Object graph.
+		 * @param partialMatch
+		 *            Partial match.
 		 */
 		public MatchGenerator(Rule rule, EGraph graph, Match partialMatch) {
 			this.rule = rule;
@@ -313,10 +325,14 @@
 		/**
 		 * Default constructor.
 		 * 
-		 * @param rule Rule to be matched.
-		 * @param graph Object graph.
-		 * @param partialMatch A partial match.
-		 * @param usedObjects Used objects (for ensuring injectivity).
+		 * @param rule
+		 *            Rule to be matched.
+		 * @param graph
+		 *            Object graph.
+		 * @param partialMatch
+		 *            A partial match.
+		 * @param usedObjects
+		 *            Used objects (for ensuring injectivity).
 		 */
 		public MatchFinder(Rule rule, EGraph graph, Match partialMatch, Set<EObject> usedObjects) {
 			this.rule = rule;
@@ -429,7 +445,8 @@
 					int partitions = ((PartitionedEGraph) graph).getNumPartitions();
 					for (int p = 0; p < partitions; p++) {
 						Set<EObject> freshUsedObjects = new HashSet<EObject>(usedKernelObjects);
-						MatchFinder matchFinder = new MatchFinder(multiRule, graph, partialMultiMatch, freshUsedObjects);
+						MatchFinder matchFinder = new MatchFinder(multiRule, graph, partialMultiMatch,
+								freshUsedObjects);
 						MatchFinderWorker worker = new MatchFinderWorker(matchFinder, p);
 						matchFinderFutures.add(workerPool.submit(worker));
 					}
@@ -452,13 +469,72 @@
 					}
 
 				}
+
+				boolean valid = rule.getMultiRules().isEmpty() || doPostponedDanglingChecks(solution, nextMatch);
+				if (!valid)
+					computeNextMatch();
 			}
+
+		}
+
+		private boolean doPostponedDanglingChecks(Solution solution, Match nextMatch) {
+			for (Variable var : solution.objectMatches.keySet()) {
+				Node node = ruleInfo.getVariableInfo().getVariableForNode(var);
+				EObject val = solution.objectMatches.get(var);
+
+				for (DanglingConstraint constraint : var.danglingConstraints) {
+					if (constraint.postpone) {
+						boolean result = doCheckOnMultiRulesTransitively(nextMatch, node, val, constraint);
+						if (!result)
+							return false;
+					}
+				}
+			}
+			return true;
+		}
+
+		private boolean doCheckOnMultiRulesTransitively(Match nextMatch, Node node, EObject val, DanglingConstraint constraint) {
+			boolean result = true;
+			DanglingConstraint constraint_ = constraint.copy();
+			if (rule.getMultiRules().isEmpty())
+				return constraint_.check(val, graph);
+			
+			// Main idea: The number of matches of each multi-rule determines
+			// how many (incoming and outgoing) edges the node provided as value
+			// may have s.t. no dangling edge remains.
+			for (Rule multi : rule.getMultiRules()) {
+				int count = nextMatch.getMultiMatches(multi).size();
+				MappingList map = multi.getMultiMappings();
+				Node mulNode = map.getImage(node, multi.getLhs());
+				if (mulNode != null) {
+					for (Edge mulEdge : mulNode.getOutgoing()) {
+						Node kerNode = map.getOrigin(mulEdge.getTarget());
+						if (kerNode == null) {
+							constraint_.increaseOutgoing(mulEdge.getType(), count);
+						}
+					}
+					for (Edge mulEdge : mulNode.getIncoming()) {
+						Node kerNode = map.getOrigin(mulEdge.getSource());
+						if (kerNode == null) {
+							constraint_.increaseIncoming(mulEdge.getType(), count);
+						}
+					}
+
+					for (Rule nextmulti : multi.getMultiRules()) {
+						for (Match m : nextMatch.getMultiMatches(nextmulti)) {
+							result &= doCheckOnMultiRulesTransitively(m, mulNode, val, constraint_);							
+						}
+					}
+				}
+			}
+			return result;
 		}
 
 		/**
 		 * Create a solution finder.
 		 * 
-		 * @param partialMatch A partial match.
+		 * @param partialMatch
+		 *            A partial match.
 		 * @return The solution finder.
 		 */
 		protected SolutionFinder createSolutionFinder(Match partialMatch) {
@@ -472,13 +548,14 @@
 					scriptEngine.getEngine());
 
 			/*
-			 * The set "usedObjects" ensures injective matching by removing already matched objects from other
-			 * DomainSlots
+			 * The set "usedObjects" ensures injective matching by removing
+			 * already matched objects from other DomainSlots
 			 */
 
 			/*
-			 * Create a domain map where all variables are mapped to slots. Different variables may share one domain
-			 * slot, if there is a mapping between the nodes of the variables.
+			 * Create a domain map where all variables are mapped to slots.
+			 * Different variables may share one domain slot, if there is a
+			 * mapping between the nodes of the variables.
 			 */
 
 			Map<Variable, DomainSlot> domainMap = new HashMap<Variable, DomainSlot>();
@@ -580,7 +657,8 @@
 	} // MatchFinder
 
 	/**
-	 * Match finding worker. To be used in a worker thread pool. It MUST be executed in a {@link PartitionThread}.
+	 * Match finding worker. To be used in a worker thread pool. It MUST be
+	 * executed in a {@link PartitionThread}.
 	 * 
 	 * @author Christian Krause
 	 */
@@ -599,8 +677,10 @@
 		/**
 		 * Constructor.
 		 * 
-		 * @param matchFinder Match finder to be used.
-		 * @param partition Partition to be used.
+		 * @param matchFinder
+		 *            Match finder to be used.
+		 * @param partition
+		 *            Partition to be used.
 		 */
 		MatchFinderWorker(MatchFinder matchFinder, int partition) {
 			this.matchFinder = matchFinder;
@@ -628,7 +708,8 @@
 	} // MatchFinderWorker
 
 	/**
-	 * Comparator for variables. Used to sort variables for optimal matching order.
+	 * Comparator for variables. Used to sort variables for optimal matching
+	 * order.
 	 */
 	private class VariableComparator implements Comparator<Variable> {
 
@@ -655,9 +736,12 @@
 		/**
 		 * Constructor.
 		 * 
-		 * @param graph Target graph
-		 * @param varInfo Variable info.
-		 * @param partialMatch Partial match.
+		 * @param graph
+		 *            Target graph
+		 * @param varInfo
+		 *            Variable info.
+		 * @param partialMatch
+		 *            Partial match.
 		 */
 		public VariableComparator(EGraph graph, VariableInfo varInfo, Match partialMatch) {
 			this.graph = graph;
@@ -700,8 +784,8 @@
 			}
 
 			// Get the domain sizes (smaller number wins):
-			int s = (graph.getDomainSize(v1.typeConstraint.type, v1.typeConstraint.strictTyping) - graph.getDomainSize(
-					v2.typeConstraint.type, v2.typeConstraint.strictTyping));
+			int s = (graph.getDomainSize(v1.typeConstraint.type, v1.typeConstraint.strictTyping)
+					- graph.getDomainSize(v2.typeConstraint.type, v2.typeConstraint.strictTyping));
 			if (s != 0) {
 				return (sign * s);
 			}
@@ -739,7 +823,8 @@
 	/**
 	 * Get the cached rule info for a given rule.
 	 * 
-	 * @param rule Rule.
+	 * @param rule
+	 *            Rule.
 	 * @return The (cached) rule info.
 	 */
 	protected RuleInfo getRuleInfo(Rule rule) {
@@ -756,7 +841,8 @@
 				if (node.getType() == null) {
 					throw new RuntimeException("Missing type for " + node);
 				}
-				if (node.getType().getEPackage() == null || node.getType().getEPackage().getEFactoryInstance() == null) {
+				if (node.getType().getEPackage() == null
+						|| node.getType().getEPackage().getEFactoryInstance() == null) {
 					throw new RuntimeException("Missing factory for '" + node
 							+ "'. Register the corresponding package, e.g. using PackageName.eINSTANCE.getName().");
 				}
@@ -776,8 +862,10 @@
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see org.eclipse.emf.henshin.interpreter.Engine#createChange(org.eclipse.emf .henshin.model.Rule,
-	 * org.eclipse.emf.henshin.interpreter.EGraph, org.eclipse.emf.henshin.interpreter.Match,
+	 * @see
+	 * org.eclipse.emf.henshin.interpreter.Engine#createChange(org.eclipse.emf
+	 * .henshin.model.Rule, org.eclipse.emf.henshin.interpreter.EGraph,
+	 * org.eclipse.emf.henshin.interpreter.Match,
 	 * org.eclipse.emf.henshin.interpreter.Match)
 	 */
 	@Override
@@ -798,11 +886,16 @@
 	/**
 	 * Recursively create the changes and result matches.
 	 * 
-	 * @param rule Rule to be applied.
-	 * @param graph Host graph.
-	 * @param completeMatch The complete match.
-	 * @param resultMatch The result match.
-	 * @param complexChange The final complex change.
+	 * @param rule
+	 *            Rule to be applied.
+	 * @param graph
+	 *            Host graph.
+	 * @param completeMatch
+	 *            The complete match.
+	 * @param resultMatch
+	 *            The result match.
+	 * @param complexChange
+	 *            The final complex change.
 	 */
 	public void createChanges(Rule rule, EGraph graph, Match completeMatch, Match resultMatch,
 			CompoundChange complexChange) {
@@ -835,7 +928,7 @@
 				}
 				value = valueList;
 			}
-			
+
 			scriptEngine.getEngine().put(param.getName(), value);
 		}
 
@@ -871,14 +964,14 @@
 
 		// Deleted edges:
 		for (Edge edge : ruleChange.getDeletedEdges()) {
-			changes.add(new ReferenceChangeImpl(graph, completeMatch.getNodeTarget(edge.getSource()), completeMatch
-					.getNodeTarget(edge.getTarget()), edge.getType(), false));
+			changes.add(new ReferenceChangeImpl(graph, completeMatch.getNodeTarget(edge.getSource()),
+					completeMatch.getNodeTarget(edge.getTarget()), edge.getType(), false));
 		}
 
 		// Created edges:
 		for (Edge edge : ruleChange.getCreatedEdges()) {
-			changes.add(new ReferenceChangeImpl(graph, resultMatch.getNodeTarget(edge.getSource()), resultMatch
-					.getNodeTarget(edge.getTarget()), edge.getType(), true));
+			changes.add(new ReferenceChangeImpl(graph, resultMatch.getNodeTarget(edge.getSource()),
+					resultMatch.getNodeTarget(edge.getTarget()), edge.getType(), true));
 		}
 
 		// Edge index changes:
@@ -892,13 +985,14 @@
 					try {
 						newIndex = ((Number) scriptEngine.eval(edge.getIndex(), rule.getAllJavaImports())).intValue();
 					} catch (ScriptException e) {
-						throw new RuntimeException("Error evaluating edge index expression \"" + edge.getIndex()
-								+ "\": " + e.getMessage(), e);
+						throw new RuntimeException(
+								"Error evaluating edge index expression \"" + edge.getIndex() + "\": " + e.getMessage(),
+								e);
 					}
 				}
 			}
-			changes.add(new IndexChangeImpl(graph, resultMatch.getNodeTarget(edge.getSource()), resultMatch
-					.getNodeTarget(edge.getTarget()), edge.getType(), newIndex));
+			changes.add(new IndexChangeImpl(graph, resultMatch.getNodeTarget(edge.getSource()),
+					resultMatch.getNodeTarget(edge.getTarget()), edge.getType(), newIndex));
 		}
 
 		// Attribute changes:
@@ -907,10 +1001,12 @@
 			Object value;
 			Parameter param = rule.getParameter(attribute.getValue());
 			if (param != null) {
-				value = castValueToDataType(resultMatch.getParameterValue(param), attribute.getType()
-						.getEAttributeType(), attribute.getType().isMany());
+				value = castValueToDataType(resultMatch.getParameterValue(param),
+						attribute.getType().getEAttributeType(), attribute.getType().isMany());
 			} else {
-				value = evalAttributeExpression(attribute, rule); // casting done here automatically
+				value = evalAttributeExpression(attribute, rule); // casting
+																	// done here
+																	// automatically
 			}
 			changes.add(new AttributeChangeImpl(graph, object, attribute.getType(), value));
 		}
@@ -940,7 +1036,8 @@
 	/**
 	 * Evaluates a given attribute expression using the JavaScript engine.
 	 * 
-	 * @param attribute Attribute to be interpreted.
+	 * @param attribute
+	 *            Attribute to be interpreted.
 	 * @return The value.
 	 */
 	public Object evalAttributeExpression(Attribute attribute, Rule rule) {
@@ -957,8 +1054,8 @@
 		// Try to evaluate the expression and cast it to the correct type:
 		try {
 			Object evalResult = scriptEngine.eval(attribute.getValue(), rule.getAllJavaImports());
-			return castValueToDataType(evalResult, attribute.getType().getEAttributeType(), attribute.getType()
-					.isMany());
+			return castValueToDataType(evalResult, attribute.getType().getEAttributeType(),
+					attribute.getType().isMany());
 		} catch (ScriptException e) {
 			throw new RuntimeException(e.getMessage());
 		}
@@ -973,9 +1070,12 @@
 	/**
 	 * Cast a data value into a given data type.
 	 * 
-	 * @param value Value.
-	 * @param type Data type.
-	 * @param isMany Many-flag.
+	 * @param value
+	 *            Value.
+	 * @param type
+	 *            Data type.
+	 * @param isMany
+	 *            Many-flag.
 	 * @return The casted object.
 	 */
 	private static Object castValueToDataType(Object value, EDataType type, boolean isMany) {
@@ -1054,9 +1154,11 @@
 	}
 
 	/**
-	 * Get the options for a specific rule graph. The graph should be either the LHS or a nested condition.
+	 * Get the options for a specific rule graph. The graph should be either the
+	 * LHS or a nested condition.
 	 * 
-	 * @param graph The graph.
+	 * @param graph
+	 *            The graph.
 	 * @return The cached options.
 	 */
 	protected MatchingOptions getGraphOptions(Graph graph) {
@@ -1199,7 +1301,8 @@
 	/**
 	 * Create user constraints for a node.
 	 * 
-	 * @param node A node.
+	 * @param node
+	 *            A node.
 	 * @return The created user constraints.
 	 */
 	public UnaryConstraint createUserConstraints(Node node) {
@@ -1209,7 +1312,8 @@
 	/**
 	 * Create user constraints for an edge.
 	 * 
-	 * @param edge An edge.
+	 * @param edge
+	 *            An edge.
 	 * @return The created user constraint.
 	 */
 	public BinaryConstraint createUserConstraints(Edge edge) {
@@ -1219,7 +1323,8 @@
 	/**
 	 * Create user constraints for an attribute.
 	 * 
-	 * @param attribute An attribute.
+	 * @param attribute
+	 *            An attribute.
 	 * @return The created user constraint.
 	 */
 	public UnaryConstraint createUserConstraints(Attribute attribute) {
diff --git a/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/info/RuleInfo.java b/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/info/RuleInfo.java
index 5a27d82..7f6efde 100644
--- a/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/info/RuleInfo.java
+++ b/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/info/RuleInfo.java
@@ -9,7 +9,14 @@
  */
 package org.eclipse.emf.henshin.interpreter.info;
 
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Set;
+
 import org.eclipse.emf.henshin.interpreter.impl.EngineImpl;
+import org.eclipse.emf.henshin.interpreter.matching.constraints.Variable;
+import org.eclipse.emf.henshin.model.Mapping;
+import org.eclipse.emf.henshin.model.Node;
 import org.eclipse.emf.henshin.model.Rule;
 
 public class RuleInfo {
@@ -18,15 +25,31 @@
 	private VariableInfo variableInfo;
 	private RuleChangeInfo changeInfo;
 	private ConditionInfo conditionInfo;
+	
+	// Nodes whose dangling condition check must be postponed,
+	// due to multi-rules.
+	private Set<Node> postponed;
 
 	public RuleInfo(Rule rule, EngineImpl engine) {
 		this.rule = rule;
-		
+
+		this.postponed = computePostponed();
 		this.conditionInfo = new ConditionInfo(rule);
 		this.variableInfo = new VariableInfo(this, engine);
 		this.changeInfo = new RuleChangeInfo(rule);
 	}
 
+	private Set<Node> computePostponed() {
+		Set<Node> result = new HashSet<Node>();
+		for (Rule r : rule.getMultiRules()) {
+			for (Mapping m : r.getMultiMappings()) {
+				if (m.getOrigin().getGraph().isLhs())
+					result.add(m.getOrigin());
+			}
+		}
+		return result;
+	}
+
 	/**
 	 * @return the rule
 	 */
@@ -54,4 +77,8 @@
 	public ConditionInfo getConditionInfo() {
 		return conditionInfo;
 	}
+
+	public Collection<Node> getPostponed() {
+		return postponed;
+	}
 }
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/info/VariableInfo.java b/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/info/VariableInfo.java
index de54a70..dd238eb 100644
--- a/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/info/VariableInfo.java
+++ b/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/info/VariableInfo.java
@@ -78,7 +78,8 @@
 
 		for (Node node : rule.getLhs().getNodes()) {
 			if (rule.getMappings().getImage(node, rule.getRhs()) == null) {
-				createDanglingConstraints(node);
+				boolean postpone = ruleInfo.getPostponed().contains(node);
+				createDanglingConstraints(node, postpone);
 			}
 		}
 
@@ -213,9 +214,11 @@
 
 	}
 
-	private void createDanglingConstraints(Node node) {
+	private void createDanglingConstraints(Node node, boolean postpone) {
 		Variable var = node2variable.get(node);
-		DanglingConstraint constraint = new DanglingConstraint(getEdgeCounts(node, false), getEdgeCounts(node, true));
+		
+		DanglingConstraint constraint = new DanglingConstraint(getEdgeCounts(node, false), getEdgeCounts(node, true), postpone);
+		
 		var.danglingConstraints.add(constraint);
 	}
 
diff --git a/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/matching/constraints/DanglingConstraint.java b/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/matching/constraints/DanglingConstraint.java
index 09336db..6b8c9ad 100644
--- a/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/matching/constraints/DanglingConstraint.java
+++ b/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/matching/constraints/DanglingConstraint.java
@@ -29,21 +29,28 @@
 public class DanglingConstraint implements Constraint {
 
 	// Outgoing edge count:
-	private final Map<EReference, Integer> outgoingEdgeCount;
+	public  Map<EReference, Integer> outgoingEdgeCount;
 
 	// Incoming edge count:
-	private final Map<EReference, Integer> incomingEdgeCount;
+	public  Map<EReference, Integer> incomingEdgeCount;
+
+	// Dangling check might have to be postponed due to contained multi-rules.
+	public boolean postpone;
 
 	/**
 	 * Default constructor.
-	 * @param outgoingEdgeCount Outgoing edge count.
-	 * @param incomingEdgeCount Incoming edge count.
+	 * 
+	 * @param outgoingEdgeCount
+	 *            Outgoing edge count.
+	 * @param incomingEdgeCount
+	 *            Incoming edge count.
+	 * @param postpone
 	 */
-	public DanglingConstraint(
-			Map<EReference, Integer> outgoingEdgeCount,
-			Map<EReference, Integer> incomingEdgeCount) {
+	public DanglingConstraint(Map<EReference, Integer> outgoingEdgeCount, Map<EReference, Integer> incomingEdgeCount,
+			boolean postpone) {
 		this.outgoingEdgeCount = outgoingEdgeCount;
 		this.incomingEdgeCount = incomingEdgeCount;
+		this.postpone = postpone;
 	}
 
 	/*
@@ -51,14 +58,13 @@
 	 */
 	@SuppressWarnings("unchecked")
 	public boolean check(EObject sourceValue, EGraph graph) {
-		
 		// Compute the actual number of incoming edges:
 		Collection<Setting> settings = graph.getCrossReferenceAdapter().getInverseReferences(sourceValue);
-		Map<EReference, Integer> actualIncomingEdges = createMapFromSettings(settings);
+		Map<EReference, Integer> actualIncomingEdges = createMapFromSettings(settings, graph);
 		Integer expectedCount;
 
 		if (incomingEdgeCount != null) {
-			for (EReference ref: actualIncomingEdges.keySet()) {
+			for (EReference ref : actualIncomingEdges.keySet()) {
 				if (incomingEdgeCount.containsKey(ref)) {
 					expectedCount = incomingEdgeCount.get(ref);
 				} else {
@@ -85,43 +91,83 @@
 				if (type.isMany()) {
 					List<Object> outgoingEdges = (List<Object>) sourceValue.eGet(type);
 					outgoingEdges.retainAll(graph);
-					if (expectedCount!=null) {
-						if (expectedCount!=outgoingEdges.size()) {
+					if (expectedCount != null) {
+						if (expectedCount != outgoingEdges.size()) {
 							return false;
 						}
 					}
 				} else {
-					if (sourceValue.eGet(type)!=null 
-							&& expectedCount!=1
+					if (sourceValue.eGet(type) != null && expectedCount != 1
 							&& graph.contains(sourceValue.eGet(type))) {
 						return false;
 					}
 				}
 			}
 		}
-		
+
 		// Ok.
 		return true;
-		
+
 	}
 
 	/*
 	 * Count edges.
 	 */
-	private Map<EReference, Integer> createMapFromSettings(Collection<Setting> settings) {
+	private Map<EReference, Integer> createMapFromSettings(Collection<Setting> settings, EGraph graph) {
 		Map<EReference, Integer> result = new HashMap<EReference, Integer>();
-		for (Setting setting: settings) {
-			Integer count = result.get(setting.getEStructuralFeature());
-			if (count == null) {
-				count = 1;
-				EStructuralFeature feature = setting.getEStructuralFeature();
-				if (!feature.isDerived())
-					result.put((EReference) feature, count);
-			} else {
-				count++;
+		for (Setting setting : settings) {
+			if (graph.contains(setting.getEObject())) {
+				Integer count = result.get(setting.getEStructuralFeature());
+				if (count == null) {
+					count = 1;
+					EStructuralFeature feature = setting.getEStructuralFeature();
+					if (!feature.isDerived())
+						result.put((EReference) feature, count);
+				} else {
+					count++;
+				}
 			}
 		}
 		return result;
 	}
 
+	public DanglingConstraint copy() {
+		Map<EReference, Integer> outgoingEdgeCount2 = null;
+		if (outgoingEdgeCount != null) {
+			outgoingEdgeCount2 = new HashMap<EReference, Integer>();
+			outgoingEdgeCount2.putAll(outgoingEdgeCount);
+		}
+
+		Map<EReference, Integer> incomingEdgeCount2 = null;
+		if (incomingEdgeCount != null) {
+			incomingEdgeCount2 = new HashMap<EReference, Integer>();
+			incomingEdgeCount2.putAll(incomingEdgeCount);
+		}
+
+		return new DanglingConstraint(outgoingEdgeCount2, incomingEdgeCount2, postpone);
+	}
+
+	public void increaseOutgoing(EReference ref, int count) {
+		if (outgoingEdgeCount == null)
+			outgoingEdgeCount = new HashMap<EReference, Integer>();
+		
+		if (outgoingEdgeCount.get(ref) == null) {
+			outgoingEdgeCount.put(ref, count);
+		} else {
+			int newCount = outgoingEdgeCount.get(ref) + count;
+			outgoingEdgeCount.put(ref, newCount);
+		}
+	}
+
+	public void increaseIncoming(EReference ref, int count) {
+		if (incomingEdgeCount == null)
+			incomingEdgeCount = new HashMap<EReference, Integer>();
+		
+		if (incomingEdgeCount.get(ref) == null)
+			incomingEdgeCount.put(ref, count);
+		else {
+			int newCount = incomingEdgeCount.get(ref) + count;
+			incomingEdgeCount.put(ref, newCount);
+		}
+	}
 }
\ No newline at end of file
diff --git a/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/matching/constraints/DomainSlot.java b/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/matching/constraints/DomainSlot.java
index e2c5b20..e695010 100644
--- a/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/matching/constraints/DomainSlot.java
+++ b/plugins/org.eclipse.emf.henshin.interpreter/src/org/eclipse/emf/henshin/interpreter/matching/constraints/DomainSlot.java
@@ -195,7 +195,7 @@
 			// Check the dangling constraints:
 			if (dangling) {
 				for (DanglingConstraint constraint : variable.danglingConstraints) {
-					if (!constraint.check(value, graph)) {
+					if (!constraint.postpone && !constraint.check(value, graph)) {
 						return false;
 					}
 				}
diff --git a/plugins/org.eclipse.emf.henshin.tests/basic/models/checkDanglingModels/graphWithTwoReferences.ecore b/plugins/org.eclipse.emf.henshin.tests/basic/models/checkDanglingModels/graphWithTwoReferences.ecore
new file mode 100644
index 0000000..382fe32
--- /dev/null
+++ b/plugins/org.eclipse.emf.henshin.tests/basic/models/checkDanglingModels/graphWithTwoReferences.ecore
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="x" nsURI="http://x" nsPrefix="x">
+  <eClassifiers xsi:type="ecore:EClass" name="A">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="c" eType="#//C"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="B">
+    <eStructuralFeatures xsi:type="ecore:EReference" name="c" eType="#//C"/>
+  </eClassifiers>
+  <eClassifiers xsi:type="ecore:EClass" name="C"/>
+</ecore:EPackage>
diff --git a/plugins/org.eclipse.emf.henshin.tests/basic/rules/checkDangling.henshin b/plugins/org.eclipse.emf.henshin.tests/basic/rules/checkDangling.henshin
new file mode 100644
index 0000000..ae4172b
--- /dev/null
+++ b/plugins/org.eclipse.emf.henshin.tests/basic/rules/checkDangling.henshin
@@ -0,0 +1,335 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<henshin:Module xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:henshin="http://www.eclipse.org/emf/2011/Henshin" xmi:id="__f7DoFl_EeeQ9__4QSHnog">
+  <imports href="http://www.eclipse.org/emf/2002/Ecore#/"/>
+  <units xsi:type="henshin:Rule" xmi:id="_Bn8gEFmAEeeQ9__4QSHnog" name="deleteClassCMulti">
+    <lhs xmi:id="_BqBjsFmAEeeQ9__4QSHnog" name="Lhs">
+      <nodes xmi:id="_DHAfEFmAEeeQ9__4QSHnog" name="c" incoming="__yMikFmDEeebw7-btdPZcw">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+        <attributes xmi:id="_8Xq8cFmDEeebw7-btdPZcw" value="&quot;C&quot;">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//ENamedElement/name"/>
+        </attributes>
+      </nodes>
+      <nodes xmi:id="_-ZKTEFmDEeebw7-btdPZcw" name="p" description="" outgoing="__yMikFmDEeebw7-btdPZcw">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+      </nodes>
+      <edges xmi:id="__yMikFmDEeebw7-btdPZcw" source="_-ZKTEFmDEeebw7-btdPZcw" target="_DHAfEFmAEeeQ9__4QSHnog">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+      </edges>
+    </lhs>
+    <rhs xmi:id="_BqBjsVmAEeeQ9__4QSHnog" name="Rhs">
+      <nodes xmi:id="__N9NEFmDEeebw7-btdPZcw">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+      </nodes>
+    </rhs>
+    <mappings xmi:id="__N9NEVmDEeebw7-btdPZcw" origin="_-ZKTEFmDEeebw7-btdPZcw" image="__N9NEFmDEeebw7-btdPZcw"/>
+    <multiRules xmi:id="_FXLK4FmAEeeQ9__4QSHnog">
+      <lhs xmi:id="_FXLx8FmAEeeQ9__4QSHnog" name="Lhs">
+        <nodes xmi:id="_FXMZAlmAEeeQ9__4QSHnog" name="c'" incoming="_JFU3oFmAEeeQ9__4QSHnog __yNJoFmDEeebw7-btdPZcw _nKPigFndEee2EOxxkU-5OQ">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+        </nodes>
+        <nodes xmi:id="_EeJRIFmAEeeQ9__4QSHnog" name="d" incoming="_AAgrYFmEEeebw7-btdPZcw" outgoing="_IutHYFmAEeeQ9__4QSHnog">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+        </nodes>
+        <nodes xmi:id="_GcAsAFmAEeeQ9__4QSHnog" name="r'" incoming="_IutHYFmAEeeQ9__4QSHnog" outgoing="_JFU3oFmAEeeQ9__4QSHnog _mshrwFndEee2EOxxkU-5OQ">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+        </nodes>
+        <nodes xmi:id="_-ZQZsFmDEeebw7-btdPZcw" name="p'" description="" outgoing="__yNJoFmDEeebw7-btdPZcw _AAgrYFmEEeebw7-btdPZcw">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+        </nodes>
+        <nodes xmi:id="_itx-QFndEee2EOxxkU-5OQ" name="g'" incoming="_mshrwFndEee2EOxxkU-5OQ" outgoing="_nKPigFndEee2EOxxkU-5OQ">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EGenericType"/>
+        </nodes>
+        <edges xmi:id="_IutHYFmAEeeQ9__4QSHnog" source="_EeJRIFmAEeeQ9__4QSHnog" target="_GcAsAFmAEeeQ9__4QSHnog">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass/eStructuralFeatures"/>
+        </edges>
+        <edges xmi:id="_JFU3oFmAEeeQ9__4QSHnog" source="_GcAsAFmAEeeQ9__4QSHnog" target="_FXMZAlmAEeeQ9__4QSHnog">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement/eType"/>
+        </edges>
+        <edges xmi:id="__yNJoFmDEeebw7-btdPZcw" source="_-ZQZsFmDEeebw7-btdPZcw" target="_FXMZAlmAEeeQ9__4QSHnog">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+        </edges>
+        <edges xmi:id="_AAgrYFmEEeebw7-btdPZcw" source="_-ZQZsFmDEeebw7-btdPZcw" target="_EeJRIFmAEeeQ9__4QSHnog">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+        </edges>
+        <edges xmi:id="_mshrwFndEee2EOxxkU-5OQ" source="_GcAsAFmAEeeQ9__4QSHnog" target="_itx-QFndEee2EOxxkU-5OQ">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement/eGenericType"/>
+        </edges>
+        <edges xmi:id="_nKPigFndEee2EOxxkU-5OQ" source="_itx-QFndEee2EOxxkU-5OQ" target="_FXMZAlmAEeeQ9__4QSHnog">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EGenericType/eClassifier"/>
+        </edges>
+      </lhs>
+      <rhs xmi:id="_FXLx8VmAEeeQ9__4QSHnog" name="Rhs">
+        <nodes xmi:id="_EeJRIVmAEeeQ9__4QSHnog" incoming="_AAgrYVmEEeebw7-btdPZcw">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+        </nodes>
+        <nodes xmi:id="__N9NElmDEeebw7-btdPZcw" outgoing="_AAgrYVmEEeebw7-btdPZcw">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+        </nodes>
+        <edges xmi:id="_AAgrYVmEEeebw7-btdPZcw" source="__N9NElmDEeebw7-btdPZcw" target="_EeJRIVmAEeeQ9__4QSHnog">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+        </edges>
+      </rhs>
+      <mappings xmi:id="_EeJRIlmAEeeQ9__4QSHnog" origin="_EeJRIFmAEeeQ9__4QSHnog" image="_EeJRIVmAEeeQ9__4QSHnog"/>
+      <mappings xmi:id="__N9NE1mDEeebw7-btdPZcw" origin="_-ZQZsFmDEeebw7-btdPZcw" image="__N9NElmDEeebw7-btdPZcw"/>
+      <multiMappings xmi:id="_FXMZA1mAEeeQ9__4QSHnog" origin="_DHAfEFmAEeeQ9__4QSHnog" image="_FXMZAlmAEeeQ9__4QSHnog"/>
+      <multiMappings xmi:id="_-ZRAwFmDEeebw7-btdPZcw" origin="_-ZKTEFmDEeebw7-btdPZcw" image="_-ZQZsFmDEeebw7-btdPZcw"/>
+      <multiMappings xmi:id="__N90IFmDEeebw7-btdPZcw" origin="__N9NEFmDEeebw7-btdPZcw" image="__N9NElmDEeebw7-btdPZcw"/>
+    </multiRules>
+  </units>
+  <units xsi:type="henshin:Rule" xmi:id="_3ZCNUFmFEees8-5Nd7nXQQ" name="deleteClassCTwoEdges">
+    <lhs xmi:id="_3ZCNUVmFEees8-5Nd7nXQQ" name="Lhs">
+      <nodes xmi:id="_3ZCNUlmFEees8-5Nd7nXQQ" name="c" incoming="_3ZCNVVmFEees8-5Nd7nXQQ _FDpjMFmGEees8-5Nd7nXQQ _FWlGQFmGEees8-5Nd7nXQQ _OefXQFnZEeeEtNdqy6ndzw _Ou8OEFnZEeeEtNdqy6ndzw">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+        <attributes xmi:id="_3ZCNU1mFEees8-5Nd7nXQQ" value="&quot;C&quot;">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//ENamedElement/name"/>
+        </attributes>
+      </nodes>
+      <nodes xmi:id="_3ZCNVFmFEees8-5Nd7nXQQ" outgoing="_3ZCNVVmFEees8-5Nd7nXQQ _-UC3oFmFEees8-5Nd7nXQQ _-he2sFmFEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+      </nodes>
+      <nodes xmi:id="_7oiToFmFEees8-5Nd7nXQQ" incoming="_-UC3oFmFEees8-5Nd7nXQQ" outgoing="_EKYY4FmGEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+      </nodes>
+      <nodes xmi:id="_98YlkFmFEees8-5Nd7nXQQ" incoming="_-he2sFmFEees8-5Nd7nXQQ" outgoing="_Ed5KwFmGEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+      </nodes>
+      <nodes xmi:id="_CV6xoFmGEees8-5Nd7nXQQ" incoming="_EKYY4FmGEees8-5Nd7nXQQ" outgoing="_FDpjMFmGEees8-5Nd7nXQQ _GUiNkFnZEeeEtNdqy6ndzw">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+      </nodes>
+      <nodes xmi:id="_DIuHkFmGEees8-5Nd7nXQQ" incoming="_Ed5KwFmGEees8-5Nd7nXQQ" outgoing="_FWlGQFmGEees8-5Nd7nXQQ _GERkAFnZEeeEtNdqy6ndzw">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+      </nodes>
+      <nodes xmi:id="_FFu4IFnZEeeEtNdqy6ndzw" incoming="_GUiNkFnZEeeEtNdqy6ndzw" outgoing="_OefXQFnZEeeEtNdqy6ndzw">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EGenericType"/>
+      </nodes>
+      <nodes xmi:id="_Fp7KUFnZEeeEtNdqy6ndzw" incoming="_GERkAFnZEeeEtNdqy6ndzw" outgoing="_Ou8OEFnZEeeEtNdqy6ndzw">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EGenericType"/>
+      </nodes>
+      <edges xmi:id="_3ZCNVVmFEees8-5Nd7nXQQ" source="_3ZCNVFmFEees8-5Nd7nXQQ" target="_3ZCNUlmFEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+      </edges>
+      <edges xmi:id="_-UC3oFmFEees8-5Nd7nXQQ" source="_3ZCNVFmFEees8-5Nd7nXQQ" target="_7oiToFmFEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+      </edges>
+      <edges xmi:id="_-he2sFmFEees8-5Nd7nXQQ" source="_3ZCNVFmFEees8-5Nd7nXQQ" target="_98YlkFmFEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+      </edges>
+      <edges xmi:id="_EKYY4FmGEees8-5Nd7nXQQ" source="_7oiToFmFEees8-5Nd7nXQQ" target="_CV6xoFmGEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass/eStructuralFeatures"/>
+      </edges>
+      <edges xmi:id="_Ed5KwFmGEees8-5Nd7nXQQ" source="_98YlkFmFEees8-5Nd7nXQQ" target="_DIuHkFmGEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass/eStructuralFeatures"/>
+      </edges>
+      <edges xmi:id="_FDpjMFmGEees8-5Nd7nXQQ" source="_CV6xoFmGEees8-5Nd7nXQQ" target="_3ZCNUlmFEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement/eType"/>
+      </edges>
+      <edges xmi:id="_FWlGQFmGEees8-5Nd7nXQQ" source="_DIuHkFmGEees8-5Nd7nXQQ" target="_3ZCNUlmFEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement/eType"/>
+      </edges>
+      <edges xmi:id="_GERkAFnZEeeEtNdqy6ndzw" source="_DIuHkFmGEees8-5Nd7nXQQ" target="_Fp7KUFnZEeeEtNdqy6ndzw">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement/eGenericType"/>
+      </edges>
+      <edges xmi:id="_GUiNkFnZEeeEtNdqy6ndzw" source="_CV6xoFmGEees8-5Nd7nXQQ" target="_FFu4IFnZEeeEtNdqy6ndzw">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement/eGenericType"/>
+      </edges>
+      <edges xmi:id="_OefXQFnZEeeEtNdqy6ndzw" source="_FFu4IFnZEeeEtNdqy6ndzw" target="_3ZCNUlmFEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EGenericType/eClassifier"/>
+      </edges>
+      <edges xmi:id="_Ou8OEFnZEeeEtNdqy6ndzw" source="_Fp7KUFnZEeeEtNdqy6ndzw" target="_3ZCNUlmFEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EGenericType/eClassifier"/>
+      </edges>
+    </lhs>
+    <rhs xmi:id="_3ZCNVlmFEees8-5Nd7nXQQ" name="Rhs">
+      <nodes xmi:id="_3ZCNV1mFEees8-5Nd7nXQQ" outgoing="_-UC3oVmFEees8-5Nd7nXQQ _-he2sVmFEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+      </nodes>
+      <nodes xmi:id="_7omlEFmFEees8-5Nd7nXQQ" incoming="_-UC3oVmFEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+      </nodes>
+      <nodes xmi:id="_98YlkVmFEees8-5Nd7nXQQ" incoming="_-he2sVmFEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+      </nodes>
+      <edges xmi:id="_-UC3oVmFEees8-5Nd7nXQQ" source="_3ZCNV1mFEees8-5Nd7nXQQ" target="_7omlEFmFEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+      </edges>
+      <edges xmi:id="_-he2sVmFEees8-5Nd7nXQQ" source="_3ZCNV1mFEees8-5Nd7nXQQ" target="_98YlkVmFEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+      </edges>
+    </rhs>
+    <mappings xmi:id="_3ZCNWFmFEees8-5Nd7nXQQ" origin="_3ZCNVFmFEees8-5Nd7nXQQ" image="_3ZCNV1mFEees8-5Nd7nXQQ"/>
+    <mappings xmi:id="_7omlEVmFEees8-5Nd7nXQQ" origin="_7oiToFmFEees8-5Nd7nXQQ" image="_7omlEFmFEees8-5Nd7nXQQ"/>
+    <mappings xmi:id="_98YlklmFEees8-5Nd7nXQQ" origin="_98YlkFmFEees8-5Nd7nXQQ" image="_98YlkVmFEees8-5Nd7nXQQ"/>
+  </units>
+  <units xsi:type="henshin:Rule" xmi:id="_F1xjsFmGEees8-5Nd7nXQQ" name="deleteClassCOneEdge">
+    <lhs xmi:id="_F1xjsVmGEees8-5Nd7nXQQ" name="Lhs">
+      <nodes xmi:id="_F1xjslmGEees8-5Nd7nXQQ" name="c" incoming="_F1xjuVmGEees8-5Nd7nXQQ _F1xjvlmGEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+        <attributes xmi:id="_F1xjs1mGEees8-5Nd7nXQQ" value="&quot;C&quot;">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//ENamedElement/name"/>
+        </attributes>
+      </nodes>
+      <nodes xmi:id="_F1xjtFmGEees8-5Nd7nXQQ" outgoing="_F1xjuVmGEees8-5Nd7nXQQ _F1xjulmGEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+      </nodes>
+      <nodes xmi:id="_F1xjtVmGEees8-5Nd7nXQQ" incoming="_F1xjulmGEees8-5Nd7nXQQ" outgoing="_F1xjvFmGEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+      </nodes>
+      <nodes xmi:id="_F1xjt1mGEees8-5Nd7nXQQ" incoming="_F1xjvFmGEees8-5Nd7nXQQ" outgoing="_F1xjvlmGEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+      </nodes>
+      <edges xmi:id="_F1xjuVmGEees8-5Nd7nXQQ" source="_F1xjtFmGEees8-5Nd7nXQQ" target="_F1xjslmGEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+      </edges>
+      <edges xmi:id="_F1xjulmGEees8-5Nd7nXQQ" source="_F1xjtFmGEees8-5Nd7nXQQ" target="_F1xjtVmGEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+      </edges>
+      <edges xmi:id="_F1xjvFmGEees8-5Nd7nXQQ" source="_F1xjtVmGEees8-5Nd7nXQQ" target="_F1xjt1mGEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass/eStructuralFeatures"/>
+      </edges>
+      <edges xmi:id="_F1xjvlmGEees8-5Nd7nXQQ" source="_F1xjt1mGEees8-5Nd7nXQQ" target="_F1xjslmGEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement/eType"/>
+      </edges>
+    </lhs>
+    <rhs xmi:id="_F1xjwFmGEees8-5Nd7nXQQ" name="Rhs">
+      <nodes xmi:id="_F1xjwVmGEees8-5Nd7nXQQ" outgoing="_F1xjxFmGEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+      </nodes>
+      <nodes xmi:id="_F1xjwlmGEees8-5Nd7nXQQ" incoming="_F1xjxFmGEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+      </nodes>
+      <edges xmi:id="_F1xjxFmGEees8-5Nd7nXQQ" source="_F1xjwVmGEees8-5Nd7nXQQ" target="_F1xjwlmGEees8-5Nd7nXQQ">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+      </edges>
+    </rhs>
+    <mappings xmi:id="_F1xjxlmGEees8-5Nd7nXQQ" origin="_F1xjtFmGEees8-5Nd7nXQQ" image="_F1xjwVmGEees8-5Nd7nXQQ"/>
+    <mappings xmi:id="_F1xjx1mGEees8-5Nd7nXQQ" origin="_F1xjtVmGEees8-5Nd7nXQQ" image="_F1xjwlmGEees8-5Nd7nXQQ"/>
+  </units>
+  <units xsi:type="henshin:Rule" xmi:id="_woG_kFnnEee0OeYFJsTIMw" name="deleteClassCMulti2Level">
+    <lhs xmi:id="_woG_kVnnEee0OeYFJsTIMw" name="Lhs">
+      <nodes xmi:id="_woG_klnnEee0OeYFJsTIMw" name="c" incoming="_woG_lVnnEee0OeYFJsTIMw">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+        <attributes xmi:id="_woG_k1nnEee0OeYFJsTIMw" value="&quot;C&quot;">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//ENamedElement/name"/>
+        </attributes>
+      </nodes>
+      <nodes xmi:id="_woG_lFnnEee0OeYFJsTIMw" name="p" description="" outgoing="_woG_lVnnEee0OeYFJsTIMw">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+      </nodes>
+      <edges xmi:id="_woG_lVnnEee0OeYFJsTIMw" source="_woG_lFnnEee0OeYFJsTIMw" target="_woG_klnnEee0OeYFJsTIMw">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+      </edges>
+    </lhs>
+    <rhs xmi:id="_woG_llnnEee0OeYFJsTIMw" name="Rhs">
+      <nodes xmi:id="_woG_l1nnEee0OeYFJsTIMw">
+        <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+      </nodes>
+    </rhs>
+    <mappings xmi:id="_woG_mFnnEee0OeYFJsTIMw" origin="_woG_lFnnEee0OeYFJsTIMw" image="_woG_l1nnEee0OeYFJsTIMw"/>
+    <multiRules xmi:id="_0sA54FnnEee0OeYFJsTIMw" name="ref">
+      <lhs xmi:id="_0sFyYFnnEee0OeYFJsTIMw" name="Lhs">
+        <nodes xmi:id="_0sGZcFnnEee0OeYFJsTIMw" name="c" incoming="_0sGZdVnnEee0OeYFJsTIMw _woG_oVnnEee0OeYFJsTIMw">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+          <attributes xmi:id="_0sGZcVnnEee0OeYFJsTIMw" value="&quot;C&quot;">
+            <type href="http://www.eclipse.org/emf/2002/Ecore#//ENamedElement/name"/>
+          </attributes>
+        </nodes>
+        <nodes xmi:id="_0sGZc1nnEee0OeYFJsTIMw" name="p" description="" outgoing="_0sGZdVnnEee0OeYFJsTIMw _AsrvEFnrEee0OeYFJsTIMw">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+        </nodes>
+        <nodes xmi:id="_woG_nVnnEee0OeYFJsTIMw" name="r'" incoming="_woG_oFnnEee0OeYFJsTIMw" outgoing="_woG_oVnnEee0OeYFJsTIMw">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+        </nodes>
+        <nodes xmi:id="_0r6MMFnnEee0OeYFJsTIMw" name="d" incoming="_AsrvEFnrEee0OeYFJsTIMw" outgoing="_woG_oFnnEee0OeYFJsTIMw">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+        </nodes>
+        <edges xmi:id="_0sGZdVnnEee0OeYFJsTIMw" source="_0sGZc1nnEee0OeYFJsTIMw" target="_0sGZcFnnEee0OeYFJsTIMw">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+        </edges>
+        <edges xmi:id="_woG_oFnnEee0OeYFJsTIMw" source="_0r6MMFnnEee0OeYFJsTIMw" target="_woG_nVnnEee0OeYFJsTIMw">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass/eStructuralFeatures"/>
+        </edges>
+        <edges xmi:id="_woG_oVnnEee0OeYFJsTIMw" source="_woG_nVnnEee0OeYFJsTIMw" target="_0sGZcFnnEee0OeYFJsTIMw">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement/eType"/>
+        </edges>
+        <edges xmi:id="_AsrvEFnrEee0OeYFJsTIMw" source="_0sGZc1nnEee0OeYFJsTIMw" target="_0r6MMFnnEee0OeYFJsTIMw">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+        </edges>
+      </lhs>
+      <rhs xmi:id="_0sFyYVnnEee0OeYFJsTIMw" name="Rhs">
+        <nodes xmi:id="_0sMgEFnnEee0OeYFJsTIMw" outgoing="_AssWIFnrEee0OeYFJsTIMw">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+        </nodes>
+        <nodes xmi:id="_-yViQFnqEee0OeYFJsTIMw" name="d" incoming="_AssWIFnrEee0OeYFJsTIMw">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+        </nodes>
+        <edges xmi:id="_AssWIFnrEee0OeYFJsTIMw" source="_0sMgEFnnEee0OeYFJsTIMw" target="_-yViQFnqEee0OeYFJsTIMw">
+          <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+        </edges>
+      </rhs>
+      <mappings xmi:id="_0sO8UFnnEee0OeYFJsTIMw" origin="_0sGZc1nnEee0OeYFJsTIMw" image="_0sMgEFnnEee0OeYFJsTIMw"/>
+      <mappings xmi:id="_-yYlkFnqEee0OeYFJsTIMw" origin="_0r6MMFnnEee0OeYFJsTIMw" image="_-yViQFnqEee0OeYFJsTIMw"/>
+      <multiRules xmi:id="_4y_9YFnnEee0OeYFJsTIMw" name="gen">
+        <lhs xmi:id="_4zAkcFnnEee0OeYFJsTIMw" name="Lhs">
+          <nodes xmi:id="_4zBLgFnnEee0OeYFJsTIMw" name="c" incoming="_4zByk1nnEee0OeYFJsTIMw _4zCZoFnnEee0OeYFJsTIMw _6IaRIFnnEee0OeYFJsTIMw">
+            <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+            <attributes xmi:id="_4zBLgVnnEee0OeYFJsTIMw" value="&quot;C&quot;">
+              <type href="http://www.eclipse.org/emf/2002/Ecore#//ENamedElement/name"/>
+            </attributes>
+          </nodes>
+          <nodes xmi:id="_4zBykVnnEee0OeYFJsTIMw" name="p" description="" outgoing="_4zByk1nnEee0OeYFJsTIMw _AssWIlnrEee0OeYFJsTIMw">
+            <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+          </nodes>
+          <nodes xmi:id="_4zBylFnnEee0OeYFJsTIMw" name="r'" incoming="_4zCZplnnEee0OeYFJsTIMw" outgoing="_4zCZoFnnEee0OeYFJsTIMw _woG_pFnnEee0OeYFJsTIMw">
+            <type href="http://www.eclipse.org/emf/2002/Ecore#//EReference"/>
+          </nodes>
+          <nodes xmi:id="_4zCZpFnnEee0OeYFJsTIMw" name="d" incoming="_AssWIlnrEee0OeYFJsTIMw" outgoing="_4zCZplnnEee0OeYFJsTIMw">
+            <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+          </nodes>
+          <nodes xmi:id="_0r7aUFnnEee0OeYFJsTIMw" name="g'" incoming="_woG_pFnnEee0OeYFJsTIMw" outgoing="_6IaRIFnnEee0OeYFJsTIMw">
+            <type href="http://www.eclipse.org/emf/2002/Ecore#//EGenericType"/>
+          </nodes>
+          <edges xmi:id="_4zByk1nnEee0OeYFJsTIMw" source="_4zBykVnnEee0OeYFJsTIMw" target="_4zBLgFnnEee0OeYFJsTIMw">
+            <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+          </edges>
+          <edges xmi:id="_4zCZoFnnEee0OeYFJsTIMw" source="_4zBylFnnEee0OeYFJsTIMw" target="_4zBLgFnnEee0OeYFJsTIMw">
+            <type href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement/eType"/>
+          </edges>
+          <edges xmi:id="_4zCZplnnEee0OeYFJsTIMw" source="_4zCZpFnnEee0OeYFJsTIMw" target="_4zBylFnnEee0OeYFJsTIMw">
+            <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass/eStructuralFeatures"/>
+          </edges>
+          <edges xmi:id="_woG_pFnnEee0OeYFJsTIMw" source="_4zBylFnnEee0OeYFJsTIMw" target="_0r7aUFnnEee0OeYFJsTIMw">
+            <type href="http://www.eclipse.org/emf/2002/Ecore#//ETypedElement/eGenericType"/>
+          </edges>
+          <edges xmi:id="_6IaRIFnnEee0OeYFJsTIMw" source="_0r7aUFnnEee0OeYFJsTIMw" target="_4zBLgFnnEee0OeYFJsTIMw">
+            <type href="http://www.eclipse.org/emf/2002/Ecore#//EGenericType/eClassifier"/>
+          </edges>
+          <edges xmi:id="_AssWIlnrEee0OeYFJsTIMw" source="_4zBykVnnEee0OeYFJsTIMw" target="_4zCZpFnnEee0OeYFJsTIMw">
+            <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+          </edges>
+        </lhs>
+        <rhs xmi:id="_4zAkcVnnEee0OeYFJsTIMw" name="Rhs">
+          <nodes xmi:id="_4zCZoVnnEee0OeYFJsTIMw" outgoing="_AssWIVnrEee0OeYFJsTIMw">
+            <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage"/>
+          </nodes>
+          <nodes xmi:id="_-yZzsFnqEee0OeYFJsTIMw" name="d" incoming="_AssWIVnrEee0OeYFJsTIMw">
+            <type href="http://www.eclipse.org/emf/2002/Ecore#//EClass"/>
+          </nodes>
+          <edges xmi:id="_AssWIVnrEee0OeYFJsTIMw" source="_4zCZoVnnEee0OeYFJsTIMw" target="_-yZzsFnqEee0OeYFJsTIMw">
+            <type href="http://www.eclipse.org/emf/2002/Ecore#//EPackage/eClassifiers"/>
+          </edges>
+        </rhs>
+        <mappings xmi:id="_4zCZo1nnEee0OeYFJsTIMw" origin="_4zBykVnnEee0OeYFJsTIMw" image="_4zCZoVnnEee0OeYFJsTIMw"/>
+        <mappings xmi:id="_-yZzsVnqEee0OeYFJsTIMw" origin="_4zCZpFnnEee0OeYFJsTIMw" image="_-yZzsFnqEee0OeYFJsTIMw"/>
+        <multiMappings xmi:id="_4zBykFnnEee0OeYFJsTIMw" origin="_0sGZcFnnEee0OeYFJsTIMw" image="_4zBLgFnnEee0OeYFJsTIMw"/>
+        <multiMappings xmi:id="_4zByklnnEee0OeYFJsTIMw" origin="_0sGZc1nnEee0OeYFJsTIMw" image="_4zBykVnnEee0OeYFJsTIMw"/>
+        <multiMappings xmi:id="_4zBylVnnEee0OeYFJsTIMw" origin="_woG_nVnnEee0OeYFJsTIMw" image="_4zBylFnnEee0OeYFJsTIMw"/>
+        <multiMappings xmi:id="_4zCZolnnEee0OeYFJsTIMw" origin="_0sMgEFnnEee0OeYFJsTIMw" image="_4zCZoVnnEee0OeYFJsTIMw"/>
+        <multiMappings xmi:id="_4zCZpVnnEee0OeYFJsTIMw" origin="_0r6MMFnnEee0OeYFJsTIMw" image="_4zCZpFnnEee0OeYFJsTIMw"/>
+        <multiMappings xmi:id="_-yZztVnqEee0OeYFJsTIMw" origin="_-yViQFnqEee0OeYFJsTIMw" image="_-yZzsFnqEee0OeYFJsTIMw"/>
+      </multiRules>
+      <multiMappings xmi:id="_0sGZclnnEee0OeYFJsTIMw" origin="_woG_klnnEee0OeYFJsTIMw" image="_0sGZcFnnEee0OeYFJsTIMw"/>
+      <multiMappings xmi:id="_0sGZdFnnEee0OeYFJsTIMw" origin="_woG_lFnnEee0OeYFJsTIMw" image="_0sGZc1nnEee0OeYFJsTIMw"/>
+      <multiMappings xmi:id="_0sOVQFnnEee0OeYFJsTIMw" origin="_woG_l1nnEee0OeYFJsTIMw" image="_0sMgEFnnEee0OeYFJsTIMw"/>
+    </multiRules>
+  </units>
+</henshin:Module>
diff --git a/plugins/org.eclipse.emf.henshin.tests/basic/rules/checkDangling.henshin_diagram b/plugins/org.eclipse.emf.henshin.tests/basic/rules/checkDangling.henshin_diagram
new file mode 100644
index 0000000..3b4e127
--- /dev/null
+++ b/plugins/org.eclipse.emf.henshin.tests/basic/rules/checkDangling.henshin_diagram
@@ -0,0 +1,578 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:henshin="http://www.eclipse.org/emf/2011/Henshin" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmi:id="__g4s8Fl_EeeQ9__4QSHnog" type="Henshin" name="checkDangling.henshin_diagram" measurementUnit="Pixel">
+  <children xmi:type="notation:Shape" xmi:id="_BoJ7cFmAEeeQ9__4QSHnog" type="2001" fontName="Segoe UI" italic="true" lineColor="0">
+    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_DHGlsFmAEeeQ9__4QSHnog" source="defaultAction">
+      <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_DHHMwFmAEeeQ9__4QSHnog" key="value" value="delete*"/>
+    </eAnnotations>
+    <children xmi:type="notation:DecorationNode" xmi:id="_BoMXsFmAEeeQ9__4QSHnog" type="5001"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_BoMXsVmAEeeQ9__4QSHnog" type="7001">
+      <children xmi:type="notation:Shape" xmi:id="_DHJpAFmAEeeQ9__4QSHnog" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_DHKQEFmAEeeQ9__4QSHnog" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_DHKQEVmAEeeQ9__4QSHnog" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_DHNTYFmAEeeQ9__4QSHnog" type="7002">
+          <children xmi:type="notation:Node" xmi:id="_8aHMcFmDEeebw7-btdPZcw" type="3002">
+            <element xmi:type="henshin:Attribute" href="checkDangling.henshin#_8Xq8cFmDEeebw7-btdPZcw"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_8aHMcVmDEeebw7-btdPZcw"/>
+          </children>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_DHNTYVmAEeeQ9__4QSHnog"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_DHNTYlmAEeeQ9__4QSHnog"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_DHAfEFmAEeeQ9__4QSHnog"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_DHJpAVmAEeeQ9__4QSHnog" x="21" y="85"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_EeKfQFmAEeeQ9__4QSHnog" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_EeLGUFmAEeeQ9__4QSHnog" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_EeLGUVmAEeeQ9__4QSHnog" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_EeLGUlmAEeeQ9__4QSHnog" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_EeLGU1mAEeeQ9__4QSHnog"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_EeLGVFmAEeeQ9__4QSHnog"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_EeJRIFmAEeeQ9__4QSHnog"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EeKfQVmAEeeQ9__4QSHnog" x="308" y="93"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_GcEWYFmAEeeQ9__4QSHnog" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_GcEWYlmAEeeQ9__4QSHnog" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_GcEWY1mAEeeQ9__4QSHnog" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_GcEWZFmAEeeQ9__4QSHnog" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_GcEWZVmAEeeQ9__4QSHnog"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_GcEWZlmAEeeQ9__4QSHnog"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_GcAsAFmAEeeQ9__4QSHnog"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_GcEWYVmAEeeQ9__4QSHnog" x="163" y="86"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_-Zcm8FmDEeebw7-btdPZcw" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_-ZdOAFmDEeebw7-btdPZcw" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_-ZdOAVmDEeebw7-btdPZcw" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_-ZdOAlmDEeebw7-btdPZcw" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_-ZdOA1mDEeebw7-btdPZcw"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_-ZdOBFmDEeebw7-btdPZcw"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_-ZKTEFmDEeebw7-btdPZcw"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-Zcm8VmDEeebw7-btdPZcw" x="163" y="9"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_jROpkFndEee2EOxxkU-5OQ" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_jRP3sFndEee2EOxxkU-5OQ" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_jRQewFndEee2EOxxkU-5OQ" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_jRQewVndEee2EOxxkU-5OQ" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_jRQewlndEee2EOxxkU-5OQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_jRQew1ndEee2EOxxkU-5OQ"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_itx-QFndEee2EOxxkU-5OQ"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_jROpkVndEee2EOxxkU-5OQ" x="100" y="173"/>
+      </children>
+    </children>
+    <element xmi:type="henshin:Rule" href="checkDangling.henshin#_Bn8gEFmAEeeQ9__4QSHnog"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_BoJ7cVmAEeeQ9__4QSHnog" x="19" y="17" width="404" height="260"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_3ZAYIFmFEees8-5Nd7nXQQ" type="2001" fontName="Segoe UI" italic="true" lineColor="0">
+    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_3ZAYIVmFEees8-5Nd7nXQQ" source="defaultAction">
+      <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_3ZAYIlmFEees8-5Nd7nXQQ" key="value" value="delete"/>
+    </eAnnotations>
+    <children xmi:type="notation:DecorationNode" xmi:id="_3ZAYI1mFEees8-5Nd7nXQQ" type="5001"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_3ZAYJFmFEees8-5Nd7nXQQ" type="7001">
+      <children xmi:type="notation:Shape" xmi:id="_3ZAYJVmFEees8-5Nd7nXQQ" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_3ZAYJlmFEees8-5Nd7nXQQ" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_3ZAYJ1mFEees8-5Nd7nXQQ" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_3ZAYKFmFEees8-5Nd7nXQQ" type="7002">
+          <children xmi:type="notation:Node" xmi:id="_3ZAYKVmFEees8-5Nd7nXQQ" type="3002">
+            <element xmi:type="henshin:Attribute" href="checkDangling.henshin#_3ZCNU1mFEees8-5Nd7nXQQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_3ZAYKlmFEees8-5Nd7nXQQ"/>
+          </children>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_3ZAYK1mFEees8-5Nd7nXQQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_3ZAYLFmFEees8-5Nd7nXQQ"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_3ZCNUlmFEees8-5Nd7nXQQ"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3ZAYLVmFEees8-5Nd7nXQQ" x="145" y="112"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_3ZAYPFmFEees8-5Nd7nXQQ" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_3ZAYPVmFEees8-5Nd7nXQQ" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_3ZAYPlmFEees8-5Nd7nXQQ" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_3ZAYP1mFEees8-5Nd7nXQQ" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_3ZAYQFmFEees8-5Nd7nXQQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_3ZAYQVmFEees8-5Nd7nXQQ"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_3ZCNVFmFEees8-5Nd7nXQQ"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3ZAYQlmFEees8-5Nd7nXQQ" x="169" y="17"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_8nnLAFmFEees8-5Nd7nXQQ" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_8npAMFmFEees8-5Nd7nXQQ" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_8npAMVmFEees8-5Nd7nXQQ" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_8npAMlmFEees8-5Nd7nXQQ" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_8npAM1mFEees8-5Nd7nXQQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_8npANFmFEees8-5Nd7nXQQ"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_7oiToFmFEees8-5Nd7nXQQ"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_8nnLAVmFEees8-5Nd7nXQQ" x="27" y="22"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_98ZzsFmFEees8-5Nd7nXQQ" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_98ZzslmFEees8-5Nd7nXQQ" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_98Zzs1mFEees8-5Nd7nXQQ" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_98ZztFmFEees8-5Nd7nXQQ" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_98ZztVmFEees8-5Nd7nXQQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_98ZztlmFEees8-5Nd7nXQQ"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_98YlkFmFEees8-5Nd7nXQQ"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_98ZzsVmFEees8-5Nd7nXQQ" x="309" y="17"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_CV9N4FmGEees8-5Nd7nXQQ" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_CV908FmGEees8-5Nd7nXQQ" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_CV908VmGEees8-5Nd7nXQQ" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_CV908lmGEees8-5Nd7nXQQ" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_CV9081mGEees8-5Nd7nXQQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_CV909FmGEees8-5Nd7nXQQ"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_CV6xoFmGEees8-5Nd7nXQQ"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_CV9N4VmGEees8-5Nd7nXQQ" x="16" y="106"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_DIvVsFmGEees8-5Nd7nXQQ" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_DIv8wFmGEees8-5Nd7nXQQ" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_DIv8wVmGEees8-5Nd7nXQQ" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_DIv8wlmGEees8-5Nd7nXQQ" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_DIv8w1mGEees8-5Nd7nXQQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_DIv8xFmGEees8-5Nd7nXQQ"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_DIuHkFmGEees8-5Nd7nXQQ"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_DIvVsVmGEees8-5Nd7nXQQ" x="307" y="116"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_FFzJkFnZEeeEtNdqy6ndzw" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_FFzJklnZEeeEtNdqy6ndzw" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_FFzJk1nZEeeEtNdqy6ndzw" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_FFzJlFnZEeeEtNdqy6ndzw" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_FFzJlVnZEeeEtNdqy6ndzw"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_FFzJllnZEeeEtNdqy6ndzw"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_FFu4IFnZEeeEtNdqy6ndzw"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_FFzJkVnZEeeEtNdqy6ndzw" x="51" y="254"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_Fp_bwFnZEeeEtNdqy6ndzw" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_Fp_bwlnZEeeEtNdqy6ndzw" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_Fp_bw1nZEeeEtNdqy6ndzw" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_FqAC0FnZEeeEtNdqy6ndzw" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_FqAC0VnZEeeEtNdqy6ndzw"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_FqAC0lnZEeeEtNdqy6ndzw"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_Fp7KUFnZEeeEtNdqy6ndzw"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Fp_bwVnZEeeEtNdqy6ndzw" x="236" y="243"/>
+      </children>
+    </children>
+    <element xmi:type="henshin:Rule" href="checkDangling.henshin#_3ZCNUFmFEees8-5Nd7nXQQ"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3ZAYQ1mFEees8-5Nd7nXQQ" x="460" y="29" width="404" height="330"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_F1w8oFmGEees8-5Nd7nXQQ" type="2001" fontName="Segoe UI" italic="true" lineColor="0">
+    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_F1w8oVmGEees8-5Nd7nXQQ" source="defaultAction">
+      <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_F1w8olmGEees8-5Nd7nXQQ" key="value" value="delete"/>
+    </eAnnotations>
+    <children xmi:type="notation:DecorationNode" xmi:id="_F1w8o1mGEees8-5Nd7nXQQ" type="5001"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_F1w8pFmGEees8-5Nd7nXQQ" type="7001">
+      <children xmi:type="notation:Shape" xmi:id="_F1w8pVmGEees8-5Nd7nXQQ" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_F1w8plmGEees8-5Nd7nXQQ" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_F1w8p1mGEees8-5Nd7nXQQ" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_F1w8qFmGEees8-5Nd7nXQQ" type="7002">
+          <children xmi:type="notation:Node" xmi:id="_F1w8qVmGEees8-5Nd7nXQQ" type="3002">
+            <element xmi:type="henshin:Attribute" href="checkDangling.henshin#_F1xjs1mGEees8-5Nd7nXQQ"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_F1w8qlmGEees8-5Nd7nXQQ"/>
+          </children>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_F1w8q1mGEees8-5Nd7nXQQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_F1w8rFmGEees8-5Nd7nXQQ"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_F1xjslmGEees8-5Nd7nXQQ"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_F1w8rVmGEees8-5Nd7nXQQ" x="145" y="112"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_F1w8rlmGEees8-5Nd7nXQQ" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_F1w8r1mGEees8-5Nd7nXQQ" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_F1w8sFmGEees8-5Nd7nXQQ" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_F1w8sVmGEees8-5Nd7nXQQ" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_F1w8slmGEees8-5Nd7nXQQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_F1w8s1mGEees8-5Nd7nXQQ"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_F1xjtFmGEees8-5Nd7nXQQ"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_F1w8tFmGEees8-5Nd7nXQQ" x="169" y="17"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_F1w8tVmGEees8-5Nd7nXQQ" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_F1w8tlmGEees8-5Nd7nXQQ" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_F1w8t1mGEees8-5Nd7nXQQ" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_F1w8uFmGEees8-5Nd7nXQQ" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_F1w8uVmGEees8-5Nd7nXQQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_F1w8ulmGEees8-5Nd7nXQQ"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_F1xjtVmGEees8-5Nd7nXQQ"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_F1w8u1mGEees8-5Nd7nXQQ" x="27" y="22"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_F1w8w1mGEees8-5Nd7nXQQ" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_F1w8xFmGEees8-5Nd7nXQQ" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_F1w8xVmGEees8-5Nd7nXQQ" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_F1w8xlmGEees8-5Nd7nXQQ" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_F1w8x1mGEees8-5Nd7nXQQ"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_F1w8yFmGEees8-5Nd7nXQQ"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_F1xjt1mGEees8-5Nd7nXQQ"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_F1w8yVmGEees8-5Nd7nXQQ" x="16" y="106"/>
+      </children>
+    </children>
+    <element xmi:type="henshin:Rule" href="checkDangling.henshin#_F1xjsFmGEees8-5Nd7nXQQ"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_F1w80VmGEees8-5Nd7nXQQ" x="460" y="400" width="404" height="245"/>
+  </children>
+  <children xmi:type="notation:Shape" xmi:id="_woD8QFnnEee0OeYFJsTIMw" type="2001" fontName="Segoe UI" italic="true" lineColor="0">
+    <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_woEjUFnnEee0OeYFJsTIMw" source="defaultAction">
+      <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_woEjUVnnEee0OeYFJsTIMw" key="value" value="delete*/ref"/>
+    </eAnnotations>
+    <children xmi:type="notation:DecorationNode" xmi:id="_woEjUlnnEee0OeYFJsTIMw" type="5001"/>
+    <children xmi:type="notation:DecorationNode" xmi:id="_woEjU1nnEee0OeYFJsTIMw" type="7001">
+      <children xmi:type="notation:Shape" xmi:id="_woEjVFnnEee0OeYFJsTIMw" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_woEjVVnnEee0OeYFJsTIMw" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_woEjVlnnEee0OeYFJsTIMw" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_woEjV1nnEee0OeYFJsTIMw" type="7002">
+          <children xmi:type="notation:Node" xmi:id="_woEjWFnnEee0OeYFJsTIMw" type="3002">
+            <element xmi:type="henshin:Attribute" href="checkDangling.henshin#_woG_k1nnEee0OeYFJsTIMw"/>
+            <layoutConstraint xmi:type="notation:Location" xmi:id="_woEjWVnnEee0OeYFJsTIMw"/>
+          </children>
+          <styles xmi:type="notation:SortingStyle" xmi:id="_woEjWlnnEee0OeYFJsTIMw"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_woEjW1nnEee0OeYFJsTIMw"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_woG_klnnEee0OeYFJsTIMw"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_woEjXFnnEee0OeYFJsTIMw" x="21" y="85"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_woEjZFnnEee0OeYFJsTIMw" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_woEjZVnnEee0OeYFJsTIMw" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_woEjZlnnEee0OeYFJsTIMw" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_woEjZ1nnEee0OeYFJsTIMw" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_woEjaFnnEee0OeYFJsTIMw"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_woEjaVnnEee0OeYFJsTIMw"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_woG_nVnnEee0OeYFJsTIMw"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_woEjalnnEee0OeYFJsTIMw" x="176" y="118"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_woEja1nnEee0OeYFJsTIMw" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_woEjbFnnEee0OeYFJsTIMw" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_woEjbVnnEee0OeYFJsTIMw" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_woEjblnnEee0OeYFJsTIMw" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_woEjb1nnEee0OeYFJsTIMw"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_woEjcFnnEee0OeYFJsTIMw"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_woG_lFnnEee0OeYFJsTIMw"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_woEjcVnnEee0OeYFJsTIMw" x="163" y="9"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_0xJ4kFnnEee0OeYFJsTIMw" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_0xKfoFnnEee0OeYFJsTIMw" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_0xKfoVnnEee0OeYFJsTIMw" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_0xKfolnnEee0OeYFJsTIMw" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_0xKfo1nnEee0OeYFJsTIMw"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_0xKfpFnnEee0OeYFJsTIMw"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_0r6MMFnnEee0OeYFJsTIMw"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0xJ4kVnnEee0OeYFJsTIMw" x="316" y="64"/>
+      </children>
+      <children xmi:type="notation:Shape" xmi:id="_0xLGsFnnEee0OeYFJsTIMw" type="3001" fontName="Segoe UI">
+        <children xmi:type="notation:DecorationNode" xmi:id="_0xLGslnnEee0OeYFJsTIMw" type="5002"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_0xLGs1nnEee0OeYFJsTIMw" type="5003"/>
+        <children xmi:type="notation:DecorationNode" xmi:id="_0xLGtFnnEee0OeYFJsTIMw" type="7002">
+          <styles xmi:type="notation:SortingStyle" xmi:id="_0xLGtVnnEee0OeYFJsTIMw"/>
+          <styles xmi:type="notation:FilteringStyle" xmi:id="_0xLGtlnnEee0OeYFJsTIMw"/>
+        </children>
+        <element xmi:type="henshin:Node" href="checkDangling.henshin#_0r7aUFnnEee0OeYFJsTIMw"/>
+        <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0xLGsVnnEee0OeYFJsTIMw" x="28" y="222"/>
+      </children>
+    </children>
+    <element xmi:type="henshin:Rule" href="checkDangling.henshin#_woG_kFnnEee0OeYFJsTIMw"/>
+    <layoutConstraint xmi:type="notation:Bounds" xmi:id="_woEjeVnnEee0OeYFJsTIMw" x="19" y="305" width="404" height="319"/>
+  </children>
+  <styles xmi:type="notation:DiagramStyle" xmi:id="__g4s8Vl_EeeQ9__4QSHnog"/>
+  <element xmi:type="henshin:Module" href="checkDangling.henshin#__f7DoFl_EeeQ9__4QSHnog"/>
+  <edges xmi:type="notation:Connector" xmi:id="_F2D3kFmGEees8-5Nd7nXQQ" type="4001" source="_3ZAYPFmFEees8-5Nd7nXQQ" target="_3ZAYJVmFEees8-5Nd7nXQQ">
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2EeoFmGEees8-5Nd7nXQQ" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2EeoVmGEees8-5Nd7nXQQ" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2EeolmGEees8-5Nd7nXQQ" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2Eeo1mGEees8-5Nd7nXQQ" y="60"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_F2D3kVmGEees8-5Nd7nXQQ" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_3ZCNVVmFEees8-5Nd7nXQQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_F2D3klmGEees8-5Nd7nXQQ" points="[-3, 21, 9, -77]$[-9, 74, 3, -24]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_F2FFsFmGEees8-5Nd7nXQQ" type="4001" source="_3ZAYPFmFEees8-5Nd7nXQQ" target="_8nnLAFmFEees8-5Nd7nXQQ">
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2FswFmGEees8-5Nd7nXQQ" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2FswVmGEees8-5Nd7nXQQ" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2FswlmGEees8-5Nd7nXQQ" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2Fsw1mGEees8-5Nd7nXQQ" y="60"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_F2FFsVmGEees8-5Nd7nXQQ" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_-UC3oFmFEees8-5Nd7nXQQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_F2FFslmGEees8-5Nd7nXQQ" points="[-30, 5, 112, 0]$[-111, 0, 31, -5]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_F2GT0FmGEees8-5Nd7nXQQ" type="4001" source="_3ZAYPFmFEees8-5Nd7nXQQ" target="_98ZzsFmFEees8-5Nd7nXQQ">
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2G64FmGEees8-5Nd7nXQQ" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2G64VmGEees8-5Nd7nXQQ" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2G64lmGEees8-5Nd7nXQQ" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2G641mGEees8-5Nd7nXQQ" y="60"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_F2GT0VmGEees8-5Nd7nXQQ" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_-he2sFmFEees8-5Nd7nXQQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_F2GT0lmGEees8-5Nd7nXQQ" points="[31, 0, -109, 0]$[110, 0, -30, 0]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_F2Hh8FmGEees8-5Nd7nXQQ" type="4001" source="_8nnLAFmFEees8-5Nd7nXQQ" target="_CV9N4FmGEees8-5Nd7nXQQ">
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2Hh81mGEees8-5Nd7nXQQ" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2Hh9FmGEees8-5Nd7nXQQ" x="-3" y="5"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2Hh9VmGEees8-5Nd7nXQQ" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2Hh9lmGEees8-5Nd7nXQQ" x="-4" y="-47"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_F2Hh8VmGEees8-5Nd7nXQQ" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_EKYY4FmGEees8-5Nd7nXQQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_F2Hh8lmGEees8-5Nd7nXQQ" points="[-8, 21, 0, -63]$[0, 63, 8, -21]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_F2IwEFmGEees8-5Nd7nXQQ" type="4001" source="_98ZzsFmFEees8-5Nd7nXQQ" target="_DIvVsFmGEees8-5Nd7nXQQ">
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2IwE1mGEees8-5Nd7nXQQ" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2IwFFmGEees8-5Nd7nXQQ" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2IwFVmGEees8-5Nd7nXQQ" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2IwFlmGEees8-5Nd7nXQQ" y="60"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_F2IwEVmGEees8-5Nd7nXQQ" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_Ed5KwFmGEees8-5Nd7nXQQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_F2IwElmGEees8-5Nd7nXQQ" points="[1, 21, 0, -78]$[0, 78, -1, -21]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_F2JXIFmGEees8-5Nd7nXQQ" type="4001" source="_CV9N4FmGEees8-5Nd7nXQQ" target="_3ZAYJVmFEees8-5Nd7nXQQ">
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2J-MFmGEees8-5Nd7nXQQ" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2J-MVmGEees8-5Nd7nXQQ" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2J-MlmGEees8-5Nd7nXQQ" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2J-M1mGEees8-5Nd7nXQQ" y="60"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_F2JXIVmGEees8-5Nd7nXQQ" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_FDpjMFmGEees8-5Nd7nXQQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_F2JXIlmGEees8-5Nd7nXQQ" points="[33, 9, -105, 0]$[96, 0, -42, -9]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_F2LMUFmGEees8-5Nd7nXQQ" type="4001" source="_DIvVsFmGEees8-5Nd7nXQQ" target="_3ZAYJVmFEees8-5Nd7nXQQ">
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2LMU1mGEees8-5Nd7nXQQ" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2LMVFmGEees8-5Nd7nXQQ" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2LMVVmGEees8-5Nd7nXQQ" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2LMVlmGEees8-5Nd7nXQQ" y="60"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_F2LMUVmGEees8-5Nd7nXQQ" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_FWlGQFmGEees8-5Nd7nXQQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_F2LMUlmGEees8-5Nd7nXQQ" points="[-33, -1, 120, 0]$[-110, 0, 43, 1]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_F2TvMFmGEees8-5Nd7nXQQ" type="4001" source="_F1w8rlmGEees8-5Nd7nXQQ" target="_F1w8pVmGEees8-5Nd7nXQQ">
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2TvM1mGEees8-5Nd7nXQQ" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2TvNFmGEees8-5Nd7nXQQ" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2TvNVmGEees8-5Nd7nXQQ" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2TvNlmGEees8-5Nd7nXQQ" y="60"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_F2TvMVmGEees8-5Nd7nXQQ" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_F1xjuVmGEees8-5Nd7nXQQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_F2TvMlmGEees8-5Nd7nXQQ" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_F2UWQFmGEees8-5Nd7nXQQ" type="4001" source="_F1w8rlmGEees8-5Nd7nXQQ" target="_F1w8tVmGEees8-5Nd7nXQQ">
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2U9UlmGEees8-5Nd7nXQQ" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2U9U1mGEees8-5Nd7nXQQ" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2U9VFmGEees8-5Nd7nXQQ" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2U9VVmGEees8-5Nd7nXQQ" x="-1" y="19"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_F2U9UFmGEees8-5Nd7nXQQ" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_F1xjulmGEees8-5Nd7nXQQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_F2U9UVmGEees8-5Nd7nXQQ" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_F2XZkFmGEees8-5Nd7nXQQ" type="4001" source="_F1w8tVmGEees8-5Nd7nXQQ" target="_F1w8w1mGEees8-5Nd7nXQQ">
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2YAoFmGEees8-5Nd7nXQQ" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2YAoVmGEees8-5Nd7nXQQ" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2YAolmGEees8-5Nd7nXQQ" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2YAo1mGEees8-5Nd7nXQQ" y="60"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_F2XZkVmGEees8-5Nd7nXQQ" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_F1xjvFmGEees8-5Nd7nXQQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_F2XZklmGEees8-5Nd7nXQQ" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_F2Z10FmGEees8-5Nd7nXQQ" type="4001" source="_F1w8w1mGEees8-5Nd7nXQQ" target="_F1w8pVmGEees8-5Nd7nXQQ">
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2Z101mGEees8-5Nd7nXQQ" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2Z11FmGEees8-5Nd7nXQQ" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_F2ac4FmGEees8-5Nd7nXQQ" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_F2ac4VmGEees8-5Nd7nXQQ" y="60"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_F2Z10VmGEees8-5Nd7nXQQ" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_F1xjvlmGEees8-5Nd7nXQQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_F2Z10lmGEees8-5Nd7nXQQ" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_GESyIFnZEeeEtNdqy6ndzw" type="4001" source="_DIvVsFmGEees8-5Nd7nXQQ" target="_Fp_bwFnZEeeEtNdqy6ndzw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_GESyI1nZEeeEtNdqy6ndzw" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_GESyJFnZEeeEtNdqy6ndzw" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_GESyJVnZEeeEtNdqy6ndzw" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_GETZMFnZEeeEtNdqy6ndzw" y="60"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_GESyIVnZEeeEtNdqy6ndzw" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_GERkAFnZEeeEtNdqy6ndzw"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_GESyIlnZEeeEtNdqy6ndzw" points="[-11, 21, 54, -106]$[-67, 148, -2, 21]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_GUjbsFnZEeeEtNdqy6ndzw" type="4001" source="_CV9N4FmGEees8-5Nd7nXQQ" target="_FFzJkFnZEeeEtNdqy6ndzw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_GUjbs1nZEeeEtNdqy6ndzw" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_GUjbtFnZEeeEtNdqy6ndzw" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_GUjbtVnZEeeEtNdqy6ndzw" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_GUjbtlnZEeeEtNdqy6ndzw" y="60"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_GUjbsVnZEeeEtNdqy6ndzw" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_GUiNkFnZEeeEtNdqy6ndzw"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_GUjbslnZEeeEtNdqy6ndzw" points="[5, 21, -36, -127]$[39, 169, -2, 21]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_OehzgFnZEeeEtNdqy6ndzw" type="4001" source="_FFzJkFnZEeeEtNdqy6ndzw" target="_3ZAYJVmFEees8-5Nd7nXQQ">
+    <children xmi:type="notation:DecorationNode" xmi:id="_Oehzg1nZEeeEtNdqy6ndzw" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_OeiakFnZEeeEtNdqy6ndzw" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_OeiakVnZEeeEtNdqy6ndzw" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_OeiaklnZEeeEtNdqy6ndzw" y="60"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_OehzgVnZEeeEtNdqy6ndzw" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_OefXQFnZEeeEtNdqy6ndzw"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_OehzglnZEeeEtNdqy6ndzw" points="[13, -21, -84, 118]$[55, -114, -42, 25]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_Ou81IFnZEeeEtNdqy6ndzw" type="4001" source="_Fp_bwFnZEeeEtNdqy6ndzw" target="_3ZAYJVmFEees8-5Nd7nXQQ">
+    <children xmi:type="notation:DecorationNode" xmi:id="_Ou9cMlnZEeeEtNdqy6ndzw" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Ou9cM1nZEeeEtNdqy6ndzw" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_Ou9cNFnZEeeEtNdqy6ndzw" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_Ou9cNVnZEeeEtNdqy6ndzw" y="60"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_Ou9cMFnZEeeEtNdqy6ndzw" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_Ou8OEFnZEeeEtNdqy6ndzw"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Ou9cMVnZEeeEtNdqy6ndzw" points="[-14, -21, 74, 107]$[-45, -118, 43, 10]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_wprs4FnnEee0OeYFJsTIMw" type="4001" source="_-Zcm8FmDEeebw7-btdPZcw" target="_DHJpAFmAEeeQ9__4QSHnog">
+    <children xmi:type="notation:DecorationNode" xmi:id="_wptiEFnnEee0OeYFJsTIMw" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_wptiEVnnEee0OeYFJsTIMw" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_wpuJIFnnEee0OeYFJsTIMw" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_wpuJIVnnEee0OeYFJsTIMw" y="60"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_wpsT8FnnEee0OeYFJsTIMw" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#__yMikFmDEeebw7-btdPZcw"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_wpsT8VnnEee0OeYFJsTIMw" points="[-37, 21, 104, -58]$[-98, 55, 43, -24]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_wpv-UFnnEee0OeYFJsTIMw" type="4001" source="_EeKfQFmAEeeQ9__4QSHnog" target="_GcEWYFmAEeeQ9__4QSHnog">
+    <children xmi:type="notation:DecorationNode" xmi:id="_wpwlYFnnEee0OeYFJsTIMw" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_wpwlYVnnEee0OeYFJsTIMw" x="-3" y="-37"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_wpwlYlnnEee0OeYFJsTIMw" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_wpwlY1nnEee0OeYFJsTIMw" x="4" y="-23"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_wpv-UVnnEee0OeYFJsTIMw" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_IutHYFmAEeeQ9__4QSHnog"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_wpv-UlnnEee0OeYFJsTIMw" points="[-35, -7, 106, 0]$[-102, 0, 39, 7]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_wpxzgFnnEee0OeYFJsTIMw" type="4001" source="_GcEWYFmAEeeQ9__4QSHnog" target="_DHJpAFmAEeeQ9__4QSHnog">
+    <children xmi:type="notation:DecorationNode" xmi:id="_wpxzg1nnEee0OeYFJsTIMw" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_wpyakFnnEee0OeYFJsTIMw" x="-6" y="-37"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_wpyakVnnEee0OeYFJsTIMw" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_wpyaklnnEee0OeYFJsTIMw" x="-5" y="-23"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_wpxzgVnnEee0OeYFJsTIMw" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_JFU3oFmAEeeQ9__4QSHnog"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_wpxzglnnEee0OeYFJsTIMw" points="[-39, 0, 100, 0]$[-96, 0, 43, 0]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_wpzosFnnEee0OeYFJsTIMw" type="4001" source="_-Zcm8FmDEeebw7-btdPZcw" target="_EeKfQFmAEeeQ9__4QSHnog">
+    <children xmi:type="notation:DecorationNode" xmi:id="_wpzos1nnEee0OeYFJsTIMw" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_wpzotFnnEee0OeYFJsTIMw" x="27" y="-58"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_wp0PwFnnEee0OeYFJsTIMw" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_wp0PwVnnEee0OeYFJsTIMw" x="17" y="-74"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_wpzosVnnEee0OeYFJsTIMw" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_AAgrYFmEEeebw7-btdPZcw"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_wpzoslnnEee0OeYFJsTIMw" points="[34, 21, -105, -65]$[104, 64, -35, -22]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_wp1d4FnnEee0OeYFJsTIMw" type="4001" source="_GcEWYFmAEeeQ9__4QSHnog" target="_jROpkFndEee2EOxxkU-5OQ">
+    <children xmi:type="notation:DecorationNode" xmi:id="_wp2E8FnnEee0OeYFJsTIMw" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_wp2E8VnnEee0OeYFJsTIMw" x="-4" y="-82"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_wp2E8lnnEee0OeYFJsTIMw" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_wp2E81nnEee0OeYFJsTIMw" x="-15" y="-72"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_wp1d4VnnEee0OeYFJsTIMw" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_mshrwFndEee2EOxxkU-5OQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_wp1d4lnnEee0OeYFJsTIMw" points="[-15, 24, 40, -63]$[-41, 64, 14, -23]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_wp2sAFnnEee0OeYFJsTIMw" type="4001" source="_jROpkFndEee2EOxxkU-5OQ" target="_DHJpAFmAEeeQ9__4QSHnog">
+    <children xmi:type="notation:DecorationNode" xmi:id="_wp3TEFnnEee0OeYFJsTIMw" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_wp3TEVnnEee0OeYFJsTIMw" x="12" y="-50"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_wp3TElnnEee0OeYFJsTIMw" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_wp3TE1nnEee0OeYFJsTIMw" x="26" y="-29"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_wp2sAVnnEee0OeYFJsTIMw" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_nKPigFndEee2EOxxkU-5OQ"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_wp2sAlnnEee0OeYFJsTIMw" points="[-23, -23, 61, 64]$[-60, -62, 24, 25]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_wp4hMFnnEee0OeYFJsTIMw" type="4001" source="_woEja1nnEee0OeYFJsTIMw" target="_woEjVFnnEee0OeYFJsTIMw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_wp5IQFnnEee0OeYFJsTIMw" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_wp5IQVnnEee0OeYFJsTIMw" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_wp5IQlnnEee0OeYFJsTIMw" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_wp5IQ1nnEee0OeYFJsTIMw" y="60"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_wp4hMVnnEee0OeYFJsTIMw" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_woG_lVnnEee0OeYFJsTIMw"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_wp4hMlnnEee0OeYFJsTIMw" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_wp7kgFnnEee0OeYFJsTIMw" type="4001" source="_woEjZFnnEee0OeYFJsTIMw" target="_woEjVFnnEee0OeYFJsTIMw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_wp8LkFnnEee0OeYFJsTIMw" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_wp8LkVnnEee0OeYFJsTIMw" y="40"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_wp8LklnnEee0OeYFJsTIMw" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_wp8Lk1nnEee0OeYFJsTIMw" y="60"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_wp7kgVnnEee0OeYFJsTIMw" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_woG_oVnnEee0OeYFJsTIMw"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_wp7kglnnEee0OeYFJsTIMw" points="[0, 0, 0, 0]$[0, 0, 0, 0]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_01ipUFnnEee0OeYFJsTIMw" type="4001" source="_0xJ4kFnnEee0OeYFJsTIMw" target="_woEjZFnnEee0OeYFJsTIMw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_01jQYFnnEee0OeYFJsTIMw" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_01jQYVnnEee0OeYFJsTIMw" x="-18" y="-66"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_01jQYlnnEee0OeYFJsTIMw" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_01jQY1nnEee0OeYFJsTIMw" x="-35" y="-40"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_01ipUVnnEee0OeYFJsTIMw" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_woG_oFnnEee0OeYFJsTIMw"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_01ipUlnnEee0OeYFJsTIMw" points="[-24, -6, 69, 15]$[-54, -12, 39, 9]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_02UFYFnnEee0OeYFJsTIMw" type="4001" source="_woEjZFnnEee0OeYFJsTIMw" target="_0xLGsFnnEee0OeYFJsTIMw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_02UscFnnEee0OeYFJsTIMw" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_02UscVnnEee0OeYFJsTIMw" x="-9" y="-82"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_02UsclnnEee0OeYFJsTIMw" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_02Usc1nnEee0OeYFJsTIMw" x="-8" y="-41"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_02UFYVnnEee0OeYFJsTIMw" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_woG_pFnnEee0OeYFJsTIMw"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_02UFYlnnEee0OeYFJsTIMw" points="[39, 10, -84, -21]$[79, 20, -44, -11]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_6IdUcFnnEee0OeYFJsTIMw" type="4001" source="_0xLGsFnnEee0OeYFJsTIMw" target="_woEjVFnnEee0OeYFJsTIMw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_6IdUc1nnEee0OeYFJsTIMw" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_6IdUdFnnEee0OeYFJsTIMw" x="17" y="-30"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_6IdUdVnnEee0OeYFJsTIMw" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_6IdUdlnnEee0OeYFJsTIMw" x="37" y="-39"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_6IdUcVnnEee0OeYFJsTIMw" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_6IaRIFnnEee0OeYFJsTIMw"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_6IdUclnnEee0OeYFJsTIMw" points="[-27, -23, 59, 70]$[-128, -84, -42, 9]"/>
+  </edges>
+  <edges xmi:type="notation:Connector" xmi:id="_AsuyYFnrEee0OeYFJsTIMw" type="4001" source="_woEja1nnEee0OeYFJsTIMw" target="_0xJ4kFnnEee0OeYFJsTIMw">
+    <children xmi:type="notation:DecorationNode" xmi:id="_AsvZcFnrEee0OeYFJsTIMw" type="6001">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_AsvZcVnrEee0OeYFJsTIMw" x="-1" y="-21"/>
+    </children>
+    <children xmi:type="notation:DecorationNode" xmi:id="_AswAgFnrEee0OeYFJsTIMw" type="6002">
+      <layoutConstraint xmi:type="notation:Location" xmi:id="_AswAgVnrEee0OeYFJsTIMw" x="-2" y="-42"/>
+    </children>
+    <styles xmi:type="notation:FontStyle" xmi:id="_AsuyYVnrEee0OeYFJsTIMw" fontName="Segoe UI"/>
+    <element xmi:type="henshin:Edge" href="checkDangling.henshin#_AsrvEFnrEee0OeYFJsTIMw"/>
+    <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_AsuyYlnrEee0OeYFJsTIMw" points="[40, 21, -92, -61]$[177, 78, 45, -4]"/>
+  </edges>
+</notation:Diagram>
diff --git a/plugins/org.eclipse.emf.henshin.tests/src/org/eclipse/emf/henshin/tests/basic/DanglingTest.java b/plugins/org.eclipse.emf.henshin.tests/src/org/eclipse/emf/henshin/tests/basic/DanglingTest.java
new file mode 100644
index 0000000..94ec105
--- /dev/null
+++ b/plugins/org.eclipse.emf.henshin.tests/src/org/eclipse/emf/henshin/tests/basic/DanglingTest.java
@@ -0,0 +1,47 @@
+package org.eclipse.emf.henshin.tests.basic;
+
+import static org.junit.Assert.*;
+
+import org.eclipse.emf.henshin.tests.framework.HenshinTest;
+import org.eclipse.emf.henshin.tests.framework.Rules;
+import org.junit.Before;
+import org.junit.Test;
+
+public class DanglingTest extends HenshinTest {
+	@Before
+	public void setUp() throws Exception {
+		init("basic/rules/checkDangling.henshin");
+		setEGraphPath("basic/models/checkDanglingModels/", "ecore");
+		loadEGraph("graphWithTwoReferences");
+	}
+
+	@Test
+	public void testMulti() {
+		loadRule("deleteClassCMulti");
+		Rules.assertRuleCanBeApplied(htRuleApp);
+		assertEquals(3, htEGraph.size());
+	}
+	
+
+	@Test
+	public void testMulti2Level() {
+		loadRule("deleteClassCMulti2Level");
+		Rules.assertRuleCanBeApplied(htRuleApp);
+		assertEquals(3, htEGraph.size());
+	}
+
+	@Test
+	public void testTwoEdges() {
+		loadRule("deleteClassCTwoEdges");
+		Rules.assertRuleCanBeApplied(htRuleApp);
+		assertEquals(3, htEGraph.size());
+	}
+	
+
+	@Test
+	public void testOneEdge() {
+		loadRule("deleteClassCOneEdge");
+		Rules.assertRuleCannotBeApplied(htRuleApp);
+		assertEquals(8, htEGraph.size());
+	}
+}
diff --git a/plugins/org.eclipse.emf.henshin.tests/src/org/eclipse/emf/henshin/tests/framework/Rules.java b/plugins/org.eclipse.emf.henshin.tests/src/org/eclipse/emf/henshin/tests/framework/Rules.java
index b3bae13..38d6de8 100644
--- a/plugins/org.eclipse.emf.henshin.tests/src/org/eclipse/emf/henshin/tests/framework/Rules.java
+++ b/plugins/org.eclipse.emf.henshin.tests/src/org/eclipse/emf/henshin/tests/framework/Rules.java
@@ -160,4 +160,11 @@
 			throw new AssertionError("expected: Rule " + ra.getRule().getName() + " can be applied.");
 		}
 	}
+	
+
+	public static void assertRuleCannotBeApplied(RuleApplication ra) throws AssertionError {
+		if (ra.execute(null)) {
+			throw new AssertionError("expected: Rule " + ra.getRule().getName() + " cannot be applied.");
+		}
+	}
 }