// This file has been generated automatically by GrGen (www.grgen.net)
// Do not modify this file! Any changes will be lost!
// Generated from "..\..\tests\alternatives\Alternatives.grg" on Mon Nov 18 19:45:09 CET 2024

//#pragma warning disable CS0219, CS0162
#pragma warning disable 219, 162

using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Threading;
using System.Diagnostics;
using GRGEN_LIBGR = de.unika.ipd.grGen.libGr;
using GRGEN_LGSP = de.unika.ipd.grGen.lgsp;
using GRGEN_EXPR = de.unika.ipd.grGen.expression;
using GRGEN_MODEL = de.unika.ipd.grGen.Model_Alternatives;
using GRGEN_ACTIONS = de.unika.ipd.grGen.Action_Alternatives;

namespace de.unika.ipd.grGen.Action_Alternatives
{
	public class Pattern_toAorB : GRGEN_LGSP.LGSPMatchingPattern
	{
		private static Pattern_toAorB instance = null;
		public static Pattern_toAorB Instance { get { if(instance==null) { instance = new Pattern_toAorB(); instance.initialize(); } return instance; } }

		public static GRGEN_LIBGR.NodeType[] toAorB_node_x_AllowedTypes = null;
		public static bool[] toAorB_node_x_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] toAorB_edge_y_AllowedTypes = null;
		public static bool[] toAorB_edge_y_IsAllowedType = null;
		public enum toAorB_NodeNums { @x, };
		public enum toAorB_EdgeNums { @y, };
		public enum toAorB_VariableNums { };
		public enum toAorB_SubNums { };
		public enum toAorB_AltNums { @alt_0, };
		public enum toAorB_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_toAorB;

		public enum toAorB_alt_0_CaseNums { @toA, @toB, };
		public static GRGEN_LIBGR.NodeType[] toAorB_alt_0_toA_node_a_AllowedTypes = null;
		public static bool[] toAorB_alt_0_toA_node_a_IsAllowedType = null;
		public enum toAorB_alt_0_toA_NodeNums { @a, };
		public enum toAorB_alt_0_toA_EdgeNums { @y, };
		public enum toAorB_alt_0_toA_VariableNums { };
		public enum toAorB_alt_0_toA_SubNums { };
		public enum toAorB_alt_0_toA_AltNums { };
		public enum toAorB_alt_0_toA_IterNums { };



		public GRGEN_LGSP.PatternGraph toAorB_alt_0_toA;

		public static GRGEN_LIBGR.NodeType[] toAorB_alt_0_toB_node_b_AllowedTypes = null;
		public static bool[] toAorB_alt_0_toB_node_b_IsAllowedType = null;
		public enum toAorB_alt_0_toB_NodeNums { @b, };
		public enum toAorB_alt_0_toB_EdgeNums { @y, };
		public enum toAorB_alt_0_toB_VariableNums { };
		public enum toAorB_alt_0_toB_SubNums { };
		public enum toAorB_alt_0_toB_AltNums { };
		public enum toAorB_alt_0_toB_IterNums { };



		public GRGEN_LGSP.PatternGraph toAorB_alt_0_toB;


		private Pattern_toAorB()
			: base("toAorB",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "toAorB_node_x", },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { }
			)
		{
		}
		private void initialize()
		{
			bool[,] toAorB_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] toAorB_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] toAorB_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] toAorB_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode toAorB_node_x = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "toAorB_node_x", "x", toAorB_node_x_AllowedTypes, toAorB_node_x_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge toAorB_edge_y = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "toAorB_edge_y", "y", toAorB_edge_y_AllowedTypes, toAorB_edge_y_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			bool[,] toAorB_alt_0_toA_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] toAorB_alt_0_toA_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] toAorB_alt_0_toA_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] toAorB_alt_0_toA_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode toAorB_alt_0_toA_node_a = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@A, GRGEN_MODEL.NodeType_A.typeVar, "GRGEN_MODEL.IA", "toAorB_alt_0_toA_node_a", "a", toAorB_alt_0_toA_node_a_AllowedTypes, toAorB_alt_0_toA_node_a_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			toAorB_alt_0_toA = new GRGEN_LGSP.PatternGraph(
				"toA",
				"toAorB_alt_0_",
				null, "toA",
				false, false,
				new GRGEN_LGSP.PatternNode[] { toAorB_alt_0_toA_node_a }, 
				new GRGEN_LGSP.PatternEdge[] { toAorB_edge_y }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[1, 1] {
					{ true, },
				},
				toAorB_alt_0_toA_isNodeHomomorphicGlobal,
				toAorB_alt_0_toA_isEdgeHomomorphicGlobal,
				toAorB_alt_0_toA_isNodeTotallyHomomorphic,
				toAorB_alt_0_toA_isEdgeTotallyHomomorphic
			);
			toAorB_alt_0_toA.edgeToTargetNode.Add(toAorB_edge_y, toAorB_alt_0_toA_node_a);

			bool[,] toAorB_alt_0_toB_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] toAorB_alt_0_toB_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] toAorB_alt_0_toB_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] toAorB_alt_0_toB_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode toAorB_alt_0_toB_node_b = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@B, GRGEN_MODEL.NodeType_B.typeVar, "GRGEN_MODEL.IB", "toAorB_alt_0_toB_node_b", "b", toAorB_alt_0_toB_node_b_AllowedTypes, toAorB_alt_0_toB_node_b_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			toAorB_alt_0_toB = new GRGEN_LGSP.PatternGraph(
				"toB",
				"toAorB_alt_0_",
				null, "toB",
				false, false,
				new GRGEN_LGSP.PatternNode[] { toAorB_alt_0_toB_node_b }, 
				new GRGEN_LGSP.PatternEdge[] { toAorB_edge_y }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[1, 1] {
					{ true, },
				},
				toAorB_alt_0_toB_isNodeHomomorphicGlobal,
				toAorB_alt_0_toB_isEdgeHomomorphicGlobal,
				toAorB_alt_0_toB_isNodeTotallyHomomorphic,
				toAorB_alt_0_toB_isEdgeTotallyHomomorphic
			);
			toAorB_alt_0_toB.edgeToTargetNode.Add(toAorB_edge_y, toAorB_alt_0_toB_node_b);

			GRGEN_LGSP.Alternative toAorB_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "toAorB_", new GRGEN_LGSP.PatternGraph[] { toAorB_alt_0_toA, toAorB_alt_0_toB } );

			pat_toAorB = new GRGEN_LGSP.PatternGraph(
				"toAorB",
				"",
				null, "toAorB",
				false, false,
				new GRGEN_LGSP.PatternNode[] { toAorB_node_x }, 
				new GRGEN_LGSP.PatternEdge[] { toAorB_edge_y }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { toAorB_alt_0,  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[1, 1] {
					{ true, },
				},
				toAorB_isNodeHomomorphicGlobal,
				toAorB_isEdgeHomomorphicGlobal,
				toAorB_isNodeTotallyHomomorphic,
				toAorB_isEdgeTotallyHomomorphic
			);
			pat_toAorB.edgeToSourceNode.Add(toAorB_edge_y, toAorB_node_x);
			toAorB_alt_0_toA.embeddingGraph = pat_toAorB;
			toAorB_alt_0_toB.embeddingGraph = pat_toAorB;

			toAorB_node_x.pointOfDefinition = null;
			toAorB_edge_y.pointOfDefinition = pat_toAorB;
			toAorB_alt_0_toA_node_a.pointOfDefinition = toAorB_alt_0_toA;
			toAorB_alt_0_toB_node_b.pointOfDefinition = toAorB_alt_0_toB;

			patternGraph = pat_toAorB;
		}


		public void toAorB_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_toAorB curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPEdge edge_y = curMatch._edge_y;
			IMatch_toAorB_alt_0 alternative_alt_0 = curMatch._alt_0;
			graph.Remove(edge_y);
		}

		public void toAorB_alt_0_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, IMatch_toAorB_alt_0 curMatch)
		{
			if(curMatch.Pattern == toAorB_alt_0_toA) {
				toAorB_alt_0_toA_Delete(actionEnv, (Match_toAorB_alt_0_toA)curMatch);
				return;
			}
			else if(curMatch.Pattern == toAorB_alt_0_toB) {
				toAorB_alt_0_toB_Delete(actionEnv, (Match_toAorB_alt_0_toB)curMatch);
				return;
			}
			throw new ApplicationException(); //debug assert
		}

		public void toAorB_alt_0_toA_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_toAorB_alt_0_toA curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_a = curMatch._node_a;
			GRGEN_LGSP.LGSPEdge edge_y = curMatch._edge_y;
			graph.Remove(edge_y);
			graph.RemoveEdges(node_a);
			graph.Remove(node_a);
		}

		public void toAorB_alt_0_toB_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_toAorB_alt_0_toB curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_b = curMatch._node_b;
			GRGEN_LGSP.LGSPEdge edge_y = curMatch._edge_y;
			graph.Remove(edge_y);
			graph.RemoveEdges(node_b);
			graph.Remove(node_b);
		}

		static Pattern_toAorB() {
		}

		public interface IMatch_toAorB : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_LIBGR.INode node_x { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge_y { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			IMatch_toAorB_alt_0 alt_0 { get; }
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_toAorB_alt_0 : GRGEN_LIBGR.IMatch
		{
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_toAorB_alt_0_toA : IMatch_toAorB_alt_0
		{
			//Nodes
			GRGEN_MODEL.IA node_a { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge_y { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_toAorB_alt_0_toB : IMatch_toAorB_alt_0
		{
			//Nodes
			GRGEN_MODEL.IB node_b { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge_y { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_toAorB : GRGEN_LGSP.MatchListElement<Match_toAorB>, IMatch_toAorB
		{
			public GRGEN_LIBGR.INode node_x { get { return (GRGEN_LIBGR.INode)_node_x; } set { _node_x = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_x;
			public enum toAorB_NodeNums { @x, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 1; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)toAorB_NodeNums.@x: return _node_x;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "x": return _node_x;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "x": _node_x = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge_y { get { return (GRGEN_LIBGR.IDEdge)_edge_y; } set { _edge_y = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge_y;
			public enum toAorB_EdgeNums { @y, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 1; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)toAorB_EdgeNums.@y: return _edge_y;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "y": return _edge_y;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "y": _edge_y = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum toAorB_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum toAorB_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public IMatch_toAorB_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_toAorB_alt_0 _alt_0;
			public enum toAorB_AltNums { @alt_0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 1; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				case (int)toAorB_AltNums.@alt_0: return _alt_0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				case "alt_0": return _alt_0;
				default: return null;
				}
			}

			public enum toAorB_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum toAorB_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Pattern_toAorB.instance.pat_toAorB; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_toAorB(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_toAorB(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_toAorB nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_toAorB cur = this;
				while(cur != null) {
					Match_toAorB next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_toAorB that)
			{
				_node_x = that._node_x;
				_edge_y = that._edge_y;
				_alt_0 = that._alt_0;
			}

			public Match_toAorB(Match_toAorB that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_toAorB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_x = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_x];
				_edge_y = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge_y];
				if(that._alt_0 is Match_toAorB_alt_0_toA)
					_alt_0 = new Match_toAorB_alt_0_toA((Match_toAorB_alt_0_toA)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_toAorB_alt_0_toB)
					_alt_0 = new Match_toAorB_alt_0_toB((Match_toAorB_alt_0_toB)that._alt_0, oldToNewMap);
			}

			public Match_toAorB(Match_toAorB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_toAorB()
			{
			}

			public bool IsEqual(Match_toAorB that)
			{
				if(that==null) return false;
				if(_node_x != that._node_x) return false;
				if(_edge_y != that._edge_y) return false;
				if(_alt_0 is Match_toAorB_alt_0_toA && !(_alt_0 as Match_toAorB_alt_0_toA).IsEqual(that._alt_0 as Match_toAorB_alt_0_toA)) return false;
				if(_alt_0 is Match_toAorB_alt_0_toB && !(_alt_0 as Match_toAorB_alt_0_toB).IsEqual(that._alt_0 as Match_toAorB_alt_0_toB)) return false;
				return true;
			}
		}

		public class Match_toAorB_alt_0_toA : GRGEN_LGSP.MatchListElement<Match_toAorB_alt_0_toA>, IMatch_toAorB_alt_0_toA
		{
			public GRGEN_MODEL.IA node_a { get { return (GRGEN_MODEL.IA)_node_a; } set { _node_a = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_a;
			public enum toAorB_alt_0_toA_NodeNums { @a, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 1; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)toAorB_alt_0_toA_NodeNums.@a: return _node_a;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "a": return _node_a;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "a": _node_a = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge_y { get { return (GRGEN_LIBGR.IDEdge)_edge_y; } set { _edge_y = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge_y;
			public enum toAorB_alt_0_toA_EdgeNums { @y, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 1; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)toAorB_alt_0_toA_EdgeNums.@y: return _edge_y;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "y": return _edge_y;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "y": _edge_y = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum toAorB_alt_0_toA_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum toAorB_alt_0_toA_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum toAorB_alt_0_toA_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum toAorB_alt_0_toA_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum toAorB_alt_0_toA_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Pattern_toAorB.instance.toAorB_alt_0_toA; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_toAorB_alt_0_toA(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_toAorB_alt_0_toA(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_toAorB_alt_0_toA nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_toAorB_alt_0_toA cur = this;
				while(cur != null) {
					Match_toAorB_alt_0_toA next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_toAorB_alt_0_toA that)
			{
				_node_a = that._node_a;
				_edge_y = that._edge_y;
			}

			public Match_toAorB_alt_0_toA(Match_toAorB_alt_0_toA that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_toAorB_alt_0_toA that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_a = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_a];
				_edge_y = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge_y];
			}

			public Match_toAorB_alt_0_toA(Match_toAorB_alt_0_toA that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_toAorB_alt_0_toA()
			{
			}

			public bool IsEqual(Match_toAorB_alt_0_toA that)
			{
				if(that==null) return false;
				if(_node_a != that._node_a) return false;
				if(_edge_y != that._edge_y) return false;
				return true;
			}
		}

		public class Match_toAorB_alt_0_toB : GRGEN_LGSP.MatchListElement<Match_toAorB_alt_0_toB>, IMatch_toAorB_alt_0_toB
		{
			public GRGEN_MODEL.IB node_b { get { return (GRGEN_MODEL.IB)_node_b; } set { _node_b = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_b;
			public enum toAorB_alt_0_toB_NodeNums { @b, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 1; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)toAorB_alt_0_toB_NodeNums.@b: return _node_b;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "b": return _node_b;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "b": _node_b = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge_y { get { return (GRGEN_LIBGR.IDEdge)_edge_y; } set { _edge_y = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge_y;
			public enum toAorB_alt_0_toB_EdgeNums { @y, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 1; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)toAorB_alt_0_toB_EdgeNums.@y: return _edge_y;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "y": return _edge_y;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "y": _edge_y = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum toAorB_alt_0_toB_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum toAorB_alt_0_toB_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum toAorB_alt_0_toB_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum toAorB_alt_0_toB_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum toAorB_alt_0_toB_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Pattern_toAorB.instance.toAorB_alt_0_toB; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_toAorB_alt_0_toB(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_toAorB_alt_0_toB(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_toAorB_alt_0_toB nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_toAorB_alt_0_toB cur = this;
				while(cur != null) {
					Match_toAorB_alt_0_toB next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_toAorB_alt_0_toB that)
			{
				_node_b = that._node_b;
				_edge_y = that._edge_y;
			}

			public Match_toAorB_alt_0_toB(Match_toAorB_alt_0_toB that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_toAorB_alt_0_toB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_b = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b];
				_edge_y = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge_y];
			}

			public Match_toAorB_alt_0_toB(Match_toAorB_alt_0_toB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_toAorB_alt_0_toB()
			{
			}

			public bool IsEqual(Match_toAorB_alt_0_toB that)
			{
				if(that==null) return false;
				if(_node_b != that._node_b) return false;
				if(_edge_y != that._edge_y) return false;
				return true;
			}
		}

	}


	public class Rule_createA : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_createA instance = null;
		public static Rule_createA Instance { get { if(instance==null) { instance = new Rule_createA(); instance.initialize(); } return instance; } }

		public enum createA_NodeNums { };
		public enum createA_EdgeNums { };
		public enum createA_VariableNums { };
		public enum createA_SubNums { };
		public enum createA_AltNums { };
		public enum createA_IterNums { };





		public GRGEN_LGSP.PatternGraph pat_createA;


		private Rule_createA()
			: base("createA",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_createA+IMatch_createA",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_createA+Match_createA"
			)
		{
		}
		private void initialize()
		{
			bool[,] createA_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] createA_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] createA_isNodeTotallyHomomorphic = new bool[0];
			bool[] createA_isEdgeTotallyHomomorphic = new bool[0];
			pat_createA = new GRGEN_LGSP.PatternGraph(
				"createA",
				"",
				null, "createA",
				false, false,
				new GRGEN_LGSP.PatternNode[] {  }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[0, 0] ,
				new bool[0, 0] ,
				createA_isNodeHomomorphicGlobal,
				createA_isEdgeHomomorphicGlobal,
				createA_isNodeTotallyHomomorphic,
				createA_isEdgeTotallyHomomorphic
			);


			patternGraph = pat_createA;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_createA curMatch = (Match_createA)_curMatch;
			graph.SettingAddedNodeNames( createA_addedNodeNames );
			GRGEN_MODEL.@A node__node0 = GRGEN_MODEL.@A.CreateNode(graph);
			graph.SettingAddedEdgeNames( createA_addedEdgeNames );
			actionEnv.SelectedMatchRewritten();
			return;
		}
		private static string[] createA_addedNodeNames = new string[] { "_node0" };
		private static string[] createA_addedEdgeNames = new string[] {  };

		static Rule_createA() {
		}

		public interface IMatch_createA : GRGEN_LIBGR.IMatch
		{
			//Nodes
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_createA : GRGEN_LGSP.MatchListElement<Match_createA>, IMatch_createA
		{
			public enum createA_NodeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 0; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createA_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createA_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createA_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createA_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createA_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createA_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_createA.instance.pat_createA; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_createA(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_createA(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_createA nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_createA cur = this;
				while(cur != null) {
					Match_createA next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_createA that)
			{
			}

			public Match_createA(Match_createA that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_createA that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
			}

			public Match_createA(Match_createA that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_createA()
			{
			}

			public bool IsEqual(Match_createA that)
			{
				if(that==null) return false;
				return true;
			}
		}


		public class Extractor
		{
		}


		public static List<GRGEN_ACTIONS.Rule_createA.IMatch_createA> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_createA.IMatch_createA>)
				return ((List<GRGEN_ACTIONS.Rule_createA.IMatch_createA>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_createA.IMatch_createA>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_createA.IMatch_createA instanceBearingAttributeForSearch_createA = new GRGEN_ACTIONS.Rule_createA.Match_createA();
	}

	public class Rule_createB : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_createB instance = null;
		public static Rule_createB Instance { get { if(instance==null) { instance = new Rule_createB(); instance.initialize(); } return instance; } }

		public enum createB_NodeNums { };
		public enum createB_EdgeNums { };
		public enum createB_VariableNums { };
		public enum createB_SubNums { };
		public enum createB_AltNums { };
		public enum createB_IterNums { };





		public GRGEN_LGSP.PatternGraph pat_createB;


		private Rule_createB()
			: base("createB",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_createB+IMatch_createB",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_createB+Match_createB"
			)
		{
		}
		private void initialize()
		{
			bool[,] createB_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] createB_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] createB_isNodeTotallyHomomorphic = new bool[0];
			bool[] createB_isEdgeTotallyHomomorphic = new bool[0];
			pat_createB = new GRGEN_LGSP.PatternGraph(
				"createB",
				"",
				null, "createB",
				false, false,
				new GRGEN_LGSP.PatternNode[] {  }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[0, 0] ,
				new bool[0, 0] ,
				createB_isNodeHomomorphicGlobal,
				createB_isEdgeHomomorphicGlobal,
				createB_isNodeTotallyHomomorphic,
				createB_isEdgeTotallyHomomorphic
			);


			patternGraph = pat_createB;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_createB curMatch = (Match_createB)_curMatch;
			graph.SettingAddedNodeNames( createB_addedNodeNames );
			GRGEN_MODEL.@B node__node0 = GRGEN_MODEL.@B.CreateNode(graph);
			graph.SettingAddedEdgeNames( createB_addedEdgeNames );
			actionEnv.SelectedMatchRewritten();
			return;
		}
		private static string[] createB_addedNodeNames = new string[] { "_node0" };
		private static string[] createB_addedEdgeNames = new string[] {  };

		static Rule_createB() {
		}

		public interface IMatch_createB : GRGEN_LIBGR.IMatch
		{
			//Nodes
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_createB : GRGEN_LGSP.MatchListElement<Match_createB>, IMatch_createB
		{
			public enum createB_NodeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 0; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createB_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createB_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createB_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createB_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createB_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createB_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_createB.instance.pat_createB; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_createB(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_createB(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_createB nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_createB cur = this;
				while(cur != null) {
					Match_createB next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_createB that)
			{
			}

			public Match_createB(Match_createB that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_createB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
			}

			public Match_createB(Match_createB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_createB()
			{
			}

			public bool IsEqual(Match_createB that)
			{
				if(that==null) return false;
				return true;
			}
		}


		public class Extractor
		{
		}


		public static List<GRGEN_ACTIONS.Rule_createB.IMatch_createB> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_createB.IMatch_createB>)
				return ((List<GRGEN_ACTIONS.Rule_createB.IMatch_createB>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_createB.IMatch_createB>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_createB.IMatch_createB instanceBearingAttributeForSearch_createB = new GRGEN_ACTIONS.Rule_createB.Match_createB();
	}

	public class Rule_createC : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_createC instance = null;
		public static Rule_createC Instance { get { if(instance==null) { instance = new Rule_createC(); instance.initialize(); } return instance; } }

		public enum createC_NodeNums { };
		public enum createC_EdgeNums { };
		public enum createC_VariableNums { };
		public enum createC_SubNums { };
		public enum createC_AltNums { };
		public enum createC_IterNums { };





		public GRGEN_LGSP.PatternGraph pat_createC;


		private Rule_createC()
			: base("createC",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_createC+IMatch_createC",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_createC+Match_createC"
			)
		{
		}
		private void initialize()
		{
			bool[,] createC_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] createC_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] createC_isNodeTotallyHomomorphic = new bool[0];
			bool[] createC_isEdgeTotallyHomomorphic = new bool[0];
			pat_createC = new GRGEN_LGSP.PatternGraph(
				"createC",
				"",
				null, "createC",
				false, false,
				new GRGEN_LGSP.PatternNode[] {  }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[0, 0] ,
				new bool[0, 0] ,
				createC_isNodeHomomorphicGlobal,
				createC_isEdgeHomomorphicGlobal,
				createC_isNodeTotallyHomomorphic,
				createC_isEdgeTotallyHomomorphic
			);


			patternGraph = pat_createC;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_createC curMatch = (Match_createC)_curMatch;
			graph.SettingAddedNodeNames( createC_addedNodeNames );
			GRGEN_MODEL.@C node__node0 = GRGEN_MODEL.@C.CreateNode(graph);
			graph.SettingAddedEdgeNames( createC_addedEdgeNames );
			actionEnv.SelectedMatchRewritten();
			return;
		}
		private static string[] createC_addedNodeNames = new string[] { "_node0" };
		private static string[] createC_addedEdgeNames = new string[] {  };

		static Rule_createC() {
		}

		public interface IMatch_createC : GRGEN_LIBGR.IMatch
		{
			//Nodes
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_createC : GRGEN_LGSP.MatchListElement<Match_createC>, IMatch_createC
		{
			public enum createC_NodeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 0; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createC_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createC_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createC_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createC_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createC_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createC_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_createC.instance.pat_createC; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_createC(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_createC(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_createC nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_createC cur = this;
				while(cur != null) {
					Match_createC next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_createC that)
			{
			}

			public Match_createC(Match_createC that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_createC that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
			}

			public Match_createC(Match_createC that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_createC()
			{
			}

			public bool IsEqual(Match_createC that)
			{
				if(that==null) return false;
				return true;
			}
		}


		public class Extractor
		{
		}


		public static List<GRGEN_ACTIONS.Rule_createC.IMatch_createC> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_createC.IMatch_createC>)
				return ((List<GRGEN_ACTIONS.Rule_createC.IMatch_createC>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_createC.IMatch_createC>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_createC.IMatch_createC instanceBearingAttributeForSearch_createC = new GRGEN_ACTIONS.Rule_createC.Match_createC();
	}

	public class Rule_createAtoB : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_createAtoB instance = null;
		public static Rule_createAtoB Instance { get { if(instance==null) { instance = new Rule_createAtoB(); instance.initialize(); } return instance; } }

		public enum createAtoB_NodeNums { };
		public enum createAtoB_EdgeNums { };
		public enum createAtoB_VariableNums { };
		public enum createAtoB_SubNums { };
		public enum createAtoB_AltNums { };
		public enum createAtoB_IterNums { };





		public GRGEN_LGSP.PatternGraph pat_createAtoB;


		private Rule_createAtoB()
			: base("createAtoB",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_createAtoB+IMatch_createAtoB",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_createAtoB+Match_createAtoB"
			)
		{
		}
		private void initialize()
		{
			bool[,] createAtoB_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] createAtoB_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] createAtoB_isNodeTotallyHomomorphic = new bool[0];
			bool[] createAtoB_isEdgeTotallyHomomorphic = new bool[0];
			pat_createAtoB = new GRGEN_LGSP.PatternGraph(
				"createAtoB",
				"",
				null, "createAtoB",
				false, false,
				new GRGEN_LGSP.PatternNode[] {  }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[0, 0] ,
				new bool[0, 0] ,
				createAtoB_isNodeHomomorphicGlobal,
				createAtoB_isEdgeHomomorphicGlobal,
				createAtoB_isNodeTotallyHomomorphic,
				createAtoB_isEdgeTotallyHomomorphic
			);


			patternGraph = pat_createAtoB;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_createAtoB curMatch = (Match_createAtoB)_curMatch;
			graph.SettingAddedNodeNames( createAtoB_addedNodeNames );
			GRGEN_MODEL.@A node__node0 = GRGEN_MODEL.@A.CreateNode(graph);
			GRGEN_MODEL.@B node__node1 = GRGEN_MODEL.@B.CreateNode(graph);
			graph.SettingAddedEdgeNames( createAtoB_addedEdgeNames );
			GRGEN_MODEL.@Edge edge__edge0 = GRGEN_MODEL.@Edge.CreateEdge(graph, node__node0, node__node1);
			actionEnv.SelectedMatchRewritten();
			return;
		}
		private static string[] createAtoB_addedNodeNames = new string[] { "_node0", "_node1" };
		private static string[] createAtoB_addedEdgeNames = new string[] { "_edge0" };

		static Rule_createAtoB() {
		}

		public interface IMatch_createAtoB : GRGEN_LIBGR.IMatch
		{
			//Nodes
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_createAtoB : GRGEN_LGSP.MatchListElement<Match_createAtoB>, IMatch_createAtoB
		{
			public enum createAtoB_NodeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 0; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createAtoB_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createAtoB_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createAtoB_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createAtoB_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createAtoB_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createAtoB_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_createAtoB.instance.pat_createAtoB; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_createAtoB(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_createAtoB(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_createAtoB nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_createAtoB cur = this;
				while(cur != null) {
					Match_createAtoB next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_createAtoB that)
			{
			}

			public Match_createAtoB(Match_createAtoB that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_createAtoB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
			}

			public Match_createAtoB(Match_createAtoB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_createAtoB()
			{
			}

			public bool IsEqual(Match_createAtoB that)
			{
				if(that==null) return false;
				return true;
			}
		}


		public class Extractor
		{
		}


		public static List<GRGEN_ACTIONS.Rule_createAtoB.IMatch_createAtoB> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_createAtoB.IMatch_createAtoB>)
				return ((List<GRGEN_ACTIONS.Rule_createAtoB.IMatch_createAtoB>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_createAtoB.IMatch_createAtoB>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_createAtoB.IMatch_createAtoB instanceBearingAttributeForSearch_createAtoB = new GRGEN_ACTIONS.Rule_createAtoB.Match_createAtoB();
	}

	public class Rule_leer : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_leer instance = null;
		public static Rule_leer Instance { get { if(instance==null) { instance = new Rule_leer(); instance.initialize(); } return instance; } }

		public enum leer_NodeNums { };
		public enum leer_EdgeNums { };
		public enum leer_VariableNums { };
		public enum leer_SubNums { };
		public enum leer_AltNums { @alt_0, };
		public enum leer_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_leer;

		public enum leer_alt_0_CaseNums { @altleer, };
		public enum leer_alt_0_altleer_NodeNums { };
		public enum leer_alt_0_altleer_EdgeNums { };
		public enum leer_alt_0_altleer_VariableNums { };
		public enum leer_alt_0_altleer_SubNums { };
		public enum leer_alt_0_altleer_AltNums { };
		public enum leer_alt_0_altleer_IterNums { };



		public GRGEN_LGSP.PatternGraph leer_alt_0_altleer;


		private Rule_leer()
			: base("leer",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_leer+IMatch_leer",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_leer+Match_leer"
			)
		{
		}
		private void initialize()
		{
			bool[,] leer_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] leer_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] leer_isNodeTotallyHomomorphic = new bool[0];
			bool[] leer_isEdgeTotallyHomomorphic = new bool[0];
			bool[,] leer_alt_0_altleer_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] leer_alt_0_altleer_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] leer_alt_0_altleer_isNodeTotallyHomomorphic = new bool[0];
			bool[] leer_alt_0_altleer_isEdgeTotallyHomomorphic = new bool[0];
			leer_alt_0_altleer = new GRGEN_LGSP.PatternGraph(
				"altleer",
				"leer_alt_0_",
				null, "altleer",
				false, false,
				new GRGEN_LGSP.PatternNode[] {  }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[0, 0] ,
				new bool[0, 0] ,
				leer_alt_0_altleer_isNodeHomomorphicGlobal,
				leer_alt_0_altleer_isEdgeHomomorphicGlobal,
				leer_alt_0_altleer_isNodeTotallyHomomorphic,
				leer_alt_0_altleer_isEdgeTotallyHomomorphic
			);

			GRGEN_LGSP.Alternative leer_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "leer_", new GRGEN_LGSP.PatternGraph[] { leer_alt_0_altleer } );

			pat_leer = new GRGEN_LGSP.PatternGraph(
				"leer",
				"",
				null, "leer",
				false, false,
				new GRGEN_LGSP.PatternNode[] {  }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { leer_alt_0,  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[0, 0] ,
				new bool[0, 0] ,
				leer_isNodeHomomorphicGlobal,
				leer_isEdgeHomomorphicGlobal,
				leer_isNodeTotallyHomomorphic,
				leer_isEdgeTotallyHomomorphic
			);
			leer_alt_0_altleer.embeddingGraph = pat_leer;


			patternGraph = pat_leer;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_leer curMatch = (Match_leer)_curMatch;
			IMatch_leer_alt_0 alternative_alt_0 = curMatch._alt_0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		public void leer_alt_0_altleer_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_leer_alt_0_altleer curMatch = (Match_leer_alt_0_altleer)_curMatch;
		}

		static Rule_leer() {
		}

		public interface IMatch_leer : GRGEN_LIBGR.IMatch
		{
			//Nodes
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			IMatch_leer_alt_0 alt_0 { get; }
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_leer_alt_0 : GRGEN_LIBGR.IMatch
		{
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_leer_alt_0_altleer : IMatch_leer_alt_0
		{
			//Nodes
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_leer : GRGEN_LGSP.MatchListElement<Match_leer>, IMatch_leer
		{
			public enum leer_NodeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 0; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum leer_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum leer_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum leer_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public IMatch_leer_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_leer_alt_0 _alt_0;
			public enum leer_AltNums { @alt_0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 1; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				case (int)leer_AltNums.@alt_0: return _alt_0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				case "alt_0": return _alt_0;
				default: return null;
				}
			}

			public enum leer_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum leer_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_leer.instance.pat_leer; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_leer(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_leer(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_leer nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_leer cur = this;
				while(cur != null) {
					Match_leer next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_leer that)
			{
				_alt_0 = that._alt_0;
			}

			public Match_leer(Match_leer that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_leer that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				if(that._alt_0 is Match_leer_alt_0_altleer)
					_alt_0 = new Match_leer_alt_0_altleer((Match_leer_alt_0_altleer)that._alt_0, oldToNewMap);
			}

			public Match_leer(Match_leer that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_leer()
			{
			}

			public bool IsEqual(Match_leer that)
			{
				if(that==null) return false;
				if(_alt_0 is Match_leer_alt_0_altleer && !(_alt_0 as Match_leer_alt_0_altleer).IsEqual(that._alt_0 as Match_leer_alt_0_altleer)) return false;
				return true;
			}
		}

		public class Match_leer_alt_0_altleer : GRGEN_LGSP.MatchListElement<Match_leer_alt_0_altleer>, IMatch_leer_alt_0_altleer
		{
			public enum leer_alt_0_altleer_NodeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 0; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum leer_alt_0_altleer_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum leer_alt_0_altleer_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum leer_alt_0_altleer_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum leer_alt_0_altleer_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum leer_alt_0_altleer_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum leer_alt_0_altleer_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_leer.instance.leer_alt_0_altleer; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_leer_alt_0_altleer(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_leer_alt_0_altleer(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_leer_alt_0_altleer nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_leer_alt_0_altleer cur = this;
				while(cur != null) {
					Match_leer_alt_0_altleer next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_leer_alt_0_altleer that)
			{
			}

			public Match_leer_alt_0_altleer(Match_leer_alt_0_altleer that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_leer_alt_0_altleer that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
			}

			public Match_leer_alt_0_altleer(Match_leer_alt_0_altleer that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_leer_alt_0_altleer()
			{
			}

			public bool IsEqual(Match_leer_alt_0_altleer that)
			{
				if(that==null) return false;
				return true;
			}
		}


		public class Extractor
		{
		}


		public static List<GRGEN_ACTIONS.Rule_leer.IMatch_leer> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_leer.IMatch_leer>)
				return ((List<GRGEN_ACTIONS.Rule_leer.IMatch_leer>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_leer.IMatch_leer>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_leer.IMatch_leer instanceBearingAttributeForSearch_leer = new GRGEN_ACTIONS.Rule_leer.Match_leer();
	}

	public class Rule_AorB : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_AorB instance = null;
		public static Rule_AorB Instance { get { if(instance==null) { instance = new Rule_AorB(); instance.initialize(); } return instance; } }

		public enum AorB_NodeNums { };
		public enum AorB_EdgeNums { };
		public enum AorB_VariableNums { };
		public enum AorB_SubNums { };
		public enum AorB_AltNums { @alt_0, };
		public enum AorB_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_AorB;

		public enum AorB_alt_0_CaseNums { @A, @B, };
		public static GRGEN_LIBGR.NodeType[] AorB_alt_0_A_node__node0_AllowedTypes = null;
		public static bool[] AorB_alt_0_A_node__node0_IsAllowedType = null;
		public enum AorB_alt_0_A_NodeNums { @_node0, };
		public enum AorB_alt_0_A_EdgeNums { };
		public enum AorB_alt_0_A_VariableNums { };
		public enum AorB_alt_0_A_SubNums { };
		public enum AorB_alt_0_A_AltNums { };
		public enum AorB_alt_0_A_IterNums { };



		public GRGEN_LGSP.PatternGraph AorB_alt_0_A;

		public static GRGEN_LIBGR.NodeType[] AorB_alt_0_B_node__node0_AllowedTypes = null;
		public static bool[] AorB_alt_0_B_node__node0_IsAllowedType = null;
		public enum AorB_alt_0_B_NodeNums { @_node0, };
		public enum AorB_alt_0_B_EdgeNums { };
		public enum AorB_alt_0_B_VariableNums { };
		public enum AorB_alt_0_B_SubNums { };
		public enum AorB_alt_0_B_AltNums { };
		public enum AorB_alt_0_B_IterNums { };



		public GRGEN_LGSP.PatternGraph AorB_alt_0_B;


		private Rule_AorB()
			: base("AorB",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_AorB+IMatch_AorB",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_AorB+Match_AorB"
			)
		{
		}
		private void initialize()
		{
			bool[,] AorB_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] AorB_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] AorB_isNodeTotallyHomomorphic = new bool[0];
			bool[] AorB_isEdgeTotallyHomomorphic = new bool[0];
			bool[,] AorB_alt_0_A_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] AorB_alt_0_A_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] AorB_alt_0_A_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] AorB_alt_0_A_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode AorB_alt_0_A_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@A, GRGEN_MODEL.NodeType_A.typeVar, "GRGEN_MODEL.IA", "AorB_alt_0_A_node__node0", "_node0", AorB_alt_0_A_node__node0_AllowedTypes, AorB_alt_0_A_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			AorB_alt_0_A = new GRGEN_LGSP.PatternGraph(
				"A",
				"AorB_alt_0_",
				null, "A",
				false, false,
				new GRGEN_LGSP.PatternNode[] { AorB_alt_0_A_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				AorB_alt_0_A_isNodeHomomorphicGlobal,
				AorB_alt_0_A_isEdgeHomomorphicGlobal,
				AorB_alt_0_A_isNodeTotallyHomomorphic,
				AorB_alt_0_A_isEdgeTotallyHomomorphic
			);

			bool[,] AorB_alt_0_B_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] AorB_alt_0_B_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] AorB_alt_0_B_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] AorB_alt_0_B_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode AorB_alt_0_B_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@B, GRGEN_MODEL.NodeType_B.typeVar, "GRGEN_MODEL.IB", "AorB_alt_0_B_node__node0", "_node0", AorB_alt_0_B_node__node0_AllowedTypes, AorB_alt_0_B_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			AorB_alt_0_B = new GRGEN_LGSP.PatternGraph(
				"B",
				"AorB_alt_0_",
				null, "B",
				false, false,
				new GRGEN_LGSP.PatternNode[] { AorB_alt_0_B_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				AorB_alt_0_B_isNodeHomomorphicGlobal,
				AorB_alt_0_B_isEdgeHomomorphicGlobal,
				AorB_alt_0_B_isNodeTotallyHomomorphic,
				AorB_alt_0_B_isEdgeTotallyHomomorphic
			);

			GRGEN_LGSP.Alternative AorB_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "AorB_", new GRGEN_LGSP.PatternGraph[] { AorB_alt_0_A, AorB_alt_0_B } );

			pat_AorB = new GRGEN_LGSP.PatternGraph(
				"AorB",
				"",
				null, "AorB",
				false, false,
				new GRGEN_LGSP.PatternNode[] {  }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { AorB_alt_0,  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[0, 0] ,
				new bool[0, 0] ,
				AorB_isNodeHomomorphicGlobal,
				AorB_isEdgeHomomorphicGlobal,
				AorB_isNodeTotallyHomomorphic,
				AorB_isEdgeTotallyHomomorphic
			);
			AorB_alt_0_A.embeddingGraph = pat_AorB;
			AorB_alt_0_B.embeddingGraph = pat_AorB;

			AorB_alt_0_A_node__node0.pointOfDefinition = AorB_alt_0_A;
			AorB_alt_0_B_node__node0.pointOfDefinition = AorB_alt_0_B;

			patternGraph = pat_AorB;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_AorB curMatch = (Match_AorB)_curMatch;
			IMatch_AorB_alt_0 alternative_alt_0 = curMatch._alt_0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		public void AorB_alt_0_A_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_AorB_alt_0_A curMatch = (Match_AorB_alt_0_A)_curMatch;
		}

		public void AorB_alt_0_B_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_AorB_alt_0_B curMatch = (Match_AorB_alt_0_B)_curMatch;
		}

		static Rule_AorB() {
		}

		public interface IMatch_AorB : GRGEN_LIBGR.IMatch
		{
			//Nodes
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			IMatch_AorB_alt_0 alt_0 { get; }
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_AorB_alt_0 : GRGEN_LIBGR.IMatch
		{
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_AorB_alt_0_A : IMatch_AorB_alt_0
		{
			//Nodes
			GRGEN_MODEL.IA node__node0 { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_AorB_alt_0_B : IMatch_AorB_alt_0
		{
			//Nodes
			GRGEN_MODEL.IB node__node0 { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_AorB : GRGEN_LGSP.MatchListElement<Match_AorB>, IMatch_AorB
		{
			public enum AorB_NodeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 0; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AorB_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AorB_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AorB_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public IMatch_AorB_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_AorB_alt_0 _alt_0;
			public enum AorB_AltNums { @alt_0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 1; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				case (int)AorB_AltNums.@alt_0: return _alt_0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				case "alt_0": return _alt_0;
				default: return null;
				}
			}

			public enum AorB_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorB_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_AorB.instance.pat_AorB; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_AorB(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_AorB(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_AorB nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_AorB cur = this;
				while(cur != null) {
					Match_AorB next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_AorB that)
			{
				_alt_0 = that._alt_0;
			}

			public Match_AorB(Match_AorB that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_AorB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				if(that._alt_0 is Match_AorB_alt_0_A)
					_alt_0 = new Match_AorB_alt_0_A((Match_AorB_alt_0_A)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_AorB_alt_0_B)
					_alt_0 = new Match_AorB_alt_0_B((Match_AorB_alt_0_B)that._alt_0, oldToNewMap);
			}

			public Match_AorB(Match_AorB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_AorB()
			{
			}

			public bool IsEqual(Match_AorB that)
			{
				if(that==null) return false;
				if(_alt_0 is Match_AorB_alt_0_A && !(_alt_0 as Match_AorB_alt_0_A).IsEqual(that._alt_0 as Match_AorB_alt_0_A)) return false;
				if(_alt_0 is Match_AorB_alt_0_B && !(_alt_0 as Match_AorB_alt_0_B).IsEqual(that._alt_0 as Match_AorB_alt_0_B)) return false;
				return true;
			}
		}

		public class Match_AorB_alt_0_A : GRGEN_LGSP.MatchListElement<Match_AorB_alt_0_A>, IMatch_AorB_alt_0_A
		{
			public GRGEN_MODEL.IA node__node0 { get { return (GRGEN_MODEL.IA)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum AorB_alt_0_A_NodeNums { @_node0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 1; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)AorB_alt_0_A_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum AorB_alt_0_A_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AorB_alt_0_A_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AorB_alt_0_A_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorB_alt_0_A_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorB_alt_0_A_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorB_alt_0_A_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_AorB.instance.AorB_alt_0_A; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_AorB_alt_0_A(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_AorB_alt_0_A(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_AorB_alt_0_A nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_AorB_alt_0_A cur = this;
				while(cur != null) {
					Match_AorB_alt_0_A next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_AorB_alt_0_A that)
			{
				_node__node0 = that._node__node0;
			}

			public Match_AorB_alt_0_A(Match_AorB_alt_0_A that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_AorB_alt_0_A that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
			}

			public Match_AorB_alt_0_A(Match_AorB_alt_0_A that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_AorB_alt_0_A()
			{
			}

			public bool IsEqual(Match_AorB_alt_0_A that)
			{
				if(that==null) return false;
				if(_node__node0 != that._node__node0) return false;
				return true;
			}
		}

		public class Match_AorB_alt_0_B : GRGEN_LGSP.MatchListElement<Match_AorB_alt_0_B>, IMatch_AorB_alt_0_B
		{
			public GRGEN_MODEL.IB node__node0 { get { return (GRGEN_MODEL.IB)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum AorB_alt_0_B_NodeNums { @_node0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 1; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)AorB_alt_0_B_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum AorB_alt_0_B_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AorB_alt_0_B_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AorB_alt_0_B_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorB_alt_0_B_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorB_alt_0_B_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorB_alt_0_B_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_AorB.instance.AorB_alt_0_B; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_AorB_alt_0_B(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_AorB_alt_0_B(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_AorB_alt_0_B nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_AorB_alt_0_B cur = this;
				while(cur != null) {
					Match_AorB_alt_0_B next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_AorB_alt_0_B that)
			{
				_node__node0 = that._node__node0;
			}

			public Match_AorB_alt_0_B(Match_AorB_alt_0_B that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_AorB_alt_0_B that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
			}

			public Match_AorB_alt_0_B(Match_AorB_alt_0_B that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_AorB_alt_0_B()
			{
			}

			public bool IsEqual(Match_AorB_alt_0_B that)
			{
				if(that==null) return false;
				if(_node__node0 != that._node__node0) return false;
				return true;
			}
		}


		public class Extractor
		{
		}


		public static List<GRGEN_ACTIONS.Rule_AorB.IMatch_AorB> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_AorB.IMatch_AorB>)
				return ((List<GRGEN_ACTIONS.Rule_AorB.IMatch_AorB>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_AorB.IMatch_AorB>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_AorB.IMatch_AorB instanceBearingAttributeForSearch_AorB = new GRGEN_ACTIONS.Rule_AorB.Match_AorB();
	}

	public class Rule_AandnotCorB : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_AandnotCorB instance = null;
		public static Rule_AandnotCorB Instance { get { if(instance==null) { instance = new Rule_AandnotCorB(); instance.initialize(); } return instance; } }

		public enum AandnotCorB_NodeNums { };
		public enum AandnotCorB_EdgeNums { };
		public enum AandnotCorB_VariableNums { };
		public enum AandnotCorB_SubNums { };
		public enum AandnotCorB_AltNums { @alt_0, };
		public enum AandnotCorB_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_AandnotCorB;

		public enum AandnotCorB_alt_0_CaseNums { @A, @B, };
		public static GRGEN_LIBGR.NodeType[] AandnotCorB_alt_0_A_node__node0_AllowedTypes = null;
		public static bool[] AandnotCorB_alt_0_A_node__node0_IsAllowedType = null;
		public enum AandnotCorB_alt_0_A_NodeNums { @_node0, };
		public enum AandnotCorB_alt_0_A_EdgeNums { };
		public enum AandnotCorB_alt_0_A_VariableNums { };
		public enum AandnotCorB_alt_0_A_SubNums { };
		public enum AandnotCorB_alt_0_A_AltNums { };
		public enum AandnotCorB_alt_0_A_IterNums { };



		public GRGEN_LGSP.PatternGraph AandnotCorB_alt_0_A;

		public static GRGEN_LIBGR.NodeType[] AandnotCorB_alt_0_A_neg_0_node__node0_AllowedTypes = null;
		public static bool[] AandnotCorB_alt_0_A_neg_0_node__node0_IsAllowedType = null;
		public enum AandnotCorB_alt_0_A_neg_0_NodeNums { @_node0, };
		public enum AandnotCorB_alt_0_A_neg_0_EdgeNums { };
		public enum AandnotCorB_alt_0_A_neg_0_VariableNums { };
		public enum AandnotCorB_alt_0_A_neg_0_SubNums { };
		public enum AandnotCorB_alt_0_A_neg_0_AltNums { };
		public enum AandnotCorB_alt_0_A_neg_0_IterNums { };


		public GRGEN_LGSP.PatternGraph AandnotCorB_alt_0_A_neg_0;

		public static GRGEN_LIBGR.NodeType[] AandnotCorB_alt_0_B_node__node0_AllowedTypes = null;
		public static bool[] AandnotCorB_alt_0_B_node__node0_IsAllowedType = null;
		public enum AandnotCorB_alt_0_B_NodeNums { @_node0, };
		public enum AandnotCorB_alt_0_B_EdgeNums { };
		public enum AandnotCorB_alt_0_B_VariableNums { };
		public enum AandnotCorB_alt_0_B_SubNums { };
		public enum AandnotCorB_alt_0_B_AltNums { };
		public enum AandnotCorB_alt_0_B_IterNums { };



		public GRGEN_LGSP.PatternGraph AandnotCorB_alt_0_B;


		private Rule_AandnotCorB()
			: base("AandnotCorB",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_AandnotCorB+IMatch_AandnotCorB",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_AandnotCorB+Match_AandnotCorB"
			)
		{
		}
		private void initialize()
		{
			bool[,] AandnotCorB_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] AandnotCorB_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] AandnotCorB_isNodeTotallyHomomorphic = new bool[0];
			bool[] AandnotCorB_isEdgeTotallyHomomorphic = new bool[0];
			bool[,] AandnotCorB_alt_0_A_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] AandnotCorB_alt_0_A_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] AandnotCorB_alt_0_A_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] AandnotCorB_alt_0_A_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode AandnotCorB_alt_0_A_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@A, GRGEN_MODEL.NodeType_A.typeVar, "GRGEN_MODEL.IA", "AandnotCorB_alt_0_A_node__node0", "_node0", AandnotCorB_alt_0_A_node__node0_AllowedTypes, AandnotCorB_alt_0_A_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			bool[,] AandnotCorB_alt_0_A_neg_0_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] AandnotCorB_alt_0_A_neg_0_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] AandnotCorB_alt_0_A_neg_0_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] AandnotCorB_alt_0_A_neg_0_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode AandnotCorB_alt_0_A_neg_0_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "AandnotCorB_alt_0_A_neg_0_node__node0", "_node0", AandnotCorB_alt_0_A_neg_0_node__node0_AllowedTypes, AandnotCorB_alt_0_A_neg_0_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			AandnotCorB_alt_0_A_neg_0 = new GRGEN_LGSP.PatternGraph(
				"neg_0",
				"AandnotCorB_alt_0_A_",
				null, "neg_0",
				false, false,
				new GRGEN_LGSP.PatternNode[] { AandnotCorB_alt_0_A_neg_0_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				AandnotCorB_alt_0_A_neg_0_isNodeHomomorphicGlobal,
				AandnotCorB_alt_0_A_neg_0_isEdgeHomomorphicGlobal,
				AandnotCorB_alt_0_A_neg_0_isNodeTotallyHomomorphic,
				AandnotCorB_alt_0_A_neg_0_isEdgeTotallyHomomorphic
			);

			AandnotCorB_alt_0_A = new GRGEN_LGSP.PatternGraph(
				"A",
				"AandnotCorB_alt_0_",
				null, "A",
				false, false,
				new GRGEN_LGSP.PatternNode[] { AandnotCorB_alt_0_A_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] { AandnotCorB_alt_0_A_neg_0,  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				AandnotCorB_alt_0_A_isNodeHomomorphicGlobal,
				AandnotCorB_alt_0_A_isEdgeHomomorphicGlobal,
				AandnotCorB_alt_0_A_isNodeTotallyHomomorphic,
				AandnotCorB_alt_0_A_isEdgeTotallyHomomorphic
			);
			AandnotCorB_alt_0_A_neg_0.embeddingGraph = AandnotCorB_alt_0_A;

			bool[,] AandnotCorB_alt_0_B_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] AandnotCorB_alt_0_B_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] AandnotCorB_alt_0_B_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] AandnotCorB_alt_0_B_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode AandnotCorB_alt_0_B_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@B, GRGEN_MODEL.NodeType_B.typeVar, "GRGEN_MODEL.IB", "AandnotCorB_alt_0_B_node__node0", "_node0", AandnotCorB_alt_0_B_node__node0_AllowedTypes, AandnotCorB_alt_0_B_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			AandnotCorB_alt_0_B = new GRGEN_LGSP.PatternGraph(
				"B",
				"AandnotCorB_alt_0_",
				null, "B",
				false, false,
				new GRGEN_LGSP.PatternNode[] { AandnotCorB_alt_0_B_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				AandnotCorB_alt_0_B_isNodeHomomorphicGlobal,
				AandnotCorB_alt_0_B_isEdgeHomomorphicGlobal,
				AandnotCorB_alt_0_B_isNodeTotallyHomomorphic,
				AandnotCorB_alt_0_B_isEdgeTotallyHomomorphic
			);

			GRGEN_LGSP.Alternative AandnotCorB_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "AandnotCorB_", new GRGEN_LGSP.PatternGraph[] { AandnotCorB_alt_0_A, AandnotCorB_alt_0_B } );

			pat_AandnotCorB = new GRGEN_LGSP.PatternGraph(
				"AandnotCorB",
				"",
				null, "AandnotCorB",
				false, false,
				new GRGEN_LGSP.PatternNode[] {  }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { AandnotCorB_alt_0,  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[0, 0] ,
				new bool[0, 0] ,
				AandnotCorB_isNodeHomomorphicGlobal,
				AandnotCorB_isEdgeHomomorphicGlobal,
				AandnotCorB_isNodeTotallyHomomorphic,
				AandnotCorB_isEdgeTotallyHomomorphic
			);
			AandnotCorB_alt_0_A.embeddingGraph = pat_AandnotCorB;
			AandnotCorB_alt_0_B.embeddingGraph = pat_AandnotCorB;

			AandnotCorB_alt_0_A_node__node0.pointOfDefinition = AandnotCorB_alt_0_A;
			AandnotCorB_alt_0_A_neg_0_node__node0.pointOfDefinition = AandnotCorB_alt_0_A_neg_0;
			AandnotCorB_alt_0_B_node__node0.pointOfDefinition = AandnotCorB_alt_0_B;

			patternGraph = pat_AandnotCorB;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_AandnotCorB curMatch = (Match_AandnotCorB)_curMatch;
			IMatch_AandnotCorB_alt_0 alternative_alt_0 = curMatch._alt_0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		public void AandnotCorB_alt_0_A_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_AandnotCorB_alt_0_A curMatch = (Match_AandnotCorB_alt_0_A)_curMatch;
		}

		public void AandnotCorB_alt_0_B_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_AandnotCorB_alt_0_B curMatch = (Match_AandnotCorB_alt_0_B)_curMatch;
		}

		static Rule_AandnotCorB() {
		}

		public interface IMatch_AandnotCorB : GRGEN_LIBGR.IMatch
		{
			//Nodes
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			IMatch_AandnotCorB_alt_0 alt_0 { get; }
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_AandnotCorB_alt_0 : GRGEN_LIBGR.IMatch
		{
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_AandnotCorB_alt_0_A : IMatch_AandnotCorB_alt_0
		{
			//Nodes
			GRGEN_MODEL.IA node__node0 { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_AandnotCorB_alt_0_A_neg_0 : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_MODEL.IC node__node0 { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_AandnotCorB_alt_0_B : IMatch_AandnotCorB_alt_0
		{
			//Nodes
			GRGEN_MODEL.IB node__node0 { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_AandnotCorB : GRGEN_LGSP.MatchListElement<Match_AandnotCorB>, IMatch_AandnotCorB
		{
			public enum AandnotCorB_NodeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 0; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AandnotCorB_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AandnotCorB_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AandnotCorB_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public IMatch_AandnotCorB_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_AandnotCorB_alt_0 _alt_0;
			public enum AandnotCorB_AltNums { @alt_0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 1; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				case (int)AandnotCorB_AltNums.@alt_0: return _alt_0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				case "alt_0": return _alt_0;
				default: return null;
				}
			}

			public enum AandnotCorB_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AandnotCorB_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_AandnotCorB.instance.pat_AandnotCorB; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_AandnotCorB(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_AandnotCorB(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_AandnotCorB nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_AandnotCorB cur = this;
				while(cur != null) {
					Match_AandnotCorB next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_AandnotCorB that)
			{
				_alt_0 = that._alt_0;
			}

			public Match_AandnotCorB(Match_AandnotCorB that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_AandnotCorB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				if(that._alt_0 is Match_AandnotCorB_alt_0_A)
					_alt_0 = new Match_AandnotCorB_alt_0_A((Match_AandnotCorB_alt_0_A)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_AandnotCorB_alt_0_B)
					_alt_0 = new Match_AandnotCorB_alt_0_B((Match_AandnotCorB_alt_0_B)that._alt_0, oldToNewMap);
			}

			public Match_AandnotCorB(Match_AandnotCorB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_AandnotCorB()
			{
			}

			public bool IsEqual(Match_AandnotCorB that)
			{
				if(that==null) return false;
				if(_alt_0 is Match_AandnotCorB_alt_0_A && !(_alt_0 as Match_AandnotCorB_alt_0_A).IsEqual(that._alt_0 as Match_AandnotCorB_alt_0_A)) return false;
				if(_alt_0 is Match_AandnotCorB_alt_0_B && !(_alt_0 as Match_AandnotCorB_alt_0_B).IsEqual(that._alt_0 as Match_AandnotCorB_alt_0_B)) return false;
				return true;
			}
		}

		public class Match_AandnotCorB_alt_0_A : GRGEN_LGSP.MatchListElement<Match_AandnotCorB_alt_0_A>, IMatch_AandnotCorB_alt_0_A
		{
			public GRGEN_MODEL.IA node__node0 { get { return (GRGEN_MODEL.IA)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum AandnotCorB_alt_0_A_NodeNums { @_node0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 1; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)AandnotCorB_alt_0_A_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum AandnotCorB_alt_0_A_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AandnotCorB_alt_0_A_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AandnotCorB_alt_0_A_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AandnotCorB_alt_0_A_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AandnotCorB_alt_0_A_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AandnotCorB_alt_0_A_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_AandnotCorB.instance.AandnotCorB_alt_0_A; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_AandnotCorB_alt_0_A(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_AandnotCorB_alt_0_A(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_AandnotCorB_alt_0_A nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_AandnotCorB_alt_0_A cur = this;
				while(cur != null) {
					Match_AandnotCorB_alt_0_A next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_AandnotCorB_alt_0_A that)
			{
				_node__node0 = that._node__node0;
			}

			public Match_AandnotCorB_alt_0_A(Match_AandnotCorB_alt_0_A that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_AandnotCorB_alt_0_A that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
			}

			public Match_AandnotCorB_alt_0_A(Match_AandnotCorB_alt_0_A that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_AandnotCorB_alt_0_A()
			{
			}

			public bool IsEqual(Match_AandnotCorB_alt_0_A that)
			{
				if(that==null) return false;
				if(_node__node0 != that._node__node0) return false;
				return true;
			}
		}

		public class Match_AandnotCorB_alt_0_A_neg_0 : GRGEN_LGSP.MatchListElement<Match_AandnotCorB_alt_0_A_neg_0>, IMatch_AandnotCorB_alt_0_A_neg_0
		{
			public GRGEN_MODEL.IC node__node0 { get { return (GRGEN_MODEL.IC)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum AandnotCorB_alt_0_A_neg_0_NodeNums { @_node0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 1; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)AandnotCorB_alt_0_A_neg_0_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum AandnotCorB_alt_0_A_neg_0_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AandnotCorB_alt_0_A_neg_0_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AandnotCorB_alt_0_A_neg_0_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AandnotCorB_alt_0_A_neg_0_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AandnotCorB_alt_0_A_neg_0_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AandnotCorB_alt_0_A_neg_0_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_AandnotCorB.instance.AandnotCorB_alt_0_A_neg_0; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_AandnotCorB_alt_0_A_neg_0(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_AandnotCorB_alt_0_A_neg_0(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_AandnotCorB_alt_0_A_neg_0 nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_AandnotCorB_alt_0_A_neg_0 cur = this;
				while(cur != null) {
					Match_AandnotCorB_alt_0_A_neg_0 next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_AandnotCorB_alt_0_A_neg_0 that)
			{
				_node__node0 = that._node__node0;
			}

			public Match_AandnotCorB_alt_0_A_neg_0(Match_AandnotCorB_alt_0_A_neg_0 that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_AandnotCorB_alt_0_A_neg_0 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
			}

			public Match_AandnotCorB_alt_0_A_neg_0(Match_AandnotCorB_alt_0_A_neg_0 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_AandnotCorB_alt_0_A_neg_0()
			{
			}

			public bool IsEqual(Match_AandnotCorB_alt_0_A_neg_0 that)
			{
				if(that==null) return false;
				if(_node__node0 != that._node__node0) return false;
				return true;
			}
		}

		public class Match_AandnotCorB_alt_0_B : GRGEN_LGSP.MatchListElement<Match_AandnotCorB_alt_0_B>, IMatch_AandnotCorB_alt_0_B
		{
			public GRGEN_MODEL.IB node__node0 { get { return (GRGEN_MODEL.IB)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum AandnotCorB_alt_0_B_NodeNums { @_node0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 1; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)AandnotCorB_alt_0_B_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum AandnotCorB_alt_0_B_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AandnotCorB_alt_0_B_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AandnotCorB_alt_0_B_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AandnotCorB_alt_0_B_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AandnotCorB_alt_0_B_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AandnotCorB_alt_0_B_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_AandnotCorB.instance.AandnotCorB_alt_0_B; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_AandnotCorB_alt_0_B(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_AandnotCorB_alt_0_B(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_AandnotCorB_alt_0_B nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_AandnotCorB_alt_0_B cur = this;
				while(cur != null) {
					Match_AandnotCorB_alt_0_B next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_AandnotCorB_alt_0_B that)
			{
				_node__node0 = that._node__node0;
			}

			public Match_AandnotCorB_alt_0_B(Match_AandnotCorB_alt_0_B that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_AandnotCorB_alt_0_B that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
			}

			public Match_AandnotCorB_alt_0_B(Match_AandnotCorB_alt_0_B that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_AandnotCorB_alt_0_B()
			{
			}

			public bool IsEqual(Match_AandnotCorB_alt_0_B that)
			{
				if(that==null) return false;
				if(_node__node0 != that._node__node0) return false;
				return true;
			}
		}


		public class Extractor
		{
		}


		public static List<GRGEN_ACTIONS.Rule_AandnotCorB.IMatch_AandnotCorB> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_AandnotCorB.IMatch_AandnotCorB>)
				return ((List<GRGEN_ACTIONS.Rule_AandnotCorB.IMatch_AandnotCorB>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_AandnotCorB.IMatch_AandnotCorB>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_AandnotCorB.IMatch_AandnotCorB instanceBearingAttributeForSearch_AandnotCorB = new GRGEN_ACTIONS.Rule_AandnotCorB.Match_AandnotCorB();
	}

	public class Rule_AorBorC : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_AorBorC instance = null;
		public static Rule_AorBorC Instance { get { if(instance==null) { instance = new Rule_AorBorC(); instance.initialize(); } return instance; } }

		public enum AorBorC_NodeNums { };
		public enum AorBorC_EdgeNums { };
		public enum AorBorC_VariableNums { };
		public enum AorBorC_SubNums { };
		public enum AorBorC_AltNums { @alt_0, };
		public enum AorBorC_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_AorBorC;

		public enum AorBorC_alt_0_CaseNums { @A, @B, @C, };
		public static GRGEN_LIBGR.NodeType[] AorBorC_alt_0_A_node__node0_AllowedTypes = null;
		public static bool[] AorBorC_alt_0_A_node__node0_IsAllowedType = null;
		public enum AorBorC_alt_0_A_NodeNums { @_node0, };
		public enum AorBorC_alt_0_A_EdgeNums { };
		public enum AorBorC_alt_0_A_VariableNums { };
		public enum AorBorC_alt_0_A_SubNums { };
		public enum AorBorC_alt_0_A_AltNums { };
		public enum AorBorC_alt_0_A_IterNums { };



		public GRGEN_LGSP.PatternGraph AorBorC_alt_0_A;

		public static GRGEN_LIBGR.NodeType[] AorBorC_alt_0_B_node__node0_AllowedTypes = null;
		public static bool[] AorBorC_alt_0_B_node__node0_IsAllowedType = null;
		public enum AorBorC_alt_0_B_NodeNums { @_node0, };
		public enum AorBorC_alt_0_B_EdgeNums { };
		public enum AorBorC_alt_0_B_VariableNums { };
		public enum AorBorC_alt_0_B_SubNums { };
		public enum AorBorC_alt_0_B_AltNums { };
		public enum AorBorC_alt_0_B_IterNums { };



		public GRGEN_LGSP.PatternGraph AorBorC_alt_0_B;

		public static GRGEN_LIBGR.NodeType[] AorBorC_alt_0_C_node__node0_AllowedTypes = null;
		public static bool[] AorBorC_alt_0_C_node__node0_IsAllowedType = null;
		public enum AorBorC_alt_0_C_NodeNums { @_node0, };
		public enum AorBorC_alt_0_C_EdgeNums { };
		public enum AorBorC_alt_0_C_VariableNums { };
		public enum AorBorC_alt_0_C_SubNums { };
		public enum AorBorC_alt_0_C_AltNums { };
		public enum AorBorC_alt_0_C_IterNums { };



		public GRGEN_LGSP.PatternGraph AorBorC_alt_0_C;


		private Rule_AorBorC()
			: base("AorBorC",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_AorBorC+IMatch_AorBorC",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_AorBorC+Match_AorBorC"
			)
		{
		}
		private void initialize()
		{
			bool[,] AorBorC_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] AorBorC_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] AorBorC_isNodeTotallyHomomorphic = new bool[0];
			bool[] AorBorC_isEdgeTotallyHomomorphic = new bool[0];
			bool[,] AorBorC_alt_0_A_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] AorBorC_alt_0_A_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] AorBorC_alt_0_A_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] AorBorC_alt_0_A_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode AorBorC_alt_0_A_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@A, GRGEN_MODEL.NodeType_A.typeVar, "GRGEN_MODEL.IA", "AorBorC_alt_0_A_node__node0", "_node0", AorBorC_alt_0_A_node__node0_AllowedTypes, AorBorC_alt_0_A_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			AorBorC_alt_0_A = new GRGEN_LGSP.PatternGraph(
				"A",
				"AorBorC_alt_0_",
				null, "A",
				false, false,
				new GRGEN_LGSP.PatternNode[] { AorBorC_alt_0_A_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				AorBorC_alt_0_A_isNodeHomomorphicGlobal,
				AorBorC_alt_0_A_isEdgeHomomorphicGlobal,
				AorBorC_alt_0_A_isNodeTotallyHomomorphic,
				AorBorC_alt_0_A_isEdgeTotallyHomomorphic
			);

			bool[,] AorBorC_alt_0_B_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] AorBorC_alt_0_B_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] AorBorC_alt_0_B_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] AorBorC_alt_0_B_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode AorBorC_alt_0_B_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@B, GRGEN_MODEL.NodeType_B.typeVar, "GRGEN_MODEL.IB", "AorBorC_alt_0_B_node__node0", "_node0", AorBorC_alt_0_B_node__node0_AllowedTypes, AorBorC_alt_0_B_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			AorBorC_alt_0_B = new GRGEN_LGSP.PatternGraph(
				"B",
				"AorBorC_alt_0_",
				null, "B",
				false, false,
				new GRGEN_LGSP.PatternNode[] { AorBorC_alt_0_B_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				AorBorC_alt_0_B_isNodeHomomorphicGlobal,
				AorBorC_alt_0_B_isEdgeHomomorphicGlobal,
				AorBorC_alt_0_B_isNodeTotallyHomomorphic,
				AorBorC_alt_0_B_isEdgeTotallyHomomorphic
			);

			bool[,] AorBorC_alt_0_C_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] AorBorC_alt_0_C_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] AorBorC_alt_0_C_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] AorBorC_alt_0_C_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode AorBorC_alt_0_C_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "AorBorC_alt_0_C_node__node0", "_node0", AorBorC_alt_0_C_node__node0_AllowedTypes, AorBorC_alt_0_C_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			AorBorC_alt_0_C = new GRGEN_LGSP.PatternGraph(
				"C",
				"AorBorC_alt_0_",
				null, "C",
				false, false,
				new GRGEN_LGSP.PatternNode[] { AorBorC_alt_0_C_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				AorBorC_alt_0_C_isNodeHomomorphicGlobal,
				AorBorC_alt_0_C_isEdgeHomomorphicGlobal,
				AorBorC_alt_0_C_isNodeTotallyHomomorphic,
				AorBorC_alt_0_C_isEdgeTotallyHomomorphic
			);

			GRGEN_LGSP.Alternative AorBorC_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "AorBorC_", new GRGEN_LGSP.PatternGraph[] { AorBorC_alt_0_A, AorBorC_alt_0_B, AorBorC_alt_0_C } );

			pat_AorBorC = new GRGEN_LGSP.PatternGraph(
				"AorBorC",
				"",
				null, "AorBorC",
				false, false,
				new GRGEN_LGSP.PatternNode[] {  }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { AorBorC_alt_0,  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[0, 0] ,
				new bool[0, 0] ,
				AorBorC_isNodeHomomorphicGlobal,
				AorBorC_isEdgeHomomorphicGlobal,
				AorBorC_isNodeTotallyHomomorphic,
				AorBorC_isEdgeTotallyHomomorphic
			);
			AorBorC_alt_0_A.embeddingGraph = pat_AorBorC;
			AorBorC_alt_0_B.embeddingGraph = pat_AorBorC;
			AorBorC_alt_0_C.embeddingGraph = pat_AorBorC;

			AorBorC_alt_0_A_node__node0.pointOfDefinition = AorBorC_alt_0_A;
			AorBorC_alt_0_B_node__node0.pointOfDefinition = AorBorC_alt_0_B;
			AorBorC_alt_0_C_node__node0.pointOfDefinition = AorBorC_alt_0_C;

			patternGraph = pat_AorBorC;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_AorBorC curMatch = (Match_AorBorC)_curMatch;
			IMatch_AorBorC_alt_0 alternative_alt_0 = curMatch._alt_0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		public void AorBorC_alt_0_A_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_AorBorC_alt_0_A curMatch = (Match_AorBorC_alt_0_A)_curMatch;
		}

		public void AorBorC_alt_0_B_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_AorBorC_alt_0_B curMatch = (Match_AorBorC_alt_0_B)_curMatch;
		}

		public void AorBorC_alt_0_C_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_AorBorC_alt_0_C curMatch = (Match_AorBorC_alt_0_C)_curMatch;
		}

		static Rule_AorBorC() {
		}

		public interface IMatch_AorBorC : GRGEN_LIBGR.IMatch
		{
			//Nodes
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			IMatch_AorBorC_alt_0 alt_0 { get; }
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_AorBorC_alt_0 : GRGEN_LIBGR.IMatch
		{
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_AorBorC_alt_0_A : IMatch_AorBorC_alt_0
		{
			//Nodes
			GRGEN_MODEL.IA node__node0 { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_AorBorC_alt_0_B : IMatch_AorBorC_alt_0
		{
			//Nodes
			GRGEN_MODEL.IB node__node0 { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_AorBorC_alt_0_C : IMatch_AorBorC_alt_0
		{
			//Nodes
			GRGEN_MODEL.IC node__node0 { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_AorBorC : GRGEN_LGSP.MatchListElement<Match_AorBorC>, IMatch_AorBorC
		{
			public enum AorBorC_NodeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 0; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AorBorC_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AorBorC_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AorBorC_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public IMatch_AorBorC_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_AorBorC_alt_0 _alt_0;
			public enum AorBorC_AltNums { @alt_0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 1; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				case (int)AorBorC_AltNums.@alt_0: return _alt_0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				case "alt_0": return _alt_0;
				default: return null;
				}
			}

			public enum AorBorC_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorBorC_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_AorBorC.instance.pat_AorBorC; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_AorBorC(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_AorBorC(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_AorBorC nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_AorBorC cur = this;
				while(cur != null) {
					Match_AorBorC next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_AorBorC that)
			{
				_alt_0 = that._alt_0;
			}

			public Match_AorBorC(Match_AorBorC that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_AorBorC that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				if(that._alt_0 is Match_AorBorC_alt_0_A)
					_alt_0 = new Match_AorBorC_alt_0_A((Match_AorBorC_alt_0_A)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_AorBorC_alt_0_B)
					_alt_0 = new Match_AorBorC_alt_0_B((Match_AorBorC_alt_0_B)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_AorBorC_alt_0_C)
					_alt_0 = new Match_AorBorC_alt_0_C((Match_AorBorC_alt_0_C)that._alt_0, oldToNewMap);
			}

			public Match_AorBorC(Match_AorBorC that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_AorBorC()
			{
			}

			public bool IsEqual(Match_AorBorC that)
			{
				if(that==null) return false;
				if(_alt_0 is Match_AorBorC_alt_0_A && !(_alt_0 as Match_AorBorC_alt_0_A).IsEqual(that._alt_0 as Match_AorBorC_alt_0_A)) return false;
				if(_alt_0 is Match_AorBorC_alt_0_B && !(_alt_0 as Match_AorBorC_alt_0_B).IsEqual(that._alt_0 as Match_AorBorC_alt_0_B)) return false;
				if(_alt_0 is Match_AorBorC_alt_0_C && !(_alt_0 as Match_AorBorC_alt_0_C).IsEqual(that._alt_0 as Match_AorBorC_alt_0_C)) return false;
				return true;
			}
		}

		public class Match_AorBorC_alt_0_A : GRGEN_LGSP.MatchListElement<Match_AorBorC_alt_0_A>, IMatch_AorBorC_alt_0_A
		{
			public GRGEN_MODEL.IA node__node0 { get { return (GRGEN_MODEL.IA)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum AorBorC_alt_0_A_NodeNums { @_node0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 1; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)AorBorC_alt_0_A_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum AorBorC_alt_0_A_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AorBorC_alt_0_A_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AorBorC_alt_0_A_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorBorC_alt_0_A_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorBorC_alt_0_A_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorBorC_alt_0_A_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_AorBorC.instance.AorBorC_alt_0_A; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_AorBorC_alt_0_A(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_AorBorC_alt_0_A(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_AorBorC_alt_0_A nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_AorBorC_alt_0_A cur = this;
				while(cur != null) {
					Match_AorBorC_alt_0_A next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_AorBorC_alt_0_A that)
			{
				_node__node0 = that._node__node0;
			}

			public Match_AorBorC_alt_0_A(Match_AorBorC_alt_0_A that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_AorBorC_alt_0_A that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
			}

			public Match_AorBorC_alt_0_A(Match_AorBorC_alt_0_A that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_AorBorC_alt_0_A()
			{
			}

			public bool IsEqual(Match_AorBorC_alt_0_A that)
			{
				if(that==null) return false;
				if(_node__node0 != that._node__node0) return false;
				return true;
			}
		}

		public class Match_AorBorC_alt_0_B : GRGEN_LGSP.MatchListElement<Match_AorBorC_alt_0_B>, IMatch_AorBorC_alt_0_B
		{
			public GRGEN_MODEL.IB node__node0 { get { return (GRGEN_MODEL.IB)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum AorBorC_alt_0_B_NodeNums { @_node0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 1; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)AorBorC_alt_0_B_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum AorBorC_alt_0_B_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AorBorC_alt_0_B_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AorBorC_alt_0_B_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorBorC_alt_0_B_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorBorC_alt_0_B_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorBorC_alt_0_B_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_AorBorC.instance.AorBorC_alt_0_B; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_AorBorC_alt_0_B(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_AorBorC_alt_0_B(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_AorBorC_alt_0_B nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_AorBorC_alt_0_B cur = this;
				while(cur != null) {
					Match_AorBorC_alt_0_B next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_AorBorC_alt_0_B that)
			{
				_node__node0 = that._node__node0;
			}

			public Match_AorBorC_alt_0_B(Match_AorBorC_alt_0_B that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_AorBorC_alt_0_B that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
			}

			public Match_AorBorC_alt_0_B(Match_AorBorC_alt_0_B that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_AorBorC_alt_0_B()
			{
			}

			public bool IsEqual(Match_AorBorC_alt_0_B that)
			{
				if(that==null) return false;
				if(_node__node0 != that._node__node0) return false;
				return true;
			}
		}

		public class Match_AorBorC_alt_0_C : GRGEN_LGSP.MatchListElement<Match_AorBorC_alt_0_C>, IMatch_AorBorC_alt_0_C
		{
			public GRGEN_MODEL.IC node__node0 { get { return (GRGEN_MODEL.IC)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum AorBorC_alt_0_C_NodeNums { @_node0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 1; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)AorBorC_alt_0_C_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum AorBorC_alt_0_C_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AorBorC_alt_0_C_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AorBorC_alt_0_C_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorBorC_alt_0_C_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorBorC_alt_0_C_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AorBorC_alt_0_C_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_AorBorC.instance.AorBorC_alt_0_C; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_AorBorC_alt_0_C(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_AorBorC_alt_0_C(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_AorBorC_alt_0_C nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_AorBorC_alt_0_C cur = this;
				while(cur != null) {
					Match_AorBorC_alt_0_C next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_AorBorC_alt_0_C that)
			{
				_node__node0 = that._node__node0;
			}

			public Match_AorBorC_alt_0_C(Match_AorBorC_alt_0_C that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_AorBorC_alt_0_C that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
			}

			public Match_AorBorC_alt_0_C(Match_AorBorC_alt_0_C that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_AorBorC_alt_0_C()
			{
			}

			public bool IsEqual(Match_AorBorC_alt_0_C that)
			{
				if(that==null) return false;
				if(_node__node0 != that._node__node0) return false;
				return true;
			}
		}


		public class Extractor
		{
		}


		public static List<GRGEN_ACTIONS.Rule_AorBorC.IMatch_AorBorC> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_AorBorC.IMatch_AorBorC>)
				return ((List<GRGEN_ACTIONS.Rule_AorBorC.IMatch_AorBorC>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_AorBorC.IMatch_AorBorC>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_AorBorC.IMatch_AorBorC instanceBearingAttributeForSearch_AorBorC = new GRGEN_ACTIONS.Rule_AorBorC.Match_AorBorC();
	}

	public class Rule_AtoAorB : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_AtoAorB instance = null;
		public static Rule_AtoAorB Instance { get { if(instance==null) { instance = new Rule_AtoAorB(); instance.initialize(); } return instance; } }

		public static GRGEN_LIBGR.NodeType[] AtoAorB_node_a_AllowedTypes = null;
		public static bool[] AtoAorB_node_a_IsAllowedType = null;
		public enum AtoAorB_NodeNums { @a, };
		public enum AtoAorB_EdgeNums { };
		public enum AtoAorB_VariableNums { };
		public enum AtoAorB_SubNums { };
		public enum AtoAorB_AltNums { @alt_0, };
		public enum AtoAorB_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_AtoAorB;

		public enum AtoAorB_alt_0_CaseNums { @toA, @toB, };
		public static GRGEN_LIBGR.NodeType[] AtoAorB_alt_0_toA_node__node0_AllowedTypes = null;
		public static bool[] AtoAorB_alt_0_toA_node__node0_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] AtoAorB_alt_0_toA_edge__edge0_AllowedTypes = null;
		public static bool[] AtoAorB_alt_0_toA_edge__edge0_IsAllowedType = null;
		public enum AtoAorB_alt_0_toA_NodeNums { @a, @_node0, };
		public enum AtoAorB_alt_0_toA_EdgeNums { @_edge0, };
		public enum AtoAorB_alt_0_toA_VariableNums { };
		public enum AtoAorB_alt_0_toA_SubNums { };
		public enum AtoAorB_alt_0_toA_AltNums { };
		public enum AtoAorB_alt_0_toA_IterNums { };



		public GRGEN_LGSP.PatternGraph AtoAorB_alt_0_toA;

		public static GRGEN_LIBGR.NodeType[] AtoAorB_alt_0_toB_node__node0_AllowedTypes = null;
		public static bool[] AtoAorB_alt_0_toB_node__node0_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] AtoAorB_alt_0_toB_edge__edge0_AllowedTypes = null;
		public static bool[] AtoAorB_alt_0_toB_edge__edge0_IsAllowedType = null;
		public enum AtoAorB_alt_0_toB_NodeNums { @a, @_node0, };
		public enum AtoAorB_alt_0_toB_EdgeNums { @_edge0, };
		public enum AtoAorB_alt_0_toB_VariableNums { };
		public enum AtoAorB_alt_0_toB_SubNums { };
		public enum AtoAorB_alt_0_toB_AltNums { };
		public enum AtoAorB_alt_0_toB_IterNums { };



		public GRGEN_LGSP.PatternGraph AtoAorB_alt_0_toB;


		private Rule_AtoAorB()
			: base("AtoAorB",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_AtoAorB+IMatch_AtoAorB",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_AtoAorB+Match_AtoAorB"
			)
		{
		}
		private void initialize()
		{
			bool[,] AtoAorB_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] AtoAorB_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] AtoAorB_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] AtoAorB_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode AtoAorB_node_a = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@A, GRGEN_MODEL.NodeType_A.typeVar, "GRGEN_MODEL.IA", "AtoAorB_node_a", "a", AtoAorB_node_a_AllowedTypes, AtoAorB_node_a_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			bool[,] AtoAorB_alt_0_toA_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] AtoAorB_alt_0_toA_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] AtoAorB_alt_0_toA_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] AtoAorB_alt_0_toA_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode AtoAorB_alt_0_toA_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@A, GRGEN_MODEL.NodeType_A.typeVar, "GRGEN_MODEL.IA", "AtoAorB_alt_0_toA_node__node0", "_node0", AtoAorB_alt_0_toA_node__node0_AllowedTypes, AtoAorB_alt_0_toA_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge AtoAorB_alt_0_toA_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "AtoAorB_alt_0_toA_edge__edge0", "_edge0", AtoAorB_alt_0_toA_edge__edge0_AllowedTypes, AtoAorB_alt_0_toA_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			AtoAorB_alt_0_toA = new GRGEN_LGSP.PatternGraph(
				"toA",
				"AtoAorB_alt_0_",
				null, "toA",
				false, false,
				new GRGEN_LGSP.PatternNode[] { AtoAorB_node_a, AtoAorB_alt_0_toA_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] { AtoAorB_alt_0_toA_edge__edge0 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				new bool[1, 1] {
					{ true, },
				},
				AtoAorB_alt_0_toA_isNodeHomomorphicGlobal,
				AtoAorB_alt_0_toA_isEdgeHomomorphicGlobal,
				AtoAorB_alt_0_toA_isNodeTotallyHomomorphic,
				AtoAorB_alt_0_toA_isEdgeTotallyHomomorphic
			);
			AtoAorB_alt_0_toA.edgeToSourceNode.Add(AtoAorB_alt_0_toA_edge__edge0, AtoAorB_node_a);
			AtoAorB_alt_0_toA.edgeToTargetNode.Add(AtoAorB_alt_0_toA_edge__edge0, AtoAorB_alt_0_toA_node__node0);

			bool[,] AtoAorB_alt_0_toB_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] AtoAorB_alt_0_toB_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] AtoAorB_alt_0_toB_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] AtoAorB_alt_0_toB_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode AtoAorB_alt_0_toB_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@B, GRGEN_MODEL.NodeType_B.typeVar, "GRGEN_MODEL.IB", "AtoAorB_alt_0_toB_node__node0", "_node0", AtoAorB_alt_0_toB_node__node0_AllowedTypes, AtoAorB_alt_0_toB_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge AtoAorB_alt_0_toB_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "AtoAorB_alt_0_toB_edge__edge0", "_edge0", AtoAorB_alt_0_toB_edge__edge0_AllowedTypes, AtoAorB_alt_0_toB_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			AtoAorB_alt_0_toB = new GRGEN_LGSP.PatternGraph(
				"toB",
				"AtoAorB_alt_0_",
				null, "toB",
				false, false,
				new GRGEN_LGSP.PatternNode[] { AtoAorB_node_a, AtoAorB_alt_0_toB_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] { AtoAorB_alt_0_toB_edge__edge0 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				new bool[1, 1] {
					{ true, },
				},
				AtoAorB_alt_0_toB_isNodeHomomorphicGlobal,
				AtoAorB_alt_0_toB_isEdgeHomomorphicGlobal,
				AtoAorB_alt_0_toB_isNodeTotallyHomomorphic,
				AtoAorB_alt_0_toB_isEdgeTotallyHomomorphic
			);
			AtoAorB_alt_0_toB.edgeToSourceNode.Add(AtoAorB_alt_0_toB_edge__edge0, AtoAorB_node_a);
			AtoAorB_alt_0_toB.edgeToTargetNode.Add(AtoAorB_alt_0_toB_edge__edge0, AtoAorB_alt_0_toB_node__node0);

			GRGEN_LGSP.Alternative AtoAorB_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "AtoAorB_", new GRGEN_LGSP.PatternGraph[] { AtoAorB_alt_0_toA, AtoAorB_alt_0_toB } );

			pat_AtoAorB = new GRGEN_LGSP.PatternGraph(
				"AtoAorB",
				"",
				null, "AtoAorB",
				false, false,
				new GRGEN_LGSP.PatternNode[] { AtoAorB_node_a }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { AtoAorB_alt_0,  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				AtoAorB_isNodeHomomorphicGlobal,
				AtoAorB_isEdgeHomomorphicGlobal,
				AtoAorB_isNodeTotallyHomomorphic,
				AtoAorB_isEdgeTotallyHomomorphic
			);
			AtoAorB_alt_0_toA.embeddingGraph = pat_AtoAorB;
			AtoAorB_alt_0_toB.embeddingGraph = pat_AtoAorB;

			AtoAorB_node_a.pointOfDefinition = pat_AtoAorB;
			AtoAorB_alt_0_toA_node__node0.pointOfDefinition = AtoAorB_alt_0_toA;
			AtoAorB_alt_0_toA_edge__edge0.pointOfDefinition = AtoAorB_alt_0_toA;
			AtoAorB_alt_0_toB_node__node0.pointOfDefinition = AtoAorB_alt_0_toB;
			AtoAorB_alt_0_toB_edge__edge0.pointOfDefinition = AtoAorB_alt_0_toB;

			patternGraph = pat_AtoAorB;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_AtoAorB curMatch = (Match_AtoAorB)_curMatch;
			IMatch_AtoAorB_alt_0 alternative_alt_0 = curMatch._alt_0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		public void AtoAorB_alt_0_toA_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_AtoAorB_alt_0_toA curMatch = (Match_AtoAorB_alt_0_toA)_curMatch;
		}

		public void AtoAorB_alt_0_toB_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_AtoAorB_alt_0_toB curMatch = (Match_AtoAorB_alt_0_toB)_curMatch;
		}

		static Rule_AtoAorB() {
		}

		public interface IMatch_AtoAorB : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_MODEL.IA node_a { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			IMatch_AtoAorB_alt_0 alt_0 { get; }
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_AtoAorB_alt_0 : GRGEN_LIBGR.IMatch
		{
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_AtoAorB_alt_0_toA : IMatch_AtoAorB_alt_0
		{
			//Nodes
			GRGEN_MODEL.IA node_a { get; set; }
			GRGEN_MODEL.IA node__node0 { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_AtoAorB_alt_0_toB : IMatch_AtoAorB_alt_0
		{
			//Nodes
			GRGEN_MODEL.IA node_a { get; set; }
			GRGEN_MODEL.IB node__node0 { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_AtoAorB : GRGEN_LGSP.MatchListElement<Match_AtoAorB>, IMatch_AtoAorB
		{
			public GRGEN_MODEL.IA node_a { get { return (GRGEN_MODEL.IA)_node_a; } set { _node_a = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_a;
			public enum AtoAorB_NodeNums { @a, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 1; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)AtoAorB_NodeNums.@a: return _node_a;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "a": return _node_a;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "a": _node_a = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum AtoAorB_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AtoAorB_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AtoAorB_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public IMatch_AtoAorB_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_AtoAorB_alt_0 _alt_0;
			public enum AtoAorB_AltNums { @alt_0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 1; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				case (int)AtoAorB_AltNums.@alt_0: return _alt_0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				case "alt_0": return _alt_0;
				default: return null;
				}
			}

			public enum AtoAorB_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AtoAorB_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_AtoAorB.instance.pat_AtoAorB; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_AtoAorB(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_AtoAorB(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_AtoAorB nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_AtoAorB cur = this;
				while(cur != null) {
					Match_AtoAorB next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_AtoAorB that)
			{
				_node_a = that._node_a;
				_alt_0 = that._alt_0;
			}

			public Match_AtoAorB(Match_AtoAorB that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_AtoAorB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_a = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_a];
				if(that._alt_0 is Match_AtoAorB_alt_0_toA)
					_alt_0 = new Match_AtoAorB_alt_0_toA((Match_AtoAorB_alt_0_toA)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_AtoAorB_alt_0_toB)
					_alt_0 = new Match_AtoAorB_alt_0_toB((Match_AtoAorB_alt_0_toB)that._alt_0, oldToNewMap);
			}

			public Match_AtoAorB(Match_AtoAorB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_AtoAorB()
			{
			}

			public bool IsEqual(Match_AtoAorB that)
			{
				if(that==null) return false;
				if(_node_a != that._node_a) return false;
				if(_alt_0 is Match_AtoAorB_alt_0_toA && !(_alt_0 as Match_AtoAorB_alt_0_toA).IsEqual(that._alt_0 as Match_AtoAorB_alt_0_toA)) return false;
				if(_alt_0 is Match_AtoAorB_alt_0_toB && !(_alt_0 as Match_AtoAorB_alt_0_toB).IsEqual(that._alt_0 as Match_AtoAorB_alt_0_toB)) return false;
				return true;
			}
		}

		public class Match_AtoAorB_alt_0_toA : GRGEN_LGSP.MatchListElement<Match_AtoAorB_alt_0_toA>, IMatch_AtoAorB_alt_0_toA
		{
			public GRGEN_MODEL.IA node_a { get { return (GRGEN_MODEL.IA)_node_a; } set { _node_a = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IA node__node0 { get { return (GRGEN_MODEL.IA)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_a;
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum AtoAorB_alt_0_toA_NodeNums { @a, @_node0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 2; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)AtoAorB_alt_0_toA_NodeNums.@a: return _node_a;
				case (int)AtoAorB_alt_0_toA_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "a": return _node_a;
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "a": _node_a = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge__edge0 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public enum AtoAorB_alt_0_toA_EdgeNums { @_edge0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 1; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)AtoAorB_alt_0_toA_EdgeNums.@_edge0: return _edge__edge0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "_edge0": return _edge__edge0;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "_edge0": _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum AtoAorB_alt_0_toA_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AtoAorB_alt_0_toA_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AtoAorB_alt_0_toA_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AtoAorB_alt_0_toA_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AtoAorB_alt_0_toA_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_AtoAorB.instance.AtoAorB_alt_0_toA; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_AtoAorB_alt_0_toA(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_AtoAorB_alt_0_toA(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_AtoAorB_alt_0_toA nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_AtoAorB_alt_0_toA cur = this;
				while(cur != null) {
					Match_AtoAorB_alt_0_toA next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_AtoAorB_alt_0_toA that)
			{
				_node_a = that._node_a;
				_node__node0 = that._node__node0;
				_edge__edge0 = that._edge__edge0;
			}

			public Match_AtoAorB_alt_0_toA(Match_AtoAorB_alt_0_toA that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_AtoAorB_alt_0_toA that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_a = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_a];
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
			}

			public Match_AtoAorB_alt_0_toA(Match_AtoAorB_alt_0_toA that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_AtoAorB_alt_0_toA()
			{
			}

			public bool IsEqual(Match_AtoAorB_alt_0_toA that)
			{
				if(that==null) return false;
				if(_node_a != that._node_a) return false;
				if(_node__node0 != that._node__node0) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				return true;
			}
		}

		public class Match_AtoAorB_alt_0_toB : GRGEN_LGSP.MatchListElement<Match_AtoAorB_alt_0_toB>, IMatch_AtoAorB_alt_0_toB
		{
			public GRGEN_MODEL.IA node_a { get { return (GRGEN_MODEL.IA)_node_a; } set { _node_a = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node__node0 { get { return (GRGEN_MODEL.IB)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_a;
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum AtoAorB_alt_0_toB_NodeNums { @a, @_node0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 2; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)AtoAorB_alt_0_toB_NodeNums.@a: return _node_a;
				case (int)AtoAorB_alt_0_toB_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "a": return _node_a;
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "a": _node_a = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge__edge0 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public enum AtoAorB_alt_0_toB_EdgeNums { @_edge0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 1; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)AtoAorB_alt_0_toB_EdgeNums.@_edge0: return _edge__edge0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "_edge0": return _edge__edge0;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "_edge0": _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum AtoAorB_alt_0_toB_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum AtoAorB_alt_0_toB_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AtoAorB_alt_0_toB_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AtoAorB_alt_0_toB_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum AtoAorB_alt_0_toB_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_AtoAorB.instance.AtoAorB_alt_0_toB; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_AtoAorB_alt_0_toB(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_AtoAorB_alt_0_toB(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_AtoAorB_alt_0_toB nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_AtoAorB_alt_0_toB cur = this;
				while(cur != null) {
					Match_AtoAorB_alt_0_toB next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_AtoAorB_alt_0_toB that)
			{
				_node_a = that._node_a;
				_node__node0 = that._node__node0;
				_edge__edge0 = that._edge__edge0;
			}

			public Match_AtoAorB_alt_0_toB(Match_AtoAorB_alt_0_toB that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_AtoAorB_alt_0_toB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_a = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_a];
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
			}

			public Match_AtoAorB_alt_0_toB(Match_AtoAorB_alt_0_toB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_AtoAorB_alt_0_toB()
			{
			}

			public bool IsEqual(Match_AtoAorB_alt_0_toB that)
			{
				if(that==null) return false;
				if(_node_a != that._node_a) return false;
				if(_node__node0 != that._node__node0) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				return true;
			}
		}


		public class Extractor
		{
			public static List<GRGEN_MODEL.IA> Extract_a(List<IMatch_AtoAorB> matchList)
			{
				List<GRGEN_MODEL.IA> resultList = new List<GRGEN_MODEL.IA>(matchList.Count);
				foreach(IMatch_AtoAorB match in matchList)
					resultList.Add(match.node_a);
				return resultList;
			}
		}


		public static List<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB>)
				return ((List<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB instanceBearingAttributeForSearch_AtoAorB = new GRGEN_ACTIONS.Rule_AtoAorB.Match_AtoAorB();
		public static List<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB> Array_AtoAorB_groupBy_a(List<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB> list)
		{
			Dictionary<GRGEN_MODEL.IA, List<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB>> seenValues = new Dictionary<GRGEN_MODEL.IA, List<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_a)) {
					seenValues[list[pos].@node_a].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB> tempList = new List<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_a, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB> newList = new List<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB>();
			foreach(List<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB> Array_AtoAorB_keepOneForEachBy_a(List<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB> list)
		{
			List<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB> newList = new List<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB>();
			Dictionary<GRGEN_MODEL.IA, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_MODEL.IA, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_a)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_a, null);
				}
			}
			return newList;
		}
		public static int Array_AtoAorB_indexOfBy_a(IList<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB> list, GRGEN_MODEL.IA entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_a.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_AtoAorB_indexOfBy_a(IList<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB> list, GRGEN_MODEL.IA entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_a.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_AtoAorB_lastIndexOfBy_a(IList<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB> list, GRGEN_MODEL.IA entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_a.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_AtoAorB_lastIndexOfBy_a(IList<GRGEN_ACTIONS.Rule_AtoAorB.IMatch_AtoAorB> list, GRGEN_MODEL.IA entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_a.Equals(entry))
					return i;
			return -1;
		}
	}

	public class Rule_createComplex : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_createComplex instance = null;
		public static Rule_createComplex Instance { get { if(instance==null) { instance = new Rule_createComplex(); instance.initialize(); } return instance; } }

		public enum createComplex_NodeNums { };
		public enum createComplex_EdgeNums { };
		public enum createComplex_VariableNums { };
		public enum createComplex_SubNums { };
		public enum createComplex_AltNums { };
		public enum createComplex_IterNums { };





		public GRGEN_LGSP.PatternGraph pat_createComplex;


		private Rule_createComplex()
			: base("createComplex",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_createComplex+IMatch_createComplex",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_createComplex+Match_createComplex"
			)
		{
		}
		private void initialize()
		{
			bool[,] createComplex_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] createComplex_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] createComplex_isNodeTotallyHomomorphic = new bool[0];
			bool[] createComplex_isEdgeTotallyHomomorphic = new bool[0];
			pat_createComplex = new GRGEN_LGSP.PatternGraph(
				"createComplex",
				"",
				null, "createComplex",
				false, false,
				new GRGEN_LGSP.PatternNode[] {  }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[0, 0] ,
				new bool[0, 0] ,
				createComplex_isNodeHomomorphicGlobal,
				createComplex_isEdgeHomomorphicGlobal,
				createComplex_isNodeTotallyHomomorphic,
				createComplex_isEdgeTotallyHomomorphic
			);


			patternGraph = pat_createComplex;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_createComplex curMatch = (Match_createComplex)_curMatch;
			graph.SettingAddedNodeNames( createComplex_addedNodeNames );
			GRGEN_MODEL.@A node_a = GRGEN_MODEL.@A.CreateNode(graph);
			GRGEN_MODEL.@B node_b = GRGEN_MODEL.@B.CreateNode(graph);
			GRGEN_MODEL.@B node_b2 = GRGEN_MODEL.@B.CreateNode(graph);
			GRGEN_MODEL.@C node__node0 = GRGEN_MODEL.@C.CreateNode(graph);
			GRGEN_MODEL.@C node__node1 = GRGEN_MODEL.@C.CreateNode(graph);
			GRGEN_MODEL.@C node__node2 = GRGEN_MODEL.@C.CreateNode(graph);
			graph.SettingAddedEdgeNames( createComplex_addedEdgeNames );
			GRGEN_MODEL.@Edge edge__edge0 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_a, node_b);
			GRGEN_MODEL.@Edge edge__edge1 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_b, node_a);
			GRGEN_MODEL.@Edge edge__edge2 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_a, node_b2);
			GRGEN_MODEL.@Edge edge__edge3 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_b2, node_a);
			GRGEN_MODEL.@Edge edge__edge4 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_b, node__node0);
			GRGEN_MODEL.@Edge edge__edge5 = GRGEN_MODEL.@Edge.CreateEdge(graph, node__node0, node__node1);
			GRGEN_MODEL.@Edge edge__edge6 = GRGEN_MODEL.@Edge.CreateEdge(graph, node__node1, node__node2);
			actionEnv.SelectedMatchRewritten();
			return;
		}
		private static string[] createComplex_addedNodeNames = new string[] { "a", "b", "b2", "_node0", "_node1", "_node2" };
		private static string[] createComplex_addedEdgeNames = new string[] { "_edge0", "_edge1", "_edge2", "_edge3", "_edge4", "_edge5", "_edge6" };

		static Rule_createComplex() {
		}

		public interface IMatch_createComplex : GRGEN_LIBGR.IMatch
		{
			//Nodes
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_createComplex : GRGEN_LGSP.MatchListElement<Match_createComplex>, IMatch_createComplex
		{
			public enum createComplex_NodeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 0; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createComplex_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createComplex_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createComplex_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createComplex_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createComplex_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createComplex_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_createComplex.instance.pat_createComplex; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_createComplex(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_createComplex(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_createComplex nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_createComplex cur = this;
				while(cur != null) {
					Match_createComplex next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_createComplex that)
			{
			}

			public Match_createComplex(Match_createComplex that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_createComplex that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
			}

			public Match_createComplex(Match_createComplex that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_createComplex()
			{
			}

			public bool IsEqual(Match_createComplex that)
			{
				if(that==null) return false;
				return true;
			}
		}


		public class Extractor
		{
		}


		public static List<GRGEN_ACTIONS.Rule_createComplex.IMatch_createComplex> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_createComplex.IMatch_createComplex>)
				return ((List<GRGEN_ACTIONS.Rule_createComplex.IMatch_createComplex>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_createComplex.IMatch_createComplex>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_createComplex.IMatch_createComplex instanceBearingAttributeForSearch_createComplex = new GRGEN_ACTIONS.Rule_createComplex.Match_createComplex();
	}

	public class Rule_Complex : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_Complex instance = null;
		public static Rule_Complex Instance { get { if(instance==null) { instance = new Rule_Complex(); instance.initialize(); } return instance; } }

		public static GRGEN_LIBGR.NodeType[] Complex_node_a_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] Complex_node_b_AllowedTypes = null;
		public static bool[] Complex_node_a_IsAllowedType = null;
		public static bool[] Complex_node_b_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] Complex_edge__edge0_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] Complex_edge__edge1_AllowedTypes = null;
		public static bool[] Complex_edge__edge0_IsAllowedType = null;
		public static bool[] Complex_edge__edge1_IsAllowedType = null;
		public enum Complex_NodeNums { @a, @b, };
		public enum Complex_EdgeNums { @_edge0, @_edge1, };
		public enum Complex_VariableNums { };
		public enum Complex_SubNums { };
		public enum Complex_AltNums { @alt_0, };
		public enum Complex_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_Complex;

		public enum Complex_alt_0_CaseNums { @ExtendAv, @ExtendAv2, @ExtendNA2, };
		public static GRGEN_LIBGR.NodeType[] Complex_alt_0_ExtendAv_node_b2_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] Complex_alt_0_ExtendAv_node__node0_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] Complex_alt_0_ExtendAv_node__node1_AllowedTypes = null;
		public static bool[] Complex_alt_0_ExtendAv_node_b2_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendAv_node__node0_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendAv_node__node1_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] Complex_alt_0_ExtendAv_edge__edge0_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] Complex_alt_0_ExtendAv_edge__edge1_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] Complex_alt_0_ExtendAv_edge__edge2_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] Complex_alt_0_ExtendAv_edge__edge3_AllowedTypes = null;
		public static bool[] Complex_alt_0_ExtendAv_edge__edge0_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendAv_edge__edge1_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendAv_edge__edge2_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendAv_edge__edge3_IsAllowedType = null;
		public enum Complex_alt_0_ExtendAv_NodeNums { @a, @b2, @b, @_node0, @_node1, };
		public enum Complex_alt_0_ExtendAv_EdgeNums { @_edge0, @_edge1, @_edge2, @_edge3, };
		public enum Complex_alt_0_ExtendAv_VariableNums { };
		public enum Complex_alt_0_ExtendAv_SubNums { };
		public enum Complex_alt_0_ExtendAv_AltNums { };
		public enum Complex_alt_0_ExtendAv_IterNums { };



		public GRGEN_LGSP.PatternGraph Complex_alt_0_ExtendAv;

		public static GRGEN_LIBGR.NodeType[] Complex_alt_0_ExtendAv2_node_b2_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] Complex_alt_0_ExtendAv2_node__node0_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] Complex_alt_0_ExtendAv2_node__node1_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] Complex_alt_0_ExtendAv2_node__node2_AllowedTypes = null;
		public static bool[] Complex_alt_0_ExtendAv2_node_b2_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendAv2_node__node0_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendAv2_node__node1_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendAv2_node__node2_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] Complex_alt_0_ExtendAv2_edge__edge0_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] Complex_alt_0_ExtendAv2_edge__edge1_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] Complex_alt_0_ExtendAv2_edge__edge2_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] Complex_alt_0_ExtendAv2_edge__edge3_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] Complex_alt_0_ExtendAv2_edge__edge4_AllowedTypes = null;
		public static bool[] Complex_alt_0_ExtendAv2_edge__edge0_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendAv2_edge__edge1_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendAv2_edge__edge2_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendAv2_edge__edge3_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendAv2_edge__edge4_IsAllowedType = null;
		public enum Complex_alt_0_ExtendAv2_NodeNums { @a, @b2, @b, @_node0, @_node1, @_node2, };
		public enum Complex_alt_0_ExtendAv2_EdgeNums { @_edge0, @_edge1, @_edge2, @_edge3, @_edge4, };
		public enum Complex_alt_0_ExtendAv2_VariableNums { };
		public enum Complex_alt_0_ExtendAv2_SubNums { };
		public enum Complex_alt_0_ExtendAv2_AltNums { };
		public enum Complex_alt_0_ExtendAv2_IterNums { };



		public GRGEN_LGSP.PatternGraph Complex_alt_0_ExtendAv2;

		public static GRGEN_LIBGR.NodeType[] Complex_alt_0_ExtendNA2_node__node0_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] Complex_alt_0_ExtendNA2_node__node1_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] Complex_alt_0_ExtendNA2_node_b2_AllowedTypes = null;
		public static bool[] Complex_alt_0_ExtendNA2_node__node0_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendNA2_node__node1_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendNA2_node_b2_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] Complex_alt_0_ExtendNA2_edge__edge0_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] Complex_alt_0_ExtendNA2_edge__edge1_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] Complex_alt_0_ExtendNA2_edge__edge2_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] Complex_alt_0_ExtendNA2_edge__edge3_AllowedTypes = null;
		public static bool[] Complex_alt_0_ExtendNA2_edge__edge0_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendNA2_edge__edge1_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendNA2_edge__edge2_IsAllowedType = null;
		public static bool[] Complex_alt_0_ExtendNA2_edge__edge3_IsAllowedType = null;
		public enum Complex_alt_0_ExtendNA2_NodeNums { @a, @_node0, @_node1, @b, @b2, };
		public enum Complex_alt_0_ExtendNA2_EdgeNums { @_edge0, @_edge1, @_edge2, @_edge3, };
		public enum Complex_alt_0_ExtendNA2_VariableNums { };
		public enum Complex_alt_0_ExtendNA2_SubNums { };
		public enum Complex_alt_0_ExtendNA2_AltNums { };
		public enum Complex_alt_0_ExtendNA2_IterNums { };



		public GRGEN_LGSP.PatternGraph Complex_alt_0_ExtendNA2;


		private Rule_Complex()
			: base("Complex",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_Complex+IMatch_Complex",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_Complex+Match_Complex"
			)
		{
		}
		private void initialize()
		{
			bool[,] Complex_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] Complex_isEdgeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[] Complex_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] Complex_isEdgeTotallyHomomorphic = new bool[2] { false, false,  };
			GRGEN_LGSP.PatternNode Complex_node_a = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@A, GRGEN_MODEL.NodeType_A.typeVar, "GRGEN_MODEL.IA", "Complex_node_a", "a", Complex_node_a_AllowedTypes, Complex_node_a_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode Complex_node_b = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@B, GRGEN_MODEL.NodeType_B.typeVar, "GRGEN_MODEL.IB", "Complex_node_b", "b", Complex_node_b_AllowedTypes, Complex_node_b_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Complex_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Complex_edge__edge0", "_edge0", Complex_edge__edge0_AllowedTypes, Complex_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Complex_edge__edge1 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Complex_edge__edge1", "_edge1", Complex_edge__edge1_AllowedTypes, Complex_edge__edge1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			bool[,] Complex_alt_0_ExtendAv_isNodeHomomorphicGlobal = new bool[5, 5] {
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
			};
			bool[,] Complex_alt_0_ExtendAv_isEdgeHomomorphicGlobal = new bool[4, 4] {
				{ false, false, false, false, },
				{ false, false, false, false, },
				{ false, false, false, false, },
				{ false, false, false, false, },
			};
			bool[] Complex_alt_0_ExtendAv_isNodeTotallyHomomorphic = new bool[5] { false, false, false, false, false,  };
			bool[] Complex_alt_0_ExtendAv_isEdgeTotallyHomomorphic = new bool[4] { false, false, false, false,  };
			GRGEN_LGSP.PatternNode Complex_alt_0_ExtendAv_node_b2 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@B, GRGEN_MODEL.NodeType_B.typeVar, "GRGEN_MODEL.IB", "Complex_alt_0_ExtendAv_node_b2", "b2", Complex_alt_0_ExtendAv_node_b2_AllowedTypes, Complex_alt_0_ExtendAv_node_b2_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode Complex_alt_0_ExtendAv_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "Complex_alt_0_ExtendAv_node__node0", "_node0", Complex_alt_0_ExtendAv_node__node0_AllowedTypes, Complex_alt_0_ExtendAv_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode Complex_alt_0_ExtendAv_node__node1 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "Complex_alt_0_ExtendAv_node__node1", "_node1", Complex_alt_0_ExtendAv_node__node1_AllowedTypes, Complex_alt_0_ExtendAv_node__node1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Complex_alt_0_ExtendAv_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Complex_alt_0_ExtendAv_edge__edge0", "_edge0", Complex_alt_0_ExtendAv_edge__edge0_AllowedTypes, Complex_alt_0_ExtendAv_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Complex_alt_0_ExtendAv_edge__edge1 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Complex_alt_0_ExtendAv_edge__edge1", "_edge1", Complex_alt_0_ExtendAv_edge__edge1_AllowedTypes, Complex_alt_0_ExtendAv_edge__edge1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Complex_alt_0_ExtendAv_edge__edge2 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Complex_alt_0_ExtendAv_edge__edge2", "_edge2", Complex_alt_0_ExtendAv_edge__edge2_AllowedTypes, Complex_alt_0_ExtendAv_edge__edge2_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Complex_alt_0_ExtendAv_edge__edge3 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Complex_alt_0_ExtendAv_edge__edge3", "_edge3", Complex_alt_0_ExtendAv_edge__edge3_AllowedTypes, Complex_alt_0_ExtendAv_edge__edge3_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			Complex_alt_0_ExtendAv = new GRGEN_LGSP.PatternGraph(
				"ExtendAv",
				"Complex_alt_0_",
				null, "ExtendAv",
				false, false,
				new GRGEN_LGSP.PatternNode[] { Complex_node_a, Complex_alt_0_ExtendAv_node_b2, Complex_node_b, Complex_alt_0_ExtendAv_node__node0, Complex_alt_0_ExtendAv_node__node1 }, 
				new GRGEN_LGSP.PatternEdge[] { Complex_alt_0_ExtendAv_edge__edge0, Complex_alt_0_ExtendAv_edge__edge1, Complex_alt_0_ExtendAv_edge__edge2, Complex_alt_0_ExtendAv_edge__edge3 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[5, 5] {
					{ true, false, false, false, false, },
					{ false, true, false, false, false, },
					{ false, false, true, false, false, },
					{ false, false, false, true, false, },
					{ false, false, false, false, true, },
				},
				new bool[4, 4] {
					{ true, false, false, false, },
					{ false, true, false, false, },
					{ false, false, true, false, },
					{ false, false, false, true, },
				},
				Complex_alt_0_ExtendAv_isNodeHomomorphicGlobal,
				Complex_alt_0_ExtendAv_isEdgeHomomorphicGlobal,
				Complex_alt_0_ExtendAv_isNodeTotallyHomomorphic,
				Complex_alt_0_ExtendAv_isEdgeTotallyHomomorphic
			);
			Complex_alt_0_ExtendAv.edgeToSourceNode.Add(Complex_alt_0_ExtendAv_edge__edge0, Complex_node_a);
			Complex_alt_0_ExtendAv.edgeToTargetNode.Add(Complex_alt_0_ExtendAv_edge__edge0, Complex_alt_0_ExtendAv_node_b2);
			Complex_alt_0_ExtendAv.edgeToSourceNode.Add(Complex_alt_0_ExtendAv_edge__edge1, Complex_alt_0_ExtendAv_node_b2);
			Complex_alt_0_ExtendAv.edgeToTargetNode.Add(Complex_alt_0_ExtendAv_edge__edge1, Complex_node_a);
			Complex_alt_0_ExtendAv.edgeToSourceNode.Add(Complex_alt_0_ExtendAv_edge__edge2, Complex_node_b);
			Complex_alt_0_ExtendAv.edgeToTargetNode.Add(Complex_alt_0_ExtendAv_edge__edge2, Complex_alt_0_ExtendAv_node__node0);
			Complex_alt_0_ExtendAv.edgeToSourceNode.Add(Complex_alt_0_ExtendAv_edge__edge3, Complex_alt_0_ExtendAv_node__node0);
			Complex_alt_0_ExtendAv.edgeToTargetNode.Add(Complex_alt_0_ExtendAv_edge__edge3, Complex_alt_0_ExtendAv_node__node1);

			bool[,] Complex_alt_0_ExtendAv2_isNodeHomomorphicGlobal = new bool[6, 6] {
				{ false, false, false, false, false, false, },
				{ false, false, false, false, false, false, },
				{ false, false, false, false, false, false, },
				{ false, false, false, false, false, false, },
				{ false, false, false, false, false, false, },
				{ false, false, false, false, false, false, },
			};
			bool[,] Complex_alt_0_ExtendAv2_isEdgeHomomorphicGlobal = new bool[5, 5] {
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
			};
			bool[] Complex_alt_0_ExtendAv2_isNodeTotallyHomomorphic = new bool[6] { false, false, false, false, false, false,  };
			bool[] Complex_alt_0_ExtendAv2_isEdgeTotallyHomomorphic = new bool[5] { false, false, false, false, false,  };
			GRGEN_LGSP.PatternNode Complex_alt_0_ExtendAv2_node_b2 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@B, GRGEN_MODEL.NodeType_B.typeVar, "GRGEN_MODEL.IB", "Complex_alt_0_ExtendAv2_node_b2", "b2", Complex_alt_0_ExtendAv2_node_b2_AllowedTypes, Complex_alt_0_ExtendAv2_node_b2_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode Complex_alt_0_ExtendAv2_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "Complex_alt_0_ExtendAv2_node__node0", "_node0", Complex_alt_0_ExtendAv2_node__node0_AllowedTypes, Complex_alt_0_ExtendAv2_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode Complex_alt_0_ExtendAv2_node__node1 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "Complex_alt_0_ExtendAv2_node__node1", "_node1", Complex_alt_0_ExtendAv2_node__node1_AllowedTypes, Complex_alt_0_ExtendAv2_node__node1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode Complex_alt_0_ExtendAv2_node__node2 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "Complex_alt_0_ExtendAv2_node__node2", "_node2", Complex_alt_0_ExtendAv2_node__node2_AllowedTypes, Complex_alt_0_ExtendAv2_node__node2_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Complex_alt_0_ExtendAv2_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Complex_alt_0_ExtendAv2_edge__edge0", "_edge0", Complex_alt_0_ExtendAv2_edge__edge0_AllowedTypes, Complex_alt_0_ExtendAv2_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Complex_alt_0_ExtendAv2_edge__edge1 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Complex_alt_0_ExtendAv2_edge__edge1", "_edge1", Complex_alt_0_ExtendAv2_edge__edge1_AllowedTypes, Complex_alt_0_ExtendAv2_edge__edge1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Complex_alt_0_ExtendAv2_edge__edge2 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Complex_alt_0_ExtendAv2_edge__edge2", "_edge2", Complex_alt_0_ExtendAv2_edge__edge2_AllowedTypes, Complex_alt_0_ExtendAv2_edge__edge2_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Complex_alt_0_ExtendAv2_edge__edge3 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Complex_alt_0_ExtendAv2_edge__edge3", "_edge3", Complex_alt_0_ExtendAv2_edge__edge3_AllowedTypes, Complex_alt_0_ExtendAv2_edge__edge3_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Complex_alt_0_ExtendAv2_edge__edge4 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Complex_alt_0_ExtendAv2_edge__edge4", "_edge4", Complex_alt_0_ExtendAv2_edge__edge4_AllowedTypes, Complex_alt_0_ExtendAv2_edge__edge4_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			Complex_alt_0_ExtendAv2 = new GRGEN_LGSP.PatternGraph(
				"ExtendAv2",
				"Complex_alt_0_",
				null, "ExtendAv2",
				false, false,
				new GRGEN_LGSP.PatternNode[] { Complex_node_a, Complex_alt_0_ExtendAv2_node_b2, Complex_node_b, Complex_alt_0_ExtendAv2_node__node0, Complex_alt_0_ExtendAv2_node__node1, Complex_alt_0_ExtendAv2_node__node2 }, 
				new GRGEN_LGSP.PatternEdge[] { Complex_alt_0_ExtendAv2_edge__edge0, Complex_alt_0_ExtendAv2_edge__edge1, Complex_alt_0_ExtendAv2_edge__edge2, Complex_alt_0_ExtendAv2_edge__edge3, Complex_alt_0_ExtendAv2_edge__edge4 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[6, 6] {
					{ true, false, false, false, false, false, },
					{ false, true, false, false, false, false, },
					{ false, false, true, false, false, false, },
					{ false, false, false, true, false, false, },
					{ false, false, false, false, true, false, },
					{ false, false, false, false, false, true, },
				},
				new bool[5, 5] {
					{ true, false, false, false, false, },
					{ false, true, false, false, false, },
					{ false, false, true, false, false, },
					{ false, false, false, true, false, },
					{ false, false, false, false, true, },
				},
				Complex_alt_0_ExtendAv2_isNodeHomomorphicGlobal,
				Complex_alt_0_ExtendAv2_isEdgeHomomorphicGlobal,
				Complex_alt_0_ExtendAv2_isNodeTotallyHomomorphic,
				Complex_alt_0_ExtendAv2_isEdgeTotallyHomomorphic
			);
			Complex_alt_0_ExtendAv2.edgeToSourceNode.Add(Complex_alt_0_ExtendAv2_edge__edge0, Complex_node_a);
			Complex_alt_0_ExtendAv2.edgeToTargetNode.Add(Complex_alt_0_ExtendAv2_edge__edge0, Complex_alt_0_ExtendAv2_node_b2);
			Complex_alt_0_ExtendAv2.edgeToSourceNode.Add(Complex_alt_0_ExtendAv2_edge__edge1, Complex_alt_0_ExtendAv2_node_b2);
			Complex_alt_0_ExtendAv2.edgeToTargetNode.Add(Complex_alt_0_ExtendAv2_edge__edge1, Complex_node_a);
			Complex_alt_0_ExtendAv2.edgeToSourceNode.Add(Complex_alt_0_ExtendAv2_edge__edge2, Complex_node_b);
			Complex_alt_0_ExtendAv2.edgeToTargetNode.Add(Complex_alt_0_ExtendAv2_edge__edge2, Complex_alt_0_ExtendAv2_node__node0);
			Complex_alt_0_ExtendAv2.edgeToSourceNode.Add(Complex_alt_0_ExtendAv2_edge__edge3, Complex_alt_0_ExtendAv2_node__node0);
			Complex_alt_0_ExtendAv2.edgeToTargetNode.Add(Complex_alt_0_ExtendAv2_edge__edge3, Complex_alt_0_ExtendAv2_node__node1);
			Complex_alt_0_ExtendAv2.edgeToSourceNode.Add(Complex_alt_0_ExtendAv2_edge__edge4, Complex_alt_0_ExtendAv2_node__node1);
			Complex_alt_0_ExtendAv2.edgeToTargetNode.Add(Complex_alt_0_ExtendAv2_edge__edge4, Complex_alt_0_ExtendAv2_node__node2);

			bool[,] Complex_alt_0_ExtendNA2_isNodeHomomorphicGlobal = new bool[5, 5] {
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
			};
			bool[,] Complex_alt_0_ExtendNA2_isEdgeHomomorphicGlobal = new bool[4, 4] {
				{ false, false, false, false, },
				{ false, false, false, false, },
				{ false, false, false, false, },
				{ false, false, false, false, },
			};
			bool[] Complex_alt_0_ExtendNA2_isNodeTotallyHomomorphic = new bool[5] { false, false, false, false, false,  };
			bool[] Complex_alt_0_ExtendNA2_isEdgeTotallyHomomorphic = new bool[4] { false, false, false, false,  };
			GRGEN_LGSP.PatternNode Complex_alt_0_ExtendNA2_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "Complex_alt_0_ExtendNA2_node__node0", "_node0", Complex_alt_0_ExtendNA2_node__node0_AllowedTypes, Complex_alt_0_ExtendNA2_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode Complex_alt_0_ExtendNA2_node__node1 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "Complex_alt_0_ExtendNA2_node__node1", "_node1", Complex_alt_0_ExtendNA2_node__node1_AllowedTypes, Complex_alt_0_ExtendNA2_node__node1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode Complex_alt_0_ExtendNA2_node_b2 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@B, GRGEN_MODEL.NodeType_B.typeVar, "GRGEN_MODEL.IB", "Complex_alt_0_ExtendNA2_node_b2", "b2", Complex_alt_0_ExtendNA2_node_b2_AllowedTypes, Complex_alt_0_ExtendNA2_node_b2_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Complex_alt_0_ExtendNA2_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Complex_alt_0_ExtendNA2_edge__edge0", "_edge0", Complex_alt_0_ExtendNA2_edge__edge0_AllowedTypes, Complex_alt_0_ExtendNA2_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Complex_alt_0_ExtendNA2_edge__edge1 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Complex_alt_0_ExtendNA2_edge__edge1", "_edge1", Complex_alt_0_ExtendNA2_edge__edge1_AllowedTypes, Complex_alt_0_ExtendNA2_edge__edge1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Complex_alt_0_ExtendNA2_edge__edge2 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Complex_alt_0_ExtendNA2_edge__edge2", "_edge2", Complex_alt_0_ExtendNA2_edge__edge2_AllowedTypes, Complex_alt_0_ExtendNA2_edge__edge2_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Complex_alt_0_ExtendNA2_edge__edge3 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Complex_alt_0_ExtendNA2_edge__edge3", "_edge3", Complex_alt_0_ExtendNA2_edge__edge3_AllowedTypes, Complex_alt_0_ExtendNA2_edge__edge3_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			Complex_alt_0_ExtendNA2 = new GRGEN_LGSP.PatternGraph(
				"ExtendNA2",
				"Complex_alt_0_",
				null, "ExtendNA2",
				false, false,
				new GRGEN_LGSP.PatternNode[] { Complex_node_a, Complex_alt_0_ExtendNA2_node__node0, Complex_alt_0_ExtendNA2_node__node1, Complex_node_b, Complex_alt_0_ExtendNA2_node_b2 }, 
				new GRGEN_LGSP.PatternEdge[] { Complex_alt_0_ExtendNA2_edge__edge0, Complex_alt_0_ExtendNA2_edge__edge1, Complex_alt_0_ExtendNA2_edge__edge2, Complex_alt_0_ExtendNA2_edge__edge3 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[5, 5] {
					{ true, false, false, false, false, },
					{ false, true, false, false, false, },
					{ false, false, true, false, false, },
					{ false, false, false, true, false, },
					{ false, false, false, false, true, },
				},
				new bool[4, 4] {
					{ true, false, false, false, },
					{ false, true, false, false, },
					{ false, false, true, false, },
					{ false, false, false, true, },
				},
				Complex_alt_0_ExtendNA2_isNodeHomomorphicGlobal,
				Complex_alt_0_ExtendNA2_isEdgeHomomorphicGlobal,
				Complex_alt_0_ExtendNA2_isNodeTotallyHomomorphic,
				Complex_alt_0_ExtendNA2_isEdgeTotallyHomomorphic
			);
			Complex_alt_0_ExtendNA2.edgeToSourceNode.Add(Complex_alt_0_ExtendNA2_edge__edge0, Complex_node_a);
			Complex_alt_0_ExtendNA2.edgeToTargetNode.Add(Complex_alt_0_ExtendNA2_edge__edge0, Complex_alt_0_ExtendNA2_node__node0);
			Complex_alt_0_ExtendNA2.edgeToSourceNode.Add(Complex_alt_0_ExtendNA2_edge__edge1, Complex_alt_0_ExtendNA2_node__node0);
			Complex_alt_0_ExtendNA2.edgeToTargetNode.Add(Complex_alt_0_ExtendNA2_edge__edge1, Complex_alt_0_ExtendNA2_node__node1);
			Complex_alt_0_ExtendNA2.edgeToSourceNode.Add(Complex_alt_0_ExtendNA2_edge__edge2, Complex_node_b);
			Complex_alt_0_ExtendNA2.edgeToTargetNode.Add(Complex_alt_0_ExtendNA2_edge__edge2, Complex_alt_0_ExtendNA2_node_b2);
			Complex_alt_0_ExtendNA2.edgeToSourceNode.Add(Complex_alt_0_ExtendNA2_edge__edge3, Complex_alt_0_ExtendNA2_node_b2);
			Complex_alt_0_ExtendNA2.edgeToTargetNode.Add(Complex_alt_0_ExtendNA2_edge__edge3, Complex_node_b);

			GRGEN_LGSP.Alternative Complex_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "Complex_", new GRGEN_LGSP.PatternGraph[] { Complex_alt_0_ExtendAv, Complex_alt_0_ExtendAv2, Complex_alt_0_ExtendNA2 } );

			pat_Complex = new GRGEN_LGSP.PatternGraph(
				"Complex",
				"",
				null, "Complex",
				false, false,
				new GRGEN_LGSP.PatternNode[] { Complex_node_a, Complex_node_b }, 
				new GRGEN_LGSP.PatternEdge[] { Complex_edge__edge0, Complex_edge__edge1 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { Complex_alt_0,  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				new bool[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				Complex_isNodeHomomorphicGlobal,
				Complex_isEdgeHomomorphicGlobal,
				Complex_isNodeTotallyHomomorphic,
				Complex_isEdgeTotallyHomomorphic
			);
			pat_Complex.edgeToSourceNode.Add(Complex_edge__edge0, Complex_node_a);
			pat_Complex.edgeToTargetNode.Add(Complex_edge__edge0, Complex_node_b);
			pat_Complex.edgeToSourceNode.Add(Complex_edge__edge1, Complex_node_b);
			pat_Complex.edgeToTargetNode.Add(Complex_edge__edge1, Complex_node_a);
			Complex_alt_0_ExtendAv.embeddingGraph = pat_Complex;
			Complex_alt_0_ExtendAv2.embeddingGraph = pat_Complex;
			Complex_alt_0_ExtendNA2.embeddingGraph = pat_Complex;

			Complex_node_a.pointOfDefinition = pat_Complex;
			Complex_node_b.pointOfDefinition = pat_Complex;
			Complex_edge__edge0.pointOfDefinition = pat_Complex;
			Complex_edge__edge1.pointOfDefinition = pat_Complex;
			Complex_alt_0_ExtendAv_node_b2.pointOfDefinition = Complex_alt_0_ExtendAv;
			Complex_alt_0_ExtendAv_node__node0.pointOfDefinition = Complex_alt_0_ExtendAv;
			Complex_alt_0_ExtendAv_node__node1.pointOfDefinition = Complex_alt_0_ExtendAv;
			Complex_alt_0_ExtendAv_edge__edge0.pointOfDefinition = Complex_alt_0_ExtendAv;
			Complex_alt_0_ExtendAv_edge__edge1.pointOfDefinition = Complex_alt_0_ExtendAv;
			Complex_alt_0_ExtendAv_edge__edge2.pointOfDefinition = Complex_alt_0_ExtendAv;
			Complex_alt_0_ExtendAv_edge__edge3.pointOfDefinition = Complex_alt_0_ExtendAv;
			Complex_alt_0_ExtendAv2_node_b2.pointOfDefinition = Complex_alt_0_ExtendAv2;
			Complex_alt_0_ExtendAv2_node__node0.pointOfDefinition = Complex_alt_0_ExtendAv2;
			Complex_alt_0_ExtendAv2_node__node1.pointOfDefinition = Complex_alt_0_ExtendAv2;
			Complex_alt_0_ExtendAv2_node__node2.pointOfDefinition = Complex_alt_0_ExtendAv2;
			Complex_alt_0_ExtendAv2_edge__edge0.pointOfDefinition = Complex_alt_0_ExtendAv2;
			Complex_alt_0_ExtendAv2_edge__edge1.pointOfDefinition = Complex_alt_0_ExtendAv2;
			Complex_alt_0_ExtendAv2_edge__edge2.pointOfDefinition = Complex_alt_0_ExtendAv2;
			Complex_alt_0_ExtendAv2_edge__edge3.pointOfDefinition = Complex_alt_0_ExtendAv2;
			Complex_alt_0_ExtendAv2_edge__edge4.pointOfDefinition = Complex_alt_0_ExtendAv2;
			Complex_alt_0_ExtendNA2_node__node0.pointOfDefinition = Complex_alt_0_ExtendNA2;
			Complex_alt_0_ExtendNA2_node__node1.pointOfDefinition = Complex_alt_0_ExtendNA2;
			Complex_alt_0_ExtendNA2_node_b2.pointOfDefinition = Complex_alt_0_ExtendNA2;
			Complex_alt_0_ExtendNA2_edge__edge0.pointOfDefinition = Complex_alt_0_ExtendNA2;
			Complex_alt_0_ExtendNA2_edge__edge1.pointOfDefinition = Complex_alt_0_ExtendNA2;
			Complex_alt_0_ExtendNA2_edge__edge2.pointOfDefinition = Complex_alt_0_ExtendNA2;
			Complex_alt_0_ExtendNA2_edge__edge3.pointOfDefinition = Complex_alt_0_ExtendNA2;

			patternGraph = pat_Complex;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_Complex curMatch = (Match_Complex)_curMatch;
			IMatch_Complex_alt_0 alternative_alt_0 = curMatch._alt_0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		public void Complex_alt_0_ExtendAv_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_Complex_alt_0_ExtendAv curMatch = (Match_Complex_alt_0_ExtendAv)_curMatch;
		}

		public void Complex_alt_0_ExtendAv2_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_Complex_alt_0_ExtendAv2 curMatch = (Match_Complex_alt_0_ExtendAv2)_curMatch;
		}

		public void Complex_alt_0_ExtendNA2_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_Complex_alt_0_ExtendNA2 curMatch = (Match_Complex_alt_0_ExtendNA2)_curMatch;
		}

		static Rule_Complex() {
		}

		public interface IMatch_Complex : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_MODEL.IA node_a { get; set; }
			GRGEN_MODEL.IB node_b { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge1 { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			IMatch_Complex_alt_0 alt_0 { get; }
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_Complex_alt_0 : GRGEN_LIBGR.IMatch
		{
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_Complex_alt_0_ExtendAv : IMatch_Complex_alt_0
		{
			//Nodes
			GRGEN_MODEL.IA node_a { get; set; }
			GRGEN_MODEL.IB node_b2 { get; set; }
			GRGEN_MODEL.IB node_b { get; set; }
			GRGEN_MODEL.IC node__node0 { get; set; }
			GRGEN_MODEL.IC node__node1 { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge1 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge2 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge3 { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_Complex_alt_0_ExtendAv2 : IMatch_Complex_alt_0
		{
			//Nodes
			GRGEN_MODEL.IA node_a { get; set; }
			GRGEN_MODEL.IB node_b2 { get; set; }
			GRGEN_MODEL.IB node_b { get; set; }
			GRGEN_MODEL.IC node__node0 { get; set; }
			GRGEN_MODEL.IC node__node1 { get; set; }
			GRGEN_MODEL.IC node__node2 { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge1 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge2 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge3 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge4 { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_Complex_alt_0_ExtendNA2 : IMatch_Complex_alt_0
		{
			//Nodes
			GRGEN_MODEL.IA node_a { get; set; }
			GRGEN_MODEL.IC node__node0 { get; set; }
			GRGEN_MODEL.IC node__node1 { get; set; }
			GRGEN_MODEL.IB node_b { get; set; }
			GRGEN_MODEL.IB node_b2 { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge1 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge2 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge3 { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_Complex : GRGEN_LGSP.MatchListElement<Match_Complex>, IMatch_Complex
		{
			public GRGEN_MODEL.IA node_a { get { return (GRGEN_MODEL.IA)_node_a; } set { _node_a = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b { get { return (GRGEN_MODEL.IB)_node_b; } set { _node_b = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_a;
			public GRGEN_LGSP.LGSPNode _node_b;
			public enum Complex_NodeNums { @a, @b, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 2; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)Complex_NodeNums.@a: return _node_a;
				case (int)Complex_NodeNums.@b: return _node_b;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "a": return _node_a;
				case "b": return _node_b;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "a": _node_a = (GRGEN_LGSP.LGSPNode)value; break;
				case "b": _node_b = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge__edge0 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge1 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge1; } set { _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public GRGEN_LGSP.LGSPEdge _edge__edge1;
			public enum Complex_EdgeNums { @_edge0, @_edge1, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 2; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)Complex_EdgeNums.@_edge0: return _edge__edge0;
				case (int)Complex_EdgeNums.@_edge1: return _edge__edge1;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "_edge0": return _edge__edge0;
				case "_edge1": return _edge__edge1;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "_edge0": _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge1": _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum Complex_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum Complex_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public IMatch_Complex_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_Complex_alt_0 _alt_0;
			public enum Complex_AltNums { @alt_0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 1; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				case (int)Complex_AltNums.@alt_0: return _alt_0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				case "alt_0": return _alt_0;
				default: return null;
				}
			}

			public enum Complex_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum Complex_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_Complex.instance.pat_Complex; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_Complex(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_Complex(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_Complex nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_Complex cur = this;
				while(cur != null) {
					Match_Complex next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_Complex that)
			{
				_node_a = that._node_a;
				_node_b = that._node_b;
				_edge__edge0 = that._edge__edge0;
				_edge__edge1 = that._edge__edge1;
				_alt_0 = that._alt_0;
			}

			public Match_Complex(Match_Complex that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_Complex that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_a = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_a];
				_node_b = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				_edge__edge1 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge1];
				if(that._alt_0 is Match_Complex_alt_0_ExtendAv)
					_alt_0 = new Match_Complex_alt_0_ExtendAv((Match_Complex_alt_0_ExtendAv)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_Complex_alt_0_ExtendAv2)
					_alt_0 = new Match_Complex_alt_0_ExtendAv2((Match_Complex_alt_0_ExtendAv2)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_Complex_alt_0_ExtendNA2)
					_alt_0 = new Match_Complex_alt_0_ExtendNA2((Match_Complex_alt_0_ExtendNA2)that._alt_0, oldToNewMap);
			}

			public Match_Complex(Match_Complex that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_Complex()
			{
			}

			public bool IsEqual(Match_Complex that)
			{
				if(that==null) return false;
				if(_node_a != that._node_a) return false;
				if(_node_b != that._node_b) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(_edge__edge1 != that._edge__edge1) return false;
				if(_alt_0 is Match_Complex_alt_0_ExtendAv && !(_alt_0 as Match_Complex_alt_0_ExtendAv).IsEqual(that._alt_0 as Match_Complex_alt_0_ExtendAv)) return false;
				if(_alt_0 is Match_Complex_alt_0_ExtendAv2 && !(_alt_0 as Match_Complex_alt_0_ExtendAv2).IsEqual(that._alt_0 as Match_Complex_alt_0_ExtendAv2)) return false;
				if(_alt_0 is Match_Complex_alt_0_ExtendNA2 && !(_alt_0 as Match_Complex_alt_0_ExtendNA2).IsEqual(that._alt_0 as Match_Complex_alt_0_ExtendNA2)) return false;
				return true;
			}
		}

		public class Match_Complex_alt_0_ExtendAv : GRGEN_LGSP.MatchListElement<Match_Complex_alt_0_ExtendAv>, IMatch_Complex_alt_0_ExtendAv
		{
			public GRGEN_MODEL.IA node_a { get { return (GRGEN_MODEL.IA)_node_a; } set { _node_a = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b2 { get { return (GRGEN_MODEL.IB)_node_b2; } set { _node_b2 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b { get { return (GRGEN_MODEL.IB)_node_b; } set { _node_b = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IC node__node0 { get { return (GRGEN_MODEL.IC)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IC node__node1 { get { return (GRGEN_MODEL.IC)_node__node1; } set { _node__node1 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_a;
			public GRGEN_LGSP.LGSPNode _node_b2;
			public GRGEN_LGSP.LGSPNode _node_b;
			public GRGEN_LGSP.LGSPNode _node__node0;
			public GRGEN_LGSP.LGSPNode _node__node1;
			public enum Complex_alt_0_ExtendAv_NodeNums { @a, @b2, @b, @_node0, @_node1, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 5; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)Complex_alt_0_ExtendAv_NodeNums.@a: return _node_a;
				case (int)Complex_alt_0_ExtendAv_NodeNums.@b2: return _node_b2;
				case (int)Complex_alt_0_ExtendAv_NodeNums.@b: return _node_b;
				case (int)Complex_alt_0_ExtendAv_NodeNums.@_node0: return _node__node0;
				case (int)Complex_alt_0_ExtendAv_NodeNums.@_node1: return _node__node1;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "a": return _node_a;
				case "b2": return _node_b2;
				case "b": return _node_b;
				case "_node0": return _node__node0;
				case "_node1": return _node__node1;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "a": _node_a = (GRGEN_LGSP.LGSPNode)value; break;
				case "b2": _node_b2 = (GRGEN_LGSP.LGSPNode)value; break;
				case "b": _node_b = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node1": _node__node1 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge__edge0 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge1 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge1; } set { _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge2 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge2; } set { _edge__edge2 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge3 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge3; } set { _edge__edge3 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public GRGEN_LGSP.LGSPEdge _edge__edge1;
			public GRGEN_LGSP.LGSPEdge _edge__edge2;
			public GRGEN_LGSP.LGSPEdge _edge__edge3;
			public enum Complex_alt_0_ExtendAv_EdgeNums { @_edge0, @_edge1, @_edge2, @_edge3, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 4; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)Complex_alt_0_ExtendAv_EdgeNums.@_edge0: return _edge__edge0;
				case (int)Complex_alt_0_ExtendAv_EdgeNums.@_edge1: return _edge__edge1;
				case (int)Complex_alt_0_ExtendAv_EdgeNums.@_edge2: return _edge__edge2;
				case (int)Complex_alt_0_ExtendAv_EdgeNums.@_edge3: return _edge__edge3;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "_edge0": return _edge__edge0;
				case "_edge1": return _edge__edge1;
				case "_edge2": return _edge__edge2;
				case "_edge3": return _edge__edge3;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "_edge0": _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge1": _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge2": _edge__edge2 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge3": _edge__edge3 = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum Complex_alt_0_ExtendAv_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum Complex_alt_0_ExtendAv_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum Complex_alt_0_ExtendAv_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum Complex_alt_0_ExtendAv_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum Complex_alt_0_ExtendAv_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_Complex.instance.Complex_alt_0_ExtendAv; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_Complex_alt_0_ExtendAv(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_Complex_alt_0_ExtendAv(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_Complex_alt_0_ExtendAv nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_Complex_alt_0_ExtendAv cur = this;
				while(cur != null) {
					Match_Complex_alt_0_ExtendAv next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_Complex_alt_0_ExtendAv that)
			{
				_node_a = that._node_a;
				_node_b2 = that._node_b2;
				_node_b = that._node_b;
				_node__node0 = that._node__node0;
				_node__node1 = that._node__node1;
				_edge__edge0 = that._edge__edge0;
				_edge__edge1 = that._edge__edge1;
				_edge__edge2 = that._edge__edge2;
				_edge__edge3 = that._edge__edge3;
			}

			public Match_Complex_alt_0_ExtendAv(Match_Complex_alt_0_ExtendAv that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_Complex_alt_0_ExtendAv that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_a = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_a];
				_node_b2 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b2];
				_node_b = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b];
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
				_node__node1 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node1];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				_edge__edge1 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge1];
				_edge__edge2 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge2];
				_edge__edge3 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge3];
			}

			public Match_Complex_alt_0_ExtendAv(Match_Complex_alt_0_ExtendAv that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_Complex_alt_0_ExtendAv()
			{
			}

			public bool IsEqual(Match_Complex_alt_0_ExtendAv that)
			{
				if(that==null) return false;
				if(_node_a != that._node_a) return false;
				if(_node_b2 != that._node_b2) return false;
				if(_node_b != that._node_b) return false;
				if(_node__node0 != that._node__node0) return false;
				if(_node__node1 != that._node__node1) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(_edge__edge1 != that._edge__edge1) return false;
				if(_edge__edge2 != that._edge__edge2) return false;
				if(_edge__edge3 != that._edge__edge3) return false;
				return true;
			}
		}

		public class Match_Complex_alt_0_ExtendAv2 : GRGEN_LGSP.MatchListElement<Match_Complex_alt_0_ExtendAv2>, IMatch_Complex_alt_0_ExtendAv2
		{
			public GRGEN_MODEL.IA node_a { get { return (GRGEN_MODEL.IA)_node_a; } set { _node_a = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b2 { get { return (GRGEN_MODEL.IB)_node_b2; } set { _node_b2 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b { get { return (GRGEN_MODEL.IB)_node_b; } set { _node_b = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IC node__node0 { get { return (GRGEN_MODEL.IC)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IC node__node1 { get { return (GRGEN_MODEL.IC)_node__node1; } set { _node__node1 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IC node__node2 { get { return (GRGEN_MODEL.IC)_node__node2; } set { _node__node2 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_a;
			public GRGEN_LGSP.LGSPNode _node_b2;
			public GRGEN_LGSP.LGSPNode _node_b;
			public GRGEN_LGSP.LGSPNode _node__node0;
			public GRGEN_LGSP.LGSPNode _node__node1;
			public GRGEN_LGSP.LGSPNode _node__node2;
			public enum Complex_alt_0_ExtendAv2_NodeNums { @a, @b2, @b, @_node0, @_node1, @_node2, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 6; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)Complex_alt_0_ExtendAv2_NodeNums.@a: return _node_a;
				case (int)Complex_alt_0_ExtendAv2_NodeNums.@b2: return _node_b2;
				case (int)Complex_alt_0_ExtendAv2_NodeNums.@b: return _node_b;
				case (int)Complex_alt_0_ExtendAv2_NodeNums.@_node0: return _node__node0;
				case (int)Complex_alt_0_ExtendAv2_NodeNums.@_node1: return _node__node1;
				case (int)Complex_alt_0_ExtendAv2_NodeNums.@_node2: return _node__node2;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "a": return _node_a;
				case "b2": return _node_b2;
				case "b": return _node_b;
				case "_node0": return _node__node0;
				case "_node1": return _node__node1;
				case "_node2": return _node__node2;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "a": _node_a = (GRGEN_LGSP.LGSPNode)value; break;
				case "b2": _node_b2 = (GRGEN_LGSP.LGSPNode)value; break;
				case "b": _node_b = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node1": _node__node1 = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node2": _node__node2 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge__edge0 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge1 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge1; } set { _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge2 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge2; } set { _edge__edge2 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge3 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge3; } set { _edge__edge3 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge4 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge4; } set { _edge__edge4 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public GRGEN_LGSP.LGSPEdge _edge__edge1;
			public GRGEN_LGSP.LGSPEdge _edge__edge2;
			public GRGEN_LGSP.LGSPEdge _edge__edge3;
			public GRGEN_LGSP.LGSPEdge _edge__edge4;
			public enum Complex_alt_0_ExtendAv2_EdgeNums { @_edge0, @_edge1, @_edge2, @_edge3, @_edge4, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 5; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)Complex_alt_0_ExtendAv2_EdgeNums.@_edge0: return _edge__edge0;
				case (int)Complex_alt_0_ExtendAv2_EdgeNums.@_edge1: return _edge__edge1;
				case (int)Complex_alt_0_ExtendAv2_EdgeNums.@_edge2: return _edge__edge2;
				case (int)Complex_alt_0_ExtendAv2_EdgeNums.@_edge3: return _edge__edge3;
				case (int)Complex_alt_0_ExtendAv2_EdgeNums.@_edge4: return _edge__edge4;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "_edge0": return _edge__edge0;
				case "_edge1": return _edge__edge1;
				case "_edge2": return _edge__edge2;
				case "_edge3": return _edge__edge3;
				case "_edge4": return _edge__edge4;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "_edge0": _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge1": _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge2": _edge__edge2 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge3": _edge__edge3 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge4": _edge__edge4 = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum Complex_alt_0_ExtendAv2_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum Complex_alt_0_ExtendAv2_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum Complex_alt_0_ExtendAv2_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum Complex_alt_0_ExtendAv2_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum Complex_alt_0_ExtendAv2_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_Complex.instance.Complex_alt_0_ExtendAv2; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_Complex_alt_0_ExtendAv2(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_Complex_alt_0_ExtendAv2(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_Complex_alt_0_ExtendAv2 nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_Complex_alt_0_ExtendAv2 cur = this;
				while(cur != null) {
					Match_Complex_alt_0_ExtendAv2 next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_Complex_alt_0_ExtendAv2 that)
			{
				_node_a = that._node_a;
				_node_b2 = that._node_b2;
				_node_b = that._node_b;
				_node__node0 = that._node__node0;
				_node__node1 = that._node__node1;
				_node__node2 = that._node__node2;
				_edge__edge0 = that._edge__edge0;
				_edge__edge1 = that._edge__edge1;
				_edge__edge2 = that._edge__edge2;
				_edge__edge3 = that._edge__edge3;
				_edge__edge4 = that._edge__edge4;
			}

			public Match_Complex_alt_0_ExtendAv2(Match_Complex_alt_0_ExtendAv2 that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_Complex_alt_0_ExtendAv2 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_a = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_a];
				_node_b2 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b2];
				_node_b = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b];
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
				_node__node1 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node1];
				_node__node2 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node2];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				_edge__edge1 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge1];
				_edge__edge2 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge2];
				_edge__edge3 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge3];
				_edge__edge4 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge4];
			}

			public Match_Complex_alt_0_ExtendAv2(Match_Complex_alt_0_ExtendAv2 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_Complex_alt_0_ExtendAv2()
			{
			}

			public bool IsEqual(Match_Complex_alt_0_ExtendAv2 that)
			{
				if(that==null) return false;
				if(_node_a != that._node_a) return false;
				if(_node_b2 != that._node_b2) return false;
				if(_node_b != that._node_b) return false;
				if(_node__node0 != that._node__node0) return false;
				if(_node__node1 != that._node__node1) return false;
				if(_node__node2 != that._node__node2) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(_edge__edge1 != that._edge__edge1) return false;
				if(_edge__edge2 != that._edge__edge2) return false;
				if(_edge__edge3 != that._edge__edge3) return false;
				if(_edge__edge4 != that._edge__edge4) return false;
				return true;
			}
		}

		public class Match_Complex_alt_0_ExtendNA2 : GRGEN_LGSP.MatchListElement<Match_Complex_alt_0_ExtendNA2>, IMatch_Complex_alt_0_ExtendNA2
		{
			public GRGEN_MODEL.IA node_a { get { return (GRGEN_MODEL.IA)_node_a; } set { _node_a = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IC node__node0 { get { return (GRGEN_MODEL.IC)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IC node__node1 { get { return (GRGEN_MODEL.IC)_node__node1; } set { _node__node1 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b { get { return (GRGEN_MODEL.IB)_node_b; } set { _node_b = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b2 { get { return (GRGEN_MODEL.IB)_node_b2; } set { _node_b2 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_a;
			public GRGEN_LGSP.LGSPNode _node__node0;
			public GRGEN_LGSP.LGSPNode _node__node1;
			public GRGEN_LGSP.LGSPNode _node_b;
			public GRGEN_LGSP.LGSPNode _node_b2;
			public enum Complex_alt_0_ExtendNA2_NodeNums { @a, @_node0, @_node1, @b, @b2, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 5; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)Complex_alt_0_ExtendNA2_NodeNums.@a: return _node_a;
				case (int)Complex_alt_0_ExtendNA2_NodeNums.@_node0: return _node__node0;
				case (int)Complex_alt_0_ExtendNA2_NodeNums.@_node1: return _node__node1;
				case (int)Complex_alt_0_ExtendNA2_NodeNums.@b: return _node_b;
				case (int)Complex_alt_0_ExtendNA2_NodeNums.@b2: return _node_b2;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "a": return _node_a;
				case "_node0": return _node__node0;
				case "_node1": return _node__node1;
				case "b": return _node_b;
				case "b2": return _node_b2;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "a": _node_a = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node1": _node__node1 = (GRGEN_LGSP.LGSPNode)value; break;
				case "b": _node_b = (GRGEN_LGSP.LGSPNode)value; break;
				case "b2": _node_b2 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge__edge0 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge1 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge1; } set { _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge2 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge2; } set { _edge__edge2 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge3 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge3; } set { _edge__edge3 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public GRGEN_LGSP.LGSPEdge _edge__edge1;
			public GRGEN_LGSP.LGSPEdge _edge__edge2;
			public GRGEN_LGSP.LGSPEdge _edge__edge3;
			public enum Complex_alt_0_ExtendNA2_EdgeNums { @_edge0, @_edge1, @_edge2, @_edge3, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 4; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)Complex_alt_0_ExtendNA2_EdgeNums.@_edge0: return _edge__edge0;
				case (int)Complex_alt_0_ExtendNA2_EdgeNums.@_edge1: return _edge__edge1;
				case (int)Complex_alt_0_ExtendNA2_EdgeNums.@_edge2: return _edge__edge2;
				case (int)Complex_alt_0_ExtendNA2_EdgeNums.@_edge3: return _edge__edge3;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "_edge0": return _edge__edge0;
				case "_edge1": return _edge__edge1;
				case "_edge2": return _edge__edge2;
				case "_edge3": return _edge__edge3;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "_edge0": _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge1": _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge2": _edge__edge2 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge3": _edge__edge3 = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum Complex_alt_0_ExtendNA2_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum Complex_alt_0_ExtendNA2_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum Complex_alt_0_ExtendNA2_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum Complex_alt_0_ExtendNA2_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum Complex_alt_0_ExtendNA2_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_Complex.instance.Complex_alt_0_ExtendNA2; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_Complex_alt_0_ExtendNA2(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_Complex_alt_0_ExtendNA2(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_Complex_alt_0_ExtendNA2 nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_Complex_alt_0_ExtendNA2 cur = this;
				while(cur != null) {
					Match_Complex_alt_0_ExtendNA2 next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_Complex_alt_0_ExtendNA2 that)
			{
				_node_a = that._node_a;
				_node__node0 = that._node__node0;
				_node__node1 = that._node__node1;
				_node_b = that._node_b;
				_node_b2 = that._node_b2;
				_edge__edge0 = that._edge__edge0;
				_edge__edge1 = that._edge__edge1;
				_edge__edge2 = that._edge__edge2;
				_edge__edge3 = that._edge__edge3;
			}

			public Match_Complex_alt_0_ExtendNA2(Match_Complex_alt_0_ExtendNA2 that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_Complex_alt_0_ExtendNA2 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_a = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_a];
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
				_node__node1 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node1];
				_node_b = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b];
				_node_b2 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b2];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				_edge__edge1 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge1];
				_edge__edge2 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge2];
				_edge__edge3 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge3];
			}

			public Match_Complex_alt_0_ExtendNA2(Match_Complex_alt_0_ExtendNA2 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_Complex_alt_0_ExtendNA2()
			{
			}

			public bool IsEqual(Match_Complex_alt_0_ExtendNA2 that)
			{
				if(that==null) return false;
				if(_node_a != that._node_a) return false;
				if(_node__node0 != that._node__node0) return false;
				if(_node__node1 != that._node__node1) return false;
				if(_node_b != that._node_b) return false;
				if(_node_b2 != that._node_b2) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(_edge__edge1 != that._edge__edge1) return false;
				if(_edge__edge2 != that._edge__edge2) return false;
				if(_edge__edge3 != that._edge__edge3) return false;
				return true;
			}
		}


		public class Extractor
		{
			public static List<GRGEN_MODEL.IA> Extract_a(List<IMatch_Complex> matchList)
			{
				List<GRGEN_MODEL.IA> resultList = new List<GRGEN_MODEL.IA>(matchList.Count);
				foreach(IMatch_Complex match in matchList)
					resultList.Add(match.node_a);
				return resultList;
			}
			public static List<GRGEN_MODEL.IB> Extract_b(List<IMatch_Complex> matchList)
			{
				List<GRGEN_MODEL.IB> resultList = new List<GRGEN_MODEL.IB>(matchList.Count);
				foreach(IMatch_Complex match in matchList)
					resultList.Add(match.node_b);
				return resultList;
			}
			public static List<GRGEN_LIBGR.IDEdge> Extract__edge0(List<IMatch_Complex> matchList)
			{
				List<GRGEN_LIBGR.IDEdge> resultList = new List<GRGEN_LIBGR.IDEdge>(matchList.Count);
				foreach(IMatch_Complex match in matchList)
					resultList.Add(match.edge__edge0);
				return resultList;
			}
			public static List<GRGEN_LIBGR.IDEdge> Extract__edge1(List<IMatch_Complex> matchList)
			{
				List<GRGEN_LIBGR.IDEdge> resultList = new List<GRGEN_LIBGR.IDEdge>(matchList.Count);
				foreach(IMatch_Complex match in matchList)
					resultList.Add(match.edge__edge1);
				return resultList;
			}
		}


		public static List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>)
				return ((List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_Complex.IMatch_Complex instanceBearingAttributeForSearch_Complex = new GRGEN_ACTIONS.Rule_Complex.Match_Complex();
		public static List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> Array_Complex_groupBy_a(List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list)
		{
			Dictionary<GRGEN_MODEL.IA, List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>> seenValues = new Dictionary<GRGEN_MODEL.IA, List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_a)) {
					seenValues[list[pos].@node_a].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> tempList = new List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_a, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> newList = new List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>();
			foreach(List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> Array_Complex_keepOneForEachBy_a(List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list)
		{
			List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> newList = new List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>();
			Dictionary<GRGEN_MODEL.IA, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_MODEL.IA, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_Complex.IMatch_Complex element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_a)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_a, null);
				}
			}
			return newList;
		}
		public static int Array_Complex_indexOfBy_a(IList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list, GRGEN_MODEL.IA entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_a.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_Complex_indexOfBy_a(IList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list, GRGEN_MODEL.IA entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_a.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_Complex_lastIndexOfBy_a(IList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list, GRGEN_MODEL.IA entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_a.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_Complex_lastIndexOfBy_a(IList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list, GRGEN_MODEL.IA entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_a.Equals(entry))
					return i;
			return -1;
		}
		public static List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> Array_Complex_groupBy_b(List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list)
		{
			Dictionary<GRGEN_MODEL.IB, List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>> seenValues = new Dictionary<GRGEN_MODEL.IB, List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_b)) {
					seenValues[list[pos].@node_b].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> tempList = new List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_b, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> newList = new List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>();
			foreach(List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> Array_Complex_keepOneForEachBy_b(List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list)
		{
			List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> newList = new List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>();
			Dictionary<GRGEN_MODEL.IB, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_MODEL.IB, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_Complex.IMatch_Complex element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_b)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_b, null);
				}
			}
			return newList;
		}
		public static int Array_Complex_indexOfBy_b(IList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list, GRGEN_MODEL.IB entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_b.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_Complex_indexOfBy_b(IList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list, GRGEN_MODEL.IB entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_b.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_Complex_lastIndexOfBy_b(IList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list, GRGEN_MODEL.IB entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_b.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_Complex_lastIndexOfBy_b(IList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list, GRGEN_MODEL.IB entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_b.Equals(entry))
					return i;
			return -1;
		}
		public static List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> Array_Complex_groupBy__edge0(List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list)
		{
			Dictionary<GRGEN_LIBGR.IDEdge, List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>> seenValues = new Dictionary<GRGEN_LIBGR.IDEdge, List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@edge__edge0)) {
					seenValues[list[pos].@edge__edge0].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> tempList = new List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@edge__edge0, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> newList = new List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>();
			foreach(List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> Array_Complex_keepOneForEachBy__edge0(List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list)
		{
			List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> newList = new List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>();
			Dictionary<GRGEN_LIBGR.IDEdge, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.IDEdge, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_Complex.IMatch_Complex element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@edge__edge0)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@edge__edge0, null);
				}
			}
			return newList;
		}
		public static int Array_Complex_indexOfBy__edge0(IList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list, GRGEN_LIBGR.IDEdge entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@edge__edge0.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_Complex_indexOfBy__edge0(IList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list, GRGEN_LIBGR.IDEdge entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@edge__edge0.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_Complex_lastIndexOfBy__edge0(IList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list, GRGEN_LIBGR.IDEdge entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@edge__edge0.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_Complex_lastIndexOfBy__edge0(IList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list, GRGEN_LIBGR.IDEdge entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@edge__edge0.Equals(entry))
					return i;
			return -1;
		}
		public static List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> Array_Complex_groupBy__edge1(List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list)
		{
			Dictionary<GRGEN_LIBGR.IDEdge, List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>> seenValues = new Dictionary<GRGEN_LIBGR.IDEdge, List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@edge__edge1)) {
					seenValues[list[pos].@edge__edge1].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> tempList = new List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@edge__edge1, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> newList = new List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>();
			foreach(List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> Array_Complex_keepOneForEachBy__edge1(List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list)
		{
			List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> newList = new List<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex>();
			Dictionary<GRGEN_LIBGR.IDEdge, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.IDEdge, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_Complex.IMatch_Complex element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@edge__edge1)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@edge__edge1, null);
				}
			}
			return newList;
		}
		public static int Array_Complex_indexOfBy__edge1(IList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list, GRGEN_LIBGR.IDEdge entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@edge__edge1.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_Complex_indexOfBy__edge1(IList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list, GRGEN_LIBGR.IDEdge entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@edge__edge1.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_Complex_lastIndexOfBy__edge1(IList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list, GRGEN_LIBGR.IDEdge entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@edge__edge1.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_Complex_lastIndexOfBy__edge1(IList<GRGEN_ACTIONS.Rule_Complex.IMatch_Complex> list, GRGEN_LIBGR.IDEdge entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@edge__edge1.Equals(entry))
					return i;
			return -1;
		}
	}

	public class Rule_ComplexMax : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_ComplexMax instance = null;
		public static Rule_ComplexMax Instance { get { if(instance==null) { instance = new Rule_ComplexMax(); instance.initialize(); } return instance; } }

		public static GRGEN_LIBGR.NodeType[] ComplexMax_node_a_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] ComplexMax_node_b_AllowedTypes = null;
		public static bool[] ComplexMax_node_a_IsAllowedType = null;
		public static bool[] ComplexMax_node_b_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ComplexMax_edge__edge0_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] ComplexMax_edge__edge1_AllowedTypes = null;
		public static bool[] ComplexMax_edge__edge0_IsAllowedType = null;
		public static bool[] ComplexMax_edge__edge1_IsAllowedType = null;
		public enum ComplexMax_NodeNums { @a, @b, };
		public enum ComplexMax_EdgeNums { @_edge0, @_edge1, };
		public enum ComplexMax_VariableNums { };
		public enum ComplexMax_SubNums { };
		public enum ComplexMax_AltNums { @alt_0, };
		public enum ComplexMax_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_ComplexMax;

		public enum ComplexMax_alt_0_CaseNums { @ExtendAv, @ExtendAv2, @ExtendNA2, };
		public static GRGEN_LIBGR.NodeType[] ComplexMax_alt_0_ExtendAv_node_b2_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] ComplexMax_alt_0_ExtendAv_node__node0_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] ComplexMax_alt_0_ExtendAv_node_c_AllowedTypes = null;
		public static bool[] ComplexMax_alt_0_ExtendAv_node_b2_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendAv_node__node0_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendAv_node_c_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ComplexMax_alt_0_ExtendAv_edge__edge0_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] ComplexMax_alt_0_ExtendAv_edge__edge1_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] ComplexMax_alt_0_ExtendAv_edge__edge2_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] ComplexMax_alt_0_ExtendAv_edge__edge3_AllowedTypes = null;
		public static bool[] ComplexMax_alt_0_ExtendAv_edge__edge0_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendAv_edge__edge1_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendAv_edge__edge2_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendAv_edge__edge3_IsAllowedType = null;
		public enum ComplexMax_alt_0_ExtendAv_NodeNums { @a, @b2, @b, @_node0, @c, };
		public enum ComplexMax_alt_0_ExtendAv_EdgeNums { @_edge0, @_edge1, @_edge2, @_edge3, };
		public enum ComplexMax_alt_0_ExtendAv_VariableNums { };
		public enum ComplexMax_alt_0_ExtendAv_SubNums { };
		public enum ComplexMax_alt_0_ExtendAv_AltNums { };
		public enum ComplexMax_alt_0_ExtendAv_IterNums { };



		public GRGEN_LGSP.PatternGraph ComplexMax_alt_0_ExtendAv;

		public static GRGEN_LIBGR.NodeType[] ComplexMax_alt_0_ExtendAv_neg_0_node__node0_AllowedTypes = null;
		public static bool[] ComplexMax_alt_0_ExtendAv_neg_0_node__node0_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0_AllowedTypes = null;
		public static bool[] ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0_IsAllowedType = null;
		public enum ComplexMax_alt_0_ExtendAv_neg_0_NodeNums { @c, @_node0, };
		public enum ComplexMax_alt_0_ExtendAv_neg_0_EdgeNums { @_edge0, };
		public enum ComplexMax_alt_0_ExtendAv_neg_0_VariableNums { };
		public enum ComplexMax_alt_0_ExtendAv_neg_0_SubNums { };
		public enum ComplexMax_alt_0_ExtendAv_neg_0_AltNums { };
		public enum ComplexMax_alt_0_ExtendAv_neg_0_IterNums { };


		public GRGEN_LGSP.PatternGraph ComplexMax_alt_0_ExtendAv_neg_0;

		public static GRGEN_LIBGR.NodeType[] ComplexMax_alt_0_ExtendAv2_node_b2_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] ComplexMax_alt_0_ExtendAv2_node__node0_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] ComplexMax_alt_0_ExtendAv2_node__node1_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] ComplexMax_alt_0_ExtendAv2_node__node2_AllowedTypes = null;
		public static bool[] ComplexMax_alt_0_ExtendAv2_node_b2_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendAv2_node__node0_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendAv2_node__node1_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendAv2_node__node2_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ComplexMax_alt_0_ExtendAv2_edge__edge0_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] ComplexMax_alt_0_ExtendAv2_edge__edge1_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] ComplexMax_alt_0_ExtendAv2_edge__edge2_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] ComplexMax_alt_0_ExtendAv2_edge__edge3_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] ComplexMax_alt_0_ExtendAv2_edge__edge4_AllowedTypes = null;
		public static bool[] ComplexMax_alt_0_ExtendAv2_edge__edge0_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendAv2_edge__edge1_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendAv2_edge__edge2_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendAv2_edge__edge3_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendAv2_edge__edge4_IsAllowedType = null;
		public enum ComplexMax_alt_0_ExtendAv2_NodeNums { @a, @b2, @b, @_node0, @_node1, @_node2, };
		public enum ComplexMax_alt_0_ExtendAv2_EdgeNums { @_edge0, @_edge1, @_edge2, @_edge3, @_edge4, };
		public enum ComplexMax_alt_0_ExtendAv2_VariableNums { };
		public enum ComplexMax_alt_0_ExtendAv2_SubNums { };
		public enum ComplexMax_alt_0_ExtendAv2_AltNums { };
		public enum ComplexMax_alt_0_ExtendAv2_IterNums { };



		public GRGEN_LGSP.PatternGraph ComplexMax_alt_0_ExtendAv2;

		public static GRGEN_LIBGR.NodeType[] ComplexMax_alt_0_ExtendNA2_node__node0_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] ComplexMax_alt_0_ExtendNA2_node__node1_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] ComplexMax_alt_0_ExtendNA2_node_b2_AllowedTypes = null;
		public static bool[] ComplexMax_alt_0_ExtendNA2_node__node0_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendNA2_node__node1_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendNA2_node_b2_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ComplexMax_alt_0_ExtendNA2_edge__edge0_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] ComplexMax_alt_0_ExtendNA2_edge__edge1_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] ComplexMax_alt_0_ExtendNA2_edge__edge2_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] ComplexMax_alt_0_ExtendNA2_edge__edge3_AllowedTypes = null;
		public static bool[] ComplexMax_alt_0_ExtendNA2_edge__edge0_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendNA2_edge__edge1_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendNA2_edge__edge2_IsAllowedType = null;
		public static bool[] ComplexMax_alt_0_ExtendNA2_edge__edge3_IsAllowedType = null;
		public enum ComplexMax_alt_0_ExtendNA2_NodeNums { @a, @_node0, @_node1, @b, @b2, };
		public enum ComplexMax_alt_0_ExtendNA2_EdgeNums { @_edge0, @_edge1, @_edge2, @_edge3, };
		public enum ComplexMax_alt_0_ExtendNA2_VariableNums { };
		public enum ComplexMax_alt_0_ExtendNA2_SubNums { };
		public enum ComplexMax_alt_0_ExtendNA2_AltNums { };
		public enum ComplexMax_alt_0_ExtendNA2_IterNums { };



		public GRGEN_LGSP.PatternGraph ComplexMax_alt_0_ExtendNA2;


		private Rule_ComplexMax()
			: base("ComplexMax",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_ComplexMax+IMatch_ComplexMax",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_ComplexMax+Match_ComplexMax"
			)
		{
		}
		private void initialize()
		{
			bool[,] ComplexMax_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ComplexMax_isEdgeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[] ComplexMax_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ComplexMax_isEdgeTotallyHomomorphic = new bool[2] { false, false,  };
			GRGEN_LGSP.PatternNode ComplexMax_node_a = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@A, GRGEN_MODEL.NodeType_A.typeVar, "GRGEN_MODEL.IA", "ComplexMax_node_a", "a", ComplexMax_node_a_AllowedTypes, ComplexMax_node_a_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode ComplexMax_node_b = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@B, GRGEN_MODEL.NodeType_B.typeVar, "GRGEN_MODEL.IB", "ComplexMax_node_b", "b", ComplexMax_node_b_AllowedTypes, ComplexMax_node_b_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ComplexMax_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ComplexMax_edge__edge0", "_edge0", ComplexMax_edge__edge0_AllowedTypes, ComplexMax_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ComplexMax_edge__edge1 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ComplexMax_edge__edge1", "_edge1", ComplexMax_edge__edge1_AllowedTypes, ComplexMax_edge__edge1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			bool[,] ComplexMax_alt_0_ExtendAv_isNodeHomomorphicGlobal = new bool[5, 5] {
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
			};
			bool[,] ComplexMax_alt_0_ExtendAv_isEdgeHomomorphicGlobal = new bool[4, 4] {
				{ false, false, false, false, },
				{ false, false, false, false, },
				{ false, false, false, false, },
				{ false, false, false, false, },
			};
			bool[] ComplexMax_alt_0_ExtendAv_isNodeTotallyHomomorphic = new bool[5] { false, false, false, false, false,  };
			bool[] ComplexMax_alt_0_ExtendAv_isEdgeTotallyHomomorphic = new bool[4] { false, false, false, false,  };
			GRGEN_LGSP.PatternNode ComplexMax_alt_0_ExtendAv_node_b2 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@B, GRGEN_MODEL.NodeType_B.typeVar, "GRGEN_MODEL.IB", "ComplexMax_alt_0_ExtendAv_node_b2", "b2", ComplexMax_alt_0_ExtendAv_node_b2_AllowedTypes, ComplexMax_alt_0_ExtendAv_node_b2_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode ComplexMax_alt_0_ExtendAv_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "ComplexMax_alt_0_ExtendAv_node__node0", "_node0", ComplexMax_alt_0_ExtendAv_node__node0_AllowedTypes, ComplexMax_alt_0_ExtendAv_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode ComplexMax_alt_0_ExtendAv_node_c = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "ComplexMax_alt_0_ExtendAv_node_c", "c", ComplexMax_alt_0_ExtendAv_node_c_AllowedTypes, ComplexMax_alt_0_ExtendAv_node_c_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ComplexMax_alt_0_ExtendAv_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ComplexMax_alt_0_ExtendAv_edge__edge0", "_edge0", ComplexMax_alt_0_ExtendAv_edge__edge0_AllowedTypes, ComplexMax_alt_0_ExtendAv_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ComplexMax_alt_0_ExtendAv_edge__edge1 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ComplexMax_alt_0_ExtendAv_edge__edge1", "_edge1", ComplexMax_alt_0_ExtendAv_edge__edge1_AllowedTypes, ComplexMax_alt_0_ExtendAv_edge__edge1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ComplexMax_alt_0_ExtendAv_edge__edge2 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ComplexMax_alt_0_ExtendAv_edge__edge2", "_edge2", ComplexMax_alt_0_ExtendAv_edge__edge2_AllowedTypes, ComplexMax_alt_0_ExtendAv_edge__edge2_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ComplexMax_alt_0_ExtendAv_edge__edge3 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ComplexMax_alt_0_ExtendAv_edge__edge3", "_edge3", ComplexMax_alt_0_ExtendAv_edge__edge3_AllowedTypes, ComplexMax_alt_0_ExtendAv_edge__edge3_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			bool[,] ComplexMax_alt_0_ExtendAv_neg_0_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ComplexMax_alt_0_ExtendAv_neg_0_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] ComplexMax_alt_0_ExtendAv_neg_0_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ComplexMax_alt_0_ExtendAv_neg_0_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode ComplexMax_alt_0_ExtendAv_neg_0_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "ComplexMax_alt_0_ExtendAv_neg_0_node__node0", "_node0", ComplexMax_alt_0_ExtendAv_neg_0_node__node0_AllowedTypes, ComplexMax_alt_0_ExtendAv_neg_0_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0", "_edge0", ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0_AllowedTypes, ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			ComplexMax_alt_0_ExtendAv_neg_0 = new GRGEN_LGSP.PatternGraph(
				"neg_0",
				"ComplexMax_alt_0_ExtendAv_",
				null, "neg_0",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ComplexMax_alt_0_ExtendAv_node_c, ComplexMax_alt_0_ExtendAv_neg_0_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] { ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				new bool[1, 1] {
					{ true, },
				},
				ComplexMax_alt_0_ExtendAv_neg_0_isNodeHomomorphicGlobal,
				ComplexMax_alt_0_ExtendAv_neg_0_isEdgeHomomorphicGlobal,
				ComplexMax_alt_0_ExtendAv_neg_0_isNodeTotallyHomomorphic,
				ComplexMax_alt_0_ExtendAv_neg_0_isEdgeTotallyHomomorphic
			);
			ComplexMax_alt_0_ExtendAv_neg_0.edgeToSourceNode.Add(ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0, ComplexMax_alt_0_ExtendAv_node_c);
			ComplexMax_alt_0_ExtendAv_neg_0.edgeToTargetNode.Add(ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0, ComplexMax_alt_0_ExtendAv_neg_0_node__node0);

			ComplexMax_alt_0_ExtendAv = new GRGEN_LGSP.PatternGraph(
				"ExtendAv",
				"ComplexMax_alt_0_",
				null, "ExtendAv",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ComplexMax_node_a, ComplexMax_alt_0_ExtendAv_node_b2, ComplexMax_node_b, ComplexMax_alt_0_ExtendAv_node__node0, ComplexMax_alt_0_ExtendAv_node_c }, 
				new GRGEN_LGSP.PatternEdge[] { ComplexMax_alt_0_ExtendAv_edge__edge0, ComplexMax_alt_0_ExtendAv_edge__edge1, ComplexMax_alt_0_ExtendAv_edge__edge2, ComplexMax_alt_0_ExtendAv_edge__edge3 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] { ComplexMax_alt_0_ExtendAv_neg_0,  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[5, 5] {
					{ true, false, false, false, false, },
					{ false, true, false, false, false, },
					{ false, false, true, false, false, },
					{ false, false, false, true, false, },
					{ false, false, false, false, true, },
				},
				new bool[4, 4] {
					{ true, false, false, false, },
					{ false, true, false, false, },
					{ false, false, true, false, },
					{ false, false, false, true, },
				},
				ComplexMax_alt_0_ExtendAv_isNodeHomomorphicGlobal,
				ComplexMax_alt_0_ExtendAv_isEdgeHomomorphicGlobal,
				ComplexMax_alt_0_ExtendAv_isNodeTotallyHomomorphic,
				ComplexMax_alt_0_ExtendAv_isEdgeTotallyHomomorphic
			);
			ComplexMax_alt_0_ExtendAv.edgeToSourceNode.Add(ComplexMax_alt_0_ExtendAv_edge__edge0, ComplexMax_node_a);
			ComplexMax_alt_0_ExtendAv.edgeToTargetNode.Add(ComplexMax_alt_0_ExtendAv_edge__edge0, ComplexMax_alt_0_ExtendAv_node_b2);
			ComplexMax_alt_0_ExtendAv.edgeToSourceNode.Add(ComplexMax_alt_0_ExtendAv_edge__edge1, ComplexMax_alt_0_ExtendAv_node_b2);
			ComplexMax_alt_0_ExtendAv.edgeToTargetNode.Add(ComplexMax_alt_0_ExtendAv_edge__edge1, ComplexMax_node_a);
			ComplexMax_alt_0_ExtendAv.edgeToSourceNode.Add(ComplexMax_alt_0_ExtendAv_edge__edge2, ComplexMax_node_b);
			ComplexMax_alt_0_ExtendAv.edgeToTargetNode.Add(ComplexMax_alt_0_ExtendAv_edge__edge2, ComplexMax_alt_0_ExtendAv_node__node0);
			ComplexMax_alt_0_ExtendAv.edgeToSourceNode.Add(ComplexMax_alt_0_ExtendAv_edge__edge3, ComplexMax_alt_0_ExtendAv_node__node0);
			ComplexMax_alt_0_ExtendAv.edgeToTargetNode.Add(ComplexMax_alt_0_ExtendAv_edge__edge3, ComplexMax_alt_0_ExtendAv_node_c);
			ComplexMax_alt_0_ExtendAv_neg_0.embeddingGraph = ComplexMax_alt_0_ExtendAv;

			bool[,] ComplexMax_alt_0_ExtendAv2_isNodeHomomorphicGlobal = new bool[6, 6] {
				{ false, false, false, false, false, false, },
				{ false, false, false, false, false, false, },
				{ false, false, false, false, false, false, },
				{ false, false, false, false, false, false, },
				{ false, false, false, false, false, false, },
				{ false, false, false, false, false, false, },
			};
			bool[,] ComplexMax_alt_0_ExtendAv2_isEdgeHomomorphicGlobal = new bool[5, 5] {
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
			};
			bool[] ComplexMax_alt_0_ExtendAv2_isNodeTotallyHomomorphic = new bool[6] { false, false, false, false, false, false,  };
			bool[] ComplexMax_alt_0_ExtendAv2_isEdgeTotallyHomomorphic = new bool[5] { false, false, false, false, false,  };
			GRGEN_LGSP.PatternNode ComplexMax_alt_0_ExtendAv2_node_b2 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@B, GRGEN_MODEL.NodeType_B.typeVar, "GRGEN_MODEL.IB", "ComplexMax_alt_0_ExtendAv2_node_b2", "b2", ComplexMax_alt_0_ExtendAv2_node_b2_AllowedTypes, ComplexMax_alt_0_ExtendAv2_node_b2_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode ComplexMax_alt_0_ExtendAv2_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "ComplexMax_alt_0_ExtendAv2_node__node0", "_node0", ComplexMax_alt_0_ExtendAv2_node__node0_AllowedTypes, ComplexMax_alt_0_ExtendAv2_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode ComplexMax_alt_0_ExtendAv2_node__node1 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "ComplexMax_alt_0_ExtendAv2_node__node1", "_node1", ComplexMax_alt_0_ExtendAv2_node__node1_AllowedTypes, ComplexMax_alt_0_ExtendAv2_node__node1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode ComplexMax_alt_0_ExtendAv2_node__node2 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "ComplexMax_alt_0_ExtendAv2_node__node2", "_node2", ComplexMax_alt_0_ExtendAv2_node__node2_AllowedTypes, ComplexMax_alt_0_ExtendAv2_node__node2_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ComplexMax_alt_0_ExtendAv2_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ComplexMax_alt_0_ExtendAv2_edge__edge0", "_edge0", ComplexMax_alt_0_ExtendAv2_edge__edge0_AllowedTypes, ComplexMax_alt_0_ExtendAv2_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ComplexMax_alt_0_ExtendAv2_edge__edge1 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ComplexMax_alt_0_ExtendAv2_edge__edge1", "_edge1", ComplexMax_alt_0_ExtendAv2_edge__edge1_AllowedTypes, ComplexMax_alt_0_ExtendAv2_edge__edge1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ComplexMax_alt_0_ExtendAv2_edge__edge2 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ComplexMax_alt_0_ExtendAv2_edge__edge2", "_edge2", ComplexMax_alt_0_ExtendAv2_edge__edge2_AllowedTypes, ComplexMax_alt_0_ExtendAv2_edge__edge2_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ComplexMax_alt_0_ExtendAv2_edge__edge3 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ComplexMax_alt_0_ExtendAv2_edge__edge3", "_edge3", ComplexMax_alt_0_ExtendAv2_edge__edge3_AllowedTypes, ComplexMax_alt_0_ExtendAv2_edge__edge3_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ComplexMax_alt_0_ExtendAv2_edge__edge4 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ComplexMax_alt_0_ExtendAv2_edge__edge4", "_edge4", ComplexMax_alt_0_ExtendAv2_edge__edge4_AllowedTypes, ComplexMax_alt_0_ExtendAv2_edge__edge4_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			ComplexMax_alt_0_ExtendAv2 = new GRGEN_LGSP.PatternGraph(
				"ExtendAv2",
				"ComplexMax_alt_0_",
				null, "ExtendAv2",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ComplexMax_node_a, ComplexMax_alt_0_ExtendAv2_node_b2, ComplexMax_node_b, ComplexMax_alt_0_ExtendAv2_node__node0, ComplexMax_alt_0_ExtendAv2_node__node1, ComplexMax_alt_0_ExtendAv2_node__node2 }, 
				new GRGEN_LGSP.PatternEdge[] { ComplexMax_alt_0_ExtendAv2_edge__edge0, ComplexMax_alt_0_ExtendAv2_edge__edge1, ComplexMax_alt_0_ExtendAv2_edge__edge2, ComplexMax_alt_0_ExtendAv2_edge__edge3, ComplexMax_alt_0_ExtendAv2_edge__edge4 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[6, 6] {
					{ true, false, false, false, false, false, },
					{ false, true, false, false, false, false, },
					{ false, false, true, false, false, false, },
					{ false, false, false, true, false, false, },
					{ false, false, false, false, true, false, },
					{ false, false, false, false, false, true, },
				},
				new bool[5, 5] {
					{ true, false, false, false, false, },
					{ false, true, false, false, false, },
					{ false, false, true, false, false, },
					{ false, false, false, true, false, },
					{ false, false, false, false, true, },
				},
				ComplexMax_alt_0_ExtendAv2_isNodeHomomorphicGlobal,
				ComplexMax_alt_0_ExtendAv2_isEdgeHomomorphicGlobal,
				ComplexMax_alt_0_ExtendAv2_isNodeTotallyHomomorphic,
				ComplexMax_alt_0_ExtendAv2_isEdgeTotallyHomomorphic
			);
			ComplexMax_alt_0_ExtendAv2.edgeToSourceNode.Add(ComplexMax_alt_0_ExtendAv2_edge__edge0, ComplexMax_node_a);
			ComplexMax_alt_0_ExtendAv2.edgeToTargetNode.Add(ComplexMax_alt_0_ExtendAv2_edge__edge0, ComplexMax_alt_0_ExtendAv2_node_b2);
			ComplexMax_alt_0_ExtendAv2.edgeToSourceNode.Add(ComplexMax_alt_0_ExtendAv2_edge__edge1, ComplexMax_alt_0_ExtendAv2_node_b2);
			ComplexMax_alt_0_ExtendAv2.edgeToTargetNode.Add(ComplexMax_alt_0_ExtendAv2_edge__edge1, ComplexMax_node_a);
			ComplexMax_alt_0_ExtendAv2.edgeToSourceNode.Add(ComplexMax_alt_0_ExtendAv2_edge__edge2, ComplexMax_node_b);
			ComplexMax_alt_0_ExtendAv2.edgeToTargetNode.Add(ComplexMax_alt_0_ExtendAv2_edge__edge2, ComplexMax_alt_0_ExtendAv2_node__node0);
			ComplexMax_alt_0_ExtendAv2.edgeToSourceNode.Add(ComplexMax_alt_0_ExtendAv2_edge__edge3, ComplexMax_alt_0_ExtendAv2_node__node0);
			ComplexMax_alt_0_ExtendAv2.edgeToTargetNode.Add(ComplexMax_alt_0_ExtendAv2_edge__edge3, ComplexMax_alt_0_ExtendAv2_node__node1);
			ComplexMax_alt_0_ExtendAv2.edgeToSourceNode.Add(ComplexMax_alt_0_ExtendAv2_edge__edge4, ComplexMax_alt_0_ExtendAv2_node__node1);
			ComplexMax_alt_0_ExtendAv2.edgeToTargetNode.Add(ComplexMax_alt_0_ExtendAv2_edge__edge4, ComplexMax_alt_0_ExtendAv2_node__node2);

			bool[,] ComplexMax_alt_0_ExtendNA2_isNodeHomomorphicGlobal = new bool[5, 5] {
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
				{ false, false, false, false, false, },
			};
			bool[,] ComplexMax_alt_0_ExtendNA2_isEdgeHomomorphicGlobal = new bool[4, 4] {
				{ false, false, false, false, },
				{ false, false, false, false, },
				{ false, false, false, false, },
				{ false, false, false, false, },
			};
			bool[] ComplexMax_alt_0_ExtendNA2_isNodeTotallyHomomorphic = new bool[5] { false, false, false, false, false,  };
			bool[] ComplexMax_alt_0_ExtendNA2_isEdgeTotallyHomomorphic = new bool[4] { false, false, false, false,  };
			GRGEN_LGSP.PatternNode ComplexMax_alt_0_ExtendNA2_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "ComplexMax_alt_0_ExtendNA2_node__node0", "_node0", ComplexMax_alt_0_ExtendNA2_node__node0_AllowedTypes, ComplexMax_alt_0_ExtendNA2_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode ComplexMax_alt_0_ExtendNA2_node__node1 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@C, GRGEN_MODEL.NodeType_C.typeVar, "GRGEN_MODEL.IC", "ComplexMax_alt_0_ExtendNA2_node__node1", "_node1", ComplexMax_alt_0_ExtendNA2_node__node1_AllowedTypes, ComplexMax_alt_0_ExtendNA2_node__node1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode ComplexMax_alt_0_ExtendNA2_node_b2 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@B, GRGEN_MODEL.NodeType_B.typeVar, "GRGEN_MODEL.IB", "ComplexMax_alt_0_ExtendNA2_node_b2", "b2", ComplexMax_alt_0_ExtendNA2_node_b2_AllowedTypes, ComplexMax_alt_0_ExtendNA2_node_b2_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ComplexMax_alt_0_ExtendNA2_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ComplexMax_alt_0_ExtendNA2_edge__edge0", "_edge0", ComplexMax_alt_0_ExtendNA2_edge__edge0_AllowedTypes, ComplexMax_alt_0_ExtendNA2_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ComplexMax_alt_0_ExtendNA2_edge__edge1 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ComplexMax_alt_0_ExtendNA2_edge__edge1", "_edge1", ComplexMax_alt_0_ExtendNA2_edge__edge1_AllowedTypes, ComplexMax_alt_0_ExtendNA2_edge__edge1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ComplexMax_alt_0_ExtendNA2_edge__edge2 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ComplexMax_alt_0_ExtendNA2_edge__edge2", "_edge2", ComplexMax_alt_0_ExtendNA2_edge__edge2_AllowedTypes, ComplexMax_alt_0_ExtendNA2_edge__edge2_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ComplexMax_alt_0_ExtendNA2_edge__edge3 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ComplexMax_alt_0_ExtendNA2_edge__edge3", "_edge3", ComplexMax_alt_0_ExtendNA2_edge__edge3_AllowedTypes, ComplexMax_alt_0_ExtendNA2_edge__edge3_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			ComplexMax_alt_0_ExtendNA2 = new GRGEN_LGSP.PatternGraph(
				"ExtendNA2",
				"ComplexMax_alt_0_",
				null, "ExtendNA2",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ComplexMax_node_a, ComplexMax_alt_0_ExtendNA2_node__node0, ComplexMax_alt_0_ExtendNA2_node__node1, ComplexMax_node_b, ComplexMax_alt_0_ExtendNA2_node_b2 }, 
				new GRGEN_LGSP.PatternEdge[] { ComplexMax_alt_0_ExtendNA2_edge__edge0, ComplexMax_alt_0_ExtendNA2_edge__edge1, ComplexMax_alt_0_ExtendNA2_edge__edge2, ComplexMax_alt_0_ExtendNA2_edge__edge3 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[5, 5] {
					{ true, false, false, false, false, },
					{ false, true, false, false, false, },
					{ false, false, true, false, false, },
					{ false, false, false, true, false, },
					{ false, false, false, false, true, },
				},
				new bool[4, 4] {
					{ true, false, false, false, },
					{ false, true, false, false, },
					{ false, false, true, false, },
					{ false, false, false, true, },
				},
				ComplexMax_alt_0_ExtendNA2_isNodeHomomorphicGlobal,
				ComplexMax_alt_0_ExtendNA2_isEdgeHomomorphicGlobal,
				ComplexMax_alt_0_ExtendNA2_isNodeTotallyHomomorphic,
				ComplexMax_alt_0_ExtendNA2_isEdgeTotallyHomomorphic
			);
			ComplexMax_alt_0_ExtendNA2.edgeToSourceNode.Add(ComplexMax_alt_0_ExtendNA2_edge__edge0, ComplexMax_node_a);
			ComplexMax_alt_0_ExtendNA2.edgeToTargetNode.Add(ComplexMax_alt_0_ExtendNA2_edge__edge0, ComplexMax_alt_0_ExtendNA2_node__node0);
			ComplexMax_alt_0_ExtendNA2.edgeToSourceNode.Add(ComplexMax_alt_0_ExtendNA2_edge__edge1, ComplexMax_alt_0_ExtendNA2_node__node0);
			ComplexMax_alt_0_ExtendNA2.edgeToTargetNode.Add(ComplexMax_alt_0_ExtendNA2_edge__edge1, ComplexMax_alt_0_ExtendNA2_node__node1);
			ComplexMax_alt_0_ExtendNA2.edgeToSourceNode.Add(ComplexMax_alt_0_ExtendNA2_edge__edge2, ComplexMax_node_b);
			ComplexMax_alt_0_ExtendNA2.edgeToTargetNode.Add(ComplexMax_alt_0_ExtendNA2_edge__edge2, ComplexMax_alt_0_ExtendNA2_node_b2);
			ComplexMax_alt_0_ExtendNA2.edgeToSourceNode.Add(ComplexMax_alt_0_ExtendNA2_edge__edge3, ComplexMax_alt_0_ExtendNA2_node_b2);
			ComplexMax_alt_0_ExtendNA2.edgeToTargetNode.Add(ComplexMax_alt_0_ExtendNA2_edge__edge3, ComplexMax_node_b);

			GRGEN_LGSP.Alternative ComplexMax_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "ComplexMax_", new GRGEN_LGSP.PatternGraph[] { ComplexMax_alt_0_ExtendAv, ComplexMax_alt_0_ExtendAv2, ComplexMax_alt_0_ExtendNA2 } );

			pat_ComplexMax = new GRGEN_LGSP.PatternGraph(
				"ComplexMax",
				"",
				null, "ComplexMax",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ComplexMax_node_a, ComplexMax_node_b }, 
				new GRGEN_LGSP.PatternEdge[] { ComplexMax_edge__edge0, ComplexMax_edge__edge1 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { ComplexMax_alt_0,  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				new bool[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				ComplexMax_isNodeHomomorphicGlobal,
				ComplexMax_isEdgeHomomorphicGlobal,
				ComplexMax_isNodeTotallyHomomorphic,
				ComplexMax_isEdgeTotallyHomomorphic
			);
			pat_ComplexMax.edgeToSourceNode.Add(ComplexMax_edge__edge0, ComplexMax_node_a);
			pat_ComplexMax.edgeToTargetNode.Add(ComplexMax_edge__edge0, ComplexMax_node_b);
			pat_ComplexMax.edgeToSourceNode.Add(ComplexMax_edge__edge1, ComplexMax_node_b);
			pat_ComplexMax.edgeToTargetNode.Add(ComplexMax_edge__edge1, ComplexMax_node_a);
			ComplexMax_alt_0_ExtendAv.embeddingGraph = pat_ComplexMax;
			ComplexMax_alt_0_ExtendAv2.embeddingGraph = pat_ComplexMax;
			ComplexMax_alt_0_ExtendNA2.embeddingGraph = pat_ComplexMax;

			ComplexMax_node_a.pointOfDefinition = pat_ComplexMax;
			ComplexMax_node_b.pointOfDefinition = pat_ComplexMax;
			ComplexMax_edge__edge0.pointOfDefinition = pat_ComplexMax;
			ComplexMax_edge__edge1.pointOfDefinition = pat_ComplexMax;
			ComplexMax_alt_0_ExtendAv_node_b2.pointOfDefinition = ComplexMax_alt_0_ExtendAv;
			ComplexMax_alt_0_ExtendAv_node__node0.pointOfDefinition = ComplexMax_alt_0_ExtendAv;
			ComplexMax_alt_0_ExtendAv_node_c.pointOfDefinition = ComplexMax_alt_0_ExtendAv;
			ComplexMax_alt_0_ExtendAv_edge__edge0.pointOfDefinition = ComplexMax_alt_0_ExtendAv;
			ComplexMax_alt_0_ExtendAv_edge__edge1.pointOfDefinition = ComplexMax_alt_0_ExtendAv;
			ComplexMax_alt_0_ExtendAv_edge__edge2.pointOfDefinition = ComplexMax_alt_0_ExtendAv;
			ComplexMax_alt_0_ExtendAv_edge__edge3.pointOfDefinition = ComplexMax_alt_0_ExtendAv;
			ComplexMax_alt_0_ExtendAv_neg_0_node__node0.pointOfDefinition = ComplexMax_alt_0_ExtendAv_neg_0;
			ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0.pointOfDefinition = ComplexMax_alt_0_ExtendAv_neg_0;
			ComplexMax_alt_0_ExtendAv2_node_b2.pointOfDefinition = ComplexMax_alt_0_ExtendAv2;
			ComplexMax_alt_0_ExtendAv2_node__node0.pointOfDefinition = ComplexMax_alt_0_ExtendAv2;
			ComplexMax_alt_0_ExtendAv2_node__node1.pointOfDefinition = ComplexMax_alt_0_ExtendAv2;
			ComplexMax_alt_0_ExtendAv2_node__node2.pointOfDefinition = ComplexMax_alt_0_ExtendAv2;
			ComplexMax_alt_0_ExtendAv2_edge__edge0.pointOfDefinition = ComplexMax_alt_0_ExtendAv2;
			ComplexMax_alt_0_ExtendAv2_edge__edge1.pointOfDefinition = ComplexMax_alt_0_ExtendAv2;
			ComplexMax_alt_0_ExtendAv2_edge__edge2.pointOfDefinition = ComplexMax_alt_0_ExtendAv2;
			ComplexMax_alt_0_ExtendAv2_edge__edge3.pointOfDefinition = ComplexMax_alt_0_ExtendAv2;
			ComplexMax_alt_0_ExtendAv2_edge__edge4.pointOfDefinition = ComplexMax_alt_0_ExtendAv2;
			ComplexMax_alt_0_ExtendNA2_node__node0.pointOfDefinition = ComplexMax_alt_0_ExtendNA2;
			ComplexMax_alt_0_ExtendNA2_node__node1.pointOfDefinition = ComplexMax_alt_0_ExtendNA2;
			ComplexMax_alt_0_ExtendNA2_node_b2.pointOfDefinition = ComplexMax_alt_0_ExtendNA2;
			ComplexMax_alt_0_ExtendNA2_edge__edge0.pointOfDefinition = ComplexMax_alt_0_ExtendNA2;
			ComplexMax_alt_0_ExtendNA2_edge__edge1.pointOfDefinition = ComplexMax_alt_0_ExtendNA2;
			ComplexMax_alt_0_ExtendNA2_edge__edge2.pointOfDefinition = ComplexMax_alt_0_ExtendNA2;
			ComplexMax_alt_0_ExtendNA2_edge__edge3.pointOfDefinition = ComplexMax_alt_0_ExtendNA2;

			patternGraph = pat_ComplexMax;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_ComplexMax curMatch = (Match_ComplexMax)_curMatch;
			IMatch_ComplexMax_alt_0 alternative_alt_0 = curMatch._alt_0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		public void ComplexMax_alt_0_ExtendAv_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_ComplexMax_alt_0_ExtendAv curMatch = (Match_ComplexMax_alt_0_ExtendAv)_curMatch;
		}

		public void ComplexMax_alt_0_ExtendAv2_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_ComplexMax_alt_0_ExtendAv2 curMatch = (Match_ComplexMax_alt_0_ExtendAv2)_curMatch;
		}

		public void ComplexMax_alt_0_ExtendNA2_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_ComplexMax_alt_0_ExtendNA2 curMatch = (Match_ComplexMax_alt_0_ExtendNA2)_curMatch;
		}

		static Rule_ComplexMax() {
		}

		public interface IMatch_ComplexMax : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_MODEL.IA node_a { get; set; }
			GRGEN_MODEL.IB node_b { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge1 { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			IMatch_ComplexMax_alt_0 alt_0 { get; }
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_ComplexMax_alt_0 : GRGEN_LIBGR.IMatch
		{
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_ComplexMax_alt_0_ExtendAv : IMatch_ComplexMax_alt_0
		{
			//Nodes
			GRGEN_MODEL.IA node_a { get; set; }
			GRGEN_MODEL.IB node_b2 { get; set; }
			GRGEN_MODEL.IB node_b { get; set; }
			GRGEN_MODEL.IC node__node0 { get; set; }
			GRGEN_MODEL.IC node_c { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge1 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge2 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge3 { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_ComplexMax_alt_0_ExtendAv_neg_0 : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_MODEL.IC node_c { get; set; }
			GRGEN_MODEL.IC node__node0 { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_ComplexMax_alt_0_ExtendAv2 : IMatch_ComplexMax_alt_0
		{
			//Nodes
			GRGEN_MODEL.IA node_a { get; set; }
			GRGEN_MODEL.IB node_b2 { get; set; }
			GRGEN_MODEL.IB node_b { get; set; }
			GRGEN_MODEL.IC node__node0 { get; set; }
			GRGEN_MODEL.IC node__node1 { get; set; }
			GRGEN_MODEL.IC node__node2 { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge1 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge2 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge3 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge4 { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_ComplexMax_alt_0_ExtendNA2 : IMatch_ComplexMax_alt_0
		{
			//Nodes
			GRGEN_MODEL.IA node_a { get; set; }
			GRGEN_MODEL.IC node__node0 { get; set; }
			GRGEN_MODEL.IC node__node1 { get; set; }
			GRGEN_MODEL.IB node_b { get; set; }
			GRGEN_MODEL.IB node_b2 { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge1 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge2 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge3 { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_ComplexMax : GRGEN_LGSP.MatchListElement<Match_ComplexMax>, IMatch_ComplexMax
		{
			public GRGEN_MODEL.IA node_a { get { return (GRGEN_MODEL.IA)_node_a; } set { _node_a = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b { get { return (GRGEN_MODEL.IB)_node_b; } set { _node_b = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_a;
			public GRGEN_LGSP.LGSPNode _node_b;
			public enum ComplexMax_NodeNums { @a, @b, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 2; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)ComplexMax_NodeNums.@a: return _node_a;
				case (int)ComplexMax_NodeNums.@b: return _node_b;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "a": return _node_a;
				case "b": return _node_b;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "a": _node_a = (GRGEN_LGSP.LGSPNode)value; break;
				case "b": _node_b = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge__edge0 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge1 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge1; } set { _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public GRGEN_LGSP.LGSPEdge _edge__edge1;
			public enum ComplexMax_EdgeNums { @_edge0, @_edge1, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 2; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)ComplexMax_EdgeNums.@_edge0: return _edge__edge0;
				case (int)ComplexMax_EdgeNums.@_edge1: return _edge__edge1;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "_edge0": return _edge__edge0;
				case "_edge1": return _edge__edge1;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "_edge0": _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge1": _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum ComplexMax_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum ComplexMax_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public IMatch_ComplexMax_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_ComplexMax_alt_0 _alt_0;
			public enum ComplexMax_AltNums { @alt_0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 1; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				case (int)ComplexMax_AltNums.@alt_0: return _alt_0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				case "alt_0": return _alt_0;
				default: return null;
				}
			}

			public enum ComplexMax_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum ComplexMax_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_ComplexMax.instance.pat_ComplexMax; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ComplexMax(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ComplexMax(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ComplexMax nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ComplexMax cur = this;
				while(cur != null) {
					Match_ComplexMax next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ComplexMax that)
			{
				_node_a = that._node_a;
				_node_b = that._node_b;
				_edge__edge0 = that._edge__edge0;
				_edge__edge1 = that._edge__edge1;
				_alt_0 = that._alt_0;
			}

			public Match_ComplexMax(Match_ComplexMax that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ComplexMax that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_a = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_a];
				_node_b = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				_edge__edge1 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge1];
				if(that._alt_0 is Match_ComplexMax_alt_0_ExtendAv)
					_alt_0 = new Match_ComplexMax_alt_0_ExtendAv((Match_ComplexMax_alt_0_ExtendAv)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_ComplexMax_alt_0_ExtendAv2)
					_alt_0 = new Match_ComplexMax_alt_0_ExtendAv2((Match_ComplexMax_alt_0_ExtendAv2)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_ComplexMax_alt_0_ExtendNA2)
					_alt_0 = new Match_ComplexMax_alt_0_ExtendNA2((Match_ComplexMax_alt_0_ExtendNA2)that._alt_0, oldToNewMap);
			}

			public Match_ComplexMax(Match_ComplexMax that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_ComplexMax()
			{
			}

			public bool IsEqual(Match_ComplexMax that)
			{
				if(that==null) return false;
				if(_node_a != that._node_a) return false;
				if(_node_b != that._node_b) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(_edge__edge1 != that._edge__edge1) return false;
				if(_alt_0 is Match_ComplexMax_alt_0_ExtendAv && !(_alt_0 as Match_ComplexMax_alt_0_ExtendAv).IsEqual(that._alt_0 as Match_ComplexMax_alt_0_ExtendAv)) return false;
				if(_alt_0 is Match_ComplexMax_alt_0_ExtendAv2 && !(_alt_0 as Match_ComplexMax_alt_0_ExtendAv2).IsEqual(that._alt_0 as Match_ComplexMax_alt_0_ExtendAv2)) return false;
				if(_alt_0 is Match_ComplexMax_alt_0_ExtendNA2 && !(_alt_0 as Match_ComplexMax_alt_0_ExtendNA2).IsEqual(that._alt_0 as Match_ComplexMax_alt_0_ExtendNA2)) return false;
				return true;
			}
		}

		public class Match_ComplexMax_alt_0_ExtendAv : GRGEN_LGSP.MatchListElement<Match_ComplexMax_alt_0_ExtendAv>, IMatch_ComplexMax_alt_0_ExtendAv
		{
			public GRGEN_MODEL.IA node_a { get { return (GRGEN_MODEL.IA)_node_a; } set { _node_a = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b2 { get { return (GRGEN_MODEL.IB)_node_b2; } set { _node_b2 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b { get { return (GRGEN_MODEL.IB)_node_b; } set { _node_b = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IC node__node0 { get { return (GRGEN_MODEL.IC)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IC node_c { get { return (GRGEN_MODEL.IC)_node_c; } set { _node_c = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_a;
			public GRGEN_LGSP.LGSPNode _node_b2;
			public GRGEN_LGSP.LGSPNode _node_b;
			public GRGEN_LGSP.LGSPNode _node__node0;
			public GRGEN_LGSP.LGSPNode _node_c;
			public enum ComplexMax_alt_0_ExtendAv_NodeNums { @a, @b2, @b, @_node0, @c, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 5; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)ComplexMax_alt_0_ExtendAv_NodeNums.@a: return _node_a;
				case (int)ComplexMax_alt_0_ExtendAv_NodeNums.@b2: return _node_b2;
				case (int)ComplexMax_alt_0_ExtendAv_NodeNums.@b: return _node_b;
				case (int)ComplexMax_alt_0_ExtendAv_NodeNums.@_node0: return _node__node0;
				case (int)ComplexMax_alt_0_ExtendAv_NodeNums.@c: return _node_c;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "a": return _node_a;
				case "b2": return _node_b2;
				case "b": return _node_b;
				case "_node0": return _node__node0;
				case "c": return _node_c;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "a": _node_a = (GRGEN_LGSP.LGSPNode)value; break;
				case "b2": _node_b2 = (GRGEN_LGSP.LGSPNode)value; break;
				case "b": _node_b = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				case "c": _node_c = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge__edge0 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge1 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge1; } set { _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge2 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge2; } set { _edge__edge2 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge3 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge3; } set { _edge__edge3 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public GRGEN_LGSP.LGSPEdge _edge__edge1;
			public GRGEN_LGSP.LGSPEdge _edge__edge2;
			public GRGEN_LGSP.LGSPEdge _edge__edge3;
			public enum ComplexMax_alt_0_ExtendAv_EdgeNums { @_edge0, @_edge1, @_edge2, @_edge3, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 4; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)ComplexMax_alt_0_ExtendAv_EdgeNums.@_edge0: return _edge__edge0;
				case (int)ComplexMax_alt_0_ExtendAv_EdgeNums.@_edge1: return _edge__edge1;
				case (int)ComplexMax_alt_0_ExtendAv_EdgeNums.@_edge2: return _edge__edge2;
				case (int)ComplexMax_alt_0_ExtendAv_EdgeNums.@_edge3: return _edge__edge3;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "_edge0": return _edge__edge0;
				case "_edge1": return _edge__edge1;
				case "_edge2": return _edge__edge2;
				case "_edge3": return _edge__edge3;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "_edge0": _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge1": _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge2": _edge__edge2 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge3": _edge__edge3 = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum ComplexMax_alt_0_ExtendAv_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum ComplexMax_alt_0_ExtendAv_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum ComplexMax_alt_0_ExtendAv_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum ComplexMax_alt_0_ExtendAv_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum ComplexMax_alt_0_ExtendAv_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_ComplexMax.instance.ComplexMax_alt_0_ExtendAv; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ComplexMax_alt_0_ExtendAv(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ComplexMax_alt_0_ExtendAv(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ComplexMax_alt_0_ExtendAv nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ComplexMax_alt_0_ExtendAv cur = this;
				while(cur != null) {
					Match_ComplexMax_alt_0_ExtendAv next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ComplexMax_alt_0_ExtendAv that)
			{
				_node_a = that._node_a;
				_node_b2 = that._node_b2;
				_node_b = that._node_b;
				_node__node0 = that._node__node0;
				_node_c = that._node_c;
				_edge__edge0 = that._edge__edge0;
				_edge__edge1 = that._edge__edge1;
				_edge__edge2 = that._edge__edge2;
				_edge__edge3 = that._edge__edge3;
			}

			public Match_ComplexMax_alt_0_ExtendAv(Match_ComplexMax_alt_0_ExtendAv that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ComplexMax_alt_0_ExtendAv that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_a = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_a];
				_node_b2 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b2];
				_node_b = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b];
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
				_node_c = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_c];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				_edge__edge1 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge1];
				_edge__edge2 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge2];
				_edge__edge3 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge3];
			}

			public Match_ComplexMax_alt_0_ExtendAv(Match_ComplexMax_alt_0_ExtendAv that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_ComplexMax_alt_0_ExtendAv()
			{
			}

			public bool IsEqual(Match_ComplexMax_alt_0_ExtendAv that)
			{
				if(that==null) return false;
				if(_node_a != that._node_a) return false;
				if(_node_b2 != that._node_b2) return false;
				if(_node_b != that._node_b) return false;
				if(_node__node0 != that._node__node0) return false;
				if(_node_c != that._node_c) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(_edge__edge1 != that._edge__edge1) return false;
				if(_edge__edge2 != that._edge__edge2) return false;
				if(_edge__edge3 != that._edge__edge3) return false;
				return true;
			}
		}

		public class Match_ComplexMax_alt_0_ExtendAv_neg_0 : GRGEN_LGSP.MatchListElement<Match_ComplexMax_alt_0_ExtendAv_neg_0>, IMatch_ComplexMax_alt_0_ExtendAv_neg_0
		{
			public GRGEN_MODEL.IC node_c { get { return (GRGEN_MODEL.IC)_node_c; } set { _node_c = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IC node__node0 { get { return (GRGEN_MODEL.IC)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_c;
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum ComplexMax_alt_0_ExtendAv_neg_0_NodeNums { @c, @_node0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 2; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)ComplexMax_alt_0_ExtendAv_neg_0_NodeNums.@c: return _node_c;
				case (int)ComplexMax_alt_0_ExtendAv_neg_0_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "c": return _node_c;
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "c": _node_c = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge__edge0 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public enum ComplexMax_alt_0_ExtendAv_neg_0_EdgeNums { @_edge0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 1; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)ComplexMax_alt_0_ExtendAv_neg_0_EdgeNums.@_edge0: return _edge__edge0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "_edge0": return _edge__edge0;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "_edge0": _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum ComplexMax_alt_0_ExtendAv_neg_0_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum ComplexMax_alt_0_ExtendAv_neg_0_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum ComplexMax_alt_0_ExtendAv_neg_0_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum ComplexMax_alt_0_ExtendAv_neg_0_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum ComplexMax_alt_0_ExtendAv_neg_0_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_ComplexMax.instance.ComplexMax_alt_0_ExtendAv_neg_0; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ComplexMax_alt_0_ExtendAv_neg_0(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ComplexMax_alt_0_ExtendAv_neg_0(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ComplexMax_alt_0_ExtendAv_neg_0 nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ComplexMax_alt_0_ExtendAv_neg_0 cur = this;
				while(cur != null) {
					Match_ComplexMax_alt_0_ExtendAv_neg_0 next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ComplexMax_alt_0_ExtendAv_neg_0 that)
			{
				_node_c = that._node_c;
				_node__node0 = that._node__node0;
				_edge__edge0 = that._edge__edge0;
			}

			public Match_ComplexMax_alt_0_ExtendAv_neg_0(Match_ComplexMax_alt_0_ExtendAv_neg_0 that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ComplexMax_alt_0_ExtendAv_neg_0 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_c = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_c];
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
			}

			public Match_ComplexMax_alt_0_ExtendAv_neg_0(Match_ComplexMax_alt_0_ExtendAv_neg_0 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_ComplexMax_alt_0_ExtendAv_neg_0()
			{
			}

			public bool IsEqual(Match_ComplexMax_alt_0_ExtendAv_neg_0 that)
			{
				if(that==null) return false;
				if(_node_c != that._node_c) return false;
				if(_node__node0 != that._node__node0) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				return true;
			}
		}

		public class Match_ComplexMax_alt_0_ExtendAv2 : GRGEN_LGSP.MatchListElement<Match_ComplexMax_alt_0_ExtendAv2>, IMatch_ComplexMax_alt_0_ExtendAv2
		{
			public GRGEN_MODEL.IA node_a { get { return (GRGEN_MODEL.IA)_node_a; } set { _node_a = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b2 { get { return (GRGEN_MODEL.IB)_node_b2; } set { _node_b2 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b { get { return (GRGEN_MODEL.IB)_node_b; } set { _node_b = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IC node__node0 { get { return (GRGEN_MODEL.IC)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IC node__node1 { get { return (GRGEN_MODEL.IC)_node__node1; } set { _node__node1 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IC node__node2 { get { return (GRGEN_MODEL.IC)_node__node2; } set { _node__node2 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_a;
			public GRGEN_LGSP.LGSPNode _node_b2;
			public GRGEN_LGSP.LGSPNode _node_b;
			public GRGEN_LGSP.LGSPNode _node__node0;
			public GRGEN_LGSP.LGSPNode _node__node1;
			public GRGEN_LGSP.LGSPNode _node__node2;
			public enum ComplexMax_alt_0_ExtendAv2_NodeNums { @a, @b2, @b, @_node0, @_node1, @_node2, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 6; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)ComplexMax_alt_0_ExtendAv2_NodeNums.@a: return _node_a;
				case (int)ComplexMax_alt_0_ExtendAv2_NodeNums.@b2: return _node_b2;
				case (int)ComplexMax_alt_0_ExtendAv2_NodeNums.@b: return _node_b;
				case (int)ComplexMax_alt_0_ExtendAv2_NodeNums.@_node0: return _node__node0;
				case (int)ComplexMax_alt_0_ExtendAv2_NodeNums.@_node1: return _node__node1;
				case (int)ComplexMax_alt_0_ExtendAv2_NodeNums.@_node2: return _node__node2;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "a": return _node_a;
				case "b2": return _node_b2;
				case "b": return _node_b;
				case "_node0": return _node__node0;
				case "_node1": return _node__node1;
				case "_node2": return _node__node2;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "a": _node_a = (GRGEN_LGSP.LGSPNode)value; break;
				case "b2": _node_b2 = (GRGEN_LGSP.LGSPNode)value; break;
				case "b": _node_b = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node1": _node__node1 = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node2": _node__node2 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge__edge0 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge1 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge1; } set { _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge2 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge2; } set { _edge__edge2 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge3 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge3; } set { _edge__edge3 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge4 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge4; } set { _edge__edge4 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public GRGEN_LGSP.LGSPEdge _edge__edge1;
			public GRGEN_LGSP.LGSPEdge _edge__edge2;
			public GRGEN_LGSP.LGSPEdge _edge__edge3;
			public GRGEN_LGSP.LGSPEdge _edge__edge4;
			public enum ComplexMax_alt_0_ExtendAv2_EdgeNums { @_edge0, @_edge1, @_edge2, @_edge3, @_edge4, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 5; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)ComplexMax_alt_0_ExtendAv2_EdgeNums.@_edge0: return _edge__edge0;
				case (int)ComplexMax_alt_0_ExtendAv2_EdgeNums.@_edge1: return _edge__edge1;
				case (int)ComplexMax_alt_0_ExtendAv2_EdgeNums.@_edge2: return _edge__edge2;
				case (int)ComplexMax_alt_0_ExtendAv2_EdgeNums.@_edge3: return _edge__edge3;
				case (int)ComplexMax_alt_0_ExtendAv2_EdgeNums.@_edge4: return _edge__edge4;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "_edge0": return _edge__edge0;
				case "_edge1": return _edge__edge1;
				case "_edge2": return _edge__edge2;
				case "_edge3": return _edge__edge3;
				case "_edge4": return _edge__edge4;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "_edge0": _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge1": _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge2": _edge__edge2 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge3": _edge__edge3 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge4": _edge__edge4 = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum ComplexMax_alt_0_ExtendAv2_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum ComplexMax_alt_0_ExtendAv2_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum ComplexMax_alt_0_ExtendAv2_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum ComplexMax_alt_0_ExtendAv2_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum ComplexMax_alt_0_ExtendAv2_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_ComplexMax.instance.ComplexMax_alt_0_ExtendAv2; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ComplexMax_alt_0_ExtendAv2(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ComplexMax_alt_0_ExtendAv2(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ComplexMax_alt_0_ExtendAv2 nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ComplexMax_alt_0_ExtendAv2 cur = this;
				while(cur != null) {
					Match_ComplexMax_alt_0_ExtendAv2 next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ComplexMax_alt_0_ExtendAv2 that)
			{
				_node_a = that._node_a;
				_node_b2 = that._node_b2;
				_node_b = that._node_b;
				_node__node0 = that._node__node0;
				_node__node1 = that._node__node1;
				_node__node2 = that._node__node2;
				_edge__edge0 = that._edge__edge0;
				_edge__edge1 = that._edge__edge1;
				_edge__edge2 = that._edge__edge2;
				_edge__edge3 = that._edge__edge3;
				_edge__edge4 = that._edge__edge4;
			}

			public Match_ComplexMax_alt_0_ExtendAv2(Match_ComplexMax_alt_0_ExtendAv2 that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ComplexMax_alt_0_ExtendAv2 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_a = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_a];
				_node_b2 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b2];
				_node_b = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b];
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
				_node__node1 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node1];
				_node__node2 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node2];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				_edge__edge1 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge1];
				_edge__edge2 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge2];
				_edge__edge3 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge3];
				_edge__edge4 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge4];
			}

			public Match_ComplexMax_alt_0_ExtendAv2(Match_ComplexMax_alt_0_ExtendAv2 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_ComplexMax_alt_0_ExtendAv2()
			{
			}

			public bool IsEqual(Match_ComplexMax_alt_0_ExtendAv2 that)
			{
				if(that==null) return false;
				if(_node_a != that._node_a) return false;
				if(_node_b2 != that._node_b2) return false;
				if(_node_b != that._node_b) return false;
				if(_node__node0 != that._node__node0) return false;
				if(_node__node1 != that._node__node1) return false;
				if(_node__node2 != that._node__node2) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(_edge__edge1 != that._edge__edge1) return false;
				if(_edge__edge2 != that._edge__edge2) return false;
				if(_edge__edge3 != that._edge__edge3) return false;
				if(_edge__edge4 != that._edge__edge4) return false;
				return true;
			}
		}

		public class Match_ComplexMax_alt_0_ExtendNA2 : GRGEN_LGSP.MatchListElement<Match_ComplexMax_alt_0_ExtendNA2>, IMatch_ComplexMax_alt_0_ExtendNA2
		{
			public GRGEN_MODEL.IA node_a { get { return (GRGEN_MODEL.IA)_node_a; } set { _node_a = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IC node__node0 { get { return (GRGEN_MODEL.IC)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IC node__node1 { get { return (GRGEN_MODEL.IC)_node__node1; } set { _node__node1 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b { get { return (GRGEN_MODEL.IB)_node_b; } set { _node_b = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b2 { get { return (GRGEN_MODEL.IB)_node_b2; } set { _node_b2 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_a;
			public GRGEN_LGSP.LGSPNode _node__node0;
			public GRGEN_LGSP.LGSPNode _node__node1;
			public GRGEN_LGSP.LGSPNode _node_b;
			public GRGEN_LGSP.LGSPNode _node_b2;
			public enum ComplexMax_alt_0_ExtendNA2_NodeNums { @a, @_node0, @_node1, @b, @b2, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 5; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)ComplexMax_alt_0_ExtendNA2_NodeNums.@a: return _node_a;
				case (int)ComplexMax_alt_0_ExtendNA2_NodeNums.@_node0: return _node__node0;
				case (int)ComplexMax_alt_0_ExtendNA2_NodeNums.@_node1: return _node__node1;
				case (int)ComplexMax_alt_0_ExtendNA2_NodeNums.@b: return _node_b;
				case (int)ComplexMax_alt_0_ExtendNA2_NodeNums.@b2: return _node_b2;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "a": return _node_a;
				case "_node0": return _node__node0;
				case "_node1": return _node__node1;
				case "b": return _node_b;
				case "b2": return _node_b2;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "a": _node_a = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node1": _node__node1 = (GRGEN_LGSP.LGSPNode)value; break;
				case "b": _node_b = (GRGEN_LGSP.LGSPNode)value; break;
				case "b2": _node_b2 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge__edge0 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge1 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge1; } set { _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge2 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge2; } set { _edge__edge2 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge3 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge3; } set { _edge__edge3 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public GRGEN_LGSP.LGSPEdge _edge__edge1;
			public GRGEN_LGSP.LGSPEdge _edge__edge2;
			public GRGEN_LGSP.LGSPEdge _edge__edge3;
			public enum ComplexMax_alt_0_ExtendNA2_EdgeNums { @_edge0, @_edge1, @_edge2, @_edge3, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 4; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)ComplexMax_alt_0_ExtendNA2_EdgeNums.@_edge0: return _edge__edge0;
				case (int)ComplexMax_alt_0_ExtendNA2_EdgeNums.@_edge1: return _edge__edge1;
				case (int)ComplexMax_alt_0_ExtendNA2_EdgeNums.@_edge2: return _edge__edge2;
				case (int)ComplexMax_alt_0_ExtendNA2_EdgeNums.@_edge3: return _edge__edge3;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "_edge0": return _edge__edge0;
				case "_edge1": return _edge__edge1;
				case "_edge2": return _edge__edge2;
				case "_edge3": return _edge__edge3;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "_edge0": _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge1": _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge2": _edge__edge2 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge3": _edge__edge3 = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum ComplexMax_alt_0_ExtendNA2_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum ComplexMax_alt_0_ExtendNA2_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum ComplexMax_alt_0_ExtendNA2_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum ComplexMax_alt_0_ExtendNA2_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum ComplexMax_alt_0_ExtendNA2_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_ComplexMax.instance.ComplexMax_alt_0_ExtendNA2; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ComplexMax_alt_0_ExtendNA2(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ComplexMax_alt_0_ExtendNA2(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ComplexMax_alt_0_ExtendNA2 nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ComplexMax_alt_0_ExtendNA2 cur = this;
				while(cur != null) {
					Match_ComplexMax_alt_0_ExtendNA2 next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ComplexMax_alt_0_ExtendNA2 that)
			{
				_node_a = that._node_a;
				_node__node0 = that._node__node0;
				_node__node1 = that._node__node1;
				_node_b = that._node_b;
				_node_b2 = that._node_b2;
				_edge__edge0 = that._edge__edge0;
				_edge__edge1 = that._edge__edge1;
				_edge__edge2 = that._edge__edge2;
				_edge__edge3 = that._edge__edge3;
			}

			public Match_ComplexMax_alt_0_ExtendNA2(Match_ComplexMax_alt_0_ExtendNA2 that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ComplexMax_alt_0_ExtendNA2 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_a = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_a];
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
				_node__node1 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node1];
				_node_b = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b];
				_node_b2 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b2];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				_edge__edge1 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge1];
				_edge__edge2 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge2];
				_edge__edge3 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge3];
			}

			public Match_ComplexMax_alt_0_ExtendNA2(Match_ComplexMax_alt_0_ExtendNA2 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_ComplexMax_alt_0_ExtendNA2()
			{
			}

			public bool IsEqual(Match_ComplexMax_alt_0_ExtendNA2 that)
			{
				if(that==null) return false;
				if(_node_a != that._node_a) return false;
				if(_node__node0 != that._node__node0) return false;
				if(_node__node1 != that._node__node1) return false;
				if(_node_b != that._node_b) return false;
				if(_node_b2 != that._node_b2) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(_edge__edge1 != that._edge__edge1) return false;
				if(_edge__edge2 != that._edge__edge2) return false;
				if(_edge__edge3 != that._edge__edge3) return false;
				return true;
			}
		}


		public class Extractor
		{
			public static List<GRGEN_MODEL.IA> Extract_a(List<IMatch_ComplexMax> matchList)
			{
				List<GRGEN_MODEL.IA> resultList = new List<GRGEN_MODEL.IA>(matchList.Count);
				foreach(IMatch_ComplexMax match in matchList)
					resultList.Add(match.node_a);
				return resultList;
			}
			public static List<GRGEN_MODEL.IB> Extract_b(List<IMatch_ComplexMax> matchList)
			{
				List<GRGEN_MODEL.IB> resultList = new List<GRGEN_MODEL.IB>(matchList.Count);
				foreach(IMatch_ComplexMax match in matchList)
					resultList.Add(match.node_b);
				return resultList;
			}
			public static List<GRGEN_LIBGR.IDEdge> Extract__edge0(List<IMatch_ComplexMax> matchList)
			{
				List<GRGEN_LIBGR.IDEdge> resultList = new List<GRGEN_LIBGR.IDEdge>(matchList.Count);
				foreach(IMatch_ComplexMax match in matchList)
					resultList.Add(match.edge__edge0);
				return resultList;
			}
			public static List<GRGEN_LIBGR.IDEdge> Extract__edge1(List<IMatch_ComplexMax> matchList)
			{
				List<GRGEN_LIBGR.IDEdge> resultList = new List<GRGEN_LIBGR.IDEdge>(matchList.Count);
				foreach(IMatch_ComplexMax match in matchList)
					resultList.Add(match.edge__edge1);
				return resultList;
			}
		}


		public static List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>)
				return ((List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax instanceBearingAttributeForSearch_ComplexMax = new GRGEN_ACTIONS.Rule_ComplexMax.Match_ComplexMax();
		public static List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> Array_ComplexMax_groupBy_a(List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list)
		{
			Dictionary<GRGEN_MODEL.IA, List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>> seenValues = new Dictionary<GRGEN_MODEL.IA, List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_a)) {
					seenValues[list[pos].@node_a].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> tempList = new List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_a, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> newList = new List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>();
			foreach(List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> Array_ComplexMax_keepOneForEachBy_a(List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list)
		{
			List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> newList = new List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>();
			Dictionary<GRGEN_MODEL.IA, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_MODEL.IA, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_a)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_a, null);
				}
			}
			return newList;
		}
		public static int Array_ComplexMax_indexOfBy_a(IList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list, GRGEN_MODEL.IA entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_a.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_ComplexMax_indexOfBy_a(IList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list, GRGEN_MODEL.IA entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_a.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_ComplexMax_lastIndexOfBy_a(IList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list, GRGEN_MODEL.IA entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_a.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_ComplexMax_lastIndexOfBy_a(IList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list, GRGEN_MODEL.IA entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_a.Equals(entry))
					return i;
			return -1;
		}
		public static List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> Array_ComplexMax_groupBy_b(List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list)
		{
			Dictionary<GRGEN_MODEL.IB, List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>> seenValues = new Dictionary<GRGEN_MODEL.IB, List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_b)) {
					seenValues[list[pos].@node_b].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> tempList = new List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_b, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> newList = new List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>();
			foreach(List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> Array_ComplexMax_keepOneForEachBy_b(List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list)
		{
			List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> newList = new List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>();
			Dictionary<GRGEN_MODEL.IB, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_MODEL.IB, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_b)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_b, null);
				}
			}
			return newList;
		}
		public static int Array_ComplexMax_indexOfBy_b(IList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list, GRGEN_MODEL.IB entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_b.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_ComplexMax_indexOfBy_b(IList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list, GRGEN_MODEL.IB entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_b.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_ComplexMax_lastIndexOfBy_b(IList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list, GRGEN_MODEL.IB entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_b.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_ComplexMax_lastIndexOfBy_b(IList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list, GRGEN_MODEL.IB entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_b.Equals(entry))
					return i;
			return -1;
		}
		public static List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> Array_ComplexMax_groupBy__edge0(List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list)
		{
			Dictionary<GRGEN_LIBGR.IDEdge, List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>> seenValues = new Dictionary<GRGEN_LIBGR.IDEdge, List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@edge__edge0)) {
					seenValues[list[pos].@edge__edge0].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> tempList = new List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@edge__edge0, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> newList = new List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>();
			foreach(List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> Array_ComplexMax_keepOneForEachBy__edge0(List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list)
		{
			List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> newList = new List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>();
			Dictionary<GRGEN_LIBGR.IDEdge, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.IDEdge, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@edge__edge0)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@edge__edge0, null);
				}
			}
			return newList;
		}
		public static int Array_ComplexMax_indexOfBy__edge0(IList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list, GRGEN_LIBGR.IDEdge entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@edge__edge0.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_ComplexMax_indexOfBy__edge0(IList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list, GRGEN_LIBGR.IDEdge entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@edge__edge0.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_ComplexMax_lastIndexOfBy__edge0(IList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list, GRGEN_LIBGR.IDEdge entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@edge__edge0.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_ComplexMax_lastIndexOfBy__edge0(IList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list, GRGEN_LIBGR.IDEdge entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@edge__edge0.Equals(entry))
					return i;
			return -1;
		}
		public static List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> Array_ComplexMax_groupBy__edge1(List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list)
		{
			Dictionary<GRGEN_LIBGR.IDEdge, List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>> seenValues = new Dictionary<GRGEN_LIBGR.IDEdge, List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@edge__edge1)) {
					seenValues[list[pos].@edge__edge1].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> tempList = new List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@edge__edge1, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> newList = new List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>();
			foreach(List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> Array_ComplexMax_keepOneForEachBy__edge1(List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list)
		{
			List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> newList = new List<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax>();
			Dictionary<GRGEN_LIBGR.IDEdge, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.IDEdge, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@edge__edge1)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@edge__edge1, null);
				}
			}
			return newList;
		}
		public static int Array_ComplexMax_indexOfBy__edge1(IList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list, GRGEN_LIBGR.IDEdge entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@edge__edge1.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_ComplexMax_indexOfBy__edge1(IList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list, GRGEN_LIBGR.IDEdge entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@edge__edge1.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_ComplexMax_lastIndexOfBy__edge1(IList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list, GRGEN_LIBGR.IDEdge entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@edge__edge1.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_ComplexMax_lastIndexOfBy__edge1(IList<GRGEN_ACTIONS.Rule_ComplexMax.IMatch_ComplexMax> list, GRGEN_LIBGR.IDEdge entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@edge__edge1.Equals(entry))
					return i;
			return -1;
		}
	}

	public class Rule_createABA : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_createABA instance = null;
		public static Rule_createABA Instance { get { if(instance==null) { instance = new Rule_createABA(); instance.initialize(); } return instance; } }

		public enum createABA_NodeNums { };
		public enum createABA_EdgeNums { };
		public enum createABA_VariableNums { };
		public enum createABA_SubNums { };
		public enum createABA_AltNums { };
		public enum createABA_IterNums { };





		public GRGEN_LGSP.PatternGraph pat_createABA;


		private Rule_createABA()
			: base("createABA",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_createABA+IMatch_createABA",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_createABA+Match_createABA"
			)
		{
		}
		private void initialize()
		{
			bool[,] createABA_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] createABA_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] createABA_isNodeTotallyHomomorphic = new bool[0];
			bool[] createABA_isEdgeTotallyHomomorphic = new bool[0];
			pat_createABA = new GRGEN_LGSP.PatternGraph(
				"createABA",
				"",
				null, "createABA",
				false, false,
				new GRGEN_LGSP.PatternNode[] {  }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[0, 0] ,
				new bool[0, 0] ,
				createABA_isNodeHomomorphicGlobal,
				createABA_isEdgeHomomorphicGlobal,
				createABA_isNodeTotallyHomomorphic,
				createABA_isEdgeTotallyHomomorphic
			);


			patternGraph = pat_createABA;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_createABA curMatch = (Match_createABA)_curMatch;
			graph.SettingAddedNodeNames( createABA_addedNodeNames );
			GRGEN_MODEL.@A node_a = GRGEN_MODEL.@A.CreateNode(graph);
			GRGEN_MODEL.@B node_b = GRGEN_MODEL.@B.CreateNode(graph);
			graph.SettingAddedEdgeNames( createABA_addedEdgeNames );
			GRGEN_MODEL.@Edge edge__edge0 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_a, node_b);
			GRGEN_MODEL.@Edge edge__edge1 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_b, node_a);
			GRGEN_MODEL.@Edge edge__edge2 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_a, node_b);
			GRGEN_MODEL.@Edge edge__edge3 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_b, node_a);
			actionEnv.SelectedMatchRewritten();
			return;
		}
		private static string[] createABA_addedNodeNames = new string[] { "a", "b" };
		private static string[] createABA_addedEdgeNames = new string[] { "_edge0", "_edge1", "_edge2", "_edge3" };

		static Rule_createABA() {
		}

		public interface IMatch_createABA : GRGEN_LIBGR.IMatch
		{
			//Nodes
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_createABA : GRGEN_LGSP.MatchListElement<Match_createABA>, IMatch_createABA
		{
			public enum createABA_NodeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 0; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createABA_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createABA_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum createABA_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createABA_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createABA_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum createABA_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_createABA.instance.pat_createABA; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_createABA(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_createABA(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_createABA nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_createABA cur = this;
				while(cur != null) {
					Match_createABA next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_createABA that)
			{
			}

			public Match_createABA(Match_createABA that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_createABA that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
			}

			public Match_createABA(Match_createABA that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_createABA()
			{
			}

			public bool IsEqual(Match_createABA that)
			{
				if(that==null) return false;
				return true;
			}
		}


		public class Extractor
		{
		}


		public static List<GRGEN_ACTIONS.Rule_createABA.IMatch_createABA> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_createABA.IMatch_createABA>)
				return ((List<GRGEN_ACTIONS.Rule_createABA.IMatch_createABA>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_createABA.IMatch_createABA>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_createABA.IMatch_createABA instanceBearingAttributeForSearch_createABA = new GRGEN_ACTIONS.Rule_createABA.Match_createABA();
	}

	public class Rule_homm : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_homm instance = null;
		public static Rule_homm Instance { get { if(instance==null) { instance = new Rule_homm(); instance.initialize(); } return instance; } }

		public static GRGEN_LIBGR.NodeType[] homm_node_a_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] homm_node_b_AllowedTypes = null;
		public static bool[] homm_node_a_IsAllowedType = null;
		public static bool[] homm_node_b_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] homm_edge__edge0_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] homm_edge__edge1_AllowedTypes = null;
		public static bool[] homm_edge__edge0_IsAllowedType = null;
		public static bool[] homm_edge__edge1_IsAllowedType = null;
		public enum homm_NodeNums { @a, @b, };
		public enum homm_EdgeNums { @_edge0, @_edge1, };
		public enum homm_VariableNums { };
		public enum homm_SubNums { };
		public enum homm_AltNums { @alt_0, };
		public enum homm_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_homm;

		public enum homm_alt_0_CaseNums { @case1, @case2, };
		public static GRGEN_LIBGR.NodeType[] homm_alt_0_case1_node_b2_AllowedTypes = null;
		public static bool[] homm_alt_0_case1_node_b2_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] homm_alt_0_case1_edge__edge0_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] homm_alt_0_case1_edge__edge1_AllowedTypes = null;
		public static bool[] homm_alt_0_case1_edge__edge0_IsAllowedType = null;
		public static bool[] homm_alt_0_case1_edge__edge1_IsAllowedType = null;
		public enum homm_alt_0_case1_NodeNums { @a, @b2, @b, };
		public enum homm_alt_0_case1_EdgeNums { @_edge0, @_edge1, };
		public enum homm_alt_0_case1_VariableNums { };
		public enum homm_alt_0_case1_SubNums { };
		public enum homm_alt_0_case1_AltNums { };
		public enum homm_alt_0_case1_IterNums { };



		public GRGEN_LGSP.PatternGraph homm_alt_0_case1;

		public static GRGEN_LIBGR.NodeType[] homm_alt_0_case2_node_b2_AllowedTypes = null;
		public static bool[] homm_alt_0_case2_node_b2_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] homm_alt_0_case2_edge__edge0_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] homm_alt_0_case2_edge__edge1_AllowedTypes = null;
		public static bool[] homm_alt_0_case2_edge__edge0_IsAllowedType = null;
		public static bool[] homm_alt_0_case2_edge__edge1_IsAllowedType = null;
		public enum homm_alt_0_case2_NodeNums { @a, @b2, };
		public enum homm_alt_0_case2_EdgeNums { @_edge0, @_edge1, };
		public enum homm_alt_0_case2_VariableNums { };
		public enum homm_alt_0_case2_SubNums { };
		public enum homm_alt_0_case2_AltNums { };
		public enum homm_alt_0_case2_IterNums { };



		public GRGEN_LGSP.PatternGraph homm_alt_0_case2;


		private Rule_homm()
			: base("homm",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_homm+IMatch_homm",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_homm+Match_homm"
			)
		{
		}
		private void initialize()
		{
			bool[,] homm_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] homm_isEdgeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[] homm_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] homm_isEdgeTotallyHomomorphic = new bool[2] { false, false,  };
			GRGEN_LGSP.PatternNode homm_node_a = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@A, GRGEN_MODEL.NodeType_A.typeVar, "GRGEN_MODEL.IA", "homm_node_a", "a", homm_node_a_AllowedTypes, homm_node_a_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode homm_node_b = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@B, GRGEN_MODEL.NodeType_B.typeVar, "GRGEN_MODEL.IB", "homm_node_b", "b", homm_node_b_AllowedTypes, homm_node_b_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge homm_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "homm_edge__edge0", "_edge0", homm_edge__edge0_AllowedTypes, homm_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge homm_edge__edge1 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "homm_edge__edge1", "_edge1", homm_edge__edge1_AllowedTypes, homm_edge__edge1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			bool[,] homm_alt_0_case1_isNodeHomomorphicGlobal = new bool[3, 3] {
				{ false, false, false, },
				{ false, false, true, },
				{ false, true, false, },
			};
			bool[,] homm_alt_0_case1_isEdgeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[] homm_alt_0_case1_isNodeTotallyHomomorphic = new bool[3] { false, false, false,  };
			bool[] homm_alt_0_case1_isEdgeTotallyHomomorphic = new bool[2] { false, false,  };
			GRGEN_LGSP.PatternNode homm_alt_0_case1_node_b2 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@B, GRGEN_MODEL.NodeType_B.typeVar, "GRGEN_MODEL.IB", "homm_alt_0_case1_node_b2", "b2", homm_alt_0_case1_node_b2_AllowedTypes, homm_alt_0_case1_node_b2_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge homm_alt_0_case1_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "homm_alt_0_case1_edge__edge0", "_edge0", homm_alt_0_case1_edge__edge0_AllowedTypes, homm_alt_0_case1_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge homm_alt_0_case1_edge__edge1 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "homm_alt_0_case1_edge__edge1", "_edge1", homm_alt_0_case1_edge__edge1_AllowedTypes, homm_alt_0_case1_edge__edge1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			homm_alt_0_case1 = new GRGEN_LGSP.PatternGraph(
				"case1",
				"homm_alt_0_",
				null, "case1",
				false, false,
				new GRGEN_LGSP.PatternNode[] { homm_node_a, homm_alt_0_case1_node_b2, homm_node_b }, 
				new GRGEN_LGSP.PatternEdge[] { homm_alt_0_case1_edge__edge0, homm_alt_0_case1_edge__edge1 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[3, 3] {
					{ true, false, true, },
					{ false, true, true, },
					{ true, true, true, },
				},
				new bool[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				homm_alt_0_case1_isNodeHomomorphicGlobal,
				homm_alt_0_case1_isEdgeHomomorphicGlobal,
				homm_alt_0_case1_isNodeTotallyHomomorphic,
				homm_alt_0_case1_isEdgeTotallyHomomorphic
			);
			homm_alt_0_case1.edgeToSourceNode.Add(homm_alt_0_case1_edge__edge0, homm_node_a);
			homm_alt_0_case1.edgeToTargetNode.Add(homm_alt_0_case1_edge__edge0, homm_alt_0_case1_node_b2);
			homm_alt_0_case1.edgeToSourceNode.Add(homm_alt_0_case1_edge__edge1, homm_alt_0_case1_node_b2);
			homm_alt_0_case1.edgeToTargetNode.Add(homm_alt_0_case1_edge__edge1, homm_node_a);

			bool[,] homm_alt_0_case2_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] homm_alt_0_case2_isEdgeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[] homm_alt_0_case2_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] homm_alt_0_case2_isEdgeTotallyHomomorphic = new bool[2] { false, false,  };
			GRGEN_LGSP.PatternNode homm_alt_0_case2_node_b2 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@B, GRGEN_MODEL.NodeType_B.typeVar, "GRGEN_MODEL.IB", "homm_alt_0_case2_node_b2", "b2", homm_alt_0_case2_node_b2_AllowedTypes, homm_alt_0_case2_node_b2_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge homm_alt_0_case2_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "homm_alt_0_case2_edge__edge0", "_edge0", homm_alt_0_case2_edge__edge0_AllowedTypes, homm_alt_0_case2_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge homm_alt_0_case2_edge__edge1 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "homm_alt_0_case2_edge__edge1", "_edge1", homm_alt_0_case2_edge__edge1_AllowedTypes, homm_alt_0_case2_edge__edge1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			homm_alt_0_case2 = new GRGEN_LGSP.PatternGraph(
				"case2",
				"homm_alt_0_",
				null, "case2",
				false, false,
				new GRGEN_LGSP.PatternNode[] { homm_node_a, homm_alt_0_case2_node_b2 }, 
				new GRGEN_LGSP.PatternEdge[] { homm_alt_0_case2_edge__edge0, homm_alt_0_case2_edge__edge1 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				new bool[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				homm_alt_0_case2_isNodeHomomorphicGlobal,
				homm_alt_0_case2_isEdgeHomomorphicGlobal,
				homm_alt_0_case2_isNodeTotallyHomomorphic,
				homm_alt_0_case2_isEdgeTotallyHomomorphic
			);
			homm_alt_0_case2.edgeToSourceNode.Add(homm_alt_0_case2_edge__edge0, homm_node_a);
			homm_alt_0_case2.edgeToTargetNode.Add(homm_alt_0_case2_edge__edge0, homm_alt_0_case2_node_b2);
			homm_alt_0_case2.edgeToSourceNode.Add(homm_alt_0_case2_edge__edge1, homm_alt_0_case2_node_b2);
			homm_alt_0_case2.edgeToTargetNode.Add(homm_alt_0_case2_edge__edge1, homm_node_a);

			GRGEN_LGSP.Alternative homm_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "homm_", new GRGEN_LGSP.PatternGraph[] { homm_alt_0_case1, homm_alt_0_case2 } );

			pat_homm = new GRGEN_LGSP.PatternGraph(
				"homm",
				"",
				null, "homm",
				false, false,
				new GRGEN_LGSP.PatternNode[] { homm_node_a, homm_node_b }, 
				new GRGEN_LGSP.PatternEdge[] { homm_edge__edge0, homm_edge__edge1 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { homm_alt_0,  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				new bool[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				homm_isNodeHomomorphicGlobal,
				homm_isEdgeHomomorphicGlobal,
				homm_isNodeTotallyHomomorphic,
				homm_isEdgeTotallyHomomorphic
			);
			pat_homm.edgeToSourceNode.Add(homm_edge__edge0, homm_node_a);
			pat_homm.edgeToTargetNode.Add(homm_edge__edge0, homm_node_b);
			pat_homm.edgeToSourceNode.Add(homm_edge__edge1, homm_node_b);
			pat_homm.edgeToTargetNode.Add(homm_edge__edge1, homm_node_a);
			homm_alt_0_case1.embeddingGraph = pat_homm;
			homm_alt_0_case2.embeddingGraph = pat_homm;

			homm_node_a.pointOfDefinition = pat_homm;
			homm_node_b.pointOfDefinition = pat_homm;
			homm_edge__edge0.pointOfDefinition = pat_homm;
			homm_edge__edge1.pointOfDefinition = pat_homm;
			homm_alt_0_case1_node_b2.pointOfDefinition = homm_alt_0_case1;
			homm_alt_0_case1_edge__edge0.pointOfDefinition = homm_alt_0_case1;
			homm_alt_0_case1_edge__edge1.pointOfDefinition = homm_alt_0_case1;
			homm_alt_0_case2_node_b2.pointOfDefinition = homm_alt_0_case2;
			homm_alt_0_case2_edge__edge0.pointOfDefinition = homm_alt_0_case2;
			homm_alt_0_case2_edge__edge1.pointOfDefinition = homm_alt_0_case2;

			patternGraph = pat_homm;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_homm curMatch = (Match_homm)_curMatch;
			IMatch_homm_alt_0 alternative_alt_0 = curMatch._alt_0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		public void homm_alt_0_case1_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_homm_alt_0_case1 curMatch = (Match_homm_alt_0_case1)_curMatch;
		}

		public void homm_alt_0_case2_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_homm_alt_0_case2 curMatch = (Match_homm_alt_0_case2)_curMatch;
		}

		static Rule_homm() {
		}

		public interface IMatch_homm : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_MODEL.IA node_a { get; set; }
			GRGEN_MODEL.IB node_b { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge1 { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			IMatch_homm_alt_0 alt_0 { get; }
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_homm_alt_0 : GRGEN_LIBGR.IMatch
		{
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_homm_alt_0_case1 : IMatch_homm_alt_0
		{
			//Nodes
			GRGEN_MODEL.IA node_a { get; set; }
			GRGEN_MODEL.IB node_b2 { get; set; }
			GRGEN_MODEL.IB node_b { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge1 { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_homm_alt_0_case2 : IMatch_homm_alt_0
		{
			//Nodes
			GRGEN_MODEL.IA node_a { get; set; }
			GRGEN_MODEL.IB node_b2 { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge1 { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_homm : GRGEN_LGSP.MatchListElement<Match_homm>, IMatch_homm
		{
			public GRGEN_MODEL.IA node_a { get { return (GRGEN_MODEL.IA)_node_a; } set { _node_a = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b { get { return (GRGEN_MODEL.IB)_node_b; } set { _node_b = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_a;
			public GRGEN_LGSP.LGSPNode _node_b;
			public enum homm_NodeNums { @a, @b, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 2; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)homm_NodeNums.@a: return _node_a;
				case (int)homm_NodeNums.@b: return _node_b;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "a": return _node_a;
				case "b": return _node_b;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "a": _node_a = (GRGEN_LGSP.LGSPNode)value; break;
				case "b": _node_b = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge__edge0 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge1 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge1; } set { _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public GRGEN_LGSP.LGSPEdge _edge__edge1;
			public enum homm_EdgeNums { @_edge0, @_edge1, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 2; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)homm_EdgeNums.@_edge0: return _edge__edge0;
				case (int)homm_EdgeNums.@_edge1: return _edge__edge1;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "_edge0": return _edge__edge0;
				case "_edge1": return _edge__edge1;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "_edge0": _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge1": _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum homm_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum homm_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public IMatch_homm_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_homm_alt_0 _alt_0;
			public enum homm_AltNums { @alt_0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 1; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				case (int)homm_AltNums.@alt_0: return _alt_0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				case "alt_0": return _alt_0;
				default: return null;
				}
			}

			public enum homm_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum homm_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_homm.instance.pat_homm; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_homm(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_homm(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_homm nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_homm cur = this;
				while(cur != null) {
					Match_homm next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_homm that)
			{
				_node_a = that._node_a;
				_node_b = that._node_b;
				_edge__edge0 = that._edge__edge0;
				_edge__edge1 = that._edge__edge1;
				_alt_0 = that._alt_0;
			}

			public Match_homm(Match_homm that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_homm that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_a = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_a];
				_node_b = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				_edge__edge1 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge1];
				if(that._alt_0 is Match_homm_alt_0_case1)
					_alt_0 = new Match_homm_alt_0_case1((Match_homm_alt_0_case1)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_homm_alt_0_case2)
					_alt_0 = new Match_homm_alt_0_case2((Match_homm_alt_0_case2)that._alt_0, oldToNewMap);
			}

			public Match_homm(Match_homm that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_homm()
			{
			}

			public bool IsEqual(Match_homm that)
			{
				if(that==null) return false;
				if(_node_a != that._node_a) return false;
				if(_node_b != that._node_b) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(_edge__edge1 != that._edge__edge1) return false;
				if(_alt_0 is Match_homm_alt_0_case1 && !(_alt_0 as Match_homm_alt_0_case1).IsEqual(that._alt_0 as Match_homm_alt_0_case1)) return false;
				if(_alt_0 is Match_homm_alt_0_case2 && !(_alt_0 as Match_homm_alt_0_case2).IsEqual(that._alt_0 as Match_homm_alt_0_case2)) return false;
				return true;
			}
		}

		public class Match_homm_alt_0_case1 : GRGEN_LGSP.MatchListElement<Match_homm_alt_0_case1>, IMatch_homm_alt_0_case1
		{
			public GRGEN_MODEL.IA node_a { get { return (GRGEN_MODEL.IA)_node_a; } set { _node_a = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b2 { get { return (GRGEN_MODEL.IB)_node_b2; } set { _node_b2 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b { get { return (GRGEN_MODEL.IB)_node_b; } set { _node_b = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_a;
			public GRGEN_LGSP.LGSPNode _node_b2;
			public GRGEN_LGSP.LGSPNode _node_b;
			public enum homm_alt_0_case1_NodeNums { @a, @b2, @b, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 3; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)homm_alt_0_case1_NodeNums.@a: return _node_a;
				case (int)homm_alt_0_case1_NodeNums.@b2: return _node_b2;
				case (int)homm_alt_0_case1_NodeNums.@b: return _node_b;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "a": return _node_a;
				case "b2": return _node_b2;
				case "b": return _node_b;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "a": _node_a = (GRGEN_LGSP.LGSPNode)value; break;
				case "b2": _node_b2 = (GRGEN_LGSP.LGSPNode)value; break;
				case "b": _node_b = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge__edge0 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge1 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge1; } set { _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public GRGEN_LGSP.LGSPEdge _edge__edge1;
			public enum homm_alt_0_case1_EdgeNums { @_edge0, @_edge1, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 2; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)homm_alt_0_case1_EdgeNums.@_edge0: return _edge__edge0;
				case (int)homm_alt_0_case1_EdgeNums.@_edge1: return _edge__edge1;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "_edge0": return _edge__edge0;
				case "_edge1": return _edge__edge1;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "_edge0": _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge1": _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum homm_alt_0_case1_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum homm_alt_0_case1_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum homm_alt_0_case1_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum homm_alt_0_case1_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum homm_alt_0_case1_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_homm.instance.homm_alt_0_case1; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_homm_alt_0_case1(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_homm_alt_0_case1(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_homm_alt_0_case1 nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_homm_alt_0_case1 cur = this;
				while(cur != null) {
					Match_homm_alt_0_case1 next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_homm_alt_0_case1 that)
			{
				_node_a = that._node_a;
				_node_b2 = that._node_b2;
				_node_b = that._node_b;
				_edge__edge0 = that._edge__edge0;
				_edge__edge1 = that._edge__edge1;
			}

			public Match_homm_alt_0_case1(Match_homm_alt_0_case1 that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_homm_alt_0_case1 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_a = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_a];
				_node_b2 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b2];
				_node_b = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				_edge__edge1 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge1];
			}

			public Match_homm_alt_0_case1(Match_homm_alt_0_case1 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_homm_alt_0_case1()
			{
			}

			public bool IsEqual(Match_homm_alt_0_case1 that)
			{
				if(that==null) return false;
				if(_node_a != that._node_a) return false;
				if(_node_b2 != that._node_b2) return false;
				if(_node_b != that._node_b) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(_edge__edge1 != that._edge__edge1) return false;
				return true;
			}
		}

		public class Match_homm_alt_0_case2 : GRGEN_LGSP.MatchListElement<Match_homm_alt_0_case2>, IMatch_homm_alt_0_case2
		{
			public GRGEN_MODEL.IA node_a { get { return (GRGEN_MODEL.IA)_node_a; } set { _node_a = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_MODEL.IB node_b2 { get { return (GRGEN_MODEL.IB)_node_b2; } set { _node_b2 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_a;
			public GRGEN_LGSP.LGSPNode _node_b2;
			public enum homm_alt_0_case2_NodeNums { @a, @b2, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 2; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)homm_alt_0_case2_NodeNums.@a: return _node_a;
				case (int)homm_alt_0_case2_NodeNums.@b2: return _node_b2;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "a": return _node_a;
				case "b2": return _node_b2;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "a": _node_a = (GRGEN_LGSP.LGSPNode)value; break;
				case "b2": _node_b2 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge__edge0 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LIBGR.IDEdge edge__edge1 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge1; } set { _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public GRGEN_LGSP.LGSPEdge _edge__edge1;
			public enum homm_alt_0_case2_EdgeNums { @_edge0, @_edge1, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 2; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)homm_alt_0_case2_EdgeNums.@_edge0: return _edge__edge0;
				case (int)homm_alt_0_case2_EdgeNums.@_edge1: return _edge__edge1;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "_edge0": return _edge__edge0;
				case "_edge1": return _edge__edge1;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "_edge0": _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; break;
				case "_edge1": _edge__edge1 = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum homm_alt_0_case2_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum homm_alt_0_case2_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum homm_alt_0_case2_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum homm_alt_0_case2_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum homm_alt_0_case2_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_homm.instance.homm_alt_0_case2; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_homm_alt_0_case2(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_homm_alt_0_case2(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_homm_alt_0_case2 nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_homm_alt_0_case2 cur = this;
				while(cur != null) {
					Match_homm_alt_0_case2 next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_homm_alt_0_case2 that)
			{
				_node_a = that._node_a;
				_node_b2 = that._node_b2;
				_edge__edge0 = that._edge__edge0;
				_edge__edge1 = that._edge__edge1;
			}

			public Match_homm_alt_0_case2(Match_homm_alt_0_case2 that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_homm_alt_0_case2 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_a = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_a];
				_node_b2 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_b2];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				_edge__edge1 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge1];
			}

			public Match_homm_alt_0_case2(Match_homm_alt_0_case2 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_homm_alt_0_case2()
			{
			}

			public bool IsEqual(Match_homm_alt_0_case2 that)
			{
				if(that==null) return false;
				if(_node_a != that._node_a) return false;
				if(_node_b2 != that._node_b2) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(_edge__edge1 != that._edge__edge1) return false;
				return true;
			}
		}


		public class Extractor
		{
			public static List<GRGEN_MODEL.IA> Extract_a(List<IMatch_homm> matchList)
			{
				List<GRGEN_MODEL.IA> resultList = new List<GRGEN_MODEL.IA>(matchList.Count);
				foreach(IMatch_homm match in matchList)
					resultList.Add(match.node_a);
				return resultList;
			}
			public static List<GRGEN_MODEL.IB> Extract_b(List<IMatch_homm> matchList)
			{
				List<GRGEN_MODEL.IB> resultList = new List<GRGEN_MODEL.IB>(matchList.Count);
				foreach(IMatch_homm match in matchList)
					resultList.Add(match.node_b);
				return resultList;
			}
			public static List<GRGEN_LIBGR.IDEdge> Extract__edge0(List<IMatch_homm> matchList)
			{
				List<GRGEN_LIBGR.IDEdge> resultList = new List<GRGEN_LIBGR.IDEdge>(matchList.Count);
				foreach(IMatch_homm match in matchList)
					resultList.Add(match.edge__edge0);
				return resultList;
			}
			public static List<GRGEN_LIBGR.IDEdge> Extract__edge1(List<IMatch_homm> matchList)
			{
				List<GRGEN_LIBGR.IDEdge> resultList = new List<GRGEN_LIBGR.IDEdge>(matchList.Count);
				foreach(IMatch_homm match in matchList)
					resultList.Add(match.edge__edge1);
				return resultList;
			}
		}


		public static List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>)
				return ((List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_homm.IMatch_homm>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_homm.IMatch_homm instanceBearingAttributeForSearch_homm = new GRGEN_ACTIONS.Rule_homm.Match_homm();
		public static List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> Array_homm_groupBy_a(List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list)
		{
			Dictionary<GRGEN_MODEL.IA, List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>> seenValues = new Dictionary<GRGEN_MODEL.IA, List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_a)) {
					seenValues[list[pos].@node_a].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> tempList = new List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_a, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> newList = new List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>();
			foreach(List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> Array_homm_keepOneForEachBy_a(List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list)
		{
			List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> newList = new List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>();
			Dictionary<GRGEN_MODEL.IA, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_MODEL.IA, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_homm.IMatch_homm element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_a)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_a, null);
				}
			}
			return newList;
		}
		public static int Array_homm_indexOfBy_a(IList<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list, GRGEN_MODEL.IA entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_a.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_homm_indexOfBy_a(IList<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list, GRGEN_MODEL.IA entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_a.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_homm_lastIndexOfBy_a(IList<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list, GRGEN_MODEL.IA entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_a.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_homm_lastIndexOfBy_a(IList<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list, GRGEN_MODEL.IA entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_a.Equals(entry))
					return i;
			return -1;
		}
		public static List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> Array_homm_groupBy_b(List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list)
		{
			Dictionary<GRGEN_MODEL.IB, List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>> seenValues = new Dictionary<GRGEN_MODEL.IB, List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_b)) {
					seenValues[list[pos].@node_b].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> tempList = new List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_b, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> newList = new List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>();
			foreach(List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> Array_homm_keepOneForEachBy_b(List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list)
		{
			List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> newList = new List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>();
			Dictionary<GRGEN_MODEL.IB, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_MODEL.IB, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_homm.IMatch_homm element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_b)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_b, null);
				}
			}
			return newList;
		}
		public static int Array_homm_indexOfBy_b(IList<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list, GRGEN_MODEL.IB entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_b.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_homm_indexOfBy_b(IList<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list, GRGEN_MODEL.IB entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_b.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_homm_lastIndexOfBy_b(IList<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list, GRGEN_MODEL.IB entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_b.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_homm_lastIndexOfBy_b(IList<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list, GRGEN_MODEL.IB entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_b.Equals(entry))
					return i;
			return -1;
		}
		public static List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> Array_homm_groupBy__edge0(List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list)
		{
			Dictionary<GRGEN_LIBGR.IDEdge, List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>> seenValues = new Dictionary<GRGEN_LIBGR.IDEdge, List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@edge__edge0)) {
					seenValues[list[pos].@edge__edge0].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> tempList = new List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@edge__edge0, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> newList = new List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>();
			foreach(List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> Array_homm_keepOneForEachBy__edge0(List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list)
		{
			List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> newList = new List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>();
			Dictionary<GRGEN_LIBGR.IDEdge, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.IDEdge, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_homm.IMatch_homm element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@edge__edge0)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@edge__edge0, null);
				}
			}
			return newList;
		}
		public static int Array_homm_indexOfBy__edge0(IList<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list, GRGEN_LIBGR.IDEdge entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@edge__edge0.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_homm_indexOfBy__edge0(IList<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list, GRGEN_LIBGR.IDEdge entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@edge__edge0.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_homm_lastIndexOfBy__edge0(IList<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list, GRGEN_LIBGR.IDEdge entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@edge__edge0.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_homm_lastIndexOfBy__edge0(IList<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list, GRGEN_LIBGR.IDEdge entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@edge__edge0.Equals(entry))
					return i;
			return -1;
		}
		public static List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> Array_homm_groupBy__edge1(List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list)
		{
			Dictionary<GRGEN_LIBGR.IDEdge, List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>> seenValues = new Dictionary<GRGEN_LIBGR.IDEdge, List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@edge__edge1)) {
					seenValues[list[pos].@edge__edge1].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> tempList = new List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@edge__edge1, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> newList = new List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>();
			foreach(List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> Array_homm_keepOneForEachBy__edge1(List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list)
		{
			List<GRGEN_ACTIONS.Rule_homm.IMatch_homm> newList = new List<GRGEN_ACTIONS.Rule_homm.IMatch_homm>();
			Dictionary<GRGEN_LIBGR.IDEdge, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.IDEdge, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_homm.IMatch_homm element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@edge__edge1)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@edge__edge1, null);
				}
			}
			return newList;
		}
		public static int Array_homm_indexOfBy__edge1(IList<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list, GRGEN_LIBGR.IDEdge entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@edge__edge1.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_homm_indexOfBy__edge1(IList<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list, GRGEN_LIBGR.IDEdge entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@edge__edge1.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_homm_lastIndexOfBy__edge1(IList<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list, GRGEN_LIBGR.IDEdge entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@edge__edge1.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_homm_lastIndexOfBy__edge1(IList<GRGEN_ACTIONS.Rule_homm.IMatch_homm> list, GRGEN_LIBGR.IDEdge entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@edge__edge1.Equals(entry))
					return i;
			return -1;
		}
	}

	public class Rule_XtoAorB : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_XtoAorB instance = null;
		public static Rule_XtoAorB Instance { get { if(instance==null) { instance = new Rule_XtoAorB(); instance.initialize(); } return instance; } }

		public static GRGEN_LIBGR.NodeType[] XtoAorB_node_x_AllowedTypes = null;
		public static bool[] XtoAorB_node_x_IsAllowedType = null;
		public enum XtoAorB_NodeNums { @x, };
		public enum XtoAorB_EdgeNums { };
		public enum XtoAorB_VariableNums { };
		public enum XtoAorB_SubNums { @_sub0, };
		public enum XtoAorB_AltNums { };
		public enum XtoAorB_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_XtoAorB;


		private Rule_XtoAorB()
			: base("XtoAorB",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_XtoAorB+IMatch_XtoAorB",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_XtoAorB+Match_XtoAorB"
			)
		{
		}
		private void initialize()
		{
			bool[,] XtoAorB_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] XtoAorB_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] XtoAorB_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] XtoAorB_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode XtoAorB_node_x = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "XtoAorB_node_x", "x", XtoAorB_node_x_AllowedTypes, XtoAorB_node_x_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding XtoAorB__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_toAorB.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("XtoAorB_node_x"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "XtoAorB_node_x" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { XtoAorB_node_x }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			pat_XtoAorB = new GRGEN_LGSP.PatternGraph(
				"XtoAorB",
				"",
				null, "XtoAorB",
				false, false,
				new GRGEN_LGSP.PatternNode[] { XtoAorB_node_x }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { XtoAorB__sub0 }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				XtoAorB_isNodeHomomorphicGlobal,
				XtoAorB_isEdgeHomomorphicGlobal,
				XtoAorB_isNodeTotallyHomomorphic,
				XtoAorB_isEdgeTotallyHomomorphic
			);

			XtoAorB_node_x.pointOfDefinition = pat_XtoAorB;
			XtoAorB__sub0.PointOfDefinition = pat_XtoAorB;

			patternGraph = pat_XtoAorB;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_XtoAorB curMatch = (Match_XtoAorB)_curMatch;
			GRGEN_LGSP.LGSPNode node_x = curMatch._node_x;
			GRGEN_ACTIONS.Pattern_toAorB.Match_toAorB subpattern__sub0 = curMatch.@__sub0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		static Rule_XtoAorB() {
		}

		public interface IMatch_XtoAorB : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_LIBGR.INode node_x { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			@GRGEN_ACTIONS.Pattern_toAorB.Match_toAorB @_sub0 { get; }
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_XtoAorB : GRGEN_LGSP.MatchListElement<Match_XtoAorB>, IMatch_XtoAorB
		{
			public GRGEN_LIBGR.INode node_x { get { return (GRGEN_LIBGR.INode)_node_x; } set { _node_x = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_x;
			public enum XtoAorB_NodeNums { @x, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 1; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)XtoAorB_NodeNums.@x: return _node_x;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "x": return _node_x;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "x": _node_x = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum XtoAorB_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum XtoAorB_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public @GRGEN_ACTIONS.Pattern_toAorB.Match_toAorB @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_toAorB.Match_toAorB @__sub0;
			public enum XtoAorB_SubNums { @_sub0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 1; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				case (int)XtoAorB_SubNums.@_sub0: return __sub0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				case "_sub0": return __sub0;
				default: return null;
				}
			}

			public enum XtoAorB_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum XtoAorB_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum XtoAorB_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_XtoAorB.instance.pat_XtoAorB; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_XtoAorB(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_XtoAorB(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_XtoAorB nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_XtoAorB cur = this;
				while(cur != null) {
					Match_XtoAorB next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_XtoAorB that)
			{
				_node_x = that._node_x;
				@__sub0 = that.@__sub0;
			}

			public Match_XtoAorB(Match_XtoAorB that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_XtoAorB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_x = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_x];
				@__sub0 = new GRGEN_ACTIONS.Pattern_toAorB.Match_toAorB(that.@__sub0, oldToNewMap);
			}

			public Match_XtoAorB(Match_XtoAorB that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_XtoAorB()
			{
			}

			public bool IsEqual(Match_XtoAorB that)
			{
				if(that==null) return false;
				if(_node_x != that._node_x) return false;
				if(!@__sub0.IsEqual(that.@__sub0)) return false;
				return true;
			}
		}


		public class Extractor
		{
			public static List<GRGEN_LIBGR.INode> Extract_x(List<IMatch_XtoAorB> matchList)
			{
				List<GRGEN_LIBGR.INode> resultList = new List<GRGEN_LIBGR.INode>(matchList.Count);
				foreach(IMatch_XtoAorB match in matchList)
					resultList.Add(match.node_x);
				return resultList;
			}
		}


		public static List<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB>)
				return ((List<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB instanceBearingAttributeForSearch_XtoAorB = new GRGEN_ACTIONS.Rule_XtoAorB.Match_XtoAorB();
		public static List<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB> Array_XtoAorB_groupBy_x(List<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_x)) {
					seenValues[list[pos].@node_x].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB> tempList = new List<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_x, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB> newList = new List<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB>();
			foreach(List<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB> Array_XtoAorB_keepOneForEachBy_x(List<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB> list)
		{
			List<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB> newList = new List<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_x)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_x, null);
				}
			}
			return newList;
		}
		public static int Array_XtoAorB_indexOfBy_x(IList<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_x.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_XtoAorB_indexOfBy_x(IList<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_x.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_XtoAorB_lastIndexOfBy_x(IList<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_x.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_XtoAorB_lastIndexOfBy_x(IList<GRGEN_ACTIONS.Rule_XtoAorB.IMatch_XtoAorB> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_x.Equals(entry))
					return i;
			return -1;
		}
	}

	public class Rule_alternative_in_negative : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_alternative_in_negative instance = null;
		public static Rule_alternative_in_negative Instance { get { if(instance==null) { instance = new Rule_alternative_in_negative(); instance.initialize(); } return instance; } }

		public enum alternative_in_negative_NodeNums { };
		public enum alternative_in_negative_EdgeNums { };
		public enum alternative_in_negative_VariableNums { };
		public enum alternative_in_negative_SubNums { };
		public enum alternative_in_negative_AltNums { };
		public enum alternative_in_negative_IterNums { };





		public GRGEN_LGSP.PatternGraph pat_alternative_in_negative;

		public enum alternative_in_negative_neg_0_NodeNums { };
		public enum alternative_in_negative_neg_0_EdgeNums { };
		public enum alternative_in_negative_neg_0_VariableNums { };
		public enum alternative_in_negative_neg_0_SubNums { };
		public enum alternative_in_negative_neg_0_AltNums { @alt_0, };
		public enum alternative_in_negative_neg_0_IterNums { };


		public GRGEN_LGSP.PatternGraph alternative_in_negative_neg_0;

		public enum alternative_in_negative_neg_0_alt_0_CaseNums { @Foo, @Bar, };
		public static GRGEN_LIBGR.NodeType[] alternative_in_negative_neg_0_alt_0_Foo_node__node0_AllowedTypes = null;
		public static bool[] alternative_in_negative_neg_0_alt_0_Foo_node__node0_IsAllowedType = null;
		public enum alternative_in_negative_neg_0_alt_0_Foo_NodeNums { @_node0, };
		public enum alternative_in_negative_neg_0_alt_0_Foo_EdgeNums { };
		public enum alternative_in_negative_neg_0_alt_0_Foo_VariableNums { };
		public enum alternative_in_negative_neg_0_alt_0_Foo_SubNums { };
		public enum alternative_in_negative_neg_0_alt_0_Foo_AltNums { };
		public enum alternative_in_negative_neg_0_alt_0_Foo_IterNums { };



		public GRGEN_LGSP.PatternGraph alternative_in_negative_neg_0_alt_0_Foo;

		public static GRGEN_LIBGR.NodeType[] alternative_in_negative_neg_0_alt_0_Bar_node__node0_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] alternative_in_negative_neg_0_alt_0_Bar_node__node1_AllowedTypes = null;
		public static bool[] alternative_in_negative_neg_0_alt_0_Bar_node__node0_IsAllowedType = null;
		public static bool[] alternative_in_negative_neg_0_alt_0_Bar_node__node1_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] alternative_in_negative_neg_0_alt_0_Bar_edge__edge0_AllowedTypes = null;
		public static bool[] alternative_in_negative_neg_0_alt_0_Bar_edge__edge0_IsAllowedType = null;
		public enum alternative_in_negative_neg_0_alt_0_Bar_NodeNums { @_node0, @_node1, };
		public enum alternative_in_negative_neg_0_alt_0_Bar_EdgeNums { @_edge0, };
		public enum alternative_in_negative_neg_0_alt_0_Bar_VariableNums { };
		public enum alternative_in_negative_neg_0_alt_0_Bar_SubNums { };
		public enum alternative_in_negative_neg_0_alt_0_Bar_AltNums { };
		public enum alternative_in_negative_neg_0_alt_0_Bar_IterNums { };



		public GRGEN_LGSP.PatternGraph alternative_in_negative_neg_0_alt_0_Bar;


		private Rule_alternative_in_negative()
			: base("alternative_in_negative",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_alternative_in_negative+IMatch_alternative_in_negative",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_alternative_in_negative+Match_alternative_in_negative"
			)
		{
		}
		private void initialize()
		{
			bool[,] alternative_in_negative_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] alternative_in_negative_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] alternative_in_negative_isNodeTotallyHomomorphic = new bool[0];
			bool[] alternative_in_negative_isEdgeTotallyHomomorphic = new bool[0];
			bool[,] alternative_in_negative_neg_0_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] alternative_in_negative_neg_0_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] alternative_in_negative_neg_0_isNodeTotallyHomomorphic = new bool[0];
			bool[] alternative_in_negative_neg_0_isEdgeTotallyHomomorphic = new bool[0];
			bool[,] alternative_in_negative_neg_0_alt_0_Foo_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] alternative_in_negative_neg_0_alt_0_Foo_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] alternative_in_negative_neg_0_alt_0_Foo_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] alternative_in_negative_neg_0_alt_0_Foo_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode alternative_in_negative_neg_0_alt_0_Foo_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "alternative_in_negative_neg_0_alt_0_Foo_node__node0", "_node0", alternative_in_negative_neg_0_alt_0_Foo_node__node0_AllowedTypes, alternative_in_negative_neg_0_alt_0_Foo_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			alternative_in_negative_neg_0_alt_0_Foo = new GRGEN_LGSP.PatternGraph(
				"Foo",
				"alternative_in_negative_neg_0_alt_0_",
				null, "Foo",
				false, false,
				new GRGEN_LGSP.PatternNode[] { alternative_in_negative_neg_0_alt_0_Foo_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				alternative_in_negative_neg_0_alt_0_Foo_isNodeHomomorphicGlobal,
				alternative_in_negative_neg_0_alt_0_Foo_isEdgeHomomorphicGlobal,
				alternative_in_negative_neg_0_alt_0_Foo_isNodeTotallyHomomorphic,
				alternative_in_negative_neg_0_alt_0_Foo_isEdgeTotallyHomomorphic
			);

			bool[,] alternative_in_negative_neg_0_alt_0_Bar_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] alternative_in_negative_neg_0_alt_0_Bar_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] alternative_in_negative_neg_0_alt_0_Bar_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] alternative_in_negative_neg_0_alt_0_Bar_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode alternative_in_negative_neg_0_alt_0_Bar_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "alternative_in_negative_neg_0_alt_0_Bar_node__node0", "_node0", alternative_in_negative_neg_0_alt_0_Bar_node__node0_AllowedTypes, alternative_in_negative_neg_0_alt_0_Bar_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode alternative_in_negative_neg_0_alt_0_Bar_node__node1 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "alternative_in_negative_neg_0_alt_0_Bar_node__node1", "_node1", alternative_in_negative_neg_0_alt_0_Bar_node__node1_AllowedTypes, alternative_in_negative_neg_0_alt_0_Bar_node__node1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge alternative_in_negative_neg_0_alt_0_Bar_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "alternative_in_negative_neg_0_alt_0_Bar_edge__edge0", "_edge0", alternative_in_negative_neg_0_alt_0_Bar_edge__edge0_AllowedTypes, alternative_in_negative_neg_0_alt_0_Bar_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			alternative_in_negative_neg_0_alt_0_Bar = new GRGEN_LGSP.PatternGraph(
				"Bar",
				"alternative_in_negative_neg_0_alt_0_",
				null, "Bar",
				false, false,
				new GRGEN_LGSP.PatternNode[] { alternative_in_negative_neg_0_alt_0_Bar_node__node0, alternative_in_negative_neg_0_alt_0_Bar_node__node1 }, 
				new GRGEN_LGSP.PatternEdge[] { alternative_in_negative_neg_0_alt_0_Bar_edge__edge0 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				new bool[1, 1] {
					{ true, },
				},
				alternative_in_negative_neg_0_alt_0_Bar_isNodeHomomorphicGlobal,
				alternative_in_negative_neg_0_alt_0_Bar_isEdgeHomomorphicGlobal,
				alternative_in_negative_neg_0_alt_0_Bar_isNodeTotallyHomomorphic,
				alternative_in_negative_neg_0_alt_0_Bar_isEdgeTotallyHomomorphic
			);
			alternative_in_negative_neg_0_alt_0_Bar.edgeToSourceNode.Add(alternative_in_negative_neg_0_alt_0_Bar_edge__edge0, alternative_in_negative_neg_0_alt_0_Bar_node__node0);
			alternative_in_negative_neg_0_alt_0_Bar.edgeToTargetNode.Add(alternative_in_negative_neg_0_alt_0_Bar_edge__edge0, alternative_in_negative_neg_0_alt_0_Bar_node__node1);

			GRGEN_LGSP.Alternative alternative_in_negative_neg_0_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "alternative_in_negative_neg_0_", new GRGEN_LGSP.PatternGraph[] { alternative_in_negative_neg_0_alt_0_Foo, alternative_in_negative_neg_0_alt_0_Bar } );

			alternative_in_negative_neg_0 = new GRGEN_LGSP.PatternGraph(
				"neg_0",
				"alternative_in_negative_",
				null, "neg_0",
				false, false,
				new GRGEN_LGSP.PatternNode[] {  }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { alternative_in_negative_neg_0_alt_0,  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[0, 0] ,
				new bool[0, 0] ,
				alternative_in_negative_neg_0_isNodeHomomorphicGlobal,
				alternative_in_negative_neg_0_isEdgeHomomorphicGlobal,
				alternative_in_negative_neg_0_isNodeTotallyHomomorphic,
				alternative_in_negative_neg_0_isEdgeTotallyHomomorphic
			);
			alternative_in_negative_neg_0_alt_0_Foo.embeddingGraph = alternative_in_negative_neg_0;
			alternative_in_negative_neg_0_alt_0_Bar.embeddingGraph = alternative_in_negative_neg_0;

			pat_alternative_in_negative = new GRGEN_LGSP.PatternGraph(
				"alternative_in_negative",
				"",
				null, "alternative_in_negative",
				false, false,
				new GRGEN_LGSP.PatternNode[] {  }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] { alternative_in_negative_neg_0,  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[0, 0] ,
				new bool[0, 0] ,
				alternative_in_negative_isNodeHomomorphicGlobal,
				alternative_in_negative_isEdgeHomomorphicGlobal,
				alternative_in_negative_isNodeTotallyHomomorphic,
				alternative_in_negative_isEdgeTotallyHomomorphic
			);
			alternative_in_negative_neg_0.embeddingGraph = pat_alternative_in_negative;

			alternative_in_negative_neg_0_alt_0_Foo_node__node0.pointOfDefinition = alternative_in_negative_neg_0_alt_0_Foo;
			alternative_in_negative_neg_0_alt_0_Bar_node__node0.pointOfDefinition = alternative_in_negative_neg_0_alt_0_Bar;
			alternative_in_negative_neg_0_alt_0_Bar_node__node1.pointOfDefinition = alternative_in_negative_neg_0_alt_0_Bar;
			alternative_in_negative_neg_0_alt_0_Bar_edge__edge0.pointOfDefinition = alternative_in_negative_neg_0_alt_0_Bar;

			patternGraph = pat_alternative_in_negative;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_alternative_in_negative curMatch = (Match_alternative_in_negative)_curMatch;
			graph.SettingAddedNodeNames( alternative_in_negative_addedNodeNames );
			graph.SettingAddedEdgeNames( alternative_in_negative_addedEdgeNames );
			actionEnv.SelectedMatchRewritten();
			return;
		}
		private static string[] alternative_in_negative_addedNodeNames = new string[] {  };
		private static string[] alternative_in_negative_addedEdgeNames = new string[] {  };

		static Rule_alternative_in_negative() {
		}

		public interface IMatch_alternative_in_negative : GRGEN_LIBGR.IMatch
		{
			//Nodes
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_alternative_in_negative_neg_0 : GRGEN_LIBGR.IMatch
		{
			//Nodes
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			IMatch_alternative_in_negative_neg_0_alt_0 alt_0 { get; }
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_alternative_in_negative_neg_0_alt_0 : GRGEN_LIBGR.IMatch
		{
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_alternative_in_negative_neg_0_alt_0_Foo : IMatch_alternative_in_negative_neg_0_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node__node0 { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_alternative_in_negative_neg_0_alt_0_Bar : IMatch_alternative_in_negative_neg_0_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node__node0 { get; set; }
			GRGEN_LIBGR.INode node__node1 { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_alternative_in_negative : GRGEN_LGSP.MatchListElement<Match_alternative_in_negative>, IMatch_alternative_in_negative
		{
			public enum alternative_in_negative_NodeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 0; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_negative_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_negative_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_negative_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_negative_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_negative_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_negative_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_alternative_in_negative.instance.pat_alternative_in_negative; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_alternative_in_negative(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_alternative_in_negative(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_alternative_in_negative nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_alternative_in_negative cur = this;
				while(cur != null) {
					Match_alternative_in_negative next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_alternative_in_negative that)
			{
			}

			public Match_alternative_in_negative(Match_alternative_in_negative that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_alternative_in_negative that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
			}

			public Match_alternative_in_negative(Match_alternative_in_negative that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_alternative_in_negative()
			{
			}

			public bool IsEqual(Match_alternative_in_negative that)
			{
				if(that==null) return false;
				return true;
			}
		}

		public class Match_alternative_in_negative_neg_0 : GRGEN_LGSP.MatchListElement<Match_alternative_in_negative_neg_0>, IMatch_alternative_in_negative_neg_0
		{
			public enum alternative_in_negative_neg_0_NodeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 0; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_negative_neg_0_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_negative_neg_0_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_negative_neg_0_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public IMatch_alternative_in_negative_neg_0_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_alternative_in_negative_neg_0_alt_0 _alt_0;
			public enum alternative_in_negative_neg_0_AltNums { @alt_0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 1; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				case (int)alternative_in_negative_neg_0_AltNums.@alt_0: return _alt_0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				case "alt_0": return _alt_0;
				default: return null;
				}
			}

			public enum alternative_in_negative_neg_0_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_negative_neg_0_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_alternative_in_negative.instance.alternative_in_negative_neg_0; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_alternative_in_negative_neg_0(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_alternative_in_negative_neg_0(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_alternative_in_negative_neg_0 nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_alternative_in_negative_neg_0 cur = this;
				while(cur != null) {
					Match_alternative_in_negative_neg_0 next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_alternative_in_negative_neg_0 that)
			{
				_alt_0 = that._alt_0;
			}

			public Match_alternative_in_negative_neg_0(Match_alternative_in_negative_neg_0 that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_alternative_in_negative_neg_0 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				if(that._alt_0 is Match_alternative_in_negative_neg_0_alt_0_Foo)
					_alt_0 = new Match_alternative_in_negative_neg_0_alt_0_Foo((Match_alternative_in_negative_neg_0_alt_0_Foo)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_alternative_in_negative_neg_0_alt_0_Bar)
					_alt_0 = new Match_alternative_in_negative_neg_0_alt_0_Bar((Match_alternative_in_negative_neg_0_alt_0_Bar)that._alt_0, oldToNewMap);
			}

			public Match_alternative_in_negative_neg_0(Match_alternative_in_negative_neg_0 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_alternative_in_negative_neg_0()
			{
			}

			public bool IsEqual(Match_alternative_in_negative_neg_0 that)
			{
				if(that==null) return false;
				if(_alt_0 is Match_alternative_in_negative_neg_0_alt_0_Foo && !(_alt_0 as Match_alternative_in_negative_neg_0_alt_0_Foo).IsEqual(that._alt_0 as Match_alternative_in_negative_neg_0_alt_0_Foo)) return false;
				if(_alt_0 is Match_alternative_in_negative_neg_0_alt_0_Bar && !(_alt_0 as Match_alternative_in_negative_neg_0_alt_0_Bar).IsEqual(that._alt_0 as Match_alternative_in_negative_neg_0_alt_0_Bar)) return false;
				return true;
			}
		}

		public class Match_alternative_in_negative_neg_0_alt_0_Foo : GRGEN_LGSP.MatchListElement<Match_alternative_in_negative_neg_0_alt_0_Foo>, IMatch_alternative_in_negative_neg_0_alt_0_Foo
		{
			public GRGEN_LIBGR.INode node__node0 { get { return (GRGEN_LIBGR.INode)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum alternative_in_negative_neg_0_alt_0_Foo_NodeNums { @_node0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 1; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)alternative_in_negative_neg_0_alt_0_Foo_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum alternative_in_negative_neg_0_alt_0_Foo_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_negative_neg_0_alt_0_Foo_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_negative_neg_0_alt_0_Foo_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_negative_neg_0_alt_0_Foo_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_negative_neg_0_alt_0_Foo_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_negative_neg_0_alt_0_Foo_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_alternative_in_negative.instance.alternative_in_negative_neg_0_alt_0_Foo; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_alternative_in_negative_neg_0_alt_0_Foo(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_alternative_in_negative_neg_0_alt_0_Foo(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_alternative_in_negative_neg_0_alt_0_Foo nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_alternative_in_negative_neg_0_alt_0_Foo cur = this;
				while(cur != null) {
					Match_alternative_in_negative_neg_0_alt_0_Foo next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_alternative_in_negative_neg_0_alt_0_Foo that)
			{
				_node__node0 = that._node__node0;
			}

			public Match_alternative_in_negative_neg_0_alt_0_Foo(Match_alternative_in_negative_neg_0_alt_0_Foo that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_alternative_in_negative_neg_0_alt_0_Foo that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
			}

			public Match_alternative_in_negative_neg_0_alt_0_Foo(Match_alternative_in_negative_neg_0_alt_0_Foo that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_alternative_in_negative_neg_0_alt_0_Foo()
			{
			}

			public bool IsEqual(Match_alternative_in_negative_neg_0_alt_0_Foo that)
			{
				if(that==null) return false;
				if(_node__node0 != that._node__node0) return false;
				return true;
			}
		}

		public class Match_alternative_in_negative_neg_0_alt_0_Bar : GRGEN_LGSP.MatchListElement<Match_alternative_in_negative_neg_0_alt_0_Bar>, IMatch_alternative_in_negative_neg_0_alt_0_Bar
		{
			public GRGEN_LIBGR.INode node__node0 { get { return (GRGEN_LIBGR.INode)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node__node1 { get { return (GRGEN_LIBGR.INode)_node__node1; } set { _node__node1 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node__node0;
			public GRGEN_LGSP.LGSPNode _node__node1;
			public enum alternative_in_negative_neg_0_alt_0_Bar_NodeNums { @_node0, @_node1, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 2; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)alternative_in_negative_neg_0_alt_0_Bar_NodeNums.@_node0: return _node__node0;
				case (int)alternative_in_negative_neg_0_alt_0_Bar_NodeNums.@_node1: return _node__node1;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "_node0": return _node__node0;
				case "_node1": return _node__node1;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node1": _node__node1 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge__edge0 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public enum alternative_in_negative_neg_0_alt_0_Bar_EdgeNums { @_edge0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 1; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)alternative_in_negative_neg_0_alt_0_Bar_EdgeNums.@_edge0: return _edge__edge0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "_edge0": return _edge__edge0;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "_edge0": _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum alternative_in_negative_neg_0_alt_0_Bar_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_negative_neg_0_alt_0_Bar_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_negative_neg_0_alt_0_Bar_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_negative_neg_0_alt_0_Bar_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_negative_neg_0_alt_0_Bar_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_alternative_in_negative.instance.alternative_in_negative_neg_0_alt_0_Bar; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_alternative_in_negative_neg_0_alt_0_Bar(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_alternative_in_negative_neg_0_alt_0_Bar(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_alternative_in_negative_neg_0_alt_0_Bar nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_alternative_in_negative_neg_0_alt_0_Bar cur = this;
				while(cur != null) {
					Match_alternative_in_negative_neg_0_alt_0_Bar next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_alternative_in_negative_neg_0_alt_0_Bar that)
			{
				_node__node0 = that._node__node0;
				_node__node1 = that._node__node1;
				_edge__edge0 = that._edge__edge0;
			}

			public Match_alternative_in_negative_neg_0_alt_0_Bar(Match_alternative_in_negative_neg_0_alt_0_Bar that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_alternative_in_negative_neg_0_alt_0_Bar that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
				_node__node1 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node1];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
			}

			public Match_alternative_in_negative_neg_0_alt_0_Bar(Match_alternative_in_negative_neg_0_alt_0_Bar that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_alternative_in_negative_neg_0_alt_0_Bar()
			{
			}

			public bool IsEqual(Match_alternative_in_negative_neg_0_alt_0_Bar that)
			{
				if(that==null) return false;
				if(_node__node0 != that._node__node0) return false;
				if(_node__node1 != that._node__node1) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				return true;
			}
		}


		public class Extractor
		{
		}


		public static List<GRGEN_ACTIONS.Rule_alternative_in_negative.IMatch_alternative_in_negative> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_alternative_in_negative.IMatch_alternative_in_negative>)
				return ((List<GRGEN_ACTIONS.Rule_alternative_in_negative.IMatch_alternative_in_negative>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_alternative_in_negative.IMatch_alternative_in_negative>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_alternative_in_negative.IMatch_alternative_in_negative instanceBearingAttributeForSearch_alternative_in_negative = new GRGEN_ACTIONS.Rule_alternative_in_negative.Match_alternative_in_negative();
	}

	public class Rule_alternative_in_iterated : GRGEN_LGSP.LGSPRulePattern
	{
		private static Rule_alternative_in_iterated instance = null;
		public static Rule_alternative_in_iterated Instance { get { if(instance==null) { instance = new Rule_alternative_in_iterated(); instance.initialize(); } return instance; } }

		public enum alternative_in_iterated_NodeNums { };
		public enum alternative_in_iterated_EdgeNums { };
		public enum alternative_in_iterated_VariableNums { };
		public enum alternative_in_iterated_SubNums { };
		public enum alternative_in_iterated_AltNums { };
		public enum alternative_in_iterated_IterNums { @iter_0, };





		public GRGEN_LGSP.PatternGraph pat_alternative_in_iterated;

		public static GRGEN_LIBGR.NodeType[] alternative_in_iterated_iter_0_node__node0_AllowedTypes = null;
		public static bool[] alternative_in_iterated_iter_0_node__node0_IsAllowedType = null;
		public enum alternative_in_iterated_iter_0_NodeNums { @_node0, };
		public enum alternative_in_iterated_iter_0_EdgeNums { };
		public enum alternative_in_iterated_iter_0_VariableNums { };
		public enum alternative_in_iterated_iter_0_SubNums { };
		public enum alternative_in_iterated_iter_0_AltNums { @alt_0, };
		public enum alternative_in_iterated_iter_0_IterNums { };





		public GRGEN_LGSP.PatternGraph alternative_in_iterated_iter_0;

		public enum alternative_in_iterated_iter_0_alt_0_CaseNums { @Foo, @Bar, };
		public static GRGEN_LIBGR.NodeType[] alternative_in_iterated_iter_0_alt_0_Foo_node__node0_AllowedTypes = null;
		public static bool[] alternative_in_iterated_iter_0_alt_0_Foo_node__node0_IsAllowedType = null;
		public enum alternative_in_iterated_iter_0_alt_0_Foo_NodeNums { @_node0, };
		public enum alternative_in_iterated_iter_0_alt_0_Foo_EdgeNums { };
		public enum alternative_in_iterated_iter_0_alt_0_Foo_VariableNums { };
		public enum alternative_in_iterated_iter_0_alt_0_Foo_SubNums { };
		public enum alternative_in_iterated_iter_0_alt_0_Foo_AltNums { };
		public enum alternative_in_iterated_iter_0_alt_0_Foo_IterNums { };





		public GRGEN_LGSP.PatternGraph alternative_in_iterated_iter_0_alt_0_Foo;

		public static GRGEN_LIBGR.NodeType[] alternative_in_iterated_iter_0_alt_0_Bar_node__node0_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] alternative_in_iterated_iter_0_alt_0_Bar_node__node1_AllowedTypes = null;
		public static bool[] alternative_in_iterated_iter_0_alt_0_Bar_node__node0_IsAllowedType = null;
		public static bool[] alternative_in_iterated_iter_0_alt_0_Bar_node__node1_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0_AllowedTypes = null;
		public static bool[] alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0_IsAllowedType = null;
		public enum alternative_in_iterated_iter_0_alt_0_Bar_NodeNums { @_node0, @_node1, };
		public enum alternative_in_iterated_iter_0_alt_0_Bar_EdgeNums { @_edge0, };
		public enum alternative_in_iterated_iter_0_alt_0_Bar_VariableNums { };
		public enum alternative_in_iterated_iter_0_alt_0_Bar_SubNums { };
		public enum alternative_in_iterated_iter_0_alt_0_Bar_AltNums { };
		public enum alternative_in_iterated_iter_0_alt_0_Bar_IterNums { };





		public GRGEN_LGSP.PatternGraph alternative_in_iterated_iter_0_alt_0_Bar;


		private Rule_alternative_in_iterated()
			: base("alternative_in_iterated",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new GRGEN_LGSP.LGSPFilter[] {
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
					new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				},
				new GRGEN_LIBGR.MatchClassInfo[] { },
				"de.unika.ipd.grGen.Action_Alternatives.Rule_alternative_in_iterated+IMatch_alternative_in_iterated",
				"de.unika.ipd.grGen.Action_Alternatives.Rule_alternative_in_iterated+Match_alternative_in_iterated"
			)
		{
		}
		private void initialize()
		{
			bool[,] alternative_in_iterated_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] alternative_in_iterated_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] alternative_in_iterated_isNodeTotallyHomomorphic = new bool[0];
			bool[] alternative_in_iterated_isEdgeTotallyHomomorphic = new bool[0];
			bool[,] alternative_in_iterated_iter_0_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] alternative_in_iterated_iter_0_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] alternative_in_iterated_iter_0_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] alternative_in_iterated_iter_0_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode alternative_in_iterated_iter_0_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "alternative_in_iterated_iter_0_node__node0", "_node0", alternative_in_iterated_iter_0_node__node0_AllowedTypes, alternative_in_iterated_iter_0_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			bool[,] alternative_in_iterated_iter_0_alt_0_Foo_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] alternative_in_iterated_iter_0_alt_0_Foo_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] alternative_in_iterated_iter_0_alt_0_Foo_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] alternative_in_iterated_iter_0_alt_0_Foo_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode alternative_in_iterated_iter_0_alt_0_Foo_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "alternative_in_iterated_iter_0_alt_0_Foo_node__node0", "_node0", alternative_in_iterated_iter_0_alt_0_Foo_node__node0_AllowedTypes, alternative_in_iterated_iter_0_alt_0_Foo_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			alternative_in_iterated_iter_0_alt_0_Foo = new GRGEN_LGSP.PatternGraph(
				"Foo",
				"alternative_in_iterated_iter_0_alt_0_",
				null, "Foo",
				false, false,
				new GRGEN_LGSP.PatternNode[] { alternative_in_iterated_iter_0_alt_0_Foo_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				alternative_in_iterated_iter_0_alt_0_Foo_isNodeHomomorphicGlobal,
				alternative_in_iterated_iter_0_alt_0_Foo_isEdgeHomomorphicGlobal,
				alternative_in_iterated_iter_0_alt_0_Foo_isNodeTotallyHomomorphic,
				alternative_in_iterated_iter_0_alt_0_Foo_isEdgeTotallyHomomorphic
			);

			bool[,] alternative_in_iterated_iter_0_alt_0_Bar_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] alternative_in_iterated_iter_0_alt_0_Bar_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] alternative_in_iterated_iter_0_alt_0_Bar_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] alternative_in_iterated_iter_0_alt_0_Bar_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode alternative_in_iterated_iter_0_alt_0_Bar_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "alternative_in_iterated_iter_0_alt_0_Bar_node__node0", "_node0", alternative_in_iterated_iter_0_alt_0_Bar_node__node0_AllowedTypes, alternative_in_iterated_iter_0_alt_0_Bar_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode alternative_in_iterated_iter_0_alt_0_Bar_node__node1 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "alternative_in_iterated_iter_0_alt_0_Bar_node__node1", "_node1", alternative_in_iterated_iter_0_alt_0_Bar_node__node1_AllowedTypes, alternative_in_iterated_iter_0_alt_0_Bar_node__node1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0", "_edge0", alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0_AllowedTypes, alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			alternative_in_iterated_iter_0_alt_0_Bar = new GRGEN_LGSP.PatternGraph(
				"Bar",
				"alternative_in_iterated_iter_0_alt_0_",
				null, "Bar",
				false, false,
				new GRGEN_LGSP.PatternNode[] { alternative_in_iterated_iter_0_alt_0_Bar_node__node0, alternative_in_iterated_iter_0_alt_0_Bar_node__node1 }, 
				new GRGEN_LGSP.PatternEdge[] { alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				new bool[1, 1] {
					{ true, },
				},
				alternative_in_iterated_iter_0_alt_0_Bar_isNodeHomomorphicGlobal,
				alternative_in_iterated_iter_0_alt_0_Bar_isEdgeHomomorphicGlobal,
				alternative_in_iterated_iter_0_alt_0_Bar_isNodeTotallyHomomorphic,
				alternative_in_iterated_iter_0_alt_0_Bar_isEdgeTotallyHomomorphic
			);
			alternative_in_iterated_iter_0_alt_0_Bar.edgeToSourceNode.Add(alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0, alternative_in_iterated_iter_0_alt_0_Bar_node__node0);
			alternative_in_iterated_iter_0_alt_0_Bar.edgeToTargetNode.Add(alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0, alternative_in_iterated_iter_0_alt_0_Bar_node__node1);

			GRGEN_LGSP.Alternative alternative_in_iterated_iter_0_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "alternative_in_iterated_iter_0_", new GRGEN_LGSP.PatternGraph[] { alternative_in_iterated_iter_0_alt_0_Foo, alternative_in_iterated_iter_0_alt_0_Bar } );

			alternative_in_iterated_iter_0 = new GRGEN_LGSP.PatternGraph(
				"iter_0",
				"alternative_in_iterated_",
				null, "iter_0",
				false, false,
				new GRGEN_LGSP.PatternNode[] { alternative_in_iterated_iter_0_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { alternative_in_iterated_iter_0_alt_0,  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				alternative_in_iterated_iter_0_isNodeHomomorphicGlobal,
				alternative_in_iterated_iter_0_isEdgeHomomorphicGlobal,
				alternative_in_iterated_iter_0_isNodeTotallyHomomorphic,
				alternative_in_iterated_iter_0_isEdgeTotallyHomomorphic
			);
			alternative_in_iterated_iter_0_alt_0_Foo.embeddingGraph = alternative_in_iterated_iter_0;
			alternative_in_iterated_iter_0_alt_0_Bar.embeddingGraph = alternative_in_iterated_iter_0;

			GRGEN_LGSP.Iterated alternative_in_iterated_iter_0_it = new GRGEN_LGSP.Iterated( alternative_in_iterated_iter_0, 0, 0, new GRGEN_LGSP.LGSPFilter[] {
				new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirst", null, "keepFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
				new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLast", null, "keepLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
				new GRGEN_LGSP.LGSPFilterAutoSupplied("keepFirstFraction", null, "keepFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				new GRGEN_LGSP.LGSPFilterAutoSupplied("keepLastFraction", null, "keepLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirst", null, "removeFirst", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
				new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLast", null, "removeLast", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(int)), }, new String[] {"param"}),
				new GRGEN_LGSP.LGSPFilterAutoSupplied("removeFirstFraction", null, "removeFirstFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
				new GRGEN_LGSP.LGSPFilterAutoSupplied("removeLastFraction", null, "removeLastFraction", null, new GRGEN_LIBGR.GrGenType[] {GRGEN_LIBGR.VarType.GetVarType(typeof(double)), }, new String[] {"param"}),
			}
			);
			pat_alternative_in_iterated = new GRGEN_LGSP.PatternGraph(
				"alternative_in_iterated",
				"",
				null, "alternative_in_iterated",
				false, false,
				new GRGEN_LGSP.PatternNode[] {  }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] { alternative_in_iterated_iter_0_it,  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[0, 0] ,
				new bool[0, 0] ,
				alternative_in_iterated_isNodeHomomorphicGlobal,
				alternative_in_iterated_isEdgeHomomorphicGlobal,
				alternative_in_iterated_isNodeTotallyHomomorphic,
				alternative_in_iterated_isEdgeTotallyHomomorphic
			);
			alternative_in_iterated_iter_0.embeddingGraph = pat_alternative_in_iterated;

			alternative_in_iterated_iter_0_node__node0.pointOfDefinition = alternative_in_iterated_iter_0;
			alternative_in_iterated_iter_0_alt_0_Foo_node__node0.pointOfDefinition = alternative_in_iterated_iter_0_alt_0_Foo;
			alternative_in_iterated_iter_0_alt_0_Bar_node__node0.pointOfDefinition = alternative_in_iterated_iter_0_alt_0_Bar;
			alternative_in_iterated_iter_0_alt_0_Bar_node__node1.pointOfDefinition = alternative_in_iterated_iter_0_alt_0_Bar;
			alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0.pointOfDefinition = alternative_in_iterated_iter_0_alt_0_Bar;

			patternGraph = pat_alternative_in_iterated;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_alternative_in_iterated curMatch = (Match_alternative_in_iterated)_curMatch;
			GRGEN_LGSP.LGSPMatchesList<Match_alternative_in_iterated_iter_0, IMatch_alternative_in_iterated_iter_0> iterated_iter_0 = curMatch._iter_0;
			graph.SettingAddedNodeNames( alternative_in_iterated_addedNodeNames );
			alternative_in_iterated_iter_0_Modify(actionEnv, iterated_iter_0);
			graph.SettingAddedEdgeNames( alternative_in_iterated_addedEdgeNames );
			actionEnv.SelectedMatchRewritten();
			return;
		}
		private static string[] alternative_in_iterated_addedNodeNames = new string[] {  };
		private static string[] alternative_in_iterated_addedEdgeNames = new string[] {  };

		public void alternative_in_iterated_iter_0_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LGSP.LGSPMatchesList<Match_alternative_in_iterated_iter_0, IMatch_alternative_in_iterated_iter_0> curMatches)
		{
			for(Match_alternative_in_iterated_iter_0 curMatch=curMatches.Root; curMatch!=null; curMatch=curMatch.next) {
				alternative_in_iterated_iter_0_Modify(actionEnv, curMatch);
			}
		}

		public void alternative_in_iterated_iter_0_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_alternative_in_iterated_iter_0 curMatch = (Match_alternative_in_iterated_iter_0)_curMatch;
			IMatch_alternative_in_iterated_iter_0_alt_0 alternative_alt_0 = curMatch._alt_0;
			graph.SettingAddedNodeNames( alternative_in_iterated_iter_0_addedNodeNames );
			alternative_in_iterated_iter_0_alt_0_Modify(actionEnv, alternative_alt_0);
			graph.SettingAddedEdgeNames( alternative_in_iterated_iter_0_addedEdgeNames );
		}
		private static string[] alternative_in_iterated_iter_0_addedNodeNames = new string[] {  };
		private static string[] alternative_in_iterated_iter_0_addedEdgeNames = new string[] {  };

		public void alternative_in_iterated_iter_0_alt_0_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, IMatch_alternative_in_iterated_iter_0_alt_0 curMatch)
		{
			if(curMatch.Pattern == alternative_in_iterated_iter_0_alt_0_Foo) {
				alternative_in_iterated_iter_0_alt_0_Foo_Modify(actionEnv, (Match_alternative_in_iterated_iter_0_alt_0_Foo)curMatch);
				return;
			}
			else if(curMatch.Pattern == alternative_in_iterated_iter_0_alt_0_Bar) {
				alternative_in_iterated_iter_0_alt_0_Bar_Modify(actionEnv, (Match_alternative_in_iterated_iter_0_alt_0_Bar)curMatch);
				return;
			}
			throw new ApplicationException(); //debug assert
		}

		public void alternative_in_iterated_iter_0_alt_0_Foo_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_alternative_in_iterated_iter_0_alt_0_Foo curMatch = (Match_alternative_in_iterated_iter_0_alt_0_Foo)_curMatch;
			graph.SettingAddedNodeNames( alternative_in_iterated_iter_0_alt_0_Foo_addedNodeNames );
			graph.SettingAddedEdgeNames( alternative_in_iterated_iter_0_alt_0_Foo_addedEdgeNames );
		}
		private static string[] alternative_in_iterated_iter_0_alt_0_Foo_addedNodeNames = new string[] {  };
		private static string[] alternative_in_iterated_iter_0_alt_0_Foo_addedEdgeNames = new string[] {  };

		public void alternative_in_iterated_iter_0_alt_0_Bar_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_alternative_in_iterated_iter_0_alt_0_Bar curMatch = (Match_alternative_in_iterated_iter_0_alt_0_Bar)_curMatch;
			graph.SettingAddedNodeNames( alternative_in_iterated_iter_0_alt_0_Bar_addedNodeNames );
			graph.SettingAddedEdgeNames( alternative_in_iterated_iter_0_alt_0_Bar_addedEdgeNames );
		}
		private static string[] alternative_in_iterated_iter_0_alt_0_Bar_addedNodeNames = new string[] {  };
		private static string[] alternative_in_iterated_iter_0_alt_0_Bar_addedEdgeNames = new string[] {  };

		static Rule_alternative_in_iterated() {
		}

		public interface IMatch_alternative_in_iterated : GRGEN_LIBGR.IMatch
		{
			//Nodes
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			GRGEN_LIBGR.IMatchesExact<IMatch_alternative_in_iterated_iter_0> iter_0 { get; }
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_alternative_in_iterated_iter_0 : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_LIBGR.INode node__node0 { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			IMatch_alternative_in_iterated_iter_0_alt_0 alt_0 { get; }
			//Iterateds
			//Independents
			// further match object stuff
			bool IsNullMatch { get; }
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_alternative_in_iterated_iter_0_alt_0 : GRGEN_LIBGR.IMatch
		{
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_alternative_in_iterated_iter_0_alt_0_Foo : IMatch_alternative_in_iterated_iter_0_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node__node0 { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public interface IMatch_alternative_in_iterated_iter_0_alt_0_Bar : IMatch_alternative_in_iterated_iter_0_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node__node0 { get; set; }
			GRGEN_LIBGR.INode node__node1 { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			//Variables
			//EmbeddedGraphs
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_alternative_in_iterated : GRGEN_LGSP.MatchListElement<Match_alternative_in_iterated>, IMatch_alternative_in_iterated
		{
			public enum alternative_in_iterated_NodeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 0; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_iterated_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_iterated_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_iterated_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_iterated_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public GRGEN_LIBGR.IMatchesExact<IMatch_alternative_in_iterated_iter_0> iter_0 { get { return _iter_0; } }
			public GRGEN_LGSP.LGSPMatchesList<Match_alternative_in_iterated_iter_0, IMatch_alternative_in_iterated_iter_0> _iter_0;
			public enum alternative_in_iterated_IterNums { @iter_0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 1; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				case (int)alternative_in_iterated_IterNums.@iter_0: return _iter_0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				case "iter_0": return _iter_0;
				default: return null;
				}
			}

			public enum alternative_in_iterated_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_alternative_in_iterated.instance.pat_alternative_in_iterated; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_alternative_in_iterated(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_alternative_in_iterated(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_alternative_in_iterated nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_alternative_in_iterated cur = this;
				while(cur != null) {
					Match_alternative_in_iterated next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_alternative_in_iterated that)
			{
				_iter_0 = that._iter_0;
			}

			public Match_alternative_in_iterated(Match_alternative_in_iterated that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_alternative_in_iterated that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_iter_0 = new GRGEN_LGSP.LGSPMatchesList<Match_alternative_in_iterated_iter_0, IMatch_alternative_in_iterated_iter_0>(that._iter_0, oldToNewMap);
			}

			public Match_alternative_in_iterated(Match_alternative_in_iterated that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_alternative_in_iterated()
			{
			}

			public bool IsEqual(Match_alternative_in_iterated that)
			{
				if(that==null) return false;
				if(_iter_0.Count != that._iter_0.Count) return false;
				IEnumerator<GRGEN_LIBGR.IMatch> _iter_0_thisEnumerator = _iter_0.GetEnumerator();
				IEnumerator<GRGEN_LIBGR.IMatch> _iter_0_thatEnumerator = that._iter_0.GetEnumerator();
				while(_iter_0_thisEnumerator.MoveNext())
				{
					_iter_0_thatEnumerator.MoveNext();
					if(!(_iter_0_thisEnumerator.Current as Match_alternative_in_iterated_iter_0).IsEqual(_iter_0_thatEnumerator.Current as Match_alternative_in_iterated_iter_0)) return false;
				}
				return true;
			}
		}

		public class Match_alternative_in_iterated_iter_0 : GRGEN_LGSP.MatchListElement<Match_alternative_in_iterated_iter_0>, IMatch_alternative_in_iterated_iter_0
		{
			public GRGEN_LIBGR.INode node__node0 { get { return (GRGEN_LIBGR.INode)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum alternative_in_iterated_iter_0_NodeNums { @_node0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 1; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)alternative_in_iterated_iter_0_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum alternative_in_iterated_iter_0_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_iterated_iter_0_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_iterated_iter_0_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public IMatch_alternative_in_iterated_iter_0_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_alternative_in_iterated_iter_0_alt_0 _alt_0;
			public enum alternative_in_iterated_iter_0_AltNums { @alt_0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 1; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				case (int)alternative_in_iterated_iter_0_AltNums.@alt_0: return _alt_0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				case "alt_0": return _alt_0;
				default: return null;
				}
			}

			public enum alternative_in_iterated_iter_0_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_iterated_iter_0_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_alternative_in_iterated.instance.alternative_in_iterated_iter_0; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public bool IsNullMatch { get { return _isNullMatch; } }
			public bool _isNullMatch;
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_alternative_in_iterated_iter_0(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_alternative_in_iterated_iter_0(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_alternative_in_iterated_iter_0 nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_alternative_in_iterated_iter_0 cur = this;
				while(cur != null) {
					Match_alternative_in_iterated_iter_0 next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_alternative_in_iterated_iter_0 that)
			{
				_node__node0 = that._node__node0;
				_alt_0 = that._alt_0;
			}

			public Match_alternative_in_iterated_iter_0(Match_alternative_in_iterated_iter_0 that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_alternative_in_iterated_iter_0 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
				if(that._alt_0 is Match_alternative_in_iterated_iter_0_alt_0_Foo)
					_alt_0 = new Match_alternative_in_iterated_iter_0_alt_0_Foo((Match_alternative_in_iterated_iter_0_alt_0_Foo)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_alternative_in_iterated_iter_0_alt_0_Bar)
					_alt_0 = new Match_alternative_in_iterated_iter_0_alt_0_Bar((Match_alternative_in_iterated_iter_0_alt_0_Bar)that._alt_0, oldToNewMap);
			}

			public Match_alternative_in_iterated_iter_0(Match_alternative_in_iterated_iter_0 that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_alternative_in_iterated_iter_0()
			{
			}

			public bool IsEqual(Match_alternative_in_iterated_iter_0 that)
			{
				if(that==null) return false;
				if(_node__node0 != that._node__node0) return false;
				if(_alt_0 is Match_alternative_in_iterated_iter_0_alt_0_Foo && !(_alt_0 as Match_alternative_in_iterated_iter_0_alt_0_Foo).IsEqual(that._alt_0 as Match_alternative_in_iterated_iter_0_alt_0_Foo)) return false;
				if(_alt_0 is Match_alternative_in_iterated_iter_0_alt_0_Bar && !(_alt_0 as Match_alternative_in_iterated_iter_0_alt_0_Bar).IsEqual(that._alt_0 as Match_alternative_in_iterated_iter_0_alt_0_Bar)) return false;
				return true;
			}
		}

		public class Match_alternative_in_iterated_iter_0_alt_0_Foo : GRGEN_LGSP.MatchListElement<Match_alternative_in_iterated_iter_0_alt_0_Foo>, IMatch_alternative_in_iterated_iter_0_alt_0_Foo
		{
			public GRGEN_LIBGR.INode node__node0 { get { return (GRGEN_LIBGR.INode)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum alternative_in_iterated_iter_0_alt_0_Foo_NodeNums { @_node0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 1; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)alternative_in_iterated_iter_0_alt_0_Foo_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum alternative_in_iterated_iter_0_alt_0_Foo_EdgeNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 0; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_iterated_iter_0_alt_0_Foo_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_iterated_iter_0_alt_0_Foo_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_iterated_iter_0_alt_0_Foo_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_iterated_iter_0_alt_0_Foo_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_iterated_iter_0_alt_0_Foo_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_alternative_in_iterated.instance.alternative_in_iterated_iter_0_alt_0_Foo; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_alternative_in_iterated_iter_0_alt_0_Foo(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_alternative_in_iterated_iter_0_alt_0_Foo(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_alternative_in_iterated_iter_0_alt_0_Foo nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_alternative_in_iterated_iter_0_alt_0_Foo cur = this;
				while(cur != null) {
					Match_alternative_in_iterated_iter_0_alt_0_Foo next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_alternative_in_iterated_iter_0_alt_0_Foo that)
			{
				_node__node0 = that._node__node0;
			}

			public Match_alternative_in_iterated_iter_0_alt_0_Foo(Match_alternative_in_iterated_iter_0_alt_0_Foo that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_alternative_in_iterated_iter_0_alt_0_Foo that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
			}

			public Match_alternative_in_iterated_iter_0_alt_0_Foo(Match_alternative_in_iterated_iter_0_alt_0_Foo that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_alternative_in_iterated_iter_0_alt_0_Foo()
			{
			}

			public bool IsEqual(Match_alternative_in_iterated_iter_0_alt_0_Foo that)
			{
				if(that==null) return false;
				if(_node__node0 != that._node__node0) return false;
				return true;
			}
		}

		public class Match_alternative_in_iterated_iter_0_alt_0_Bar : GRGEN_LGSP.MatchListElement<Match_alternative_in_iterated_iter_0_alt_0_Bar>, IMatch_alternative_in_iterated_iter_0_alt_0_Bar
		{
			public GRGEN_LIBGR.INode node__node0 { get { return (GRGEN_LIBGR.INode)_node__node0; } set { _node__node0 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node__node1 { get { return (GRGEN_LIBGR.INode)_node__node1; } set { _node__node1 = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node__node0;
			public GRGEN_LGSP.LGSPNode _node__node1;
			public enum alternative_in_iterated_iter_0_alt_0_Bar_NodeNums { @_node0, @_node1, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.INode> Nodes { get { return new GRGEN_LGSP.Nodes_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.INode> NodesEnumerator { get { return new GRGEN_LGSP.Nodes_Enumerator(this); } }
			public override int NumberOfNodes { get { return 2; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)alternative_in_iterated_iter_0_alt_0_Bar_NodeNums.@_node0: return _node__node0;
				case (int)alternative_in_iterated_iter_0_alt_0_Bar_NodeNums.@_node1: return _node__node1;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "_node0": return _node__node0;
				case "_node1": return _node__node1;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node1": _node__node1 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IDEdge edge__edge0 { get { return (GRGEN_LIBGR.IDEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public enum alternative_in_iterated_iter_0_alt_0_Bar_EdgeNums { @_edge0, END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IEdge> Edges { get { return new GRGEN_LGSP.Edges_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IEdge> EdgesEnumerator { get { return new GRGEN_LGSP.Edges_Enumerator(this); } }
			public override int NumberOfEdges { get { return 1; } }
			public override GRGEN_LIBGR.IEdge getEdgeAt(int index)
			{
				switch(index) {
				case (int)alternative_in_iterated_iter_0_alt_0_Bar_EdgeNums.@_edge0: return _edge__edge0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IEdge getEdge(string name)
			{
				switch(name) {
				case "_edge0": return _edge__edge0;
				default: return null;
				}
			}
			public override void SetEdge(string name, GRGEN_LIBGR.IEdge value)
			{
				switch(name) {
				case "_edge0": _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; break;
				default: break;
				}
			}

			public enum alternative_in_iterated_iter_0_alt_0_Bar_VariableNums { END_OF_ENUM };
			public override IEnumerable<object> Variables { get { return new GRGEN_LGSP.Variables_Enumerable(this); } }
			public override IEnumerator<object> VariablesEnumerator { get { return new GRGEN_LGSP.Variables_Enumerator(this); } }
			public override int NumberOfVariables { get { return 0; } }
			public override object getVariableAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override object getVariable(string name)
			{
				switch(name) {
				default: return null;
				}
			}
			public override void SetVariable(string name, object value)
			{
				switch(name) {
				default: break;
				}
			}

			public enum alternative_in_iterated_iter_0_alt_0_Bar_SubNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> EmbeddedGraphs { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> EmbeddedGraphsEnumerator { get { return new GRGEN_LGSP.EmbeddedGraphs_Enumerator(this); } }
			public override int NumberOfEmbeddedGraphs { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getEmbeddedGraphAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_iterated_iter_0_alt_0_Bar_AltNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Alternatives { get { return new GRGEN_LGSP.Alternatives_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> AlternativesEnumerator { get { return new GRGEN_LGSP.Alternatives_Enumerator(this); } }
			public override int NumberOfAlternatives { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getAlternativeAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getAlternative(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_iterated_iter_0_alt_0_Bar_IterNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatches> Iterateds { get { return new GRGEN_LGSP.Iterateds_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatches> IteratedsEnumerator { get { return new GRGEN_LGSP.Iterateds_Enumerator(this); } }
			public override int NumberOfIterateds { get { return 0; } }
			public override GRGEN_LIBGR.IMatches getIteratedAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatches getIterated(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public enum alternative_in_iterated_iter_0_alt_0_Bar_IdptNums { END_OF_ENUM };
			public override IEnumerable<GRGEN_LIBGR.IMatch> Independents { get { return new GRGEN_LGSP.Independents_Enumerable(this); } }
			public override IEnumerator<GRGEN_LIBGR.IMatch> IndependentsEnumerator { get { return new GRGEN_LGSP.Independents_Enumerator(this); } }
			public override int NumberOfIndependents { get { return 0; } }
			public override GRGEN_LIBGR.IMatch getIndependentAt(int index)
			{
				switch(index) {
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getIndependent(string name)
			{
				switch(name) {
				default: return null;
				}
			}

			public override GRGEN_LIBGR.IPatternGraph Pattern { get { return Rule_alternative_in_iterated.instance.alternative_in_iterated_iter_0_alt_0_Bar; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_alternative_in_iterated_iter_0_alt_0_Bar(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_alternative_in_iterated_iter_0_alt_0_Bar(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_alternative_in_iterated_iter_0_alt_0_Bar nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_alternative_in_iterated_iter_0_alt_0_Bar cur = this;
				while(cur != null) {
					Match_alternative_in_iterated_iter_0_alt_0_Bar next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_alternative_in_iterated_iter_0_alt_0_Bar that)
			{
				_node__node0 = that._node__node0;
				_node__node1 = that._node__node1;
				_edge__edge0 = that._edge__edge0;
			}

			public Match_alternative_in_iterated_iter_0_alt_0_Bar(Match_alternative_in_iterated_iter_0_alt_0_Bar that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_alternative_in_iterated_iter_0_alt_0_Bar that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
				_node__node1 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node1];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
			}

			public Match_alternative_in_iterated_iter_0_alt_0_Bar(Match_alternative_in_iterated_iter_0_alt_0_Bar that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				AssignContent(that, oldToNewMap);
			}
			public Match_alternative_in_iterated_iter_0_alt_0_Bar()
			{
			}

			public bool IsEqual(Match_alternative_in_iterated_iter_0_alt_0_Bar that)
			{
				if(that==null) return false;
				if(_node__node0 != that._node__node0) return false;
				if(_node__node1 != that._node__node1) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				return true;
			}
		}


		public class Extractor
		{
		}

		public class Extractor_iter_0
		{
			public static List<GRGEN_LIBGR.INode> Extract__node0(List<IMatch_alternative_in_iterated_iter_0> matchList)
			{
				List<GRGEN_LIBGR.INode> resultList = new List<GRGEN_LIBGR.INode>(matchList.Count);
				foreach(IMatch_alternative_in_iterated_iter_0 match in matchList)
					resultList.Add(match.node__node0);
				return resultList;
			}
		}


		public static List<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated> ConvertAsNeeded(object parameter)
		{
			if(parameter is List<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated>)
				return ((List<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated>)parameter);
			else
				return GRGEN_LIBGR.MatchListHelper.ToList<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated>((IList<GRGEN_LIBGR.IMatch>)parameter);
		}
	}

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated instanceBearingAttributeForSearch_alternative_in_iterated = new GRGEN_ACTIONS.Rule_alternative_in_iterated.Match_alternative_in_iterated();
	}
	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0 instanceBearingAttributeForSearch_alternative_in_iterated_iter_0 = new GRGEN_ACTIONS.Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0();
		public static List<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0> Array_alternative_in_iterated_iter_0_groupBy__node0(List<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node__node0)) {
					seenValues[list[pos].@node__node0].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0> tempList = new List<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node__node0, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0> newList = new List<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0>();
			foreach(List<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0> Array_alternative_in_iterated_iter_0_keepOneForEachBy__node0(List<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0> list)
		{
			List<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0> newList = new List<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0 element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node__node0)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node__node0, null);
				}
			}
			return newList;
		}
		public static int Array_alternative_in_iterated_iter_0_indexOfBy__node0(IList<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node__node0.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_alternative_in_iterated_iter_0_indexOfBy__node0(IList<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node__node0.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_alternative_in_iterated_iter_0_lastIndexOfBy__node0(IList<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node__node0.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_alternative_in_iterated_iter_0_lastIndexOfBy__node0(IList<GRGEN_ACTIONS.Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node__node0.Equals(entry))
					return i;
			return -1;
		}
	}

	public class Functions
	{

		static Functions() {
		}

	}

	public class Procedures
	{

		static Procedures() {
		}

	}

	public partial class MatchFilters
	{

		static MatchFilters() {
		}

	}

	public partial class MatchClassFilters
	{

		static MatchClassFilters() {
		}

	}



	//-----------------------------------------------------------

	public class Alternatives_RuleAndMatchingPatterns : GRGEN_LGSP.LGSPRuleAndMatchingPatterns
	{
		public Alternatives_RuleAndMatchingPatterns()
		{
			subpatterns = new GRGEN_LGSP.LGSPMatchingPattern[1];
			rules = new GRGEN_LGSP.LGSPRulePattern[17];
			rulesAndSubpatterns = new GRGEN_LGSP.LGSPMatchingPattern[1+17];
			definedSequences = new GRGEN_LIBGR.DefinedSequenceInfo[0];
			functions = new GRGEN_LIBGR.FunctionInfo[0+0];
			procedures = new GRGEN_LIBGR.ProcedureInfo[0+0];
			matchClasses = new GRGEN_LIBGR.MatchClassInfo[0];
			packages = new string[0];
			subpatterns[0] = Pattern_toAorB.Instance;
			rulesAndSubpatterns[0] = Pattern_toAorB.Instance;
			rules[0] = Rule_createA.Instance;
			rulesAndSubpatterns[1+0] = Rule_createA.Instance;
			rules[1] = Rule_createB.Instance;
			rulesAndSubpatterns[1+1] = Rule_createB.Instance;
			rules[2] = Rule_createC.Instance;
			rulesAndSubpatterns[1+2] = Rule_createC.Instance;
			rules[3] = Rule_createAtoB.Instance;
			rulesAndSubpatterns[1+3] = Rule_createAtoB.Instance;
			rules[4] = Rule_leer.Instance;
			rulesAndSubpatterns[1+4] = Rule_leer.Instance;
			rules[5] = Rule_AorB.Instance;
			rulesAndSubpatterns[1+5] = Rule_AorB.Instance;
			rules[6] = Rule_AandnotCorB.Instance;
			rulesAndSubpatterns[1+6] = Rule_AandnotCorB.Instance;
			rules[7] = Rule_AorBorC.Instance;
			rulesAndSubpatterns[1+7] = Rule_AorBorC.Instance;
			rules[8] = Rule_AtoAorB.Instance;
			rulesAndSubpatterns[1+8] = Rule_AtoAorB.Instance;
			rules[9] = Rule_createComplex.Instance;
			rulesAndSubpatterns[1+9] = Rule_createComplex.Instance;
			rules[10] = Rule_Complex.Instance;
			rulesAndSubpatterns[1+10] = Rule_Complex.Instance;
			rules[11] = Rule_ComplexMax.Instance;
			rulesAndSubpatterns[1+11] = Rule_ComplexMax.Instance;
			rules[12] = Rule_createABA.Instance;
			rulesAndSubpatterns[1+12] = Rule_createABA.Instance;
			rules[13] = Rule_homm.Instance;
			rulesAndSubpatterns[1+13] = Rule_homm.Instance;
			rules[14] = Rule_XtoAorB.Instance;
			rulesAndSubpatterns[1+14] = Rule_XtoAorB.Instance;
			rules[15] = Rule_alternative_in_negative.Instance;
			rulesAndSubpatterns[1+15] = Rule_alternative_in_negative.Instance;
			rules[16] = Rule_alternative_in_iterated.Instance;
			rulesAndSubpatterns[1+16] = Rule_alternative_in_iterated.Instance;
		}
		public override GRGEN_LGSP.LGSPRulePattern[] Rules { get { return rules; } }
		private GRGEN_LGSP.LGSPRulePattern[] rules;
		public override GRGEN_LGSP.LGSPMatchingPattern[] Subpatterns { get { return subpatterns; } }
		private GRGEN_LGSP.LGSPMatchingPattern[] subpatterns;
		public override GRGEN_LGSP.LGSPMatchingPattern[] RulesAndSubpatterns { get { return rulesAndSubpatterns; } }
		private GRGEN_LGSP.LGSPMatchingPattern[] rulesAndSubpatterns;
		public override GRGEN_LIBGR.DefinedSequenceInfo[] DefinedSequences { get { return definedSequences; } }
		private GRGEN_LIBGR.DefinedSequenceInfo[] definedSequences;
		public override GRGEN_LIBGR.FunctionInfo[] Functions { get { return functions; } }
		private GRGEN_LIBGR.FunctionInfo[] functions;
		public override GRGEN_LIBGR.ProcedureInfo[] Procedures { get { return procedures; } }
		private GRGEN_LIBGR.ProcedureInfo[] procedures;
		public override GRGEN_LIBGR.MatchClassInfo[] MatchClasses { get { return matchClasses; } }
		private GRGEN_LIBGR.MatchClassInfo[] matchClasses;
		public override string[] Packages { get { return packages; } }
		private string[] packages;
	}


    public class PatternAction_toAorB : GRGEN_LGSP.LGSPSubpatternAction
    {
        private PatternAction_toAorB(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_)
            : base(null)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
            patternGraph = Pattern_toAorB.Instance.patternGraph;
        }

        public static PatternAction_toAorB getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_) {
            PatternAction_toAorB newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new PatternAction_toAorB(actionEnv_, openTasks_);
            }
            return newTask;
        }

        public static void releaseTask(PatternAction_toAorB oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static PatternAction_toAorB freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private PatternAction_toAorB next = null;

        public GRGEN_LGSP.LGSPNode toAorB_node_x;
        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // SubPreset toAorB_node_x 
            GRGEN_LGSP.LGSPNode candidate_toAorB_node_x = toAorB_node_x;
            // Extend Outgoing toAorB_edge_y from toAorB_node_x 
            GRGEN_LGSP.LGSPEdge head_candidate_toAorB_edge_y = candidate_toAorB_node_x.lgspOuthead;
            if(head_candidate_toAorB_edge_y != null)
            {
                GRGEN_LGSP.LGSPEdge candidate_toAorB_edge_y = head_candidate_toAorB_edge_y;
                do
                {
                    if(candidate_toAorB_edge_y.lgspType.TypeID!=1) {
                        continue;
                    }
                    if((candidate_toAorB_edge_y.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                    {
                        continue;
                    }
                    // Push alternative matching task for toAorB_alt_0
                    AlternativeAction_toAorB_alt_0 taskFor_alt_0 = AlternativeAction_toAorB_alt_0.getNewTask(actionEnv, openTasks, Pattern_toAorB.Instance.patternGraph.alternatives[(int)Pattern_toAorB.toAorB_AltNums.@alt_0].alternativeCases);
                    taskFor_alt_0.toAorB_edge_y = candidate_toAorB_edge_y;
                    taskFor_alt_0.searchPatternpath = false;
                    taskFor_alt_0.matchOfNestingPattern = null;
                    taskFor_alt_0.lastMatchAtPreviousNestingLevel = null;
                    openTasks.Push(taskFor_alt_0);
                    uint prevGlobal__candidate_toAorB_edge_y;
                    prevGlobal__candidate_toAorB_edge_y = candidate_toAorB_edge_y.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    candidate_toAorB_edge_y.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    // Match subpatterns 
                    openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                    // Pop alternative matching task for toAorB_alt_0
                    openTasks.Pop();
                    AlternativeAction_toAorB_alt_0.releaseTask(taskFor_alt_0);
                    // Check whether subpatterns were found 
                    if(matchesList.Count>0) {
                        // subpatterns/alternatives were found, extend the partial matches by our local match object
                        foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                        {
                            Pattern_toAorB.Match_toAorB match = new Pattern_toAorB.Match_toAorB();
                            match._node_x = candidate_toAorB_node_x;
                            match._edge_y = candidate_toAorB_edge_y;
                            match._alt_0 = (Pattern_toAorB.IMatch_toAorB_alt_0)currentFoundPartialMatch.Pop();
                            match._alt_0.SetMatchOfEnclosingPattern(match);
                            currentFoundPartialMatch.Push(match);
                        }
                        if(matchesList==foundPartialMatches) {
                            matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                        } else {
                            foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                foundPartialMatches.Add(match);
                            }
                            matchesList.Clear();
                        }
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            candidate_toAorB_edge_y.lgspFlags = candidate_toAorB_edge_y.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_edge_y;
                            openTasks.Push(this);
                            return;
                        }
                        candidate_toAorB_edge_y.lgspFlags = candidate_toAorB_edge_y.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_edge_y;
                        continue;
                    }
                    candidate_toAorB_edge_y.lgspFlags = candidate_toAorB_edge_y.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_edge_y;
                }
                while( (candidate_toAorB_edge_y = candidate_toAorB_edge_y.lgspOutNext) != head_candidate_toAorB_edge_y );
            }
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_toAorB_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_toAorB_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_toAorB_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_toAorB_alt_0 newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_toAorB_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_toAorB_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_toAorB_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_toAorB_alt_0 next = null;

        public GRGEN_LGSP.LGSPEdge toAorB_edge_y;
        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // Alternative case toAorB_alt_0_toA 
            do {
                patternGraph = patternGraphs[(int)Pattern_toAorB.toAorB_alt_0_CaseNums.@toA];
                // SubPreset toAorB_edge_y 
                GRGEN_LGSP.LGSPEdge candidate_toAorB_edge_y = toAorB_edge_y;
                // Implicit Target toAorB_alt_0_toA_node_a from toAorB_edge_y 
                GRGEN_LGSP.LGSPNode candidate_toAorB_alt_0_toA_node_a = candidate_toAorB_edge_y.lgspTarget;
                if(candidate_toAorB_alt_0_toA_node_a.lgspType.TypeID!=1) {
                    continue;
                }
                if((candidate_toAorB_alt_0_toA_node_a.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                {
                    continue;
                }
                // Check whether there are subpattern matching tasks left to execute
                if(openTasks.Count==0)
                {
                    Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                    foundPartialMatches.Add(currentFoundPartialMatch);
                    Pattern_toAorB.Match_toAorB_alt_0_toA match = new Pattern_toAorB.Match_toAorB_alt_0_toA();
                    match._node_a = candidate_toAorB_alt_0_toA_node_a;
                    match._edge_y = candidate_toAorB_edge_y;
                    currentFoundPartialMatch.Push(match);
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        openTasks.Push(this);
                        return;
                    }
                    continue;
                }
                uint prevGlobal__candidate_toAorB_alt_0_toA_node_a;
                prevGlobal__candidate_toAorB_alt_0_toA_node_a = candidate_toAorB_alt_0_toA_node_a.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                candidate_toAorB_alt_0_toA_node_a.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                // Match subpatterns 
                openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                // Check whether subpatterns were found 
                if(matchesList.Count>0) {
                    // subpatterns/alternatives were found, extend the partial matches by our local match object
                    foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                    {
                        Pattern_toAorB.Match_toAorB_alt_0_toA match = new Pattern_toAorB.Match_toAorB_alt_0_toA();
                        match._node_a = candidate_toAorB_alt_0_toA_node_a;
                        match._edge_y = candidate_toAorB_edge_y;
                        currentFoundPartialMatch.Push(match);
                    }
                    if(matchesList==foundPartialMatches) {
                        matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                    } else {
                        foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                            foundPartialMatches.Add(match);
                        }
                        matchesList.Clear();
                    }
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        candidate_toAorB_alt_0_toA_node_a.lgspFlags = candidate_toAorB_alt_0_toA_node_a.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_alt_0_toA_node_a;
                        openTasks.Push(this);
                        return;
                    }
                    candidate_toAorB_alt_0_toA_node_a.lgspFlags = candidate_toAorB_alt_0_toA_node_a.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_alt_0_toA_node_a;
                    continue;
                }
                candidate_toAorB_alt_0_toA_node_a.lgspFlags = candidate_toAorB_alt_0_toA_node_a.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_alt_0_toA_node_a;
            } while(false);
            if(matchesList.Count>0) {
                if(matchesList==foundPartialMatches) {
                    matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                } else {
                    foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                        foundPartialMatches.Add(match);
                    }
                    matchesList.Clear();
                }
            }
            // Alternative case toAorB_alt_0_toB 
            do {
                patternGraph = patternGraphs[(int)Pattern_toAorB.toAorB_alt_0_CaseNums.@toB];
                // SubPreset toAorB_edge_y 
                GRGEN_LGSP.LGSPEdge candidate_toAorB_edge_y = toAorB_edge_y;
                // Implicit Target toAorB_alt_0_toB_node_b from toAorB_edge_y 
                GRGEN_LGSP.LGSPNode candidate_toAorB_alt_0_toB_node_b = candidate_toAorB_edge_y.lgspTarget;
                if(candidate_toAorB_alt_0_toB_node_b.lgspType.TypeID!=2) {
                    continue;
                }
                if((candidate_toAorB_alt_0_toB_node_b.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                {
                    continue;
                }
                // Check whether there are subpattern matching tasks left to execute
                if(openTasks.Count==0)
                {
                    Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                    foundPartialMatches.Add(currentFoundPartialMatch);
                    Pattern_toAorB.Match_toAorB_alt_0_toB match = new Pattern_toAorB.Match_toAorB_alt_0_toB();
                    match._node_b = candidate_toAorB_alt_0_toB_node_b;
                    match._edge_y = candidate_toAorB_edge_y;
                    currentFoundPartialMatch.Push(match);
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        openTasks.Push(this);
                        return;
                    }
                    continue;
                }
                uint prevGlobal__candidate_toAorB_alt_0_toB_node_b;
                prevGlobal__candidate_toAorB_alt_0_toB_node_b = candidate_toAorB_alt_0_toB_node_b.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                candidate_toAorB_alt_0_toB_node_b.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                // Match subpatterns 
                openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                // Check whether subpatterns were found 
                if(matchesList.Count>0) {
                    // subpatterns/alternatives were found, extend the partial matches by our local match object
                    foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                    {
                        Pattern_toAorB.Match_toAorB_alt_0_toB match = new Pattern_toAorB.Match_toAorB_alt_0_toB();
                        match._node_b = candidate_toAorB_alt_0_toB_node_b;
                        match._edge_y = candidate_toAorB_edge_y;
                        currentFoundPartialMatch.Push(match);
                    }
                    if(matchesList==foundPartialMatches) {
                        matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                    } else {
                        foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                            foundPartialMatches.Add(match);
                        }
                        matchesList.Clear();
                    }
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        candidate_toAorB_alt_0_toB_node_b.lgspFlags = candidate_toAorB_alt_0_toB_node_b.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_alt_0_toB_node_b;
                        openTasks.Push(this);
                        return;
                    }
                    candidate_toAorB_alt_0_toB_node_b.lgspFlags = candidate_toAorB_alt_0_toB_node_b.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_alt_0_toB_node_b;
                    continue;
                }
                candidate_toAorB_alt_0_toB_node_b.lgspFlags = candidate_toAorB_alt_0_toB_node_b.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_alt_0_toB_node_b;
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_createA
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_createA.IMatch_createA> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_createA.IMatch_createA match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createA.IMatch_createA> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_createA : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_createA
    {
        public Action_createA()
            : base(Rule_createA.Instance.patternGraph)
        {
            _rulePattern = Rule_createA.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_createA _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "createA"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_createA.Match_createA, Rule_createA.IMatch_createA> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_createA Instance { get { return instance; } set { instance = value; } }
        private static Action_createA instance = new Action_createA();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_createA.IMatch_createA> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_createA.Match_createA, Rule_createA.IMatch_createA>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            Rule_createA.Match_createA match = matches.GetNextUnfilledPosition();
            matches.PositionWasFilledFixIt();
            // if enough matches were found, we leave
            if(maxMatches > 0 && matches.Count >= maxMatches)
            {
                return matches;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_createA.IMatch_createA> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_createA.IMatch_createA> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_createA.IMatch_createA match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createA.IMatch_createA> matches)
        {
            foreach(Rule_createA.IMatch_createA match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createA.IMatch_createA> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createA.IMatch_createA> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_createA.IMatch_createA match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createA.IMatch_createA> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createA.IMatch_createA> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createA.IMatch_createA> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_createA.IMatch_createA)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_createA.IMatch_createA>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_createB
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_createB.IMatch_createB> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_createB.IMatch_createB match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createB.IMatch_createB> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_createB : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_createB
    {
        public Action_createB()
            : base(Rule_createB.Instance.patternGraph)
        {
            _rulePattern = Rule_createB.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_createB _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "createB"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_createB.Match_createB, Rule_createB.IMatch_createB> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_createB Instance { get { return instance; } set { instance = value; } }
        private static Action_createB instance = new Action_createB();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_createB.IMatch_createB> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_createB.Match_createB, Rule_createB.IMatch_createB>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            Rule_createB.Match_createB match = matches.GetNextUnfilledPosition();
            matches.PositionWasFilledFixIt();
            // if enough matches were found, we leave
            if(maxMatches > 0 && matches.Count >= maxMatches)
            {
                return matches;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_createB.IMatch_createB> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_createB.IMatch_createB> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_createB.IMatch_createB match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createB.IMatch_createB> matches)
        {
            foreach(Rule_createB.IMatch_createB match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createB.IMatch_createB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createB.IMatch_createB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_createB.IMatch_createB match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createB.IMatch_createB> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createB.IMatch_createB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createB.IMatch_createB> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_createB.IMatch_createB)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_createB.IMatch_createB>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_createC
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_createC.IMatch_createC> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_createC.IMatch_createC match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createC.IMatch_createC> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_createC : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_createC
    {
        public Action_createC()
            : base(Rule_createC.Instance.patternGraph)
        {
            _rulePattern = Rule_createC.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_createC _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "createC"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_createC.Match_createC, Rule_createC.IMatch_createC> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_createC Instance { get { return instance; } set { instance = value; } }
        private static Action_createC instance = new Action_createC();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_createC.IMatch_createC> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_createC.Match_createC, Rule_createC.IMatch_createC>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            Rule_createC.Match_createC match = matches.GetNextUnfilledPosition();
            matches.PositionWasFilledFixIt();
            // if enough matches were found, we leave
            if(maxMatches > 0 && matches.Count >= maxMatches)
            {
                return matches;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_createC.IMatch_createC> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_createC.IMatch_createC> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_createC.IMatch_createC match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createC.IMatch_createC> matches)
        {
            foreach(Rule_createC.IMatch_createC match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createC.IMatch_createC> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createC.IMatch_createC> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_createC.IMatch_createC match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createC.IMatch_createC> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createC.IMatch_createC> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createC.IMatch_createC> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_createC.IMatch_createC)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_createC.IMatch_createC>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_createAtoB
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_createAtoB.IMatch_createAtoB> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_createAtoB.IMatch_createAtoB match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createAtoB.IMatch_createAtoB> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_createAtoB : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_createAtoB
    {
        public Action_createAtoB()
            : base(Rule_createAtoB.Instance.patternGraph)
        {
            _rulePattern = Rule_createAtoB.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_createAtoB _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "createAtoB"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_createAtoB.Match_createAtoB, Rule_createAtoB.IMatch_createAtoB> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_createAtoB Instance { get { return instance; } set { instance = value; } }
        private static Action_createAtoB instance = new Action_createAtoB();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_createAtoB.IMatch_createAtoB> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_createAtoB.Match_createAtoB, Rule_createAtoB.IMatch_createAtoB>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            Rule_createAtoB.Match_createAtoB match = matches.GetNextUnfilledPosition();
            matches.PositionWasFilledFixIt();
            // if enough matches were found, we leave
            if(maxMatches > 0 && matches.Count >= maxMatches)
            {
                return matches;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_createAtoB.IMatch_createAtoB> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_createAtoB.IMatch_createAtoB> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_createAtoB.IMatch_createAtoB match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createAtoB.IMatch_createAtoB> matches)
        {
            foreach(Rule_createAtoB.IMatch_createAtoB match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createAtoB.IMatch_createAtoB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createAtoB.IMatch_createAtoB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_createAtoB.IMatch_createAtoB match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createAtoB.IMatch_createAtoB> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createAtoB.IMatch_createAtoB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createAtoB.IMatch_createAtoB> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_createAtoB.IMatch_createAtoB)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_createAtoB.IMatch_createAtoB>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_leer
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_leer.IMatch_leer> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_leer.IMatch_leer match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_leer.IMatch_leer> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_leer : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_leer
    {
        public Action_leer()
            : base(Rule_leer.Instance.patternGraph)
        {
            _rulePattern = Rule_leer.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_leer _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "leer"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_leer.Match_leer, Rule_leer.IMatch_leer> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_leer Instance { get { return instance; } set { instance = value; } }
        private static Action_leer instance = new Action_leer();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_leer.IMatch_leer> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_leer.Match_leer, Rule_leer.IMatch_leer>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks = new Stack<GRGEN_LGSP.LGSPSubpatternAction>();
            List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches = new List<Stack<GRGEN_LIBGR.IMatch>>();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            // Push alternative matching task for leer_alt_0
            AlternativeAction_leer_alt_0 taskFor_alt_0 = AlternativeAction_leer_alt_0.getNewTask(actionEnv, openTasks, Rule_leer.Instance.patternGraph.alternatives[(int)Rule_leer.leer_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0.searchPatternpath = false;
            taskFor_alt_0.matchOfNestingPattern = null;
            taskFor_alt_0.lastMatchAtPreviousNestingLevel = null;
            openTasks.Push(taskFor_alt_0);
            // Match subpatterns 
            openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
            // Pop alternative matching task for leer_alt_0
            openTasks.Pop();
            AlternativeAction_leer_alt_0.releaseTask(taskFor_alt_0);
            // Check whether subpatterns were found 
            if(matchesList.Count>0) {
                // subpatterns/alternatives were found, extend the partial matches by our local match object, becoming a complete match object and save it
                foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                {
                    Rule_leer.Match_leer match = matches.GetNextUnfilledPosition();
                    match._alt_0 = (Rule_leer.IMatch_leer_alt_0)currentFoundPartialMatch.Pop();
                    match._alt_0.SetMatchOfEnclosingPattern(match);
                    matches.PositionWasFilledFixIt();
                }
                matchesList.Clear();
                // if enough matches were found, we leave
                if(maxMatches > 0 && matches.Count >= maxMatches)
                {
                    return matches;
                }
                return matches;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_leer.IMatch_leer> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_leer.IMatch_leer> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_leer.IMatch_leer match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_leer.IMatch_leer> matches)
        {
            foreach(Rule_leer.IMatch_leer match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_leer.IMatch_leer> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_leer.IMatch_leer> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_leer.IMatch_leer match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_leer.IMatch_leer> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_leer.IMatch_leer> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_leer.IMatch_leer> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_leer.IMatch_leer)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_leer.IMatch_leer>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    public class AlternativeAction_leer_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_leer_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_leer_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_leer_alt_0 newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_leer_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_leer_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_leer_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_leer_alt_0 next = null;

        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // Alternative case leer_alt_0_altleer 
            do {
                patternGraph = patternGraphs[(int)Rule_leer.leer_alt_0_CaseNums.@altleer];
                // Check whether there are subpattern matching tasks left to execute
                if(openTasks.Count==0)
                {
                    Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                    foundPartialMatches.Add(currentFoundPartialMatch);
                    Rule_leer.Match_leer_alt_0_altleer match = new Rule_leer.Match_leer_alt_0_altleer();
                    currentFoundPartialMatch.Push(match);
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        openTasks.Push(this);
                        return;
                    }
                    continue;
                }
                // Match subpatterns 
                openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                // Check whether subpatterns were found 
                if(matchesList.Count>0) {
                    // subpatterns/alternatives were found, extend the partial matches by our local match object
                    foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                    {
                        Rule_leer.Match_leer_alt_0_altleer match = new Rule_leer.Match_leer_alt_0_altleer();
                        currentFoundPartialMatch.Push(match);
                    }
                    if(matchesList==foundPartialMatches) {
                        matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                    } else {
                        foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                            foundPartialMatches.Add(match);
                        }
                        matchesList.Clear();
                    }
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        openTasks.Push(this);
                        return;
                    }
                    continue;
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_AorB
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_AorB.IMatch_AorB> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_AorB.IMatch_AorB match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_AorB.IMatch_AorB> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_AorB : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_AorB
    {
        public Action_AorB()
            : base(Rule_AorB.Instance.patternGraph)
        {
            _rulePattern = Rule_AorB.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_AorB _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "AorB"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_AorB.Match_AorB, Rule_AorB.IMatch_AorB> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_AorB Instance { get { return instance; } set { instance = value; } }
        private static Action_AorB instance = new Action_AorB();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_AorB.IMatch_AorB> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_AorB.Match_AorB, Rule_AorB.IMatch_AorB>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks = new Stack<GRGEN_LGSP.LGSPSubpatternAction>();
            List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches = new List<Stack<GRGEN_LIBGR.IMatch>>();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            // Push alternative matching task for AorB_alt_0
            AlternativeAction_AorB_alt_0 taskFor_alt_0 = AlternativeAction_AorB_alt_0.getNewTask(actionEnv, openTasks, Rule_AorB.Instance.patternGraph.alternatives[(int)Rule_AorB.AorB_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0.searchPatternpath = false;
            taskFor_alt_0.matchOfNestingPattern = null;
            taskFor_alt_0.lastMatchAtPreviousNestingLevel = null;
            openTasks.Push(taskFor_alt_0);
            // Match subpatterns 
            openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
            // Pop alternative matching task for AorB_alt_0
            openTasks.Pop();
            AlternativeAction_AorB_alt_0.releaseTask(taskFor_alt_0);
            // Check whether subpatterns were found 
            if(matchesList.Count>0) {
                // subpatterns/alternatives were found, extend the partial matches by our local match object, becoming a complete match object and save it
                foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                {
                    Rule_AorB.Match_AorB match = matches.GetNextUnfilledPosition();
                    match._alt_0 = (Rule_AorB.IMatch_AorB_alt_0)currentFoundPartialMatch.Pop();
                    match._alt_0.SetMatchOfEnclosingPattern(match);
                    matches.PositionWasFilledFixIt();
                }
                matchesList.Clear();
                // if enough matches were found, we leave
                if(maxMatches > 0 && matches.Count >= maxMatches)
                {
                    return matches;
                }
                return matches;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_AorB.IMatch_AorB> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_AorB.IMatch_AorB> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_AorB.IMatch_AorB match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_AorB.IMatch_AorB> matches)
        {
            foreach(Rule_AorB.IMatch_AorB match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AorB.IMatch_AorB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AorB.IMatch_AorB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_AorB.IMatch_AorB match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AorB.IMatch_AorB> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AorB.IMatch_AorB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AorB.IMatch_AorB> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_AorB.IMatch_AorB)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_AorB.IMatch_AorB>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    public class AlternativeAction_AorB_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_AorB_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_AorB_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_AorB_alt_0 newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_AorB_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_AorB_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_AorB_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_AorB_alt_0 next = null;

        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // Alternative case AorB_alt_0_A 
            do {
                patternGraph = patternGraphs[(int)Rule_AorB.AorB_alt_0_CaseNums.@A];
                // Lookup AorB_alt_0_A_node__node0 
                int type_id_candidate_AorB_alt_0_A_node__node0 = 1;
                for(GRGEN_LGSP.LGSPNode head_candidate_AorB_alt_0_A_node__node0 = graph.nodesByTypeHeads[type_id_candidate_AorB_alt_0_A_node__node0], candidate_AorB_alt_0_A_node__node0 = head_candidate_AorB_alt_0_A_node__node0.lgspTypeNext; candidate_AorB_alt_0_A_node__node0 != head_candidate_AorB_alt_0_A_node__node0; candidate_AorB_alt_0_A_node__node0 = candidate_AorB_alt_0_A_node__node0.lgspTypeNext)
                {
                    if((candidate_AorB_alt_0_A_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                    {
                        continue;
                    }
                    // Check whether there are subpattern matching tasks left to execute
                    if(openTasks.Count==0)
                    {
                        Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                        foundPartialMatches.Add(currentFoundPartialMatch);
                        Rule_AorB.Match_AorB_alt_0_A match = new Rule_AorB.Match_AorB_alt_0_A();
                        match._node__node0 = candidate_AorB_alt_0_A_node__node0;
                        currentFoundPartialMatch.Push(match);
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            openTasks.Push(this);
                            return;
                        }
                        continue;
                    }
                    uint prevGlobal__candidate_AorB_alt_0_A_node__node0;
                    prevGlobal__candidate_AorB_alt_0_A_node__node0 = candidate_AorB_alt_0_A_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    candidate_AorB_alt_0_A_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    // Match subpatterns 
                    openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                    // Check whether subpatterns were found 
                    if(matchesList.Count>0) {
                        // subpatterns/alternatives were found, extend the partial matches by our local match object
                        foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                        {
                            Rule_AorB.Match_AorB_alt_0_A match = new Rule_AorB.Match_AorB_alt_0_A();
                            match._node__node0 = candidate_AorB_alt_0_A_node__node0;
                            currentFoundPartialMatch.Push(match);
                        }
                        if(matchesList==foundPartialMatches) {
                            matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                        } else {
                            foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                foundPartialMatches.Add(match);
                            }
                            matchesList.Clear();
                        }
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            candidate_AorB_alt_0_A_node__node0.lgspFlags = candidate_AorB_alt_0_A_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AorB_alt_0_A_node__node0;
                            openTasks.Push(this);
                            return;
                        }
                        candidate_AorB_alt_0_A_node__node0.lgspFlags = candidate_AorB_alt_0_A_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AorB_alt_0_A_node__node0;
                        continue;
                    }
                    candidate_AorB_alt_0_A_node__node0.lgspFlags = candidate_AorB_alt_0_A_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AorB_alt_0_A_node__node0;
                }
            } while(false);
            if(matchesList.Count>0) {
                if(matchesList==foundPartialMatches) {
                    matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                } else {
                    foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                        foundPartialMatches.Add(match);
                    }
                    matchesList.Clear();
                }
            }
            // Alternative case AorB_alt_0_B 
            do {
                patternGraph = patternGraphs[(int)Rule_AorB.AorB_alt_0_CaseNums.@B];
                // Lookup AorB_alt_0_B_node__node0 
                int type_id_candidate_AorB_alt_0_B_node__node0 = 2;
                for(GRGEN_LGSP.LGSPNode head_candidate_AorB_alt_0_B_node__node0 = graph.nodesByTypeHeads[type_id_candidate_AorB_alt_0_B_node__node0], candidate_AorB_alt_0_B_node__node0 = head_candidate_AorB_alt_0_B_node__node0.lgspTypeNext; candidate_AorB_alt_0_B_node__node0 != head_candidate_AorB_alt_0_B_node__node0; candidate_AorB_alt_0_B_node__node0 = candidate_AorB_alt_0_B_node__node0.lgspTypeNext)
                {
                    if((candidate_AorB_alt_0_B_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                    {
                        continue;
                    }
                    // Check whether there are subpattern matching tasks left to execute
                    if(openTasks.Count==0)
                    {
                        Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                        foundPartialMatches.Add(currentFoundPartialMatch);
                        Rule_AorB.Match_AorB_alt_0_B match = new Rule_AorB.Match_AorB_alt_0_B();
                        match._node__node0 = candidate_AorB_alt_0_B_node__node0;
                        currentFoundPartialMatch.Push(match);
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            openTasks.Push(this);
                            return;
                        }
                        continue;
                    }
                    uint prevGlobal__candidate_AorB_alt_0_B_node__node0;
                    prevGlobal__candidate_AorB_alt_0_B_node__node0 = candidate_AorB_alt_0_B_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    candidate_AorB_alt_0_B_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    // Match subpatterns 
                    openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                    // Check whether subpatterns were found 
                    if(matchesList.Count>0) {
                        // subpatterns/alternatives were found, extend the partial matches by our local match object
                        foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                        {
                            Rule_AorB.Match_AorB_alt_0_B match = new Rule_AorB.Match_AorB_alt_0_B();
                            match._node__node0 = candidate_AorB_alt_0_B_node__node0;
                            currentFoundPartialMatch.Push(match);
                        }
                        if(matchesList==foundPartialMatches) {
                            matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                        } else {
                            foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                foundPartialMatches.Add(match);
                            }
                            matchesList.Clear();
                        }
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            candidate_AorB_alt_0_B_node__node0.lgspFlags = candidate_AorB_alt_0_B_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AorB_alt_0_B_node__node0;
                            openTasks.Push(this);
                            return;
                        }
                        candidate_AorB_alt_0_B_node__node0.lgspFlags = candidate_AorB_alt_0_B_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AorB_alt_0_B_node__node0;
                        continue;
                    }
                    candidate_AorB_alt_0_B_node__node0.lgspFlags = candidate_AorB_alt_0_B_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AorB_alt_0_B_node__node0;
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_AandnotCorB
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_AandnotCorB.IMatch_AandnotCorB> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_AandnotCorB.IMatch_AandnotCorB match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_AandnotCorB.IMatch_AandnotCorB> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_AandnotCorB : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_AandnotCorB
    {
        public Action_AandnotCorB()
            : base(Rule_AandnotCorB.Instance.patternGraph)
        {
            _rulePattern = Rule_AandnotCorB.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_AandnotCorB _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "AandnotCorB"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_AandnotCorB.Match_AandnotCorB, Rule_AandnotCorB.IMatch_AandnotCorB> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_AandnotCorB Instance { get { return instance; } set { instance = value; } }
        private static Action_AandnotCorB instance = new Action_AandnotCorB();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_AandnotCorB.IMatch_AandnotCorB> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_AandnotCorB.Match_AandnotCorB, Rule_AandnotCorB.IMatch_AandnotCorB>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks = new Stack<GRGEN_LGSP.LGSPSubpatternAction>();
            List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches = new List<Stack<GRGEN_LIBGR.IMatch>>();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            // Push alternative matching task for AandnotCorB_alt_0
            AlternativeAction_AandnotCorB_alt_0 taskFor_alt_0 = AlternativeAction_AandnotCorB_alt_0.getNewTask(actionEnv, openTasks, Rule_AandnotCorB.Instance.patternGraph.alternatives[(int)Rule_AandnotCorB.AandnotCorB_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0.searchPatternpath = false;
            taskFor_alt_0.matchOfNestingPattern = null;
            taskFor_alt_0.lastMatchAtPreviousNestingLevel = null;
            openTasks.Push(taskFor_alt_0);
            // Match subpatterns 
            openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
            // Pop alternative matching task for AandnotCorB_alt_0
            openTasks.Pop();
            AlternativeAction_AandnotCorB_alt_0.releaseTask(taskFor_alt_0);
            // Check whether subpatterns were found 
            if(matchesList.Count>0) {
                // subpatterns/alternatives were found, extend the partial matches by our local match object, becoming a complete match object and save it
                foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                {
                    Rule_AandnotCorB.Match_AandnotCorB match = matches.GetNextUnfilledPosition();
                    match._alt_0 = (Rule_AandnotCorB.IMatch_AandnotCorB_alt_0)currentFoundPartialMatch.Pop();
                    match._alt_0.SetMatchOfEnclosingPattern(match);
                    matches.PositionWasFilledFixIt();
                }
                matchesList.Clear();
                // if enough matches were found, we leave
                if(maxMatches > 0 && matches.Count >= maxMatches)
                {
                    return matches;
                }
                return matches;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_AandnotCorB.IMatch_AandnotCorB> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_AandnotCorB.IMatch_AandnotCorB> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_AandnotCorB.IMatch_AandnotCorB match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_AandnotCorB.IMatch_AandnotCorB> matches)
        {
            foreach(Rule_AandnotCorB.IMatch_AandnotCorB match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AandnotCorB.IMatch_AandnotCorB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AandnotCorB.IMatch_AandnotCorB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_AandnotCorB.IMatch_AandnotCorB match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AandnotCorB.IMatch_AandnotCorB> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AandnotCorB.IMatch_AandnotCorB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AandnotCorB.IMatch_AandnotCorB> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_AandnotCorB.IMatch_AandnotCorB)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_AandnotCorB.IMatch_AandnotCorB>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    public class AlternativeAction_AandnotCorB_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_AandnotCorB_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_AandnotCorB_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_AandnotCorB_alt_0 newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_AandnotCorB_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_AandnotCorB_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_AandnotCorB_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_AandnotCorB_alt_0 next = null;

        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // Alternative case AandnotCorB_alt_0_A 
            do {
                patternGraph = patternGraphs[(int)Rule_AandnotCorB.AandnotCorB_alt_0_CaseNums.@A];
                // NegativePattern 
                {
                    ++isoSpace;
                    // Lookup AandnotCorB_alt_0_A_neg_0_node__node0 
                    int type_id_candidate_AandnotCorB_alt_0_A_neg_0_node__node0 = 3;
                    for(GRGEN_LGSP.LGSPNode head_candidate_AandnotCorB_alt_0_A_neg_0_node__node0 = graph.nodesByTypeHeads[type_id_candidate_AandnotCorB_alt_0_A_neg_0_node__node0], candidate_AandnotCorB_alt_0_A_neg_0_node__node0 = head_candidate_AandnotCorB_alt_0_A_neg_0_node__node0.lgspTypeNext; candidate_AandnotCorB_alt_0_A_neg_0_node__node0 != head_candidate_AandnotCorB_alt_0_A_neg_0_node__node0; candidate_AandnotCorB_alt_0_A_neg_0_node__node0 = candidate_AandnotCorB_alt_0_A_neg_0_node__node0.lgspTypeNext)
                    {
                        if((candidate_AandnotCorB_alt_0_A_neg_0_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // negative pattern found
                        --isoSpace;
                        goto label0;
                    }
                    --isoSpace;
                }
                // Lookup AandnotCorB_alt_0_A_node__node0 
                int type_id_candidate_AandnotCorB_alt_0_A_node__node0 = 1;
                for(GRGEN_LGSP.LGSPNode head_candidate_AandnotCorB_alt_0_A_node__node0 = graph.nodesByTypeHeads[type_id_candidate_AandnotCorB_alt_0_A_node__node0], candidate_AandnotCorB_alt_0_A_node__node0 = head_candidate_AandnotCorB_alt_0_A_node__node0.lgspTypeNext; candidate_AandnotCorB_alt_0_A_node__node0 != head_candidate_AandnotCorB_alt_0_A_node__node0; candidate_AandnotCorB_alt_0_A_node__node0 = candidate_AandnotCorB_alt_0_A_node__node0.lgspTypeNext)
                {
                    if((candidate_AandnotCorB_alt_0_A_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                    {
                        continue;
                    }
                    // Check whether there are subpattern matching tasks left to execute
                    if(openTasks.Count==0)
                    {
                        Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                        foundPartialMatches.Add(currentFoundPartialMatch);
                        Rule_AandnotCorB.Match_AandnotCorB_alt_0_A match = new Rule_AandnotCorB.Match_AandnotCorB_alt_0_A();
                        match._node__node0 = candidate_AandnotCorB_alt_0_A_node__node0;
                        currentFoundPartialMatch.Push(match);
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            openTasks.Push(this);
                            return;
                        }
                        continue;
                    }
                    uint prevGlobal__candidate_AandnotCorB_alt_0_A_node__node0;
                    prevGlobal__candidate_AandnotCorB_alt_0_A_node__node0 = candidate_AandnotCorB_alt_0_A_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    candidate_AandnotCorB_alt_0_A_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    // Match subpatterns 
                    openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                    // Check whether subpatterns were found 
                    if(matchesList.Count>0) {
                        // subpatterns/alternatives were found, extend the partial matches by our local match object
                        foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                        {
                            Rule_AandnotCorB.Match_AandnotCorB_alt_0_A match = new Rule_AandnotCorB.Match_AandnotCorB_alt_0_A();
                            match._node__node0 = candidate_AandnotCorB_alt_0_A_node__node0;
                            currentFoundPartialMatch.Push(match);
                        }
                        if(matchesList==foundPartialMatches) {
                            matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                        } else {
                            foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                foundPartialMatches.Add(match);
                            }
                            matchesList.Clear();
                        }
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            candidate_AandnotCorB_alt_0_A_node__node0.lgspFlags = candidate_AandnotCorB_alt_0_A_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AandnotCorB_alt_0_A_node__node0;
                            openTasks.Push(this);
                            return;
                        }
                        candidate_AandnotCorB_alt_0_A_node__node0.lgspFlags = candidate_AandnotCorB_alt_0_A_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AandnotCorB_alt_0_A_node__node0;
                        continue;
                    }
                    candidate_AandnotCorB_alt_0_A_node__node0.lgspFlags = candidate_AandnotCorB_alt_0_A_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AandnotCorB_alt_0_A_node__node0;
                }
label0: ;
            } while(false);
            if(matchesList.Count>0) {
                if(matchesList==foundPartialMatches) {
                    matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                } else {
                    foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                        foundPartialMatches.Add(match);
                    }
                    matchesList.Clear();
                }
            }
            // Alternative case AandnotCorB_alt_0_B 
            do {
                patternGraph = patternGraphs[(int)Rule_AandnotCorB.AandnotCorB_alt_0_CaseNums.@B];
                // Lookup AandnotCorB_alt_0_B_node__node0 
                int type_id_candidate_AandnotCorB_alt_0_B_node__node0 = 2;
                for(GRGEN_LGSP.LGSPNode head_candidate_AandnotCorB_alt_0_B_node__node0 = graph.nodesByTypeHeads[type_id_candidate_AandnotCorB_alt_0_B_node__node0], candidate_AandnotCorB_alt_0_B_node__node0 = head_candidate_AandnotCorB_alt_0_B_node__node0.lgspTypeNext; candidate_AandnotCorB_alt_0_B_node__node0 != head_candidate_AandnotCorB_alt_0_B_node__node0; candidate_AandnotCorB_alt_0_B_node__node0 = candidate_AandnotCorB_alt_0_B_node__node0.lgspTypeNext)
                {
                    if((candidate_AandnotCorB_alt_0_B_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                    {
                        continue;
                    }
                    // Check whether there are subpattern matching tasks left to execute
                    if(openTasks.Count==0)
                    {
                        Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                        foundPartialMatches.Add(currentFoundPartialMatch);
                        Rule_AandnotCorB.Match_AandnotCorB_alt_0_B match = new Rule_AandnotCorB.Match_AandnotCorB_alt_0_B();
                        match._node__node0 = candidate_AandnotCorB_alt_0_B_node__node0;
                        currentFoundPartialMatch.Push(match);
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            openTasks.Push(this);
                            return;
                        }
                        continue;
                    }
                    uint prevGlobal__candidate_AandnotCorB_alt_0_B_node__node0;
                    prevGlobal__candidate_AandnotCorB_alt_0_B_node__node0 = candidate_AandnotCorB_alt_0_B_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    candidate_AandnotCorB_alt_0_B_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    // Match subpatterns 
                    openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                    // Check whether subpatterns were found 
                    if(matchesList.Count>0) {
                        // subpatterns/alternatives were found, extend the partial matches by our local match object
                        foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                        {
                            Rule_AandnotCorB.Match_AandnotCorB_alt_0_B match = new Rule_AandnotCorB.Match_AandnotCorB_alt_0_B();
                            match._node__node0 = candidate_AandnotCorB_alt_0_B_node__node0;
                            currentFoundPartialMatch.Push(match);
                        }
                        if(matchesList==foundPartialMatches) {
                            matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                        } else {
                            foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                foundPartialMatches.Add(match);
                            }
                            matchesList.Clear();
                        }
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            candidate_AandnotCorB_alt_0_B_node__node0.lgspFlags = candidate_AandnotCorB_alt_0_B_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AandnotCorB_alt_0_B_node__node0;
                            openTasks.Push(this);
                            return;
                        }
                        candidate_AandnotCorB_alt_0_B_node__node0.lgspFlags = candidate_AandnotCorB_alt_0_B_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AandnotCorB_alt_0_B_node__node0;
                        continue;
                    }
                    candidate_AandnotCorB_alt_0_B_node__node0.lgspFlags = candidate_AandnotCorB_alt_0_B_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AandnotCorB_alt_0_B_node__node0;
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_AorBorC
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_AorBorC.IMatch_AorBorC> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_AorBorC.IMatch_AorBorC match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_AorBorC.IMatch_AorBorC> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_AorBorC : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_AorBorC
    {
        public Action_AorBorC()
            : base(Rule_AorBorC.Instance.patternGraph)
        {
            _rulePattern = Rule_AorBorC.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_AorBorC _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "AorBorC"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_AorBorC.Match_AorBorC, Rule_AorBorC.IMatch_AorBorC> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_AorBorC Instance { get { return instance; } set { instance = value; } }
        private static Action_AorBorC instance = new Action_AorBorC();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_AorBorC.IMatch_AorBorC> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_AorBorC.Match_AorBorC, Rule_AorBorC.IMatch_AorBorC>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks = new Stack<GRGEN_LGSP.LGSPSubpatternAction>();
            List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches = new List<Stack<GRGEN_LIBGR.IMatch>>();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            // Push alternative matching task for AorBorC_alt_0
            AlternativeAction_AorBorC_alt_0 taskFor_alt_0 = AlternativeAction_AorBorC_alt_0.getNewTask(actionEnv, openTasks, Rule_AorBorC.Instance.patternGraph.alternatives[(int)Rule_AorBorC.AorBorC_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0.searchPatternpath = false;
            taskFor_alt_0.matchOfNestingPattern = null;
            taskFor_alt_0.lastMatchAtPreviousNestingLevel = null;
            openTasks.Push(taskFor_alt_0);
            // Match subpatterns 
            openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
            // Pop alternative matching task for AorBorC_alt_0
            openTasks.Pop();
            AlternativeAction_AorBorC_alt_0.releaseTask(taskFor_alt_0);
            // Check whether subpatterns were found 
            if(matchesList.Count>0) {
                // subpatterns/alternatives were found, extend the partial matches by our local match object, becoming a complete match object and save it
                foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                {
                    Rule_AorBorC.Match_AorBorC match = matches.GetNextUnfilledPosition();
                    match._alt_0 = (Rule_AorBorC.IMatch_AorBorC_alt_0)currentFoundPartialMatch.Pop();
                    match._alt_0.SetMatchOfEnclosingPattern(match);
                    matches.PositionWasFilledFixIt();
                }
                matchesList.Clear();
                // if enough matches were found, we leave
                if(maxMatches > 0 && matches.Count >= maxMatches)
                {
                    return matches;
                }
                return matches;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_AorBorC.IMatch_AorBorC> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_AorBorC.IMatch_AorBorC> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_AorBorC.IMatch_AorBorC match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_AorBorC.IMatch_AorBorC> matches)
        {
            foreach(Rule_AorBorC.IMatch_AorBorC match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AorBorC.IMatch_AorBorC> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AorBorC.IMatch_AorBorC> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_AorBorC.IMatch_AorBorC match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AorBorC.IMatch_AorBorC> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AorBorC.IMatch_AorBorC> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AorBorC.IMatch_AorBorC> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_AorBorC.IMatch_AorBorC)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_AorBorC.IMatch_AorBorC>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    public class AlternativeAction_AorBorC_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_AorBorC_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_AorBorC_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_AorBorC_alt_0 newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_AorBorC_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_AorBorC_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_AorBorC_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_AorBorC_alt_0 next = null;

        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // Alternative case AorBorC_alt_0_A 
            do {
                patternGraph = patternGraphs[(int)Rule_AorBorC.AorBorC_alt_0_CaseNums.@A];
                // Lookup AorBorC_alt_0_A_node__node0 
                int type_id_candidate_AorBorC_alt_0_A_node__node0 = 1;
                for(GRGEN_LGSP.LGSPNode head_candidate_AorBorC_alt_0_A_node__node0 = graph.nodesByTypeHeads[type_id_candidate_AorBorC_alt_0_A_node__node0], candidate_AorBorC_alt_0_A_node__node0 = head_candidate_AorBorC_alt_0_A_node__node0.lgspTypeNext; candidate_AorBorC_alt_0_A_node__node0 != head_candidate_AorBorC_alt_0_A_node__node0; candidate_AorBorC_alt_0_A_node__node0 = candidate_AorBorC_alt_0_A_node__node0.lgspTypeNext)
                {
                    if((candidate_AorBorC_alt_0_A_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                    {
                        continue;
                    }
                    // Check whether there are subpattern matching tasks left to execute
                    if(openTasks.Count==0)
                    {
                        Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                        foundPartialMatches.Add(currentFoundPartialMatch);
                        Rule_AorBorC.Match_AorBorC_alt_0_A match = new Rule_AorBorC.Match_AorBorC_alt_0_A();
                        match._node__node0 = candidate_AorBorC_alt_0_A_node__node0;
                        currentFoundPartialMatch.Push(match);
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            openTasks.Push(this);
                            return;
                        }
                        continue;
                    }
                    uint prevGlobal__candidate_AorBorC_alt_0_A_node__node0;
                    prevGlobal__candidate_AorBorC_alt_0_A_node__node0 = candidate_AorBorC_alt_0_A_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    candidate_AorBorC_alt_0_A_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    // Match subpatterns 
                    openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                    // Check whether subpatterns were found 
                    if(matchesList.Count>0) {
                        // subpatterns/alternatives were found, extend the partial matches by our local match object
                        foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                        {
                            Rule_AorBorC.Match_AorBorC_alt_0_A match = new Rule_AorBorC.Match_AorBorC_alt_0_A();
                            match._node__node0 = candidate_AorBorC_alt_0_A_node__node0;
                            currentFoundPartialMatch.Push(match);
                        }
                        if(matchesList==foundPartialMatches) {
                            matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                        } else {
                            foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                foundPartialMatches.Add(match);
                            }
                            matchesList.Clear();
                        }
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            candidate_AorBorC_alt_0_A_node__node0.lgspFlags = candidate_AorBorC_alt_0_A_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AorBorC_alt_0_A_node__node0;
                            openTasks.Push(this);
                            return;
                        }
                        candidate_AorBorC_alt_0_A_node__node0.lgspFlags = candidate_AorBorC_alt_0_A_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AorBorC_alt_0_A_node__node0;
                        continue;
                    }
                    candidate_AorBorC_alt_0_A_node__node0.lgspFlags = candidate_AorBorC_alt_0_A_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AorBorC_alt_0_A_node__node0;
                }
            } while(false);
            if(matchesList.Count>0) {
                if(matchesList==foundPartialMatches) {
                    matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                } else {
                    foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                        foundPartialMatches.Add(match);
                    }
                    matchesList.Clear();
                }
            }
            // Alternative case AorBorC_alt_0_B 
            do {
                patternGraph = patternGraphs[(int)Rule_AorBorC.AorBorC_alt_0_CaseNums.@B];
                // Lookup AorBorC_alt_0_B_node__node0 
                int type_id_candidate_AorBorC_alt_0_B_node__node0 = 2;
                for(GRGEN_LGSP.LGSPNode head_candidate_AorBorC_alt_0_B_node__node0 = graph.nodesByTypeHeads[type_id_candidate_AorBorC_alt_0_B_node__node0], candidate_AorBorC_alt_0_B_node__node0 = head_candidate_AorBorC_alt_0_B_node__node0.lgspTypeNext; candidate_AorBorC_alt_0_B_node__node0 != head_candidate_AorBorC_alt_0_B_node__node0; candidate_AorBorC_alt_0_B_node__node0 = candidate_AorBorC_alt_0_B_node__node0.lgspTypeNext)
                {
                    if((candidate_AorBorC_alt_0_B_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                    {
                        continue;
                    }
                    // Check whether there are subpattern matching tasks left to execute
                    if(openTasks.Count==0)
                    {
                        Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                        foundPartialMatches.Add(currentFoundPartialMatch);
                        Rule_AorBorC.Match_AorBorC_alt_0_B match = new Rule_AorBorC.Match_AorBorC_alt_0_B();
                        match._node__node0 = candidate_AorBorC_alt_0_B_node__node0;
                        currentFoundPartialMatch.Push(match);
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            openTasks.Push(this);
                            return;
                        }
                        continue;
                    }
                    uint prevGlobal__candidate_AorBorC_alt_0_B_node__node0;
                    prevGlobal__candidate_AorBorC_alt_0_B_node__node0 = candidate_AorBorC_alt_0_B_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    candidate_AorBorC_alt_0_B_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    // Match subpatterns 
                    openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                    // Check whether subpatterns were found 
                    if(matchesList.Count>0) {
                        // subpatterns/alternatives were found, extend the partial matches by our local match object
                        foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                        {
                            Rule_AorBorC.Match_AorBorC_alt_0_B match = new Rule_AorBorC.Match_AorBorC_alt_0_B();
                            match._node__node0 = candidate_AorBorC_alt_0_B_node__node0;
                            currentFoundPartialMatch.Push(match);
                        }
                        if(matchesList==foundPartialMatches) {
                            matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                        } else {
                            foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                foundPartialMatches.Add(match);
                            }
                            matchesList.Clear();
                        }
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            candidate_AorBorC_alt_0_B_node__node0.lgspFlags = candidate_AorBorC_alt_0_B_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AorBorC_alt_0_B_node__node0;
                            openTasks.Push(this);
                            return;
                        }
                        candidate_AorBorC_alt_0_B_node__node0.lgspFlags = candidate_AorBorC_alt_0_B_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AorBorC_alt_0_B_node__node0;
                        continue;
                    }
                    candidate_AorBorC_alt_0_B_node__node0.lgspFlags = candidate_AorBorC_alt_0_B_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AorBorC_alt_0_B_node__node0;
                }
            } while(false);
            if(matchesList.Count>0) {
                if(matchesList==foundPartialMatches) {
                    matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                } else {
                    foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                        foundPartialMatches.Add(match);
                    }
                    matchesList.Clear();
                }
            }
            // Alternative case AorBorC_alt_0_C 
            do {
                patternGraph = patternGraphs[(int)Rule_AorBorC.AorBorC_alt_0_CaseNums.@C];
                // Lookup AorBorC_alt_0_C_node__node0 
                int type_id_candidate_AorBorC_alt_0_C_node__node0 = 3;
                for(GRGEN_LGSP.LGSPNode head_candidate_AorBorC_alt_0_C_node__node0 = graph.nodesByTypeHeads[type_id_candidate_AorBorC_alt_0_C_node__node0], candidate_AorBorC_alt_0_C_node__node0 = head_candidate_AorBorC_alt_0_C_node__node0.lgspTypeNext; candidate_AorBorC_alt_0_C_node__node0 != head_candidate_AorBorC_alt_0_C_node__node0; candidate_AorBorC_alt_0_C_node__node0 = candidate_AorBorC_alt_0_C_node__node0.lgspTypeNext)
                {
                    if((candidate_AorBorC_alt_0_C_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                    {
                        continue;
                    }
                    // Check whether there are subpattern matching tasks left to execute
                    if(openTasks.Count==0)
                    {
                        Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                        foundPartialMatches.Add(currentFoundPartialMatch);
                        Rule_AorBorC.Match_AorBorC_alt_0_C match = new Rule_AorBorC.Match_AorBorC_alt_0_C();
                        match._node__node0 = candidate_AorBorC_alt_0_C_node__node0;
                        currentFoundPartialMatch.Push(match);
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            openTasks.Push(this);
                            return;
                        }
                        continue;
                    }
                    uint prevGlobal__candidate_AorBorC_alt_0_C_node__node0;
                    prevGlobal__candidate_AorBorC_alt_0_C_node__node0 = candidate_AorBorC_alt_0_C_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    candidate_AorBorC_alt_0_C_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    // Match subpatterns 
                    openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                    // Check whether subpatterns were found 
                    if(matchesList.Count>0) {
                        // subpatterns/alternatives were found, extend the partial matches by our local match object
                        foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                        {
                            Rule_AorBorC.Match_AorBorC_alt_0_C match = new Rule_AorBorC.Match_AorBorC_alt_0_C();
                            match._node__node0 = candidate_AorBorC_alt_0_C_node__node0;
                            currentFoundPartialMatch.Push(match);
                        }
                        if(matchesList==foundPartialMatches) {
                            matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                        } else {
                            foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                foundPartialMatches.Add(match);
                            }
                            matchesList.Clear();
                        }
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            candidate_AorBorC_alt_0_C_node__node0.lgspFlags = candidate_AorBorC_alt_0_C_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AorBorC_alt_0_C_node__node0;
                            openTasks.Push(this);
                            return;
                        }
                        candidate_AorBorC_alt_0_C_node__node0.lgspFlags = candidate_AorBorC_alt_0_C_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AorBorC_alt_0_C_node__node0;
                        continue;
                    }
                    candidate_AorBorC_alt_0_C_node__node0.lgspFlags = candidate_AorBorC_alt_0_C_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AorBorC_alt_0_C_node__node0;
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_AtoAorB
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_AtoAorB.IMatch_AtoAorB> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_AtoAorB.IMatch_AtoAorB match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_AtoAorB.IMatch_AtoAorB> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_AtoAorB : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_AtoAorB
    {
        public Action_AtoAorB()
            : base(Rule_AtoAorB.Instance.patternGraph)
        {
            _rulePattern = Rule_AtoAorB.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_AtoAorB _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "AtoAorB"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_AtoAorB.Match_AtoAorB, Rule_AtoAorB.IMatch_AtoAorB> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_AtoAorB Instance { get { return instance; } set { instance = value; } }
        private static Action_AtoAorB instance = new Action_AtoAorB();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_AtoAorB.IMatch_AtoAorB> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_AtoAorB.Match_AtoAorB, Rule_AtoAorB.IMatch_AtoAorB>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks = new Stack<GRGEN_LGSP.LGSPSubpatternAction>();
            List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches = new List<Stack<GRGEN_LIBGR.IMatch>>();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            // Lookup AtoAorB_node_a 
            int type_id_candidate_AtoAorB_node_a = 1;
            for(GRGEN_LGSP.LGSPNode head_candidate_AtoAorB_node_a = graph.nodesByTypeHeads[type_id_candidate_AtoAorB_node_a], candidate_AtoAorB_node_a = head_candidate_AtoAorB_node_a.lgspTypeNext; candidate_AtoAorB_node_a != head_candidate_AtoAorB_node_a; candidate_AtoAorB_node_a = candidate_AtoAorB_node_a.lgspTypeNext)
            {
                // Push alternative matching task for AtoAorB_alt_0
                AlternativeAction_AtoAorB_alt_0 taskFor_alt_0 = AlternativeAction_AtoAorB_alt_0.getNewTask(actionEnv, openTasks, Rule_AtoAorB.Instance.patternGraph.alternatives[(int)Rule_AtoAorB.AtoAorB_AltNums.@alt_0].alternativeCases);
                taskFor_alt_0.AtoAorB_node_a = candidate_AtoAorB_node_a;
                taskFor_alt_0.searchPatternpath = false;
                taskFor_alt_0.matchOfNestingPattern = null;
                taskFor_alt_0.lastMatchAtPreviousNestingLevel = null;
                openTasks.Push(taskFor_alt_0);
                uint prevGlobal__candidate_AtoAorB_node_a;
                prevGlobal__candidate_AtoAorB_node_a = candidate_AtoAorB_node_a.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                candidate_AtoAorB_node_a.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                // Match subpatterns 
                openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                // Pop alternative matching task for AtoAorB_alt_0
                openTasks.Pop();
                AlternativeAction_AtoAorB_alt_0.releaseTask(taskFor_alt_0);
                // Check whether subpatterns were found 
                if(matchesList.Count>0) {
                    // subpatterns/alternatives were found, extend the partial matches by our local match object, becoming a complete match object and save it
                    foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                    {
                        Rule_AtoAorB.Match_AtoAorB match = matches.GetNextUnfilledPosition();
                        match._node_a = candidate_AtoAorB_node_a;
                        match._alt_0 = (Rule_AtoAorB.IMatch_AtoAorB_alt_0)currentFoundPartialMatch.Pop();
                        match._alt_0.SetMatchOfEnclosingPattern(match);
                        matches.PositionWasFilledFixIt();
                    }
                    matchesList.Clear();
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && matches.Count >= maxMatches)
                    {
                        candidate_AtoAorB_node_a.lgspFlags = candidate_AtoAorB_node_a.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AtoAorB_node_a;
                        return matches;
                    }
                    candidate_AtoAorB_node_a.lgspFlags = candidate_AtoAorB_node_a.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AtoAorB_node_a;
                    continue;
                }
                candidate_AtoAorB_node_a.lgspFlags = candidate_AtoAorB_node_a.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AtoAorB_node_a;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_AtoAorB.IMatch_AtoAorB> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_AtoAorB.IMatch_AtoAorB> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_AtoAorB.IMatch_AtoAorB match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_AtoAorB.IMatch_AtoAorB> matches)
        {
            foreach(Rule_AtoAorB.IMatch_AtoAorB match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AtoAorB.IMatch_AtoAorB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AtoAorB.IMatch_AtoAorB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_AtoAorB.IMatch_AtoAorB match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AtoAorB.IMatch_AtoAorB> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AtoAorB.IMatch_AtoAorB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_AtoAorB.IMatch_AtoAorB> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_AtoAorB.IMatch_AtoAorB)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_AtoAorB.IMatch_AtoAorB>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    public class AlternativeAction_AtoAorB_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_AtoAorB_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_AtoAorB_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_AtoAorB_alt_0 newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_AtoAorB_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_AtoAorB_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_AtoAorB_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_AtoAorB_alt_0 next = null;

        public GRGEN_LGSP.LGSPNode AtoAorB_node_a;
        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // Alternative case AtoAorB_alt_0_toA 
            do {
                patternGraph = patternGraphs[(int)Rule_AtoAorB.AtoAorB_alt_0_CaseNums.@toA];
                // SubPreset AtoAorB_node_a 
                GRGEN_LGSP.LGSPNode candidate_AtoAorB_node_a = AtoAorB_node_a;
                // Extend Outgoing AtoAorB_alt_0_toA_edge__edge0 from AtoAorB_node_a 
                GRGEN_LGSP.LGSPEdge head_candidate_AtoAorB_alt_0_toA_edge__edge0 = candidate_AtoAorB_node_a.lgspOuthead;
                if(head_candidate_AtoAorB_alt_0_toA_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_AtoAorB_alt_0_toA_edge__edge0 = head_candidate_AtoAorB_alt_0_toA_edge__edge0;
                    do
                    {
                        if(candidate_AtoAorB_alt_0_toA_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_AtoAorB_alt_0_toA_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Implicit Target AtoAorB_alt_0_toA_node__node0 from AtoAorB_alt_0_toA_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_AtoAorB_alt_0_toA_node__node0 = candidate_AtoAorB_alt_0_toA_edge__edge0.lgspTarget;
                        if(candidate_AtoAorB_alt_0_toA_node__node0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_AtoAorB_alt_0_toA_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            continue;
                        }
                        if((candidate_AtoAorB_alt_0_toA_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Check whether there are subpattern matching tasks left to execute
                        if(openTasks.Count==0)
                        {
                            Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                            foundPartialMatches.Add(currentFoundPartialMatch);
                            Rule_AtoAorB.Match_AtoAorB_alt_0_toA match = new Rule_AtoAorB.Match_AtoAorB_alt_0_toA();
                            match._node_a = candidate_AtoAorB_node_a;
                            match._node__node0 = candidate_AtoAorB_alt_0_toA_node__node0;
                            match._edge__edge0 = candidate_AtoAorB_alt_0_toA_edge__edge0;
                            currentFoundPartialMatch.Push(match);
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                            {
                                openTasks.Push(this);
                                return;
                            }
                            continue;
                        }
                        uint prevGlobal__candidate_AtoAorB_alt_0_toA_node__node0;
                        prevGlobal__candidate_AtoAorB_alt_0_toA_node__node0 = candidate_AtoAorB_alt_0_toA_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_AtoAorB_alt_0_toA_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_AtoAorB_alt_0_toA_edge__edge0;
                        prevGlobal__candidate_AtoAorB_alt_0_toA_edge__edge0 = candidate_AtoAorB_alt_0_toA_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_AtoAorB_alt_0_toA_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Check whether subpatterns were found 
                        if(matchesList.Count>0) {
                            // subpatterns/alternatives were found, extend the partial matches by our local match object
                            foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                            {
                                Rule_AtoAorB.Match_AtoAorB_alt_0_toA match = new Rule_AtoAorB.Match_AtoAorB_alt_0_toA();
                                match._node_a = candidate_AtoAorB_node_a;
                                match._node__node0 = candidate_AtoAorB_alt_0_toA_node__node0;
                                match._edge__edge0 = candidate_AtoAorB_alt_0_toA_edge__edge0;
                                currentFoundPartialMatch.Push(match);
                            }
                            if(matchesList==foundPartialMatches) {
                                matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                            } else {
                                foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                    foundPartialMatches.Add(match);
                                }
                                matchesList.Clear();
                            }
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                            {
                                candidate_AtoAorB_alt_0_toA_edge__edge0.lgspFlags = candidate_AtoAorB_alt_0_toA_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AtoAorB_alt_0_toA_edge__edge0;
                                candidate_AtoAorB_alt_0_toA_node__node0.lgspFlags = candidate_AtoAorB_alt_0_toA_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AtoAorB_alt_0_toA_node__node0;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_AtoAorB_alt_0_toA_edge__edge0.lgspFlags = candidate_AtoAorB_alt_0_toA_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AtoAorB_alt_0_toA_edge__edge0;
                            candidate_AtoAorB_alt_0_toA_node__node0.lgspFlags = candidate_AtoAorB_alt_0_toA_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AtoAorB_alt_0_toA_node__node0;
                            continue;
                        }
                        candidate_AtoAorB_alt_0_toA_node__node0.lgspFlags = candidate_AtoAorB_alt_0_toA_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AtoAorB_alt_0_toA_node__node0;
                        candidate_AtoAorB_alt_0_toA_edge__edge0.lgspFlags = candidate_AtoAorB_alt_0_toA_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AtoAorB_alt_0_toA_edge__edge0;
                    }
                    while( (candidate_AtoAorB_alt_0_toA_edge__edge0 = candidate_AtoAorB_alt_0_toA_edge__edge0.lgspOutNext) != head_candidate_AtoAorB_alt_0_toA_edge__edge0 );
                }
            } while(false);
            if(matchesList.Count>0) {
                if(matchesList==foundPartialMatches) {
                    matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                } else {
                    foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                        foundPartialMatches.Add(match);
                    }
                    matchesList.Clear();
                }
            }
            // Alternative case AtoAorB_alt_0_toB 
            do {
                patternGraph = patternGraphs[(int)Rule_AtoAorB.AtoAorB_alt_0_CaseNums.@toB];
                // SubPreset AtoAorB_node_a 
                GRGEN_LGSP.LGSPNode candidate_AtoAorB_node_a = AtoAorB_node_a;
                // Extend Outgoing AtoAorB_alt_0_toB_edge__edge0 from AtoAorB_node_a 
                GRGEN_LGSP.LGSPEdge head_candidate_AtoAorB_alt_0_toB_edge__edge0 = candidate_AtoAorB_node_a.lgspOuthead;
                if(head_candidate_AtoAorB_alt_0_toB_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_AtoAorB_alt_0_toB_edge__edge0 = head_candidate_AtoAorB_alt_0_toB_edge__edge0;
                    do
                    {
                        if(candidate_AtoAorB_alt_0_toB_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_AtoAorB_alt_0_toB_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Implicit Target AtoAorB_alt_0_toB_node__node0 from AtoAorB_alt_0_toB_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_AtoAorB_alt_0_toB_node__node0 = candidate_AtoAorB_alt_0_toB_edge__edge0.lgspTarget;
                        if(candidate_AtoAorB_alt_0_toB_node__node0.lgspType.TypeID!=2) {
                            continue;
                        }
                        if((candidate_AtoAorB_alt_0_toB_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Check whether there are subpattern matching tasks left to execute
                        if(openTasks.Count==0)
                        {
                            Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                            foundPartialMatches.Add(currentFoundPartialMatch);
                            Rule_AtoAorB.Match_AtoAorB_alt_0_toB match = new Rule_AtoAorB.Match_AtoAorB_alt_0_toB();
                            match._node_a = candidate_AtoAorB_node_a;
                            match._node__node0 = candidate_AtoAorB_alt_0_toB_node__node0;
                            match._edge__edge0 = candidate_AtoAorB_alt_0_toB_edge__edge0;
                            currentFoundPartialMatch.Push(match);
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                            {
                                openTasks.Push(this);
                                return;
                            }
                            continue;
                        }
                        uint prevGlobal__candidate_AtoAorB_alt_0_toB_node__node0;
                        prevGlobal__candidate_AtoAorB_alt_0_toB_node__node0 = candidate_AtoAorB_alt_0_toB_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_AtoAorB_alt_0_toB_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_AtoAorB_alt_0_toB_edge__edge0;
                        prevGlobal__candidate_AtoAorB_alt_0_toB_edge__edge0 = candidate_AtoAorB_alt_0_toB_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_AtoAorB_alt_0_toB_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Check whether subpatterns were found 
                        if(matchesList.Count>0) {
                            // subpatterns/alternatives were found, extend the partial matches by our local match object
                            foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                            {
                                Rule_AtoAorB.Match_AtoAorB_alt_0_toB match = new Rule_AtoAorB.Match_AtoAorB_alt_0_toB();
                                match._node_a = candidate_AtoAorB_node_a;
                                match._node__node0 = candidate_AtoAorB_alt_0_toB_node__node0;
                                match._edge__edge0 = candidate_AtoAorB_alt_0_toB_edge__edge0;
                                currentFoundPartialMatch.Push(match);
                            }
                            if(matchesList==foundPartialMatches) {
                                matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                            } else {
                                foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                    foundPartialMatches.Add(match);
                                }
                                matchesList.Clear();
                            }
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                            {
                                candidate_AtoAorB_alt_0_toB_edge__edge0.lgspFlags = candidate_AtoAorB_alt_0_toB_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AtoAorB_alt_0_toB_edge__edge0;
                                candidate_AtoAorB_alt_0_toB_node__node0.lgspFlags = candidate_AtoAorB_alt_0_toB_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AtoAorB_alt_0_toB_node__node0;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_AtoAorB_alt_0_toB_edge__edge0.lgspFlags = candidate_AtoAorB_alt_0_toB_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AtoAorB_alt_0_toB_edge__edge0;
                            candidate_AtoAorB_alt_0_toB_node__node0.lgspFlags = candidate_AtoAorB_alt_0_toB_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AtoAorB_alt_0_toB_node__node0;
                            continue;
                        }
                        candidate_AtoAorB_alt_0_toB_node__node0.lgspFlags = candidate_AtoAorB_alt_0_toB_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AtoAorB_alt_0_toB_node__node0;
                        candidate_AtoAorB_alt_0_toB_edge__edge0.lgspFlags = candidate_AtoAorB_alt_0_toB_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_AtoAorB_alt_0_toB_edge__edge0;
                    }
                    while( (candidate_AtoAorB_alt_0_toB_edge__edge0 = candidate_AtoAorB_alt_0_toB_edge__edge0.lgspOutNext) != head_candidate_AtoAorB_alt_0_toB_edge__edge0 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_createComplex
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_createComplex.IMatch_createComplex> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_createComplex.IMatch_createComplex match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createComplex.IMatch_createComplex> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_createComplex : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_createComplex
    {
        public Action_createComplex()
            : base(Rule_createComplex.Instance.patternGraph)
        {
            _rulePattern = Rule_createComplex.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_createComplex _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "createComplex"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_createComplex.Match_createComplex, Rule_createComplex.IMatch_createComplex> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_createComplex Instance { get { return instance; } set { instance = value; } }
        private static Action_createComplex instance = new Action_createComplex();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_createComplex.IMatch_createComplex> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_createComplex.Match_createComplex, Rule_createComplex.IMatch_createComplex>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            Rule_createComplex.Match_createComplex match = matches.GetNextUnfilledPosition();
            matches.PositionWasFilledFixIt();
            // if enough matches were found, we leave
            if(maxMatches > 0 && matches.Count >= maxMatches)
            {
                return matches;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_createComplex.IMatch_createComplex> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_createComplex.IMatch_createComplex> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_createComplex.IMatch_createComplex match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createComplex.IMatch_createComplex> matches)
        {
            foreach(Rule_createComplex.IMatch_createComplex match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createComplex.IMatch_createComplex> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createComplex.IMatch_createComplex> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_createComplex.IMatch_createComplex match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createComplex.IMatch_createComplex> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createComplex.IMatch_createComplex> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createComplex.IMatch_createComplex> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_createComplex.IMatch_createComplex)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_createComplex.IMatch_createComplex>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_Complex
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_Complex.IMatch_Complex> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_Complex.IMatch_Complex match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_Complex.IMatch_Complex> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_Complex : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_Complex
    {
        public Action_Complex()
            : base(Rule_Complex.Instance.patternGraph)
        {
            _rulePattern = Rule_Complex.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_Complex _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "Complex"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_Complex.Match_Complex, Rule_Complex.IMatch_Complex> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_Complex Instance { get { return instance; } set { instance = value; } }
        private static Action_Complex instance = new Action_Complex();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_Complex.IMatch_Complex> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_Complex.Match_Complex, Rule_Complex.IMatch_Complex>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks = new Stack<GRGEN_LGSP.LGSPSubpatternAction>();
            List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches = new List<Stack<GRGEN_LIBGR.IMatch>>();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            // Lookup Complex_edge__edge0 
            int type_id_candidate_Complex_edge__edge0 = 1;
            for(GRGEN_LGSP.LGSPEdge head_candidate_Complex_edge__edge0 = graph.edgesByTypeHeads[type_id_candidate_Complex_edge__edge0], candidate_Complex_edge__edge0 = head_candidate_Complex_edge__edge0.lgspTypeNext; candidate_Complex_edge__edge0 != head_candidate_Complex_edge__edge0; candidate_Complex_edge__edge0 = candidate_Complex_edge__edge0.lgspTypeNext)
            {
                uint prev__candidate_Complex_edge__edge0;
                prev__candidate_Complex_edge__edge0 = candidate_Complex_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                candidate_Complex_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                // Implicit Source Complex_node_a from Complex_edge__edge0 
                GRGEN_LGSP.LGSPNode candidate_Complex_node_a = candidate_Complex_edge__edge0.lgspSource;
                if(candidate_Complex_node_a.lgspType.TypeID!=1) {
                    candidate_Complex_edge__edge0.lgspFlags = candidate_Complex_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_edge__edge0;
                    continue;
                }
                // Implicit Target Complex_node_b from Complex_edge__edge0 
                GRGEN_LGSP.LGSPNode candidate_Complex_node_b = candidate_Complex_edge__edge0.lgspTarget;
                if(candidate_Complex_node_b.lgspType.TypeID!=2) {
                    candidate_Complex_edge__edge0.lgspFlags = candidate_Complex_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_edge__edge0;
                    continue;
                }
                // Extend Outgoing Complex_edge__edge1 from Complex_node_b 
                GRGEN_LGSP.LGSPEdge head_candidate_Complex_edge__edge1 = candidate_Complex_node_b.lgspOuthead;
                if(head_candidate_Complex_edge__edge1 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_Complex_edge__edge1 = head_candidate_Complex_edge__edge1;
                    do
                    {
                        if(candidate_Complex_edge__edge1.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_Complex_edge__edge1.lgspTarget != candidate_Complex_node_a) {
                            continue;
                        }
                        if((candidate_Complex_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            continue;
                        }
                        // Push alternative matching task for Complex_alt_0
                        AlternativeAction_Complex_alt_0 taskFor_alt_0 = AlternativeAction_Complex_alt_0.getNewTask(actionEnv, openTasks, Rule_Complex.Instance.patternGraph.alternatives[(int)Rule_Complex.Complex_AltNums.@alt_0].alternativeCases);
                        taskFor_alt_0.Complex_node_a = candidate_Complex_node_a;
                        taskFor_alt_0.Complex_node_b = candidate_Complex_node_b;
                        taskFor_alt_0.searchPatternpath = false;
                        taskFor_alt_0.matchOfNestingPattern = null;
                        taskFor_alt_0.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor_alt_0);
                        uint prevGlobal__candidate_Complex_node_a;
                        prevGlobal__candidate_Complex_node_a = candidate_Complex_node_a.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_Complex_node_a.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_Complex_node_b;
                        prevGlobal__candidate_Complex_node_b = candidate_Complex_node_b.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_Complex_node_b.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_Complex_edge__edge0;
                        prevGlobal__candidate_Complex_edge__edge0 = candidate_Complex_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_Complex_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_Complex_edge__edge1;
                        prevGlobal__candidate_Complex_edge__edge1 = candidate_Complex_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_Complex_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop alternative matching task for Complex_alt_0
                        openTasks.Pop();
                        AlternativeAction_Complex_alt_0.releaseTask(taskFor_alt_0);
                        // Check whether subpatterns were found 
                        if(matchesList.Count>0) {
                            // subpatterns/alternatives were found, extend the partial matches by our local match object, becoming a complete match object and save it
                            foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                            {
                                Rule_Complex.Match_Complex match = matches.GetNextUnfilledPosition();
                                match._node_a = candidate_Complex_node_a;
                                match._node_b = candidate_Complex_node_b;
                                match._edge__edge0 = candidate_Complex_edge__edge0;
                                match._edge__edge1 = candidate_Complex_edge__edge1;
                                match._alt_0 = (Rule_Complex.IMatch_Complex_alt_0)currentFoundPartialMatch.Pop();
                                match._alt_0.SetMatchOfEnclosingPattern(match);
                                matches.PositionWasFilledFixIt();
                            }
                            matchesList.Clear();
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && matches.Count >= maxMatches)
                            {
                                candidate_Complex_edge__edge1.lgspFlags = candidate_Complex_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_edge__edge1;
                                candidate_Complex_edge__edge0.lgspFlags = candidate_Complex_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_edge__edge0;
                                candidate_Complex_node_b.lgspFlags = candidate_Complex_node_b.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_node_b;
                                candidate_Complex_node_a.lgspFlags = candidate_Complex_node_a.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_node_a;
                                candidate_Complex_edge__edge0.lgspFlags = candidate_Complex_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_edge__edge0;
                                return matches;
                            }
                            candidate_Complex_edge__edge1.lgspFlags = candidate_Complex_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_edge__edge1;
                            candidate_Complex_edge__edge0.lgspFlags = candidate_Complex_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_edge__edge0;
                            candidate_Complex_node_b.lgspFlags = candidate_Complex_node_b.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_node_b;
                            candidate_Complex_node_a.lgspFlags = candidate_Complex_node_a.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_node_a;
                            continue;
                        }
                        candidate_Complex_node_a.lgspFlags = candidate_Complex_node_a.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_node_a;
                        candidate_Complex_node_b.lgspFlags = candidate_Complex_node_b.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_node_b;
                        candidate_Complex_edge__edge0.lgspFlags = candidate_Complex_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_edge__edge0;
                        candidate_Complex_edge__edge1.lgspFlags = candidate_Complex_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_edge__edge1;
                    }
                    while( (candidate_Complex_edge__edge1 = candidate_Complex_edge__edge1.lgspOutNext) != head_candidate_Complex_edge__edge1 );
                }
                candidate_Complex_edge__edge0.lgspFlags = candidate_Complex_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_edge__edge0;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_Complex.IMatch_Complex> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_Complex.IMatch_Complex> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_Complex.IMatch_Complex match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_Complex.IMatch_Complex> matches)
        {
            foreach(Rule_Complex.IMatch_Complex match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_Complex.IMatch_Complex> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_Complex.IMatch_Complex> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_Complex.IMatch_Complex match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_Complex.IMatch_Complex> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_Complex.IMatch_Complex> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_Complex.IMatch_Complex> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_Complex.IMatch_Complex)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_Complex.IMatch_Complex>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    public class AlternativeAction_Complex_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_Complex_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_Complex_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_Complex_alt_0 newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_Complex_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_Complex_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_Complex_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_Complex_alt_0 next = null;

        public GRGEN_LGSP.LGSPNode Complex_node_a;
        public GRGEN_LGSP.LGSPNode Complex_node_b;
        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // Alternative case Complex_alt_0_ExtendAv 
            do {
                patternGraph = patternGraphs[(int)Rule_Complex.Complex_alt_0_CaseNums.@ExtendAv];
                // SubPreset Complex_node_a 
                GRGEN_LGSP.LGSPNode candidate_Complex_node_a = Complex_node_a;
                // SubPreset Complex_node_b 
                GRGEN_LGSP.LGSPNode candidate_Complex_node_b = Complex_node_b;
                // Extend Outgoing Complex_alt_0_ExtendAv_edge__edge0 from Complex_node_a 
                GRGEN_LGSP.LGSPEdge head_candidate_Complex_alt_0_ExtendAv_edge__edge0 = candidate_Complex_node_a.lgspOuthead;
                if(head_candidate_Complex_alt_0_ExtendAv_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_Complex_alt_0_ExtendAv_edge__edge0 = head_candidate_Complex_alt_0_ExtendAv_edge__edge0;
                    do
                    {
                        if(candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        uint prev__candidate_Complex_alt_0_ExtendAv_edge__edge0;
                        prev__candidate_Complex_alt_0_ExtendAv_edge__edge0 = candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        // Implicit Target Complex_alt_0_ExtendAv_node_b2 from Complex_alt_0_ExtendAv_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_Complex_alt_0_ExtendAv_node_b2 = candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspTarget;
                        if(candidate_Complex_alt_0_ExtendAv_node_b2.lgspType.TypeID!=2) {
                            candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_edge__edge0;
                            continue;
                        }
                        if((candidate_Complex_alt_0_ExtendAv_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_edge__edge0;
                            continue;
                        }
                        if((candidate_Complex_alt_0_ExtendAv_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_edge__edge0;
                            continue;
                        }
                        // Extend Outgoing Complex_alt_0_ExtendAv_edge__edge2 from Complex_node_b 
                        GRGEN_LGSP.LGSPEdge head_candidate_Complex_alt_0_ExtendAv_edge__edge2 = candidate_Complex_node_b.lgspOuthead;
                        if(head_candidate_Complex_alt_0_ExtendAv_edge__edge2 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_Complex_alt_0_ExtendAv_edge__edge2 = head_candidate_Complex_alt_0_ExtendAv_edge__edge2;
                            do
                            {
                                if(candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspType.TypeID!=1) {
                                    continue;
                                }
                                if((candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    continue;
                                }
                                uint prev__candidate_Complex_alt_0_ExtendAv_edge__edge2;
                                prev__candidate_Complex_alt_0_ExtendAv_edge__edge2 = candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                // Implicit Target Complex_alt_0_ExtendAv_node__node0 from Complex_alt_0_ExtendAv_edge__edge2 
                                GRGEN_LGSP.LGSPNode candidate_Complex_alt_0_ExtendAv_node__node0 = candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspTarget;
                                if(candidate_Complex_alt_0_ExtendAv_node__node0.lgspType.TypeID!=3) {
                                    candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_edge__edge2;
                                    continue;
                                }
                                if((candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_edge__edge2;
                                    continue;
                                }
                                uint prev__candidate_Complex_alt_0_ExtendAv_node__node0;
                                prev__candidate_Complex_alt_0_ExtendAv_node__node0 = candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                // Extend Outgoing Complex_alt_0_ExtendAv_edge__edge1 from Complex_alt_0_ExtendAv_node_b2 
                                GRGEN_LGSP.LGSPEdge head_candidate_Complex_alt_0_ExtendAv_edge__edge1 = candidate_Complex_alt_0_ExtendAv_node_b2.lgspOuthead;
                                if(head_candidate_Complex_alt_0_ExtendAv_edge__edge1 != null)
                                {
                                    GRGEN_LGSP.LGSPEdge candidate_Complex_alt_0_ExtendAv_edge__edge1 = head_candidate_Complex_alt_0_ExtendAv_edge__edge1;
                                    do
                                    {
                                        if(candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspType.TypeID!=1) {
                                            continue;
                                        }
                                        if(candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspTarget != candidate_Complex_node_a) {
                                            continue;
                                        }
                                        if((candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                        {
                                            continue;
                                        }
                                        if((candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                        {
                                            continue;
                                        }
                                        uint prev__candidate_Complex_alt_0_ExtendAv_edge__edge1;
                                        prev__candidate_Complex_alt_0_ExtendAv_edge__edge1 = candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                        candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                        // Extend Outgoing Complex_alt_0_ExtendAv_edge__edge3 from Complex_alt_0_ExtendAv_node__node0 
                                        GRGEN_LGSP.LGSPEdge head_candidate_Complex_alt_0_ExtendAv_edge__edge3 = candidate_Complex_alt_0_ExtendAv_node__node0.lgspOuthead;
                                        if(head_candidate_Complex_alt_0_ExtendAv_edge__edge3 != null)
                                        {
                                            GRGEN_LGSP.LGSPEdge candidate_Complex_alt_0_ExtendAv_edge__edge3 = head_candidate_Complex_alt_0_ExtendAv_edge__edge3;
                                            do
                                            {
                                                if(candidate_Complex_alt_0_ExtendAv_edge__edge3.lgspType.TypeID!=1) {
                                                    continue;
                                                }
                                                if((candidate_Complex_alt_0_ExtendAv_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                                {
                                                    continue;
                                                }
                                                if((candidate_Complex_alt_0_ExtendAv_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                                {
                                                    continue;
                                                }
                                                // Implicit Target Complex_alt_0_ExtendAv_node__node1 from Complex_alt_0_ExtendAv_edge__edge3 
                                                GRGEN_LGSP.LGSPNode candidate_Complex_alt_0_ExtendAv_node__node1 = candidate_Complex_alt_0_ExtendAv_edge__edge3.lgspTarget;
                                                if(candidate_Complex_alt_0_ExtendAv_node__node1.lgspType.TypeID!=3) {
                                                    continue;
                                                }
                                                if((candidate_Complex_alt_0_ExtendAv_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                                {
                                                    continue;
                                                }
                                                if((candidate_Complex_alt_0_ExtendAv_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                                {
                                                    continue;
                                                }
                                                // Check whether there are subpattern matching tasks left to execute
                                                if(openTasks.Count==0)
                                                {
                                                    Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                                                    foundPartialMatches.Add(currentFoundPartialMatch);
                                                    Rule_Complex.Match_Complex_alt_0_ExtendAv match = new Rule_Complex.Match_Complex_alt_0_ExtendAv();
                                                    match._node_a = candidate_Complex_node_a;
                                                    match._node_b2 = candidate_Complex_alt_0_ExtendAv_node_b2;
                                                    match._node_b = candidate_Complex_node_b;
                                                    match._node__node0 = candidate_Complex_alt_0_ExtendAv_node__node0;
                                                    match._node__node1 = candidate_Complex_alt_0_ExtendAv_node__node1;
                                                    match._edge__edge0 = candidate_Complex_alt_0_ExtendAv_edge__edge0;
                                                    match._edge__edge1 = candidate_Complex_alt_0_ExtendAv_edge__edge1;
                                                    match._edge__edge2 = candidate_Complex_alt_0_ExtendAv_edge__edge2;
                                                    match._edge__edge3 = candidate_Complex_alt_0_ExtendAv_edge__edge3;
                                                    currentFoundPartialMatch.Push(match);
                                                    // if enough matches were found, we leave
                                                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                                    {
                                                        candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_edge__edge1;
                                                        candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_node__node0;
                                                        candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_edge__edge2;
                                                        candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_edge__edge0;
                                                        openTasks.Push(this);
                                                        return;
                                                    }
                                                    continue;
                                                }
                                                uint prevGlobal__candidate_Complex_alt_0_ExtendAv_node_b2;
                                                prevGlobal__candidate_Complex_alt_0_ExtendAv_node_b2 = candidate_Complex_alt_0_ExtendAv_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_Complex_alt_0_ExtendAv_node_b2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_Complex_alt_0_ExtendAv_node__node0;
                                                prevGlobal__candidate_Complex_alt_0_ExtendAv_node__node0 = candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_Complex_alt_0_ExtendAv_node__node1;
                                                prevGlobal__candidate_Complex_alt_0_ExtendAv_node__node1 = candidate_Complex_alt_0_ExtendAv_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_Complex_alt_0_ExtendAv_node__node1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge0;
                                                prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge0 = candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge1;
                                                prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge1 = candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge2;
                                                prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge2 = candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge3;
                                                prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge3 = candidate_Complex_alt_0_ExtendAv_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_Complex_alt_0_ExtendAv_edge__edge3.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                // Match subpatterns 
                                                openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                                                // Check whether subpatterns were found 
                                                if(matchesList.Count>0) {
                                                    // subpatterns/alternatives were found, extend the partial matches by our local match object
                                                    foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                                                    {
                                                        Rule_Complex.Match_Complex_alt_0_ExtendAv match = new Rule_Complex.Match_Complex_alt_0_ExtendAv();
                                                        match._node_a = candidate_Complex_node_a;
                                                        match._node_b2 = candidate_Complex_alt_0_ExtendAv_node_b2;
                                                        match._node_b = candidate_Complex_node_b;
                                                        match._node__node0 = candidate_Complex_alt_0_ExtendAv_node__node0;
                                                        match._node__node1 = candidate_Complex_alt_0_ExtendAv_node__node1;
                                                        match._edge__edge0 = candidate_Complex_alt_0_ExtendAv_edge__edge0;
                                                        match._edge__edge1 = candidate_Complex_alt_0_ExtendAv_edge__edge1;
                                                        match._edge__edge2 = candidate_Complex_alt_0_ExtendAv_edge__edge2;
                                                        match._edge__edge3 = candidate_Complex_alt_0_ExtendAv_edge__edge3;
                                                        currentFoundPartialMatch.Push(match);
                                                    }
                                                    if(matchesList==foundPartialMatches) {
                                                        matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                                                    } else {
                                                        foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                                            foundPartialMatches.Add(match);
                                                        }
                                                        matchesList.Clear();
                                                    }
                                                    // if enough matches were found, we leave
                                                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                                    {
                                                        candidate_Complex_alt_0_ExtendAv_edge__edge3.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge3;
                                                        candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge2;
                                                        candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge1;
                                                        candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge0;
                                                        candidate_Complex_alt_0_ExtendAv_node__node1.lgspFlags = candidate_Complex_alt_0_ExtendAv_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_node__node1;
                                                        candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_node__node0;
                                                        candidate_Complex_alt_0_ExtendAv_node_b2.lgspFlags = candidate_Complex_alt_0_ExtendAv_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_node_b2;
                                                        candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_edge__edge1;
                                                        candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_node__node0;
                                                        candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_edge__edge2;
                                                        candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_edge__edge0;
                                                        openTasks.Push(this);
                                                        return;
                                                    }
                                                    candidate_Complex_alt_0_ExtendAv_edge__edge3.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge3;
                                                    candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge2;
                                                    candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge1;
                                                    candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge0;
                                                    candidate_Complex_alt_0_ExtendAv_node__node1.lgspFlags = candidate_Complex_alt_0_ExtendAv_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_node__node1;
                                                    candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_node__node0;
                                                    candidate_Complex_alt_0_ExtendAv_node_b2.lgspFlags = candidate_Complex_alt_0_ExtendAv_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_node_b2;
                                                    continue;
                                                }
                                                candidate_Complex_alt_0_ExtendAv_node_b2.lgspFlags = candidate_Complex_alt_0_ExtendAv_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_node_b2;
                                                candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_node__node0;
                                                candidate_Complex_alt_0_ExtendAv_node__node1.lgspFlags = candidate_Complex_alt_0_ExtendAv_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_node__node1;
                                                candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge0;
                                                candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge1;
                                                candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge2;
                                                candidate_Complex_alt_0_ExtendAv_edge__edge3.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv_edge__edge3;
                                            }
                                            while( (candidate_Complex_alt_0_ExtendAv_edge__edge3 = candidate_Complex_alt_0_ExtendAv_edge__edge3.lgspOutNext) != head_candidate_Complex_alt_0_ExtendAv_edge__edge3 );
                                        }
                                        candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_edge__edge1;
                                    }
                                    while( (candidate_Complex_alt_0_ExtendAv_edge__edge1 = candidate_Complex_alt_0_ExtendAv_edge__edge1.lgspOutNext) != head_candidate_Complex_alt_0_ExtendAv_edge__edge1 );
                                }
                                candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendAv_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_node__node0;
                                candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_edge__edge2;
                            }
                            while( (candidate_Complex_alt_0_ExtendAv_edge__edge2 = candidate_Complex_alt_0_ExtendAv_edge__edge2.lgspOutNext) != head_candidate_Complex_alt_0_ExtendAv_edge__edge2 );
                        }
                        candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv_edge__edge0;
                    }
                    while( (candidate_Complex_alt_0_ExtendAv_edge__edge0 = candidate_Complex_alt_0_ExtendAv_edge__edge0.lgspOutNext) != head_candidate_Complex_alt_0_ExtendAv_edge__edge0 );
                }
            } while(false);
            if(matchesList.Count>0) {
                if(matchesList==foundPartialMatches) {
                    matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                } else {
                    foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                        foundPartialMatches.Add(match);
                    }
                    matchesList.Clear();
                }
            }
            // Alternative case Complex_alt_0_ExtendAv2 
            do {
                patternGraph = patternGraphs[(int)Rule_Complex.Complex_alt_0_CaseNums.@ExtendAv2];
                // SubPreset Complex_node_a 
                GRGEN_LGSP.LGSPNode candidate_Complex_node_a = Complex_node_a;
                // SubPreset Complex_node_b 
                GRGEN_LGSP.LGSPNode candidate_Complex_node_b = Complex_node_b;
                // Extend Outgoing Complex_alt_0_ExtendAv2_edge__edge0 from Complex_node_a 
                GRGEN_LGSP.LGSPEdge head_candidate_Complex_alt_0_ExtendAv2_edge__edge0 = candidate_Complex_node_a.lgspOuthead;
                if(head_candidate_Complex_alt_0_ExtendAv2_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_Complex_alt_0_ExtendAv2_edge__edge0 = head_candidate_Complex_alt_0_ExtendAv2_edge__edge0;
                    do
                    {
                        if(candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        uint prev__candidate_Complex_alt_0_ExtendAv2_edge__edge0;
                        prev__candidate_Complex_alt_0_ExtendAv2_edge__edge0 = candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        // Implicit Target Complex_alt_0_ExtendAv2_node_b2 from Complex_alt_0_ExtendAv2_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_Complex_alt_0_ExtendAv2_node_b2 = candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspTarget;
                        if(candidate_Complex_alt_0_ExtendAv2_node_b2.lgspType.TypeID!=2) {
                            candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge0;
                            continue;
                        }
                        if((candidate_Complex_alt_0_ExtendAv2_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge0;
                            continue;
                        }
                        if((candidate_Complex_alt_0_ExtendAv2_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge0;
                            continue;
                        }
                        // Extend Outgoing Complex_alt_0_ExtendAv2_edge__edge2 from Complex_node_b 
                        GRGEN_LGSP.LGSPEdge head_candidate_Complex_alt_0_ExtendAv2_edge__edge2 = candidate_Complex_node_b.lgspOuthead;
                        if(head_candidate_Complex_alt_0_ExtendAv2_edge__edge2 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_Complex_alt_0_ExtendAv2_edge__edge2 = head_candidate_Complex_alt_0_ExtendAv2_edge__edge2;
                            do
                            {
                                if(candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspType.TypeID!=1) {
                                    continue;
                                }
                                if((candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    continue;
                                }
                                uint prev__candidate_Complex_alt_0_ExtendAv2_edge__edge2;
                                prev__candidate_Complex_alt_0_ExtendAv2_edge__edge2 = candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                // Implicit Target Complex_alt_0_ExtendAv2_node__node0 from Complex_alt_0_ExtendAv2_edge__edge2 
                                GRGEN_LGSP.LGSPNode candidate_Complex_alt_0_ExtendAv2_node__node0 = candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspTarget;
                                if(candidate_Complex_alt_0_ExtendAv2_node__node0.lgspType.TypeID!=3) {
                                    candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge2;
                                    continue;
                                }
                                if((candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge2;
                                    continue;
                                }
                                uint prev__candidate_Complex_alt_0_ExtendAv2_node__node0;
                                prev__candidate_Complex_alt_0_ExtendAv2_node__node0 = candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                // Extend Outgoing Complex_alt_0_ExtendAv2_edge__edge1 from Complex_alt_0_ExtendAv2_node_b2 
                                GRGEN_LGSP.LGSPEdge head_candidate_Complex_alt_0_ExtendAv2_edge__edge1 = candidate_Complex_alt_0_ExtendAv2_node_b2.lgspOuthead;
                                if(head_candidate_Complex_alt_0_ExtendAv2_edge__edge1 != null)
                                {
                                    GRGEN_LGSP.LGSPEdge candidate_Complex_alt_0_ExtendAv2_edge__edge1 = head_candidate_Complex_alt_0_ExtendAv2_edge__edge1;
                                    do
                                    {
                                        if(candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspType.TypeID!=1) {
                                            continue;
                                        }
                                        if(candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspTarget != candidate_Complex_node_a) {
                                            continue;
                                        }
                                        if((candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                        {
                                            continue;
                                        }
                                        if((candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                        {
                                            continue;
                                        }
                                        uint prev__candidate_Complex_alt_0_ExtendAv2_edge__edge1;
                                        prev__candidate_Complex_alt_0_ExtendAv2_edge__edge1 = candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                        candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                        // Extend Outgoing Complex_alt_0_ExtendAv2_edge__edge3 from Complex_alt_0_ExtendAv2_node__node0 
                                        GRGEN_LGSP.LGSPEdge head_candidate_Complex_alt_0_ExtendAv2_edge__edge3 = candidate_Complex_alt_0_ExtendAv2_node__node0.lgspOuthead;
                                        if(head_candidate_Complex_alt_0_ExtendAv2_edge__edge3 != null)
                                        {
                                            GRGEN_LGSP.LGSPEdge candidate_Complex_alt_0_ExtendAv2_edge__edge3 = head_candidate_Complex_alt_0_ExtendAv2_edge__edge3;
                                            do
                                            {
                                                if(candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspType.TypeID!=1) {
                                                    continue;
                                                }
                                                if((candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                                {
                                                    continue;
                                                }
                                                if((candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                                {
                                                    continue;
                                                }
                                                uint prev__candidate_Complex_alt_0_ExtendAv2_edge__edge3;
                                                prev__candidate_Complex_alt_0_ExtendAv2_edge__edge3 = candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                                candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                                // Implicit Target Complex_alt_0_ExtendAv2_node__node1 from Complex_alt_0_ExtendAv2_edge__edge3 
                                                GRGEN_LGSP.LGSPNode candidate_Complex_alt_0_ExtendAv2_node__node1 = candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspTarget;
                                                if(candidate_Complex_alt_0_ExtendAv2_node__node1.lgspType.TypeID!=3) {
                                                    candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge3;
                                                    continue;
                                                }
                                                if((candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                                {
                                                    candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge3;
                                                    continue;
                                                }
                                                if((candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                                {
                                                    candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge3;
                                                    continue;
                                                }
                                                uint prev__candidate_Complex_alt_0_ExtendAv2_node__node1;
                                                prev__candidate_Complex_alt_0_ExtendAv2_node__node1 = candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                                candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                                // Extend Outgoing Complex_alt_0_ExtendAv2_edge__edge4 from Complex_alt_0_ExtendAv2_node__node1 
                                                GRGEN_LGSP.LGSPEdge head_candidate_Complex_alt_0_ExtendAv2_edge__edge4 = candidate_Complex_alt_0_ExtendAv2_node__node1.lgspOuthead;
                                                if(head_candidate_Complex_alt_0_ExtendAv2_edge__edge4 != null)
                                                {
                                                    GRGEN_LGSP.LGSPEdge candidate_Complex_alt_0_ExtendAv2_edge__edge4 = head_candidate_Complex_alt_0_ExtendAv2_edge__edge4;
                                                    do
                                                    {
                                                        if(candidate_Complex_alt_0_ExtendAv2_edge__edge4.lgspType.TypeID!=1) {
                                                            continue;
                                                        }
                                                        if((candidate_Complex_alt_0_ExtendAv2_edge__edge4.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                                        {
                                                            continue;
                                                        }
                                                        if((candidate_Complex_alt_0_ExtendAv2_edge__edge4.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                                        {
                                                            continue;
                                                        }
                                                        // Implicit Target Complex_alt_0_ExtendAv2_node__node2 from Complex_alt_0_ExtendAv2_edge__edge4 
                                                        GRGEN_LGSP.LGSPNode candidate_Complex_alt_0_ExtendAv2_node__node2 = candidate_Complex_alt_0_ExtendAv2_edge__edge4.lgspTarget;
                                                        if(candidate_Complex_alt_0_ExtendAv2_node__node2.lgspType.TypeID!=3) {
                                                            continue;
                                                        }
                                                        if((candidate_Complex_alt_0_ExtendAv2_node__node2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                                        {
                                                            continue;
                                                        }
                                                        if((candidate_Complex_alt_0_ExtendAv2_node__node2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                                        {
                                                            continue;
                                                        }
                                                        // Check whether there are subpattern matching tasks left to execute
                                                        if(openTasks.Count==0)
                                                        {
                                                            Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                                                            foundPartialMatches.Add(currentFoundPartialMatch);
                                                            Rule_Complex.Match_Complex_alt_0_ExtendAv2 match = new Rule_Complex.Match_Complex_alt_0_ExtendAv2();
                                                            match._node_a = candidate_Complex_node_a;
                                                            match._node_b2 = candidate_Complex_alt_0_ExtendAv2_node_b2;
                                                            match._node_b = candidate_Complex_node_b;
                                                            match._node__node0 = candidate_Complex_alt_0_ExtendAv2_node__node0;
                                                            match._node__node1 = candidate_Complex_alt_0_ExtendAv2_node__node1;
                                                            match._node__node2 = candidate_Complex_alt_0_ExtendAv2_node__node2;
                                                            match._edge__edge0 = candidate_Complex_alt_0_ExtendAv2_edge__edge0;
                                                            match._edge__edge1 = candidate_Complex_alt_0_ExtendAv2_edge__edge1;
                                                            match._edge__edge2 = candidate_Complex_alt_0_ExtendAv2_edge__edge2;
                                                            match._edge__edge3 = candidate_Complex_alt_0_ExtendAv2_edge__edge3;
                                                            match._edge__edge4 = candidate_Complex_alt_0_ExtendAv2_edge__edge4;
                                                            currentFoundPartialMatch.Push(match);
                                                            // if enough matches were found, we leave
                                                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                                            {
                                                                candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_node__node1;
                                                                candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge3;
                                                                candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge1;
                                                                candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_node__node0;
                                                                candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge2;
                                                                candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge0;
                                                                openTasks.Push(this);
                                                                return;
                                                            }
                                                            continue;
                                                        }
                                                        uint prevGlobal__candidate_Complex_alt_0_ExtendAv2_node_b2;
                                                        prevGlobal__candidate_Complex_alt_0_ExtendAv2_node_b2 = candidate_Complex_alt_0_ExtendAv2_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_Complex_alt_0_ExtendAv2_node_b2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        uint prevGlobal__candidate_Complex_alt_0_ExtendAv2_node__node0;
                                                        prevGlobal__candidate_Complex_alt_0_ExtendAv2_node__node0 = candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        uint prevGlobal__candidate_Complex_alt_0_ExtendAv2_node__node1;
                                                        prevGlobal__candidate_Complex_alt_0_ExtendAv2_node__node1 = candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        uint prevGlobal__candidate_Complex_alt_0_ExtendAv2_node__node2;
                                                        prevGlobal__candidate_Complex_alt_0_ExtendAv2_node__node2 = candidate_Complex_alt_0_ExtendAv2_node__node2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_Complex_alt_0_ExtendAv2_node__node2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        uint prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge0;
                                                        prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge0 = candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        uint prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge1;
                                                        prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge1 = candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        uint prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge2;
                                                        prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge2 = candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        uint prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge3;
                                                        prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge3 = candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        uint prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge4;
                                                        prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge4 = candidate_Complex_alt_0_ExtendAv2_edge__edge4.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_Complex_alt_0_ExtendAv2_edge__edge4.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        // Match subpatterns 
                                                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                                                        // Check whether subpatterns were found 
                                                        if(matchesList.Count>0) {
                                                            // subpatterns/alternatives were found, extend the partial matches by our local match object
                                                            foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                                                            {
                                                                Rule_Complex.Match_Complex_alt_0_ExtendAv2 match = new Rule_Complex.Match_Complex_alt_0_ExtendAv2();
                                                                match._node_a = candidate_Complex_node_a;
                                                                match._node_b2 = candidate_Complex_alt_0_ExtendAv2_node_b2;
                                                                match._node_b = candidate_Complex_node_b;
                                                                match._node__node0 = candidate_Complex_alt_0_ExtendAv2_node__node0;
                                                                match._node__node1 = candidate_Complex_alt_0_ExtendAv2_node__node1;
                                                                match._node__node2 = candidate_Complex_alt_0_ExtendAv2_node__node2;
                                                                match._edge__edge0 = candidate_Complex_alt_0_ExtendAv2_edge__edge0;
                                                                match._edge__edge1 = candidate_Complex_alt_0_ExtendAv2_edge__edge1;
                                                                match._edge__edge2 = candidate_Complex_alt_0_ExtendAv2_edge__edge2;
                                                                match._edge__edge3 = candidate_Complex_alt_0_ExtendAv2_edge__edge3;
                                                                match._edge__edge4 = candidate_Complex_alt_0_ExtendAv2_edge__edge4;
                                                                currentFoundPartialMatch.Push(match);
                                                            }
                                                            if(matchesList==foundPartialMatches) {
                                                                matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                                                            } else {
                                                                foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                                                    foundPartialMatches.Add(match);
                                                                }
                                                                matchesList.Clear();
                                                            }
                                                            // if enough matches were found, we leave
                                                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                                            {
                                                                candidate_Complex_alt_0_ExtendAv2_edge__edge4.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge4.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge4;
                                                                candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge3;
                                                                candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge2;
                                                                candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge1;
                                                                candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge0;
                                                                candidate_Complex_alt_0_ExtendAv2_node__node2.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node__node2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_node__node2;
                                                                candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_node__node1;
                                                                candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_node__node0;
                                                                candidate_Complex_alt_0_ExtendAv2_node_b2.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_node_b2;
                                                                candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_node__node1;
                                                                candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge3;
                                                                candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge1;
                                                                candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_node__node0;
                                                                candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge2;
                                                                candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge0;
                                                                openTasks.Push(this);
                                                                return;
                                                            }
                                                            candidate_Complex_alt_0_ExtendAv2_edge__edge4.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge4.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge4;
                                                            candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge3;
                                                            candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge2;
                                                            candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge1;
                                                            candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge0;
                                                            candidate_Complex_alt_0_ExtendAv2_node__node2.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node__node2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_node__node2;
                                                            candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_node__node1;
                                                            candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_node__node0;
                                                            candidate_Complex_alt_0_ExtendAv2_node_b2.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_node_b2;
                                                            continue;
                                                        }
                                                        candidate_Complex_alt_0_ExtendAv2_node_b2.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_node_b2;
                                                        candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_node__node0;
                                                        candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_node__node1;
                                                        candidate_Complex_alt_0_ExtendAv2_node__node2.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node__node2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_node__node2;
                                                        candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge0;
                                                        candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge1;
                                                        candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge2;
                                                        candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge3;
                                                        candidate_Complex_alt_0_ExtendAv2_edge__edge4.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge4.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendAv2_edge__edge4;
                                                    }
                                                    while( (candidate_Complex_alt_0_ExtendAv2_edge__edge4 = candidate_Complex_alt_0_ExtendAv2_edge__edge4.lgspOutNext) != head_candidate_Complex_alt_0_ExtendAv2_edge__edge4 );
                                                }
                                                candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_node__node1;
                                                candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge3;
                                            }
                                            while( (candidate_Complex_alt_0_ExtendAv2_edge__edge3 = candidate_Complex_alt_0_ExtendAv2_edge__edge3.lgspOutNext) != head_candidate_Complex_alt_0_ExtendAv2_edge__edge3 );
                                        }
                                        candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge1;
                                    }
                                    while( (candidate_Complex_alt_0_ExtendAv2_edge__edge1 = candidate_Complex_alt_0_ExtendAv2_edge__edge1.lgspOutNext) != head_candidate_Complex_alt_0_ExtendAv2_edge__edge1 );
                                }
                                candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendAv2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_node__node0;
                                candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge2;
                            }
                            while( (candidate_Complex_alt_0_ExtendAv2_edge__edge2 = candidate_Complex_alt_0_ExtendAv2_edge__edge2.lgspOutNext) != head_candidate_Complex_alt_0_ExtendAv2_edge__edge2 );
                        }
                        candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendAv2_edge__edge0;
                    }
                    while( (candidate_Complex_alt_0_ExtendAv2_edge__edge0 = candidate_Complex_alt_0_ExtendAv2_edge__edge0.lgspOutNext) != head_candidate_Complex_alt_0_ExtendAv2_edge__edge0 );
                }
            } while(false);
            if(matchesList.Count>0) {
                if(matchesList==foundPartialMatches) {
                    matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                } else {
                    foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                        foundPartialMatches.Add(match);
                    }
                    matchesList.Clear();
                }
            }
            // Alternative case Complex_alt_0_ExtendNA2 
            do {
                patternGraph = patternGraphs[(int)Rule_Complex.Complex_alt_0_CaseNums.@ExtendNA2];
                // SubPreset Complex_node_a 
                GRGEN_LGSP.LGSPNode candidate_Complex_node_a = Complex_node_a;
                // SubPreset Complex_node_b 
                GRGEN_LGSP.LGSPNode candidate_Complex_node_b = Complex_node_b;
                // Extend Outgoing Complex_alt_0_ExtendNA2_edge__edge0 from Complex_node_a 
                GRGEN_LGSP.LGSPEdge head_candidate_Complex_alt_0_ExtendNA2_edge__edge0 = candidate_Complex_node_a.lgspOuthead;
                if(head_candidate_Complex_alt_0_ExtendNA2_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_Complex_alt_0_ExtendNA2_edge__edge0 = head_candidate_Complex_alt_0_ExtendNA2_edge__edge0;
                    do
                    {
                        if(candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        uint prev__candidate_Complex_alt_0_ExtendNA2_edge__edge0;
                        prev__candidate_Complex_alt_0_ExtendNA2_edge__edge0 = candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        // Implicit Target Complex_alt_0_ExtendNA2_node__node0 from Complex_alt_0_ExtendNA2_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_Complex_alt_0_ExtendNA2_node__node0 = candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspTarget;
                        if(candidate_Complex_alt_0_ExtendNA2_node__node0.lgspType.TypeID!=3) {
                            candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge0;
                            continue;
                        }
                        if((candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge0;
                            continue;
                        }
                        uint prev__candidate_Complex_alt_0_ExtendNA2_node__node0;
                        prev__candidate_Complex_alt_0_ExtendNA2_node__node0 = candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        // Extend Outgoing Complex_alt_0_ExtendNA2_edge__edge2 from Complex_node_b 
                        GRGEN_LGSP.LGSPEdge head_candidate_Complex_alt_0_ExtendNA2_edge__edge2 = candidate_Complex_node_b.lgspOuthead;
                        if(head_candidate_Complex_alt_0_ExtendNA2_edge__edge2 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_Complex_alt_0_ExtendNA2_edge__edge2 = head_candidate_Complex_alt_0_ExtendNA2_edge__edge2;
                            do
                            {
                                if(candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspType.TypeID!=1) {
                                    continue;
                                }
                                if((candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    continue;
                                }
                                uint prev__candidate_Complex_alt_0_ExtendNA2_edge__edge2;
                                prev__candidate_Complex_alt_0_ExtendNA2_edge__edge2 = candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                // Implicit Target Complex_alt_0_ExtendNA2_node_b2 from Complex_alt_0_ExtendNA2_edge__edge2 
                                GRGEN_LGSP.LGSPNode candidate_Complex_alt_0_ExtendNA2_node_b2 = candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspTarget;
                                if(candidate_Complex_alt_0_ExtendNA2_node_b2.lgspType.TypeID!=2) {
                                    candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge2;
                                    continue;
                                }
                                if((candidate_Complex_alt_0_ExtendNA2_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge2;
                                    continue;
                                }
                                if((candidate_Complex_alt_0_ExtendNA2_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge2;
                                    continue;
                                }
                                // Extend Outgoing Complex_alt_0_ExtendNA2_edge__edge1 from Complex_alt_0_ExtendNA2_node__node0 
                                GRGEN_LGSP.LGSPEdge head_candidate_Complex_alt_0_ExtendNA2_edge__edge1 = candidate_Complex_alt_0_ExtendNA2_node__node0.lgspOuthead;
                                if(head_candidate_Complex_alt_0_ExtendNA2_edge__edge1 != null)
                                {
                                    GRGEN_LGSP.LGSPEdge candidate_Complex_alt_0_ExtendNA2_edge__edge1 = head_candidate_Complex_alt_0_ExtendNA2_edge__edge1;
                                    do
                                    {
                                        if(candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspType.TypeID!=1) {
                                            continue;
                                        }
                                        if((candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                        {
                                            continue;
                                        }
                                        if((candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                        {
                                            continue;
                                        }
                                        uint prev__candidate_Complex_alt_0_ExtendNA2_edge__edge1;
                                        prev__candidate_Complex_alt_0_ExtendNA2_edge__edge1 = candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                        candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                        // Implicit Target Complex_alt_0_ExtendNA2_node__node1 from Complex_alt_0_ExtendNA2_edge__edge1 
                                        GRGEN_LGSP.LGSPNode candidate_Complex_alt_0_ExtendNA2_node__node1 = candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspTarget;
                                        if(candidate_Complex_alt_0_ExtendNA2_node__node1.lgspType.TypeID!=3) {
                                            candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge1;
                                            continue;
                                        }
                                        if((candidate_Complex_alt_0_ExtendNA2_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                        {
                                            candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge1;
                                            continue;
                                        }
                                        if((candidate_Complex_alt_0_ExtendNA2_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                        {
                                            candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge1;
                                            continue;
                                        }
                                        // Extend Outgoing Complex_alt_0_ExtendNA2_edge__edge3 from Complex_alt_0_ExtendNA2_node_b2 
                                        GRGEN_LGSP.LGSPEdge head_candidate_Complex_alt_0_ExtendNA2_edge__edge3 = candidate_Complex_alt_0_ExtendNA2_node_b2.lgspOuthead;
                                        if(head_candidate_Complex_alt_0_ExtendNA2_edge__edge3 != null)
                                        {
                                            GRGEN_LGSP.LGSPEdge candidate_Complex_alt_0_ExtendNA2_edge__edge3 = head_candidate_Complex_alt_0_ExtendNA2_edge__edge3;
                                            do
                                            {
                                                if(candidate_Complex_alt_0_ExtendNA2_edge__edge3.lgspType.TypeID!=1) {
                                                    continue;
                                                }
                                                if(candidate_Complex_alt_0_ExtendNA2_edge__edge3.lgspTarget != candidate_Complex_node_b) {
                                                    continue;
                                                }
                                                if((candidate_Complex_alt_0_ExtendNA2_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                                {
                                                    continue;
                                                }
                                                if((candidate_Complex_alt_0_ExtendNA2_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                                {
                                                    continue;
                                                }
                                                // Check whether there are subpattern matching tasks left to execute
                                                if(openTasks.Count==0)
                                                {
                                                    Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                                                    foundPartialMatches.Add(currentFoundPartialMatch);
                                                    Rule_Complex.Match_Complex_alt_0_ExtendNA2 match = new Rule_Complex.Match_Complex_alt_0_ExtendNA2();
                                                    match._node_a = candidate_Complex_node_a;
                                                    match._node__node0 = candidate_Complex_alt_0_ExtendNA2_node__node0;
                                                    match._node__node1 = candidate_Complex_alt_0_ExtendNA2_node__node1;
                                                    match._node_b = candidate_Complex_node_b;
                                                    match._node_b2 = candidate_Complex_alt_0_ExtendNA2_node_b2;
                                                    match._edge__edge0 = candidate_Complex_alt_0_ExtendNA2_edge__edge0;
                                                    match._edge__edge1 = candidate_Complex_alt_0_ExtendNA2_edge__edge1;
                                                    match._edge__edge2 = candidate_Complex_alt_0_ExtendNA2_edge__edge2;
                                                    match._edge__edge3 = candidate_Complex_alt_0_ExtendNA2_edge__edge3;
                                                    currentFoundPartialMatch.Push(match);
                                                    // if enough matches were found, we leave
                                                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                                    {
                                                        candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge1;
                                                        candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge2;
                                                        candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_node__node0;
                                                        candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge0;
                                                        openTasks.Push(this);
                                                        return;
                                                    }
                                                    continue;
                                                }
                                                uint prevGlobal__candidate_Complex_alt_0_ExtendNA2_node__node0;
                                                prevGlobal__candidate_Complex_alt_0_ExtendNA2_node__node0 = candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_Complex_alt_0_ExtendNA2_node__node1;
                                                prevGlobal__candidate_Complex_alt_0_ExtendNA2_node__node1 = candidate_Complex_alt_0_ExtendNA2_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_Complex_alt_0_ExtendNA2_node__node1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_Complex_alt_0_ExtendNA2_node_b2;
                                                prevGlobal__candidate_Complex_alt_0_ExtendNA2_node_b2 = candidate_Complex_alt_0_ExtendNA2_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_Complex_alt_0_ExtendNA2_node_b2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge0;
                                                prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge0 = candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge1;
                                                prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge1 = candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge2;
                                                prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge2 = candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge3;
                                                prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge3 = candidate_Complex_alt_0_ExtendNA2_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_Complex_alt_0_ExtendNA2_edge__edge3.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                // Match subpatterns 
                                                openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                                                // Check whether subpatterns were found 
                                                if(matchesList.Count>0) {
                                                    // subpatterns/alternatives were found, extend the partial matches by our local match object
                                                    foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                                                    {
                                                        Rule_Complex.Match_Complex_alt_0_ExtendNA2 match = new Rule_Complex.Match_Complex_alt_0_ExtendNA2();
                                                        match._node_a = candidate_Complex_node_a;
                                                        match._node__node0 = candidate_Complex_alt_0_ExtendNA2_node__node0;
                                                        match._node__node1 = candidate_Complex_alt_0_ExtendNA2_node__node1;
                                                        match._node_b = candidate_Complex_node_b;
                                                        match._node_b2 = candidate_Complex_alt_0_ExtendNA2_node_b2;
                                                        match._edge__edge0 = candidate_Complex_alt_0_ExtendNA2_edge__edge0;
                                                        match._edge__edge1 = candidate_Complex_alt_0_ExtendNA2_edge__edge1;
                                                        match._edge__edge2 = candidate_Complex_alt_0_ExtendNA2_edge__edge2;
                                                        match._edge__edge3 = candidate_Complex_alt_0_ExtendNA2_edge__edge3;
                                                        currentFoundPartialMatch.Push(match);
                                                    }
                                                    if(matchesList==foundPartialMatches) {
                                                        matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                                                    } else {
                                                        foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                                            foundPartialMatches.Add(match);
                                                        }
                                                        matchesList.Clear();
                                                    }
                                                    // if enough matches were found, we leave
                                                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                                    {
                                                        candidate_Complex_alt_0_ExtendNA2_edge__edge3.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge3;
                                                        candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge2;
                                                        candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge1;
                                                        candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge0;
                                                        candidate_Complex_alt_0_ExtendNA2_node_b2.lgspFlags = candidate_Complex_alt_0_ExtendNA2_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_node_b2;
                                                        candidate_Complex_alt_0_ExtendNA2_node__node1.lgspFlags = candidate_Complex_alt_0_ExtendNA2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_node__node1;
                                                        candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_node__node0;
                                                        candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge1;
                                                        candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge2;
                                                        candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_node__node0;
                                                        candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge0;
                                                        openTasks.Push(this);
                                                        return;
                                                    }
                                                    candidate_Complex_alt_0_ExtendNA2_edge__edge3.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge3;
                                                    candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge2;
                                                    candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge1;
                                                    candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge0;
                                                    candidate_Complex_alt_0_ExtendNA2_node_b2.lgspFlags = candidate_Complex_alt_0_ExtendNA2_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_node_b2;
                                                    candidate_Complex_alt_0_ExtendNA2_node__node1.lgspFlags = candidate_Complex_alt_0_ExtendNA2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_node__node1;
                                                    candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_node__node0;
                                                    continue;
                                                }
                                                candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_node__node0;
                                                candidate_Complex_alt_0_ExtendNA2_node__node1.lgspFlags = candidate_Complex_alt_0_ExtendNA2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_node__node1;
                                                candidate_Complex_alt_0_ExtendNA2_node_b2.lgspFlags = candidate_Complex_alt_0_ExtendNA2_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_node_b2;
                                                candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge0;
                                                candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge1;
                                                candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge2;
                                                candidate_Complex_alt_0_ExtendNA2_edge__edge3.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Complex_alt_0_ExtendNA2_edge__edge3;
                                            }
                                            while( (candidate_Complex_alt_0_ExtendNA2_edge__edge3 = candidate_Complex_alt_0_ExtendNA2_edge__edge3.lgspOutNext) != head_candidate_Complex_alt_0_ExtendNA2_edge__edge3 );
                                        }
                                        candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge1;
                                    }
                                    while( (candidate_Complex_alt_0_ExtendNA2_edge__edge1 = candidate_Complex_alt_0_ExtendNA2_edge__edge1.lgspOutNext) != head_candidate_Complex_alt_0_ExtendNA2_edge__edge1 );
                                }
                                candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge2;
                            }
                            while( (candidate_Complex_alt_0_ExtendNA2_edge__edge2 = candidate_Complex_alt_0_ExtendNA2_edge__edge2.lgspOutNext) != head_candidate_Complex_alt_0_ExtendNA2_edge__edge2 );
                        }
                        candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags = candidate_Complex_alt_0_ExtendNA2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_node__node0;
                        candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags = candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_Complex_alt_0_ExtendNA2_edge__edge0;
                    }
                    while( (candidate_Complex_alt_0_ExtendNA2_edge__edge0 = candidate_Complex_alt_0_ExtendNA2_edge__edge0.lgspOutNext) != head_candidate_Complex_alt_0_ExtendNA2_edge__edge0 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_ComplexMax
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_ComplexMax.IMatch_ComplexMax> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_ComplexMax.IMatch_ComplexMax match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_ComplexMax.IMatch_ComplexMax> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_ComplexMax : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_ComplexMax
    {
        public Action_ComplexMax()
            : base(Rule_ComplexMax.Instance.patternGraph)
        {
            _rulePattern = Rule_ComplexMax.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_ComplexMax _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "ComplexMax"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_ComplexMax.Match_ComplexMax, Rule_ComplexMax.IMatch_ComplexMax> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_ComplexMax Instance { get { return instance; } set { instance = value; } }
        private static Action_ComplexMax instance = new Action_ComplexMax();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_ComplexMax.IMatch_ComplexMax> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_ComplexMax.Match_ComplexMax, Rule_ComplexMax.IMatch_ComplexMax>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks = new Stack<GRGEN_LGSP.LGSPSubpatternAction>();
            List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches = new List<Stack<GRGEN_LIBGR.IMatch>>();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            // Lookup ComplexMax_edge__edge0 
            int type_id_candidate_ComplexMax_edge__edge0 = 1;
            for(GRGEN_LGSP.LGSPEdge head_candidate_ComplexMax_edge__edge0 = graph.edgesByTypeHeads[type_id_candidate_ComplexMax_edge__edge0], candidate_ComplexMax_edge__edge0 = head_candidate_ComplexMax_edge__edge0.lgspTypeNext; candidate_ComplexMax_edge__edge0 != head_candidate_ComplexMax_edge__edge0; candidate_ComplexMax_edge__edge0 = candidate_ComplexMax_edge__edge0.lgspTypeNext)
            {
                uint prev__candidate_ComplexMax_edge__edge0;
                prev__candidate_ComplexMax_edge__edge0 = candidate_ComplexMax_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                candidate_ComplexMax_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                // Implicit Source ComplexMax_node_a from ComplexMax_edge__edge0 
                GRGEN_LGSP.LGSPNode candidate_ComplexMax_node_a = candidate_ComplexMax_edge__edge0.lgspSource;
                if(candidate_ComplexMax_node_a.lgspType.TypeID!=1) {
                    candidate_ComplexMax_edge__edge0.lgspFlags = candidate_ComplexMax_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_edge__edge0;
                    continue;
                }
                // Implicit Target ComplexMax_node_b from ComplexMax_edge__edge0 
                GRGEN_LGSP.LGSPNode candidate_ComplexMax_node_b = candidate_ComplexMax_edge__edge0.lgspTarget;
                if(candidate_ComplexMax_node_b.lgspType.TypeID!=2) {
                    candidate_ComplexMax_edge__edge0.lgspFlags = candidate_ComplexMax_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_edge__edge0;
                    continue;
                }
                // Extend Outgoing ComplexMax_edge__edge1 from ComplexMax_node_b 
                GRGEN_LGSP.LGSPEdge head_candidate_ComplexMax_edge__edge1 = candidate_ComplexMax_node_b.lgspOuthead;
                if(head_candidate_ComplexMax_edge__edge1 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ComplexMax_edge__edge1 = head_candidate_ComplexMax_edge__edge1;
                    do
                    {
                        if(candidate_ComplexMax_edge__edge1.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_ComplexMax_edge__edge1.lgspTarget != candidate_ComplexMax_node_a) {
                            continue;
                        }
                        if((candidate_ComplexMax_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            continue;
                        }
                        // Push alternative matching task for ComplexMax_alt_0
                        AlternativeAction_ComplexMax_alt_0 taskFor_alt_0 = AlternativeAction_ComplexMax_alt_0.getNewTask(actionEnv, openTasks, Rule_ComplexMax.Instance.patternGraph.alternatives[(int)Rule_ComplexMax.ComplexMax_AltNums.@alt_0].alternativeCases);
                        taskFor_alt_0.ComplexMax_node_a = candidate_ComplexMax_node_a;
                        taskFor_alt_0.ComplexMax_node_b = candidate_ComplexMax_node_b;
                        taskFor_alt_0.searchPatternpath = false;
                        taskFor_alt_0.matchOfNestingPattern = null;
                        taskFor_alt_0.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor_alt_0);
                        uint prevGlobal__candidate_ComplexMax_node_a;
                        prevGlobal__candidate_ComplexMax_node_a = candidate_ComplexMax_node_a.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ComplexMax_node_a.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ComplexMax_node_b;
                        prevGlobal__candidate_ComplexMax_node_b = candidate_ComplexMax_node_b.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ComplexMax_node_b.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ComplexMax_edge__edge0;
                        prevGlobal__candidate_ComplexMax_edge__edge0 = candidate_ComplexMax_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ComplexMax_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ComplexMax_edge__edge1;
                        prevGlobal__candidate_ComplexMax_edge__edge1 = candidate_ComplexMax_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ComplexMax_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop alternative matching task for ComplexMax_alt_0
                        openTasks.Pop();
                        AlternativeAction_ComplexMax_alt_0.releaseTask(taskFor_alt_0);
                        // Check whether subpatterns were found 
                        if(matchesList.Count>0) {
                            // subpatterns/alternatives were found, extend the partial matches by our local match object, becoming a complete match object and save it
                            foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                            {
                                Rule_ComplexMax.Match_ComplexMax match = matches.GetNextUnfilledPosition();
                                match._node_a = candidate_ComplexMax_node_a;
                                match._node_b = candidate_ComplexMax_node_b;
                                match._edge__edge0 = candidate_ComplexMax_edge__edge0;
                                match._edge__edge1 = candidate_ComplexMax_edge__edge1;
                                match._alt_0 = (Rule_ComplexMax.IMatch_ComplexMax_alt_0)currentFoundPartialMatch.Pop();
                                match._alt_0.SetMatchOfEnclosingPattern(match);
                                matches.PositionWasFilledFixIt();
                            }
                            matchesList.Clear();
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && matches.Count >= maxMatches)
                            {
                                candidate_ComplexMax_edge__edge1.lgspFlags = candidate_ComplexMax_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_edge__edge1;
                                candidate_ComplexMax_edge__edge0.lgspFlags = candidate_ComplexMax_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_edge__edge0;
                                candidate_ComplexMax_node_b.lgspFlags = candidate_ComplexMax_node_b.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_node_b;
                                candidate_ComplexMax_node_a.lgspFlags = candidate_ComplexMax_node_a.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_node_a;
                                candidate_ComplexMax_edge__edge0.lgspFlags = candidate_ComplexMax_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_edge__edge0;
                                return matches;
                            }
                            candidate_ComplexMax_edge__edge1.lgspFlags = candidate_ComplexMax_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_edge__edge1;
                            candidate_ComplexMax_edge__edge0.lgspFlags = candidate_ComplexMax_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_edge__edge0;
                            candidate_ComplexMax_node_b.lgspFlags = candidate_ComplexMax_node_b.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_node_b;
                            candidate_ComplexMax_node_a.lgspFlags = candidate_ComplexMax_node_a.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_node_a;
                            continue;
                        }
                        candidate_ComplexMax_node_a.lgspFlags = candidate_ComplexMax_node_a.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_node_a;
                        candidate_ComplexMax_node_b.lgspFlags = candidate_ComplexMax_node_b.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_node_b;
                        candidate_ComplexMax_edge__edge0.lgspFlags = candidate_ComplexMax_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_edge__edge0;
                        candidate_ComplexMax_edge__edge1.lgspFlags = candidate_ComplexMax_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_edge__edge1;
                    }
                    while( (candidate_ComplexMax_edge__edge1 = candidate_ComplexMax_edge__edge1.lgspOutNext) != head_candidate_ComplexMax_edge__edge1 );
                }
                candidate_ComplexMax_edge__edge0.lgspFlags = candidate_ComplexMax_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_edge__edge0;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_ComplexMax.IMatch_ComplexMax> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_ComplexMax.IMatch_ComplexMax> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_ComplexMax.IMatch_ComplexMax match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_ComplexMax.IMatch_ComplexMax> matches)
        {
            foreach(Rule_ComplexMax.IMatch_ComplexMax match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_ComplexMax.IMatch_ComplexMax> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_ComplexMax.IMatch_ComplexMax> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_ComplexMax.IMatch_ComplexMax match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_ComplexMax.IMatch_ComplexMax> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_ComplexMax.IMatch_ComplexMax> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_ComplexMax.IMatch_ComplexMax> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_ComplexMax.IMatch_ComplexMax)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_ComplexMax.IMatch_ComplexMax>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    public class AlternativeAction_ComplexMax_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ComplexMax_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ComplexMax_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ComplexMax_alt_0 newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_ComplexMax_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ComplexMax_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ComplexMax_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ComplexMax_alt_0 next = null;

        public GRGEN_LGSP.LGSPNode ComplexMax_node_a;
        public GRGEN_LGSP.LGSPNode ComplexMax_node_b;
        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // Alternative case ComplexMax_alt_0_ExtendAv 
            do {
                patternGraph = patternGraphs[(int)Rule_ComplexMax.ComplexMax_alt_0_CaseNums.@ExtendAv];
                // SubPreset ComplexMax_node_a 
                GRGEN_LGSP.LGSPNode candidate_ComplexMax_node_a = ComplexMax_node_a;
                // SubPreset ComplexMax_node_b 
                GRGEN_LGSP.LGSPNode candidate_ComplexMax_node_b = ComplexMax_node_b;
                // Extend Outgoing ComplexMax_alt_0_ExtendAv_edge__edge0 from ComplexMax_node_a 
                GRGEN_LGSP.LGSPEdge head_candidate_ComplexMax_alt_0_ExtendAv_edge__edge0 = candidate_ComplexMax_node_a.lgspOuthead;
                if(head_candidate_ComplexMax_alt_0_ExtendAv_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ComplexMax_alt_0_ExtendAv_edge__edge0 = head_candidate_ComplexMax_alt_0_ExtendAv_edge__edge0;
                    do
                    {
                        if(candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        uint prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge0;
                        prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge0 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        // Implicit Target ComplexMax_alt_0_ExtendAv_node_b2 from ComplexMax_alt_0_ExtendAv_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_ComplexMax_alt_0_ExtendAv_node_b2 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspTarget;
                        if(candidate_ComplexMax_alt_0_ExtendAv_node_b2.lgspType.TypeID!=2) {
                            candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge0;
                            continue;
                        }
                        if((candidate_ComplexMax_alt_0_ExtendAv_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge0;
                            continue;
                        }
                        if((candidate_ComplexMax_alt_0_ExtendAv_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge0;
                            continue;
                        }
                        // Extend Outgoing ComplexMax_alt_0_ExtendAv_edge__edge2 from ComplexMax_node_b 
                        GRGEN_LGSP.LGSPEdge head_candidate_ComplexMax_alt_0_ExtendAv_edge__edge2 = candidate_ComplexMax_node_b.lgspOuthead;
                        if(head_candidate_ComplexMax_alt_0_ExtendAv_edge__edge2 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_ComplexMax_alt_0_ExtendAv_edge__edge2 = head_candidate_ComplexMax_alt_0_ExtendAv_edge__edge2;
                            do
                            {
                                if(candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspType.TypeID!=1) {
                                    continue;
                                }
                                if((candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    continue;
                                }
                                uint prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge2;
                                prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge2 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                // Implicit Target ComplexMax_alt_0_ExtendAv_node__node0 from ComplexMax_alt_0_ExtendAv_edge__edge2 
                                GRGEN_LGSP.LGSPNode candidate_ComplexMax_alt_0_ExtendAv_node__node0 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspTarget;
                                if(candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspType.TypeID!=3) {
                                    candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge2;
                                    continue;
                                }
                                if((candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge2;
                                    continue;
                                }
                                uint prev__candidate_ComplexMax_alt_0_ExtendAv_node__node0;
                                prev__candidate_ComplexMax_alt_0_ExtendAv_node__node0 = candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                // Extend Outgoing ComplexMax_alt_0_ExtendAv_edge__edge1 from ComplexMax_alt_0_ExtendAv_node_b2 
                                GRGEN_LGSP.LGSPEdge head_candidate_ComplexMax_alt_0_ExtendAv_edge__edge1 = candidate_ComplexMax_alt_0_ExtendAv_node_b2.lgspOuthead;
                                if(head_candidate_ComplexMax_alt_0_ExtendAv_edge__edge1 != null)
                                {
                                    GRGEN_LGSP.LGSPEdge candidate_ComplexMax_alt_0_ExtendAv_edge__edge1 = head_candidate_ComplexMax_alt_0_ExtendAv_edge__edge1;
                                    do
                                    {
                                        if(candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspType.TypeID!=1) {
                                            continue;
                                        }
                                        if(candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspTarget != candidate_ComplexMax_node_a) {
                                            continue;
                                        }
                                        if((candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                        {
                                            continue;
                                        }
                                        if((candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                        {
                                            continue;
                                        }
                                        uint prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge1;
                                        prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge1 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                        candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                        // Extend Outgoing ComplexMax_alt_0_ExtendAv_edge__edge3 from ComplexMax_alt_0_ExtendAv_node__node0 
                                        GRGEN_LGSP.LGSPEdge head_candidate_ComplexMax_alt_0_ExtendAv_edge__edge3 = candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspOuthead;
                                        if(head_candidate_ComplexMax_alt_0_ExtendAv_edge__edge3 != null)
                                        {
                                            GRGEN_LGSP.LGSPEdge candidate_ComplexMax_alt_0_ExtendAv_edge__edge3 = head_candidate_ComplexMax_alt_0_ExtendAv_edge__edge3;
                                            do
                                            {
                                                if(candidate_ComplexMax_alt_0_ExtendAv_edge__edge3.lgspType.TypeID!=1) {
                                                    continue;
                                                }
                                                if((candidate_ComplexMax_alt_0_ExtendAv_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                                {
                                                    continue;
                                                }
                                                if((candidate_ComplexMax_alt_0_ExtendAv_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                                {
                                                    continue;
                                                }
                                                // Implicit Target ComplexMax_alt_0_ExtendAv_node_c from ComplexMax_alt_0_ExtendAv_edge__edge3 
                                                GRGEN_LGSP.LGSPNode candidate_ComplexMax_alt_0_ExtendAv_node_c = candidate_ComplexMax_alt_0_ExtendAv_edge__edge3.lgspTarget;
                                                if(candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspType.TypeID!=3) {
                                                    continue;
                                                }
                                                if((candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                                {
                                                    continue;
                                                }
                                                if((candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                                {
                                                    continue;
                                                }
                                                // NegativePattern 
                                                {
                                                    ++isoSpace;
                                                    uint prev_neg_0__candidate_ComplexMax_alt_0_ExtendAv_node_c;
                                                    prev_neg_0__candidate_ComplexMax_alt_0_ExtendAv_node_c = candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                                    candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                                    // Extend Outgoing ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0 from ComplexMax_alt_0_ExtendAv_node_c 
                                                    GRGEN_LGSP.LGSPEdge head_candidate_ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0 = candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspOuthead;
                                                    if(head_candidate_ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0 != null)
                                                    {
                                                        GRGEN_LGSP.LGSPEdge candidate_ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0 = head_candidate_ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0;
                                                        do
                                                        {
                                                            if(candidate_ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0.lgspType.TypeID!=1) {
                                                                continue;
                                                            }
                                                            if((candidate_ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                                            {
                                                                continue;
                                                            }
                                                            // Implicit Target ComplexMax_alt_0_ExtendAv_neg_0_node__node0 from ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0 
                                                            GRGEN_LGSP.LGSPNode candidate_ComplexMax_alt_0_ExtendAv_neg_0_node__node0 = candidate_ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0.lgspTarget;
                                                            if(candidate_ComplexMax_alt_0_ExtendAv_neg_0_node__node0.lgspType.TypeID!=3) {
                                                                continue;
                                                            }
                                                            if((candidate_ComplexMax_alt_0_ExtendAv_neg_0_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                                            {
                                                                continue;
                                                            }
                                                            if((candidate_ComplexMax_alt_0_ExtendAv_neg_0_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                                            {
                                                                continue;
                                                            }
                                                            // negative pattern found
                                                            candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0__candidate_ComplexMax_alt_0_ExtendAv_node_c;
                                                            --isoSpace;
                                                            goto label1;
                                                        }
                                                        while( (candidate_ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0 = candidate_ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0.lgspOutNext) != head_candidate_ComplexMax_alt_0_ExtendAv_neg_0_edge__edge0 );
                                                    }
                                                    candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0__candidate_ComplexMax_alt_0_ExtendAv_node_c;
                                                    --isoSpace;
                                                }
                                                // Check whether there are subpattern matching tasks left to execute
                                                if(openTasks.Count==0)
                                                {
                                                    Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                                                    foundPartialMatches.Add(currentFoundPartialMatch);
                                                    Rule_ComplexMax.Match_ComplexMax_alt_0_ExtendAv match = new Rule_ComplexMax.Match_ComplexMax_alt_0_ExtendAv();
                                                    match._node_a = candidate_ComplexMax_node_a;
                                                    match._node_b2 = candidate_ComplexMax_alt_0_ExtendAv_node_b2;
                                                    match._node_b = candidate_ComplexMax_node_b;
                                                    match._node__node0 = candidate_ComplexMax_alt_0_ExtendAv_node__node0;
                                                    match._node_c = candidate_ComplexMax_alt_0_ExtendAv_node_c;
                                                    match._edge__edge0 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge0;
                                                    match._edge__edge1 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge1;
                                                    match._edge__edge2 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge2;
                                                    match._edge__edge3 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge3;
                                                    currentFoundPartialMatch.Push(match);
                                                    // if enough matches were found, we leave
                                                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                                    {
                                                        candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge1;
                                                        candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_node__node0;
                                                        candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge2;
                                                        candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge0;
                                                        openTasks.Push(this);
                                                        return;
                                                    }
                                                    goto label2;
                                                }
                                                uint prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_node_b2;
                                                prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_node_b2 = candidate_ComplexMax_alt_0_ExtendAv_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_ComplexMax_alt_0_ExtendAv_node_b2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_node__node0;
                                                prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_node__node0 = candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_node_c;
                                                prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_node_c = candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge0;
                                                prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge0 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge1;
                                                prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge1 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge2;
                                                prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge2 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge3;
                                                prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge3 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_ComplexMax_alt_0_ExtendAv_edge__edge3.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                // Match subpatterns 
                                                openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                                                // Check whether subpatterns were found 
                                                if(matchesList.Count>0) {
                                                    // subpatterns/alternatives were found, extend the partial matches by our local match object
                                                    foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                                                    {
                                                        Rule_ComplexMax.Match_ComplexMax_alt_0_ExtendAv match = new Rule_ComplexMax.Match_ComplexMax_alt_0_ExtendAv();
                                                        match._node_a = candidate_ComplexMax_node_a;
                                                        match._node_b2 = candidate_ComplexMax_alt_0_ExtendAv_node_b2;
                                                        match._node_b = candidate_ComplexMax_node_b;
                                                        match._node__node0 = candidate_ComplexMax_alt_0_ExtendAv_node__node0;
                                                        match._node_c = candidate_ComplexMax_alt_0_ExtendAv_node_c;
                                                        match._edge__edge0 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge0;
                                                        match._edge__edge1 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge1;
                                                        match._edge__edge2 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge2;
                                                        match._edge__edge3 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge3;
                                                        currentFoundPartialMatch.Push(match);
                                                    }
                                                    if(matchesList==foundPartialMatches) {
                                                        matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                                                    } else {
                                                        foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                                            foundPartialMatches.Add(match);
                                                        }
                                                        matchesList.Clear();
                                                    }
                                                    // if enough matches were found, we leave
                                                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                                    {
                                                        candidate_ComplexMax_alt_0_ExtendAv_edge__edge3.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge3;
                                                        candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge2;
                                                        candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge1;
                                                        candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge0;
                                                        candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_node_c;
                                                        candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_node__node0;
                                                        candidate_ComplexMax_alt_0_ExtendAv_node_b2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_node_b2;
                                                        candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge1;
                                                        candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_node__node0;
                                                        candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge2;
                                                        candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge0;
                                                        openTasks.Push(this);
                                                        return;
                                                    }
                                                    candidate_ComplexMax_alt_0_ExtendAv_edge__edge3.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge3;
                                                    candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge2;
                                                    candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge1;
                                                    candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge0;
                                                    candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_node_c;
                                                    candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_node__node0;
                                                    candidate_ComplexMax_alt_0_ExtendAv_node_b2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_node_b2;
                                                    goto label3;
                                                }
                                                candidate_ComplexMax_alt_0_ExtendAv_node_b2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_node_b2;
                                                candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_node__node0;
                                                candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_node_c.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_node_c;
                                                candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge0;
                                                candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge1;
                                                candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge2;
                                                candidate_ComplexMax_alt_0_ExtendAv_edge__edge3.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv_edge__edge3;
label1: ;
label2: ;
label3: ;
                                            }
                                            while( (candidate_ComplexMax_alt_0_ExtendAv_edge__edge3 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge3.lgspOutNext) != head_candidate_ComplexMax_alt_0_ExtendAv_edge__edge3 );
                                        }
                                        candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge1;
                                    }
                                    while( (candidate_ComplexMax_alt_0_ExtendAv_edge__edge1 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge1.lgspOutNext) != head_candidate_ComplexMax_alt_0_ExtendAv_edge__edge1 );
                                }
                                candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_node__node0;
                                candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge2;
                            }
                            while( (candidate_ComplexMax_alt_0_ExtendAv_edge__edge2 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge2.lgspOutNext) != head_candidate_ComplexMax_alt_0_ExtendAv_edge__edge2 );
                        }
                        candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv_edge__edge0;
                    }
                    while( (candidate_ComplexMax_alt_0_ExtendAv_edge__edge0 = candidate_ComplexMax_alt_0_ExtendAv_edge__edge0.lgspOutNext) != head_candidate_ComplexMax_alt_0_ExtendAv_edge__edge0 );
                }
            } while(false);
            if(matchesList.Count>0) {
                if(matchesList==foundPartialMatches) {
                    matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                } else {
                    foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                        foundPartialMatches.Add(match);
                    }
                    matchesList.Clear();
                }
            }
            // Alternative case ComplexMax_alt_0_ExtendAv2 
            do {
                patternGraph = patternGraphs[(int)Rule_ComplexMax.ComplexMax_alt_0_CaseNums.@ExtendAv2];
                // SubPreset ComplexMax_node_a 
                GRGEN_LGSP.LGSPNode candidate_ComplexMax_node_a = ComplexMax_node_a;
                // SubPreset ComplexMax_node_b 
                GRGEN_LGSP.LGSPNode candidate_ComplexMax_node_b = ComplexMax_node_b;
                // Extend Outgoing ComplexMax_alt_0_ExtendAv2_edge__edge0 from ComplexMax_node_a 
                GRGEN_LGSP.LGSPEdge head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0 = candidate_ComplexMax_node_a.lgspOuthead;
                if(head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0 = head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0;
                    do
                    {
                        if(candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        uint prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0;
                        prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        // Implicit Target ComplexMax_alt_0_ExtendAv2_node_b2 from ComplexMax_alt_0_ExtendAv2_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_ComplexMax_alt_0_ExtendAv2_node_b2 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspTarget;
                        if(candidate_ComplexMax_alt_0_ExtendAv2_node_b2.lgspType.TypeID!=2) {
                            candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0;
                            continue;
                        }
                        if((candidate_ComplexMax_alt_0_ExtendAv2_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0;
                            continue;
                        }
                        if((candidate_ComplexMax_alt_0_ExtendAv2_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0;
                            continue;
                        }
                        // Extend Outgoing ComplexMax_alt_0_ExtendAv2_edge__edge2 from ComplexMax_node_b 
                        GRGEN_LGSP.LGSPEdge head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2 = candidate_ComplexMax_node_b.lgspOuthead;
                        if(head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2 = head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2;
                            do
                            {
                                if(candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspType.TypeID!=1) {
                                    continue;
                                }
                                if((candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    continue;
                                }
                                uint prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2;
                                prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                // Implicit Target ComplexMax_alt_0_ExtendAv2_node__node0 from ComplexMax_alt_0_ExtendAv2_edge__edge2 
                                GRGEN_LGSP.LGSPNode candidate_ComplexMax_alt_0_ExtendAv2_node__node0 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspTarget;
                                if(candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspType.TypeID!=3) {
                                    candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2;
                                    continue;
                                }
                                if((candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2;
                                    continue;
                                }
                                uint prev__candidate_ComplexMax_alt_0_ExtendAv2_node__node0;
                                prev__candidate_ComplexMax_alt_0_ExtendAv2_node__node0 = candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                // Extend Outgoing ComplexMax_alt_0_ExtendAv2_edge__edge1 from ComplexMax_alt_0_ExtendAv2_node_b2 
                                GRGEN_LGSP.LGSPEdge head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1 = candidate_ComplexMax_alt_0_ExtendAv2_node_b2.lgspOuthead;
                                if(head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1 != null)
                                {
                                    GRGEN_LGSP.LGSPEdge candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1 = head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1;
                                    do
                                    {
                                        if(candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspType.TypeID!=1) {
                                            continue;
                                        }
                                        if(candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspTarget != candidate_ComplexMax_node_a) {
                                            continue;
                                        }
                                        if((candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                        {
                                            continue;
                                        }
                                        if((candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                        {
                                            continue;
                                        }
                                        uint prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1;
                                        prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                        candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                        // Extend Outgoing ComplexMax_alt_0_ExtendAv2_edge__edge3 from ComplexMax_alt_0_ExtendAv2_node__node0 
                                        GRGEN_LGSP.LGSPEdge head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3 = candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspOuthead;
                                        if(head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3 != null)
                                        {
                                            GRGEN_LGSP.LGSPEdge candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3 = head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3;
                                            do
                                            {
                                                if(candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspType.TypeID!=1) {
                                                    continue;
                                                }
                                                if((candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                                {
                                                    continue;
                                                }
                                                if((candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                                {
                                                    continue;
                                                }
                                                uint prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3;
                                                prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                                // Implicit Target ComplexMax_alt_0_ExtendAv2_node__node1 from ComplexMax_alt_0_ExtendAv2_edge__edge3 
                                                GRGEN_LGSP.LGSPNode candidate_ComplexMax_alt_0_ExtendAv2_node__node1 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspTarget;
                                                if(candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspType.TypeID!=3) {
                                                    candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3;
                                                    continue;
                                                }
                                                if((candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                                {
                                                    candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3;
                                                    continue;
                                                }
                                                if((candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                                {
                                                    candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3;
                                                    continue;
                                                }
                                                uint prev__candidate_ComplexMax_alt_0_ExtendAv2_node__node1;
                                                prev__candidate_ComplexMax_alt_0_ExtendAv2_node__node1 = candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                                candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                                // Extend Outgoing ComplexMax_alt_0_ExtendAv2_edge__edge4 from ComplexMax_alt_0_ExtendAv2_node__node1 
                                                GRGEN_LGSP.LGSPEdge head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4 = candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspOuthead;
                                                if(head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4 != null)
                                                {
                                                    GRGEN_LGSP.LGSPEdge candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4 = head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4;
                                                    do
                                                    {
                                                        if(candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4.lgspType.TypeID!=1) {
                                                            continue;
                                                        }
                                                        if((candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                                        {
                                                            continue;
                                                        }
                                                        if((candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                                        {
                                                            continue;
                                                        }
                                                        // Implicit Target ComplexMax_alt_0_ExtendAv2_node__node2 from ComplexMax_alt_0_ExtendAv2_edge__edge4 
                                                        GRGEN_LGSP.LGSPNode candidate_ComplexMax_alt_0_ExtendAv2_node__node2 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4.lgspTarget;
                                                        if(candidate_ComplexMax_alt_0_ExtendAv2_node__node2.lgspType.TypeID!=3) {
                                                            continue;
                                                        }
                                                        if((candidate_ComplexMax_alt_0_ExtendAv2_node__node2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                                        {
                                                            continue;
                                                        }
                                                        if((candidate_ComplexMax_alt_0_ExtendAv2_node__node2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                                        {
                                                            continue;
                                                        }
                                                        // Check whether there are subpattern matching tasks left to execute
                                                        if(openTasks.Count==0)
                                                        {
                                                            Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                                                            foundPartialMatches.Add(currentFoundPartialMatch);
                                                            Rule_ComplexMax.Match_ComplexMax_alt_0_ExtendAv2 match = new Rule_ComplexMax.Match_ComplexMax_alt_0_ExtendAv2();
                                                            match._node_a = candidate_ComplexMax_node_a;
                                                            match._node_b2 = candidate_ComplexMax_alt_0_ExtendAv2_node_b2;
                                                            match._node_b = candidate_ComplexMax_node_b;
                                                            match._node__node0 = candidate_ComplexMax_alt_0_ExtendAv2_node__node0;
                                                            match._node__node1 = candidate_ComplexMax_alt_0_ExtendAv2_node__node1;
                                                            match._node__node2 = candidate_ComplexMax_alt_0_ExtendAv2_node__node2;
                                                            match._edge__edge0 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0;
                                                            match._edge__edge1 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1;
                                                            match._edge__edge2 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2;
                                                            match._edge__edge3 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3;
                                                            match._edge__edge4 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4;
                                                            currentFoundPartialMatch.Push(match);
                                                            // if enough matches were found, we leave
                                                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                                            {
                                                                candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_node__node1;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_node__node0;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0;
                                                                openTasks.Push(this);
                                                                return;
                                                            }
                                                            continue;
                                                        }
                                                        uint prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node_b2;
                                                        prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node_b2 = candidate_ComplexMax_alt_0_ExtendAv2_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_node_b2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        uint prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node__node0;
                                                        prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node__node0 = candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        uint prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node__node1;
                                                        prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node__node1 = candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        uint prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node__node2;
                                                        prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node__node2 = candidate_ComplexMax_alt_0_ExtendAv2_node__node2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_node__node2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        uint prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0;
                                                        prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        uint prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1;
                                                        prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        uint prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2;
                                                        prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        uint prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3;
                                                        prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        uint prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4;
                                                        prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                        // Match subpatterns 
                                                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                                                        // Check whether subpatterns were found 
                                                        if(matchesList.Count>0) {
                                                            // subpatterns/alternatives were found, extend the partial matches by our local match object
                                                            foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                                                            {
                                                                Rule_ComplexMax.Match_ComplexMax_alt_0_ExtendAv2 match = new Rule_ComplexMax.Match_ComplexMax_alt_0_ExtendAv2();
                                                                match._node_a = candidate_ComplexMax_node_a;
                                                                match._node_b2 = candidate_ComplexMax_alt_0_ExtendAv2_node_b2;
                                                                match._node_b = candidate_ComplexMax_node_b;
                                                                match._node__node0 = candidate_ComplexMax_alt_0_ExtendAv2_node__node0;
                                                                match._node__node1 = candidate_ComplexMax_alt_0_ExtendAv2_node__node1;
                                                                match._node__node2 = candidate_ComplexMax_alt_0_ExtendAv2_node__node2;
                                                                match._edge__edge0 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0;
                                                                match._edge__edge1 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1;
                                                                match._edge__edge2 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2;
                                                                match._edge__edge3 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3;
                                                                match._edge__edge4 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4;
                                                                currentFoundPartialMatch.Push(match);
                                                            }
                                                            if(matchesList==foundPartialMatches) {
                                                                matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                                                            } else {
                                                                foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                                                    foundPartialMatches.Add(match);
                                                                }
                                                                matchesList.Clear();
                                                            }
                                                            // if enough matches were found, we leave
                                                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                                            {
                                                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_node__node2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node__node2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node__node2;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node__node1;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node__node0;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_node_b2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node_b2;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_node__node1;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_node__node0;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2;
                                                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0;
                                                                openTasks.Push(this);
                                                                return;
                                                            }
                                                            candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4;
                                                            candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3;
                                                            candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2;
                                                            candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1;
                                                            candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0;
                                                            candidate_ComplexMax_alt_0_ExtendAv2_node__node2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node__node2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node__node2;
                                                            candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node__node1;
                                                            candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node__node0;
                                                            candidate_ComplexMax_alt_0_ExtendAv2_node_b2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node_b2;
                                                            continue;
                                                        }
                                                        candidate_ComplexMax_alt_0_ExtendAv2_node_b2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node_b2;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node__node0;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node__node1;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_node__node2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node__node2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_node__node2;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3;
                                                        candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4;
                                                    }
                                                    while( (candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4.lgspOutNext) != head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge4 );
                                                }
                                                candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_node__node1;
                                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3;
                                            }
                                            while( (candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3.lgspOutNext) != head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge3 );
                                        }
                                        candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1;
                                    }
                                    while( (candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1.lgspOutNext) != head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge1 );
                                }
                                candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_node__node0;
                                candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2;
                            }
                            while( (candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2.lgspOutNext) != head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge2 );
                        }
                        candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0;
                    }
                    while( (candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0 = candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0.lgspOutNext) != head_candidate_ComplexMax_alt_0_ExtendAv2_edge__edge0 );
                }
            } while(false);
            if(matchesList.Count>0) {
                if(matchesList==foundPartialMatches) {
                    matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                } else {
                    foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                        foundPartialMatches.Add(match);
                    }
                    matchesList.Clear();
                }
            }
            // Alternative case ComplexMax_alt_0_ExtendNA2 
            do {
                patternGraph = patternGraphs[(int)Rule_ComplexMax.ComplexMax_alt_0_CaseNums.@ExtendNA2];
                // SubPreset ComplexMax_node_a 
                GRGEN_LGSP.LGSPNode candidate_ComplexMax_node_a = ComplexMax_node_a;
                // SubPreset ComplexMax_node_b 
                GRGEN_LGSP.LGSPNode candidate_ComplexMax_node_b = ComplexMax_node_b;
                // Extend Outgoing ComplexMax_alt_0_ExtendNA2_edge__edge0 from ComplexMax_node_a 
                GRGEN_LGSP.LGSPEdge head_candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0 = candidate_ComplexMax_node_a.lgspOuthead;
                if(head_candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0 = head_candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0;
                    do
                    {
                        if(candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        uint prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0;
                        prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        // Implicit Target ComplexMax_alt_0_ExtendNA2_node__node0 from ComplexMax_alt_0_ExtendNA2_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_ComplexMax_alt_0_ExtendNA2_node__node0 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspTarget;
                        if(candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspType.TypeID!=3) {
                            candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0;
                            continue;
                        }
                        if((candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0;
                            continue;
                        }
                        uint prev__candidate_ComplexMax_alt_0_ExtendNA2_node__node0;
                        prev__candidate_ComplexMax_alt_0_ExtendNA2_node__node0 = candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        // Extend Outgoing ComplexMax_alt_0_ExtendNA2_edge__edge2 from ComplexMax_node_b 
                        GRGEN_LGSP.LGSPEdge head_candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2 = candidate_ComplexMax_node_b.lgspOuthead;
                        if(head_candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2 = head_candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2;
                            do
                            {
                                if(candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspType.TypeID!=1) {
                                    continue;
                                }
                                if((candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    continue;
                                }
                                uint prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2;
                                prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                // Implicit Target ComplexMax_alt_0_ExtendNA2_node_b2 from ComplexMax_alt_0_ExtendNA2_edge__edge2 
                                GRGEN_LGSP.LGSPNode candidate_ComplexMax_alt_0_ExtendNA2_node_b2 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspTarget;
                                if(candidate_ComplexMax_alt_0_ExtendNA2_node_b2.lgspType.TypeID!=2) {
                                    candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2;
                                    continue;
                                }
                                if((candidate_ComplexMax_alt_0_ExtendNA2_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2;
                                    continue;
                                }
                                if((candidate_ComplexMax_alt_0_ExtendNA2_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2;
                                    continue;
                                }
                                // Extend Outgoing ComplexMax_alt_0_ExtendNA2_edge__edge1 from ComplexMax_alt_0_ExtendNA2_node__node0 
                                GRGEN_LGSP.LGSPEdge head_candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1 = candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspOuthead;
                                if(head_candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1 != null)
                                {
                                    GRGEN_LGSP.LGSPEdge candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1 = head_candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1;
                                    do
                                    {
                                        if(candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspType.TypeID!=1) {
                                            continue;
                                        }
                                        if((candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                        {
                                            continue;
                                        }
                                        if((candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                        {
                                            continue;
                                        }
                                        uint prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1;
                                        prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                        candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                                        // Implicit Target ComplexMax_alt_0_ExtendNA2_node__node1 from ComplexMax_alt_0_ExtendNA2_edge__edge1 
                                        GRGEN_LGSP.LGSPNode candidate_ComplexMax_alt_0_ExtendNA2_node__node1 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspTarget;
                                        if(candidate_ComplexMax_alt_0_ExtendNA2_node__node1.lgspType.TypeID!=3) {
                                            candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1;
                                            continue;
                                        }
                                        if((candidate_ComplexMax_alt_0_ExtendNA2_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                        {
                                            candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1;
                                            continue;
                                        }
                                        if((candidate_ComplexMax_alt_0_ExtendNA2_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                        {
                                            candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1;
                                            continue;
                                        }
                                        // Extend Outgoing ComplexMax_alt_0_ExtendNA2_edge__edge3 from ComplexMax_alt_0_ExtendNA2_node_b2 
                                        GRGEN_LGSP.LGSPEdge head_candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3 = candidate_ComplexMax_alt_0_ExtendNA2_node_b2.lgspOuthead;
                                        if(head_candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3 != null)
                                        {
                                            GRGEN_LGSP.LGSPEdge candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3 = head_candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3;
                                            do
                                            {
                                                if(candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3.lgspType.TypeID!=1) {
                                                    continue;
                                                }
                                                if(candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3.lgspTarget != candidate_ComplexMax_node_b) {
                                                    continue;
                                                }
                                                if((candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                                {
                                                    continue;
                                                }
                                                if((candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                                {
                                                    continue;
                                                }
                                                // Check whether there are subpattern matching tasks left to execute
                                                if(openTasks.Count==0)
                                                {
                                                    Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                                                    foundPartialMatches.Add(currentFoundPartialMatch);
                                                    Rule_ComplexMax.Match_ComplexMax_alt_0_ExtendNA2 match = new Rule_ComplexMax.Match_ComplexMax_alt_0_ExtendNA2();
                                                    match._node_a = candidate_ComplexMax_node_a;
                                                    match._node__node0 = candidate_ComplexMax_alt_0_ExtendNA2_node__node0;
                                                    match._node__node1 = candidate_ComplexMax_alt_0_ExtendNA2_node__node1;
                                                    match._node_b = candidate_ComplexMax_node_b;
                                                    match._node_b2 = candidate_ComplexMax_alt_0_ExtendNA2_node_b2;
                                                    match._edge__edge0 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0;
                                                    match._edge__edge1 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1;
                                                    match._edge__edge2 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2;
                                                    match._edge__edge3 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3;
                                                    currentFoundPartialMatch.Push(match);
                                                    // if enough matches were found, we leave
                                                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                                    {
                                                        candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1;
                                                        candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2;
                                                        candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_node__node0;
                                                        candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0;
                                                        openTasks.Push(this);
                                                        return;
                                                    }
                                                    continue;
                                                }
                                                uint prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_node__node0;
                                                prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_node__node0 = candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_node__node1;
                                                prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_node__node1 = candidate_ComplexMax_alt_0_ExtendNA2_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_ComplexMax_alt_0_ExtendNA2_node__node1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_node_b2;
                                                prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_node_b2 = candidate_ComplexMax_alt_0_ExtendNA2_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_ComplexMax_alt_0_ExtendNA2_node_b2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0;
                                                prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1;
                                                prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2;
                                                prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                uint prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3;
                                                prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                                // Match subpatterns 
                                                openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                                                // Check whether subpatterns were found 
                                                if(matchesList.Count>0) {
                                                    // subpatterns/alternatives were found, extend the partial matches by our local match object
                                                    foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                                                    {
                                                        Rule_ComplexMax.Match_ComplexMax_alt_0_ExtendNA2 match = new Rule_ComplexMax.Match_ComplexMax_alt_0_ExtendNA2();
                                                        match._node_a = candidate_ComplexMax_node_a;
                                                        match._node__node0 = candidate_ComplexMax_alt_0_ExtendNA2_node__node0;
                                                        match._node__node1 = candidate_ComplexMax_alt_0_ExtendNA2_node__node1;
                                                        match._node_b = candidate_ComplexMax_node_b;
                                                        match._node_b2 = candidate_ComplexMax_alt_0_ExtendNA2_node_b2;
                                                        match._edge__edge0 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0;
                                                        match._edge__edge1 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1;
                                                        match._edge__edge2 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2;
                                                        match._edge__edge3 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3;
                                                        currentFoundPartialMatch.Push(match);
                                                    }
                                                    if(matchesList==foundPartialMatches) {
                                                        matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                                                    } else {
                                                        foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                                            foundPartialMatches.Add(match);
                                                        }
                                                        matchesList.Clear();
                                                    }
                                                    // if enough matches were found, we leave
                                                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                                    {
                                                        candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3;
                                                        candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2;
                                                        candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1;
                                                        candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0;
                                                        candidate_ComplexMax_alt_0_ExtendNA2_node_b2.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_node_b2;
                                                        candidate_ComplexMax_alt_0_ExtendNA2_node__node1.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_node__node1;
                                                        candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_node__node0;
                                                        candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1;
                                                        candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2;
                                                        candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_node__node0;
                                                        candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0;
                                                        openTasks.Push(this);
                                                        return;
                                                    }
                                                    candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3;
                                                    candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2;
                                                    candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1;
                                                    candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0;
                                                    candidate_ComplexMax_alt_0_ExtendNA2_node_b2.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_node_b2;
                                                    candidate_ComplexMax_alt_0_ExtendNA2_node__node1.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_node__node1;
                                                    candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_node__node0;
                                                    continue;
                                                }
                                                candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_node__node0;
                                                candidate_ComplexMax_alt_0_ExtendNA2_node__node1.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_node__node1;
                                                candidate_ComplexMax_alt_0_ExtendNA2_node_b2.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_node_b2;
                                                candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0;
                                                candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1;
                                                candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2;
                                                candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3;
                                            }
                                            while( (candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3.lgspOutNext) != head_candidate_ComplexMax_alt_0_ExtendNA2_edge__edge3 );
                                        }
                                        candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1;
                                    }
                                    while( (candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1.lgspOutNext) != head_candidate_ComplexMax_alt_0_ExtendNA2_edge__edge1 );
                                }
                                candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2;
                            }
                            while( (candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2.lgspOutNext) != head_candidate_ComplexMax_alt_0_ExtendNA2_edge__edge2 );
                        }
                        candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_node__node0;
                        candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0;
                    }
                    while( (candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0 = candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0.lgspOutNext) != head_candidate_ComplexMax_alt_0_ExtendNA2_edge__edge0 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_createABA
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_createABA.IMatch_createABA> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_createABA.IMatch_createABA match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createABA.IMatch_createABA> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_createABA : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_createABA
    {
        public Action_createABA()
            : base(Rule_createABA.Instance.patternGraph)
        {
            _rulePattern = Rule_createABA.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_createABA _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "createABA"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_createABA.Match_createABA, Rule_createABA.IMatch_createABA> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_createABA Instance { get { return instance; } set { instance = value; } }
        private static Action_createABA instance = new Action_createABA();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_createABA.IMatch_createABA> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_createABA.Match_createABA, Rule_createABA.IMatch_createABA>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            Rule_createABA.Match_createABA match = matches.GetNextUnfilledPosition();
            matches.PositionWasFilledFixIt();
            // if enough matches were found, we leave
            if(maxMatches > 0 && matches.Count >= maxMatches)
            {
                return matches;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_createABA.IMatch_createABA> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_createABA.IMatch_createABA> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_createABA.IMatch_createABA match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createABA.IMatch_createABA> matches)
        {
            foreach(Rule_createABA.IMatch_createABA match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createABA.IMatch_createABA> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createABA.IMatch_createABA> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_createABA.IMatch_createABA match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createABA.IMatch_createABA> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createABA.IMatch_createABA> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createABA.IMatch_createABA> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_createABA.IMatch_createABA)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_createABA.IMatch_createABA>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_homm
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_homm.IMatch_homm> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_homm.IMatch_homm match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_homm.IMatch_homm> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_homm : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_homm
    {
        public Action_homm()
            : base(Rule_homm.Instance.patternGraph)
        {
            _rulePattern = Rule_homm.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_homm _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "homm"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_homm.Match_homm, Rule_homm.IMatch_homm> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_homm Instance { get { return instance; } set { instance = value; } }
        private static Action_homm instance = new Action_homm();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_homm.IMatch_homm> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_homm.Match_homm, Rule_homm.IMatch_homm>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks = new Stack<GRGEN_LGSP.LGSPSubpatternAction>();
            List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches = new List<Stack<GRGEN_LIBGR.IMatch>>();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            // Lookup homm_edge__edge0 
            int type_id_candidate_homm_edge__edge0 = 1;
            for(GRGEN_LGSP.LGSPEdge head_candidate_homm_edge__edge0 = graph.edgesByTypeHeads[type_id_candidate_homm_edge__edge0], candidate_homm_edge__edge0 = head_candidate_homm_edge__edge0.lgspTypeNext; candidate_homm_edge__edge0 != head_candidate_homm_edge__edge0; candidate_homm_edge__edge0 = candidate_homm_edge__edge0.lgspTypeNext)
            {
                uint prev__candidate_homm_edge__edge0;
                prev__candidate_homm_edge__edge0 = candidate_homm_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                candidate_homm_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                // Implicit Source homm_node_a from homm_edge__edge0 
                GRGEN_LGSP.LGSPNode candidate_homm_node_a = candidate_homm_edge__edge0.lgspSource;
                if(candidate_homm_node_a.lgspType.TypeID!=1) {
                    candidate_homm_edge__edge0.lgspFlags = candidate_homm_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_homm_edge__edge0;
                    continue;
                }
                // Implicit Target homm_node_b from homm_edge__edge0 
                GRGEN_LGSP.LGSPNode candidate_homm_node_b = candidate_homm_edge__edge0.lgspTarget;
                if(candidate_homm_node_b.lgspType.TypeID!=2) {
                    candidate_homm_edge__edge0.lgspFlags = candidate_homm_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_homm_edge__edge0;
                    continue;
                }
                // Extend Outgoing homm_edge__edge1 from homm_node_b 
                GRGEN_LGSP.LGSPEdge head_candidate_homm_edge__edge1 = candidate_homm_node_b.lgspOuthead;
                if(head_candidate_homm_edge__edge1 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_homm_edge__edge1 = head_candidate_homm_edge__edge1;
                    do
                    {
                        if(candidate_homm_edge__edge1.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_homm_edge__edge1.lgspTarget != candidate_homm_node_a) {
                            continue;
                        }
                        if((candidate_homm_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            continue;
                        }
                        // Push alternative matching task for homm_alt_0
                        AlternativeAction_homm_alt_0 taskFor_alt_0 = AlternativeAction_homm_alt_0.getNewTask(actionEnv, openTasks, Rule_homm.Instance.patternGraph.alternatives[(int)Rule_homm.homm_AltNums.@alt_0].alternativeCases);
                        taskFor_alt_0.homm_node_a = candidate_homm_node_a;
                        taskFor_alt_0.homm_node_b = candidate_homm_node_b;
                        taskFor_alt_0.searchPatternpath = false;
                        taskFor_alt_0.matchOfNestingPattern = null;
                        taskFor_alt_0.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor_alt_0);
                        uint prevGlobal__candidate_homm_node_a;
                        prevGlobal__candidate_homm_node_a = candidate_homm_node_a.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_homm_node_a.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_homm_node_b;
                        prevGlobal__candidate_homm_node_b = candidate_homm_node_b.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_homm_node_b.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_homm_edge__edge0;
                        prevGlobal__candidate_homm_edge__edge0 = candidate_homm_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_homm_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_homm_edge__edge1;
                        prevGlobal__candidate_homm_edge__edge1 = candidate_homm_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_homm_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop alternative matching task for homm_alt_0
                        openTasks.Pop();
                        AlternativeAction_homm_alt_0.releaseTask(taskFor_alt_0);
                        // Check whether subpatterns were found 
                        if(matchesList.Count>0) {
                            // subpatterns/alternatives were found, extend the partial matches by our local match object, becoming a complete match object and save it
                            foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                            {
                                Rule_homm.Match_homm match = matches.GetNextUnfilledPosition();
                                match._node_a = candidate_homm_node_a;
                                match._node_b = candidate_homm_node_b;
                                match._edge__edge0 = candidate_homm_edge__edge0;
                                match._edge__edge1 = candidate_homm_edge__edge1;
                                match._alt_0 = (Rule_homm.IMatch_homm_alt_0)currentFoundPartialMatch.Pop();
                                match._alt_0.SetMatchOfEnclosingPattern(match);
                                matches.PositionWasFilledFixIt();
                            }
                            matchesList.Clear();
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && matches.Count >= maxMatches)
                            {
                                candidate_homm_edge__edge1.lgspFlags = candidate_homm_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_edge__edge1;
                                candidate_homm_edge__edge0.lgspFlags = candidate_homm_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_edge__edge0;
                                candidate_homm_node_b.lgspFlags = candidate_homm_node_b.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_node_b;
                                candidate_homm_node_a.lgspFlags = candidate_homm_node_a.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_node_a;
                                candidate_homm_edge__edge0.lgspFlags = candidate_homm_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_homm_edge__edge0;
                                return matches;
                            }
                            candidate_homm_edge__edge1.lgspFlags = candidate_homm_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_edge__edge1;
                            candidate_homm_edge__edge0.lgspFlags = candidate_homm_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_edge__edge0;
                            candidate_homm_node_b.lgspFlags = candidate_homm_node_b.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_node_b;
                            candidate_homm_node_a.lgspFlags = candidate_homm_node_a.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_node_a;
                            continue;
                        }
                        candidate_homm_node_a.lgspFlags = candidate_homm_node_a.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_node_a;
                        candidate_homm_node_b.lgspFlags = candidate_homm_node_b.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_node_b;
                        candidate_homm_edge__edge0.lgspFlags = candidate_homm_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_edge__edge0;
                        candidate_homm_edge__edge1.lgspFlags = candidate_homm_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_edge__edge1;
                    }
                    while( (candidate_homm_edge__edge1 = candidate_homm_edge__edge1.lgspOutNext) != head_candidate_homm_edge__edge1 );
                }
                candidate_homm_edge__edge0.lgspFlags = candidate_homm_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_homm_edge__edge0;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_homm.IMatch_homm> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_homm.IMatch_homm> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_homm.IMatch_homm match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_homm.IMatch_homm> matches)
        {
            foreach(Rule_homm.IMatch_homm match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_homm.IMatch_homm> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_homm.IMatch_homm> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_homm.IMatch_homm match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_homm.IMatch_homm> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_homm.IMatch_homm> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_homm.IMatch_homm> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_homm.IMatch_homm)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_homm.IMatch_homm>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    public class AlternativeAction_homm_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_homm_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_homm_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_homm_alt_0 newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_homm_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_homm_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_homm_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_homm_alt_0 next = null;

        public GRGEN_LGSP.LGSPNode homm_node_a;
        public GRGEN_LGSP.LGSPNode homm_node_b;
        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // Alternative case homm_alt_0_case1 
            do {
                patternGraph = patternGraphs[(int)Rule_homm.homm_alt_0_CaseNums.@case1];
                // SubPreset homm_node_a 
                GRGEN_LGSP.LGSPNode candidate_homm_node_a = homm_node_a;
                // SubPreset homm_node_b 
                GRGEN_LGSP.LGSPNode candidate_homm_node_b = homm_node_b;
                // Extend Outgoing homm_alt_0_case1_edge__edge0 from homm_node_a 
                GRGEN_LGSP.LGSPEdge head_candidate_homm_alt_0_case1_edge__edge0 = candidate_homm_node_a.lgspOuthead;
                if(head_candidate_homm_alt_0_case1_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_homm_alt_0_case1_edge__edge0 = head_candidate_homm_alt_0_case1_edge__edge0;
                    do
                    {
                        if(candidate_homm_alt_0_case1_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_homm_alt_0_case1_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        uint prev__candidate_homm_alt_0_case1_edge__edge0;
                        prev__candidate_homm_alt_0_case1_edge__edge0 = candidate_homm_alt_0_case1_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        candidate_homm_alt_0_case1_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        // Implicit Target homm_alt_0_case1_node_b2 from homm_alt_0_case1_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_homm_alt_0_case1_node_b2 = candidate_homm_alt_0_case1_edge__edge0.lgspTarget;
                        if(candidate_homm_alt_0_case1_node_b2.lgspType.TypeID!=2) {
                            candidate_homm_alt_0_case1_edge__edge0.lgspFlags = candidate_homm_alt_0_case1_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_homm_alt_0_case1_edge__edge0;
                            continue;
                        }
                        if((candidate_homm_alt_0_case1_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace && candidate_homm_alt_0_case1_node_b2!=candidate_homm_node_b)
                        {
                            candidate_homm_alt_0_case1_edge__edge0.lgspFlags = candidate_homm_alt_0_case1_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_homm_alt_0_case1_edge__edge0;
                            continue;
                        }
                        // Extend Outgoing homm_alt_0_case1_edge__edge1 from homm_alt_0_case1_node_b2 
                        GRGEN_LGSP.LGSPEdge head_candidate_homm_alt_0_case1_edge__edge1 = candidate_homm_alt_0_case1_node_b2.lgspOuthead;
                        if(head_candidate_homm_alt_0_case1_edge__edge1 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_homm_alt_0_case1_edge__edge1 = head_candidate_homm_alt_0_case1_edge__edge1;
                            do
                            {
                                if(candidate_homm_alt_0_case1_edge__edge1.lgspType.TypeID!=1) {
                                    continue;
                                }
                                if(candidate_homm_alt_0_case1_edge__edge1.lgspTarget != candidate_homm_node_a) {
                                    continue;
                                }
                                if((candidate_homm_alt_0_case1_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_homm_alt_0_case1_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    continue;
                                }
                                // Check whether there are subpattern matching tasks left to execute
                                if(openTasks.Count==0)
                                {
                                    Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                                    foundPartialMatches.Add(currentFoundPartialMatch);
                                    Rule_homm.Match_homm_alt_0_case1 match = new Rule_homm.Match_homm_alt_0_case1();
                                    match._node_a = candidate_homm_node_a;
                                    match._node_b2 = candidate_homm_alt_0_case1_node_b2;
                                    match._node_b = candidate_homm_node_b;
                                    match._edge__edge0 = candidate_homm_alt_0_case1_edge__edge0;
                                    match._edge__edge1 = candidate_homm_alt_0_case1_edge__edge1;
                                    currentFoundPartialMatch.Push(match);
                                    // if enough matches were found, we leave
                                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                    {
                                        candidate_homm_alt_0_case1_edge__edge0.lgspFlags = candidate_homm_alt_0_case1_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_homm_alt_0_case1_edge__edge0;
                                        openTasks.Push(this);
                                        return;
                                    }
                                    continue;
                                }
                                uint prevGlobal__candidate_homm_alt_0_case1_node_b2;
                                prevGlobal__candidate_homm_alt_0_case1_node_b2 = candidate_homm_alt_0_case1_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_homm_alt_0_case1_node_b2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                uint prevGlobal__candidate_homm_alt_0_case1_edge__edge0;
                                prevGlobal__candidate_homm_alt_0_case1_edge__edge0 = candidate_homm_alt_0_case1_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_homm_alt_0_case1_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                uint prevGlobal__candidate_homm_alt_0_case1_edge__edge1;
                                prevGlobal__candidate_homm_alt_0_case1_edge__edge1 = candidate_homm_alt_0_case1_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_homm_alt_0_case1_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                // Match subpatterns 
                                openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                                // Check whether subpatterns were found 
                                if(matchesList.Count>0) {
                                    // subpatterns/alternatives were found, extend the partial matches by our local match object
                                    foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                                    {
                                        Rule_homm.Match_homm_alt_0_case1 match = new Rule_homm.Match_homm_alt_0_case1();
                                        match._node_a = candidate_homm_node_a;
                                        match._node_b2 = candidate_homm_alt_0_case1_node_b2;
                                        match._node_b = candidate_homm_node_b;
                                        match._edge__edge0 = candidate_homm_alt_0_case1_edge__edge0;
                                        match._edge__edge1 = candidate_homm_alt_0_case1_edge__edge1;
                                        currentFoundPartialMatch.Push(match);
                                    }
                                    if(matchesList==foundPartialMatches) {
                                        matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                                    } else {
                                        foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                            foundPartialMatches.Add(match);
                                        }
                                        matchesList.Clear();
                                    }
                                    // if enough matches were found, we leave
                                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                    {
                                        candidate_homm_alt_0_case1_edge__edge1.lgspFlags = candidate_homm_alt_0_case1_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case1_edge__edge1;
                                        candidate_homm_alt_0_case1_edge__edge0.lgspFlags = candidate_homm_alt_0_case1_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case1_edge__edge0;
                                        candidate_homm_alt_0_case1_node_b2.lgspFlags = candidate_homm_alt_0_case1_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case1_node_b2;
                                        candidate_homm_alt_0_case1_edge__edge0.lgspFlags = candidate_homm_alt_0_case1_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_homm_alt_0_case1_edge__edge0;
                                        openTasks.Push(this);
                                        return;
                                    }
                                    candidate_homm_alt_0_case1_edge__edge1.lgspFlags = candidate_homm_alt_0_case1_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case1_edge__edge1;
                                    candidate_homm_alt_0_case1_edge__edge0.lgspFlags = candidate_homm_alt_0_case1_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case1_edge__edge0;
                                    candidate_homm_alt_0_case1_node_b2.lgspFlags = candidate_homm_alt_0_case1_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case1_node_b2;
                                    continue;
                                }
                                candidate_homm_alt_0_case1_node_b2.lgspFlags = candidate_homm_alt_0_case1_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case1_node_b2;
                                candidate_homm_alt_0_case1_edge__edge0.lgspFlags = candidate_homm_alt_0_case1_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case1_edge__edge0;
                                candidate_homm_alt_0_case1_edge__edge1.lgspFlags = candidate_homm_alt_0_case1_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case1_edge__edge1;
                            }
                            while( (candidate_homm_alt_0_case1_edge__edge1 = candidate_homm_alt_0_case1_edge__edge1.lgspOutNext) != head_candidate_homm_alt_0_case1_edge__edge1 );
                        }
                        candidate_homm_alt_0_case1_edge__edge0.lgspFlags = candidate_homm_alt_0_case1_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_homm_alt_0_case1_edge__edge0;
                    }
                    while( (candidate_homm_alt_0_case1_edge__edge0 = candidate_homm_alt_0_case1_edge__edge0.lgspOutNext) != head_candidate_homm_alt_0_case1_edge__edge0 );
                }
            } while(false);
            if(matchesList.Count>0) {
                if(matchesList==foundPartialMatches) {
                    matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                } else {
                    foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                        foundPartialMatches.Add(match);
                    }
                    matchesList.Clear();
                }
            }
            // Alternative case homm_alt_0_case2 
            do {
                patternGraph = patternGraphs[(int)Rule_homm.homm_alt_0_CaseNums.@case2];
                // SubPreset homm_node_a 
                GRGEN_LGSP.LGSPNode candidate_homm_node_a = homm_node_a;
                // Extend Outgoing homm_alt_0_case2_edge__edge0 from homm_node_a 
                GRGEN_LGSP.LGSPEdge head_candidate_homm_alt_0_case2_edge__edge0 = candidate_homm_node_a.lgspOuthead;
                if(head_candidate_homm_alt_0_case2_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_homm_alt_0_case2_edge__edge0 = head_candidate_homm_alt_0_case2_edge__edge0;
                    do
                    {
                        if(candidate_homm_alt_0_case2_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_homm_alt_0_case2_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        uint prev__candidate_homm_alt_0_case2_edge__edge0;
                        prev__candidate_homm_alt_0_case2_edge__edge0 = candidate_homm_alt_0_case2_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        candidate_homm_alt_0_case2_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        // Implicit Target homm_alt_0_case2_node_b2 from homm_alt_0_case2_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_homm_alt_0_case2_node_b2 = candidate_homm_alt_0_case2_edge__edge0.lgspTarget;
                        if(candidate_homm_alt_0_case2_node_b2.lgspType.TypeID!=2) {
                            candidate_homm_alt_0_case2_edge__edge0.lgspFlags = candidate_homm_alt_0_case2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_homm_alt_0_case2_edge__edge0;
                            continue;
                        }
                        if((candidate_homm_alt_0_case2_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            candidate_homm_alt_0_case2_edge__edge0.lgspFlags = candidate_homm_alt_0_case2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_homm_alt_0_case2_edge__edge0;
                            continue;
                        }
                        // Extend Outgoing homm_alt_0_case2_edge__edge1 from homm_alt_0_case2_node_b2 
                        GRGEN_LGSP.LGSPEdge head_candidate_homm_alt_0_case2_edge__edge1 = candidate_homm_alt_0_case2_node_b2.lgspOuthead;
                        if(head_candidate_homm_alt_0_case2_edge__edge1 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_homm_alt_0_case2_edge__edge1 = head_candidate_homm_alt_0_case2_edge__edge1;
                            do
                            {
                                if(candidate_homm_alt_0_case2_edge__edge1.lgspType.TypeID!=1) {
                                    continue;
                                }
                                if(candidate_homm_alt_0_case2_edge__edge1.lgspTarget != candidate_homm_node_a) {
                                    continue;
                                }
                                if((candidate_homm_alt_0_case2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_homm_alt_0_case2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    continue;
                                }
                                // Check whether there are subpattern matching tasks left to execute
                                if(openTasks.Count==0)
                                {
                                    Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                                    foundPartialMatches.Add(currentFoundPartialMatch);
                                    Rule_homm.Match_homm_alt_0_case2 match = new Rule_homm.Match_homm_alt_0_case2();
                                    match._node_a = candidate_homm_node_a;
                                    match._node_b2 = candidate_homm_alt_0_case2_node_b2;
                                    match._edge__edge0 = candidate_homm_alt_0_case2_edge__edge0;
                                    match._edge__edge1 = candidate_homm_alt_0_case2_edge__edge1;
                                    currentFoundPartialMatch.Push(match);
                                    // if enough matches were found, we leave
                                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                    {
                                        candidate_homm_alt_0_case2_edge__edge0.lgspFlags = candidate_homm_alt_0_case2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_homm_alt_0_case2_edge__edge0;
                                        openTasks.Push(this);
                                        return;
                                    }
                                    continue;
                                }
                                uint prevGlobal__candidate_homm_alt_0_case2_node_b2;
                                prevGlobal__candidate_homm_alt_0_case2_node_b2 = candidate_homm_alt_0_case2_node_b2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_homm_alt_0_case2_node_b2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                uint prevGlobal__candidate_homm_alt_0_case2_edge__edge0;
                                prevGlobal__candidate_homm_alt_0_case2_edge__edge0 = candidate_homm_alt_0_case2_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_homm_alt_0_case2_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                uint prevGlobal__candidate_homm_alt_0_case2_edge__edge1;
                                prevGlobal__candidate_homm_alt_0_case2_edge__edge1 = candidate_homm_alt_0_case2_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_homm_alt_0_case2_edge__edge1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                // Match subpatterns 
                                openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                                // Check whether subpatterns were found 
                                if(matchesList.Count>0) {
                                    // subpatterns/alternatives were found, extend the partial matches by our local match object
                                    foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                                    {
                                        Rule_homm.Match_homm_alt_0_case2 match = new Rule_homm.Match_homm_alt_0_case2();
                                        match._node_a = candidate_homm_node_a;
                                        match._node_b2 = candidate_homm_alt_0_case2_node_b2;
                                        match._edge__edge0 = candidate_homm_alt_0_case2_edge__edge0;
                                        match._edge__edge1 = candidate_homm_alt_0_case2_edge__edge1;
                                        currentFoundPartialMatch.Push(match);
                                    }
                                    if(matchesList==foundPartialMatches) {
                                        matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                                    } else {
                                        foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                            foundPartialMatches.Add(match);
                                        }
                                        matchesList.Clear();
                                    }
                                    // if enough matches were found, we leave
                                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                    {
                                        candidate_homm_alt_0_case2_edge__edge1.lgspFlags = candidate_homm_alt_0_case2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case2_edge__edge1;
                                        candidate_homm_alt_0_case2_edge__edge0.lgspFlags = candidate_homm_alt_0_case2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case2_edge__edge0;
                                        candidate_homm_alt_0_case2_node_b2.lgspFlags = candidate_homm_alt_0_case2_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case2_node_b2;
                                        candidate_homm_alt_0_case2_edge__edge0.lgspFlags = candidate_homm_alt_0_case2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_homm_alt_0_case2_edge__edge0;
                                        openTasks.Push(this);
                                        return;
                                    }
                                    candidate_homm_alt_0_case2_edge__edge1.lgspFlags = candidate_homm_alt_0_case2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case2_edge__edge1;
                                    candidate_homm_alt_0_case2_edge__edge0.lgspFlags = candidate_homm_alt_0_case2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case2_edge__edge0;
                                    candidate_homm_alt_0_case2_node_b2.lgspFlags = candidate_homm_alt_0_case2_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case2_node_b2;
                                    continue;
                                }
                                candidate_homm_alt_0_case2_node_b2.lgspFlags = candidate_homm_alt_0_case2_node_b2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case2_node_b2;
                                candidate_homm_alt_0_case2_edge__edge0.lgspFlags = candidate_homm_alt_0_case2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case2_edge__edge0;
                                candidate_homm_alt_0_case2_edge__edge1.lgspFlags = candidate_homm_alt_0_case2_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_homm_alt_0_case2_edge__edge1;
                            }
                            while( (candidate_homm_alt_0_case2_edge__edge1 = candidate_homm_alt_0_case2_edge__edge1.lgspOutNext) != head_candidate_homm_alt_0_case2_edge__edge1 );
                        }
                        candidate_homm_alt_0_case2_edge__edge0.lgspFlags = candidate_homm_alt_0_case2_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_homm_alt_0_case2_edge__edge0;
                    }
                    while( (candidate_homm_alt_0_case2_edge__edge0 = candidate_homm_alt_0_case2_edge__edge0.lgspOutNext) != head_candidate_homm_alt_0_case2_edge__edge0 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_XtoAorB
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_XtoAorB.IMatch_XtoAorB> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_XtoAorB.IMatch_XtoAorB match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_XtoAorB.IMatch_XtoAorB> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_XtoAorB : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_XtoAorB
    {
        public Action_XtoAorB()
            : base(Rule_XtoAorB.Instance.patternGraph)
        {
            _rulePattern = Rule_XtoAorB.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_XtoAorB _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "XtoAorB"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_XtoAorB.Match_XtoAorB, Rule_XtoAorB.IMatch_XtoAorB> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_XtoAorB Instance { get { return instance; } set { instance = value; } }
        private static Action_XtoAorB instance = new Action_XtoAorB();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_XtoAorB.IMatch_XtoAorB> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_XtoAorB.Match_XtoAorB, Rule_XtoAorB.IMatch_XtoAorB>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks = new Stack<GRGEN_LGSP.LGSPSubpatternAction>();
            List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches = new List<Stack<GRGEN_LIBGR.IMatch>>();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            // Lookup toAorB_edge_y_inlined__sub0_0 
            int type_id_candidate_toAorB_edge_y_inlined__sub0_0 = 1;
            for(GRGEN_LGSP.LGSPEdge head_candidate_toAorB_edge_y_inlined__sub0_0 = graph.edgesByTypeHeads[type_id_candidate_toAorB_edge_y_inlined__sub0_0], candidate_toAorB_edge_y_inlined__sub0_0 = head_candidate_toAorB_edge_y_inlined__sub0_0.lgspTypeNext; candidate_toAorB_edge_y_inlined__sub0_0 != head_candidate_toAorB_edge_y_inlined__sub0_0; candidate_toAorB_edge_y_inlined__sub0_0 = candidate_toAorB_edge_y_inlined__sub0_0.lgspTypeNext)
            {
                // Implicit Source toAorB_node_x_inlined__sub0_0 from toAorB_edge_y_inlined__sub0_0 
                GRGEN_LGSP.LGSPNode candidate_toAorB_node_x_inlined__sub0_0 = candidate_toAorB_edge_y_inlined__sub0_0.lgspSource;
                // Element XtoAorB_node_x assigned from other element toAorB_node_x_inlined__sub0_0 
                GRGEN_LGSP.LGSPNode candidate_XtoAorB_node_x = candidate_toAorB_node_x_inlined__sub0_0;
                // Push alternative matching task for XtoAorB_alt_0_inlined__sub0_0_in_XtoAorB
                AlternativeAction_XtoAorB_alt_0_inlined__sub0_0_in_XtoAorB taskFor_alt_0_inlined__sub0_0_in_XtoAorB = AlternativeAction_XtoAorB_alt_0_inlined__sub0_0_in_XtoAorB.getNewTask(actionEnv, openTasks, Pattern_toAorB.Instance.patternGraph.alternatives[(int)Pattern_toAorB.toAorB_AltNums.@alt_0].alternativeCases);
                taskFor_alt_0_inlined__sub0_0_in_XtoAorB.toAorB_edge_y_inlined__sub0_0 = candidate_toAorB_edge_y_inlined__sub0_0;
                taskFor_alt_0_inlined__sub0_0_in_XtoAorB.searchPatternpath = false;
                taskFor_alt_0_inlined__sub0_0_in_XtoAorB.matchOfNestingPattern = null;
                taskFor_alt_0_inlined__sub0_0_in_XtoAorB.lastMatchAtPreviousNestingLevel = null;
                openTasks.Push(taskFor_alt_0_inlined__sub0_0_in_XtoAorB);
                uint prevGlobal__candidate_XtoAorB_node_x;
                prevGlobal__candidate_XtoAorB_node_x = candidate_XtoAorB_node_x.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                candidate_XtoAorB_node_x.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                uint prevGlobal__candidate_toAorB_edge_y_inlined__sub0_0;
                prevGlobal__candidate_toAorB_edge_y_inlined__sub0_0 = candidate_toAorB_edge_y_inlined__sub0_0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                candidate_toAorB_edge_y_inlined__sub0_0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                // Match subpatterns 
                openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                // Pop alternative matching task for XtoAorB_alt_0_inlined__sub0_0_in_XtoAorB
                openTasks.Pop();
                AlternativeAction_XtoAorB_alt_0_inlined__sub0_0_in_XtoAorB.releaseTask(taskFor_alt_0_inlined__sub0_0_in_XtoAorB);
                // Check whether subpatterns were found 
                if(matchesList.Count>0) {
                    // subpatterns/alternatives were found, extend the partial matches by our local match object, becoming a complete match object and save it
                    foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                    {
                        Rule_XtoAorB.Match_XtoAorB match = matches.GetNextUnfilledPosition();
                        Pattern_toAorB.Match_toAorB match__sub0 = new Pattern_toAorB.Match_toAorB();
                        match__sub0.SetMatchOfEnclosingPattern(match);
                        match._node_x = candidate_XtoAorB_node_x;
                        match__sub0._node_x = candidate_toAorB_node_x_inlined__sub0_0;
                        match__sub0._edge_y = candidate_toAorB_edge_y_inlined__sub0_0;
                        match.__sub0 = match__sub0;
                        match__sub0._alt_0 = (Pattern_toAorB.IMatch_toAorB_alt_0)currentFoundPartialMatch.Pop();
                        match__sub0._alt_0.SetMatchOfEnclosingPattern(match__sub0);
                        matches.PositionWasFilledFixIt();
                    }
                    matchesList.Clear();
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && matches.Count >= maxMatches)
                    {
                        candidate_toAorB_edge_y_inlined__sub0_0.lgspFlags = candidate_toAorB_edge_y_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_edge_y_inlined__sub0_0;
                        candidate_XtoAorB_node_x.lgspFlags = candidate_XtoAorB_node_x.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_XtoAorB_node_x;
                        return matches;
                    }
                    candidate_toAorB_edge_y_inlined__sub0_0.lgspFlags = candidate_toAorB_edge_y_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_edge_y_inlined__sub0_0;
                    candidate_XtoAorB_node_x.lgspFlags = candidate_XtoAorB_node_x.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_XtoAorB_node_x;
                    continue;
                }
                candidate_XtoAorB_node_x.lgspFlags = candidate_XtoAorB_node_x.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_XtoAorB_node_x;
                candidate_toAorB_edge_y_inlined__sub0_0.lgspFlags = candidate_toAorB_edge_y_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_edge_y_inlined__sub0_0;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_XtoAorB.IMatch_XtoAorB> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_XtoAorB.IMatch_XtoAorB> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_XtoAorB.IMatch_XtoAorB match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_XtoAorB.IMatch_XtoAorB> matches)
        {
            foreach(Rule_XtoAorB.IMatch_XtoAorB match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_XtoAorB.IMatch_XtoAorB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_XtoAorB.IMatch_XtoAorB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_XtoAorB.IMatch_XtoAorB match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_XtoAorB.IMatch_XtoAorB> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_XtoAorB.IMatch_XtoAorB> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_XtoAorB.IMatch_XtoAorB> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_XtoAorB.IMatch_XtoAorB)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_XtoAorB.IMatch_XtoAorB>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    public class AlternativeAction_XtoAorB_alt_0_inlined__sub0_0_in_XtoAorB : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_XtoAorB_alt_0_inlined__sub0_0_in_XtoAorB(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_XtoAorB_alt_0_inlined__sub0_0_in_XtoAorB getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_XtoAorB_alt_0_inlined__sub0_0_in_XtoAorB newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_XtoAorB_alt_0_inlined__sub0_0_in_XtoAorB(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_XtoAorB_alt_0_inlined__sub0_0_in_XtoAorB oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_XtoAorB_alt_0_inlined__sub0_0_in_XtoAorB freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_XtoAorB_alt_0_inlined__sub0_0_in_XtoAorB next = null;

        public GRGEN_LGSP.LGSPEdge toAorB_edge_y_inlined__sub0_0;
        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // Alternative case toAorB_alt_0_toA 
            do {
                patternGraph = patternGraphs[(int)Pattern_toAorB.toAorB_alt_0_CaseNums.@toA];
                // SubPreset toAorB_edge_y_inlined__sub0_0 
                GRGEN_LGSP.LGSPEdge candidate_toAorB_edge_y_inlined__sub0_0 = toAorB_edge_y_inlined__sub0_0;
                // Implicit Target toAorB_alt_0_toA_node_a_inlined__sub0_0 from toAorB_edge_y_inlined__sub0_0 
                GRGEN_LGSP.LGSPNode candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0 = candidate_toAorB_edge_y_inlined__sub0_0.lgspTarget;
                if(candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0.lgspType.TypeID!=1) {
                    continue;
                }
                if((candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                {
                    continue;
                }
                // Check whether there are subpattern matching tasks left to execute
                if(openTasks.Count==0)
                {
                    Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                    foundPartialMatches.Add(currentFoundPartialMatch);
                    Pattern_toAorB.Match_toAorB_alt_0_toA match = new Pattern_toAorB.Match_toAorB_alt_0_toA();
                    match._node_a = candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0;
                    match._edge_y = candidate_toAorB_edge_y_inlined__sub0_0;
                    currentFoundPartialMatch.Push(match);
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        openTasks.Push(this);
                        return;
                    }
                    continue;
                }
                uint prevGlobal__candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0;
                prevGlobal__candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0 = candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                // Match subpatterns 
                openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                // Check whether subpatterns were found 
                if(matchesList.Count>0) {
                    // subpatterns/alternatives were found, extend the partial matches by our local match object
                    foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                    {
                        Pattern_toAorB.Match_toAorB_alt_0_toA match = new Pattern_toAorB.Match_toAorB_alt_0_toA();
                        match._node_a = candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0;
                        match._edge_y = candidate_toAorB_edge_y_inlined__sub0_0;
                        currentFoundPartialMatch.Push(match);
                    }
                    if(matchesList==foundPartialMatches) {
                        matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                    } else {
                        foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                            foundPartialMatches.Add(match);
                        }
                        matchesList.Clear();
                    }
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0.lgspFlags = candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0;
                        openTasks.Push(this);
                        return;
                    }
                    candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0.lgspFlags = candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0;
                    continue;
                }
                candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0.lgspFlags = candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_alt_0_toA_node_a_inlined__sub0_0;
            } while(false);
            if(matchesList.Count>0) {
                if(matchesList==foundPartialMatches) {
                    matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                } else {
                    foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                        foundPartialMatches.Add(match);
                    }
                    matchesList.Clear();
                }
            }
            // Alternative case toAorB_alt_0_toB 
            do {
                patternGraph = patternGraphs[(int)Pattern_toAorB.toAorB_alt_0_CaseNums.@toB];
                // SubPreset toAorB_edge_y_inlined__sub0_0 
                GRGEN_LGSP.LGSPEdge candidate_toAorB_edge_y_inlined__sub0_0 = toAorB_edge_y_inlined__sub0_0;
                // Implicit Target toAorB_alt_0_toB_node_b_inlined__sub0_0 from toAorB_edge_y_inlined__sub0_0 
                GRGEN_LGSP.LGSPNode candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0 = candidate_toAorB_edge_y_inlined__sub0_0.lgspTarget;
                if(candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0.lgspType.TypeID!=2) {
                    continue;
                }
                if((candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                {
                    continue;
                }
                // Check whether there are subpattern matching tasks left to execute
                if(openTasks.Count==0)
                {
                    Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                    foundPartialMatches.Add(currentFoundPartialMatch);
                    Pattern_toAorB.Match_toAorB_alt_0_toB match = new Pattern_toAorB.Match_toAorB_alt_0_toB();
                    match._node_b = candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0;
                    match._edge_y = candidate_toAorB_edge_y_inlined__sub0_0;
                    currentFoundPartialMatch.Push(match);
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        openTasks.Push(this);
                        return;
                    }
                    continue;
                }
                uint prevGlobal__candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0;
                prevGlobal__candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0 = candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                // Match subpatterns 
                openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                // Check whether subpatterns were found 
                if(matchesList.Count>0) {
                    // subpatterns/alternatives were found, extend the partial matches by our local match object
                    foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                    {
                        Pattern_toAorB.Match_toAorB_alt_0_toB match = new Pattern_toAorB.Match_toAorB_alt_0_toB();
                        match._node_b = candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0;
                        match._edge_y = candidate_toAorB_edge_y_inlined__sub0_0;
                        currentFoundPartialMatch.Push(match);
                    }
                    if(matchesList==foundPartialMatches) {
                        matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                    } else {
                        foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                            foundPartialMatches.Add(match);
                        }
                        matchesList.Clear();
                    }
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0.lgspFlags = candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0;
                        openTasks.Push(this);
                        return;
                    }
                    candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0.lgspFlags = candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0;
                    continue;
                }
                candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0.lgspFlags = candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_toAorB_alt_0_toB_node_b_inlined__sub0_0;
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_alternative_in_negative
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_negative.IMatch_alternative_in_negative> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_alternative_in_negative.IMatch_alternative_in_negative match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_negative.IMatch_alternative_in_negative> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_alternative_in_negative : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_alternative_in_negative
    {
        public Action_alternative_in_negative()
            : base(Rule_alternative_in_negative.Instance.patternGraph)
        {
            _rulePattern = Rule_alternative_in_negative.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_alternative_in_negative _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "alternative_in_negative"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_alternative_in_negative.Match_alternative_in_negative, Rule_alternative_in_negative.IMatch_alternative_in_negative> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_alternative_in_negative Instance { get { return instance; } set { instance = value; } }
        private static Action_alternative_in_negative instance = new Action_alternative_in_negative();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_negative.IMatch_alternative_in_negative> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_alternative_in_negative.Match_alternative_in_negative, Rule_alternative_in_negative.IMatch_alternative_in_negative>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            // NegativePattern 
            {
                ++isoSpace;
                Stack<GRGEN_LGSP.LGSPSubpatternAction> neg_0_openTasks = new Stack<GRGEN_LGSP.LGSPSubpatternAction>();
                List<Stack<GRGEN_LIBGR.IMatch>> neg_0_foundPartialMatches = new List<Stack<GRGEN_LIBGR.IMatch>>();
                List<Stack<GRGEN_LIBGR.IMatch>> neg_0_matchesList = neg_0_foundPartialMatches;
                // Push alternative matching task for alternative_in_negative_neg_0_alt_0
                AlternativeAction_alternative_in_negative_neg_0_alt_0 taskFor_neg_0_alt_0 = AlternativeAction_alternative_in_negative_neg_0_alt_0.getNewTask(actionEnv, neg_0_openTasks, Rule_alternative_in_negative.Instance.alternative_in_negative_neg_0.alternatives[(int)Rule_alternative_in_negative.alternative_in_negative_neg_0_AltNums.@alt_0].alternativeCases);
                taskFor_neg_0_alt_0.searchPatternpath = false;
                taskFor_neg_0_alt_0.matchOfNestingPattern = null;
                taskFor_neg_0_alt_0.lastMatchAtPreviousNestingLevel = null;
                neg_0_openTasks.Push(taskFor_neg_0_alt_0);
                // Match subpatterns of neg_0_
                neg_0_openTasks.Peek().myMatch(neg_0_matchesList, 1, isoSpace);
                // Pop alternative matching task for alternative_in_negative_neg_0_alt_0
                neg_0_openTasks.Pop();
                AlternativeAction_alternative_in_negative_neg_0_alt_0.releaseTask(taskFor_neg_0_alt_0);
                // Check whether subpatterns were found 
                if(neg_0_matchesList.Count>0) {
                    // negative pattern with contained subpatterns found
                    neg_0_matchesList.Clear();
                    --isoSpace;
                    return matches;
                }
                --isoSpace;
            }
            Rule_alternative_in_negative.Match_alternative_in_negative match = matches.GetNextUnfilledPosition();
            matches.PositionWasFilledFixIt();
            // if enough matches were found, we leave
            if(maxMatches > 0 && matches.Count >= maxMatches)
            {
                return matches;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_negative.IMatch_alternative_in_negative> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_negative.IMatch_alternative_in_negative> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_alternative_in_negative.IMatch_alternative_in_negative match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_negative.IMatch_alternative_in_negative> matches)
        {
            foreach(Rule_alternative_in_negative.IMatch_alternative_in_negative match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_negative.IMatch_alternative_in_negative> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_negative.IMatch_alternative_in_negative> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_alternative_in_negative.IMatch_alternative_in_negative match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_negative.IMatch_alternative_in_negative> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_negative.IMatch_alternative_in_negative> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_negative.IMatch_alternative_in_negative> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_alternative_in_negative.IMatch_alternative_in_negative)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_negative.IMatch_alternative_in_negative>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    public class AlternativeAction_alternative_in_negative_neg_0_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_alternative_in_negative_neg_0_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_alternative_in_negative_neg_0_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_alternative_in_negative_neg_0_alt_0 newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_alternative_in_negative_neg_0_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_alternative_in_negative_neg_0_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_alternative_in_negative_neg_0_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_alternative_in_negative_neg_0_alt_0 next = null;

        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // Alternative case alternative_in_negative_neg_0_alt_0_Foo 
            do {
                patternGraph = patternGraphs[(int)Rule_alternative_in_negative.alternative_in_negative_neg_0_alt_0_CaseNums.@Foo];
                // Lookup alternative_in_negative_neg_0_alt_0_Foo_node__node0 
                foreach(GRGEN_LIBGR.NodeType type_candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0 in GRGEN_MODEL.NodeType_Node.typeVar.SubOrSameTypes)
                {
                    int type_id_candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0 = type_candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0.TypeID;
                    for(GRGEN_LGSP.LGSPNode head_candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0 = graph.nodesByTypeHeads[type_id_candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0], candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0 = head_candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0.lgspTypeNext; candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0 != head_candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0; candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0 = candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0.lgspTypeNext)
                    {
                        if((candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Check whether there are subpattern matching tasks left to execute
                        if(openTasks.Count==0)
                        {
                            Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                            foundPartialMatches.Add(currentFoundPartialMatch);
                            Rule_alternative_in_negative.Match_alternative_in_negative_neg_0_alt_0_Foo match = new Rule_alternative_in_negative.Match_alternative_in_negative_neg_0_alt_0_Foo();
                            match._node__node0 = candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0;
                            currentFoundPartialMatch.Push(match);
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                            {
                                openTasks.Push(this);
                                return;
                            }
                            continue;
                        }
                        uint prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0;
                        prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0 = candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Check whether subpatterns were found 
                        if(matchesList.Count>0) {
                            // subpatterns/alternatives were found, extend the partial matches by our local match object
                            foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                            {
                                Rule_alternative_in_negative.Match_alternative_in_negative_neg_0_alt_0_Foo match = new Rule_alternative_in_negative.Match_alternative_in_negative_neg_0_alt_0_Foo();
                                match._node__node0 = candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0;
                                currentFoundPartialMatch.Push(match);
                            }
                            if(matchesList==foundPartialMatches) {
                                matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                            } else {
                                foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                    foundPartialMatches.Add(match);
                                }
                                matchesList.Clear();
                            }
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                            {
                                candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0;
                            continue;
                        }
                        candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Foo_node__node0;
                    }
                }
            } while(false);
            if(matchesList.Count>0) {
                if(matchesList==foundPartialMatches) {
                    matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                } else {
                    foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                        foundPartialMatches.Add(match);
                    }
                    matchesList.Clear();
                }
            }
            // Alternative case alternative_in_negative_neg_0_alt_0_Bar 
            do {
                patternGraph = patternGraphs[(int)Rule_alternative_in_negative.alternative_in_negative_neg_0_alt_0_CaseNums.@Bar];
                // Lookup alternative_in_negative_neg_0_alt_0_Bar_edge__edge0 
                int type_id_candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0 = 1;
                for(GRGEN_LGSP.LGSPEdge head_candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0 = graph.edgesByTypeHeads[type_id_candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0], candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0 = head_candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0.lgspTypeNext; candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0 != head_candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0; candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0 = candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0.lgspTypeNext)
                {
                    if((candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                    {
                        continue;
                    }
                    // Implicit Source alternative_in_negative_neg_0_alt_0_Bar_node__node0 from alternative_in_negative_neg_0_alt_0_Bar_edge__edge0 
                    GRGEN_LGSP.LGSPNode candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0 = candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0.lgspSource;
                    if((candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                    {
                        continue;
                    }
                    uint prev__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0;
                    prev__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0 = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    // Implicit Target alternative_in_negative_neg_0_alt_0_Bar_node__node1 from alternative_in_negative_neg_0_alt_0_Bar_edge__edge0 
                    GRGEN_LGSP.LGSPNode candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1 = candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0.lgspTarget;
                    if((candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                    {
                        candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0;
                        continue;
                    }
                    if((candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                    {
                        candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0;
                        continue;
                    }
                    // Check whether there are subpattern matching tasks left to execute
                    if(openTasks.Count==0)
                    {
                        Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                        foundPartialMatches.Add(currentFoundPartialMatch);
                        Rule_alternative_in_negative.Match_alternative_in_negative_neg_0_alt_0_Bar match = new Rule_alternative_in_negative.Match_alternative_in_negative_neg_0_alt_0_Bar();
                        match._node__node0 = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0;
                        match._node__node1 = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1;
                        match._edge__edge0 = candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0;
                        currentFoundPartialMatch.Push(match);
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0;
                            openTasks.Push(this);
                            return;
                        }
                        candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0;
                        continue;
                    }
                    uint prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0;
                    prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0 = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    uint prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1;
                    prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1 = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    uint prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0;
                    prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0 = candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    // Match subpatterns 
                    openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                    // Check whether subpatterns were found 
                    if(matchesList.Count>0) {
                        // subpatterns/alternatives were found, extend the partial matches by our local match object
                        foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                        {
                            Rule_alternative_in_negative.Match_alternative_in_negative_neg_0_alt_0_Bar match = new Rule_alternative_in_negative.Match_alternative_in_negative_neg_0_alt_0_Bar();
                            match._node__node0 = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0;
                            match._node__node1 = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1;
                            match._edge__edge0 = candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0;
                            currentFoundPartialMatch.Push(match);
                        }
                        if(matchesList==foundPartialMatches) {
                            matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                        } else {
                            foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                foundPartialMatches.Add(match);
                            }
                            matchesList.Clear();
                        }
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0;
                            candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1;
                            candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0;
                            candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0;
                            openTasks.Push(this);
                            return;
                        }
                        candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0;
                        candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1;
                        candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0;
                        candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0;
                        continue;
                    }
                    candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0;
                    candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node1;
                    candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_negative_neg_0_alt_0_Bar_edge__edge0;
                    candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_alternative_in_negative_neg_0_alt_0_Bar_node__node0;
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    /// <summary>
    /// An object representing an executable rule - same as IAction, but with exact types and distinct parameters.
    /// </summary>
    public interface IAction_alternative_in_iterated
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_iterated.IMatch_alternative_in_iterated> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_alternative_in_iterated.IMatch_alternative_in_iterated match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_iterated.IMatch_alternative_in_iterated> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyAll, but with exact types and distinct parameters; returns the number of matches found/applied. </summary>
        int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max);
    }
    
    public class Action_alternative_in_iterated : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_alternative_in_iterated
    {
        public Action_alternative_in_iterated()
            : base(Rule_alternative_in_iterated.Instance.patternGraph)
        {
            _rulePattern = Rule_alternative_in_iterated.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_alternative_in_iterated _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "alternative_in_iterated"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_alternative_in_iterated.Match_alternative_in_iterated, Rule_alternative_in_iterated.IMatch_alternative_in_iterated> matches;

        // Performance optimization: saves us usage of new for the return array or the return arrays. In the object/string-style modify/apply methods of the action interface implementation.
        [ThreadStatic] public static object[] ReturnArray;
        [ThreadStatic] public static List<object[]> ReturnArrayListForAll;
        [ThreadStatic] public static List<object[]> AvailableReturnArrays;
        public static Action_alternative_in_iterated Instance { get { return instance; } set { instance = value; } }
        private static Action_alternative_in_iterated instance = new Action_alternative_in_iterated();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_iterated.IMatch_alternative_in_iterated> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_alternative_in_iterated.Match_alternative_in_iterated, Rule_alternative_in_iterated.IMatch_alternative_in_iterated>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks = new Stack<GRGEN_LGSP.LGSPSubpatternAction>();
            List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches = new List<Stack<GRGEN_LIBGR.IMatch>>();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            // Push iterated matching task for alternative_in_iterated_iter_0
            IteratedAction_alternative_in_iterated_iter_0 taskFor_iter_0 = IteratedAction_alternative_in_iterated_iter_0.getNewTask(actionEnv, openTasks);
            taskFor_iter_0.searchPatternpath = false;
            taskFor_iter_0.matchOfNestingPattern = null;
            taskFor_iter_0.lastMatchAtPreviousNestingLevel = null;
            openTasks.Push(taskFor_iter_0);
            // Match subpatterns 
            openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
            // Pop iterated matching task for alternative_in_iterated_iter_0
            openTasks.Pop();
            IteratedAction_alternative_in_iterated_iter_0.releaseTask(taskFor_iter_0);
            // Check whether subpatterns were found 
            if(matchesList.Count>0) {
                // subpatterns/alternatives were found, extend the partial matches by our local match object, becoming a complete match object and save it
                foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                {
                    Rule_alternative_in_iterated.Match_alternative_in_iterated match = matches.GetNextUnfilledPosition();
                    match._iter_0 = new GRGEN_LGSP.LGSPMatchesList<Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0, Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0>(null);
                    while(currentFoundPartialMatch.Count>0 && currentFoundPartialMatch.Peek() is Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0) {
                        Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0 cfpm = (Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0)currentFoundPartialMatch.Pop();
                        if(cfpm.IsNullMatch) break;
                        cfpm.SetMatchOfEnclosingPattern(match);
                        match._iter_0.Add(cfpm);
                    }
                    matches.PositionWasFilledFixIt();
                }
                matchesList.Clear();
                // if enough matches were found, we leave
                if(maxMatches > 0 && matches.Count >= maxMatches)
                {
                    return matches;
                }
                return matches;
            }
            return matches;
        }
        /// <summary> Type of the matcher method (with parameters processing environment containing host graph, maximum number of matches to search for (zero=unlimited), and rule parameters; returning found matches). </summary>
        public delegate GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_iterated.IMatch_alternative_in_iterated> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches);
        /// <summary> A delegate pointing to the current matcher program for this rule. </summary>
        public MatchInvoker DynamicMatch;
        /// <summary> The RulePattern object from which this LGSPAction object has been created. </summary>
        public GRGEN_LIBGR.IRulePattern RulePattern { get { return _rulePattern; } }
        public GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_iterated.IMatch_alternative_in_iterated> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_alternative_in_iterated.IMatch_alternative_in_iterated match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_iterated.IMatch_alternative_in_iterated> matches)
        {
            foreach(Rule_alternative_in_iterated.IMatch_alternative_in_iterated match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_iterated.IMatch_alternative_in_iterated> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_iterated.IMatch_alternative_in_iterated> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_alternative_in_iterated.IMatch_alternative_in_iterated match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_iterated.IMatch_alternative_in_iterated> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_iterated.IMatch_alternative_in_iterated> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_iterated.IMatch_alternative_in_iterated> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
            return true;
        }
        // implementation of inexact action interface by delegation to exact action interface
        public GRGEN_LIBGR.IMatches Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, object[] parameters)
        {
            return Match(actionEnv, maxMatches);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_alternative_in_iterated.IMatch_alternative_in_iterated)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_alternative_in_iterated.IMatch_alternative_in_iterated>)matches);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv)) {
                return ReturnArray;
            }
            else return null;
        }
        public List<object[]> Reserve(int numReturns)
        {
            if(AvailableReturnArrays == null)
                AvailableReturnArrays = new List<object[]>();
            while(AvailableReturnArrays.Count < numReturns) AvailableReturnArrays.Add(new object[0]);
            if(ReturnArrayListForAll == null)
                ReturnArrayListForAll = new List<object[]>();
            ReturnArrayListForAll.Clear();
            for(int i=0; i<numReturns; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[0]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max);
        }
        public void Filter(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches, GRGEN_LIBGR.FilterCallWithArguments filter)
        {
            switch(filter.PackagePrefixedName) {
                case "keepFirst": matches.Filter_keepFirst((System.Int32)(filter.Arguments[0])); break;
                case "keepLast": matches.Filter_keepLast((System.Int32)(filter.Arguments[0])); break;
                case "keepFirstFraction": matches.Filter_keepFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "keepLastFraction": matches.Filter_keepLastFraction((System.Double)(filter.Arguments[0])); break;
                case "removeFirst": matches.Filter_removeFirst((System.Int32)(filter.Arguments[0])); break;
                case "removeLast": matches.Filter_removeLast((System.Int32)(filter.Arguments[0])); break;
                case "removeFirstFraction": matches.Filter_removeFirstFraction((System.Double)(filter.Arguments[0])); break;
                case "removeLastFraction": matches.Filter_removeLastFraction((System.Double)(filter.Arguments[0])); break;
                default: throw new Exception("Unknown filter name " + filter.PackagePrefixedName + "!");
            }
        }
    }
    
    public class IteratedAction_alternative_in_iterated_iter_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private IteratedAction_alternative_in_iterated_iter_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_)
            : base(null)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
            patternGraph = Rule_alternative_in_iterated.Instance.patternGraph;
            minMatchesIter = 0;
            maxMatchesIter = 0;
            numMatchesIter = 0;
        }

        int minMatchesIter;
        int maxMatchesIter;
        int numMatchesIter;

        public static IteratedAction_alternative_in_iterated_iter_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_) {
            IteratedAction_alternative_in_iterated_iter_0 newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new IteratedAction_alternative_in_iterated_iter_0(actionEnv_, openTasks_);
            }
            return newTask;
        }

        public static void releaseTask(IteratedAction_alternative_in_iterated_iter_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static IteratedAction_alternative_in_iterated_iter_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private IteratedAction_alternative_in_iterated_iter_0 next = null;

        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            bool patternFound = false;
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // if the maximum number of matches of the iterated is reached, we complete iterated matching by building the null match object
            if(maxMatchesIter>0 && numMatchesIter>=maxMatchesIter) goto maxMatchesIterReached;
            // dummy loop for iterated matching return prevention
            do
            {
                // Lookup alternative_in_iterated_iter_0_node__node0 
                foreach(GRGEN_LIBGR.NodeType type_candidate_alternative_in_iterated_iter_0_node__node0 in GRGEN_MODEL.NodeType_Node.typeVar.SubOrSameTypes)
                {
                    int type_id_candidate_alternative_in_iterated_iter_0_node__node0 = type_candidate_alternative_in_iterated_iter_0_node__node0.TypeID;
                    for(GRGEN_LGSP.LGSPNode head_candidate_alternative_in_iterated_iter_0_node__node0 = graph.nodesByTypeHeads[type_id_candidate_alternative_in_iterated_iter_0_node__node0], candidate_alternative_in_iterated_iter_0_node__node0 = head_candidate_alternative_in_iterated_iter_0_node__node0.lgspTypeNext; candidate_alternative_in_iterated_iter_0_node__node0 != head_candidate_alternative_in_iterated_iter_0_node__node0; candidate_alternative_in_iterated_iter_0_node__node0 = candidate_alternative_in_iterated_iter_0_node__node0.lgspTypeNext)
                    {
                        if((candidate_alternative_in_iterated_iter_0_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // accept iterated instance match
                        ++numMatchesIter;
                        // Push alternative matching task for alternative_in_iterated_iter_0_alt_0
                        AlternativeAction_alternative_in_iterated_iter_0_alt_0 taskFor_alt_0 = AlternativeAction_alternative_in_iterated_iter_0_alt_0.getNewTask(actionEnv, openTasks, Rule_alternative_in_iterated.Instance.alternative_in_iterated_iter_0.alternatives[(int)Rule_alternative_in_iterated.alternative_in_iterated_iter_0_AltNums.@alt_0].alternativeCases);
                        taskFor_alt_0.searchPatternpath = false;
                        taskFor_alt_0.matchOfNestingPattern = null;
                        taskFor_alt_0.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor_alt_0);
                        uint prevGlobal__candidate_alternative_in_iterated_iter_0_node__node0;
                        prevGlobal__candidate_alternative_in_iterated_iter_0_node__node0 = candidate_alternative_in_iterated_iter_0_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_alternative_in_iterated_iter_0_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop alternative matching task for alternative_in_iterated_iter_0_alt_0
                        openTasks.Pop();
                        AlternativeAction_alternative_in_iterated_iter_0_alt_0.releaseTask(taskFor_alt_0);
                        // Check whether subpatterns were found 
                        if(matchesList.Count>0) {
                            patternFound = true;
                            // subpatterns/alternatives were found, extend the partial matches by our local match object
                            foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                            {
                                Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0 match = new Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0();
                                match._node__node0 = candidate_alternative_in_iterated_iter_0_node__node0;
                                match._alt_0 = (Rule_alternative_in_iterated.IMatch_alternative_in_iterated_iter_0_alt_0)currentFoundPartialMatch.Pop();
                                match._alt_0.SetMatchOfEnclosingPattern(match);
                                currentFoundPartialMatch.Push(match);
                            }
                            // if enough matches were found, we leave
                            if(true) // as soon as there's a match, it's enough for iterated
                            {
                                candidate_alternative_in_iterated_iter_0_node__node0.lgspFlags = candidate_alternative_in_iterated_iter_0_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_iterated_iter_0_node__node0;
                                --numMatchesIter;
                                goto maxMatchesIterReached;
                            }
                            candidate_alternative_in_iterated_iter_0_node__node0.lgspFlags = candidate_alternative_in_iterated_iter_0_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_iterated_iter_0_node__node0;
                            --numMatchesIter;
                            continue;
                        }
                        candidate_alternative_in_iterated_iter_0_node__node0.lgspFlags = candidate_alternative_in_iterated_iter_0_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_iterated_iter_0_node__node0;
                        --numMatchesIter;
                    }
                }
            } while(false);
            // Check whether the iterated pattern null match was found
maxMatchesIterReached:
            if(!patternFound && numMatchesIter>=minMatchesIter)
            {
                openTasks.Pop();
                // Check whether there are subpattern matching tasks left to execute
                if(openTasks.Count==0)
                {
                    Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                    foundPartialMatches.Add(currentFoundPartialMatch);
                    Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0 match = new Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0();
                    match._isNullMatch = true; // null match of iterated pattern
                    currentFoundPartialMatch.Push(match);
                    openTasks.Push(this);
                    return;
                }
                // Match subpatterns 
                openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                // Check whether subpatterns were found 
                if(matchesList.Count>0) {
                    // subpatterns/alternatives were found, extend the partial matches by our local match object
                    foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                    {
                        Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0 match = new Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0();
                        match._isNullMatch = true; // null match of iterated pattern
                        currentFoundPartialMatch.Push(match);
                    }
                }
                openTasks.Push(this);
                return;
            }
            return;
        }
    }
    
    public class AlternativeAction_alternative_in_iterated_iter_0_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_alternative_in_iterated_iter_0_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_alternative_in_iterated_iter_0_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_alternative_in_iterated_iter_0_alt_0 newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_alternative_in_iterated_iter_0_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_alternative_in_iterated_iter_0_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_alternative_in_iterated_iter_0_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_alternative_in_iterated_iter_0_alt_0 next = null;

        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // Alternative case alternative_in_iterated_iter_0_alt_0_Foo 
            do {
                patternGraph = patternGraphs[(int)Rule_alternative_in_iterated.alternative_in_iterated_iter_0_alt_0_CaseNums.@Foo];
                // Lookup alternative_in_iterated_iter_0_alt_0_Foo_node__node0 
                foreach(GRGEN_LIBGR.NodeType type_candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0 in GRGEN_MODEL.NodeType_Node.typeVar.SubOrSameTypes)
                {
                    int type_id_candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0 = type_candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0.TypeID;
                    for(GRGEN_LGSP.LGSPNode head_candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0 = graph.nodesByTypeHeads[type_id_candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0], candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0 = head_candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0.lgspTypeNext; candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0 != head_candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0; candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0 = candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0.lgspTypeNext)
                    {
                        if((candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Check whether there are subpattern matching tasks left to execute
                        if(openTasks.Count==0)
                        {
                            Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                            foundPartialMatches.Add(currentFoundPartialMatch);
                            Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0_alt_0_Foo match = new Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0_alt_0_Foo();
                            match._node__node0 = candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0;
                            currentFoundPartialMatch.Push(match);
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                            {
                                openTasks.Push(this);
                                return;
                            }
                            continue;
                        }
                        uint prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0;
                        prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0 = candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Check whether subpatterns were found 
                        if(matchesList.Count>0) {
                            // subpatterns/alternatives were found, extend the partial matches by our local match object
                            foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                            {
                                Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0_alt_0_Foo match = new Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0_alt_0_Foo();
                                match._node__node0 = candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0;
                                currentFoundPartialMatch.Push(match);
                            }
                            if(matchesList==foundPartialMatches) {
                                matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                            } else {
                                foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                    foundPartialMatches.Add(match);
                                }
                                matchesList.Clear();
                            }
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                            {
                                candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0;
                            continue;
                        }
                        candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Foo_node__node0;
                    }
                }
            } while(false);
            if(matchesList.Count>0) {
                if(matchesList==foundPartialMatches) {
                    matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                } else {
                    foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                        foundPartialMatches.Add(match);
                    }
                    matchesList.Clear();
                }
            }
            // Alternative case alternative_in_iterated_iter_0_alt_0_Bar 
            do {
                patternGraph = patternGraphs[(int)Rule_alternative_in_iterated.alternative_in_iterated_iter_0_alt_0_CaseNums.@Bar];
                // Lookup alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0 
                int type_id_candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0 = 1;
                for(GRGEN_LGSP.LGSPEdge head_candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0 = graph.edgesByTypeHeads[type_id_candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0], candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0 = head_candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0.lgspTypeNext; candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0 != head_candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0; candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0 = candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0.lgspTypeNext)
                {
                    if((candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                    {
                        continue;
                    }
                    // Implicit Source alternative_in_iterated_iter_0_alt_0_Bar_node__node0 from alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0 
                    GRGEN_LGSP.LGSPNode candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0 = candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0.lgspSource;
                    if((candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                    {
                        continue;
                    }
                    uint prev__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0;
                    prev__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0 = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    // Implicit Target alternative_in_iterated_iter_0_alt_0_Bar_node__node1 from alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0 
                    GRGEN_LGSP.LGSPNode candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1 = candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0.lgspTarget;
                    if((candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                    {
                        candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0;
                        continue;
                    }
                    if((candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                    {
                        candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0;
                        continue;
                    }
                    // Check whether there are subpattern matching tasks left to execute
                    if(openTasks.Count==0)
                    {
                        Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch = new Stack<GRGEN_LIBGR.IMatch>();
                        foundPartialMatches.Add(currentFoundPartialMatch);
                        Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0_alt_0_Bar match = new Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0_alt_0_Bar();
                        match._node__node0 = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0;
                        match._node__node1 = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1;
                        match._edge__edge0 = candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0;
                        currentFoundPartialMatch.Push(match);
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0;
                            openTasks.Push(this);
                            return;
                        }
                        candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0;
                        continue;
                    }
                    uint prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0;
                    prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0 = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    uint prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1;
                    prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1 = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    uint prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0;
                    prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0 = candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                    // Match subpatterns 
                    openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                    // Check whether subpatterns were found 
                    if(matchesList.Count>0) {
                        // subpatterns/alternatives were found, extend the partial matches by our local match object
                        foreach(Stack<GRGEN_LIBGR.IMatch> currentFoundPartialMatch in matchesList)
                        {
                            Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0_alt_0_Bar match = new Rule_alternative_in_iterated.Match_alternative_in_iterated_iter_0_alt_0_Bar();
                            match._node__node0 = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0;
                            match._node__node1 = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1;
                            match._edge__edge0 = candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0;
                            currentFoundPartialMatch.Push(match);
                        }
                        if(matchesList==foundPartialMatches) {
                            matchesList = new List<Stack<GRGEN_LIBGR.IMatch>>();
                        } else {
                            foreach(Stack<GRGEN_LIBGR.IMatch> match in matchesList) {
                                foundPartialMatches.Add(match);
                            }
                            matchesList.Clear();
                        }
                        // if enough matches were found, we leave
                        if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                        {
                            candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0;
                            candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1;
                            candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0;
                            candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0;
                            openTasks.Push(this);
                            return;
                        }
                        candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0;
                        candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1;
                        candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0;
                        candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0;
                        continue;
                    }
                    candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0;
                    candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node1;
                    candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_alternative_in_iterated_iter_0_alt_0_Bar_edge__edge0;
                    candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags = candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_alternative_in_iterated_iter_0_alt_0_Bar_node__node0;
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    

    // class which instantiates and stores all the compiled actions of the module,
    // dynamic regeneration and compilation causes the old action to be overwritten by the new one
    // matching/rule patterns are analyzed at creation time here, once, so that later regeneration runs have all the information available
    public class AlternativesActions : GRGEN_LGSP.LGSPActions
    {
        public AlternativesActions(GRGEN_LGSP.LGSPGraph lgspgraph, string modelAsmName, string actionsAsmName)
            : base(lgspgraph, modelAsmName, actionsAsmName)
        {
            InitActions();
        }

        public AlternativesActions(GRGEN_LGSP.LGSPGraph lgspgraph)
            : base(lgspgraph)
        {
            InitActions();
        }

        private void InitActions()
        {
            packages = new string[0];
            GRGEN_LGSP.PatternGraphAnalyzer analyzer = new GRGEN_LGSP.PatternGraphAnalyzer();
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_toAorB.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Pattern_toAorB.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Pattern_toAorB.Instance);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createA.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_createA.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_createA.Instance);
            actions.Add("createA", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_createA.Instance);
            @createA = GRGEN_ACTIONS.Action_createA.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createB.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_createB.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_createB.Instance);
            actions.Add("createB", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_createB.Instance);
            @createB = GRGEN_ACTIONS.Action_createB.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createC.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_createC.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_createC.Instance);
            actions.Add("createC", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_createC.Instance);
            @createC = GRGEN_ACTIONS.Action_createC.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createAtoB.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_createAtoB.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_createAtoB.Instance);
            actions.Add("createAtoB", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_createAtoB.Instance);
            @createAtoB = GRGEN_ACTIONS.Action_createAtoB.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_leer.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_leer.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_leer.Instance);
            actions.Add("leer", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_leer.Instance);
            @leer = GRGEN_ACTIONS.Action_leer.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_AorB.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_AorB.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_AorB.Instance);
            actions.Add("AorB", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_AorB.Instance);
            @AorB = GRGEN_ACTIONS.Action_AorB.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_AandnotCorB.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_AandnotCorB.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_AandnotCorB.Instance);
            actions.Add("AandnotCorB", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_AandnotCorB.Instance);
            @AandnotCorB = GRGEN_ACTIONS.Action_AandnotCorB.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_AorBorC.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_AorBorC.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_AorBorC.Instance);
            actions.Add("AorBorC", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_AorBorC.Instance);
            @AorBorC = GRGEN_ACTIONS.Action_AorBorC.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_AtoAorB.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_AtoAorB.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_AtoAorB.Instance);
            actions.Add("AtoAorB", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_AtoAorB.Instance);
            @AtoAorB = GRGEN_ACTIONS.Action_AtoAorB.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createComplex.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_createComplex.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_createComplex.Instance);
            actions.Add("createComplex", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_createComplex.Instance);
            @createComplex = GRGEN_ACTIONS.Action_createComplex.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_Complex.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_Complex.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_Complex.Instance);
            actions.Add("Complex", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_Complex.Instance);
            @Complex = GRGEN_ACTIONS.Action_Complex.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_ComplexMax.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_ComplexMax.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_ComplexMax.Instance);
            actions.Add("ComplexMax", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_ComplexMax.Instance);
            @ComplexMax = GRGEN_ACTIONS.Action_ComplexMax.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createABA.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_createABA.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_createABA.Instance);
            actions.Add("createABA", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_createABA.Instance);
            @createABA = GRGEN_ACTIONS.Action_createABA.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_homm.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_homm.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_homm.Instance);
            actions.Add("homm", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_homm.Instance);
            @homm = GRGEN_ACTIONS.Action_homm.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_XtoAorB.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_XtoAorB.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_XtoAorB.Instance);
            actions.Add("XtoAorB", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_XtoAorB.Instance);
            @XtoAorB = GRGEN_ACTIONS.Action_XtoAorB.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_alternative_in_negative.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_alternative_in_negative.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_alternative_in_negative.Instance);
            actions.Add("alternative_in_negative", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_alternative_in_negative.Instance);
            @alternative_in_negative = GRGEN_ACTIONS.Action_alternative_in_negative.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_alternative_in_iterated.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_alternative_in_iterated.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_alternative_in_iterated.Instance);
            actions.Add("alternative_in_iterated", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_alternative_in_iterated.Instance);
            @alternative_in_iterated = GRGEN_ACTIONS.Action_alternative_in_iterated.Instance;
            analyzer.ComputeInterPatternRelations(false);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Pattern_toAorB.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_createA.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_createB.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_createC.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_createAtoB.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_leer.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_AorB.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_AandnotCorB.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_AorBorC.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_AtoAorB.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_createComplex.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_Complex.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_ComplexMax.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_createABA.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_homm.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_XtoAorB.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_alternative_in_negative.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_alternative_in_iterated.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Pattern_toAorB.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_createA.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_createB.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_createC.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_createAtoB.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_leer.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_AorB.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_AandnotCorB.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_AorBorC.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_AtoAorB.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_createComplex.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_Complex.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_ComplexMax.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_createABA.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_homm.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_XtoAorB.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_alternative_in_negative.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_alternative_in_iterated.Instance.patternGraph);
            GRGEN_ACTIONS.Pattern_toAorB.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_createA.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_createB.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_createC.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_createAtoB.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_leer.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_AorB.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_AandnotCorB.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_AorBorC.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_AtoAorB.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_createComplex.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_Complex.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_ComplexMax.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_createABA.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_homm.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_XtoAorB.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_alternative_in_negative.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_alternative_in_iterated.Instance.patternGraph.maxIsoSpace = 0;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_toAorB.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createA.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createB.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createC.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createAtoB.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_leer.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_AorB.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_AandnotCorB.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_AorBorC.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_AtoAorB.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createComplex.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_Complex.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_ComplexMax.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createABA.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_homm.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_XtoAorB.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_alternative_in_negative.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_alternative_in_iterated.Instance.patternGraph, true);
            analyzer.ComputeInterPatternRelations(true);
        }
        
        public GRGEN_ACTIONS.IAction_createA @createA;
        public GRGEN_ACTIONS.IAction_createB @createB;
        public GRGEN_ACTIONS.IAction_createC @createC;
        public GRGEN_ACTIONS.IAction_createAtoB @createAtoB;
        public GRGEN_ACTIONS.IAction_leer @leer;
        public GRGEN_ACTIONS.IAction_AorB @AorB;
        public GRGEN_ACTIONS.IAction_AandnotCorB @AandnotCorB;
        public GRGEN_ACTIONS.IAction_AorBorC @AorBorC;
        public GRGEN_ACTIONS.IAction_AtoAorB @AtoAorB;
        public GRGEN_ACTIONS.IAction_createComplex @createComplex;
        public GRGEN_ACTIONS.IAction_Complex @Complex;
        public GRGEN_ACTIONS.IAction_ComplexMax @ComplexMax;
        public GRGEN_ACTIONS.IAction_createABA @createABA;
        public GRGEN_ACTIONS.IAction_homm @homm;
        public GRGEN_ACTIONS.IAction_XtoAorB @XtoAorB;
        public GRGEN_ACTIONS.IAction_alternative_in_negative @alternative_in_negative;
        public GRGEN_ACTIONS.IAction_alternative_in_iterated @alternative_in_iterated;
        
        
        public override string[] Packages { get { return packages; } }
        private string[] packages;
        
        public override string Name { get { return "AlternativesActions"; } }
        public override string StatisticsPath { get { return null; } }
        public override bool LazyNIC { get { return false; } }
        public override bool InlineIndependents { get { return true; } }
        public override bool Profile { get { return false; } }

        public override IList ArrayOrderAscendingBy(IList array, string member)
        {
            if(array.Count == 0)
                return array;
            string arrayType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array.GetType());
            string arrayValueType = GRGEN_LIBGR.TypesHelper.ExtractSrc(arrayType);
            if(!arrayValueType.StartsWith("match<"))
                return null;
            if(array[0] == null)
                return null;
            if(arrayValueType == "match<>")
                arrayValueType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array[0].GetType());
            if(arrayValueType.StartsWith("match<class "))
            {
                switch(arrayValueType.Substring(12, arrayValueType.Length - 12 - 1))
                {
                default:
                    return null;
                }
            }
            else
            {
                switch(arrayValueType.Substring(6, arrayValueType.Length - 6 - 1))
                {
                case "createA":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createC":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createAtoB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "leer":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "AorB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "AandnotCorB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "AorBorC":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "AtoAorB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createComplex":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "Complex":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "ComplexMax":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createABA":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "homm":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "XtoAorB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "alternative_in_negative":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "alternative_in_iterated":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                default:
                    return null;
                }
            }
        }

        public override IList ArrayOrderDescendingBy(IList array, string member)
        {
            if(array.Count == 0)
                return array;
            string arrayType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array.GetType());
            string arrayValueType = GRGEN_LIBGR.TypesHelper.ExtractSrc(arrayType);
            if(!arrayValueType.StartsWith("match<"))
                return null;
            if(array[0] == null)
                return null;
            if(arrayValueType == "match<>")
                arrayValueType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array[0].GetType());
            if(arrayValueType.StartsWith("match<class "))
            {
                switch(arrayValueType.Substring(12, arrayValueType.Length - 12 - 1))
                {
                default:
                    return null;
                }
            }
            else
            {
                switch(arrayValueType.Substring(6, arrayValueType.Length - 6 - 1))
                {
                case "createA":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createC":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createAtoB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "leer":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "AorB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "AandnotCorB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "AorBorC":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "AtoAorB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createComplex":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "Complex":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "ComplexMax":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createABA":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "homm":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "XtoAorB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "alternative_in_negative":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "alternative_in_iterated":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                default:
                    return null;
                }
            }
        }

        public override IList ArrayGroupBy(IList array, string member)
        {
            if(array.Count == 0)
                return array;
            string arrayType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array.GetType());
            string arrayValueType = GRGEN_LIBGR.TypesHelper.ExtractSrc(arrayType);
            if(!arrayValueType.StartsWith("match<"))
                return null;
            if(array[0] == null)
                return null;
            if(arrayValueType == "match<>")
                arrayValueType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array[0].GetType());
            if(arrayValueType.StartsWith("match<class "))
            {
                switch(arrayValueType.Substring(12, arrayValueType.Length - 12 - 1))
                {
                default:
                    return null;
                }
            }
            else
            {
                switch(arrayValueType.Substring(6, arrayValueType.Length - 6 - 1))
                {
                case "createA":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createC":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createAtoB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "leer":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "AorB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "AandnotCorB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "AorBorC":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "AtoAorB":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_AtoAorB_groupBy_a(GRGEN_ACTIONS.Rule_AtoAorB.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "createComplex":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "Complex":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_Complex_groupBy_a(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array));
                    case "b":
                        return ArrayHelper.Array_Complex_groupBy_b(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array));
                    case "_edge0":
                        return ArrayHelper.Array_Complex_groupBy__edge0(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array));
                    case "_edge1":
                        return ArrayHelper.Array_Complex_groupBy__edge1(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "ComplexMax":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_ComplexMax_groupBy_a(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array));
                    case "b":
                        return ArrayHelper.Array_ComplexMax_groupBy_b(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array));
                    case "_edge0":
                        return ArrayHelper.Array_ComplexMax_groupBy__edge0(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array));
                    case "_edge1":
                        return ArrayHelper.Array_ComplexMax_groupBy__edge1(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "createABA":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "homm":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_homm_groupBy_a(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array));
                    case "b":
                        return ArrayHelper.Array_homm_groupBy_b(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array));
                    case "_edge0":
                        return ArrayHelper.Array_homm_groupBy__edge0(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array));
                    case "_edge1":
                        return ArrayHelper.Array_homm_groupBy__edge1(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "XtoAorB":
                    switch(member)
                    {
                    case "x":
                        return ArrayHelper.Array_XtoAorB_groupBy_x(GRGEN_ACTIONS.Rule_XtoAorB.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "alternative_in_negative":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "alternative_in_iterated":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                default:
                    return null;
                }
            }
        }

        public override IList ArrayKeepOneForEach(IList array, string member)
        {
            if(array.Count == 0)
                return array;
            string arrayType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array.GetType());
            string arrayValueType = GRGEN_LIBGR.TypesHelper.ExtractSrc(arrayType);
            if(!arrayValueType.StartsWith("match<"))
                return null;
            if(array[0] == null)
                return null;
            if(arrayValueType == "match<>")
                arrayValueType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array[0].GetType());
            if(arrayValueType.StartsWith("match<class "))
            {
                switch(arrayValueType.Substring(12, arrayValueType.Length - 12 - 1))
                {
                default:
                    return null;
                }
            }
            else
            {
                switch(arrayValueType.Substring(6, arrayValueType.Length - 6 - 1))
                {
                case "createA":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createC":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createAtoB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "leer":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "AorB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "AandnotCorB":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "AorBorC":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "AtoAorB":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_AtoAorB_keepOneForEachBy_a(GRGEN_ACTIONS.Rule_AtoAorB.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "createComplex":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "Complex":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_Complex_keepOneForEachBy_a(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array));
                    case "b":
                        return ArrayHelper.Array_Complex_keepOneForEachBy_b(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array));
                    case "_edge0":
                        return ArrayHelper.Array_Complex_keepOneForEachBy__edge0(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array));
                    case "_edge1":
                        return ArrayHelper.Array_Complex_keepOneForEachBy__edge1(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "ComplexMax":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_ComplexMax_keepOneForEachBy_a(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array));
                    case "b":
                        return ArrayHelper.Array_ComplexMax_keepOneForEachBy_b(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array));
                    case "_edge0":
                        return ArrayHelper.Array_ComplexMax_keepOneForEachBy__edge0(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array));
                    case "_edge1":
                        return ArrayHelper.Array_ComplexMax_keepOneForEachBy__edge1(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "createABA":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "homm":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_homm_keepOneForEachBy_a(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array));
                    case "b":
                        return ArrayHelper.Array_homm_keepOneForEachBy_b(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array));
                    case "_edge0":
                        return ArrayHelper.Array_homm_keepOneForEachBy__edge0(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array));
                    case "_edge1":
                        return ArrayHelper.Array_homm_keepOneForEachBy__edge1(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "XtoAorB":
                    switch(member)
                    {
                    case "x":
                        return ArrayHelper.Array_XtoAorB_keepOneForEachBy_x(GRGEN_ACTIONS.Rule_XtoAorB.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "alternative_in_negative":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "alternative_in_iterated":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                default:
                    return null;
                }
            }
        }

        public override int ArrayIndexOfBy(IList array, string member, object value)
        {
            if(array.Count == 0)
                return -1;
            string arrayType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array.GetType());
            string arrayValueType = GRGEN_LIBGR.TypesHelper.ExtractSrc(arrayType);
            if(!arrayValueType.StartsWith("match<"))
                return -1;
            if(array[0] == null)
                return -1;
            if(arrayValueType == "match<>")
                arrayValueType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array[0].GetType());
            if(arrayValueType.StartsWith("match<class "))
            {
                switch(arrayValueType.Substring(12, arrayValueType.Length - 12 - 1))
                {
                default:
                    return -1;
                }
            }
            else
            {
                switch(arrayValueType.Substring(6, arrayValueType.Length - 6 - 1))
                {
                case "createA":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createC":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createAtoB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "leer":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AorB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AandnotCorB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AorBorC":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AtoAorB":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_AtoAorB_indexOfBy_a(GRGEN_ACTIONS.Rule_AtoAorB.ConvertAsNeeded(array), (GRGEN_MODEL.IA)value);
                    default:
                        return -1;
                    }
                case "createComplex":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "Complex":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_Complex_indexOfBy_a(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array), (GRGEN_MODEL.IA)value);
                    case "b":
                        return ArrayHelper.Array_Complex_indexOfBy_b(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array), (GRGEN_MODEL.IB)value);
                    case "_edge0":
                        return ArrayHelper.Array_Complex_indexOfBy__edge0(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value);
                    case "_edge1":
                        return ArrayHelper.Array_Complex_indexOfBy__edge1(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value);
                    default:
                        return -1;
                    }
                case "ComplexMax":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_ComplexMax_indexOfBy_a(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array), (GRGEN_MODEL.IA)value);
                    case "b":
                        return ArrayHelper.Array_ComplexMax_indexOfBy_b(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array), (GRGEN_MODEL.IB)value);
                    case "_edge0":
                        return ArrayHelper.Array_ComplexMax_indexOfBy__edge0(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value);
                    case "_edge1":
                        return ArrayHelper.Array_ComplexMax_indexOfBy__edge1(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value);
                    default:
                        return -1;
                    }
                case "createABA":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "homm":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_homm_indexOfBy_a(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array), (GRGEN_MODEL.IA)value);
                    case "b":
                        return ArrayHelper.Array_homm_indexOfBy_b(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array), (GRGEN_MODEL.IB)value);
                    case "_edge0":
                        return ArrayHelper.Array_homm_indexOfBy__edge0(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value);
                    case "_edge1":
                        return ArrayHelper.Array_homm_indexOfBy__edge1(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value);
                    default:
                        return -1;
                    }
                case "XtoAorB":
                    switch(member)
                    {
                    case "x":
                        return ArrayHelper.Array_XtoAorB_indexOfBy_x(GRGEN_ACTIONS.Rule_XtoAorB.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "alternative_in_negative":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "alternative_in_iterated":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                default:
                    return -1;
                }
            }
        }

        public override int ArrayIndexOfBy(IList array, string member, object value, int startIndex)
        {
            if(array.Count == 0)
                return -1;
            string arrayType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array.GetType());
            string arrayValueType = GRGEN_LIBGR.TypesHelper.ExtractSrc(arrayType);
            if(!arrayValueType.StartsWith("match<"))
                return -1;
            if(array[0] == null)
                return -1;
            if(arrayValueType == "match<>")
                arrayValueType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array[0].GetType());
            if(arrayValueType.StartsWith("match<class "))
            {
                switch(arrayValueType.Substring(12, arrayValueType.Length - 12 - 1))
                {
                default:
                    return -1;
                }
            }
            else
            {
                switch(arrayValueType.Substring(6, arrayValueType.Length - 6 - 1))
                {
                case "createA":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createC":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createAtoB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "leer":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AorB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AandnotCorB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AorBorC":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AtoAorB":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_AtoAorB_indexOfBy_a(GRGEN_ACTIONS.Rule_AtoAorB.ConvertAsNeeded(array), (GRGEN_MODEL.IA)value, startIndex);
                    default:
                        return -1;
                    }
                case "createComplex":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "Complex":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_Complex_indexOfBy_a(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array), (GRGEN_MODEL.IA)value, startIndex);
                    case "b":
                        return ArrayHelper.Array_Complex_indexOfBy_b(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array), (GRGEN_MODEL.IB)value, startIndex);
                    case "_edge0":
                        return ArrayHelper.Array_Complex_indexOfBy__edge0(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value, startIndex);
                    case "_edge1":
                        return ArrayHelper.Array_Complex_indexOfBy__edge1(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value, startIndex);
                    default:
                        return -1;
                    }
                case "ComplexMax":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_ComplexMax_indexOfBy_a(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array), (GRGEN_MODEL.IA)value, startIndex);
                    case "b":
                        return ArrayHelper.Array_ComplexMax_indexOfBy_b(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array), (GRGEN_MODEL.IB)value, startIndex);
                    case "_edge0":
                        return ArrayHelper.Array_ComplexMax_indexOfBy__edge0(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value, startIndex);
                    case "_edge1":
                        return ArrayHelper.Array_ComplexMax_indexOfBy__edge1(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value, startIndex);
                    default:
                        return -1;
                    }
                case "createABA":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "homm":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_homm_indexOfBy_a(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array), (GRGEN_MODEL.IA)value, startIndex);
                    case "b":
                        return ArrayHelper.Array_homm_indexOfBy_b(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array), (GRGEN_MODEL.IB)value, startIndex);
                    case "_edge0":
                        return ArrayHelper.Array_homm_indexOfBy__edge0(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value, startIndex);
                    case "_edge1":
                        return ArrayHelper.Array_homm_indexOfBy__edge1(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value, startIndex);
                    default:
                        return -1;
                    }
                case "XtoAorB":
                    switch(member)
                    {
                    case "x":
                        return ArrayHelper.Array_XtoAorB_indexOfBy_x(GRGEN_ACTIONS.Rule_XtoAorB.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "alternative_in_negative":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "alternative_in_iterated":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                default:
                    return -1;
                }
            }
        }

        public override int ArrayLastIndexOfBy(IList array, string member, object value)
        {
            if(array.Count == 0)
                return -1;
            string arrayType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array.GetType());
            string arrayValueType = GRGEN_LIBGR.TypesHelper.ExtractSrc(arrayType);
            if(!arrayValueType.StartsWith("match<"))
                return -1;
            if(array[0] == null)
                return -1;
            if(arrayValueType == "match<>")
                arrayValueType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array[0].GetType());
            if(arrayValueType.StartsWith("match<class "))
            {
                switch(arrayValueType.Substring(12, arrayValueType.Length - 12 - 1))
                {
                default:
                    return -1;
                }
            }
            else
            {
                switch(arrayValueType.Substring(6, arrayValueType.Length - 6 - 1))
                {
                case "createA":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createC":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createAtoB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "leer":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AorB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AandnotCorB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AorBorC":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AtoAorB":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_AtoAorB_lastIndexOfBy_a(GRGEN_ACTIONS.Rule_AtoAorB.ConvertAsNeeded(array), (GRGEN_MODEL.IA)value);
                    default:
                        return -1;
                    }
                case "createComplex":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "Complex":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_Complex_lastIndexOfBy_a(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array), (GRGEN_MODEL.IA)value);
                    case "b":
                        return ArrayHelper.Array_Complex_lastIndexOfBy_b(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array), (GRGEN_MODEL.IB)value);
                    case "_edge0":
                        return ArrayHelper.Array_Complex_lastIndexOfBy__edge0(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value);
                    case "_edge1":
                        return ArrayHelper.Array_Complex_lastIndexOfBy__edge1(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value);
                    default:
                        return -1;
                    }
                case "ComplexMax":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_ComplexMax_lastIndexOfBy_a(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array), (GRGEN_MODEL.IA)value);
                    case "b":
                        return ArrayHelper.Array_ComplexMax_lastIndexOfBy_b(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array), (GRGEN_MODEL.IB)value);
                    case "_edge0":
                        return ArrayHelper.Array_ComplexMax_lastIndexOfBy__edge0(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value);
                    case "_edge1":
                        return ArrayHelper.Array_ComplexMax_lastIndexOfBy__edge1(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value);
                    default:
                        return -1;
                    }
                case "createABA":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "homm":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_homm_lastIndexOfBy_a(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array), (GRGEN_MODEL.IA)value);
                    case "b":
                        return ArrayHelper.Array_homm_lastIndexOfBy_b(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array), (GRGEN_MODEL.IB)value);
                    case "_edge0":
                        return ArrayHelper.Array_homm_lastIndexOfBy__edge0(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value);
                    case "_edge1":
                        return ArrayHelper.Array_homm_lastIndexOfBy__edge1(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value);
                    default:
                        return -1;
                    }
                case "XtoAorB":
                    switch(member)
                    {
                    case "x":
                        return ArrayHelper.Array_XtoAorB_lastIndexOfBy_x(GRGEN_ACTIONS.Rule_XtoAorB.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "alternative_in_negative":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "alternative_in_iterated":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                default:
                    return -1;
                }
            }
        }

        public override int ArrayLastIndexOfBy(IList array, string member, object value, int startIndex)
        {
            if(array.Count == 0)
                return -1;
            string arrayType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array.GetType());
            string arrayValueType = GRGEN_LIBGR.TypesHelper.ExtractSrc(arrayType);
            if(!arrayValueType.StartsWith("match<"))
                return -1;
            if(array[0] == null)
                return -1;
            if(arrayValueType == "match<>")
                arrayValueType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array[0].GetType());
            if(arrayValueType.StartsWith("match<class "))
            {
                switch(arrayValueType.Substring(12, arrayValueType.Length - 12 - 1))
                {
                default:
                    return -1;
                }
            }
            else
            {
                switch(arrayValueType.Substring(6, arrayValueType.Length - 6 - 1))
                {
                case "createA":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createC":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createAtoB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "leer":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AorB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AandnotCorB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AorBorC":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AtoAorB":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_AtoAorB_lastIndexOfBy_a(GRGEN_ACTIONS.Rule_AtoAorB.ConvertAsNeeded(array), (GRGEN_MODEL.IA)value, startIndex);
                    default:
                        return -1;
                    }
                case "createComplex":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "Complex":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_Complex_lastIndexOfBy_a(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array), (GRGEN_MODEL.IA)value, startIndex);
                    case "b":
                        return ArrayHelper.Array_Complex_lastIndexOfBy_b(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array), (GRGEN_MODEL.IB)value, startIndex);
                    case "_edge0":
                        return ArrayHelper.Array_Complex_lastIndexOfBy__edge0(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value, startIndex);
                    case "_edge1":
                        return ArrayHelper.Array_Complex_lastIndexOfBy__edge1(GRGEN_ACTIONS.Rule_Complex.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value, startIndex);
                    default:
                        return -1;
                    }
                case "ComplexMax":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_ComplexMax_lastIndexOfBy_a(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array), (GRGEN_MODEL.IA)value, startIndex);
                    case "b":
                        return ArrayHelper.Array_ComplexMax_lastIndexOfBy_b(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array), (GRGEN_MODEL.IB)value, startIndex);
                    case "_edge0":
                        return ArrayHelper.Array_ComplexMax_lastIndexOfBy__edge0(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value, startIndex);
                    case "_edge1":
                        return ArrayHelper.Array_ComplexMax_lastIndexOfBy__edge1(GRGEN_ACTIONS.Rule_ComplexMax.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value, startIndex);
                    default:
                        return -1;
                    }
                case "createABA":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "homm":
                    switch(member)
                    {
                    case "a":
                        return ArrayHelper.Array_homm_lastIndexOfBy_a(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array), (GRGEN_MODEL.IA)value, startIndex);
                    case "b":
                        return ArrayHelper.Array_homm_lastIndexOfBy_b(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array), (GRGEN_MODEL.IB)value, startIndex);
                    case "_edge0":
                        return ArrayHelper.Array_homm_lastIndexOfBy__edge0(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value, startIndex);
                    case "_edge1":
                        return ArrayHelper.Array_homm_lastIndexOfBy__edge1(GRGEN_ACTIONS.Rule_homm.ConvertAsNeeded(array), (GRGEN_LIBGR.IDEdge)value, startIndex);
                    default:
                        return -1;
                    }
                case "XtoAorB":
                    switch(member)
                    {
                    case "x":
                        return ArrayHelper.Array_XtoAorB_lastIndexOfBy_x(GRGEN_ACTIONS.Rule_XtoAorB.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "alternative_in_negative":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "alternative_in_iterated":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                default:
                    return -1;
                }
            }
        }

        public override int ArrayIndexOfOrderedBy(IList array, string member, object value)
        {
            if(array.Count == 0)
                return -1;
            string arrayType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array.GetType());
            string arrayValueType = GRGEN_LIBGR.TypesHelper.ExtractSrc(arrayType);
            if(!arrayValueType.StartsWith("match<"))
                return -1;
            if(array[0] == null)
                return -1;
            if(arrayValueType == "match<>")
                arrayValueType = GRGEN_LIBGR.TypesHelper.DotNetTypeToXgrsType(array[0].GetType());
            if(arrayValueType.StartsWith("match<class "))
            {
                switch(arrayValueType.Substring(12, arrayValueType.Length - 12 - 1))
                {
                default:
                    return -1;
                }
            }
            else
            {
                switch(arrayValueType.Substring(6, arrayValueType.Length - 6 - 1))
                {
                case "createA":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createC":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createAtoB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "leer":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AorB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AandnotCorB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AorBorC":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "AtoAorB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createComplex":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "Complex":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "ComplexMax":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createABA":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "homm":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "XtoAorB":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "alternative_in_negative":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "alternative_in_iterated":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                default:
                    return -1;
                }
            }
        }
        public override void FailAssertion() { Debug.Assert(false); }
        public override string ModelMD5Hash { get { return "eda3f90b55d93d14a7d999b4279fcda1"; } }
    }
}