// This file has been generated automatically by GrGen (www.grgen.net)
// Do not modify this file! Any changes will be lost!
// Generated from "..\..\tests\Recursive\Recursive.grg" on Sat Dec 20 20:57:31 CET 2025

//#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_Std;
using GRGEN_ACTIONS = de.unika.ipd.grGen.Action_Recursive;

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

		public static GRGEN_LIBGR.NodeType[] ChainFromTo_node_from_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] ChainFromTo_node_to_AllowedTypes = null;
		public static bool[] ChainFromTo_node_from_IsAllowedType = null;
		public static bool[] ChainFromTo_node_to_IsAllowedType = null;
		public enum ChainFromTo_NodeNums { @from, @to, };
		public enum ChainFromTo_EdgeNums { };
		public enum ChainFromTo_VariableNums { };
		public enum ChainFromTo_SubNums { };
		public enum ChainFromTo_AltNums { @alt_0, };
		public enum ChainFromTo_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_ChainFromTo;

		public enum ChainFromTo_alt_0_CaseNums { @base, @rec, };
		public static GRGEN_LIBGR.EdgeType[] ChainFromTo_alt_0_base_edge__edge0_AllowedTypes = null;
		public static bool[] ChainFromTo_alt_0_base_edge__edge0_IsAllowedType = null;
		public enum ChainFromTo_alt_0_base_NodeNums { @from, @to, };
		public enum ChainFromTo_alt_0_base_EdgeNums { @_edge0, };
		public enum ChainFromTo_alt_0_base_VariableNums { };
		public enum ChainFromTo_alt_0_base_SubNums { };
		public enum ChainFromTo_alt_0_base_AltNums { };
		public enum ChainFromTo_alt_0_base_IterNums { };



		public GRGEN_LGSP.PatternGraph ChainFromTo_alt_0_base;

		public static GRGEN_LIBGR.NodeType[] ChainFromTo_alt_0_rec_node_intermediate_AllowedTypes = null;
		public static bool[] ChainFromTo_alt_0_rec_node_intermediate_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ChainFromTo_alt_0_rec_edge__edge0_AllowedTypes = null;
		public static bool[] ChainFromTo_alt_0_rec_edge__edge0_IsAllowedType = null;
		public enum ChainFromTo_alt_0_rec_NodeNums { @from, @intermediate, @to, };
		public enum ChainFromTo_alt_0_rec_EdgeNums { @_edge0, };
		public enum ChainFromTo_alt_0_rec_VariableNums { };
		public enum ChainFromTo_alt_0_rec_SubNums { @_sub0, };
		public enum ChainFromTo_alt_0_rec_AltNums { };
		public enum ChainFromTo_alt_0_rec_IterNums { };



		public GRGEN_LGSP.PatternGraph ChainFromTo_alt_0_rec;


		private Pattern_ChainFromTo()
			: base("ChainFromTo",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "ChainFromTo_node_from", "ChainFromTo_node_to", },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { }
			)
		{
		}
		private void initialize()
		{
			bool[,] ChainFromTo_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ChainFromTo_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] ChainFromTo_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ChainFromTo_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode ChainFromTo_node_from = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromTo_node_from", "from", ChainFromTo_node_from_AllowedTypes, ChainFromTo_node_from_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode ChainFromTo_node_to = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromTo_node_to", "to", ChainFromTo_node_to_AllowedTypes, ChainFromTo_node_to_IsAllowedType, 5.5F, 1, false, null, null, null, null, null, null, false, null);
			bool[,] ChainFromTo_alt_0_base_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ChainFromTo_alt_0_base_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] ChainFromTo_alt_0_base_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ChainFromTo_alt_0_base_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternEdge ChainFromTo_alt_0_base_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ChainFromTo_alt_0_base_edge__edge0", "_edge0", ChainFromTo_alt_0_base_edge__edge0_AllowedTypes, ChainFromTo_alt_0_base_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			ChainFromTo_alt_0_base = new GRGEN_LGSP.PatternGraph(
				"base",
				"ChainFromTo_alt_0_",
				null, "base",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromTo_node_from, ChainFromTo_node_to }, 
				new GRGEN_LGSP.PatternEdge[] { ChainFromTo_alt_0_base_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, },
				},
				ChainFromTo_alt_0_base_isNodeHomomorphicGlobal,
				ChainFromTo_alt_0_base_isEdgeHomomorphicGlobal,
				ChainFromTo_alt_0_base_isNodeTotallyHomomorphic,
				ChainFromTo_alt_0_base_isEdgeTotallyHomomorphic
			);
			ChainFromTo_alt_0_base.edgeToSourceNode.Add(ChainFromTo_alt_0_base_edge__edge0, ChainFromTo_node_from);
			ChainFromTo_alt_0_base.edgeToTargetNode.Add(ChainFromTo_alt_0_base_edge__edge0, ChainFromTo_node_to);

			bool[,] ChainFromTo_alt_0_rec_isNodeHomomorphicGlobal = new bool[3, 3] {
				{ false, false, false, },
				{ false, false, false, },
				{ false, false, false, },
			};
			bool[,] ChainFromTo_alt_0_rec_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] ChainFromTo_alt_0_rec_isNodeTotallyHomomorphic = new bool[3] { false, false, false,  };
			bool[] ChainFromTo_alt_0_rec_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode ChainFromTo_alt_0_rec_node_intermediate = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromTo_alt_0_rec_node_intermediate", "intermediate", ChainFromTo_alt_0_rec_node_intermediate_AllowedTypes, ChainFromTo_alt_0_rec_node_intermediate_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ChainFromTo_alt_0_rec_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ChainFromTo_alt_0_rec_edge__edge0", "_edge0", ChainFromTo_alt_0_rec_edge__edge0_AllowedTypes, ChainFromTo_alt_0_rec_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding ChainFromTo_alt_0_rec__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_ChainFromTo.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("ChainFromTo_alt_0_rec_node_intermediate"),
					new GRGEN_EXPR.GraphEntityExpression("ChainFromTo_node_to"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "ChainFromTo_alt_0_rec_node_intermediate", "ChainFromTo_node_to" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { ChainFromTo_alt_0_rec_node_intermediate, ChainFromTo_node_to }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			ChainFromTo_alt_0_rec = new GRGEN_LGSP.PatternGraph(
				"rec",
				"ChainFromTo_alt_0_",
				null, "rec",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromTo_node_from, ChainFromTo_alt_0_rec_node_intermediate, ChainFromTo_node_to }, 
				new GRGEN_LGSP.PatternEdge[] { ChainFromTo_alt_0_rec_edge__edge0 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { ChainFromTo_alt_0_rec__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[3, 3] {
					{ true, false, true, },
					{ false, true, true, },
					{ true, true, true, },
				},
				new bool[1, 1] {
					{ true, },
				},
				ChainFromTo_alt_0_rec_isNodeHomomorphicGlobal,
				ChainFromTo_alt_0_rec_isEdgeHomomorphicGlobal,
				ChainFromTo_alt_0_rec_isNodeTotallyHomomorphic,
				ChainFromTo_alt_0_rec_isEdgeTotallyHomomorphic
			);
			ChainFromTo_alt_0_rec.edgeToSourceNode.Add(ChainFromTo_alt_0_rec_edge__edge0, ChainFromTo_node_from);
			ChainFromTo_alt_0_rec.edgeToTargetNode.Add(ChainFromTo_alt_0_rec_edge__edge0, ChainFromTo_alt_0_rec_node_intermediate);

			GRGEN_LGSP.Alternative ChainFromTo_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "ChainFromTo_", new GRGEN_LGSP.PatternGraph[] { ChainFromTo_alt_0_base, ChainFromTo_alt_0_rec } );

			pat_ChainFromTo = new GRGEN_LGSP.PatternGraph(
				"ChainFromTo",
				"",
				null, "ChainFromTo",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromTo_node_from, ChainFromTo_node_to }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { ChainFromTo_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[0, 0] ,
				ChainFromTo_isNodeHomomorphicGlobal,
				ChainFromTo_isEdgeHomomorphicGlobal,
				ChainFromTo_isNodeTotallyHomomorphic,
				ChainFromTo_isEdgeTotallyHomomorphic
			);
			ChainFromTo_alt_0_base.embeddingGraph = pat_ChainFromTo;
			ChainFromTo_alt_0_rec.embeddingGraph = pat_ChainFromTo;

			ChainFromTo_node_from.pointOfDefinition = null;
			ChainFromTo_node_to.pointOfDefinition = null;
			ChainFromTo_alt_0_base_edge__edge0.pointOfDefinition = ChainFromTo_alt_0_base;
			ChainFromTo_alt_0_rec_node_intermediate.pointOfDefinition = ChainFromTo_alt_0_rec;
			ChainFromTo_alt_0_rec_edge__edge0.pointOfDefinition = ChainFromTo_alt_0_rec;
			ChainFromTo_alt_0_rec__sub0.PointOfDefinition = ChainFromTo_alt_0_rec;

			patternGraph = pat_ChainFromTo;
		}


		public void ChainFromTo_Create(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LGSP.LGSPNode node_from, GRGEN_LGSP.LGSPNode node_to)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			graph.SettingAddedNodeNames( create_ChainFromTo_addedNodeNames );
			graph.SettingAddedEdgeNames( create_ChainFromTo_addedEdgeNames );
		}
		private static string[] create_ChainFromTo_addedNodeNames = new string[] {  };
		private static string[] create_ChainFromTo_addedEdgeNames = new string[] {  };

		public void ChainFromTo_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromTo curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			IMatch_ChainFromTo_alt_0 alternative_alt_0 = curMatch._alt_0;
		}

		public void ChainFromTo_alt_0_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, IMatch_ChainFromTo_alt_0 curMatch)
		{
			if(curMatch.Pattern == ChainFromTo_alt_0_base) {
				ChainFromTo_alt_0_base_Delete(actionEnv, (Match_ChainFromTo_alt_0_base)curMatch);
				return;
			}
			else if(curMatch.Pattern == ChainFromTo_alt_0_rec) {
				ChainFromTo_alt_0_rec_Delete(actionEnv, (Match_ChainFromTo_alt_0_rec)curMatch);
				return;
			}
			throw new ApplicationException(); //debug assert
		}

		public void ChainFromTo_alt_0_base_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromTo_alt_0_base curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPNode node_to = curMatch._node_to;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			graph.Remove(edge__edge0);
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
			graph.RemoveEdges(node_to);
			graph.Remove(node_to);
		}

		public void ChainFromTo_alt_0_rec_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromTo_alt_0_rec curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPNode node_intermediate = curMatch._node_intermediate;
			GRGEN_LGSP.LGSPNode node_to = curMatch._node_to;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			GRGEN_ACTIONS.Pattern_ChainFromTo.Match_ChainFromTo subpattern__sub0 = curMatch.@__sub0;
			graph.Remove(edge__edge0);
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
			graph.RemoveEdges(node_intermediate);
			graph.Remove(node_intermediate);
			graph.RemoveEdges(node_to);
			graph.Remove(node_to);
			GRGEN_ACTIONS.Pattern_ChainFromTo.Instance.ChainFromTo_Delete(actionEnv, subpattern__sub0);
		}

		static Pattern_ChainFromTo() {
		}

		public interface IMatch_ChainFromTo : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_to { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			IMatch_ChainFromTo_alt_0 alt_0 { get; }
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

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

		public interface IMatch_ChainFromTo_alt_0_base : IMatch_ChainFromTo_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_to { 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_ChainFromTo_alt_0_rec : IMatch_ChainFromTo_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_intermediate { get; set; }
			GRGEN_LIBGR.INode node_to { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			//Variables
			//EmbeddedGraphs
			@GRGEN_ACTIONS.Pattern_ChainFromTo.Match_ChainFromTo @_sub0 { get; }
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_ChainFromTo : GRGEN_LGSP.MatchListElement<Match_ChainFromTo>, IMatch_ChainFromTo
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_to;
			public enum ChainFromTo_NodeNums { @from, @to, 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)ChainFromTo_NodeNums.@from: return _node_from;
				case (int)ChainFromTo_NodeNums.@to: return _node_to;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "to": return _node_to;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum ChainFromTo_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 ChainFromTo_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 ChainFromTo_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_ChainFromTo_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_ChainFromTo_alt_0 _alt_0;
			public enum ChainFromTo_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)ChainFromTo_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 ChainFromTo_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 ChainFromTo_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_ChainFromTo.instance.pat_ChainFromTo; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromTo(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromTo(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromTo nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromTo cur = this;
				while(cur != null) {
					Match_ChainFromTo next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromTo that)
			{
				_node_from = that._node_from;
				_node_to = that._node_to;
				_alt_0 = that._alt_0;
			}

			public Match_ChainFromTo(Match_ChainFromTo that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ChainFromTo that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				_node_to = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_to];
				if(that._alt_0 is Match_ChainFromTo_alt_0_base)
					_alt_0 = new Match_ChainFromTo_alt_0_base((Match_ChainFromTo_alt_0_base)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_ChainFromTo_alt_0_rec)
					_alt_0 = new Match_ChainFromTo_alt_0_rec((Match_ChainFromTo_alt_0_rec)that._alt_0, oldToNewMap);
			}

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

			public bool IsEqual(Match_ChainFromTo that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_node_to != that._node_to) return false;
				if(_alt_0 is Match_ChainFromTo_alt_0_base && !(_alt_0 as Match_ChainFromTo_alt_0_base).IsEqual(that._alt_0 as Match_ChainFromTo_alt_0_base)) return false;
				if(_alt_0 is Match_ChainFromTo_alt_0_rec && !(_alt_0 as Match_ChainFromTo_alt_0_rec).IsEqual(that._alt_0 as Match_ChainFromTo_alt_0_rec)) return false;
				return true;
			}
		}

		public class Match_ChainFromTo_alt_0_base : GRGEN_LGSP.MatchListElement<Match_ChainFromTo_alt_0_base>, IMatch_ChainFromTo_alt_0_base
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_to;
			public enum ChainFromTo_alt_0_base_NodeNums { @from, @to, 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)ChainFromTo_alt_0_base_NodeNums.@from: return _node_from;
				case (int)ChainFromTo_alt_0_base_NodeNums.@to: return _node_to;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "to": return _node_to;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (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 ChainFromTo_alt_0_base_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)ChainFromTo_alt_0_base_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 ChainFromTo_alt_0_base_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 ChainFromTo_alt_0_base_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 ChainFromTo_alt_0_base_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 ChainFromTo_alt_0_base_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 ChainFromTo_alt_0_base_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_ChainFromTo.instance.ChainFromTo_alt_0_base; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromTo_alt_0_base(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromTo_alt_0_base(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromTo_alt_0_base nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromTo_alt_0_base cur = this;
				while(cur != null) {
					Match_ChainFromTo_alt_0_base next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromTo_alt_0_base that)
			{
				_node_from = that._node_from;
				_node_to = that._node_to;
				_edge__edge0 = that._edge__edge0;
			}

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

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

			public bool IsEqual(Match_ChainFromTo_alt_0_base that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_node_to != that._node_to) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				return true;
			}
		}

		public class Match_ChainFromTo_alt_0_rec : GRGEN_LGSP.MatchListElement<Match_ChainFromTo_alt_0_rec>, IMatch_ChainFromTo_alt_0_rec
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_intermediate { get { return (GRGEN_LIBGR.INode)_node_intermediate; } set { _node_intermediate = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_intermediate;
			public GRGEN_LGSP.LGSPNode _node_to;
			public enum ChainFromTo_alt_0_rec_NodeNums { @from, @intermediate, @to, 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)ChainFromTo_alt_0_rec_NodeNums.@from: return _node_from;
				case (int)ChainFromTo_alt_0_rec_NodeNums.@intermediate: return _node_intermediate;
				case (int)ChainFromTo_alt_0_rec_NodeNums.@to: return _node_to;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "intermediate": return _node_intermediate;
				case "to": return _node_to;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "intermediate": _node_intermediate = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (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 ChainFromTo_alt_0_rec_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)ChainFromTo_alt_0_rec_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 ChainFromTo_alt_0_rec_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_ChainFromTo.Match_ChainFromTo @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_ChainFromTo.Match_ChainFromTo @__sub0;
			public enum ChainFromTo_alt_0_rec_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)ChainFromTo_alt_0_rec_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 ChainFromTo_alt_0_rec_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 ChainFromTo_alt_0_rec_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 ChainFromTo_alt_0_rec_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_ChainFromTo.instance.ChainFromTo_alt_0_rec; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromTo_alt_0_rec(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromTo_alt_0_rec(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromTo_alt_0_rec nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromTo_alt_0_rec cur = this;
				while(cur != null) {
					Match_ChainFromTo_alt_0_rec next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromTo_alt_0_rec that)
			{
				_node_from = that._node_from;
				_node_intermediate = that._node_intermediate;
				_node_to = that._node_to;
				_edge__edge0 = that._edge__edge0;
				@__sub0 = that.@__sub0;
			}

			public Match_ChainFromTo_alt_0_rec(Match_ChainFromTo_alt_0_rec that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ChainFromTo_alt_0_rec that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				_node_intermediate = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_intermediate];
				_node_to = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_to];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				@__sub0 = new GRGEN_ACTIONS.Pattern_ChainFromTo.Match_ChainFromTo(that.@__sub0, oldToNewMap);
			}

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

			public bool IsEqual(Match_ChainFromTo_alt_0_rec that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_node_intermediate != that._node_intermediate) return false;
				if(_node_to != that._node_to) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(!@__sub0.IsEqual(that.@__sub0)) return false;
				return true;
			}
		}

	}


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

		public static GRGEN_LIBGR.NodeType[] ChainFrom_node_from_AllowedTypes = null;
		public static bool[] ChainFrom_node_from_IsAllowedType = null;
		public enum ChainFrom_NodeNums { @from, };
		public enum ChainFrom_EdgeNums { };
		public enum ChainFrom_VariableNums { };
		public enum ChainFrom_SubNums { };
		public enum ChainFrom_AltNums { @alt_0, };
		public enum ChainFrom_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_ChainFrom;

		public enum ChainFrom_alt_0_CaseNums { @base, @rec, };
		public enum ChainFrom_alt_0_base_NodeNums { };
		public enum ChainFrom_alt_0_base_EdgeNums { };
		public enum ChainFrom_alt_0_base_VariableNums { };
		public enum ChainFrom_alt_0_base_SubNums { };
		public enum ChainFrom_alt_0_base_AltNums { };
		public enum ChainFrom_alt_0_base_IterNums { };



		public GRGEN_LGSP.PatternGraph ChainFrom_alt_0_base;

		public static GRGEN_LIBGR.NodeType[] ChainFrom_alt_0_rec_node_to_AllowedTypes = null;
		public static bool[] ChainFrom_alt_0_rec_node_to_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ChainFrom_alt_0_rec_edge__edge0_AllowedTypes = null;
		public static bool[] ChainFrom_alt_0_rec_edge__edge0_IsAllowedType = null;
		public enum ChainFrom_alt_0_rec_NodeNums { @from, @to, };
		public enum ChainFrom_alt_0_rec_EdgeNums { @_edge0, };
		public enum ChainFrom_alt_0_rec_VariableNums { };
		public enum ChainFrom_alt_0_rec_SubNums { @_sub0, };
		public enum ChainFrom_alt_0_rec_AltNums { };
		public enum ChainFrom_alt_0_rec_IterNums { };



		public GRGEN_LGSP.PatternGraph ChainFrom_alt_0_rec;


		private Pattern_ChainFrom()
			: base("ChainFrom",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "ChainFrom_node_from", },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { }
			)
		{
		}
		private void initialize()
		{
			bool[,] ChainFrom_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] ChainFrom_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] ChainFrom_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] ChainFrom_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode ChainFrom_node_from = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFrom_node_from", "from", ChainFrom_node_from_AllowedTypes, ChainFrom_node_from_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			bool[,] ChainFrom_alt_0_base_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] ChainFrom_alt_0_base_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] ChainFrom_alt_0_base_isNodeTotallyHomomorphic = new bool[0];
			bool[] ChainFrom_alt_0_base_isEdgeTotallyHomomorphic = new bool[0];
			ChainFrom_alt_0_base = new GRGEN_LGSP.PatternGraph(
				"base",
				"ChainFrom_alt_0_",
				null, "base",
				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] ,
				ChainFrom_alt_0_base_isNodeHomomorphicGlobal,
				ChainFrom_alt_0_base_isEdgeHomomorphicGlobal,
				ChainFrom_alt_0_base_isNodeTotallyHomomorphic,
				ChainFrom_alt_0_base_isEdgeTotallyHomomorphic
			);

			bool[,] ChainFrom_alt_0_rec_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ChainFrom_alt_0_rec_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] ChainFrom_alt_0_rec_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ChainFrom_alt_0_rec_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode ChainFrom_alt_0_rec_node_to = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFrom_alt_0_rec_node_to", "to", ChainFrom_alt_0_rec_node_to_AllowedTypes, ChainFrom_alt_0_rec_node_to_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ChainFrom_alt_0_rec_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ChainFrom_alt_0_rec_edge__edge0", "_edge0", ChainFrom_alt_0_rec_edge__edge0_AllowedTypes, ChainFrom_alt_0_rec_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding ChainFrom_alt_0_rec__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_ChainFrom.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("ChainFrom_alt_0_rec_node_to"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "ChainFrom_alt_0_rec_node_to" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { ChainFrom_alt_0_rec_node_to }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			ChainFrom_alt_0_rec = new GRGEN_LGSP.PatternGraph(
				"rec",
				"ChainFrom_alt_0_",
				null, "rec",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFrom_node_from, ChainFrom_alt_0_rec_node_to }, 
				new GRGEN_LGSP.PatternEdge[] { ChainFrom_alt_0_rec_edge__edge0 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { ChainFrom_alt_0_rec__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[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				new bool[1, 1] {
					{ true, },
				},
				ChainFrom_alt_0_rec_isNodeHomomorphicGlobal,
				ChainFrom_alt_0_rec_isEdgeHomomorphicGlobal,
				ChainFrom_alt_0_rec_isNodeTotallyHomomorphic,
				ChainFrom_alt_0_rec_isEdgeTotallyHomomorphic
			);
			ChainFrom_alt_0_rec.edgeToSourceNode.Add(ChainFrom_alt_0_rec_edge__edge0, ChainFrom_node_from);
			ChainFrom_alt_0_rec.edgeToTargetNode.Add(ChainFrom_alt_0_rec_edge__edge0, ChainFrom_alt_0_rec_node_to);

			GRGEN_LGSP.Alternative ChainFrom_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "ChainFrom_", new GRGEN_LGSP.PatternGraph[] { ChainFrom_alt_0_base, ChainFrom_alt_0_rec } );

			pat_ChainFrom = new GRGEN_LGSP.PatternGraph(
				"ChainFrom",
				"",
				null, "ChainFrom",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFrom_node_from }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { ChainFrom_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] ,
				ChainFrom_isNodeHomomorphicGlobal,
				ChainFrom_isEdgeHomomorphicGlobal,
				ChainFrom_isNodeTotallyHomomorphic,
				ChainFrom_isEdgeTotallyHomomorphic
			);
			ChainFrom_alt_0_base.embeddingGraph = pat_ChainFrom;
			ChainFrom_alt_0_rec.embeddingGraph = pat_ChainFrom;

			ChainFrom_node_from.pointOfDefinition = null;
			ChainFrom_alt_0_rec_node_to.pointOfDefinition = ChainFrom_alt_0_rec;
			ChainFrom_alt_0_rec_edge__edge0.pointOfDefinition = ChainFrom_alt_0_rec;
			ChainFrom_alt_0_rec__sub0.PointOfDefinition = ChainFrom_alt_0_rec;

			patternGraph = pat_ChainFrom;
		}


		public void ChainFrom_Create(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LGSP.LGSPNode node_from)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			graph.SettingAddedNodeNames( create_ChainFrom_addedNodeNames );
			graph.SettingAddedEdgeNames( create_ChainFrom_addedEdgeNames );
		}
		private static string[] create_ChainFrom_addedNodeNames = new string[] {  };
		private static string[] create_ChainFrom_addedEdgeNames = new string[] {  };

		public void ChainFrom_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFrom curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			IMatch_ChainFrom_alt_0 alternative_alt_0 = curMatch._alt_0;
		}

		public void ChainFrom_alt_0_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, IMatch_ChainFrom_alt_0 curMatch)
		{
			if(curMatch.Pattern == ChainFrom_alt_0_base) {
				ChainFrom_alt_0_base_Delete(actionEnv, (Match_ChainFrom_alt_0_base)curMatch);
				return;
			}
			else if(curMatch.Pattern == ChainFrom_alt_0_rec) {
				ChainFrom_alt_0_rec_Delete(actionEnv, (Match_ChainFrom_alt_0_rec)curMatch);
				return;
			}
			throw new ApplicationException(); //debug assert
		}

		public void ChainFrom_alt_0_base_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFrom_alt_0_base curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
		}

		public void ChainFrom_alt_0_rec_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFrom_alt_0_rec curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPNode node_to = curMatch._node_to;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			GRGEN_ACTIONS.Pattern_ChainFrom.Match_ChainFrom subpattern__sub0 = curMatch.@__sub0;
			graph.Remove(edge__edge0);
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
			graph.RemoveEdges(node_to);
			graph.Remove(node_to);
			GRGEN_ACTIONS.Pattern_ChainFrom.Instance.ChainFrom_Delete(actionEnv, subpattern__sub0);
		}

		static Pattern_ChainFrom() {
		}

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

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

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

		public interface IMatch_ChainFrom_alt_0_rec : IMatch_ChainFrom_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_to { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			//Variables
			//EmbeddedGraphs
			@GRGEN_ACTIONS.Pattern_ChainFrom.Match_ChainFrom @_sub0 { get; }
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_ChainFrom : GRGEN_LGSP.MatchListElement<Match_ChainFrom>, IMatch_ChainFrom
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public enum ChainFrom_NodeNums { @from, 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)ChainFrom_NodeNums.@from: return _node_from;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum ChainFrom_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 ChainFrom_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 ChainFrom_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_ChainFrom_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_ChainFrom_alt_0 _alt_0;
			public enum ChainFrom_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)ChainFrom_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 ChainFrom_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 ChainFrom_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_ChainFrom.instance.pat_ChainFrom; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFrom(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFrom(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFrom nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFrom cur = this;
				while(cur != null) {
					Match_ChainFrom next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

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

			public Match_ChainFrom(Match_ChainFrom that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ChainFrom that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				if(that._alt_0 is Match_ChainFrom_alt_0_base)
					_alt_0 = new Match_ChainFrom_alt_0_base((Match_ChainFrom_alt_0_base)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_ChainFrom_alt_0_rec)
					_alt_0 = new Match_ChainFrom_alt_0_rec((Match_ChainFrom_alt_0_rec)that._alt_0, oldToNewMap);
			}

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

			public bool IsEqual(Match_ChainFrom that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_alt_0 is Match_ChainFrom_alt_0_base && !(_alt_0 as Match_ChainFrom_alt_0_base).IsEqual(that._alt_0 as Match_ChainFrom_alt_0_base)) return false;
				if(_alt_0 is Match_ChainFrom_alt_0_rec && !(_alt_0 as Match_ChainFrom_alt_0_rec).IsEqual(that._alt_0 as Match_ChainFrom_alt_0_rec)) return false;
				return true;
			}
		}

		public class Match_ChainFrom_alt_0_base : GRGEN_LGSP.MatchListElement<Match_ChainFrom_alt_0_base>, IMatch_ChainFrom_alt_0_base
		{
			public enum ChainFrom_alt_0_base_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 ChainFrom_alt_0_base_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 ChainFrom_alt_0_base_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 ChainFrom_alt_0_base_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 ChainFrom_alt_0_base_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 ChainFrom_alt_0_base_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 ChainFrom_alt_0_base_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_ChainFrom.instance.ChainFrom_alt_0_base; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFrom_alt_0_base(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFrom_alt_0_base(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFrom_alt_0_base nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFrom_alt_0_base cur = this;
				while(cur != null) {
					Match_ChainFrom_alt_0_base next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFrom_alt_0_base that)
			{
			}

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

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

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

		public class Match_ChainFrom_alt_0_rec : GRGEN_LGSP.MatchListElement<Match_ChainFrom_alt_0_rec>, IMatch_ChainFrom_alt_0_rec
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_to;
			public enum ChainFrom_alt_0_rec_NodeNums { @from, @to, 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)ChainFrom_alt_0_rec_NodeNums.@from: return _node_from;
				case (int)ChainFrom_alt_0_rec_NodeNums.@to: return _node_to;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "to": return _node_to;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (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 ChainFrom_alt_0_rec_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)ChainFrom_alt_0_rec_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 ChainFrom_alt_0_rec_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_ChainFrom.Match_ChainFrom @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_ChainFrom.Match_ChainFrom @__sub0;
			public enum ChainFrom_alt_0_rec_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)ChainFrom_alt_0_rec_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 ChainFrom_alt_0_rec_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 ChainFrom_alt_0_rec_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 ChainFrom_alt_0_rec_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_ChainFrom.instance.ChainFrom_alt_0_rec; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFrom_alt_0_rec(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFrom_alt_0_rec(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFrom_alt_0_rec nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFrom_alt_0_rec cur = this;
				while(cur != null) {
					Match_ChainFrom_alt_0_rec next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFrom_alt_0_rec that)
			{
				_node_from = that._node_from;
				_node_to = that._node_to;
				_edge__edge0 = that._edge__edge0;
				@__sub0 = that.@__sub0;
			}

			public Match_ChainFrom_alt_0_rec(Match_ChainFrom_alt_0_rec that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ChainFrom_alt_0_rec that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				_node_to = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_to];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				@__sub0 = new GRGEN_ACTIONS.Pattern_ChainFrom.Match_ChainFrom(that.@__sub0, oldToNewMap);
			}

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

			public bool IsEqual(Match_ChainFrom_alt_0_rec that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_node_to != that._node_to) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(!@__sub0.IsEqual(that.@__sub0)) return false;
				return true;
			}
		}

	}


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

		public static GRGEN_LIBGR.NodeType[] ChainFromComplete_node_from_AllowedTypes = null;
		public static bool[] ChainFromComplete_node_from_IsAllowedType = null;
		public enum ChainFromComplete_NodeNums { @from, };
		public enum ChainFromComplete_EdgeNums { };
		public enum ChainFromComplete_VariableNums { };
		public enum ChainFromComplete_SubNums { };
		public enum ChainFromComplete_AltNums { @alt_0, };
		public enum ChainFromComplete_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_ChainFromComplete;

		public enum ChainFromComplete_alt_0_CaseNums { @base, @rec, };
		public enum ChainFromComplete_alt_0_base_NodeNums { @from, };
		public enum ChainFromComplete_alt_0_base_EdgeNums { };
		public enum ChainFromComplete_alt_0_base_VariableNums { };
		public enum ChainFromComplete_alt_0_base_SubNums { };
		public enum ChainFromComplete_alt_0_base_AltNums { };
		public enum ChainFromComplete_alt_0_base_IterNums { };



		public GRGEN_LGSP.PatternGraph ChainFromComplete_alt_0_base;

		public static GRGEN_LIBGR.NodeType[] ChainFromComplete_alt_0_base_neg_0_node__node0_AllowedTypes = null;
		public static bool[] ChainFromComplete_alt_0_base_neg_0_node__node0_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ChainFromComplete_alt_0_base_neg_0_edge__edge0_AllowedTypes = null;
		public static bool[] ChainFromComplete_alt_0_base_neg_0_edge__edge0_IsAllowedType = null;
		public enum ChainFromComplete_alt_0_base_neg_0_NodeNums { @from, @_node0, };
		public enum ChainFromComplete_alt_0_base_neg_0_EdgeNums { @_edge0, };
		public enum ChainFromComplete_alt_0_base_neg_0_VariableNums { };
		public enum ChainFromComplete_alt_0_base_neg_0_SubNums { };
		public enum ChainFromComplete_alt_0_base_neg_0_AltNums { };
		public enum ChainFromComplete_alt_0_base_neg_0_IterNums { };


		public GRGEN_LGSP.PatternGraph ChainFromComplete_alt_0_base_neg_0;

		public static GRGEN_LIBGR.NodeType[] ChainFromComplete_alt_0_rec_node_to_AllowedTypes = null;
		public static bool[] ChainFromComplete_alt_0_rec_node_to_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ChainFromComplete_alt_0_rec_edge__edge0_AllowedTypes = null;
		public static bool[] ChainFromComplete_alt_0_rec_edge__edge0_IsAllowedType = null;
		public enum ChainFromComplete_alt_0_rec_NodeNums { @from, @to, };
		public enum ChainFromComplete_alt_0_rec_EdgeNums { @_edge0, };
		public enum ChainFromComplete_alt_0_rec_VariableNums { };
		public enum ChainFromComplete_alt_0_rec_SubNums { @_sub0, };
		public enum ChainFromComplete_alt_0_rec_AltNums { };
		public enum ChainFromComplete_alt_0_rec_IterNums { };



		public GRGEN_LGSP.PatternGraph ChainFromComplete_alt_0_rec;


		private Pattern_ChainFromComplete()
			: base("ChainFromComplete",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "ChainFromComplete_node_from", },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { }
			)
		{
		}
		private void initialize()
		{
			bool[,] ChainFromComplete_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] ChainFromComplete_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] ChainFromComplete_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] ChainFromComplete_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode ChainFromComplete_node_from = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromComplete_node_from", "from", ChainFromComplete_node_from_AllowedTypes, ChainFromComplete_node_from_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			bool[,] ChainFromComplete_alt_0_base_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] ChainFromComplete_alt_0_base_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] ChainFromComplete_alt_0_base_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] ChainFromComplete_alt_0_base_isEdgeTotallyHomomorphic = new bool[0];
			bool[,] ChainFromComplete_alt_0_base_neg_0_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ChainFromComplete_alt_0_base_neg_0_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] ChainFromComplete_alt_0_base_neg_0_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ChainFromComplete_alt_0_base_neg_0_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode ChainFromComplete_alt_0_base_neg_0_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromComplete_alt_0_base_neg_0_node__node0", "_node0", ChainFromComplete_alt_0_base_neg_0_node__node0_AllowedTypes, ChainFromComplete_alt_0_base_neg_0_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ChainFromComplete_alt_0_base_neg_0_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ChainFromComplete_alt_0_base_neg_0_edge__edge0", "_edge0", ChainFromComplete_alt_0_base_neg_0_edge__edge0_AllowedTypes, ChainFromComplete_alt_0_base_neg_0_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			ChainFromComplete_alt_0_base_neg_0 = new GRGEN_LGSP.PatternGraph(
				"neg_0",
				"ChainFromComplete_alt_0_base_",
				null, "neg_0",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromComplete_node_from, ChainFromComplete_alt_0_base_neg_0_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] { ChainFromComplete_alt_0_base_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, },
				},
				ChainFromComplete_alt_0_base_neg_0_isNodeHomomorphicGlobal,
				ChainFromComplete_alt_0_base_neg_0_isEdgeHomomorphicGlobal,
				ChainFromComplete_alt_0_base_neg_0_isNodeTotallyHomomorphic,
				ChainFromComplete_alt_0_base_neg_0_isEdgeTotallyHomomorphic
			);
			ChainFromComplete_alt_0_base_neg_0.edgeToSourceNode.Add(ChainFromComplete_alt_0_base_neg_0_edge__edge0, ChainFromComplete_node_from);
			ChainFromComplete_alt_0_base_neg_0.edgeToTargetNode.Add(ChainFromComplete_alt_0_base_neg_0_edge__edge0, ChainFromComplete_alt_0_base_neg_0_node__node0);

			ChainFromComplete_alt_0_base = new GRGEN_LGSP.PatternGraph(
				"base",
				"ChainFromComplete_alt_0_",
				null, "base",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromComplete_node_from }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] { ChainFromComplete_alt_0_base_neg_0,  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				ChainFromComplete_alt_0_base_isNodeHomomorphicGlobal,
				ChainFromComplete_alt_0_base_isEdgeHomomorphicGlobal,
				ChainFromComplete_alt_0_base_isNodeTotallyHomomorphic,
				ChainFromComplete_alt_0_base_isEdgeTotallyHomomorphic
			);
			ChainFromComplete_alt_0_base_neg_0.embeddingGraph = ChainFromComplete_alt_0_base;

			bool[,] ChainFromComplete_alt_0_rec_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ChainFromComplete_alt_0_rec_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] ChainFromComplete_alt_0_rec_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ChainFromComplete_alt_0_rec_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode ChainFromComplete_alt_0_rec_node_to = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromComplete_alt_0_rec_node_to", "to", ChainFromComplete_alt_0_rec_node_to_AllowedTypes, ChainFromComplete_alt_0_rec_node_to_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ChainFromComplete_alt_0_rec_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ChainFromComplete_alt_0_rec_edge__edge0", "_edge0", ChainFromComplete_alt_0_rec_edge__edge0_AllowedTypes, ChainFromComplete_alt_0_rec_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding ChainFromComplete_alt_0_rec__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_ChainFromComplete.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("ChainFromComplete_alt_0_rec_node_to"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "ChainFromComplete_alt_0_rec_node_to" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { ChainFromComplete_alt_0_rec_node_to }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			ChainFromComplete_alt_0_rec = new GRGEN_LGSP.PatternGraph(
				"rec",
				"ChainFromComplete_alt_0_",
				null, "rec",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromComplete_node_from, ChainFromComplete_alt_0_rec_node_to }, 
				new GRGEN_LGSP.PatternEdge[] { ChainFromComplete_alt_0_rec_edge__edge0 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { ChainFromComplete_alt_0_rec__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[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				new bool[1, 1] {
					{ true, },
				},
				ChainFromComplete_alt_0_rec_isNodeHomomorphicGlobal,
				ChainFromComplete_alt_0_rec_isEdgeHomomorphicGlobal,
				ChainFromComplete_alt_0_rec_isNodeTotallyHomomorphic,
				ChainFromComplete_alt_0_rec_isEdgeTotallyHomomorphic
			);
			ChainFromComplete_alt_0_rec.edgeToSourceNode.Add(ChainFromComplete_alt_0_rec_edge__edge0, ChainFromComplete_node_from);
			ChainFromComplete_alt_0_rec.edgeToTargetNode.Add(ChainFromComplete_alt_0_rec_edge__edge0, ChainFromComplete_alt_0_rec_node_to);

			GRGEN_LGSP.Alternative ChainFromComplete_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "ChainFromComplete_", new GRGEN_LGSP.PatternGraph[] { ChainFromComplete_alt_0_base, ChainFromComplete_alt_0_rec } );

			pat_ChainFromComplete = new GRGEN_LGSP.PatternGraph(
				"ChainFromComplete",
				"",
				null, "ChainFromComplete",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromComplete_node_from }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { ChainFromComplete_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] ,
				ChainFromComplete_isNodeHomomorphicGlobal,
				ChainFromComplete_isEdgeHomomorphicGlobal,
				ChainFromComplete_isNodeTotallyHomomorphic,
				ChainFromComplete_isEdgeTotallyHomomorphic
			);
			ChainFromComplete_alt_0_base.embeddingGraph = pat_ChainFromComplete;
			ChainFromComplete_alt_0_rec.embeddingGraph = pat_ChainFromComplete;

			ChainFromComplete_node_from.pointOfDefinition = null;
			ChainFromComplete_alt_0_base_neg_0_node__node0.pointOfDefinition = ChainFromComplete_alt_0_base_neg_0;
			ChainFromComplete_alt_0_base_neg_0_edge__edge0.pointOfDefinition = ChainFromComplete_alt_0_base_neg_0;
			ChainFromComplete_alt_0_rec_node_to.pointOfDefinition = ChainFromComplete_alt_0_rec;
			ChainFromComplete_alt_0_rec_edge__edge0.pointOfDefinition = ChainFromComplete_alt_0_rec;
			ChainFromComplete_alt_0_rec__sub0.PointOfDefinition = ChainFromComplete_alt_0_rec;

			patternGraph = pat_ChainFromComplete;
		}


		public void ChainFromComplete_Create(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LGSP.LGSPNode node_from)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			graph.SettingAddedNodeNames( create_ChainFromComplete_addedNodeNames );
			graph.SettingAddedEdgeNames( create_ChainFromComplete_addedEdgeNames );
		}
		private static string[] create_ChainFromComplete_addedNodeNames = new string[] {  };
		private static string[] create_ChainFromComplete_addedEdgeNames = new string[] {  };

		public void ChainFromComplete_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromComplete curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			IMatch_ChainFromComplete_alt_0 alternative_alt_0 = curMatch._alt_0;
		}

		public void ChainFromComplete_alt_0_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, IMatch_ChainFromComplete_alt_0 curMatch)
		{
			if(curMatch.Pattern == ChainFromComplete_alt_0_base) {
				ChainFromComplete_alt_0_base_Delete(actionEnv, (Match_ChainFromComplete_alt_0_base)curMatch);
				return;
			}
			else if(curMatch.Pattern == ChainFromComplete_alt_0_rec) {
				ChainFromComplete_alt_0_rec_Delete(actionEnv, (Match_ChainFromComplete_alt_0_rec)curMatch);
				return;
			}
			throw new ApplicationException(); //debug assert
		}

		public void ChainFromComplete_alt_0_base_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromComplete_alt_0_base curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
		}

		public void ChainFromComplete_alt_0_rec_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromComplete_alt_0_rec curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPNode node_to = curMatch._node_to;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			GRGEN_ACTIONS.Pattern_ChainFromComplete.Match_ChainFromComplete subpattern__sub0 = curMatch.@__sub0;
			graph.Remove(edge__edge0);
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
			graph.RemoveEdges(node_to);
			graph.Remove(node_to);
			GRGEN_ACTIONS.Pattern_ChainFromComplete.Instance.ChainFromComplete_Delete(actionEnv, subpattern__sub0);
		}

		static Pattern_ChainFromComplete() {
		}

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

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

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

		public interface IMatch_ChainFromComplete_alt_0_base_neg_0 : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode 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_ChainFromComplete_alt_0_rec : IMatch_ChainFromComplete_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_to { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			//Variables
			//EmbeddedGraphs
			@GRGEN_ACTIONS.Pattern_ChainFromComplete.Match_ChainFromComplete @_sub0 { get; }
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_ChainFromComplete : GRGEN_LGSP.MatchListElement<Match_ChainFromComplete>, IMatch_ChainFromComplete
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public enum ChainFromComplete_NodeNums { @from, 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)ChainFromComplete_NodeNums.@from: return _node_from;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum ChainFromComplete_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 ChainFromComplete_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 ChainFromComplete_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_ChainFromComplete_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_ChainFromComplete_alt_0 _alt_0;
			public enum ChainFromComplete_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)ChainFromComplete_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 ChainFromComplete_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 ChainFromComplete_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_ChainFromComplete.instance.pat_ChainFromComplete; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromComplete(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromComplete(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromComplete nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromComplete cur = this;
				while(cur != null) {
					Match_ChainFromComplete next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

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

			public Match_ChainFromComplete(Match_ChainFromComplete that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ChainFromComplete that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				if(that._alt_0 is Match_ChainFromComplete_alt_0_base)
					_alt_0 = new Match_ChainFromComplete_alt_0_base((Match_ChainFromComplete_alt_0_base)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_ChainFromComplete_alt_0_rec)
					_alt_0 = new Match_ChainFromComplete_alt_0_rec((Match_ChainFromComplete_alt_0_rec)that._alt_0, oldToNewMap);
			}

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

			public bool IsEqual(Match_ChainFromComplete that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_alt_0 is Match_ChainFromComplete_alt_0_base && !(_alt_0 as Match_ChainFromComplete_alt_0_base).IsEqual(that._alt_0 as Match_ChainFromComplete_alt_0_base)) return false;
				if(_alt_0 is Match_ChainFromComplete_alt_0_rec && !(_alt_0 as Match_ChainFromComplete_alt_0_rec).IsEqual(that._alt_0 as Match_ChainFromComplete_alt_0_rec)) return false;
				return true;
			}
		}

		public class Match_ChainFromComplete_alt_0_base : GRGEN_LGSP.MatchListElement<Match_ChainFromComplete_alt_0_base>, IMatch_ChainFromComplete_alt_0_base
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public enum ChainFromComplete_alt_0_base_NodeNums { @from, 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)ChainFromComplete_alt_0_base_NodeNums.@from: return _node_from;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum ChainFromComplete_alt_0_base_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 ChainFromComplete_alt_0_base_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 ChainFromComplete_alt_0_base_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 ChainFromComplete_alt_0_base_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 ChainFromComplete_alt_0_base_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 ChainFromComplete_alt_0_base_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_ChainFromComplete.instance.ChainFromComplete_alt_0_base; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromComplete_alt_0_base(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromComplete_alt_0_base(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromComplete_alt_0_base nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromComplete_alt_0_base cur = this;
				while(cur != null) {
					Match_ChainFromComplete_alt_0_base next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromComplete_alt_0_base that)
			{
				_node_from = that._node_from;
			}

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

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

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

		public class Match_ChainFromComplete_alt_0_base_neg_0 : GRGEN_LGSP.MatchListElement<Match_ChainFromComplete_alt_0_base_neg_0>, IMatch_ChainFromComplete_alt_0_base_neg_0
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			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_from;
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum ChainFromComplete_alt_0_base_neg_0_NodeNums { @from, @_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)ChainFromComplete_alt_0_base_neg_0_NodeNums.@from: return _node_from;
				case (int)ChainFromComplete_alt_0_base_neg_0_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (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 ChainFromComplete_alt_0_base_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)ChainFromComplete_alt_0_base_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 ChainFromComplete_alt_0_base_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 ChainFromComplete_alt_0_base_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 ChainFromComplete_alt_0_base_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 ChainFromComplete_alt_0_base_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 ChainFromComplete_alt_0_base_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 Pattern_ChainFromComplete.instance.ChainFromComplete_alt_0_base_neg_0; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromComplete_alt_0_base_neg_0(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromComplete_alt_0_base_neg_0(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromComplete_alt_0_base_neg_0 nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromComplete_alt_0_base_neg_0 cur = this;
				while(cur != null) {
					Match_ChainFromComplete_alt_0_base_neg_0 next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromComplete_alt_0_base_neg_0 that)
			{
				_node_from = that._node_from;
				_node__node0 = that._node__node0;
				_edge__edge0 = that._edge__edge0;
			}

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

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

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

		public class Match_ChainFromComplete_alt_0_rec : GRGEN_LGSP.MatchListElement<Match_ChainFromComplete_alt_0_rec>, IMatch_ChainFromComplete_alt_0_rec
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_to;
			public enum ChainFromComplete_alt_0_rec_NodeNums { @from, @to, 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)ChainFromComplete_alt_0_rec_NodeNums.@from: return _node_from;
				case (int)ChainFromComplete_alt_0_rec_NodeNums.@to: return _node_to;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "to": return _node_to;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (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 ChainFromComplete_alt_0_rec_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)ChainFromComplete_alt_0_rec_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 ChainFromComplete_alt_0_rec_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_ChainFromComplete.Match_ChainFromComplete @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_ChainFromComplete.Match_ChainFromComplete @__sub0;
			public enum ChainFromComplete_alt_0_rec_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)ChainFromComplete_alt_0_rec_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 ChainFromComplete_alt_0_rec_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 ChainFromComplete_alt_0_rec_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 ChainFromComplete_alt_0_rec_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_ChainFromComplete.instance.ChainFromComplete_alt_0_rec; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromComplete_alt_0_rec(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromComplete_alt_0_rec(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromComplete_alt_0_rec nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromComplete_alt_0_rec cur = this;
				while(cur != null) {
					Match_ChainFromComplete_alt_0_rec next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromComplete_alt_0_rec that)
			{
				_node_from = that._node_from;
				_node_to = that._node_to;
				_edge__edge0 = that._edge__edge0;
				@__sub0 = that.@__sub0;
			}

			public Match_ChainFromComplete_alt_0_rec(Match_ChainFromComplete_alt_0_rec that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ChainFromComplete_alt_0_rec that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				_node_to = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_to];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				@__sub0 = new GRGEN_ACTIONS.Pattern_ChainFromComplete.Match_ChainFromComplete(that.@__sub0, oldToNewMap);
			}

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

			public bool IsEqual(Match_ChainFromComplete_alt_0_rec that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_node_to != that._node_to) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(!@__sub0.IsEqual(that.@__sub0)) return false;
				return true;
			}
		}

	}


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

		public static GRGEN_LIBGR.NodeType[] ChainFromCompleteArbitraryPatternpathLocked_node_from_AllowedTypes = null;
		public static bool[] ChainFromCompleteArbitraryPatternpathLocked_node_from_IsAllowedType = null;
		public enum ChainFromCompleteArbitraryPatternpathLocked_NodeNums { @from, };
		public enum ChainFromCompleteArbitraryPatternpathLocked_EdgeNums { };
		public enum ChainFromCompleteArbitraryPatternpathLocked_VariableNums { };
		public enum ChainFromCompleteArbitraryPatternpathLocked_SubNums { };
		public enum ChainFromCompleteArbitraryPatternpathLocked_AltNums { @alt_0, };
		public enum ChainFromCompleteArbitraryPatternpathLocked_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_ChainFromCompleteArbitraryPatternpathLocked;

		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_CaseNums { @base, @rec, };
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_NodeNums { @from, };
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_EdgeNums { };
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_VariableNums { };
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_SubNums { };
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_AltNums { };
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_IterNums { };



		public GRGEN_LGSP.PatternGraph ChainFromCompleteArbitraryPatternpathLocked_alt_0_base;

		public static GRGEN_LIBGR.NodeType[] ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0_AllowedTypes = null;
		public static bool[] ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0_AllowedTypes = null;
		public static bool[] ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0_IsAllowedType = null;
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_NodeNums { @from, @_node0, };
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_EdgeNums { @_edge0, };
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_VariableNums { };
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_SubNums { };
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_AltNums { };
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_IterNums { };


		public GRGEN_LGSP.PatternGraph ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0;

		public static GRGEN_LIBGR.NodeType[] ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to_AllowedTypes = null;
		public static bool[] ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0_AllowedTypes = null;
		public static bool[] ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0_IsAllowedType = null;
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_NodeNums { @from, @to, };
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_EdgeNums { @_edge0, };
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_VariableNums { };
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_SubNums { @_sub0, };
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_AltNums { };
		public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_IterNums { };



		public GRGEN_LGSP.PatternGraph ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec;


		private Pattern_ChainFromCompleteArbitraryPatternpathLocked()
			: base("ChainFromCompleteArbitraryPatternpathLocked",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "ChainFromCompleteArbitraryPatternpathLocked_node_from", },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { }
			)
		{
		}
		private void initialize()
		{
			bool[,] ChainFromCompleteArbitraryPatternpathLocked_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] ChainFromCompleteArbitraryPatternpathLocked_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] ChainFromCompleteArbitraryPatternpathLocked_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] ChainFromCompleteArbitraryPatternpathLocked_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode ChainFromCompleteArbitraryPatternpathLocked_node_from = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromCompleteArbitraryPatternpathLocked_node_from", "from", ChainFromCompleteArbitraryPatternpathLocked_node_from_AllowedTypes, ChainFromCompleteArbitraryPatternpathLocked_node_from_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			bool[,] ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_isEdgeTotallyHomomorphic = new bool[0];
			bool[,] ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0", "_node0", ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0_AllowedTypes, ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0 = new GRGEN_LGSP.PatternEdge(false, (int) GRGEN_MODEL.EdgeTypes.@AEdge, GRGEN_MODEL.EdgeType_AEdge.typeVar, "GRGEN_LIBGR.IEdge", "ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0", "_edge0", ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0_AllowedTypes, ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0 = new GRGEN_LGSP.PatternGraph(
				"neg_0",
				"ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_",
				null, "neg_0",
				true, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromCompleteArbitraryPatternpathLocked_node_from, ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] { ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_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, },
				},
				ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_isNodeHomomorphicGlobal,
				ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_isEdgeHomomorphicGlobal,
				ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_isNodeTotallyHomomorphic,
				ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_isEdgeTotallyHomomorphic
			);
			ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0.edgeToSourceNode.Add(ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0, ChainFromCompleteArbitraryPatternpathLocked_node_from);
			ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0.edgeToTargetNode.Add(ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0, ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0);

			ChainFromCompleteArbitraryPatternpathLocked_alt_0_base = new GRGEN_LGSP.PatternGraph(
				"base",
				"ChainFromCompleteArbitraryPatternpathLocked_alt_0_",
				null, "base",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromCompleteArbitraryPatternpathLocked_node_from }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] { ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0,  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_isNodeHomomorphicGlobal,
				ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_isEdgeHomomorphicGlobal,
				ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_isNodeTotallyHomomorphic,
				ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_isEdgeTotallyHomomorphic
			);
			ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0.embeddingGraph = ChainFromCompleteArbitraryPatternpathLocked_alt_0_base;

			bool[,] ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to", "to", ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to_AllowedTypes, ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0", "_edge0", ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0_AllowedTypes, ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_ChainFromCompleteArbitraryPatternpathLocked.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec = new GRGEN_LGSP.PatternGraph(
				"rec",
				"ChainFromCompleteArbitraryPatternpathLocked_alt_0_",
				null, "rec",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromCompleteArbitraryPatternpathLocked_node_from, ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to }, 
				new GRGEN_LGSP.PatternEdge[] { ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec__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[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				new bool[1, 1] {
					{ true, },
				},
				ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_isNodeHomomorphicGlobal,
				ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_isEdgeHomomorphicGlobal,
				ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_isNodeTotallyHomomorphic,
				ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_isEdgeTotallyHomomorphic
			);
			ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec.edgeToSourceNode.Add(ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0, ChainFromCompleteArbitraryPatternpathLocked_node_from);
			ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec.edgeToTargetNode.Add(ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0, ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to);

			GRGEN_LGSP.Alternative ChainFromCompleteArbitraryPatternpathLocked_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "ChainFromCompleteArbitraryPatternpathLocked_", new GRGEN_LGSP.PatternGraph[] { ChainFromCompleteArbitraryPatternpathLocked_alt_0_base, ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec } );

			pat_ChainFromCompleteArbitraryPatternpathLocked = new GRGEN_LGSP.PatternGraph(
				"ChainFromCompleteArbitraryPatternpathLocked",
				"",
				null, "ChainFromCompleteArbitraryPatternpathLocked",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromCompleteArbitraryPatternpathLocked_node_from }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { ChainFromCompleteArbitraryPatternpathLocked_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] ,
				ChainFromCompleteArbitraryPatternpathLocked_isNodeHomomorphicGlobal,
				ChainFromCompleteArbitraryPatternpathLocked_isEdgeHomomorphicGlobal,
				ChainFromCompleteArbitraryPatternpathLocked_isNodeTotallyHomomorphic,
				ChainFromCompleteArbitraryPatternpathLocked_isEdgeTotallyHomomorphic
			);
			ChainFromCompleteArbitraryPatternpathLocked_alt_0_base.embeddingGraph = pat_ChainFromCompleteArbitraryPatternpathLocked;
			ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec.embeddingGraph = pat_ChainFromCompleteArbitraryPatternpathLocked;

			ChainFromCompleteArbitraryPatternpathLocked_node_from.pointOfDefinition = null;
			ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0.pointOfDefinition = ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0;
			ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0.pointOfDefinition = ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0;
			ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.pointOfDefinition = ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec;
			ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.pointOfDefinition = ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec;
			ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec__sub0.PointOfDefinition = ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec;

			patternGraph = pat_ChainFromCompleteArbitraryPatternpathLocked;
		}


		public void ChainFromCompleteArbitraryPatternpathLocked_Create(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LGSP.LGSPNode node_from)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			graph.SettingAddedNodeNames( create_ChainFromCompleteArbitraryPatternpathLocked_addedNodeNames );
			graph.SettingAddedEdgeNames( create_ChainFromCompleteArbitraryPatternpathLocked_addedEdgeNames );
		}
		private static string[] create_ChainFromCompleteArbitraryPatternpathLocked_addedNodeNames = new string[] {  };
		private static string[] create_ChainFromCompleteArbitraryPatternpathLocked_addedEdgeNames = new string[] {  };

		public void ChainFromCompleteArbitraryPatternpathLocked_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromCompleteArbitraryPatternpathLocked curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			IMatch_ChainFromCompleteArbitraryPatternpathLocked_alt_0 alternative_alt_0 = curMatch._alt_0;
		}

		public void ChainFromCompleteArbitraryPatternpathLocked_alt_0_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, IMatch_ChainFromCompleteArbitraryPatternpathLocked_alt_0 curMatch)
		{
			if(curMatch.Pattern == ChainFromCompleteArbitraryPatternpathLocked_alt_0_base) {
				ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_Delete(actionEnv, (Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base)curMatch);
				return;
			}
			else if(curMatch.Pattern == ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec) {
				ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_Delete(actionEnv, (Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec)curMatch);
				return;
			}
			throw new ApplicationException(); //debug assert
		}

		public void ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
		}

		public void ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPNode node_to = curMatch._node_to;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked subpattern__sub0 = curMatch.@__sub0;
			graph.Remove(edge__edge0);
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
			graph.RemoveEdges(node_to);
			graph.Remove(node_to);
			GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryPatternpathLocked.Instance.ChainFromCompleteArbitraryPatternpathLocked_Delete(actionEnv, subpattern__sub0);
		}

		static Pattern_ChainFromCompleteArbitraryPatternpathLocked() {
		}

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

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

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

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

		public interface IMatch_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec : IMatch_ChainFromCompleteArbitraryPatternpathLocked_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_to { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			//Variables
			//EmbeddedGraphs
			@GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked @_sub0 { get; }
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_ChainFromCompleteArbitraryPatternpathLocked : GRGEN_LGSP.MatchListElement<Match_ChainFromCompleteArbitraryPatternpathLocked>, IMatch_ChainFromCompleteArbitraryPatternpathLocked
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public enum ChainFromCompleteArbitraryPatternpathLocked_NodeNums { @from, 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)ChainFromCompleteArbitraryPatternpathLocked_NodeNums.@from: return _node_from;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum ChainFromCompleteArbitraryPatternpathLocked_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 ChainFromCompleteArbitraryPatternpathLocked_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 ChainFromCompleteArbitraryPatternpathLocked_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_ChainFromCompleteArbitraryPatternpathLocked_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_ChainFromCompleteArbitraryPatternpathLocked_alt_0 _alt_0;
			public enum ChainFromCompleteArbitraryPatternpathLocked_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)ChainFromCompleteArbitraryPatternpathLocked_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 ChainFromCompleteArbitraryPatternpathLocked_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 ChainFromCompleteArbitraryPatternpathLocked_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_ChainFromCompleteArbitraryPatternpathLocked.instance.pat_ChainFromCompleteArbitraryPatternpathLocked; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromCompleteArbitraryPatternpathLocked(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromCompleteArbitraryPatternpathLocked(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromCompleteArbitraryPatternpathLocked nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromCompleteArbitraryPatternpathLocked cur = this;
				while(cur != null) {
					Match_ChainFromCompleteArbitraryPatternpathLocked next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

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

			public Match_ChainFromCompleteArbitraryPatternpathLocked(Match_ChainFromCompleteArbitraryPatternpathLocked that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ChainFromCompleteArbitraryPatternpathLocked that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				if(that._alt_0 is Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base)
					_alt_0 = new Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base((Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec)
					_alt_0 = new Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec((Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec)that._alt_0, oldToNewMap);
			}

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

			public bool IsEqual(Match_ChainFromCompleteArbitraryPatternpathLocked that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_alt_0 is Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base && !(_alt_0 as Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base).IsEqual(that._alt_0 as Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base)) return false;
				if(_alt_0 is Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec && !(_alt_0 as Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec).IsEqual(that._alt_0 as Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec)) return false;
				return true;
			}
		}

		public class Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base : GRGEN_LGSP.MatchListElement<Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base>, IMatch_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_NodeNums { @from, 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)ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_NodeNums.@from: return _node_from;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_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_ChainFromCompleteArbitraryPatternpathLocked.instance.ChainFromCompleteArbitraryPatternpathLocked_alt_0_base; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base cur = this;
				while(cur != null) {
					Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base that)
			{
				_node_from = that._node_from;
			}

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

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

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

		public class Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0 : GRGEN_LGSP.MatchListElement<Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0>, IMatch_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			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_from;
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_NodeNums { @from, @_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)ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_NodeNums.@from: return _node_from;
				case (int)ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IEdge edge__edge0 { get { return (GRGEN_LIBGR.IEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_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)ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_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 Pattern_ChainFromCompleteArbitraryPatternpathLocked.instance.ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0 nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0 cur = this;
				while(cur != null) {
					Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0 next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0 that)
			{
				_node_from = that._node_from;
				_node__node0 = that._node__node0;
				_edge__edge0 = that._edge__edge0;
			}

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

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

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

		public class Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec : GRGEN_LGSP.MatchListElement<Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec>, IMatch_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_to;
			public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_NodeNums { @from, @to, 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)ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_NodeNums.@from: return _node_from;
				case (int)ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_NodeNums.@to: return _node_to;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "to": return _node_to;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_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)ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_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_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked @__sub0;
			public enum ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_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)ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_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_ChainFromCompleteArbitraryPatternpathLocked.instance.ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec cur = this;
				while(cur != null) {
					Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec that)
			{
				_node_from = that._node_from;
				_node_to = that._node_to;
				_edge__edge0 = that._edge__edge0;
				@__sub0 = that.@__sub0;
			}

			public Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec(Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				_node_to = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_to];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				@__sub0 = new GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked(that.@__sub0, oldToNewMap);
			}

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

			public bool IsEqual(Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_node_to != that._node_to) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(!@__sub0.IsEqual(that.@__sub0)) return false;
				return true;
			}
		}

	}


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

		public static GRGEN_LIBGR.NodeType[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_AllowedTypes = null;
		public static bool[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_IsAllowedType = null;
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_NodeNums { @from, };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_EdgeNums { };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_VariableNums { };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_SubNums { };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_AltNums { @alt_0, };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards;

		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_CaseNums { @base, @rec, };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_NodeNums { @from, };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_EdgeNums { };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_VariableNums { };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_SubNums { };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_AltNums { };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_IterNums { };



		public GRGEN_LGSP.PatternGraph ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base;

		public static GRGEN_LIBGR.NodeType[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0_AllowedTypes = null;
		public static bool[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_AllowedTypes = null;
		public static bool[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_IsAllowedType = null;
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_NodeNums { @from, @_node0, };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_EdgeNums { @_edge0, };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_VariableNums { };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_SubNums { };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_AltNums { };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_IterNums { };


		public GRGEN_LGSP.PatternGraph ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0;

		public static GRGEN_LIBGR.NodeType[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_AllowedTypes = null;
		public static bool[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_AllowedTypes = null;
		public static bool[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_IsAllowedType = null;
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_NodeNums { @from, @to, };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_EdgeNums { @_edge0, };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_VariableNums { };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_SubNums { @_sub0, };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_AltNums { };
		public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_IterNums { };



		public GRGEN_LGSP.PatternGraph ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec;


		private Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards()
			: base("ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from", },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { }
			)
		{
		}
		private void initialize()
		{
			bool[,] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from", "from", ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_AllowedTypes, ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			bool[,] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_isEdgeTotallyHomomorphic = new bool[0];
			bool[,] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0", "_node0", ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0_AllowedTypes, ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0 = new GRGEN_LGSP.PatternEdge(false, (int) GRGEN_MODEL.EdgeTypes.@AEdge, GRGEN_MODEL.EdgeType_AEdge.typeVar, "GRGEN_LIBGR.IEdge", "ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0", "_edge0", ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_AllowedTypes, ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0 = new GRGEN_LGSP.PatternGraph(
				"neg_0",
				"ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_",
				null, "neg_0",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from, ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] { ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_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, },
				},
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_isNodeHomomorphicGlobal,
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_isEdgeHomomorphicGlobal,
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_isNodeTotallyHomomorphic,
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_isEdgeTotallyHomomorphic
			);
			ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0.edgeToSourceNode.Add(ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0, ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from);
			ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0.edgeToTargetNode.Add(ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0, ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0);

			ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base = new GRGEN_LGSP.PatternGraph(
				"base",
				"ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_",
				null, "base",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] { ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0,  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_isNodeHomomorphicGlobal,
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_isEdgeHomomorphicGlobal,
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_isNodeTotallyHomomorphic,
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_isEdgeTotallyHomomorphic
			);
			ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0.embeddingGraph = ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base;

			bool[,] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to", "to", ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_AllowedTypes, ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0", "_edge0", ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_AllowedTypes, ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec = new GRGEN_LGSP.PatternGraph(
				"rec",
				"ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_",
				null, "rec",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from, ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to }, 
				new GRGEN_LGSP.PatternEdge[] { ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec__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[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				new bool[1, 1] {
					{ true, },
				},
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_isNodeHomomorphicGlobal,
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_isEdgeHomomorphicGlobal,
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_isNodeTotallyHomomorphic,
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_isEdgeTotallyHomomorphic
			);
			ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec.edgeToSourceNode.Add(ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0, ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from);
			ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec.edgeToTargetNode.Add(ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0, ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to);

			GRGEN_LGSP.Alternative ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_", new GRGEN_LGSP.PatternGraph[] { ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base, ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec } );

			pat_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards = new GRGEN_LGSP.PatternGraph(
				"ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards",
				"",
				null, "ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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] ,
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_isNodeHomomorphicGlobal,
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_isEdgeHomomorphicGlobal,
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_isNodeTotallyHomomorphic,
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_isEdgeTotallyHomomorphic
			);
			ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base.embeddingGraph = pat_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards;
			ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec.embeddingGraph = pat_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards;

			ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from.pointOfDefinition = null;
			ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0.pointOfDefinition = ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0;
			ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0.pointOfDefinition = ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0;
			ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to.pointOfDefinition = ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec;
			ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0.pointOfDefinition = ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec;
			ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec__sub0.PointOfDefinition = ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec;

			patternGraph = pat_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards;
		}


		public void ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_Create(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LGSP.LGSPNode node_from)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			graph.SettingAddedNodeNames( create_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_addedNodeNames );
			graph.SettingAddedEdgeNames( create_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_addedEdgeNames );
		}
		private static string[] create_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_addedNodeNames = new string[] {  };
		private static string[] create_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_addedEdgeNames = new string[] {  };

		public void ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			IMatch_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0 alternative_alt_0 = curMatch._alt_0;
		}

		public void ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, IMatch_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0 curMatch)
		{
			if(curMatch.Pattern == ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base) {
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_Delete(actionEnv, (Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base)curMatch);
				return;
			}
			else if(curMatch.Pattern == ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec) {
				ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_Delete(actionEnv, (Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec)curMatch);
				return;
			}
			throw new ApplicationException(); //debug assert
		}

		public void ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
		}

		public void ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPNode node_to = curMatch._node_to;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards subpattern__sub0 = curMatch.@__sub0;
			graph.Remove(edge__edge0);
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
			graph.RemoveEdges(node_to);
			graph.Remove(node_to);
			GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_Delete(actionEnv, subpattern__sub0);
		}

		static Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards() {
		}

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

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

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

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

		public interface IMatch_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec : IMatch_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_to { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			//Variables
			//EmbeddedGraphs
			@GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards @_sub0 { get; }
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards : GRGEN_LGSP.MatchListElement<Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards>, IMatch_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_NodeNums { @from, 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)ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_NodeNums.@from: return _node_from;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0 _alt_0;
			public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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)ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.instance.pat_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards cur = this;
				while(cur != null) {
					Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

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

			public Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards(Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				if(that._alt_0 is Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base)
					_alt_0 = new Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base((Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec)
					_alt_0 = new Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec((Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec)that._alt_0, oldToNewMap);
			}

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

			public bool IsEqual(Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_alt_0 is Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base && !(_alt_0 as Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base).IsEqual(that._alt_0 as Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base)) return false;
				if(_alt_0 is Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec && !(_alt_0 as Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec).IsEqual(that._alt_0 as Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec)) return false;
				return true;
			}
		}

		public class Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base : GRGEN_LGSP.MatchListElement<Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base>, IMatch_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_NodeNums { @from, 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)ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_NodeNums.@from: return _node_from;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.instance.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base cur = this;
				while(cur != null) {
					Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base that)
			{
				_node_from = that._node_from;
			}

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

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

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

		public class Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0 : GRGEN_LGSP.MatchListElement<Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0>, IMatch_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			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_from;
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_NodeNums { @from, @_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)ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_NodeNums.@from: return _node_from;
				case (int)ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "_node0": _node__node0 = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public GRGEN_LIBGR.IEdge edge__edge0 { get { return (GRGEN_LIBGR.IEdge)_edge__edge0; } set { _edge__edge0 = (GRGEN_LGSP.LGSPEdge)value; } }
			public GRGEN_LGSP.LGSPEdge _edge__edge0;
			public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_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)ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_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 Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.instance.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0 nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0 cur = this;
				while(cur != null) {
					Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0 next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0 that)
			{
				_node_from = that._node_from;
				_node__node0 = that._node__node0;
				_edge__edge0 = that._edge__edge0;
			}

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

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

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

		public class Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec : GRGEN_LGSP.MatchListElement<Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec>, IMatch_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_to;
			public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_NodeNums { @from, @to, 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)ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_NodeNums.@from: return _node_from;
				case (int)ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_NodeNums.@to: return _node_to;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "to": return _node_to;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_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)ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards @__sub0;
			public enum ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_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)ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.instance.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec cur = this;
				while(cur != null) {
					Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec that)
			{
				_node_from = that._node_from;
				_node_to = that._node_to;
				_edge__edge0 = that._edge__edge0;
				@__sub0 = that.@__sub0;
			}

			public Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec(Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				_node_to = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_to];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				@__sub0 = new GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards(that.@__sub0, oldToNewMap);
			}

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

			public bool IsEqual(Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_node_to != that._node_to) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(!@__sub0.IsEqual(that.@__sub0)) return false;
				return true;
			}
		}

	}


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

		public static GRGEN_LIBGR.NodeType[] Blowball_node_head_AllowedTypes = null;
		public static bool[] Blowball_node_head_IsAllowedType = null;
		public enum Blowball_NodeNums { @head, };
		public enum Blowball_EdgeNums { };
		public enum Blowball_VariableNums { };
		public enum Blowball_SubNums { };
		public enum Blowball_AltNums { @alt_0, };
		public enum Blowball_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_Blowball;

		public enum Blowball_alt_0_CaseNums { @end, @further, };
		public enum Blowball_alt_0_end_NodeNums { @head, };
		public enum Blowball_alt_0_end_EdgeNums { };
		public enum Blowball_alt_0_end_VariableNums { };
		public enum Blowball_alt_0_end_SubNums { };
		public enum Blowball_alt_0_end_AltNums { };
		public enum Blowball_alt_0_end_IterNums { };



		public GRGEN_LGSP.PatternGraph Blowball_alt_0_end;

		public static GRGEN_LIBGR.NodeType[] Blowball_alt_0_end_neg_0_node__node0_AllowedTypes = null;
		public static bool[] Blowball_alt_0_end_neg_0_node__node0_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] Blowball_alt_0_end_neg_0_edge__edge0_AllowedTypes = null;
		public static bool[] Blowball_alt_0_end_neg_0_edge__edge0_IsAllowedType = null;
		public enum Blowball_alt_0_end_neg_0_NodeNums { @head, @_node0, };
		public enum Blowball_alt_0_end_neg_0_EdgeNums { @_edge0, };
		public enum Blowball_alt_0_end_neg_0_VariableNums { };
		public enum Blowball_alt_0_end_neg_0_SubNums { };
		public enum Blowball_alt_0_end_neg_0_AltNums { };
		public enum Blowball_alt_0_end_neg_0_IterNums { };


		public GRGEN_LGSP.PatternGraph Blowball_alt_0_end_neg_0;

		public static GRGEN_LIBGR.NodeType[] Blowball_alt_0_further_node__node0_AllowedTypes = null;
		public static bool[] Blowball_alt_0_further_node__node0_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] Blowball_alt_0_further_edge__edge0_AllowedTypes = null;
		public static bool[] Blowball_alt_0_further_edge__edge0_IsAllowedType = null;
		public enum Blowball_alt_0_further_NodeNums { @head, @_node0, };
		public enum Blowball_alt_0_further_EdgeNums { @_edge0, };
		public enum Blowball_alt_0_further_VariableNums { };
		public enum Blowball_alt_0_further_SubNums { @_sub0, };
		public enum Blowball_alt_0_further_AltNums { };
		public enum Blowball_alt_0_further_IterNums { };



		public GRGEN_LGSP.PatternGraph Blowball_alt_0_further;


		private Pattern_Blowball()
			: base("Blowball",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "Blowball_node_head", },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { }
			)
		{
		}
		private void initialize()
		{
			bool[,] Blowball_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] Blowball_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] Blowball_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] Blowball_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode Blowball_node_head = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "Blowball_node_head", "head", Blowball_node_head_AllowedTypes, Blowball_node_head_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			bool[,] Blowball_alt_0_end_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] Blowball_alt_0_end_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] Blowball_alt_0_end_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] Blowball_alt_0_end_isEdgeTotallyHomomorphic = new bool[0];
			bool[,] Blowball_alt_0_end_neg_0_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] Blowball_alt_0_end_neg_0_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] Blowball_alt_0_end_neg_0_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] Blowball_alt_0_end_neg_0_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode Blowball_alt_0_end_neg_0_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "Blowball_alt_0_end_neg_0_node__node0", "_node0", Blowball_alt_0_end_neg_0_node__node0_AllowedTypes, Blowball_alt_0_end_neg_0_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Blowball_alt_0_end_neg_0_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Blowball_alt_0_end_neg_0_edge__edge0", "_edge0", Blowball_alt_0_end_neg_0_edge__edge0_AllowedTypes, Blowball_alt_0_end_neg_0_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			Blowball_alt_0_end_neg_0 = new GRGEN_LGSP.PatternGraph(
				"neg_0",
				"Blowball_alt_0_end_",
				null, "neg_0",
				true, false,
				new GRGEN_LGSP.PatternNode[] { Blowball_node_head, Blowball_alt_0_end_neg_0_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] { Blowball_alt_0_end_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, },
				},
				Blowball_alt_0_end_neg_0_isNodeHomomorphicGlobal,
				Blowball_alt_0_end_neg_0_isEdgeHomomorphicGlobal,
				Blowball_alt_0_end_neg_0_isNodeTotallyHomomorphic,
				Blowball_alt_0_end_neg_0_isEdgeTotallyHomomorphic
			);
			Blowball_alt_0_end_neg_0.edgeToSourceNode.Add(Blowball_alt_0_end_neg_0_edge__edge0, Blowball_node_head);
			Blowball_alt_0_end_neg_0.edgeToTargetNode.Add(Blowball_alt_0_end_neg_0_edge__edge0, Blowball_alt_0_end_neg_0_node__node0);

			Blowball_alt_0_end = new GRGEN_LGSP.PatternGraph(
				"end",
				"Blowball_alt_0_",
				null, "end",
				false, false,
				new GRGEN_LGSP.PatternNode[] { Blowball_node_head }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] {  }, 
				new GRGEN_LGSP.Iterated[] {  }, 
				new GRGEN_LGSP.PatternGraph[] { Blowball_alt_0_end_neg_0,  }, 
				new GRGEN_LGSP.PatternGraph[] {  }, 
				new GRGEN_LGSP.PatternCondition[] {  }, 
				new GRGEN_LGSP.PatternYielding[] {  }, 
				new bool[1, 1] {
					{ true, },
				},
				new bool[0, 0] ,
				Blowball_alt_0_end_isNodeHomomorphicGlobal,
				Blowball_alt_0_end_isEdgeHomomorphicGlobal,
				Blowball_alt_0_end_isNodeTotallyHomomorphic,
				Blowball_alt_0_end_isEdgeTotallyHomomorphic
			);
			Blowball_alt_0_end_neg_0.embeddingGraph = Blowball_alt_0_end;

			bool[,] Blowball_alt_0_further_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] Blowball_alt_0_further_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] Blowball_alt_0_further_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] Blowball_alt_0_further_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode Blowball_alt_0_further_node__node0 = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "Blowball_alt_0_further_node__node0", "_node0", Blowball_alt_0_further_node__node0_AllowedTypes, Blowball_alt_0_further_node__node0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge Blowball_alt_0_further_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "Blowball_alt_0_further_edge__edge0", "_edge0", Blowball_alt_0_further_edge__edge0_AllowedTypes, Blowball_alt_0_further_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding Blowball_alt_0_further__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_Blowball.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("Blowball_node_head"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "Blowball_node_head" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { Blowball_node_head }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			Blowball_alt_0_further = new GRGEN_LGSP.PatternGraph(
				"further",
				"Blowball_alt_0_",
				null, "further",
				false, false,
				new GRGEN_LGSP.PatternNode[] { Blowball_node_head, Blowball_alt_0_further_node__node0 }, 
				new GRGEN_LGSP.PatternEdge[] { Blowball_alt_0_further_edge__edge0 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { Blowball_alt_0_further__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[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				new bool[1, 1] {
					{ true, },
				},
				Blowball_alt_0_further_isNodeHomomorphicGlobal,
				Blowball_alt_0_further_isEdgeHomomorphicGlobal,
				Blowball_alt_0_further_isNodeTotallyHomomorphic,
				Blowball_alt_0_further_isEdgeTotallyHomomorphic
			);
			Blowball_alt_0_further.edgeToSourceNode.Add(Blowball_alt_0_further_edge__edge0, Blowball_node_head);
			Blowball_alt_0_further.edgeToTargetNode.Add(Blowball_alt_0_further_edge__edge0, Blowball_alt_0_further_node__node0);

			GRGEN_LGSP.Alternative Blowball_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "Blowball_", new GRGEN_LGSP.PatternGraph[] { Blowball_alt_0_end, Blowball_alt_0_further } );

			pat_Blowball = new GRGEN_LGSP.PatternGraph(
				"Blowball",
				"",
				null, "Blowball",
				false, false,
				new GRGEN_LGSP.PatternNode[] { Blowball_node_head }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { Blowball_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] ,
				Blowball_isNodeHomomorphicGlobal,
				Blowball_isEdgeHomomorphicGlobal,
				Blowball_isNodeTotallyHomomorphic,
				Blowball_isEdgeTotallyHomomorphic
			);
			Blowball_alt_0_end.embeddingGraph = pat_Blowball;
			Blowball_alt_0_further.embeddingGraph = pat_Blowball;

			Blowball_node_head.pointOfDefinition = null;
			Blowball_alt_0_end_neg_0_node__node0.pointOfDefinition = Blowball_alt_0_end_neg_0;
			Blowball_alt_0_end_neg_0_edge__edge0.pointOfDefinition = Blowball_alt_0_end_neg_0;
			Blowball_alt_0_further_node__node0.pointOfDefinition = Blowball_alt_0_further;
			Blowball_alt_0_further_edge__edge0.pointOfDefinition = Blowball_alt_0_further;
			Blowball_alt_0_further__sub0.PointOfDefinition = Blowball_alt_0_further;

			patternGraph = pat_Blowball;
		}


		public void Blowball_Create(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LGSP.LGSPNode node_head)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			graph.SettingAddedNodeNames( create_Blowball_addedNodeNames );
			graph.SettingAddedEdgeNames( create_Blowball_addedEdgeNames );
		}
		private static string[] create_Blowball_addedNodeNames = new string[] {  };
		private static string[] create_Blowball_addedEdgeNames = new string[] {  };

		public void Blowball_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_Blowball curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			IMatch_Blowball_alt_0 alternative_alt_0 = curMatch._alt_0;
		}

		public void Blowball_alt_0_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, IMatch_Blowball_alt_0 curMatch)
		{
			if(curMatch.Pattern == Blowball_alt_0_end) {
				Blowball_alt_0_end_Delete(actionEnv, (Match_Blowball_alt_0_end)curMatch);
				return;
			}
			else if(curMatch.Pattern == Blowball_alt_0_further) {
				Blowball_alt_0_further_Delete(actionEnv, (Match_Blowball_alt_0_further)curMatch);
				return;
			}
			throw new ApplicationException(); //debug assert
		}

		public void Blowball_alt_0_end_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_Blowball_alt_0_end curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_head = curMatch._node_head;
			graph.RemoveEdges(node_head);
			graph.Remove(node_head);
		}

		public void Blowball_alt_0_further_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_Blowball_alt_0_further curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_head = curMatch._node_head;
			GRGEN_LGSP.LGSPNode node__node0 = curMatch._node__node0;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			GRGEN_ACTIONS.Pattern_Blowball.Match_Blowball subpattern__sub0 = curMatch.@__sub0;
			graph.Remove(edge__edge0);
			graph.RemoveEdges(node_head);
			graph.Remove(node_head);
			graph.RemoveEdges(node__node0);
			graph.Remove(node__node0);
			GRGEN_ACTIONS.Pattern_Blowball.Instance.Blowball_Delete(actionEnv, subpattern__sub0);
		}

		static Pattern_Blowball() {
		}

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

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

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

		public interface IMatch_Blowball_alt_0_end_neg_0 : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_LIBGR.INode node_head { get; set; }
			GRGEN_LIBGR.INode 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_Blowball_alt_0_further : IMatch_Blowball_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node_head { get; set; }
			GRGEN_LIBGR.INode node__node0 { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			//Variables
			//EmbeddedGraphs
			@GRGEN_ACTIONS.Pattern_Blowball.Match_Blowball @_sub0 { get; }
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_Blowball : GRGEN_LGSP.MatchListElement<Match_Blowball>, IMatch_Blowball
		{
			public GRGEN_LIBGR.INode node_head { get { return (GRGEN_LIBGR.INode)_node_head; } set { _node_head = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_head;
			public enum Blowball_NodeNums { @head, 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)Blowball_NodeNums.@head: return _node_head;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "head": return _node_head;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "head": _node_head = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum Blowball_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 Blowball_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 Blowball_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_Blowball_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_Blowball_alt_0 _alt_0;
			public enum Blowball_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)Blowball_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 Blowball_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 Blowball_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_Blowball.instance.pat_Blowball; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_Blowball(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_Blowball(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_Blowball nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_Blowball cur = this;
				while(cur != null) {
					Match_Blowball next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

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

			public Match_Blowball(Match_Blowball that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_Blowball that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_head = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_head];
				if(that._alt_0 is Match_Blowball_alt_0_end)
					_alt_0 = new Match_Blowball_alt_0_end((Match_Blowball_alt_0_end)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_Blowball_alt_0_further)
					_alt_0 = new Match_Blowball_alt_0_further((Match_Blowball_alt_0_further)that._alt_0, oldToNewMap);
			}

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

			public bool IsEqual(Match_Blowball that)
			{
				if(that==null) return false;
				if(_node_head != that._node_head) return false;
				if(_alt_0 is Match_Blowball_alt_0_end && !(_alt_0 as Match_Blowball_alt_0_end).IsEqual(that._alt_0 as Match_Blowball_alt_0_end)) return false;
				if(_alt_0 is Match_Blowball_alt_0_further && !(_alt_0 as Match_Blowball_alt_0_further).IsEqual(that._alt_0 as Match_Blowball_alt_0_further)) return false;
				return true;
			}
		}

		public class Match_Blowball_alt_0_end : GRGEN_LGSP.MatchListElement<Match_Blowball_alt_0_end>, IMatch_Blowball_alt_0_end
		{
			public GRGEN_LIBGR.INode node_head { get { return (GRGEN_LIBGR.INode)_node_head; } set { _node_head = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_head;
			public enum Blowball_alt_0_end_NodeNums { @head, 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)Blowball_alt_0_end_NodeNums.@head: return _node_head;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "head": return _node_head;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "head": _node_head = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum Blowball_alt_0_end_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 Blowball_alt_0_end_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 Blowball_alt_0_end_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 Blowball_alt_0_end_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 Blowball_alt_0_end_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 Blowball_alt_0_end_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_Blowball.instance.Blowball_alt_0_end; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_Blowball_alt_0_end(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_Blowball_alt_0_end(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_Blowball_alt_0_end nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_Blowball_alt_0_end cur = this;
				while(cur != null) {
					Match_Blowball_alt_0_end next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_Blowball_alt_0_end that)
			{
				_node_head = that._node_head;
			}

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

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

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

		public class Match_Blowball_alt_0_end_neg_0 : GRGEN_LGSP.MatchListElement<Match_Blowball_alt_0_end_neg_0>, IMatch_Blowball_alt_0_end_neg_0
		{
			public GRGEN_LIBGR.INode node_head { get { return (GRGEN_LIBGR.INode)_node_head; } set { _node_head = (GRGEN_LGSP.LGSPNode)value; } }
			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_head;
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum Blowball_alt_0_end_neg_0_NodeNums { @head, @_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)Blowball_alt_0_end_neg_0_NodeNums.@head: return _node_head;
				case (int)Blowball_alt_0_end_neg_0_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "head": return _node_head;
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "head": _node_head = (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 Blowball_alt_0_end_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)Blowball_alt_0_end_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 Blowball_alt_0_end_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 Blowball_alt_0_end_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 Blowball_alt_0_end_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 Blowball_alt_0_end_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 Blowball_alt_0_end_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 Pattern_Blowball.instance.Blowball_alt_0_end_neg_0; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_Blowball_alt_0_end_neg_0(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_Blowball_alt_0_end_neg_0(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_Blowball_alt_0_end_neg_0 nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_Blowball_alt_0_end_neg_0 cur = this;
				while(cur != null) {
					Match_Blowball_alt_0_end_neg_0 next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_Blowball_alt_0_end_neg_0 that)
			{
				_node_head = that._node_head;
				_node__node0 = that._node__node0;
				_edge__edge0 = that._edge__edge0;
			}

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

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

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

		public class Match_Blowball_alt_0_further : GRGEN_LGSP.MatchListElement<Match_Blowball_alt_0_further>, IMatch_Blowball_alt_0_further
		{
			public GRGEN_LIBGR.INode node_head { get { return (GRGEN_LIBGR.INode)_node_head; } set { _node_head = (GRGEN_LGSP.LGSPNode)value; } }
			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_head;
			public GRGEN_LGSP.LGSPNode _node__node0;
			public enum Blowball_alt_0_further_NodeNums { @head, @_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)Blowball_alt_0_further_NodeNums.@head: return _node_head;
				case (int)Blowball_alt_0_further_NodeNums.@_node0: return _node__node0;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "head": return _node_head;
				case "_node0": return _node__node0;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "head": _node_head = (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 Blowball_alt_0_further_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)Blowball_alt_0_further_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 Blowball_alt_0_further_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_Blowball.Match_Blowball @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_Blowball.Match_Blowball @__sub0;
			public enum Blowball_alt_0_further_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)Blowball_alt_0_further_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 Blowball_alt_0_further_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 Blowball_alt_0_further_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 Blowball_alt_0_further_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_Blowball.instance.Blowball_alt_0_further; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_Blowball_alt_0_further(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_Blowball_alt_0_further(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_Blowball_alt_0_further nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_Blowball_alt_0_further cur = this;
				while(cur != null) {
					Match_Blowball_alt_0_further next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_Blowball_alt_0_further that)
			{
				_node_head = that._node_head;
				_node__node0 = that._node__node0;
				_edge__edge0 = that._edge__edge0;
				@__sub0 = that.@__sub0;
			}

			public Match_Blowball_alt_0_further(Match_Blowball_alt_0_further that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_Blowball_alt_0_further that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_head = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_head];
				_node__node0 = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node__node0];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				@__sub0 = new GRGEN_ACTIONS.Pattern_Blowball.Match_Blowball(that.@__sub0, oldToNewMap);
			}

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

			public bool IsEqual(Match_Blowball_alt_0_further that)
			{
				if(that==null) return false;
				if(_node_head != that._node_head) return false;
				if(_node__node0 != that._node__node0) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(!@__sub0.IsEqual(that.@__sub0)) return false;
				return true;
			}
		}

	}


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

		public static GRGEN_LIBGR.NodeType[] ReverseChainFromTo_node_from_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] ReverseChainFromTo_node_to_AllowedTypes = null;
		public static bool[] ReverseChainFromTo_node_from_IsAllowedType = null;
		public static bool[] ReverseChainFromTo_node_to_IsAllowedType = null;
		public enum ReverseChainFromTo_NodeNums { @from, @to, };
		public enum ReverseChainFromTo_EdgeNums { };
		public enum ReverseChainFromTo_VariableNums { };
		public enum ReverseChainFromTo_SubNums { };
		public enum ReverseChainFromTo_AltNums { @alt_0, };
		public enum ReverseChainFromTo_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_ReverseChainFromTo;

		public enum ReverseChainFromTo_alt_0_CaseNums { @base, @rec, };
		public static GRGEN_LIBGR.EdgeType[] ReverseChainFromTo_alt_0_base_edge__edge0_AllowedTypes = null;
		public static bool[] ReverseChainFromTo_alt_0_base_edge__edge0_IsAllowedType = null;
		public enum ReverseChainFromTo_alt_0_base_NodeNums { @to, @from, };
		public enum ReverseChainFromTo_alt_0_base_EdgeNums { @_edge0, };
		public enum ReverseChainFromTo_alt_0_base_VariableNums { };
		public enum ReverseChainFromTo_alt_0_base_SubNums { };
		public enum ReverseChainFromTo_alt_0_base_AltNums { };
		public enum ReverseChainFromTo_alt_0_base_IterNums { };



		public GRGEN_LGSP.PatternGraph ReverseChainFromTo_alt_0_base;

		public static GRGEN_LIBGR.NodeType[] ReverseChainFromTo_alt_0_rec_node_intermediate_AllowedTypes = null;
		public static bool[] ReverseChainFromTo_alt_0_rec_node_intermediate_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ReverseChainFromTo_alt_0_rec_edge__edge0_AllowedTypes = null;
		public static bool[] ReverseChainFromTo_alt_0_rec_edge__edge0_IsAllowedType = null;
		public enum ReverseChainFromTo_alt_0_rec_NodeNums { @intermediate, @from, @to, };
		public enum ReverseChainFromTo_alt_0_rec_EdgeNums { @_edge0, };
		public enum ReverseChainFromTo_alt_0_rec_VariableNums { };
		public enum ReverseChainFromTo_alt_0_rec_SubNums { @_sub0, };
		public enum ReverseChainFromTo_alt_0_rec_AltNums { };
		public enum ReverseChainFromTo_alt_0_rec_IterNums { };



		public GRGEN_LGSP.PatternGraph ReverseChainFromTo_alt_0_rec;


		private Pattern_ReverseChainFromTo()
			: base("ReverseChainFromTo",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "ReverseChainFromTo_node_from", "ReverseChainFromTo_node_to", },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { }
			)
		{
		}
		private void initialize()
		{
			bool[,] ReverseChainFromTo_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ReverseChainFromTo_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] ReverseChainFromTo_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ReverseChainFromTo_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode ReverseChainFromTo_node_from = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ReverseChainFromTo_node_from", "from", ReverseChainFromTo_node_from_AllowedTypes, ReverseChainFromTo_node_from_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode ReverseChainFromTo_node_to = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ReverseChainFromTo_node_to", "to", ReverseChainFromTo_node_to_AllowedTypes, ReverseChainFromTo_node_to_IsAllowedType, 5.5F, 1, false, null, null, null, null, null, null, false, null);
			bool[,] ReverseChainFromTo_alt_0_base_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ReverseChainFromTo_alt_0_base_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] ReverseChainFromTo_alt_0_base_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ReverseChainFromTo_alt_0_base_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternEdge ReverseChainFromTo_alt_0_base_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ReverseChainFromTo_alt_0_base_edge__edge0", "_edge0", ReverseChainFromTo_alt_0_base_edge__edge0_AllowedTypes, ReverseChainFromTo_alt_0_base_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			ReverseChainFromTo_alt_0_base = new GRGEN_LGSP.PatternGraph(
				"base",
				"ReverseChainFromTo_alt_0_",
				null, "base",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ReverseChainFromTo_node_to, ReverseChainFromTo_node_from }, 
				new GRGEN_LGSP.PatternEdge[] { ReverseChainFromTo_alt_0_base_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, },
				},
				ReverseChainFromTo_alt_0_base_isNodeHomomorphicGlobal,
				ReverseChainFromTo_alt_0_base_isEdgeHomomorphicGlobal,
				ReverseChainFromTo_alt_0_base_isNodeTotallyHomomorphic,
				ReverseChainFromTo_alt_0_base_isEdgeTotallyHomomorphic
			);
			ReverseChainFromTo_alt_0_base.edgeToSourceNode.Add(ReverseChainFromTo_alt_0_base_edge__edge0, ReverseChainFromTo_node_to);
			ReverseChainFromTo_alt_0_base.edgeToTargetNode.Add(ReverseChainFromTo_alt_0_base_edge__edge0, ReverseChainFromTo_node_from);

			bool[,] ReverseChainFromTo_alt_0_rec_isNodeHomomorphicGlobal = new bool[3, 3] {
				{ false, false, false, },
				{ false, false, false, },
				{ false, false, false, },
			};
			bool[,] ReverseChainFromTo_alt_0_rec_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] ReverseChainFromTo_alt_0_rec_isNodeTotallyHomomorphic = new bool[3] { false, false, false,  };
			bool[] ReverseChainFromTo_alt_0_rec_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode ReverseChainFromTo_alt_0_rec_node_intermediate = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ReverseChainFromTo_alt_0_rec_node_intermediate", "intermediate", ReverseChainFromTo_alt_0_rec_node_intermediate_AllowedTypes, ReverseChainFromTo_alt_0_rec_node_intermediate_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ReverseChainFromTo_alt_0_rec_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ReverseChainFromTo_alt_0_rec_edge__edge0", "_edge0", ReverseChainFromTo_alt_0_rec_edge__edge0_AllowedTypes, ReverseChainFromTo_alt_0_rec_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding ReverseChainFromTo_alt_0_rec__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_ReverseChainFromTo.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("ReverseChainFromTo_alt_0_rec_node_intermediate"),
					new GRGEN_EXPR.GraphEntityExpression("ReverseChainFromTo_node_to"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "ReverseChainFromTo_alt_0_rec_node_intermediate", "ReverseChainFromTo_node_to" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { ReverseChainFromTo_alt_0_rec_node_intermediate, ReverseChainFromTo_node_to }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			ReverseChainFromTo_alt_0_rec = new GRGEN_LGSP.PatternGraph(
				"rec",
				"ReverseChainFromTo_alt_0_",
				null, "rec",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ReverseChainFromTo_alt_0_rec_node_intermediate, ReverseChainFromTo_node_from, ReverseChainFromTo_node_to }, 
				new GRGEN_LGSP.PatternEdge[] { ReverseChainFromTo_alt_0_rec_edge__edge0 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { ReverseChainFromTo_alt_0_rec__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[3, 3] {
					{ true, false, true, },
					{ false, true, true, },
					{ true, true, true, },
				},
				new bool[1, 1] {
					{ true, },
				},
				ReverseChainFromTo_alt_0_rec_isNodeHomomorphicGlobal,
				ReverseChainFromTo_alt_0_rec_isEdgeHomomorphicGlobal,
				ReverseChainFromTo_alt_0_rec_isNodeTotallyHomomorphic,
				ReverseChainFromTo_alt_0_rec_isEdgeTotallyHomomorphic
			);
			ReverseChainFromTo_alt_0_rec.edgeToSourceNode.Add(ReverseChainFromTo_alt_0_rec_edge__edge0, ReverseChainFromTo_alt_0_rec_node_intermediate);
			ReverseChainFromTo_alt_0_rec.edgeToTargetNode.Add(ReverseChainFromTo_alt_0_rec_edge__edge0, ReverseChainFromTo_node_from);

			GRGEN_LGSP.Alternative ReverseChainFromTo_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "ReverseChainFromTo_", new GRGEN_LGSP.PatternGraph[] { ReverseChainFromTo_alt_0_base, ReverseChainFromTo_alt_0_rec } );

			pat_ReverseChainFromTo = new GRGEN_LGSP.PatternGraph(
				"ReverseChainFromTo",
				"",
				null, "ReverseChainFromTo",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ReverseChainFromTo_node_from, ReverseChainFromTo_node_to }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { ReverseChainFromTo_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[0, 0] ,
				ReverseChainFromTo_isNodeHomomorphicGlobal,
				ReverseChainFromTo_isEdgeHomomorphicGlobal,
				ReverseChainFromTo_isNodeTotallyHomomorphic,
				ReverseChainFromTo_isEdgeTotallyHomomorphic
			);
			ReverseChainFromTo_alt_0_base.embeddingGraph = pat_ReverseChainFromTo;
			ReverseChainFromTo_alt_0_rec.embeddingGraph = pat_ReverseChainFromTo;

			ReverseChainFromTo_node_from.pointOfDefinition = null;
			ReverseChainFromTo_node_to.pointOfDefinition = null;
			ReverseChainFromTo_alt_0_base_edge__edge0.pointOfDefinition = ReverseChainFromTo_alt_0_base;
			ReverseChainFromTo_alt_0_rec_node_intermediate.pointOfDefinition = ReverseChainFromTo_alt_0_rec;
			ReverseChainFromTo_alt_0_rec_edge__edge0.pointOfDefinition = ReverseChainFromTo_alt_0_rec;
			ReverseChainFromTo_alt_0_rec__sub0.PointOfDefinition = ReverseChainFromTo_alt_0_rec;

			patternGraph = pat_ReverseChainFromTo;
		}


		public void ReverseChainFromTo_Create(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LGSP.LGSPNode node_from, GRGEN_LGSP.LGSPNode node_to)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			graph.SettingAddedNodeNames( create_ReverseChainFromTo_addedNodeNames );
			graph.SettingAddedEdgeNames( create_ReverseChainFromTo_addedEdgeNames );
		}
		private static string[] create_ReverseChainFromTo_addedNodeNames = new string[] {  };
		private static string[] create_ReverseChainFromTo_addedEdgeNames = new string[] {  };

		public void ReverseChainFromTo_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ReverseChainFromTo curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			IMatch_ReverseChainFromTo_alt_0 alternative_alt_0 = curMatch._alt_0;
		}

		public void ReverseChainFromTo_alt_0_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, IMatch_ReverseChainFromTo_alt_0 curMatch)
		{
			if(curMatch.Pattern == ReverseChainFromTo_alt_0_base) {
				ReverseChainFromTo_alt_0_base_Delete(actionEnv, (Match_ReverseChainFromTo_alt_0_base)curMatch);
				return;
			}
			else if(curMatch.Pattern == ReverseChainFromTo_alt_0_rec) {
				ReverseChainFromTo_alt_0_rec_Delete(actionEnv, (Match_ReverseChainFromTo_alt_0_rec)curMatch);
				return;
			}
			throw new ApplicationException(); //debug assert
		}

		public void ReverseChainFromTo_alt_0_base_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ReverseChainFromTo_alt_0_base curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_to = curMatch._node_to;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			graph.Remove(edge__edge0);
			graph.RemoveEdges(node_to);
			graph.Remove(node_to);
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
		}

		public void ReverseChainFromTo_alt_0_rec_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ReverseChainFromTo_alt_0_rec curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_intermediate = curMatch._node_intermediate;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPNode node_to = curMatch._node_to;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			GRGEN_ACTIONS.Pattern_ReverseChainFromTo.Match_ReverseChainFromTo subpattern__sub0 = curMatch.@__sub0;
			graph.Remove(edge__edge0);
			graph.RemoveEdges(node_intermediate);
			graph.Remove(node_intermediate);
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
			graph.RemoveEdges(node_to);
			graph.Remove(node_to);
			GRGEN_ACTIONS.Pattern_ReverseChainFromTo.Instance.ReverseChainFromTo_Delete(actionEnv, subpattern__sub0);
		}

		static Pattern_ReverseChainFromTo() {
		}

		public interface IMatch_ReverseChainFromTo : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_to { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			IMatch_ReverseChainFromTo_alt_0 alt_0 { get; }
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

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

		public interface IMatch_ReverseChainFromTo_alt_0_base : IMatch_ReverseChainFromTo_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node_to { get; set; }
			GRGEN_LIBGR.INode node_from { 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_ReverseChainFromTo_alt_0_rec : IMatch_ReverseChainFromTo_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node_intermediate { get; set; }
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_to { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			//Variables
			//EmbeddedGraphs
			@GRGEN_ACTIONS.Pattern_ReverseChainFromTo.Match_ReverseChainFromTo @_sub0 { get; }
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_ReverseChainFromTo : GRGEN_LGSP.MatchListElement<Match_ReverseChainFromTo>, IMatch_ReverseChainFromTo
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_to;
			public enum ReverseChainFromTo_NodeNums { @from, @to, 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)ReverseChainFromTo_NodeNums.@from: return _node_from;
				case (int)ReverseChainFromTo_NodeNums.@to: return _node_to;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "to": return _node_to;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum ReverseChainFromTo_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 ReverseChainFromTo_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 ReverseChainFromTo_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_ReverseChainFromTo_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_ReverseChainFromTo_alt_0 _alt_0;
			public enum ReverseChainFromTo_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)ReverseChainFromTo_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 ReverseChainFromTo_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 ReverseChainFromTo_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_ReverseChainFromTo.instance.pat_ReverseChainFromTo; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ReverseChainFromTo(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ReverseChainFromTo(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ReverseChainFromTo nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ReverseChainFromTo cur = this;
				while(cur != null) {
					Match_ReverseChainFromTo next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ReverseChainFromTo that)
			{
				_node_from = that._node_from;
				_node_to = that._node_to;
				_alt_0 = that._alt_0;
			}

			public Match_ReverseChainFromTo(Match_ReverseChainFromTo that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ReverseChainFromTo that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				_node_to = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_to];
				if(that._alt_0 is Match_ReverseChainFromTo_alt_0_base)
					_alt_0 = new Match_ReverseChainFromTo_alt_0_base((Match_ReverseChainFromTo_alt_0_base)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_ReverseChainFromTo_alt_0_rec)
					_alt_0 = new Match_ReverseChainFromTo_alt_0_rec((Match_ReverseChainFromTo_alt_0_rec)that._alt_0, oldToNewMap);
			}

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

			public bool IsEqual(Match_ReverseChainFromTo that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_node_to != that._node_to) return false;
				if(_alt_0 is Match_ReverseChainFromTo_alt_0_base && !(_alt_0 as Match_ReverseChainFromTo_alt_0_base).IsEqual(that._alt_0 as Match_ReverseChainFromTo_alt_0_base)) return false;
				if(_alt_0 is Match_ReverseChainFromTo_alt_0_rec && !(_alt_0 as Match_ReverseChainFromTo_alt_0_rec).IsEqual(that._alt_0 as Match_ReverseChainFromTo_alt_0_rec)) return false;
				return true;
			}
		}

		public class Match_ReverseChainFromTo_alt_0_base : GRGEN_LGSP.MatchListElement<Match_ReverseChainFromTo_alt_0_base>, IMatch_ReverseChainFromTo_alt_0_base
		{
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_to;
			public GRGEN_LGSP.LGSPNode _node_from;
			public enum ReverseChainFromTo_alt_0_base_NodeNums { @to, @from, 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)ReverseChainFromTo_alt_0_base_NodeNums.@to: return _node_to;
				case (int)ReverseChainFromTo_alt_0_base_NodeNums.@from: return _node_from;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "to": return _node_to;
				case "from": return _node_from;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "to": _node_to = (GRGEN_LGSP.LGSPNode)value; break;
				case "from": _node_from = (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 ReverseChainFromTo_alt_0_base_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)ReverseChainFromTo_alt_0_base_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 ReverseChainFromTo_alt_0_base_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 ReverseChainFromTo_alt_0_base_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 ReverseChainFromTo_alt_0_base_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 ReverseChainFromTo_alt_0_base_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 ReverseChainFromTo_alt_0_base_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_ReverseChainFromTo.instance.ReverseChainFromTo_alt_0_base; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ReverseChainFromTo_alt_0_base(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ReverseChainFromTo_alt_0_base(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ReverseChainFromTo_alt_0_base nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ReverseChainFromTo_alt_0_base cur = this;
				while(cur != null) {
					Match_ReverseChainFromTo_alt_0_base next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ReverseChainFromTo_alt_0_base that)
			{
				_node_to = that._node_to;
				_node_from = that._node_from;
				_edge__edge0 = that._edge__edge0;
			}

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

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

			public bool IsEqual(Match_ReverseChainFromTo_alt_0_base that)
			{
				if(that==null) return false;
				if(_node_to != that._node_to) return false;
				if(_node_from != that._node_from) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				return true;
			}
		}

		public class Match_ReverseChainFromTo_alt_0_rec : GRGEN_LGSP.MatchListElement<Match_ReverseChainFromTo_alt_0_rec>, IMatch_ReverseChainFromTo_alt_0_rec
		{
			public GRGEN_LIBGR.INode node_intermediate { get { return (GRGEN_LIBGR.INode)_node_intermediate; } set { _node_intermediate = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_intermediate;
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_to;
			public enum ReverseChainFromTo_alt_0_rec_NodeNums { @intermediate, @from, @to, 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)ReverseChainFromTo_alt_0_rec_NodeNums.@intermediate: return _node_intermediate;
				case (int)ReverseChainFromTo_alt_0_rec_NodeNums.@from: return _node_from;
				case (int)ReverseChainFromTo_alt_0_rec_NodeNums.@to: return _node_to;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "intermediate": return _node_intermediate;
				case "from": return _node_from;
				case "to": return _node_to;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "intermediate": _node_intermediate = (GRGEN_LGSP.LGSPNode)value; break;
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (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 ReverseChainFromTo_alt_0_rec_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)ReverseChainFromTo_alt_0_rec_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 ReverseChainFromTo_alt_0_rec_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_ReverseChainFromTo.Match_ReverseChainFromTo @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_ReverseChainFromTo.Match_ReverseChainFromTo @__sub0;
			public enum ReverseChainFromTo_alt_0_rec_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)ReverseChainFromTo_alt_0_rec_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 ReverseChainFromTo_alt_0_rec_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 ReverseChainFromTo_alt_0_rec_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 ReverseChainFromTo_alt_0_rec_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_ReverseChainFromTo.instance.ReverseChainFromTo_alt_0_rec; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ReverseChainFromTo_alt_0_rec(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ReverseChainFromTo_alt_0_rec(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ReverseChainFromTo_alt_0_rec nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ReverseChainFromTo_alt_0_rec cur = this;
				while(cur != null) {
					Match_ReverseChainFromTo_alt_0_rec next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ReverseChainFromTo_alt_0_rec that)
			{
				_node_intermediate = that._node_intermediate;
				_node_from = that._node_from;
				_node_to = that._node_to;
				_edge__edge0 = that._edge__edge0;
				@__sub0 = that.@__sub0;
			}

			public Match_ReverseChainFromTo_alt_0_rec(Match_ReverseChainFromTo_alt_0_rec that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ReverseChainFromTo_alt_0_rec that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_intermediate = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_intermediate];
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				_node_to = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_to];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				@__sub0 = new GRGEN_ACTIONS.Pattern_ReverseChainFromTo.Match_ReverseChainFromTo(that.@__sub0, oldToNewMap);
			}

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

			public bool IsEqual(Match_ReverseChainFromTo_alt_0_rec that)
			{
				if(that==null) return false;
				if(_node_intermediate != that._node_intermediate) return false;
				if(_node_from != that._node_from) return false;
				if(_node_to != that._node_to) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(!@__sub0.IsEqual(that.@__sub0)) return false;
				return true;
			}
		}

	}


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

		public static GRGEN_LIBGR.NodeType[] ChainFromToReverse_node_from_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] ChainFromToReverse_node_to_AllowedTypes = null;
		public static bool[] ChainFromToReverse_node_from_IsAllowedType = null;
		public static bool[] ChainFromToReverse_node_to_IsAllowedType = null;
		public enum ChainFromToReverse_NodeNums { @from, @to, };
		public enum ChainFromToReverse_EdgeNums { };
		public enum ChainFromToReverse_VariableNums { };
		public enum ChainFromToReverse_SubNums { };
		public enum ChainFromToReverse_AltNums { @alt_0, };
		public enum ChainFromToReverse_IterNums { };





		public GRGEN_LGSP.PatternGraph pat_ChainFromToReverse;

		public enum ChainFromToReverse_alt_0_CaseNums { @base, @rec, };
		public static GRGEN_LIBGR.EdgeType[] ChainFromToReverse_alt_0_base_edge__edge0_AllowedTypes = null;
		public static bool[] ChainFromToReverse_alt_0_base_edge__edge0_IsAllowedType = null;
		public enum ChainFromToReverse_alt_0_base_NodeNums { @from, @to, };
		public enum ChainFromToReverse_alt_0_base_EdgeNums { @_edge0, };
		public enum ChainFromToReverse_alt_0_base_VariableNums { };
		public enum ChainFromToReverse_alt_0_base_SubNums { };
		public enum ChainFromToReverse_alt_0_base_AltNums { };
		public enum ChainFromToReverse_alt_0_base_IterNums { };





		public GRGEN_LGSP.PatternGraph ChainFromToReverse_alt_0_base;

		public static GRGEN_LIBGR.NodeType[] ChainFromToReverse_alt_0_rec_node_intermediate_AllowedTypes = null;
		public static bool[] ChainFromToReverse_alt_0_rec_node_intermediate_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ChainFromToReverse_alt_0_rec_edge__edge0_AllowedTypes = null;
		public static bool[] ChainFromToReverse_alt_0_rec_edge__edge0_IsAllowedType = null;
		public enum ChainFromToReverse_alt_0_rec_NodeNums { @from, @intermediate, @to, };
		public enum ChainFromToReverse_alt_0_rec_EdgeNums { @_edge0, };
		public enum ChainFromToReverse_alt_0_rec_VariableNums { };
		public enum ChainFromToReverse_alt_0_rec_SubNums { @cftr, };
		public enum ChainFromToReverse_alt_0_rec_AltNums { };
		public enum ChainFromToReverse_alt_0_rec_IterNums { };





		public GRGEN_LGSP.PatternGraph ChainFromToReverse_alt_0_rec;


		private Pattern_ChainFromToReverse()
			: base("ChainFromToReverse",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "ChainFromToReverse_node_from", "ChainFromToReverse_node_to", },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { }
			)
		{
		}
		private void initialize()
		{
			bool[,] ChainFromToReverse_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ChainFromToReverse_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] ChainFromToReverse_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ChainFromToReverse_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode ChainFromToReverse_node_from = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromToReverse_node_from", "from", ChainFromToReverse_node_from_AllowedTypes, ChainFromToReverse_node_from_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode ChainFromToReverse_node_to = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromToReverse_node_to", "to", ChainFromToReverse_node_to_AllowedTypes, ChainFromToReverse_node_to_IsAllowedType, 5.5F, 1, false, null, null, null, null, null, null, false, null);
			bool[,] ChainFromToReverse_alt_0_base_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ChainFromToReverse_alt_0_base_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] ChainFromToReverse_alt_0_base_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ChainFromToReverse_alt_0_base_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternEdge ChainFromToReverse_alt_0_base_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ChainFromToReverse_alt_0_base_edge__edge0", "_edge0", ChainFromToReverse_alt_0_base_edge__edge0_AllowedTypes, ChainFromToReverse_alt_0_base_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			ChainFromToReverse_alt_0_base = new GRGEN_LGSP.PatternGraph(
				"base",
				"ChainFromToReverse_alt_0_",
				null, "base",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromToReverse_node_from, ChainFromToReverse_node_to }, 
				new GRGEN_LGSP.PatternEdge[] { ChainFromToReverse_alt_0_base_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, },
				},
				ChainFromToReverse_alt_0_base_isNodeHomomorphicGlobal,
				ChainFromToReverse_alt_0_base_isEdgeHomomorphicGlobal,
				ChainFromToReverse_alt_0_base_isNodeTotallyHomomorphic,
				ChainFromToReverse_alt_0_base_isEdgeTotallyHomomorphic
			);
			ChainFromToReverse_alt_0_base.edgeToSourceNode.Add(ChainFromToReverse_alt_0_base_edge__edge0, ChainFromToReverse_node_from);
			ChainFromToReverse_alt_0_base.edgeToTargetNode.Add(ChainFromToReverse_alt_0_base_edge__edge0, ChainFromToReverse_node_to);

			bool[,] ChainFromToReverse_alt_0_rec_isNodeHomomorphicGlobal = new bool[3, 3] {
				{ false, false, false, },
				{ false, false, false, },
				{ false, false, false, },
			};
			bool[,] ChainFromToReverse_alt_0_rec_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] ChainFromToReverse_alt_0_rec_isNodeTotallyHomomorphic = new bool[3] { false, false, false,  };
			bool[] ChainFromToReverse_alt_0_rec_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode ChainFromToReverse_alt_0_rec_node_intermediate = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromToReverse_alt_0_rec_node_intermediate", "intermediate", ChainFromToReverse_alt_0_rec_node_intermediate_AllowedTypes, ChainFromToReverse_alt_0_rec_node_intermediate_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ChainFromToReverse_alt_0_rec_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ChainFromToReverse_alt_0_rec_edge__edge0", "_edge0", ChainFromToReverse_alt_0_rec_edge__edge0_AllowedTypes, ChainFromToReverse_alt_0_rec_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding ChainFromToReverse_alt_0_rec_cftr = new GRGEN_LGSP.PatternGraphEmbedding("cftr", Pattern_ChainFromToReverse.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("ChainFromToReverse_alt_0_rec_node_intermediate"),
					new GRGEN_EXPR.GraphEntityExpression("ChainFromToReverse_node_to"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "ChainFromToReverse_alt_0_rec_node_intermediate", "ChainFromToReverse_node_to" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { ChainFromToReverse_alt_0_rec_node_intermediate, ChainFromToReverse_node_to }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			ChainFromToReverse_alt_0_rec = new GRGEN_LGSP.PatternGraph(
				"rec",
				"ChainFromToReverse_alt_0_",
				null, "rec",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromToReverse_node_from, ChainFromToReverse_alt_0_rec_node_intermediate, ChainFromToReverse_node_to }, 
				new GRGEN_LGSP.PatternEdge[] { ChainFromToReverse_alt_0_rec_edge__edge0 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { ChainFromToReverse_alt_0_rec_cftr }, 
				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[1, 1] {
					{ true, },
				},
				ChainFromToReverse_alt_0_rec_isNodeHomomorphicGlobal,
				ChainFromToReverse_alt_0_rec_isEdgeHomomorphicGlobal,
				ChainFromToReverse_alt_0_rec_isNodeTotallyHomomorphic,
				ChainFromToReverse_alt_0_rec_isEdgeTotallyHomomorphic
			);
			ChainFromToReverse_alt_0_rec.edgeToSourceNode.Add(ChainFromToReverse_alt_0_rec_edge__edge0, ChainFromToReverse_node_from);
			ChainFromToReverse_alt_0_rec.edgeToTargetNode.Add(ChainFromToReverse_alt_0_rec_edge__edge0, ChainFromToReverse_alt_0_rec_node_intermediate);

			GRGEN_LGSP.Alternative ChainFromToReverse_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "ChainFromToReverse_", new GRGEN_LGSP.PatternGraph[] { ChainFromToReverse_alt_0_base, ChainFromToReverse_alt_0_rec } );

			pat_ChainFromToReverse = new GRGEN_LGSP.PatternGraph(
				"ChainFromToReverse",
				"",
				null, "ChainFromToReverse",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromToReverse_node_from, ChainFromToReverse_node_to }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { ChainFromToReverse_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[0, 0] ,
				ChainFromToReverse_isNodeHomomorphicGlobal,
				ChainFromToReverse_isEdgeHomomorphicGlobal,
				ChainFromToReverse_isNodeTotallyHomomorphic,
				ChainFromToReverse_isEdgeTotallyHomomorphic
			);
			ChainFromToReverse_alt_0_base.embeddingGraph = pat_ChainFromToReverse;
			ChainFromToReverse_alt_0_rec.embeddingGraph = pat_ChainFromToReverse;

			ChainFromToReverse_node_from.pointOfDefinition = null;
			ChainFromToReverse_node_to.pointOfDefinition = null;
			ChainFromToReverse_alt_0_base_edge__edge0.pointOfDefinition = ChainFromToReverse_alt_0_base;
			ChainFromToReverse_alt_0_rec_node_intermediate.pointOfDefinition = ChainFromToReverse_alt_0_rec;
			ChainFromToReverse_alt_0_rec_edge__edge0.pointOfDefinition = ChainFromToReverse_alt_0_rec;
			ChainFromToReverse_alt_0_rec_cftr.PointOfDefinition = ChainFromToReverse_alt_0_rec;

			patternGraph = pat_ChainFromToReverse;
		}


		public void ChainFromToReverse_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_ChainFromToReverse curMatch = (Match_ChainFromToReverse)_curMatch;
			IMatch_ChainFromToReverse_alt_0 alternative_alt_0 = curMatch._alt_0;
			graph.SettingAddedNodeNames( ChainFromToReverse_addedNodeNames );
			ChainFromToReverse_alt_0_Modify(actionEnv, alternative_alt_0);
			graph.SettingAddedEdgeNames( ChainFromToReverse_addedEdgeNames );
		}
		private static string[] ChainFromToReverse_addedNodeNames = new string[] {  };
		private static string[] ChainFromToReverse_addedEdgeNames = new string[] {  };

		public void ChainFromToReverse_Create(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LGSP.LGSPNode node_from, GRGEN_LGSP.LGSPNode node_to)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			graph.SettingAddedNodeNames( create_ChainFromToReverse_addedNodeNames );
			graph.SettingAddedEdgeNames( create_ChainFromToReverse_addedEdgeNames );
		}
		private static string[] create_ChainFromToReverse_addedNodeNames = new string[] {  };
		private static string[] create_ChainFromToReverse_addedEdgeNames = new string[] {  };

		public void ChainFromToReverse_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromToReverse curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			IMatch_ChainFromToReverse_alt_0 alternative_alt_0 = curMatch._alt_0;
		}

		public void ChainFromToReverse_alt_0_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, IMatch_ChainFromToReverse_alt_0 curMatch)
		{
			if(curMatch.Pattern == ChainFromToReverse_alt_0_base) {
				ChainFromToReverse_alt_0_base_Modify(actionEnv, (Match_ChainFromToReverse_alt_0_base)curMatch);
				return;
			}
			else if(curMatch.Pattern == ChainFromToReverse_alt_0_rec) {
				ChainFromToReverse_alt_0_rec_Modify(actionEnv, (Match_ChainFromToReverse_alt_0_rec)curMatch);
				return;
			}
			throw new ApplicationException(); //debug assert
		}

		public void ChainFromToReverse_alt_0_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, IMatch_ChainFromToReverse_alt_0 curMatch)
		{
			if(curMatch.Pattern == ChainFromToReverse_alt_0_base) {
				ChainFromToReverse_alt_0_base_Delete(actionEnv, (Match_ChainFromToReverse_alt_0_base)curMatch);
				return;
			}
			else if(curMatch.Pattern == ChainFromToReverse_alt_0_rec) {
				ChainFromToReverse_alt_0_rec_Delete(actionEnv, (Match_ChainFromToReverse_alt_0_rec)curMatch);
				return;
			}
			throw new ApplicationException(); //debug assert
		}

		public void ChainFromToReverse_alt_0_base_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_ChainFromToReverse_alt_0_base curMatch = (Match_ChainFromToReverse_alt_0_base)_curMatch;
			GRGEN_LGSP.LGSPNode node_to = curMatch._node_to;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			graph.SettingAddedNodeNames( ChainFromToReverse_alt_0_base_addedNodeNames );
			graph.SettingAddedEdgeNames( ChainFromToReverse_alt_0_base_addedEdgeNames );
			GRGEN_MODEL.@Edge edge__edge1 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_to, node_from);
			graph.Remove(edge__edge0);
		}
		private static string[] ChainFromToReverse_alt_0_base_addedNodeNames = new string[] {  };
		private static string[] ChainFromToReverse_alt_0_base_addedEdgeNames = new string[] { "_edge1" };

		public void ChainFromToReverse_alt_0_base_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromToReverse_alt_0_base curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPNode node_to = curMatch._node_to;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			graph.Remove(edge__edge0);
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
			graph.RemoveEdges(node_to);
			graph.Remove(node_to);
		}

		public void ChainFromToReverse_alt_0_rec_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_ChainFromToReverse_alt_0_rec curMatch = (Match_ChainFromToReverse_alt_0_rec)_curMatch;
			GRGEN_LGSP.LGSPNode node_intermediate = curMatch._node_intermediate;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			GRGEN_ACTIONS.Pattern_ChainFromToReverse.Match_ChainFromToReverse subpattern_cftr = curMatch.@_cftr;
			graph.SettingAddedNodeNames( ChainFromToReverse_alt_0_rec_addedNodeNames );
			{ // cftr
				GRGEN_ACTIONS.Pattern_ChainFromToReverse.Instance.ChainFromToReverse_Modify(actionEnv, subpattern_cftr);
			}
			graph.SettingAddedEdgeNames( ChainFromToReverse_alt_0_rec_addedEdgeNames );
			GRGEN_MODEL.@Edge edge__edge1 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_intermediate, node_from);
			graph.Remove(edge__edge0);
		}
		private static string[] ChainFromToReverse_alt_0_rec_addedNodeNames = new string[] {  };
		private static string[] ChainFromToReverse_alt_0_rec_addedEdgeNames = new string[] { "_edge1" };

		public void ChainFromToReverse_alt_0_rec_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromToReverse_alt_0_rec curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPNode node_intermediate = curMatch._node_intermediate;
			GRGEN_LGSP.LGSPNode node_to = curMatch._node_to;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			GRGEN_ACTIONS.Pattern_ChainFromToReverse.Match_ChainFromToReverse subpattern_cftr = curMatch.@_cftr;
			graph.Remove(edge__edge0);
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
			graph.RemoveEdges(node_intermediate);
			graph.Remove(node_intermediate);
			graph.RemoveEdges(node_to);
			graph.Remove(node_to);
			GRGEN_ACTIONS.Pattern_ChainFromToReverse.Instance.ChainFromToReverse_Delete(actionEnv, subpattern_cftr);
		}

		static Pattern_ChainFromToReverse() {
		}

		public interface IMatch_ChainFromToReverse : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_to { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			IMatch_ChainFromToReverse_alt_0 alt_0 { get; }
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

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

		public interface IMatch_ChainFromToReverse_alt_0_base : IMatch_ChainFromToReverse_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_to { 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_ChainFromToReverse_alt_0_rec : IMatch_ChainFromToReverse_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_intermediate { get; set; }
			GRGEN_LIBGR.INode node_to { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			//Variables
			//EmbeddedGraphs
			@GRGEN_ACTIONS.Pattern_ChainFromToReverse.Match_ChainFromToReverse @cftr { get; }
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_ChainFromToReverse : GRGEN_LGSP.MatchListElement<Match_ChainFromToReverse>, IMatch_ChainFromToReverse
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_to;
			public enum ChainFromToReverse_NodeNums { @from, @to, 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)ChainFromToReverse_NodeNums.@from: return _node_from;
				case (int)ChainFromToReverse_NodeNums.@to: return _node_to;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "to": return _node_to;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum ChainFromToReverse_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 ChainFromToReverse_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 ChainFromToReverse_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_ChainFromToReverse_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_ChainFromToReverse_alt_0 _alt_0;
			public enum ChainFromToReverse_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)ChainFromToReverse_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 ChainFromToReverse_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 ChainFromToReverse_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_ChainFromToReverse.instance.pat_ChainFromToReverse; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromToReverse(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromToReverse(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromToReverse nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromToReverse cur = this;
				while(cur != null) {
					Match_ChainFromToReverse next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromToReverse that)
			{
				_node_from = that._node_from;
				_node_to = that._node_to;
				_alt_0 = that._alt_0;
			}

			public Match_ChainFromToReverse(Match_ChainFromToReverse that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ChainFromToReverse that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				_node_to = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_to];
				if(that._alt_0 is Match_ChainFromToReverse_alt_0_base)
					_alt_0 = new Match_ChainFromToReverse_alt_0_base((Match_ChainFromToReverse_alt_0_base)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_ChainFromToReverse_alt_0_rec)
					_alt_0 = new Match_ChainFromToReverse_alt_0_rec((Match_ChainFromToReverse_alt_0_rec)that._alt_0, oldToNewMap);
			}

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

			public bool IsEqual(Match_ChainFromToReverse that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_node_to != that._node_to) return false;
				if(_alt_0 is Match_ChainFromToReverse_alt_0_base && !(_alt_0 as Match_ChainFromToReverse_alt_0_base).IsEqual(that._alt_0 as Match_ChainFromToReverse_alt_0_base)) return false;
				if(_alt_0 is Match_ChainFromToReverse_alt_0_rec && !(_alt_0 as Match_ChainFromToReverse_alt_0_rec).IsEqual(that._alt_0 as Match_ChainFromToReverse_alt_0_rec)) return false;
				return true;
			}
		}

		public class Match_ChainFromToReverse_alt_0_base : GRGEN_LGSP.MatchListElement<Match_ChainFromToReverse_alt_0_base>, IMatch_ChainFromToReverse_alt_0_base
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_to;
			public enum ChainFromToReverse_alt_0_base_NodeNums { @from, @to, 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)ChainFromToReverse_alt_0_base_NodeNums.@from: return _node_from;
				case (int)ChainFromToReverse_alt_0_base_NodeNums.@to: return _node_to;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "to": return _node_to;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (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 ChainFromToReverse_alt_0_base_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)ChainFromToReverse_alt_0_base_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 ChainFromToReverse_alt_0_base_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 ChainFromToReverse_alt_0_base_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 ChainFromToReverse_alt_0_base_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 ChainFromToReverse_alt_0_base_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 ChainFromToReverse_alt_0_base_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_ChainFromToReverse.instance.ChainFromToReverse_alt_0_base; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromToReverse_alt_0_base(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromToReverse_alt_0_base(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromToReverse_alt_0_base nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromToReverse_alt_0_base cur = this;
				while(cur != null) {
					Match_ChainFromToReverse_alt_0_base next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromToReverse_alt_0_base that)
			{
				_node_from = that._node_from;
				_node_to = that._node_to;
				_edge__edge0 = that._edge__edge0;
			}

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

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

			public bool IsEqual(Match_ChainFromToReverse_alt_0_base that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_node_to != that._node_to) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				return true;
			}
		}

		public class Match_ChainFromToReverse_alt_0_rec : GRGEN_LGSP.MatchListElement<Match_ChainFromToReverse_alt_0_rec>, IMatch_ChainFromToReverse_alt_0_rec
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_intermediate { get { return (GRGEN_LIBGR.INode)_node_intermediate; } set { _node_intermediate = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_intermediate;
			public GRGEN_LGSP.LGSPNode _node_to;
			public enum ChainFromToReverse_alt_0_rec_NodeNums { @from, @intermediate, @to, 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)ChainFromToReverse_alt_0_rec_NodeNums.@from: return _node_from;
				case (int)ChainFromToReverse_alt_0_rec_NodeNums.@intermediate: return _node_intermediate;
				case (int)ChainFromToReverse_alt_0_rec_NodeNums.@to: return _node_to;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "intermediate": return _node_intermediate;
				case "to": return _node_to;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "intermediate": _node_intermediate = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (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 ChainFromToReverse_alt_0_rec_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)ChainFromToReverse_alt_0_rec_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 ChainFromToReverse_alt_0_rec_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_ChainFromToReverse.Match_ChainFromToReverse @cftr { get { return @_cftr; } }
			public @GRGEN_ACTIONS.Pattern_ChainFromToReverse.Match_ChainFromToReverse @_cftr;
			public enum ChainFromToReverse_alt_0_rec_SubNums { @cftr, 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)ChainFromToReverse_alt_0_rec_SubNums.@cftr: return _cftr;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				case "cftr": return _cftr;
				default: return null;
				}
			}

			public enum ChainFromToReverse_alt_0_rec_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 ChainFromToReverse_alt_0_rec_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 ChainFromToReverse_alt_0_rec_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_ChainFromToReverse.instance.ChainFromToReverse_alt_0_rec; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromToReverse_alt_0_rec(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromToReverse_alt_0_rec(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromToReverse_alt_0_rec nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromToReverse_alt_0_rec cur = this;
				while(cur != null) {
					Match_ChainFromToReverse_alt_0_rec next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromToReverse_alt_0_rec that)
			{
				_node_from = that._node_from;
				_node_intermediate = that._node_intermediate;
				_node_to = that._node_to;
				_edge__edge0 = that._edge__edge0;
				@_cftr = that.@_cftr;
			}

			public Match_ChainFromToReverse_alt_0_rec(Match_ChainFromToReverse_alt_0_rec that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ChainFromToReverse_alt_0_rec that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				_node_intermediate = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_intermediate];
				_node_to = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_to];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				@_cftr = new GRGEN_ACTIONS.Pattern_ChainFromToReverse.Match_ChainFromToReverse(that.@_cftr, oldToNewMap);
			}

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

			public bool IsEqual(Match_ChainFromToReverse_alt_0_rec that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_node_intermediate != that._node_intermediate) return false;
				if(_node_to != that._node_to) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(!@_cftr.IsEqual(that.@_cftr)) return false;
				return true;
			}
		}

	}


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

		public static GRGEN_LIBGR.NodeType[] ChainFromToReverseToCommon_node_from_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] ChainFromToReverseToCommon_node_to_AllowedTypes = null;
		public static bool[] ChainFromToReverseToCommon_node_from_IsAllowedType = null;
		public static bool[] ChainFromToReverseToCommon_node_to_IsAllowedType = null;
		public enum ChainFromToReverseToCommon_NodeNums { @from, @to, };
		public enum ChainFromToReverseToCommon_EdgeNums { };
		public enum ChainFromToReverseToCommon_VariableNums { };
		public enum ChainFromToReverseToCommon_SubNums { };
		public enum ChainFromToReverseToCommon_AltNums { @alt_0, };
		public enum ChainFromToReverseToCommon_IterNums { };





		public GRGEN_LGSP.PatternGraph pat_ChainFromToReverseToCommon;

		public enum ChainFromToReverseToCommon_alt_0_CaseNums { @base, @rec, };
		public static GRGEN_LIBGR.EdgeType[] ChainFromToReverseToCommon_alt_0_base_edge__edge0_AllowedTypes = null;
		public static bool[] ChainFromToReverseToCommon_alt_0_base_edge__edge0_IsAllowedType = null;
		public enum ChainFromToReverseToCommon_alt_0_base_NodeNums { @from, @to, };
		public enum ChainFromToReverseToCommon_alt_0_base_EdgeNums { @_edge0, };
		public enum ChainFromToReverseToCommon_alt_0_base_VariableNums { };
		public enum ChainFromToReverseToCommon_alt_0_base_SubNums { };
		public enum ChainFromToReverseToCommon_alt_0_base_AltNums { };
		public enum ChainFromToReverseToCommon_alt_0_base_IterNums { };





		public GRGEN_LGSP.PatternGraph ChainFromToReverseToCommon_alt_0_base;

		public static GRGEN_LIBGR.NodeType[] ChainFromToReverseToCommon_alt_0_rec_node_intermediate_AllowedTypes = null;
		public static bool[] ChainFromToReverseToCommon_alt_0_rec_node_intermediate_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ChainFromToReverseToCommon_alt_0_rec_edge__edge0_AllowedTypes = null;
		public static bool[] ChainFromToReverseToCommon_alt_0_rec_edge__edge0_IsAllowedType = null;
		public enum ChainFromToReverseToCommon_alt_0_rec_NodeNums { @from, @intermediate, @to, };
		public enum ChainFromToReverseToCommon_alt_0_rec_EdgeNums { @_edge0, };
		public enum ChainFromToReverseToCommon_alt_0_rec_VariableNums { };
		public enum ChainFromToReverseToCommon_alt_0_rec_SubNums { @cftrtc, };
		public enum ChainFromToReverseToCommon_alt_0_rec_AltNums { };
		public enum ChainFromToReverseToCommon_alt_0_rec_IterNums { };





		public GRGEN_LGSP.PatternGraph ChainFromToReverseToCommon_alt_0_rec;


		private Pattern_ChainFromToReverseToCommon()
			: base("ChainFromToReverseToCommon",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "ChainFromToReverseToCommon_node_from", "ChainFromToReverseToCommon_node_to", },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { }
			)
		{
		}
		private void initialize()
		{
			bool[,] ChainFromToReverseToCommon_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ChainFromToReverseToCommon_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] ChainFromToReverseToCommon_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ChainFromToReverseToCommon_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode ChainFromToReverseToCommon_node_from = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromToReverseToCommon_node_from", "from", ChainFromToReverseToCommon_node_from_AllowedTypes, ChainFromToReverseToCommon_node_from_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode ChainFromToReverseToCommon_node_to = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromToReverseToCommon_node_to", "to", ChainFromToReverseToCommon_node_to_AllowedTypes, ChainFromToReverseToCommon_node_to_IsAllowedType, 5.5F, 1, false, null, null, null, null, null, null, false, null);
			bool[,] ChainFromToReverseToCommon_alt_0_base_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] ChainFromToReverseToCommon_alt_0_base_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] ChainFromToReverseToCommon_alt_0_base_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] ChainFromToReverseToCommon_alt_0_base_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternEdge ChainFromToReverseToCommon_alt_0_base_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ChainFromToReverseToCommon_alt_0_base_edge__edge0", "_edge0", ChainFromToReverseToCommon_alt_0_base_edge__edge0_AllowedTypes, ChainFromToReverseToCommon_alt_0_base_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			ChainFromToReverseToCommon_alt_0_base = new GRGEN_LGSP.PatternGraph(
				"base",
				"ChainFromToReverseToCommon_alt_0_",
				null, "base",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromToReverseToCommon_node_from, ChainFromToReverseToCommon_node_to }, 
				new GRGEN_LGSP.PatternEdge[] { ChainFromToReverseToCommon_alt_0_base_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, },
				},
				ChainFromToReverseToCommon_alt_0_base_isNodeHomomorphicGlobal,
				ChainFromToReverseToCommon_alt_0_base_isEdgeHomomorphicGlobal,
				ChainFromToReverseToCommon_alt_0_base_isNodeTotallyHomomorphic,
				ChainFromToReverseToCommon_alt_0_base_isEdgeTotallyHomomorphic
			);
			ChainFromToReverseToCommon_alt_0_base.edgeToSourceNode.Add(ChainFromToReverseToCommon_alt_0_base_edge__edge0, ChainFromToReverseToCommon_node_from);
			ChainFromToReverseToCommon_alt_0_base.edgeToTargetNode.Add(ChainFromToReverseToCommon_alt_0_base_edge__edge0, ChainFromToReverseToCommon_node_to);

			bool[,] ChainFromToReverseToCommon_alt_0_rec_isNodeHomomorphicGlobal = new bool[3, 3] {
				{ false, false, false, },
				{ false, false, false, },
				{ false, false, false, },
			};
			bool[,] ChainFromToReverseToCommon_alt_0_rec_isEdgeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[] ChainFromToReverseToCommon_alt_0_rec_isNodeTotallyHomomorphic = new bool[3] { false, false, false,  };
			bool[] ChainFromToReverseToCommon_alt_0_rec_isEdgeTotallyHomomorphic = new bool[1] { false,  };
			GRGEN_LGSP.PatternNode ChainFromToReverseToCommon_alt_0_rec_node_intermediate = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ChainFromToReverseToCommon_alt_0_rec_node_intermediate", "intermediate", ChainFromToReverseToCommon_alt_0_rec_node_intermediate_AllowedTypes, ChainFromToReverseToCommon_alt_0_rec_node_intermediate_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ChainFromToReverseToCommon_alt_0_rec_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ChainFromToReverseToCommon_alt_0_rec_edge__edge0", "_edge0", ChainFromToReverseToCommon_alt_0_rec_edge__edge0_AllowedTypes, ChainFromToReverseToCommon_alt_0_rec_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding ChainFromToReverseToCommon_alt_0_rec_cftrtc = new GRGEN_LGSP.PatternGraphEmbedding("cftrtc", Pattern_ChainFromToReverseToCommon.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("ChainFromToReverseToCommon_alt_0_rec_node_intermediate"),
					new GRGEN_EXPR.GraphEntityExpression("ChainFromToReverseToCommon_node_to"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "ChainFromToReverseToCommon_alt_0_rec_node_intermediate", "ChainFromToReverseToCommon_node_to" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { ChainFromToReverseToCommon_alt_0_rec_node_intermediate, ChainFromToReverseToCommon_node_to }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			ChainFromToReverseToCommon_alt_0_rec = new GRGEN_LGSP.PatternGraph(
				"rec",
				"ChainFromToReverseToCommon_alt_0_",
				null, "rec",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromToReverseToCommon_node_from, ChainFromToReverseToCommon_alt_0_rec_node_intermediate, ChainFromToReverseToCommon_node_to }, 
				new GRGEN_LGSP.PatternEdge[] { ChainFromToReverseToCommon_alt_0_rec_edge__edge0 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { ChainFromToReverseToCommon_alt_0_rec_cftrtc }, 
				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[1, 1] {
					{ true, },
				},
				ChainFromToReverseToCommon_alt_0_rec_isNodeHomomorphicGlobal,
				ChainFromToReverseToCommon_alt_0_rec_isEdgeHomomorphicGlobal,
				ChainFromToReverseToCommon_alt_0_rec_isNodeTotallyHomomorphic,
				ChainFromToReverseToCommon_alt_0_rec_isEdgeTotallyHomomorphic
			);
			ChainFromToReverseToCommon_alt_0_rec.edgeToSourceNode.Add(ChainFromToReverseToCommon_alt_0_rec_edge__edge0, ChainFromToReverseToCommon_node_from);
			ChainFromToReverseToCommon_alt_0_rec.edgeToTargetNode.Add(ChainFromToReverseToCommon_alt_0_rec_edge__edge0, ChainFromToReverseToCommon_alt_0_rec_node_intermediate);

			GRGEN_LGSP.Alternative ChainFromToReverseToCommon_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "ChainFromToReverseToCommon_", new GRGEN_LGSP.PatternGraph[] { ChainFromToReverseToCommon_alt_0_base, ChainFromToReverseToCommon_alt_0_rec } );

			pat_ChainFromToReverseToCommon = new GRGEN_LGSP.PatternGraph(
				"ChainFromToReverseToCommon",
				"",
				null, "ChainFromToReverseToCommon",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ChainFromToReverseToCommon_node_from, ChainFromToReverseToCommon_node_to }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { ChainFromToReverseToCommon_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[0, 0] ,
				ChainFromToReverseToCommon_isNodeHomomorphicGlobal,
				ChainFromToReverseToCommon_isEdgeHomomorphicGlobal,
				ChainFromToReverseToCommon_isNodeTotallyHomomorphic,
				ChainFromToReverseToCommon_isEdgeTotallyHomomorphic
			);
			ChainFromToReverseToCommon_alt_0_base.embeddingGraph = pat_ChainFromToReverseToCommon;
			ChainFromToReverseToCommon_alt_0_rec.embeddingGraph = pat_ChainFromToReverseToCommon;

			ChainFromToReverseToCommon_node_from.pointOfDefinition = null;
			ChainFromToReverseToCommon_node_to.pointOfDefinition = null;
			ChainFromToReverseToCommon_alt_0_base_edge__edge0.pointOfDefinition = ChainFromToReverseToCommon_alt_0_base;
			ChainFromToReverseToCommon_alt_0_rec_node_intermediate.pointOfDefinition = ChainFromToReverseToCommon_alt_0_rec;
			ChainFromToReverseToCommon_alt_0_rec_edge__edge0.pointOfDefinition = ChainFromToReverseToCommon_alt_0_rec;
			ChainFromToReverseToCommon_alt_0_rec_cftrtc.PointOfDefinition = ChainFromToReverseToCommon_alt_0_rec;

			patternGraph = pat_ChainFromToReverseToCommon;
		}


		public void ChainFromToReverseToCommon_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch, GRGEN_LGSP.LGSPNode node_common)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_ChainFromToReverseToCommon curMatch = (Match_ChainFromToReverseToCommon)_curMatch;
			IMatch_ChainFromToReverseToCommon_alt_0 alternative_alt_0 = curMatch._alt_0;
			graph.SettingAddedNodeNames( ChainFromToReverseToCommon_addedNodeNames );
			ChainFromToReverseToCommon_alt_0_Modify(actionEnv, alternative_alt_0, node_common);
			graph.SettingAddedEdgeNames( ChainFromToReverseToCommon_addedEdgeNames );
		}
		private static string[] ChainFromToReverseToCommon_addedNodeNames = new string[] {  };
		private static string[] ChainFromToReverseToCommon_addedEdgeNames = new string[] {  };

		public void ChainFromToReverseToCommon_Create(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LGSP.LGSPNode node_from, GRGEN_LGSP.LGSPNode node_to)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			graph.SettingAddedNodeNames( create_ChainFromToReverseToCommon_addedNodeNames );
			graph.SettingAddedEdgeNames( create_ChainFromToReverseToCommon_addedEdgeNames );
		}
		private static string[] create_ChainFromToReverseToCommon_addedNodeNames = new string[] {  };
		private static string[] create_ChainFromToReverseToCommon_addedEdgeNames = new string[] {  };

		public void ChainFromToReverseToCommon_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromToReverseToCommon curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			IMatch_ChainFromToReverseToCommon_alt_0 alternative_alt_0 = curMatch._alt_0;
		}

		public void ChainFromToReverseToCommon_alt_0_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, IMatch_ChainFromToReverseToCommon_alt_0 curMatch, GRGEN_LGSP.LGSPNode node_common)
		{
			if(curMatch.Pattern == ChainFromToReverseToCommon_alt_0_base) {
				ChainFromToReverseToCommon_alt_0_base_Modify(actionEnv, (Match_ChainFromToReverseToCommon_alt_0_base)curMatch, node_common);
				return;
			}
			else if(curMatch.Pattern == ChainFromToReverseToCommon_alt_0_rec) {
				ChainFromToReverseToCommon_alt_0_rec_Modify(actionEnv, (Match_ChainFromToReverseToCommon_alt_0_rec)curMatch, node_common);
				return;
			}
			throw new ApplicationException(); //debug assert
		}

		public void ChainFromToReverseToCommon_alt_0_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, IMatch_ChainFromToReverseToCommon_alt_0 curMatch)
		{
			if(curMatch.Pattern == ChainFromToReverseToCommon_alt_0_base) {
				ChainFromToReverseToCommon_alt_0_base_Delete(actionEnv, (Match_ChainFromToReverseToCommon_alt_0_base)curMatch);
				return;
			}
			else if(curMatch.Pattern == ChainFromToReverseToCommon_alt_0_rec) {
				ChainFromToReverseToCommon_alt_0_rec_Delete(actionEnv, (Match_ChainFromToReverseToCommon_alt_0_rec)curMatch);
				return;
			}
			throw new ApplicationException(); //debug assert
		}

		public void ChainFromToReverseToCommon_alt_0_base_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch, GRGEN_LGSP.LGSPNode node_common)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_ChainFromToReverseToCommon_alt_0_base curMatch = (Match_ChainFromToReverseToCommon_alt_0_base)_curMatch;
			GRGEN_LGSP.LGSPNode node_to = curMatch._node_to;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			graph.SettingAddedNodeNames( ChainFromToReverseToCommon_alt_0_base_addedNodeNames );
			graph.SettingAddedEdgeNames( ChainFromToReverseToCommon_alt_0_base_addedEdgeNames );
			GRGEN_MODEL.@Edge edge__edge1 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_to, node_from);
			GRGEN_MODEL.@Edge edge__edge2 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_from, node_common);
			GRGEN_MODEL.@Edge edge__edge3 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_to, node_common);
			graph.Remove(edge__edge0);
		}
		private static string[] ChainFromToReverseToCommon_alt_0_base_addedNodeNames = new string[] {  };
		private static string[] ChainFromToReverseToCommon_alt_0_base_addedEdgeNames = new string[] { "_edge1", "_edge2", "_edge3" };

		public void ChainFromToReverseToCommon_alt_0_base_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromToReverseToCommon_alt_0_base curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPNode node_to = curMatch._node_to;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			graph.Remove(edge__edge0);
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
			graph.RemoveEdges(node_to);
			graph.Remove(node_to);
		}

		public void ChainFromToReverseToCommon_alt_0_rec_Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch, GRGEN_LGSP.LGSPNode node_common)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_ChainFromToReverseToCommon_alt_0_rec curMatch = (Match_ChainFromToReverseToCommon_alt_0_rec)_curMatch;
			GRGEN_LGSP.LGSPNode node_intermediate = curMatch._node_intermediate;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon subpattern_cftrtc = curMatch.@_cftrtc;
			graph.SettingAddedNodeNames( ChainFromToReverseToCommon_alt_0_rec_addedNodeNames );
			{ // cftrtc
				GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Instance.ChainFromToReverseToCommon_Modify(actionEnv, subpattern_cftrtc, (GRGEN_LGSP.LGSPNode)(node_common));
			}
			graph.SettingAddedEdgeNames( ChainFromToReverseToCommon_alt_0_rec_addedEdgeNames );
			GRGEN_MODEL.@Edge edge__edge1 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_intermediate, node_from);
			GRGEN_MODEL.@Edge edge__edge2 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_from, node_common);
			graph.Remove(edge__edge0);
		}
		private static string[] ChainFromToReverseToCommon_alt_0_rec_addedNodeNames = new string[] {  };
		private static string[] ChainFromToReverseToCommon_alt_0_rec_addedEdgeNames = new string[] { "_edge1", "_edge2" };

		public void ChainFromToReverseToCommon_alt_0_rec_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ChainFromToReverseToCommon_alt_0_rec curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPNode node_intermediate = curMatch._node_intermediate;
			GRGEN_LGSP.LGSPNode node_to = curMatch._node_to;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon subpattern_cftrtc = curMatch.@_cftrtc;
			graph.Remove(edge__edge0);
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
			graph.RemoveEdges(node_intermediate);
			graph.Remove(node_intermediate);
			graph.RemoveEdges(node_to);
			graph.Remove(node_to);
			GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Instance.ChainFromToReverseToCommon_Delete(actionEnv, subpattern_cftrtc);
		}

		static Pattern_ChainFromToReverseToCommon() {
		}

		public interface IMatch_ChainFromToReverseToCommon : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_to { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			IMatch_ChainFromToReverseToCommon_alt_0 alt_0 { get; }
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

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

		public interface IMatch_ChainFromToReverseToCommon_alt_0_base : IMatch_ChainFromToReverseToCommon_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_to { 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_ChainFromToReverseToCommon_alt_0_rec : IMatch_ChainFromToReverseToCommon_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_intermediate { get; set; }
			GRGEN_LIBGR.INode node_to { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			//Variables
			//EmbeddedGraphs
			@GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon @cftrtc { get; }
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_ChainFromToReverseToCommon : GRGEN_LGSP.MatchListElement<Match_ChainFromToReverseToCommon>, IMatch_ChainFromToReverseToCommon
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_to;
			public enum ChainFromToReverseToCommon_NodeNums { @from, @to, 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)ChainFromToReverseToCommon_NodeNums.@from: return _node_from;
				case (int)ChainFromToReverseToCommon_NodeNums.@to: return _node_to;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "to": return _node_to;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum ChainFromToReverseToCommon_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 ChainFromToReverseToCommon_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 ChainFromToReverseToCommon_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_ChainFromToReverseToCommon_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_ChainFromToReverseToCommon_alt_0 _alt_0;
			public enum ChainFromToReverseToCommon_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)ChainFromToReverseToCommon_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 ChainFromToReverseToCommon_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 ChainFromToReverseToCommon_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_ChainFromToReverseToCommon.instance.pat_ChainFromToReverseToCommon; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromToReverseToCommon(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromToReverseToCommon(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromToReverseToCommon nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromToReverseToCommon cur = this;
				while(cur != null) {
					Match_ChainFromToReverseToCommon next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromToReverseToCommon that)
			{
				_node_from = that._node_from;
				_node_to = that._node_to;
				_alt_0 = that._alt_0;
			}

			public Match_ChainFromToReverseToCommon(Match_ChainFromToReverseToCommon that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ChainFromToReverseToCommon that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				_node_to = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_to];
				if(that._alt_0 is Match_ChainFromToReverseToCommon_alt_0_base)
					_alt_0 = new Match_ChainFromToReverseToCommon_alt_0_base((Match_ChainFromToReverseToCommon_alt_0_base)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_ChainFromToReverseToCommon_alt_0_rec)
					_alt_0 = new Match_ChainFromToReverseToCommon_alt_0_rec((Match_ChainFromToReverseToCommon_alt_0_rec)that._alt_0, oldToNewMap);
			}

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

			public bool IsEqual(Match_ChainFromToReverseToCommon that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_node_to != that._node_to) return false;
				if(_alt_0 is Match_ChainFromToReverseToCommon_alt_0_base && !(_alt_0 as Match_ChainFromToReverseToCommon_alt_0_base).IsEqual(that._alt_0 as Match_ChainFromToReverseToCommon_alt_0_base)) return false;
				if(_alt_0 is Match_ChainFromToReverseToCommon_alt_0_rec && !(_alt_0 as Match_ChainFromToReverseToCommon_alt_0_rec).IsEqual(that._alt_0 as Match_ChainFromToReverseToCommon_alt_0_rec)) return false;
				return true;
			}
		}

		public class Match_ChainFromToReverseToCommon_alt_0_base : GRGEN_LGSP.MatchListElement<Match_ChainFromToReverseToCommon_alt_0_base>, IMatch_ChainFromToReverseToCommon_alt_0_base
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_to;
			public enum ChainFromToReverseToCommon_alt_0_base_NodeNums { @from, @to, 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)ChainFromToReverseToCommon_alt_0_base_NodeNums.@from: return _node_from;
				case (int)ChainFromToReverseToCommon_alt_0_base_NodeNums.@to: return _node_to;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "to": return _node_to;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (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 ChainFromToReverseToCommon_alt_0_base_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)ChainFromToReverseToCommon_alt_0_base_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 ChainFromToReverseToCommon_alt_0_base_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 ChainFromToReverseToCommon_alt_0_base_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 ChainFromToReverseToCommon_alt_0_base_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 ChainFromToReverseToCommon_alt_0_base_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 ChainFromToReverseToCommon_alt_0_base_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_ChainFromToReverseToCommon.instance.ChainFromToReverseToCommon_alt_0_base; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromToReverseToCommon_alt_0_base(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromToReverseToCommon_alt_0_base(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromToReverseToCommon_alt_0_base nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromToReverseToCommon_alt_0_base cur = this;
				while(cur != null) {
					Match_ChainFromToReverseToCommon_alt_0_base next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromToReverseToCommon_alt_0_base that)
			{
				_node_from = that._node_from;
				_node_to = that._node_to;
				_edge__edge0 = that._edge__edge0;
			}

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

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

			public bool IsEqual(Match_ChainFromToReverseToCommon_alt_0_base that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_node_to != that._node_to) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				return true;
			}
		}

		public class Match_ChainFromToReverseToCommon_alt_0_rec : GRGEN_LGSP.MatchListElement<Match_ChainFromToReverseToCommon_alt_0_rec>, IMatch_ChainFromToReverseToCommon_alt_0_rec
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_intermediate { get { return (GRGEN_LIBGR.INode)_node_intermediate; } set { _node_intermediate = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_intermediate;
			public GRGEN_LGSP.LGSPNode _node_to;
			public enum ChainFromToReverseToCommon_alt_0_rec_NodeNums { @from, @intermediate, @to, 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)ChainFromToReverseToCommon_alt_0_rec_NodeNums.@from: return _node_from;
				case (int)ChainFromToReverseToCommon_alt_0_rec_NodeNums.@intermediate: return _node_intermediate;
				case (int)ChainFromToReverseToCommon_alt_0_rec_NodeNums.@to: return _node_to;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "intermediate": return _node_intermediate;
				case "to": return _node_to;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "intermediate": _node_intermediate = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (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 ChainFromToReverseToCommon_alt_0_rec_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)ChainFromToReverseToCommon_alt_0_rec_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 ChainFromToReverseToCommon_alt_0_rec_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_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon @cftrtc { get { return @_cftrtc; } }
			public @GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon @_cftrtc;
			public enum ChainFromToReverseToCommon_alt_0_rec_SubNums { @cftrtc, 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)ChainFromToReverseToCommon_alt_0_rec_SubNums.@cftrtc: return _cftrtc;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				case "cftrtc": return _cftrtc;
				default: return null;
				}
			}

			public enum ChainFromToReverseToCommon_alt_0_rec_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 ChainFromToReverseToCommon_alt_0_rec_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 ChainFromToReverseToCommon_alt_0_rec_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_ChainFromToReverseToCommon.instance.ChainFromToReverseToCommon_alt_0_rec; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ChainFromToReverseToCommon_alt_0_rec(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ChainFromToReverseToCommon_alt_0_rec(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ChainFromToReverseToCommon_alt_0_rec nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ChainFromToReverseToCommon_alt_0_rec cur = this;
				while(cur != null) {
					Match_ChainFromToReverseToCommon_alt_0_rec next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ChainFromToReverseToCommon_alt_0_rec that)
			{
				_node_from = that._node_from;
				_node_intermediate = that._node_intermediate;
				_node_to = that._node_to;
				_edge__edge0 = that._edge__edge0;
				@_cftrtc = that.@_cftrtc;
			}

			public Match_ChainFromToReverseToCommon_alt_0_rec(Match_ChainFromToReverseToCommon_alt_0_rec that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ChainFromToReverseToCommon_alt_0_rec that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				_node_intermediate = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_intermediate];
				_node_to = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_to];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				@_cftrtc = new GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon(that.@_cftrtc, oldToNewMap);
			}

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

			public bool IsEqual(Match_ChainFromToReverseToCommon_alt_0_rec that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_node_intermediate != that._node_intermediate) return false;
				if(_node_to != that._node_to) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(!@_cftrtc.IsEqual(that.@_cftrtc)) return false;
				return true;
			}
		}

	}


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

		public static GRGEN_LIBGR.NodeType[] ReverseChainFromToToCommon_node_from_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] ReverseChainFromToToCommon_node_to_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] ReverseChainFromToToCommon_node_common_AllowedTypes = null;
		public static bool[] ReverseChainFromToToCommon_node_from_IsAllowedType = null;
		public static bool[] ReverseChainFromToToCommon_node_to_IsAllowedType = null;
		public static bool[] ReverseChainFromToToCommon_node_common_IsAllowedType = null;
		public enum ReverseChainFromToToCommon_NodeNums { @from, @to, @common, };
		public enum ReverseChainFromToToCommon_EdgeNums { };
		public enum ReverseChainFromToToCommon_VariableNums { };
		public enum ReverseChainFromToToCommon_SubNums { };
		public enum ReverseChainFromToToCommon_AltNums { @alt_0, };
		public enum ReverseChainFromToToCommon_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_ReverseChainFromToToCommon;

		public enum ReverseChainFromToToCommon_alt_0_CaseNums { @base, @rec, };
		public static GRGEN_LIBGR.EdgeType[] ReverseChainFromToToCommon_alt_0_base_edge__edge0_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] ReverseChainFromToToCommon_alt_0_base_edge__edge1_AllowedTypes = null;
		public static bool[] ReverseChainFromToToCommon_alt_0_base_edge__edge0_IsAllowedType = null;
		public static bool[] ReverseChainFromToToCommon_alt_0_base_edge__edge1_IsAllowedType = null;
		public enum ReverseChainFromToToCommon_alt_0_base_NodeNums { @to, @from, @common, };
		public enum ReverseChainFromToToCommon_alt_0_base_EdgeNums { @_edge0, @_edge1, };
		public enum ReverseChainFromToToCommon_alt_0_base_VariableNums { };
		public enum ReverseChainFromToToCommon_alt_0_base_SubNums { };
		public enum ReverseChainFromToToCommon_alt_0_base_AltNums { };
		public enum ReverseChainFromToToCommon_alt_0_base_IterNums { };



		public GRGEN_LGSP.PatternGraph ReverseChainFromToToCommon_alt_0_base;

		public static GRGEN_LIBGR.NodeType[] ReverseChainFromToToCommon_alt_0_rec_node_intermediate_AllowedTypes = null;
		public static bool[] ReverseChainFromToToCommon_alt_0_rec_node_intermediate_IsAllowedType = null;
		public static GRGEN_LIBGR.EdgeType[] ReverseChainFromToToCommon_alt_0_rec_edge__edge0_AllowedTypes = null;
		public static GRGEN_LIBGR.EdgeType[] ReverseChainFromToToCommon_alt_0_rec_edge__edge1_AllowedTypes = null;
		public static bool[] ReverseChainFromToToCommon_alt_0_rec_edge__edge0_IsAllowedType = null;
		public static bool[] ReverseChainFromToToCommon_alt_0_rec_edge__edge1_IsAllowedType = null;
		public enum ReverseChainFromToToCommon_alt_0_rec_NodeNums { @intermediate, @from, @common, @to, };
		public enum ReverseChainFromToToCommon_alt_0_rec_EdgeNums { @_edge0, @_edge1, };
		public enum ReverseChainFromToToCommon_alt_0_rec_VariableNums { };
		public enum ReverseChainFromToToCommon_alt_0_rec_SubNums { @_sub0, };
		public enum ReverseChainFromToToCommon_alt_0_rec_AltNums { };
		public enum ReverseChainFromToToCommon_alt_0_rec_IterNums { };



		public GRGEN_LGSP.PatternGraph ReverseChainFromToToCommon_alt_0_rec;


		private Pattern_ReverseChainFromToToCommon()
			: base("ReverseChainFromToToCommon",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, GRGEN_MODEL.NodeType_Node.typeVar, GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "ReverseChainFromToToCommon_node_from", "ReverseChainFromToToCommon_node_to", "ReverseChainFromToToCommon_node_common", },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { }
			)
		{
		}
		private void initialize()
		{
			bool[,] ReverseChainFromToToCommon_isNodeHomomorphicGlobal = new bool[3, 3] {
				{ false, false, false, },
				{ false, false, false, },
				{ false, false, false, },
			};
			bool[,] ReverseChainFromToToCommon_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] ReverseChainFromToToCommon_isNodeTotallyHomomorphic = new bool[3] { false, false, false,  };
			bool[] ReverseChainFromToToCommon_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode ReverseChainFromToToCommon_node_from = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ReverseChainFromToToCommon_node_from", "from", ReverseChainFromToToCommon_node_from_AllowedTypes, ReverseChainFromToToCommon_node_from_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode ReverseChainFromToToCommon_node_to = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ReverseChainFromToToCommon_node_to", "to", ReverseChainFromToToCommon_node_to_AllowedTypes, ReverseChainFromToToCommon_node_to_IsAllowedType, 5.5F, 1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode ReverseChainFromToToCommon_node_common = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ReverseChainFromToToCommon_node_common", "common", ReverseChainFromToToCommon_node_common_AllowedTypes, ReverseChainFromToToCommon_node_common_IsAllowedType, 5.5F, 2, false, null, null, null, null, null, null, false, null);
			bool[,] ReverseChainFromToToCommon_alt_0_base_isNodeHomomorphicGlobal = new bool[3, 3] {
				{ false, false, false, },
				{ false, false, false, },
				{ false, false, false, },
			};
			bool[,] ReverseChainFromToToCommon_alt_0_base_isEdgeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[] ReverseChainFromToToCommon_alt_0_base_isNodeTotallyHomomorphic = new bool[3] { false, false, false,  };
			bool[] ReverseChainFromToToCommon_alt_0_base_isEdgeTotallyHomomorphic = new bool[2] { false, false,  };
			GRGEN_LGSP.PatternEdge ReverseChainFromToToCommon_alt_0_base_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ReverseChainFromToToCommon_alt_0_base_edge__edge0", "_edge0", ReverseChainFromToToCommon_alt_0_base_edge__edge0_AllowedTypes, ReverseChainFromToToCommon_alt_0_base_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ReverseChainFromToToCommon_alt_0_base_edge__edge1 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ReverseChainFromToToCommon_alt_0_base_edge__edge1", "_edge1", ReverseChainFromToToCommon_alt_0_base_edge__edge1_AllowedTypes, ReverseChainFromToToCommon_alt_0_base_edge__edge1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			ReverseChainFromToToCommon_alt_0_base = new GRGEN_LGSP.PatternGraph(
				"base",
				"ReverseChainFromToToCommon_alt_0_",
				null, "base",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ReverseChainFromToToCommon_node_to, ReverseChainFromToToCommon_node_from, ReverseChainFromToToCommon_node_common }, 
				new GRGEN_LGSP.PatternEdge[] { ReverseChainFromToToCommon_alt_0_base_edge__edge0, ReverseChainFromToToCommon_alt_0_base_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, false, },
					{ false, true, false, },
					{ false, false, true, },
				},
				new bool[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				ReverseChainFromToToCommon_alt_0_base_isNodeHomomorphicGlobal,
				ReverseChainFromToToCommon_alt_0_base_isEdgeHomomorphicGlobal,
				ReverseChainFromToToCommon_alt_0_base_isNodeTotallyHomomorphic,
				ReverseChainFromToToCommon_alt_0_base_isEdgeTotallyHomomorphic
			);
			ReverseChainFromToToCommon_alt_0_base.edgeToSourceNode.Add(ReverseChainFromToToCommon_alt_0_base_edge__edge0, ReverseChainFromToToCommon_node_to);
			ReverseChainFromToToCommon_alt_0_base.edgeToTargetNode.Add(ReverseChainFromToToCommon_alt_0_base_edge__edge0, ReverseChainFromToToCommon_node_from);
			ReverseChainFromToToCommon_alt_0_base.edgeToSourceNode.Add(ReverseChainFromToToCommon_alt_0_base_edge__edge1, ReverseChainFromToToCommon_node_from);
			ReverseChainFromToToCommon_alt_0_base.edgeToTargetNode.Add(ReverseChainFromToToCommon_alt_0_base_edge__edge1, ReverseChainFromToToCommon_node_common);

			bool[,] ReverseChainFromToToCommon_alt_0_rec_isNodeHomomorphicGlobal = new bool[4, 4] {
				{ false, false, false, false, },
				{ false, false, false, false, },
				{ false, false, false, false, },
				{ false, false, false, false, },
			};
			bool[,] ReverseChainFromToToCommon_alt_0_rec_isEdgeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[] ReverseChainFromToToCommon_alt_0_rec_isNodeTotallyHomomorphic = new bool[4] { false, false, false, false,  };
			bool[] ReverseChainFromToToCommon_alt_0_rec_isEdgeTotallyHomomorphic = new bool[2] { false, false,  };
			GRGEN_LGSP.PatternNode ReverseChainFromToToCommon_alt_0_rec_node_intermediate = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "ReverseChainFromToToCommon_alt_0_rec_node_intermediate", "intermediate", ReverseChainFromToToCommon_alt_0_rec_node_intermediate_AllowedTypes, ReverseChainFromToToCommon_alt_0_rec_node_intermediate_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ReverseChainFromToToCommon_alt_0_rec_edge__edge0 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ReverseChainFromToToCommon_alt_0_rec_edge__edge0", "_edge0", ReverseChainFromToToCommon_alt_0_rec_edge__edge0_AllowedTypes, ReverseChainFromToToCommon_alt_0_rec_edge__edge0_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternEdge ReverseChainFromToToCommon_alt_0_rec_edge__edge1 = new GRGEN_LGSP.PatternEdge(true, (int) GRGEN_MODEL.EdgeTypes.@Edge, GRGEN_MODEL.EdgeType_Edge.typeVar, "GRGEN_LIBGR.IDEdge", "ReverseChainFromToToCommon_alt_0_rec_edge__edge1", "_edge1", ReverseChainFromToToCommon_alt_0_rec_edge__edge1_AllowedTypes, ReverseChainFromToToCommon_alt_0_rec_edge__edge1_IsAllowedType, 5.5F, -1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding ReverseChainFromToToCommon_alt_0_rec__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_ReverseChainFromToToCommon.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("ReverseChainFromToToCommon_alt_0_rec_node_intermediate"),
					new GRGEN_EXPR.GraphEntityExpression("ReverseChainFromToToCommon_node_to"),
					new GRGEN_EXPR.GraphEntityExpression("ReverseChainFromToToCommon_node_common"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "ReverseChainFromToToCommon_alt_0_rec_node_intermediate", "ReverseChainFromToToCommon_node_to", "ReverseChainFromToToCommon_node_common" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { ReverseChainFromToToCommon_alt_0_rec_node_intermediate, ReverseChainFromToToCommon_node_to, ReverseChainFromToToCommon_node_common }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			ReverseChainFromToToCommon_alt_0_rec = new GRGEN_LGSP.PatternGraph(
				"rec",
				"ReverseChainFromToToCommon_alt_0_",
				null, "rec",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ReverseChainFromToToCommon_alt_0_rec_node_intermediate, ReverseChainFromToToCommon_node_from, ReverseChainFromToToCommon_node_common, ReverseChainFromToToCommon_node_to }, 
				new GRGEN_LGSP.PatternEdge[] { ReverseChainFromToToCommon_alt_0_rec_edge__edge0, ReverseChainFromToToCommon_alt_0_rec_edge__edge1 }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { ReverseChainFromToToCommon_alt_0_rec__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[4, 4] {
					{ true, false, false, true, },
					{ false, true, false, true, },
					{ false, false, true, true, },
					{ true, true, true, true, },
				},
				new bool[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				ReverseChainFromToToCommon_alt_0_rec_isNodeHomomorphicGlobal,
				ReverseChainFromToToCommon_alt_0_rec_isEdgeHomomorphicGlobal,
				ReverseChainFromToToCommon_alt_0_rec_isNodeTotallyHomomorphic,
				ReverseChainFromToToCommon_alt_0_rec_isEdgeTotallyHomomorphic
			);
			ReverseChainFromToToCommon_alt_0_rec.edgeToSourceNode.Add(ReverseChainFromToToCommon_alt_0_rec_edge__edge0, ReverseChainFromToToCommon_alt_0_rec_node_intermediate);
			ReverseChainFromToToCommon_alt_0_rec.edgeToTargetNode.Add(ReverseChainFromToToCommon_alt_0_rec_edge__edge0, ReverseChainFromToToCommon_node_from);
			ReverseChainFromToToCommon_alt_0_rec.edgeToSourceNode.Add(ReverseChainFromToToCommon_alt_0_rec_edge__edge1, ReverseChainFromToToCommon_node_from);
			ReverseChainFromToToCommon_alt_0_rec.edgeToTargetNode.Add(ReverseChainFromToToCommon_alt_0_rec_edge__edge1, ReverseChainFromToToCommon_node_common);

			GRGEN_LGSP.Alternative ReverseChainFromToToCommon_alt_0 = new GRGEN_LGSP.Alternative( "alt_0", "ReverseChainFromToToCommon_", new GRGEN_LGSP.PatternGraph[] { ReverseChainFromToToCommon_alt_0_base, ReverseChainFromToToCommon_alt_0_rec } );

			pat_ReverseChainFromToToCommon = new GRGEN_LGSP.PatternGraph(
				"ReverseChainFromToToCommon",
				"",
				null, "ReverseChainFromToToCommon",
				false, false,
				new GRGEN_LGSP.PatternNode[] { ReverseChainFromToToCommon_node_from, ReverseChainFromToToCommon_node_to, ReverseChainFromToToCommon_node_common }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] {  }, 
				new GRGEN_LGSP.Alternative[] { ReverseChainFromToToCommon_alt_0,  }, 
				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, false, },
					{ false, true, false, },
					{ false, false, true, },
				},
				new bool[0, 0] ,
				ReverseChainFromToToCommon_isNodeHomomorphicGlobal,
				ReverseChainFromToToCommon_isEdgeHomomorphicGlobal,
				ReverseChainFromToToCommon_isNodeTotallyHomomorphic,
				ReverseChainFromToToCommon_isEdgeTotallyHomomorphic
			);
			ReverseChainFromToToCommon_alt_0_base.embeddingGraph = pat_ReverseChainFromToToCommon;
			ReverseChainFromToToCommon_alt_0_rec.embeddingGraph = pat_ReverseChainFromToToCommon;

			ReverseChainFromToToCommon_node_from.pointOfDefinition = null;
			ReverseChainFromToToCommon_node_to.pointOfDefinition = null;
			ReverseChainFromToToCommon_node_common.pointOfDefinition = null;
			ReverseChainFromToToCommon_alt_0_base_edge__edge0.pointOfDefinition = ReverseChainFromToToCommon_alt_0_base;
			ReverseChainFromToToCommon_alt_0_base_edge__edge1.pointOfDefinition = ReverseChainFromToToCommon_alt_0_base;
			ReverseChainFromToToCommon_alt_0_rec_node_intermediate.pointOfDefinition = ReverseChainFromToToCommon_alt_0_rec;
			ReverseChainFromToToCommon_alt_0_rec_edge__edge0.pointOfDefinition = ReverseChainFromToToCommon_alt_0_rec;
			ReverseChainFromToToCommon_alt_0_rec_edge__edge1.pointOfDefinition = ReverseChainFromToToCommon_alt_0_rec;
			ReverseChainFromToToCommon_alt_0_rec__sub0.PointOfDefinition = ReverseChainFromToToCommon_alt_0_rec;

			patternGraph = pat_ReverseChainFromToToCommon;
		}


		public void ReverseChainFromToToCommon_Create(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LGSP.LGSPNode node_from, GRGEN_LGSP.LGSPNode node_to, GRGEN_LGSP.LGSPNode node_common)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			graph.SettingAddedNodeNames( create_ReverseChainFromToToCommon_addedNodeNames );
			graph.SettingAddedEdgeNames( create_ReverseChainFromToToCommon_addedEdgeNames );
		}
		private static string[] create_ReverseChainFromToToCommon_addedNodeNames = new string[] {  };
		private static string[] create_ReverseChainFromToToCommon_addedEdgeNames = new string[] {  };

		public void ReverseChainFromToToCommon_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ReverseChainFromToToCommon curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			IMatch_ReverseChainFromToToCommon_alt_0 alternative_alt_0 = curMatch._alt_0;
		}

		public void ReverseChainFromToToCommon_alt_0_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, IMatch_ReverseChainFromToToCommon_alt_0 curMatch)
		{
			if(curMatch.Pattern == ReverseChainFromToToCommon_alt_0_base) {
				ReverseChainFromToToCommon_alt_0_base_Delete(actionEnv, (Match_ReverseChainFromToToCommon_alt_0_base)curMatch);
				return;
			}
			else if(curMatch.Pattern == ReverseChainFromToToCommon_alt_0_rec) {
				ReverseChainFromToToCommon_alt_0_rec_Delete(actionEnv, (Match_ReverseChainFromToToCommon_alt_0_rec)curMatch);
				return;
			}
			throw new ApplicationException(); //debug assert
		}

		public void ReverseChainFromToToCommon_alt_0_base_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ReverseChainFromToToCommon_alt_0_base curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_to = curMatch._node_to;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPNode node_common = curMatch._node_common;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			GRGEN_LGSP.LGSPEdge edge__edge1 = curMatch._edge__edge1;
			graph.Remove(edge__edge0);
			graph.Remove(edge__edge1);
			graph.RemoveEdges(node_to);
			graph.Remove(node_to);
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
			graph.RemoveEdges(node_common);
			graph.Remove(node_common);
		}

		public void ReverseChainFromToToCommon_alt_0_rec_Delete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, Match_ReverseChainFromToToCommon_alt_0_rec curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			GRGEN_LGSP.LGSPNode node_intermediate = curMatch._node_intermediate;
			GRGEN_LGSP.LGSPNode node_from = curMatch._node_from;
			GRGEN_LGSP.LGSPNode node_common = curMatch._node_common;
			GRGEN_LGSP.LGSPNode node_to = curMatch._node_to;
			GRGEN_LGSP.LGSPEdge edge__edge0 = curMatch._edge__edge0;
			GRGEN_LGSP.LGSPEdge edge__edge1 = curMatch._edge__edge1;
			GRGEN_ACTIONS.Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon subpattern__sub0 = curMatch.@__sub0;
			graph.Remove(edge__edge0);
			graph.Remove(edge__edge1);
			graph.RemoveEdges(node_intermediate);
			graph.Remove(node_intermediate);
			graph.RemoveEdges(node_from);
			graph.Remove(node_from);
			graph.RemoveEdges(node_common);
			graph.Remove(node_common);
			graph.RemoveEdges(node_to);
			graph.Remove(node_to);
			GRGEN_ACTIONS.Pattern_ReverseChainFromToToCommon.Instance.ReverseChainFromToToCommon_Delete(actionEnv, subpattern__sub0);
		}

		static Pattern_ReverseChainFromToToCommon() {
		}

		public interface IMatch_ReverseChainFromToToCommon : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_to { get; set; }
			GRGEN_LIBGR.INode node_common { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			//Alternatives
			IMatch_ReverseChainFromToToCommon_alt_0 alt_0 { get; }
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

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

		public interface IMatch_ReverseChainFromToToCommon_alt_0_base : IMatch_ReverseChainFromToToCommon_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node_to { get; set; }
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_common { 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_ReverseChainFromToToCommon_alt_0_rec : IMatch_ReverseChainFromToToCommon_alt_0
		{
			//Nodes
			GRGEN_LIBGR.INode node_intermediate { get; set; }
			GRGEN_LIBGR.INode node_from { get; set; }
			GRGEN_LIBGR.INode node_common { get; set; }
			GRGEN_LIBGR.INode node_to { get; set; }
			//Edges
			GRGEN_LIBGR.IDEdge edge__edge0 { get; set; }
			GRGEN_LIBGR.IDEdge edge__edge1 { get; set; }
			//Variables
			//EmbeddedGraphs
			@GRGEN_ACTIONS.Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon @_sub0 { get; }
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			new void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_ReverseChainFromToToCommon : GRGEN_LGSP.MatchListElement<Match_ReverseChainFromToToCommon>, IMatch_ReverseChainFromToToCommon
		{
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_common { get { return (GRGEN_LIBGR.INode)_node_common; } set { _node_common = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_to;
			public GRGEN_LGSP.LGSPNode _node_common;
			public enum ReverseChainFromToToCommon_NodeNums { @from, @to, @common, 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)ReverseChainFromToToCommon_NodeNums.@from: return _node_from;
				case (int)ReverseChainFromToToCommon_NodeNums.@to: return _node_to;
				case (int)ReverseChainFromToToCommon_NodeNums.@common: return _node_common;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "from": return _node_from;
				case "to": return _node_to;
				case "common": return _node_common;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (GRGEN_LGSP.LGSPNode)value; break;
				case "common": _node_common = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum ReverseChainFromToToCommon_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 ReverseChainFromToToCommon_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 ReverseChainFromToToCommon_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_ReverseChainFromToToCommon_alt_0 alt_0 { get { return _alt_0; } }
			public IMatch_ReverseChainFromToToCommon_alt_0 _alt_0;
			public enum ReverseChainFromToToCommon_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)ReverseChainFromToToCommon_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 ReverseChainFromToToCommon_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 ReverseChainFromToToCommon_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_ReverseChainFromToToCommon.instance.pat_ReverseChainFromToToCommon; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ReverseChainFromToToCommon(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ReverseChainFromToToCommon(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ReverseChainFromToToCommon nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ReverseChainFromToToCommon cur = this;
				while(cur != null) {
					Match_ReverseChainFromToToCommon next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ReverseChainFromToToCommon that)
			{
				_node_from = that._node_from;
				_node_to = that._node_to;
				_node_common = that._node_common;
				_alt_0 = that._alt_0;
			}

			public Match_ReverseChainFromToToCommon(Match_ReverseChainFromToToCommon that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ReverseChainFromToToCommon that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				_node_to = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_to];
				_node_common = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_common];
				if(that._alt_0 is Match_ReverseChainFromToToCommon_alt_0_base)
					_alt_0 = new Match_ReverseChainFromToToCommon_alt_0_base((Match_ReverseChainFromToToCommon_alt_0_base)that._alt_0, oldToNewMap);
				else if(that._alt_0 is Match_ReverseChainFromToToCommon_alt_0_rec)
					_alt_0 = new Match_ReverseChainFromToToCommon_alt_0_rec((Match_ReverseChainFromToToCommon_alt_0_rec)that._alt_0, oldToNewMap);
			}

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

			public bool IsEqual(Match_ReverseChainFromToToCommon that)
			{
				if(that==null) return false;
				if(_node_from != that._node_from) return false;
				if(_node_to != that._node_to) return false;
				if(_node_common != that._node_common) return false;
				if(_alt_0 is Match_ReverseChainFromToToCommon_alt_0_base && !(_alt_0 as Match_ReverseChainFromToToCommon_alt_0_base).IsEqual(that._alt_0 as Match_ReverseChainFromToToCommon_alt_0_base)) return false;
				if(_alt_0 is Match_ReverseChainFromToToCommon_alt_0_rec && !(_alt_0 as Match_ReverseChainFromToToCommon_alt_0_rec).IsEqual(that._alt_0 as Match_ReverseChainFromToToCommon_alt_0_rec)) return false;
				return true;
			}
		}

		public class Match_ReverseChainFromToToCommon_alt_0_base : GRGEN_LGSP.MatchListElement<Match_ReverseChainFromToToCommon_alt_0_base>, IMatch_ReverseChainFromToToCommon_alt_0_base
		{
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_common { get { return (GRGEN_LIBGR.INode)_node_common; } set { _node_common = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_to;
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_common;
			public enum ReverseChainFromToToCommon_alt_0_base_NodeNums { @to, @from, @common, 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)ReverseChainFromToToCommon_alt_0_base_NodeNums.@to: return _node_to;
				case (int)ReverseChainFromToToCommon_alt_0_base_NodeNums.@from: return _node_from;
				case (int)ReverseChainFromToToCommon_alt_0_base_NodeNums.@common: return _node_common;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "to": return _node_to;
				case "from": return _node_from;
				case "common": return _node_common;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "to": _node_to = (GRGEN_LGSP.LGSPNode)value; break;
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "common": _node_common = (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 ReverseChainFromToToCommon_alt_0_base_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)ReverseChainFromToToCommon_alt_0_base_EdgeNums.@_edge0: return _edge__edge0;
				case (int)ReverseChainFromToToCommon_alt_0_base_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 ReverseChainFromToToCommon_alt_0_base_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 ReverseChainFromToToCommon_alt_0_base_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 ReverseChainFromToToCommon_alt_0_base_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 ReverseChainFromToToCommon_alt_0_base_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 ReverseChainFromToToCommon_alt_0_base_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_ReverseChainFromToToCommon.instance.ReverseChainFromToToCommon_alt_0_base; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ReverseChainFromToToCommon_alt_0_base(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ReverseChainFromToToCommon_alt_0_base(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ReverseChainFromToToCommon_alt_0_base nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ReverseChainFromToToCommon_alt_0_base cur = this;
				while(cur != null) {
					Match_ReverseChainFromToToCommon_alt_0_base next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ReverseChainFromToToCommon_alt_0_base that)
			{
				_node_to = that._node_to;
				_node_from = that._node_from;
				_node_common = that._node_common;
				_edge__edge0 = that._edge__edge0;
				_edge__edge1 = that._edge__edge1;
			}

			public Match_ReverseChainFromToToCommon_alt_0_base(Match_ReverseChainFromToToCommon_alt_0_base that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ReverseChainFromToToCommon_alt_0_base that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_to = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_to];
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				_node_common = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_common];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				_edge__edge1 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge1];
			}

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

			public bool IsEqual(Match_ReverseChainFromToToCommon_alt_0_base that)
			{
				if(that==null) return false;
				if(_node_to != that._node_to) return false;
				if(_node_from != that._node_from) return false;
				if(_node_common != that._node_common) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(_edge__edge1 != that._edge__edge1) return false;
				return true;
			}
		}

		public class Match_ReverseChainFromToToCommon_alt_0_rec : GRGEN_LGSP.MatchListElement<Match_ReverseChainFromToToCommon_alt_0_rec>, IMatch_ReverseChainFromToToCommon_alt_0_rec
		{
			public GRGEN_LIBGR.INode node_intermediate { get { return (GRGEN_LIBGR.INode)_node_intermediate; } set { _node_intermediate = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_from { get { return (GRGEN_LIBGR.INode)_node_from; } set { _node_from = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_common { get { return (GRGEN_LIBGR.INode)_node_common; } set { _node_common = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_to { get { return (GRGEN_LIBGR.INode)_node_to; } set { _node_to = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_intermediate;
			public GRGEN_LGSP.LGSPNode _node_from;
			public GRGEN_LGSP.LGSPNode _node_common;
			public GRGEN_LGSP.LGSPNode _node_to;
			public enum ReverseChainFromToToCommon_alt_0_rec_NodeNums { @intermediate, @from, @common, @to, 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 4; } }
			public override GRGEN_LIBGR.INode getNodeAt(int index)
			{
				switch(index) {
				case (int)ReverseChainFromToToCommon_alt_0_rec_NodeNums.@intermediate: return _node_intermediate;
				case (int)ReverseChainFromToToCommon_alt_0_rec_NodeNums.@from: return _node_from;
				case (int)ReverseChainFromToToCommon_alt_0_rec_NodeNums.@common: return _node_common;
				case (int)ReverseChainFromToToCommon_alt_0_rec_NodeNums.@to: return _node_to;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "intermediate": return _node_intermediate;
				case "from": return _node_from;
				case "common": return _node_common;
				case "to": return _node_to;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "intermediate": _node_intermediate = (GRGEN_LGSP.LGSPNode)value; break;
				case "from": _node_from = (GRGEN_LGSP.LGSPNode)value; break;
				case "common": _node_common = (GRGEN_LGSP.LGSPNode)value; break;
				case "to": _node_to = (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 ReverseChainFromToToCommon_alt_0_rec_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)ReverseChainFromToToCommon_alt_0_rec_EdgeNums.@_edge0: return _edge__edge0;
				case (int)ReverseChainFromToToCommon_alt_0_rec_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 ReverseChainFromToToCommon_alt_0_rec_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_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon @__sub0;
			public enum ReverseChainFromToToCommon_alt_0_rec_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)ReverseChainFromToToCommon_alt_0_rec_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 ReverseChainFromToToCommon_alt_0_rec_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 ReverseChainFromToToCommon_alt_0_rec_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 ReverseChainFromToToCommon_alt_0_rec_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_ReverseChainFromToToCommon.instance.ReverseChainFromToToCommon_alt_0_rec; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_ReverseChainFromToToCommon_alt_0_rec(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_ReverseChainFromToToCommon_alt_0_rec(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_ReverseChainFromToToCommon_alt_0_rec nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_ReverseChainFromToToCommon_alt_0_rec cur = this;
				while(cur != null) {
					Match_ReverseChainFromToToCommon_alt_0_rec next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_ReverseChainFromToToCommon_alt_0_rec that)
			{
				_node_intermediate = that._node_intermediate;
				_node_from = that._node_from;
				_node_common = that._node_common;
				_node_to = that._node_to;
				_edge__edge0 = that._edge__edge0;
				_edge__edge1 = that._edge__edge1;
				@__sub0 = that.@__sub0;
			}

			public Match_ReverseChainFromToToCommon_alt_0_rec(Match_ReverseChainFromToToCommon_alt_0_rec that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_ReverseChainFromToToCommon_alt_0_rec that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_intermediate = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_intermediate];
				_node_from = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_from];
				_node_common = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_common];
				_node_to = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_to];
				_edge__edge0 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge0];
				_edge__edge1 = (GRGEN_LGSP.LGSPEdge)oldToNewMap[that._edge__edge1];
				@__sub0 = new GRGEN_ACTIONS.Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon(that.@__sub0, oldToNewMap);
			}

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

			public bool IsEqual(Match_ReverseChainFromToToCommon_alt_0_rec that)
			{
				if(that==null) return false;
				if(_node_intermediate != that._node_intermediate) return false;
				if(_node_from != that._node_from) return false;
				if(_node_common != that._node_common) return false;
				if(_node_to != that._node_to) return false;
				if(_edge__edge0 != that._edge__edge0) return false;
				if(_edge__edge1 != that._edge__edge1) return false;
				if(!@__sub0.IsEqual(that.@__sub0)) return false;
				return true;
			}
		}

	}


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

		public enum createChain_NodeNums { };
		public enum createChain_EdgeNums { };
		public enum createChain_VariableNums { };
		public enum createChain_SubNums { };
		public enum createChain_AltNums { };
		public enum createChain_IterNums { };





		public GRGEN_LGSP.PatternGraph pat_createChain;


		private Rule_createChain()
			: base("createChain",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, GRGEN_MODEL.NodeType_Node.typeVar, },
				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_Recursive.Rule_createChain+IMatch_createChain",
				"de.unika.ipd.grGen.Action_Recursive.Rule_createChain+Match_createChain"
			)
		{
		}
		private void initialize()
		{
			bool[,] createChain_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] createChain_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] createChain_isNodeTotallyHomomorphic = new bool[0];
			bool[] createChain_isEdgeTotallyHomomorphic = new bool[0];
			pat_createChain = new GRGEN_LGSP.PatternGraph(
				"createChain",
				"",
				null, "createChain",
				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] ,
				createChain_isNodeHomomorphicGlobal,
				createChain_isEdgeHomomorphicGlobal,
				createChain_isNodeTotallyHomomorphic,
				createChain_isEdgeTotallyHomomorphic
			);


			patternGraph = pat_createChain;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch, out GRGEN_LIBGR.INode output_0, out GRGEN_LIBGR.INode output_1)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_createChain curMatch = (Match_createChain)_curMatch;
			graph.SettingAddedNodeNames( createChain_addedNodeNames );
			GRGEN_MODEL.@Node node_beg = GRGEN_MODEL.@Node.CreateNode(graph);
			GRGEN_MODEL.@Node node__node0 = GRGEN_MODEL.@Node.CreateNode(graph);
			GRGEN_MODEL.@Node node__node1 = GRGEN_MODEL.@Node.CreateNode(graph);
			GRGEN_MODEL.@Node node_end = GRGEN_MODEL.@Node.CreateNode(graph);
			graph.SettingAddedEdgeNames( createChain_addedEdgeNames );
			GRGEN_MODEL.@Edge edge__edge0 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_beg, node__node0);
			GRGEN_MODEL.@Edge edge__edge1 = GRGEN_MODEL.@Edge.CreateEdge(graph, node__node0, node__node1);
			GRGEN_MODEL.@Edge edge__edge2 = GRGEN_MODEL.@Edge.CreateEdge(graph, node__node1, node_end);
			actionEnv.SelectedMatchRewritten();
			output_0 = (GRGEN_LIBGR.INode)(node_beg);
			output_1 = (GRGEN_LIBGR.INode)(node_end);
			return;
		}
		private static string[] createChain_addedNodeNames = new string[] { "beg", "_node0", "_node1", "end" };
		private static string[] createChain_addedEdgeNames = new string[] { "_edge0", "_edge1", "_edge2" };

		static Rule_createChain() {
		}

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

		public class Match_createChain : GRGEN_LGSP.MatchListElement<Match_createChain>, IMatch_createChain
		{
			public enum createChain_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 createChain_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 createChain_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 createChain_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 createChain_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 createChain_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 createChain_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_createChain.instance.pat_createChain; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_createChain(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_createChain(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_createChain nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_createChain cur = this;
				while(cur != null) {
					Match_createChain next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_createChain that)
			{
			}

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

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

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


		public class Extractor
		{
		}


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

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_createChain.IMatch_createChain instanceBearingAttributeForSearch_createChain = new GRGEN_ACTIONS.Rule_createChain.Match_createChain();
	}

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

		public static GRGEN_LIBGR.NodeType[] chainFromTo_node_beg_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] chainFromTo_node_end_AllowedTypes = null;
		public static bool[] chainFromTo_node_beg_IsAllowedType = null;
		public static bool[] chainFromTo_node_end_IsAllowedType = null;
		public enum chainFromTo_NodeNums { @beg, @end, };
		public enum chainFromTo_EdgeNums { };
		public enum chainFromTo_VariableNums { };
		public enum chainFromTo_SubNums { @_sub0, };
		public enum chainFromTo_AltNums { };
		public enum chainFromTo_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_chainFromTo;


		private Rule_chainFromTo()
			: base("chainFromTo",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "chainFromTo_node_beg", "chainFromTo_node_end", },
				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_Recursive.Rule_chainFromTo+IMatch_chainFromTo",
				"de.unika.ipd.grGen.Action_Recursive.Rule_chainFromTo+Match_chainFromTo"
			)
		{
		}
		private void initialize()
		{
			bool[,] chainFromTo_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] chainFromTo_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] chainFromTo_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] chainFromTo_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode chainFromTo_node_beg = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "chainFromTo_node_beg", "beg", chainFromTo_node_beg_AllowedTypes, chainFromTo_node_beg_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode chainFromTo_node_end = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "chainFromTo_node_end", "end", chainFromTo_node_end_AllowedTypes, chainFromTo_node_end_IsAllowedType, 5.5F, 1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding chainFromTo__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_ChainFromTo.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("chainFromTo_node_beg"),
					new GRGEN_EXPR.GraphEntityExpression("chainFromTo_node_end"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "chainFromTo_node_beg", "chainFromTo_node_end" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { chainFromTo_node_beg, chainFromTo_node_end }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			pat_chainFromTo = new GRGEN_LGSP.PatternGraph(
				"chainFromTo",
				"",
				null, "chainFromTo",
				false, false,
				new GRGEN_LGSP.PatternNode[] { chainFromTo_node_beg, chainFromTo_node_end }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { chainFromTo__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[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				new bool[0, 0] ,
				chainFromTo_isNodeHomomorphicGlobal,
				chainFromTo_isEdgeHomomorphicGlobal,
				chainFromTo_isNodeTotallyHomomorphic,
				chainFromTo_isEdgeTotallyHomomorphic
			);

			chainFromTo_node_beg.pointOfDefinition = null;
			chainFromTo_node_end.pointOfDefinition = null;
			chainFromTo__sub0.PointOfDefinition = pat_chainFromTo;

			patternGraph = pat_chainFromTo;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_chainFromTo curMatch = (Match_chainFromTo)_curMatch;
			GRGEN_LGSP.LGSPNode node_beg = curMatch._node_beg;
			GRGEN_LGSP.LGSPNode node_end = curMatch._node_end;
			GRGEN_ACTIONS.Pattern_ChainFromTo.Match_ChainFromTo subpattern__sub0 = curMatch.@__sub0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		static Rule_chainFromTo() {
		}

		public interface IMatch_chainFromTo : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_LIBGR.INode node_beg { get; set; }
			GRGEN_LIBGR.INode node_end { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			@GRGEN_ACTIONS.Pattern_ChainFromTo.Match_ChainFromTo @_sub0 { get; }
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_chainFromTo : GRGEN_LGSP.MatchListElement<Match_chainFromTo>, IMatch_chainFromTo
		{
			public GRGEN_LIBGR.INode node_beg { get { return (GRGEN_LIBGR.INode)_node_beg; } set { _node_beg = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_end { get { return (GRGEN_LIBGR.INode)_node_end; } set { _node_end = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_beg;
			public GRGEN_LGSP.LGSPNode _node_end;
			public enum chainFromTo_NodeNums { @beg, @end, 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)chainFromTo_NodeNums.@beg: return _node_beg;
				case (int)chainFromTo_NodeNums.@end: return _node_end;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "beg": return _node_beg;
				case "end": return _node_end;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "beg": _node_beg = (GRGEN_LGSP.LGSPNode)value; break;
				case "end": _node_end = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum chainFromTo_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 chainFromTo_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_ChainFromTo.Match_ChainFromTo @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_ChainFromTo.Match_ChainFromTo @__sub0;
			public enum chainFromTo_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)chainFromTo_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 chainFromTo_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 chainFromTo_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 chainFromTo_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_chainFromTo.instance.pat_chainFromTo; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_chainFromTo(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_chainFromTo(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_chainFromTo nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_chainFromTo cur = this;
				while(cur != null) {
					Match_chainFromTo next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_chainFromTo that)
			{
				_node_beg = that._node_beg;
				_node_end = that._node_end;
				@__sub0 = that.@__sub0;
			}

			public Match_chainFromTo(Match_chainFromTo that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_chainFromTo that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_beg = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_beg];
				_node_end = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_end];
				@__sub0 = new GRGEN_ACTIONS.Pattern_ChainFromTo.Match_ChainFromTo(that.@__sub0, oldToNewMap);
			}

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

			public bool IsEqual(Match_chainFromTo that)
			{
				if(that==null) return false;
				if(_node_beg != that._node_beg) return false;
				if(_node_end != that._node_end) return false;
				if(!@__sub0.IsEqual(that.@__sub0)) return false;
				return true;
			}
		}


		public class Extractor
		{
			public static List<GRGEN_LIBGR.INode> Extract_beg(List<IMatch_chainFromTo> matchList)
			{
				List<GRGEN_LIBGR.INode> resultList = new List<GRGEN_LIBGR.INode>(matchList.Count);
				foreach(IMatch_chainFromTo match in matchList)
					resultList.Add(match.node_beg);
				return resultList;
			}
			public static List<GRGEN_LIBGR.INode> Extract_end(List<IMatch_chainFromTo> matchList)
			{
				List<GRGEN_LIBGR.INode> resultList = new List<GRGEN_LIBGR.INode>(matchList.Count);
				foreach(IMatch_chainFromTo match in matchList)
					resultList.Add(match.node_end);
				return resultList;
			}
		}


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

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo instanceBearingAttributeForSearch_chainFromTo = new GRGEN_ACTIONS.Rule_chainFromTo.Match_chainFromTo();
		public static List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> Array_chainFromTo_groupBy_beg(List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_beg)) {
					seenValues[list[pos].@node_beg].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> tempList = new List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_beg, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> newList = new List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo>();
			foreach(List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> Array_chainFromTo_keepOneForEachBy_beg(List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> list)
		{
			List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> newList = new List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_beg)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_beg, null);
				}
			}
			return newList;
		}
		public static int Array_chainFromTo_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromTo_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromTo_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromTo_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> Array_chainFromTo_groupBy_end(List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_end)) {
					seenValues[list[pos].@node_end].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> tempList = new List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_end, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> newList = new List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo>();
			foreach(List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> Array_chainFromTo_keepOneForEachBy_end(List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> list)
		{
			List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> newList = new List<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_end)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_end, null);
				}
			}
			return newList;
		}
		public static int Array_chainFromTo_indexOfBy_end(IList<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromTo_indexOfBy_end(IList<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromTo_lastIndexOfBy_end(IList<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromTo_lastIndexOfBy_end(IList<GRGEN_ACTIONS.Rule_chainFromTo.IMatch_chainFromTo> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
	}

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

		public static GRGEN_LIBGR.NodeType[] chainFrom_node_beg_AllowedTypes = null;
		public static bool[] chainFrom_node_beg_IsAllowedType = null;
		public enum chainFrom_NodeNums { @beg, };
		public enum chainFrom_EdgeNums { };
		public enum chainFrom_VariableNums { };
		public enum chainFrom_SubNums { @_sub0, };
		public enum chainFrom_AltNums { };
		public enum chainFrom_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_chainFrom;


		private Rule_chainFrom()
			: base("chainFrom",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "chainFrom_node_beg", },
				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_Recursive.Rule_chainFrom+IMatch_chainFrom",
				"de.unika.ipd.grGen.Action_Recursive.Rule_chainFrom+Match_chainFrom"
			)
		{
		}
		private void initialize()
		{
			bool[,] chainFrom_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] chainFrom_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] chainFrom_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] chainFrom_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode chainFrom_node_beg = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "chainFrom_node_beg", "beg", chainFrom_node_beg_AllowedTypes, chainFrom_node_beg_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding chainFrom__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_ChainFrom.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("chainFrom_node_beg"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "chainFrom_node_beg" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { chainFrom_node_beg }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			pat_chainFrom = new GRGEN_LGSP.PatternGraph(
				"chainFrom",
				"",
				null, "chainFrom",
				false, false,
				new GRGEN_LGSP.PatternNode[] { chainFrom_node_beg }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { chainFrom__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] ,
				chainFrom_isNodeHomomorphicGlobal,
				chainFrom_isEdgeHomomorphicGlobal,
				chainFrom_isNodeTotallyHomomorphic,
				chainFrom_isEdgeTotallyHomomorphic
			);

			chainFrom_node_beg.pointOfDefinition = null;
			chainFrom__sub0.PointOfDefinition = pat_chainFrom;

			patternGraph = pat_chainFrom;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_chainFrom curMatch = (Match_chainFrom)_curMatch;
			GRGEN_LGSP.LGSPNode node_beg = curMatch._node_beg;
			GRGEN_ACTIONS.Pattern_ChainFrom.Match_ChainFrom subpattern__sub0 = curMatch.@__sub0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		static Rule_chainFrom() {
		}

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

		public class Match_chainFrom : GRGEN_LGSP.MatchListElement<Match_chainFrom>, IMatch_chainFrom
		{
			public GRGEN_LIBGR.INode node_beg { get { return (GRGEN_LIBGR.INode)_node_beg; } set { _node_beg = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_beg;
			public enum chainFrom_NodeNums { @beg, 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)chainFrom_NodeNums.@beg: return _node_beg;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "beg": return _node_beg;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "beg": _node_beg = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum chainFrom_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 chainFrom_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_ChainFrom.Match_ChainFrom @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_ChainFrom.Match_ChainFrom @__sub0;
			public enum chainFrom_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)chainFrom_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 chainFrom_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 chainFrom_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 chainFrom_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_chainFrom.instance.pat_chainFrom; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_chainFrom(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_chainFrom(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_chainFrom nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_chainFrom cur = this;
				while(cur != null) {
					Match_chainFrom next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_chainFrom that)
			{
				_node_beg = that._node_beg;
				@__sub0 = that.@__sub0;
			}

			public Match_chainFrom(Match_chainFrom that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_chainFrom that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_beg = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_beg];
				@__sub0 = new GRGEN_ACTIONS.Pattern_ChainFrom.Match_ChainFrom(that.@__sub0, oldToNewMap);
			}

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

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


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


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

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom instanceBearingAttributeForSearch_chainFrom = new GRGEN_ACTIONS.Rule_chainFrom.Match_chainFrom();
		public static List<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom> Array_chainFrom_groupBy_beg(List<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_beg)) {
					seenValues[list[pos].@node_beg].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom> tempList = new List<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_beg, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom> newList = new List<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom>();
			foreach(List<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom> Array_chainFrom_keepOneForEachBy_beg(List<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom> list)
		{
			List<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom> newList = new List<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_beg)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_beg, null);
				}
			}
			return newList;
		}
		public static int Array_chainFrom_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFrom_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFrom_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFrom_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFrom.IMatch_chainFrom> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
	}

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

		public static GRGEN_LIBGR.NodeType[] chainFromComplete_node_beg_AllowedTypes = null;
		public static bool[] chainFromComplete_node_beg_IsAllowedType = null;
		public enum chainFromComplete_NodeNums { @beg, };
		public enum chainFromComplete_EdgeNums { };
		public enum chainFromComplete_VariableNums { };
		public enum chainFromComplete_SubNums { @_sub0, };
		public enum chainFromComplete_AltNums { };
		public enum chainFromComplete_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_chainFromComplete;


		private Rule_chainFromComplete()
			: base("chainFromComplete",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "chainFromComplete_node_beg", },
				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_Recursive.Rule_chainFromComplete+IMatch_chainFromComplete",
				"de.unika.ipd.grGen.Action_Recursive.Rule_chainFromComplete+Match_chainFromComplete"
			)
		{
		}
		private void initialize()
		{
			bool[,] chainFromComplete_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] chainFromComplete_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] chainFromComplete_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] chainFromComplete_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode chainFromComplete_node_beg = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "chainFromComplete_node_beg", "beg", chainFromComplete_node_beg_AllowedTypes, chainFromComplete_node_beg_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding chainFromComplete__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_ChainFromComplete.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("chainFromComplete_node_beg"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "chainFromComplete_node_beg" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { chainFromComplete_node_beg }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			pat_chainFromComplete = new GRGEN_LGSP.PatternGraph(
				"chainFromComplete",
				"",
				null, "chainFromComplete",
				false, false,
				new GRGEN_LGSP.PatternNode[] { chainFromComplete_node_beg }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { chainFromComplete__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] ,
				chainFromComplete_isNodeHomomorphicGlobal,
				chainFromComplete_isEdgeHomomorphicGlobal,
				chainFromComplete_isNodeTotallyHomomorphic,
				chainFromComplete_isEdgeTotallyHomomorphic
			);

			chainFromComplete_node_beg.pointOfDefinition = null;
			chainFromComplete__sub0.PointOfDefinition = pat_chainFromComplete;

			patternGraph = pat_chainFromComplete;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_chainFromComplete curMatch = (Match_chainFromComplete)_curMatch;
			GRGEN_LGSP.LGSPNode node_beg = curMatch._node_beg;
			GRGEN_ACTIONS.Pattern_ChainFromComplete.Match_ChainFromComplete subpattern__sub0 = curMatch.@__sub0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		static Rule_chainFromComplete() {
		}

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

		public class Match_chainFromComplete : GRGEN_LGSP.MatchListElement<Match_chainFromComplete>, IMatch_chainFromComplete
		{
			public GRGEN_LIBGR.INode node_beg { get { return (GRGEN_LIBGR.INode)_node_beg; } set { _node_beg = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_beg;
			public enum chainFromComplete_NodeNums { @beg, 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)chainFromComplete_NodeNums.@beg: return _node_beg;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "beg": return _node_beg;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "beg": _node_beg = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum chainFromComplete_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 chainFromComplete_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_ChainFromComplete.Match_ChainFromComplete @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_ChainFromComplete.Match_ChainFromComplete @__sub0;
			public enum chainFromComplete_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)chainFromComplete_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 chainFromComplete_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 chainFromComplete_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 chainFromComplete_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_chainFromComplete.instance.pat_chainFromComplete; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_chainFromComplete(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_chainFromComplete(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_chainFromComplete nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_chainFromComplete cur = this;
				while(cur != null) {
					Match_chainFromComplete next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_chainFromComplete that)
			{
				_node_beg = that._node_beg;
				@__sub0 = that.@__sub0;
			}

			public Match_chainFromComplete(Match_chainFromComplete that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_chainFromComplete that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_beg = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_beg];
				@__sub0 = new GRGEN_ACTIONS.Pattern_ChainFromComplete.Match_ChainFromComplete(that.@__sub0, oldToNewMap);
			}

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

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


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


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

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete instanceBearingAttributeForSearch_chainFromComplete = new GRGEN_ACTIONS.Rule_chainFromComplete.Match_chainFromComplete();
		public static List<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete> Array_chainFromComplete_groupBy_beg(List<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_beg)) {
					seenValues[list[pos].@node_beg].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete> tempList = new List<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_beg, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete> newList = new List<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete>();
			foreach(List<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete> Array_chainFromComplete_keepOneForEachBy_beg(List<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete> list)
		{
			List<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete> newList = new List<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_beg)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_beg, null);
				}
			}
			return newList;
		}
		public static int Array_chainFromComplete_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromComplete_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromComplete_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromComplete_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromComplete.IMatch_chainFromComplete> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
	}

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

		public static GRGEN_LIBGR.NodeType[] chainFromCompleteArbitraryPatternpathLocked_node_beg_AllowedTypes = null;
		public static bool[] chainFromCompleteArbitraryPatternpathLocked_node_beg_IsAllowedType = null;
		public enum chainFromCompleteArbitraryPatternpathLocked_NodeNums { @beg, };
		public enum chainFromCompleteArbitraryPatternpathLocked_EdgeNums { };
		public enum chainFromCompleteArbitraryPatternpathLocked_VariableNums { };
		public enum chainFromCompleteArbitraryPatternpathLocked_SubNums { @_sub0, };
		public enum chainFromCompleteArbitraryPatternpathLocked_AltNums { };
		public enum chainFromCompleteArbitraryPatternpathLocked_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_chainFromCompleteArbitraryPatternpathLocked;


		private Rule_chainFromCompleteArbitraryPatternpathLocked()
			: base("chainFromCompleteArbitraryPatternpathLocked",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "chainFromCompleteArbitraryPatternpathLocked_node_beg", },
				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_Recursive.Rule_chainFromCompleteArbitraryPatternpathLocked+IMatch_chainFromCompleteArbitraryPatternpathLocked",
				"de.unika.ipd.grGen.Action_Recursive.Rule_chainFromCompleteArbitraryPatternpathLocked+Match_chainFromCompleteArbitraryPatternpathLocked"
			)
		{
		}
		private void initialize()
		{
			bool[,] chainFromCompleteArbitraryPatternpathLocked_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] chainFromCompleteArbitraryPatternpathLocked_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] chainFromCompleteArbitraryPatternpathLocked_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] chainFromCompleteArbitraryPatternpathLocked_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode chainFromCompleteArbitraryPatternpathLocked_node_beg = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "chainFromCompleteArbitraryPatternpathLocked_node_beg", "beg", chainFromCompleteArbitraryPatternpathLocked_node_beg_AllowedTypes, chainFromCompleteArbitraryPatternpathLocked_node_beg_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding chainFromCompleteArbitraryPatternpathLocked__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_ChainFromCompleteArbitraryPatternpathLocked.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("chainFromCompleteArbitraryPatternpathLocked_node_beg"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "chainFromCompleteArbitraryPatternpathLocked_node_beg" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { chainFromCompleteArbitraryPatternpathLocked_node_beg }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			pat_chainFromCompleteArbitraryPatternpathLocked = new GRGEN_LGSP.PatternGraph(
				"chainFromCompleteArbitraryPatternpathLocked",
				"",
				null, "chainFromCompleteArbitraryPatternpathLocked",
				false, false,
				new GRGEN_LGSP.PatternNode[] { chainFromCompleteArbitraryPatternpathLocked_node_beg }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { chainFromCompleteArbitraryPatternpathLocked__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] ,
				chainFromCompleteArbitraryPatternpathLocked_isNodeHomomorphicGlobal,
				chainFromCompleteArbitraryPatternpathLocked_isEdgeHomomorphicGlobal,
				chainFromCompleteArbitraryPatternpathLocked_isNodeTotallyHomomorphic,
				chainFromCompleteArbitraryPatternpathLocked_isEdgeTotallyHomomorphic
			);

			chainFromCompleteArbitraryPatternpathLocked_node_beg.pointOfDefinition = null;
			chainFromCompleteArbitraryPatternpathLocked__sub0.PointOfDefinition = pat_chainFromCompleteArbitraryPatternpathLocked;

			patternGraph = pat_chainFromCompleteArbitraryPatternpathLocked;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_chainFromCompleteArbitraryPatternpathLocked curMatch = (Match_chainFromCompleteArbitraryPatternpathLocked)_curMatch;
			GRGEN_LGSP.LGSPNode node_beg = curMatch._node_beg;
			GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked subpattern__sub0 = curMatch.@__sub0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		static Rule_chainFromCompleteArbitraryPatternpathLocked() {
		}

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

		public class Match_chainFromCompleteArbitraryPatternpathLocked : GRGEN_LGSP.MatchListElement<Match_chainFromCompleteArbitraryPatternpathLocked>, IMatch_chainFromCompleteArbitraryPatternpathLocked
		{
			public GRGEN_LIBGR.INode node_beg { get { return (GRGEN_LIBGR.INode)_node_beg; } set { _node_beg = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_beg;
			public enum chainFromCompleteArbitraryPatternpathLocked_NodeNums { @beg, 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)chainFromCompleteArbitraryPatternpathLocked_NodeNums.@beg: return _node_beg;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "beg": return _node_beg;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "beg": _node_beg = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum chainFromCompleteArbitraryPatternpathLocked_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 chainFromCompleteArbitraryPatternpathLocked_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_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked @__sub0;
			public enum chainFromCompleteArbitraryPatternpathLocked_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)chainFromCompleteArbitraryPatternpathLocked_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 chainFromCompleteArbitraryPatternpathLocked_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 chainFromCompleteArbitraryPatternpathLocked_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 chainFromCompleteArbitraryPatternpathLocked_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_chainFromCompleteArbitraryPatternpathLocked.instance.pat_chainFromCompleteArbitraryPatternpathLocked; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_chainFromCompleteArbitraryPatternpathLocked(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_chainFromCompleteArbitraryPatternpathLocked(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_chainFromCompleteArbitraryPatternpathLocked nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_chainFromCompleteArbitraryPatternpathLocked cur = this;
				while(cur != null) {
					Match_chainFromCompleteArbitraryPatternpathLocked next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_chainFromCompleteArbitraryPatternpathLocked that)
			{
				_node_beg = that._node_beg;
				@__sub0 = that.@__sub0;
			}

			public Match_chainFromCompleteArbitraryPatternpathLocked(Match_chainFromCompleteArbitraryPatternpathLocked that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_chainFromCompleteArbitraryPatternpathLocked that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_beg = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_beg];
				@__sub0 = new GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked(that.@__sub0, oldToNewMap);
			}

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

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


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


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

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked instanceBearingAttributeForSearch_chainFromCompleteArbitraryPatternpathLocked = new GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.Match_chainFromCompleteArbitraryPatternpathLocked();
		public static List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> Array_chainFromCompleteArbitraryPatternpathLocked_groupBy_beg(List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_beg)) {
					seenValues[list[pos].@node_beg].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> tempList = new List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_beg, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> newList = new List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked>();
			foreach(List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> Array_chainFromCompleteArbitraryPatternpathLocked_keepOneForEachBy_beg(List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> list)
		{
			List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> newList = new List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_beg)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_beg, null);
				}
			}
			return newList;
		}
		public static int Array_chainFromCompleteArbitraryPatternpathLocked_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromCompleteArbitraryPatternpathLocked_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromCompleteArbitraryPatternpathLocked_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromCompleteArbitraryPatternpathLocked_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
	}

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

		public static GRGEN_LIBGR.NodeType[] chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg_AllowedTypes = null;
		public static bool[] chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg_IsAllowedType = null;
		public enum chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_NodeNums { @beg, };
		public enum chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_EdgeNums { };
		public enum chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_VariableNums { };
		public enum chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_SubNums { @_sub0, };
		public enum chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_AltNums { };
		public enum chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards;


		private Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards()
			: base("chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg", },
				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_Recursive.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards+IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards",
				"de.unika.ipd.grGen.Action_Recursive.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards+Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards"
			)
		{
		}
		private void initialize()
		{
			bool[,] chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg", "beg", chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg_AllowedTypes, chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			pat_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards = new GRGEN_LGSP.PatternGraph(
				"chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards",
				"",
				null, "chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards",
				false, false,
				new GRGEN_LGSP.PatternNode[] { chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards__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] ,
				chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_isNodeHomomorphicGlobal,
				chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_isEdgeHomomorphicGlobal,
				chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_isNodeTotallyHomomorphic,
				chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_isEdgeTotallyHomomorphic
			);

			chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg.pointOfDefinition = null;
			chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards__sub0.PointOfDefinition = pat_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards;

			patternGraph = pat_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards curMatch = (Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards)_curMatch;
			GRGEN_LGSP.LGSPNode node_beg = curMatch._node_beg;
			GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards subpattern__sub0 = curMatch.@__sub0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		static Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards() {
		}

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

		public class Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards : GRGEN_LGSP.MatchListElement<Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards>, IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards
		{
			public GRGEN_LIBGR.INode node_beg { get { return (GRGEN_LIBGR.INode)_node_beg; } set { _node_beg = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_beg;
			public enum chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_NodeNums { @beg, 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)chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_NodeNums.@beg: return _node_beg;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "beg": return _node_beg;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "beg": _node_beg = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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 chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards @__sub0;
			public enum chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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)chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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 chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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 chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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 chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.instance.pat_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards cur = this;
				while(cur != null) {
					Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards that)
			{
				_node_beg = that._node_beg;
				@__sub0 = that.@__sub0;
			}

			public Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards(Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_beg = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_beg];
				@__sub0 = new GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards(that.@__sub0, oldToNewMap);
			}

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

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


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


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

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards instanceBearingAttributeForSearch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards = new GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards();
		public static List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> Array_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_groupBy_beg(List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_beg)) {
					seenValues[list[pos].@node_beg].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> tempList = new List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_beg, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> newList = new List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards>();
			foreach(List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> Array_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_keepOneForEachBy_beg(List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> list)
		{
			List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> newList = new List<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_beg)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_beg, null);
				}
			}
			return newList;
		}
		public static int Array_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
	}

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

		public enum createBlowball_NodeNums { };
		public enum createBlowball_EdgeNums { };
		public enum createBlowball_VariableNums { };
		public enum createBlowball_SubNums { };
		public enum createBlowball_AltNums { };
		public enum createBlowball_IterNums { };





		public GRGEN_LGSP.PatternGraph pat_createBlowball;


		private Rule_createBlowball()
			: base("createBlowball",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, },
				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_Recursive.Rule_createBlowball+IMatch_createBlowball",
				"de.unika.ipd.grGen.Action_Recursive.Rule_createBlowball+Match_createBlowball"
			)
		{
		}
		private void initialize()
		{
			bool[,] createBlowball_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] createBlowball_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] createBlowball_isNodeTotallyHomomorphic = new bool[0];
			bool[] createBlowball_isEdgeTotallyHomomorphic = new bool[0];
			pat_createBlowball = new GRGEN_LGSP.PatternGraph(
				"createBlowball",
				"",
				null, "createBlowball",
				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] ,
				createBlowball_isNodeHomomorphicGlobal,
				createBlowball_isEdgeHomomorphicGlobal,
				createBlowball_isNodeTotallyHomomorphic,
				createBlowball_isEdgeTotallyHomomorphic
			);


			patternGraph = pat_createBlowball;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch, out GRGEN_LIBGR.INode output_0)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_createBlowball curMatch = (Match_createBlowball)_curMatch;
			graph.SettingAddedNodeNames( createBlowball_addedNodeNames );
			GRGEN_MODEL.@Node node_head = GRGEN_MODEL.@Node.CreateNode(graph);
			GRGEN_MODEL.@Node node__node0 = GRGEN_MODEL.@Node.CreateNode(graph);
			GRGEN_MODEL.@Node node__node1 = GRGEN_MODEL.@Node.CreateNode(graph);
			GRGEN_MODEL.@Node node__node2 = GRGEN_MODEL.@Node.CreateNode(graph);
			GRGEN_MODEL.@Node node__node3 = GRGEN_MODEL.@Node.CreateNode(graph);
			graph.SettingAddedEdgeNames( createBlowball_addedEdgeNames );
			GRGEN_MODEL.@Edge edge__edge0 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_head, node__node0);
			GRGEN_MODEL.@Edge edge__edge1 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_head, node__node1);
			GRGEN_MODEL.@Edge edge__edge2 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_head, node__node2);
			GRGEN_MODEL.@Edge edge__edge3 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_head, node__node3);
			actionEnv.SelectedMatchRewritten();
			output_0 = (GRGEN_LIBGR.INode)(node_head);
			return;
		}
		private static string[] createBlowball_addedNodeNames = new string[] { "head", "_node0", "_node1", "_node2", "_node3" };
		private static string[] createBlowball_addedEdgeNames = new string[] { "_edge0", "_edge1", "_edge2", "_edge3" };

		static Rule_createBlowball() {
		}

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

		public class Match_createBlowball : GRGEN_LGSP.MatchListElement<Match_createBlowball>, IMatch_createBlowball
		{
			public enum createBlowball_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 createBlowball_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 createBlowball_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 createBlowball_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 createBlowball_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 createBlowball_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 createBlowball_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_createBlowball.instance.pat_createBlowball; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_createBlowball(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_createBlowball(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_createBlowball nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_createBlowball cur = this;
				while(cur != null) {
					Match_createBlowball next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_createBlowball that)
			{
			}

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

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

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


		public class Extractor
		{
		}


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

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_createBlowball.IMatch_createBlowball instanceBearingAttributeForSearch_createBlowball = new GRGEN_ACTIONS.Rule_createBlowball.Match_createBlowball();
	}

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

		public static GRGEN_LIBGR.NodeType[] blowball_node_head_AllowedTypes = null;
		public static bool[] blowball_node_head_IsAllowedType = null;
		public enum blowball_NodeNums { @head, };
		public enum blowball_EdgeNums { };
		public enum blowball_VariableNums { };
		public enum blowball_SubNums { @_sub0, };
		public enum blowball_AltNums { };
		public enum blowball_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_blowball;


		private Rule_blowball()
			: base("blowball",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "blowball_node_head", },
				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_Recursive.Rule_blowball+IMatch_blowball",
				"de.unika.ipd.grGen.Action_Recursive.Rule_blowball+Match_blowball"
			)
		{
		}
		private void initialize()
		{
			bool[,] blowball_isNodeHomomorphicGlobal = new bool[1, 1] {
				{ false, },
			};
			bool[,] blowball_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] blowball_isNodeTotallyHomomorphic = new bool[1] { false,  };
			bool[] blowball_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode blowball_node_head = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "blowball_node_head", "head", blowball_node_head_AllowedTypes, blowball_node_head_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding blowball__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_Blowball.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("blowball_node_head"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "blowball_node_head" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { blowball_node_head }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			pat_blowball = new GRGEN_LGSP.PatternGraph(
				"blowball",
				"",
				null, "blowball",
				false, false,
				new GRGEN_LGSP.PatternNode[] { blowball_node_head }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { blowball__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] ,
				blowball_isNodeHomomorphicGlobal,
				blowball_isEdgeHomomorphicGlobal,
				blowball_isNodeTotallyHomomorphic,
				blowball_isEdgeTotallyHomomorphic
			);

			blowball_node_head.pointOfDefinition = null;
			blowball__sub0.PointOfDefinition = pat_blowball;

			patternGraph = pat_blowball;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_blowball curMatch = (Match_blowball)_curMatch;
			GRGEN_LGSP.LGSPNode node_head = curMatch._node_head;
			GRGEN_ACTIONS.Pattern_Blowball.Match_Blowball subpattern__sub0 = curMatch.@__sub0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		static Rule_blowball() {
		}

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

		public class Match_blowball : GRGEN_LGSP.MatchListElement<Match_blowball>, IMatch_blowball
		{
			public GRGEN_LIBGR.INode node_head { get { return (GRGEN_LIBGR.INode)_node_head; } set { _node_head = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_head;
			public enum blowball_NodeNums { @head, 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)blowball_NodeNums.@head: return _node_head;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "head": return _node_head;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "head": _node_head = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum blowball_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 blowball_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_Blowball.Match_Blowball @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_Blowball.Match_Blowball @__sub0;
			public enum blowball_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)blowball_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 blowball_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 blowball_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 blowball_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_blowball.instance.pat_blowball; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_blowball(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_blowball(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_blowball nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_blowball cur = this;
				while(cur != null) {
					Match_blowball next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_blowball that)
			{
				_node_head = that._node_head;
				@__sub0 = that.@__sub0;
			}

			public Match_blowball(Match_blowball that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_blowball that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_head = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_head];
				@__sub0 = new GRGEN_ACTIONS.Pattern_Blowball.Match_Blowball(that.@__sub0, oldToNewMap);
			}

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

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


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


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

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_blowball.IMatch_blowball instanceBearingAttributeForSearch_blowball = new GRGEN_ACTIONS.Rule_blowball.Match_blowball();
		public static List<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball> Array_blowball_groupBy_head(List<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_head)) {
					seenValues[list[pos].@node_head].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball> tempList = new List<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_head, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball> newList = new List<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball>();
			foreach(List<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball> Array_blowball_keepOneForEachBy_head(List<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball> list)
		{
			List<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball> newList = new List<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_blowball.IMatch_blowball element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_head)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_head, null);
				}
			}
			return newList;
		}
		public static int Array_blowball_indexOfBy_head(IList<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_head.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_blowball_indexOfBy_head(IList<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_head.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_blowball_lastIndexOfBy_head(IList<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_head.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_blowball_lastIndexOfBy_head(IList<GRGEN_ACTIONS.Rule_blowball.IMatch_blowball> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_head.Equals(entry))
					return i;
			return -1;
		}
	}

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

		public static GRGEN_LIBGR.NodeType[] reverseChainFromTo_node_beg_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] reverseChainFromTo_node_end_AllowedTypes = null;
		public static bool[] reverseChainFromTo_node_beg_IsAllowedType = null;
		public static bool[] reverseChainFromTo_node_end_IsAllowedType = null;
		public enum reverseChainFromTo_NodeNums { @beg, @end, };
		public enum reverseChainFromTo_EdgeNums { };
		public enum reverseChainFromTo_VariableNums { };
		public enum reverseChainFromTo_SubNums { @_sub0, };
		public enum reverseChainFromTo_AltNums { };
		public enum reverseChainFromTo_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_reverseChainFromTo;


		private Rule_reverseChainFromTo()
			: base("reverseChainFromTo",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "reverseChainFromTo_node_beg", "reverseChainFromTo_node_end", },
				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_Recursive.Rule_reverseChainFromTo+IMatch_reverseChainFromTo",
				"de.unika.ipd.grGen.Action_Recursive.Rule_reverseChainFromTo+Match_reverseChainFromTo"
			)
		{
		}
		private void initialize()
		{
			bool[,] reverseChainFromTo_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] reverseChainFromTo_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] reverseChainFromTo_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] reverseChainFromTo_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode reverseChainFromTo_node_beg = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "reverseChainFromTo_node_beg", "beg", reverseChainFromTo_node_beg_AllowedTypes, reverseChainFromTo_node_beg_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode reverseChainFromTo_node_end = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "reverseChainFromTo_node_end", "end", reverseChainFromTo_node_end_AllowedTypes, reverseChainFromTo_node_end_IsAllowedType, 5.5F, 1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding reverseChainFromTo__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_ReverseChainFromTo.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("reverseChainFromTo_node_beg"),
					new GRGEN_EXPR.GraphEntityExpression("reverseChainFromTo_node_end"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "reverseChainFromTo_node_beg", "reverseChainFromTo_node_end" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { reverseChainFromTo_node_beg, reverseChainFromTo_node_end }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			pat_reverseChainFromTo = new GRGEN_LGSP.PatternGraph(
				"reverseChainFromTo",
				"",
				null, "reverseChainFromTo",
				false, false,
				new GRGEN_LGSP.PatternNode[] { reverseChainFromTo_node_beg, reverseChainFromTo_node_end }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { reverseChainFromTo__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[2, 2] {
					{ true, false, },
					{ false, true, },
				},
				new bool[0, 0] ,
				reverseChainFromTo_isNodeHomomorphicGlobal,
				reverseChainFromTo_isEdgeHomomorphicGlobal,
				reverseChainFromTo_isNodeTotallyHomomorphic,
				reverseChainFromTo_isEdgeTotallyHomomorphic
			);

			reverseChainFromTo_node_beg.pointOfDefinition = null;
			reverseChainFromTo_node_end.pointOfDefinition = null;
			reverseChainFromTo__sub0.PointOfDefinition = pat_reverseChainFromTo;

			patternGraph = pat_reverseChainFromTo;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_reverseChainFromTo curMatch = (Match_reverseChainFromTo)_curMatch;
			GRGEN_LGSP.LGSPNode node_beg = curMatch._node_beg;
			GRGEN_LGSP.LGSPNode node_end = curMatch._node_end;
			GRGEN_ACTIONS.Pattern_ReverseChainFromTo.Match_ReverseChainFromTo subpattern__sub0 = curMatch.@__sub0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		static Rule_reverseChainFromTo() {
		}

		public interface IMatch_reverseChainFromTo : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_LIBGR.INode node_beg { get; set; }
			GRGEN_LIBGR.INode node_end { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			@GRGEN_ACTIONS.Pattern_ReverseChainFromTo.Match_ReverseChainFromTo @_sub0 { get; }
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_reverseChainFromTo : GRGEN_LGSP.MatchListElement<Match_reverseChainFromTo>, IMatch_reverseChainFromTo
		{
			public GRGEN_LIBGR.INode node_beg { get { return (GRGEN_LIBGR.INode)_node_beg; } set { _node_beg = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_end { get { return (GRGEN_LIBGR.INode)_node_end; } set { _node_end = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_beg;
			public GRGEN_LGSP.LGSPNode _node_end;
			public enum reverseChainFromTo_NodeNums { @beg, @end, 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)reverseChainFromTo_NodeNums.@beg: return _node_beg;
				case (int)reverseChainFromTo_NodeNums.@end: return _node_end;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "beg": return _node_beg;
				case "end": return _node_end;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "beg": _node_beg = (GRGEN_LGSP.LGSPNode)value; break;
				case "end": _node_end = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum reverseChainFromTo_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 reverseChainFromTo_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_ReverseChainFromTo.Match_ReverseChainFromTo @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_ReverseChainFromTo.Match_ReverseChainFromTo @__sub0;
			public enum reverseChainFromTo_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)reverseChainFromTo_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 reverseChainFromTo_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 reverseChainFromTo_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 reverseChainFromTo_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_reverseChainFromTo.instance.pat_reverseChainFromTo; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_reverseChainFromTo(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_reverseChainFromTo(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_reverseChainFromTo nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_reverseChainFromTo cur = this;
				while(cur != null) {
					Match_reverseChainFromTo next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_reverseChainFromTo that)
			{
				_node_beg = that._node_beg;
				_node_end = that._node_end;
				@__sub0 = that.@__sub0;
			}

			public Match_reverseChainFromTo(Match_reverseChainFromTo that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_reverseChainFromTo that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_beg = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_beg];
				_node_end = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_end];
				@__sub0 = new GRGEN_ACTIONS.Pattern_ReverseChainFromTo.Match_ReverseChainFromTo(that.@__sub0, oldToNewMap);
			}

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

			public bool IsEqual(Match_reverseChainFromTo that)
			{
				if(that==null) return false;
				if(_node_beg != that._node_beg) return false;
				if(_node_end != that._node_end) return false;
				if(!@__sub0.IsEqual(that.@__sub0)) return false;
				return true;
			}
		}


		public class Extractor
		{
			public static List<GRGEN_LIBGR.INode> Extract_beg(List<IMatch_reverseChainFromTo> matchList)
			{
				List<GRGEN_LIBGR.INode> resultList = new List<GRGEN_LIBGR.INode>(matchList.Count);
				foreach(IMatch_reverseChainFromTo match in matchList)
					resultList.Add(match.node_beg);
				return resultList;
			}
			public static List<GRGEN_LIBGR.INode> Extract_end(List<IMatch_reverseChainFromTo> matchList)
			{
				List<GRGEN_LIBGR.INode> resultList = new List<GRGEN_LIBGR.INode>(matchList.Count);
				foreach(IMatch_reverseChainFromTo match in matchList)
					resultList.Add(match.node_end);
				return resultList;
			}
		}


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

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo instanceBearingAttributeForSearch_reverseChainFromTo = new GRGEN_ACTIONS.Rule_reverseChainFromTo.Match_reverseChainFromTo();
		public static List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> Array_reverseChainFromTo_groupBy_beg(List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_beg)) {
					seenValues[list[pos].@node_beg].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> tempList = new List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_beg, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> newList = new List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo>();
			foreach(List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> Array_reverseChainFromTo_keepOneForEachBy_beg(List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> list)
		{
			List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> newList = new List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_beg)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_beg, null);
				}
			}
			return newList;
		}
		public static int Array_reverseChainFromTo_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_reverseChainFromTo_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_reverseChainFromTo_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_reverseChainFromTo_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> Array_reverseChainFromTo_groupBy_end(List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_end)) {
					seenValues[list[pos].@node_end].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> tempList = new List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_end, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> newList = new List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo>();
			foreach(List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> Array_reverseChainFromTo_keepOneForEachBy_end(List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> list)
		{
			List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> newList = new List<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_end)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_end, null);
				}
			}
			return newList;
		}
		public static int Array_reverseChainFromTo_indexOfBy_end(IList<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_reverseChainFromTo_indexOfBy_end(IList<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_reverseChainFromTo_lastIndexOfBy_end(IList<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_reverseChainFromTo_lastIndexOfBy_end(IList<GRGEN_ACTIONS.Rule_reverseChainFromTo.IMatch_reverseChainFromTo> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
	}

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

		public enum createReverseChain_NodeNums { };
		public enum createReverseChain_EdgeNums { };
		public enum createReverseChain_VariableNums { };
		public enum createReverseChain_SubNums { };
		public enum createReverseChain_AltNums { };
		public enum createReverseChain_IterNums { };





		public GRGEN_LGSP.PatternGraph pat_createReverseChain;


		private Rule_createReverseChain()
			: base("createReverseChain",
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, GRGEN_MODEL.NodeType_Node.typeVar, },
				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_Recursive.Rule_createReverseChain+IMatch_createReverseChain",
				"de.unika.ipd.grGen.Action_Recursive.Rule_createReverseChain+Match_createReverseChain"
			)
		{
		}
		private void initialize()
		{
			bool[,] createReverseChain_isNodeHomomorphicGlobal = new bool[0, 0];
			bool[,] createReverseChain_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] createReverseChain_isNodeTotallyHomomorphic = new bool[0];
			bool[] createReverseChain_isEdgeTotallyHomomorphic = new bool[0];
			pat_createReverseChain = new GRGEN_LGSP.PatternGraph(
				"createReverseChain",
				"",
				null, "createReverseChain",
				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] ,
				createReverseChain_isNodeHomomorphicGlobal,
				createReverseChain_isEdgeHomomorphicGlobal,
				createReverseChain_isNodeTotallyHomomorphic,
				createReverseChain_isEdgeTotallyHomomorphic
			);


			patternGraph = pat_createReverseChain;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch, out GRGEN_LIBGR.INode output_0, out GRGEN_LIBGR.INode output_1)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_createReverseChain curMatch = (Match_createReverseChain)_curMatch;
			graph.SettingAddedNodeNames( createReverseChain_addedNodeNames );
			GRGEN_MODEL.@Node node__node0 = GRGEN_MODEL.@Node.CreateNode(graph);
			GRGEN_MODEL.@Node node_beg = GRGEN_MODEL.@Node.CreateNode(graph);
			GRGEN_MODEL.@Node node__node1 = GRGEN_MODEL.@Node.CreateNode(graph);
			GRGEN_MODEL.@Node node_end = GRGEN_MODEL.@Node.CreateNode(graph);
			graph.SettingAddedEdgeNames( createReverseChain_addedEdgeNames );
			GRGEN_MODEL.@Edge edge__edge0 = GRGEN_MODEL.@Edge.CreateEdge(graph, node__node0, node_beg);
			GRGEN_MODEL.@Edge edge__edge1 = GRGEN_MODEL.@Edge.CreateEdge(graph, node__node1, node__node0);
			GRGEN_MODEL.@Edge edge__edge2 = GRGEN_MODEL.@Edge.CreateEdge(graph, node_end, node__node1);
			actionEnv.SelectedMatchRewritten();
			output_0 = (GRGEN_LIBGR.INode)(node_beg);
			output_1 = (GRGEN_LIBGR.INode)(node_end);
			return;
		}
		private static string[] createReverseChain_addedNodeNames = new string[] { "_node0", "beg", "_node1", "end" };
		private static string[] createReverseChain_addedEdgeNames = new string[] { "_edge0", "_edge1", "_edge2" };

		static Rule_createReverseChain() {
		}

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

		public class Match_createReverseChain : GRGEN_LGSP.MatchListElement<Match_createReverseChain>, IMatch_createReverseChain
		{
			public enum createReverseChain_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 createReverseChain_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 createReverseChain_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 createReverseChain_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 createReverseChain_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 createReverseChain_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 createReverseChain_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_createReverseChain.instance.pat_createReverseChain; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_createReverseChain(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_createReverseChain(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_createReverseChain nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_createReverseChain cur = this;
				while(cur != null) {
					Match_createReverseChain next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_createReverseChain that)
			{
			}

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

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

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


		public class Extractor
		{
		}


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

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_createReverseChain.IMatch_createReverseChain instanceBearingAttributeForSearch_createReverseChain = new GRGEN_ACTIONS.Rule_createReverseChain.Match_createReverseChain();
	}

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

		public static GRGEN_LIBGR.NodeType[] chainFromToReverse_node_beg_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] chainFromToReverse_node_end_AllowedTypes = null;
		public static bool[] chainFromToReverse_node_beg_IsAllowedType = null;
		public static bool[] chainFromToReverse_node_end_IsAllowedType = null;
		public enum chainFromToReverse_NodeNums { @beg, @end, };
		public enum chainFromToReverse_EdgeNums { };
		public enum chainFromToReverse_VariableNums { };
		public enum chainFromToReverse_SubNums { @cftr, };
		public enum chainFromToReverse_AltNums { };
		public enum chainFromToReverse_IterNums { };





		public GRGEN_LGSP.PatternGraph pat_chainFromToReverse;


		private Rule_chainFromToReverse()
			: base("chainFromToReverse",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "chainFromToReverse_node_beg", "chainFromToReverse_node_end", },
				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_Recursive.Rule_chainFromToReverse+IMatch_chainFromToReverse",
				"de.unika.ipd.grGen.Action_Recursive.Rule_chainFromToReverse+Match_chainFromToReverse"
			)
		{
		}
		private void initialize()
		{
			bool[,] chainFromToReverse_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] chainFromToReverse_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] chainFromToReverse_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] chainFromToReverse_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode chainFromToReverse_node_beg = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "chainFromToReverse_node_beg", "beg", chainFromToReverse_node_beg_AllowedTypes, chainFromToReverse_node_beg_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode chainFromToReverse_node_end = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "chainFromToReverse_node_end", "end", chainFromToReverse_node_end_AllowedTypes, chainFromToReverse_node_end_IsAllowedType, 5.5F, 1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding chainFromToReverse_cftr = new GRGEN_LGSP.PatternGraphEmbedding("cftr", Pattern_ChainFromToReverse.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("chainFromToReverse_node_beg"),
					new GRGEN_EXPR.GraphEntityExpression("chainFromToReverse_node_end"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "chainFromToReverse_node_beg", "chainFromToReverse_node_end" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { chainFromToReverse_node_beg, chainFromToReverse_node_end }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			pat_chainFromToReverse = new GRGEN_LGSP.PatternGraph(
				"chainFromToReverse",
				"",
				null, "chainFromToReverse",
				false, false,
				new GRGEN_LGSP.PatternNode[] { chainFromToReverse_node_beg, chainFromToReverse_node_end }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { chainFromToReverse_cftr }, 
				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[0, 0] ,
				chainFromToReverse_isNodeHomomorphicGlobal,
				chainFromToReverse_isEdgeHomomorphicGlobal,
				chainFromToReverse_isNodeTotallyHomomorphic,
				chainFromToReverse_isEdgeTotallyHomomorphic
			);

			chainFromToReverse_node_beg.pointOfDefinition = null;
			chainFromToReverse_node_end.pointOfDefinition = null;
			chainFromToReverse_cftr.PointOfDefinition = pat_chainFromToReverse;

			patternGraph = pat_chainFromToReverse;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_chainFromToReverse curMatch = (Match_chainFromToReverse)_curMatch;
			GRGEN_ACTIONS.Pattern_ChainFromToReverse.Match_ChainFromToReverse subpattern_cftr = curMatch.@_cftr;
			graph.SettingAddedNodeNames( chainFromToReverse_addedNodeNames );
			{ // cftr
				GRGEN_ACTIONS.Pattern_ChainFromToReverse.Instance.ChainFromToReverse_Modify(actionEnv, subpattern_cftr);
			}
			graph.SettingAddedEdgeNames( chainFromToReverse_addedEdgeNames );
			actionEnv.SelectedMatchRewritten();
			return;
		}
		private static string[] chainFromToReverse_addedNodeNames = new string[] {  };
		private static string[] chainFromToReverse_addedEdgeNames = new string[] {  };

		static Rule_chainFromToReverse() {
		}

		public interface IMatch_chainFromToReverse : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_LIBGR.INode node_beg { get; set; }
			GRGEN_LIBGR.INode node_end { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			@GRGEN_ACTIONS.Pattern_ChainFromToReverse.Match_ChainFromToReverse @cftr { get; }
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_chainFromToReverse : GRGEN_LGSP.MatchListElement<Match_chainFromToReverse>, IMatch_chainFromToReverse
		{
			public GRGEN_LIBGR.INode node_beg { get { return (GRGEN_LIBGR.INode)_node_beg; } set { _node_beg = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_end { get { return (GRGEN_LIBGR.INode)_node_end; } set { _node_end = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_beg;
			public GRGEN_LGSP.LGSPNode _node_end;
			public enum chainFromToReverse_NodeNums { @beg, @end, 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)chainFromToReverse_NodeNums.@beg: return _node_beg;
				case (int)chainFromToReverse_NodeNums.@end: return _node_end;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "beg": return _node_beg;
				case "end": return _node_end;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "beg": _node_beg = (GRGEN_LGSP.LGSPNode)value; break;
				case "end": _node_end = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum chainFromToReverse_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 chainFromToReverse_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_ChainFromToReverse.Match_ChainFromToReverse @cftr { get { return @_cftr; } }
			public @GRGEN_ACTIONS.Pattern_ChainFromToReverse.Match_ChainFromToReverse @_cftr;
			public enum chainFromToReverse_SubNums { @cftr, 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)chainFromToReverse_SubNums.@cftr: return _cftr;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				case "cftr": return _cftr;
				default: return null;
				}
			}

			public enum chainFromToReverse_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 chainFromToReverse_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 chainFromToReverse_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_chainFromToReverse.instance.pat_chainFromToReverse; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_chainFromToReverse(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_chainFromToReverse(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_chainFromToReverse nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_chainFromToReverse cur = this;
				while(cur != null) {
					Match_chainFromToReverse next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_chainFromToReverse that)
			{
				_node_beg = that._node_beg;
				_node_end = that._node_end;
				@_cftr = that.@_cftr;
			}

			public Match_chainFromToReverse(Match_chainFromToReverse that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_chainFromToReverse that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_beg = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_beg];
				_node_end = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_end];
				@_cftr = new GRGEN_ACTIONS.Pattern_ChainFromToReverse.Match_ChainFromToReverse(that.@_cftr, oldToNewMap);
			}

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

			public bool IsEqual(Match_chainFromToReverse that)
			{
				if(that==null) return false;
				if(_node_beg != that._node_beg) return false;
				if(_node_end != that._node_end) return false;
				if(!@_cftr.IsEqual(that.@_cftr)) return false;
				return true;
			}
		}


		public class Extractor
		{
			public static List<GRGEN_LIBGR.INode> Extract_beg(List<IMatch_chainFromToReverse> matchList)
			{
				List<GRGEN_LIBGR.INode> resultList = new List<GRGEN_LIBGR.INode>(matchList.Count);
				foreach(IMatch_chainFromToReverse match in matchList)
					resultList.Add(match.node_beg);
				return resultList;
			}
			public static List<GRGEN_LIBGR.INode> Extract_end(List<IMatch_chainFromToReverse> matchList)
			{
				List<GRGEN_LIBGR.INode> resultList = new List<GRGEN_LIBGR.INode>(matchList.Count);
				foreach(IMatch_chainFromToReverse match in matchList)
					resultList.Add(match.node_end);
				return resultList;
			}
		}


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

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse instanceBearingAttributeForSearch_chainFromToReverse = new GRGEN_ACTIONS.Rule_chainFromToReverse.Match_chainFromToReverse();
		public static List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> Array_chainFromToReverse_groupBy_beg(List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_beg)) {
					seenValues[list[pos].@node_beg].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> tempList = new List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_beg, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> newList = new List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse>();
			foreach(List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> Array_chainFromToReverse_keepOneForEachBy_beg(List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> list)
		{
			List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> newList = new List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_beg)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_beg, null);
				}
			}
			return newList;
		}
		public static int Array_chainFromToReverse_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromToReverse_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromToReverse_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromToReverse_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> Array_chainFromToReverse_groupBy_end(List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_end)) {
					seenValues[list[pos].@node_end].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> tempList = new List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_end, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> newList = new List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse>();
			foreach(List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> Array_chainFromToReverse_keepOneForEachBy_end(List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> list)
		{
			List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> newList = new List<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_end)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_end, null);
				}
			}
			return newList;
		}
		public static int Array_chainFromToReverse_indexOfBy_end(IList<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromToReverse_indexOfBy_end(IList<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromToReverse_lastIndexOfBy_end(IList<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromToReverse_lastIndexOfBy_end(IList<GRGEN_ACTIONS.Rule_chainFromToReverse.IMatch_chainFromToReverse> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
	}

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

		public static GRGEN_LIBGR.NodeType[] chainFromToReverseToCommon_node_beg_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] chainFromToReverseToCommon_node_end_AllowedTypes = null;
		public static bool[] chainFromToReverseToCommon_node_beg_IsAllowedType = null;
		public static bool[] chainFromToReverseToCommon_node_end_IsAllowedType = null;
		public enum chainFromToReverseToCommon_NodeNums { @beg, @end, };
		public enum chainFromToReverseToCommon_EdgeNums { };
		public enum chainFromToReverseToCommon_VariableNums { };
		public enum chainFromToReverseToCommon_SubNums { @cftrtc, };
		public enum chainFromToReverseToCommon_AltNums { };
		public enum chainFromToReverseToCommon_IterNums { };





		public GRGEN_LGSP.PatternGraph pat_chainFromToReverseToCommon;


		private Rule_chainFromToReverseToCommon()
			: base("chainFromToReverseToCommon",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "chainFromToReverseToCommon_node_beg", "chainFromToReverseToCommon_node_end", },
				new GRGEN_LIBGR.GrGenType[] { },
				new string[] { },
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, },
				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_Recursive.Rule_chainFromToReverseToCommon+IMatch_chainFromToReverseToCommon",
				"de.unika.ipd.grGen.Action_Recursive.Rule_chainFromToReverseToCommon+Match_chainFromToReverseToCommon"
			)
		{
		}
		private void initialize()
		{
			bool[,] chainFromToReverseToCommon_isNodeHomomorphicGlobal = new bool[2, 2] {
				{ false, false, },
				{ false, false, },
			};
			bool[,] chainFromToReverseToCommon_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] chainFromToReverseToCommon_isNodeTotallyHomomorphic = new bool[2] { false, false,  };
			bool[] chainFromToReverseToCommon_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode chainFromToReverseToCommon_node_beg = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "chainFromToReverseToCommon_node_beg", "beg", chainFromToReverseToCommon_node_beg_AllowedTypes, chainFromToReverseToCommon_node_beg_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode chainFromToReverseToCommon_node_end = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "chainFromToReverseToCommon_node_end", "end", chainFromToReverseToCommon_node_end_AllowedTypes, chainFromToReverseToCommon_node_end_IsAllowedType, 5.5F, 1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding chainFromToReverseToCommon_cftrtc = new GRGEN_LGSP.PatternGraphEmbedding("cftrtc", Pattern_ChainFromToReverseToCommon.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("chainFromToReverseToCommon_node_beg"),
					new GRGEN_EXPR.GraphEntityExpression("chainFromToReverseToCommon_node_end"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "chainFromToReverseToCommon_node_beg", "chainFromToReverseToCommon_node_end" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { chainFromToReverseToCommon_node_beg, chainFromToReverseToCommon_node_end }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			pat_chainFromToReverseToCommon = new GRGEN_LGSP.PatternGraph(
				"chainFromToReverseToCommon",
				"",
				null, "chainFromToReverseToCommon",
				false, false,
				new GRGEN_LGSP.PatternNode[] { chainFromToReverseToCommon_node_beg, chainFromToReverseToCommon_node_end }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { chainFromToReverseToCommon_cftrtc }, 
				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[0, 0] ,
				chainFromToReverseToCommon_isNodeHomomorphicGlobal,
				chainFromToReverseToCommon_isEdgeHomomorphicGlobal,
				chainFromToReverseToCommon_isNodeTotallyHomomorphic,
				chainFromToReverseToCommon_isEdgeTotallyHomomorphic
			);

			chainFromToReverseToCommon_node_beg.pointOfDefinition = null;
			chainFromToReverseToCommon_node_end.pointOfDefinition = null;
			chainFromToReverseToCommon_cftrtc.PointOfDefinition = pat_chainFromToReverseToCommon;

			patternGraph = pat_chainFromToReverseToCommon;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch, out GRGEN_LIBGR.INode output_0)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_chainFromToReverseToCommon curMatch = (Match_chainFromToReverseToCommon)_curMatch;
			GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon subpattern_cftrtc = curMatch.@_cftrtc;
			graph.SettingAddedNodeNames( chainFromToReverseToCommon_addedNodeNames );
			GRGEN_MODEL.@Node node_common = GRGEN_MODEL.@Node.CreateNode(graph);
			{ // cftrtc
				GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Instance.ChainFromToReverseToCommon_Modify(actionEnv, subpattern_cftrtc, (GRGEN_LGSP.LGSPNode)(node_common));
			}
			graph.SettingAddedEdgeNames( chainFromToReverseToCommon_addedEdgeNames );
			actionEnv.SelectedMatchRewritten();
			output_0 = (GRGEN_LIBGR.INode)(node_common);
			return;
		}
		private static string[] chainFromToReverseToCommon_addedNodeNames = new string[] { "common" };
		private static string[] chainFromToReverseToCommon_addedEdgeNames = new string[] {  };

		static Rule_chainFromToReverseToCommon() {
		}

		public interface IMatch_chainFromToReverseToCommon : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_LIBGR.INode node_beg { get; set; }
			GRGEN_LIBGR.INode node_end { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			@GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon @cftrtc { get; }
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_chainFromToReverseToCommon : GRGEN_LGSP.MatchListElement<Match_chainFromToReverseToCommon>, IMatch_chainFromToReverseToCommon
		{
			public GRGEN_LIBGR.INode node_beg { get { return (GRGEN_LIBGR.INode)_node_beg; } set { _node_beg = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_end { get { return (GRGEN_LIBGR.INode)_node_end; } set { _node_end = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_beg;
			public GRGEN_LGSP.LGSPNode _node_end;
			public enum chainFromToReverseToCommon_NodeNums { @beg, @end, 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)chainFromToReverseToCommon_NodeNums.@beg: return _node_beg;
				case (int)chainFromToReverseToCommon_NodeNums.@end: return _node_end;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "beg": return _node_beg;
				case "end": return _node_end;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "beg": _node_beg = (GRGEN_LGSP.LGSPNode)value; break;
				case "end": _node_end = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum chainFromToReverseToCommon_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 chainFromToReverseToCommon_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_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon @cftrtc { get { return @_cftrtc; } }
			public @GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon @_cftrtc;
			public enum chainFromToReverseToCommon_SubNums { @cftrtc, 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)chainFromToReverseToCommon_SubNums.@cftrtc: return _cftrtc;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.IMatch getEmbeddedGraph(string name)
			{
				switch(name) {
				case "cftrtc": return _cftrtc;
				default: return null;
				}
			}

			public enum chainFromToReverseToCommon_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 chainFromToReverseToCommon_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 chainFromToReverseToCommon_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_chainFromToReverseToCommon.instance.pat_chainFromToReverseToCommon; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_chainFromToReverseToCommon(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_chainFromToReverseToCommon(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_chainFromToReverseToCommon nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_chainFromToReverseToCommon cur = this;
				while(cur != null) {
					Match_chainFromToReverseToCommon next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_chainFromToReverseToCommon that)
			{
				_node_beg = that._node_beg;
				_node_end = that._node_end;
				@_cftrtc = that.@_cftrtc;
			}

			public Match_chainFromToReverseToCommon(Match_chainFromToReverseToCommon that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_chainFromToReverseToCommon that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_beg = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_beg];
				_node_end = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_end];
				@_cftrtc = new GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon(that.@_cftrtc, oldToNewMap);
			}

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

			public bool IsEqual(Match_chainFromToReverseToCommon that)
			{
				if(that==null) return false;
				if(_node_beg != that._node_beg) return false;
				if(_node_end != that._node_end) return false;
				if(!@_cftrtc.IsEqual(that.@_cftrtc)) return false;
				return true;
			}
		}


		public class Extractor
		{
			public static List<GRGEN_LIBGR.INode> Extract_beg(List<IMatch_chainFromToReverseToCommon> matchList)
			{
				List<GRGEN_LIBGR.INode> resultList = new List<GRGEN_LIBGR.INode>(matchList.Count);
				foreach(IMatch_chainFromToReverseToCommon match in matchList)
					resultList.Add(match.node_beg);
				return resultList;
			}
			public static List<GRGEN_LIBGR.INode> Extract_end(List<IMatch_chainFromToReverseToCommon> matchList)
			{
				List<GRGEN_LIBGR.INode> resultList = new List<GRGEN_LIBGR.INode>(matchList.Count);
				foreach(IMatch_chainFromToReverseToCommon match in matchList)
					resultList.Add(match.node_end);
				return resultList;
			}
		}


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

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon instanceBearingAttributeForSearch_chainFromToReverseToCommon = new GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.Match_chainFromToReverseToCommon();
		public static List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> Array_chainFromToReverseToCommon_groupBy_beg(List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_beg)) {
					seenValues[list[pos].@node_beg].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> tempList = new List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_beg, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> newList = new List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon>();
			foreach(List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> Array_chainFromToReverseToCommon_keepOneForEachBy_beg(List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> list)
		{
			List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> newList = new List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_beg)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_beg, null);
				}
			}
			return newList;
		}
		public static int Array_chainFromToReverseToCommon_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromToReverseToCommon_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromToReverseToCommon_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromToReverseToCommon_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> Array_chainFromToReverseToCommon_groupBy_end(List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_end)) {
					seenValues[list[pos].@node_end].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> tempList = new List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_end, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> newList = new List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon>();
			foreach(List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> Array_chainFromToReverseToCommon_keepOneForEachBy_end(List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> list)
		{
			List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> newList = new List<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_end)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_end, null);
				}
			}
			return newList;
		}
		public static int Array_chainFromToReverseToCommon_indexOfBy_end(IList<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromToReverseToCommon_indexOfBy_end(IList<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromToReverseToCommon_lastIndexOfBy_end(IList<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_chainFromToReverseToCommon_lastIndexOfBy_end(IList<GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
	}

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

		public static GRGEN_LIBGR.NodeType[] reverseChainFromToToCommon_node_beg_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] reverseChainFromToToCommon_node_end_AllowedTypes = null;
		public static GRGEN_LIBGR.NodeType[] reverseChainFromToToCommon_node_common_AllowedTypes = null;
		public static bool[] reverseChainFromToToCommon_node_beg_IsAllowedType = null;
		public static bool[] reverseChainFromToToCommon_node_end_IsAllowedType = null;
		public static bool[] reverseChainFromToToCommon_node_common_IsAllowedType = null;
		public enum reverseChainFromToToCommon_NodeNums { @beg, @end, @common, };
		public enum reverseChainFromToToCommon_EdgeNums { };
		public enum reverseChainFromToToCommon_VariableNums { };
		public enum reverseChainFromToToCommon_SubNums { @_sub0, };
		public enum reverseChainFromToToCommon_AltNums { };
		public enum reverseChainFromToToCommon_IterNums { };



		public GRGEN_LGSP.PatternGraph pat_reverseChainFromToToCommon;


		private Rule_reverseChainFromToToCommon()
			: base("reverseChainFromToToCommon",
				new GRGEN_LIBGR.GrGenType[] { GRGEN_MODEL.NodeType_Node.typeVar, GRGEN_MODEL.NodeType_Node.typeVar, GRGEN_MODEL.NodeType_Node.typeVar, },
				new string[] { "reverseChainFromToToCommon_node_beg", "reverseChainFromToToCommon_node_end", "reverseChainFromToToCommon_node_common", },
				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_Recursive.Rule_reverseChainFromToToCommon+IMatch_reverseChainFromToToCommon",
				"de.unika.ipd.grGen.Action_Recursive.Rule_reverseChainFromToToCommon+Match_reverseChainFromToToCommon"
			)
		{
		}
		private void initialize()
		{
			bool[,] reverseChainFromToToCommon_isNodeHomomorphicGlobal = new bool[3, 3] {
				{ false, false, false, },
				{ false, false, false, },
				{ false, false, false, },
			};
			bool[,] reverseChainFromToToCommon_isEdgeHomomorphicGlobal = new bool[0, 0];
			bool[] reverseChainFromToToCommon_isNodeTotallyHomomorphic = new bool[3] { false, false, false,  };
			bool[] reverseChainFromToToCommon_isEdgeTotallyHomomorphic = new bool[0];
			GRGEN_LGSP.PatternNode reverseChainFromToToCommon_node_beg = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "reverseChainFromToToCommon_node_beg", "beg", reverseChainFromToToCommon_node_beg_AllowedTypes, reverseChainFromToToCommon_node_beg_IsAllowedType, 5.5F, 0, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode reverseChainFromToToCommon_node_end = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "reverseChainFromToToCommon_node_end", "end", reverseChainFromToToCommon_node_end_AllowedTypes, reverseChainFromToToCommon_node_end_IsAllowedType, 5.5F, 1, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternNode reverseChainFromToToCommon_node_common = new GRGEN_LGSP.PatternNode((int) GRGEN_MODEL.NodeTypes.@Node, GRGEN_MODEL.NodeType_Node.typeVar, "GRGEN_LIBGR.INode", "reverseChainFromToToCommon_node_common", "common", reverseChainFromToToCommon_node_common_AllowedTypes, reverseChainFromToToCommon_node_common_IsAllowedType, 5.5F, 2, false, null, null, null, null, null, null, false, null);
			GRGEN_LGSP.PatternGraphEmbedding reverseChainFromToToCommon__sub0 = new GRGEN_LGSP.PatternGraphEmbedding("_sub0", Pattern_ReverseChainFromToToCommon.Instance, 
				new GRGEN_EXPR.Expression[] {
					new GRGEN_EXPR.GraphEntityExpression("reverseChainFromToToCommon_node_beg"),
					new GRGEN_EXPR.GraphEntityExpression("reverseChainFromToToCommon_node_end"),
					new GRGEN_EXPR.GraphEntityExpression("reverseChainFromToToCommon_node_common"),
				}, 
				new string[] { }, new GRGEN_LGSP.PatternElement[] { }, new GRGEN_LGSP.PatternVariable[] { },
				new string[] { "reverseChainFromToToCommon_node_beg", "reverseChainFromToToCommon_node_end", "reverseChainFromToToCommon_node_common" }, new string[] {  }, new string[] {  },
				new GRGEN_LGSP.PatternNode[] { reverseChainFromToToCommon_node_beg, reverseChainFromToToCommon_node_end, reverseChainFromToToCommon_node_common }, new GRGEN_LGSP.PatternEdge[] {  }, new GRGEN_LGSP.PatternVariable[] {  });
			pat_reverseChainFromToToCommon = new GRGEN_LGSP.PatternGraph(
				"reverseChainFromToToCommon",
				"",
				null, "reverseChainFromToToCommon",
				false, false,
				new GRGEN_LGSP.PatternNode[] { reverseChainFromToToCommon_node_beg, reverseChainFromToToCommon_node_end, reverseChainFromToToCommon_node_common }, 
				new GRGEN_LGSP.PatternEdge[] {  }, 
				new GRGEN_LGSP.PatternVariable[] {  }, 
				new GRGEN_LGSP.PatternGraphEmbedding[] { reverseChainFromToToCommon__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[3, 3] {
					{ true, false, false, },
					{ false, true, false, },
					{ false, false, true, },
				},
				new bool[0, 0] ,
				reverseChainFromToToCommon_isNodeHomomorphicGlobal,
				reverseChainFromToToCommon_isEdgeHomomorphicGlobal,
				reverseChainFromToToCommon_isNodeTotallyHomomorphic,
				reverseChainFromToToCommon_isEdgeTotallyHomomorphic
			);

			reverseChainFromToToCommon_node_beg.pointOfDefinition = null;
			reverseChainFromToToCommon_node_end.pointOfDefinition = null;
			reverseChainFromToToCommon_node_common.pointOfDefinition = null;
			reverseChainFromToToCommon__sub0.PointOfDefinition = pat_reverseChainFromToToCommon;

			patternGraph = pat_reverseChainFromToToCommon;
		}


		public void Modify(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch _curMatch)
		{
			GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
			Match_reverseChainFromToToCommon curMatch = (Match_reverseChainFromToToCommon)_curMatch;
			GRGEN_LGSP.LGSPNode node_beg = curMatch._node_beg;
			GRGEN_LGSP.LGSPNode node_end = curMatch._node_end;
			GRGEN_LGSP.LGSPNode node_common = curMatch._node_common;
			GRGEN_ACTIONS.Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon subpattern__sub0 = curMatch.@__sub0;
			actionEnv.SelectedMatchRewritten();
			return;
		}

		static Rule_reverseChainFromToToCommon() {
		}

		public interface IMatch_reverseChainFromToToCommon : GRGEN_LIBGR.IMatch
		{
			//Nodes
			GRGEN_LIBGR.INode node_beg { get; set; }
			GRGEN_LIBGR.INode node_end { get; set; }
			GRGEN_LIBGR.INode node_common { get; set; }
			//Edges
			//Variables
			//EmbeddedGraphs
			@GRGEN_ACTIONS.Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon @_sub0 { get; }
			//Alternatives
			//Iterateds
			//Independents
			// further match object stuff
			void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern);
		}

		public class Match_reverseChainFromToToCommon : GRGEN_LGSP.MatchListElement<Match_reverseChainFromToToCommon>, IMatch_reverseChainFromToToCommon
		{
			public GRGEN_LIBGR.INode node_beg { get { return (GRGEN_LIBGR.INode)_node_beg; } set { _node_beg = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_end { get { return (GRGEN_LIBGR.INode)_node_end; } set { _node_end = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LIBGR.INode node_common { get { return (GRGEN_LIBGR.INode)_node_common; } set { _node_common = (GRGEN_LGSP.LGSPNode)value; } }
			public GRGEN_LGSP.LGSPNode _node_beg;
			public GRGEN_LGSP.LGSPNode _node_end;
			public GRGEN_LGSP.LGSPNode _node_common;
			public enum reverseChainFromToToCommon_NodeNums { @beg, @end, @common, 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)reverseChainFromToToCommon_NodeNums.@beg: return _node_beg;
				case (int)reverseChainFromToToCommon_NodeNums.@end: return _node_end;
				case (int)reverseChainFromToToCommon_NodeNums.@common: return _node_common;
				default: return null;
				}
			}
			public override GRGEN_LIBGR.INode getNode(string name)
			{
				switch(name) {
				case "beg": return _node_beg;
				case "end": return _node_end;
				case "common": return _node_common;
				default: return null;
				}
			}
			public override void SetNode(string name, GRGEN_LIBGR.INode value)
			{
				switch(name) {
				case "beg": _node_beg = (GRGEN_LGSP.LGSPNode)value; break;
				case "end": _node_end = (GRGEN_LGSP.LGSPNode)value; break;
				case "common": _node_common = (GRGEN_LGSP.LGSPNode)value; break;
				default: break;
				}
			}

			public enum reverseChainFromToToCommon_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 reverseChainFromToToCommon_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_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon @_sub0 { get { return @__sub0; } }
			public @GRGEN_ACTIONS.Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon @__sub0;
			public enum reverseChainFromToToCommon_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)reverseChainFromToToCommon_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 reverseChainFromToToCommon_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 reverseChainFromToToCommon_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 reverseChainFromToToCommon_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_reverseChainFromToToCommon.instance.pat_reverseChainFromToToCommon; } }
			public override GRGEN_LIBGR.IMatchClass MatchClass { get { return null; } }
			public override GRGEN_LIBGR.IMatch Clone() { return new Match_reverseChainFromToToCommon(this); }
			public override GRGEN_LIBGR.IMatch Clone(IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap) { return new Match_reverseChainFromToToCommon(this, oldToNewMap); }
			public void SetMatchOfEnclosingPattern(GRGEN_LIBGR.IMatch matchOfEnclosingPattern) { _matchOfEnclosingPattern = matchOfEnclosingPattern; }
			public Match_reverseChainFromToToCommon nextWithSameHash;
			public void CleanNextWithSameHash() {
				Match_reverseChainFromToToCommon cur = this;
				while(cur != null) {
					Match_reverseChainFromToToCommon next = cur.nextWithSameHash;
					cur.nextWithSameHash = null;
					cur = next;
				}
			}

			public void AssignContent(Match_reverseChainFromToToCommon that)
			{
				_node_beg = that._node_beg;
				_node_end = that._node_end;
				_node_common = that._node_common;
				@__sub0 = that.@__sub0;
			}

			public Match_reverseChainFromToToCommon(Match_reverseChainFromToToCommon that)
			{
				AssignContent(that);
			}
			public void AssignContent(Match_reverseChainFromToToCommon that, IDictionary<GRGEN_LIBGR.IGraphElement, GRGEN_LIBGR.IGraphElement> oldToNewMap)
			{
				_node_beg = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_beg];
				_node_end = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_end];
				_node_common = (GRGEN_LGSP.LGSPNode)oldToNewMap[that._node_common];
				@__sub0 = new GRGEN_ACTIONS.Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon(that.@__sub0, oldToNewMap);
			}

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

			public bool IsEqual(Match_reverseChainFromToToCommon that)
			{
				if(that==null) return false;
				if(_node_beg != that._node_beg) return false;
				if(_node_end != that._node_end) return false;
				if(_node_common != that._node_common) return false;
				if(!@__sub0.IsEqual(that.@__sub0)) return false;
				return true;
			}
		}


		public class Extractor
		{
			public static List<GRGEN_LIBGR.INode> Extract_beg(List<IMatch_reverseChainFromToToCommon> matchList)
			{
				List<GRGEN_LIBGR.INode> resultList = new List<GRGEN_LIBGR.INode>(matchList.Count);
				foreach(IMatch_reverseChainFromToToCommon match in matchList)
					resultList.Add(match.node_beg);
				return resultList;
			}
			public static List<GRGEN_LIBGR.INode> Extract_end(List<IMatch_reverseChainFromToToCommon> matchList)
			{
				List<GRGEN_LIBGR.INode> resultList = new List<GRGEN_LIBGR.INode>(matchList.Count);
				foreach(IMatch_reverseChainFromToToCommon match in matchList)
					resultList.Add(match.node_end);
				return resultList;
			}
			public static List<GRGEN_LIBGR.INode> Extract_common(List<IMatch_reverseChainFromToToCommon> matchList)
			{
				List<GRGEN_LIBGR.INode> resultList = new List<GRGEN_LIBGR.INode>(matchList.Count);
				foreach(IMatch_reverseChainFromToToCommon match in matchList)
					resultList.Add(match.node_common);
				return resultList;
			}
		}


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

	
	public partial class ArrayHelper
	{
		private static GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon instanceBearingAttributeForSearch_reverseChainFromToToCommon = new GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.Match_reverseChainFromToToCommon();
		public static List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> Array_reverseChainFromToToCommon_groupBy_beg(List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_beg)) {
					seenValues[list[pos].@node_beg].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> tempList = new List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_beg, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> newList = new List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>();
			foreach(List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> Array_reverseChainFromToToCommon_keepOneForEachBy_beg(List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list)
		{
			List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> newList = new List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_beg)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_beg, null);
				}
			}
			return newList;
		}
		public static int Array_reverseChainFromToToCommon_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_reverseChainFromToToCommon_indexOfBy_beg(IList<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_reverseChainFromToToCommon_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_reverseChainFromToToCommon_lastIndexOfBy_beg(IList<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_beg.Equals(entry))
					return i;
			return -1;
		}
		public static List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> Array_reverseChainFromToToCommon_groupBy_end(List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_end)) {
					seenValues[list[pos].@node_end].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> tempList = new List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_end, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> newList = new List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>();
			foreach(List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> Array_reverseChainFromToToCommon_keepOneForEachBy_end(List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list)
		{
			List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> newList = new List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_end)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_end, null);
				}
			}
			return newList;
		}
		public static int Array_reverseChainFromToToCommon_indexOfBy_end(IList<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_reverseChainFromToToCommon_indexOfBy_end(IList<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_reverseChainFromToToCommon_lastIndexOfBy_end(IList<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_reverseChainFromToToCommon_lastIndexOfBy_end(IList<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_end.Equals(entry))
					return i;
			return -1;
		}
		public static List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> Array_reverseChainFromToToCommon_groupBy_common(List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list)
		{
			Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>> seenValues = new Dictionary<GRGEN_LIBGR.INode, List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>>();
			for(int pos = 0; pos < list.Count; ++pos)
			{
				if(seenValues.ContainsKey(list[pos].@node_common)) {
					seenValues[list[pos].@node_common].Add(list[pos]);
				} else {
					List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> tempList = new List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>();
					tempList.Add(list[pos]);
					seenValues.Add(list[pos].@node_common, tempList);
				}
			}
			List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> newList = new List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>();
			foreach(List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> entry in seenValues.Values)
			{
				newList.AddRange(entry);
			}
			return newList;
		}
		public static List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> Array_reverseChainFromToToCommon_keepOneForEachBy_common(List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list)
		{
			List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> newList = new List<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>();
			Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType> alreadySeenMembers = new Dictionary<GRGEN_LIBGR.INode, GRGEN_LIBGR.SetValueType>();
			foreach(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon element in list)
			{
				if(!alreadySeenMembers.ContainsKey(element.@node_common)) {
					newList.Add(element);
					alreadySeenMembers.Add(element.@node_common, null);
				}
			}
			return newList;
		}
		public static int Array_reverseChainFromToToCommon_indexOfBy_common(IList<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i < list.Count; ++i)
				if(list[i].@node_common.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_reverseChainFromToToCommon_indexOfBy_common(IList<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = 0; i < list.Count; ++i)
				if(list[i].@node_common.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_reverseChainFromToToCommon_lastIndexOfBy_common(IList<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list, GRGEN_LIBGR.INode entry, int startIndex)
		{
			for(int i = startIndex; i >= 0; --i)
				if(list[i].@node_common.Equals(entry))
					return i;
			return -1;
		}
		public static int Array_reverseChainFromToToCommon_lastIndexOfBy_common(IList<GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> list, GRGEN_LIBGR.INode entry)
		{
			for(int i = list.Count - 1; i >= 0; --i)
				if(list[i].@node_common.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 Recursive_RuleAndMatchingPatterns : GRGEN_LGSP.LGSPRuleAndMatchingPatterns
	{
		public Recursive_RuleAndMatchingPatterns()
		{
			subpatterns = new GRGEN_LGSP.LGSPMatchingPattern[10];
			rules = new GRGEN_LGSP.LGSPRulePattern[13];
			rulesAndSubpatterns = new GRGEN_LGSP.LGSPMatchingPattern[10+13];
			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_ChainFromTo.Instance;
			rulesAndSubpatterns[0] = Pattern_ChainFromTo.Instance;
			subpatterns[1] = Pattern_ChainFrom.Instance;
			rulesAndSubpatterns[1] = Pattern_ChainFrom.Instance;
			subpatterns[2] = Pattern_ChainFromComplete.Instance;
			rulesAndSubpatterns[2] = Pattern_ChainFromComplete.Instance;
			subpatterns[3] = Pattern_ChainFromCompleteArbitraryPatternpathLocked.Instance;
			rulesAndSubpatterns[3] = Pattern_ChainFromCompleteArbitraryPatternpathLocked.Instance;
			subpatterns[4] = Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance;
			rulesAndSubpatterns[4] = Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance;
			subpatterns[5] = Pattern_Blowball.Instance;
			rulesAndSubpatterns[5] = Pattern_Blowball.Instance;
			subpatterns[6] = Pattern_ReverseChainFromTo.Instance;
			rulesAndSubpatterns[6] = Pattern_ReverseChainFromTo.Instance;
			subpatterns[7] = Pattern_ChainFromToReverse.Instance;
			rulesAndSubpatterns[7] = Pattern_ChainFromToReverse.Instance;
			subpatterns[8] = Pattern_ChainFromToReverseToCommon.Instance;
			rulesAndSubpatterns[8] = Pattern_ChainFromToReverseToCommon.Instance;
			subpatterns[9] = Pattern_ReverseChainFromToToCommon.Instance;
			rulesAndSubpatterns[9] = Pattern_ReverseChainFromToToCommon.Instance;
			rules[0] = Rule_createChain.Instance;
			rulesAndSubpatterns[10+0] = Rule_createChain.Instance;
			rules[1] = Rule_chainFromTo.Instance;
			rulesAndSubpatterns[10+1] = Rule_chainFromTo.Instance;
			rules[2] = Rule_chainFrom.Instance;
			rulesAndSubpatterns[10+2] = Rule_chainFrom.Instance;
			rules[3] = Rule_chainFromComplete.Instance;
			rulesAndSubpatterns[10+3] = Rule_chainFromComplete.Instance;
			rules[4] = Rule_chainFromCompleteArbitraryPatternpathLocked.Instance;
			rulesAndSubpatterns[10+4] = Rule_chainFromCompleteArbitraryPatternpathLocked.Instance;
			rules[5] = Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance;
			rulesAndSubpatterns[10+5] = Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance;
			rules[6] = Rule_createBlowball.Instance;
			rulesAndSubpatterns[10+6] = Rule_createBlowball.Instance;
			rules[7] = Rule_blowball.Instance;
			rulesAndSubpatterns[10+7] = Rule_blowball.Instance;
			rules[8] = Rule_reverseChainFromTo.Instance;
			rulesAndSubpatterns[10+8] = Rule_reverseChainFromTo.Instance;
			rules[9] = Rule_createReverseChain.Instance;
			rulesAndSubpatterns[10+9] = Rule_createReverseChain.Instance;
			rules[10] = Rule_chainFromToReverse.Instance;
			rulesAndSubpatterns[10+10] = Rule_chainFromToReverse.Instance;
			rules[11] = Rule_chainFromToReverseToCommon.Instance;
			rulesAndSubpatterns[10+11] = Rule_chainFromToReverseToCommon.Instance;
			rules[12] = Rule_reverseChainFromToToCommon.Instance;
			rulesAndSubpatterns[10+12] = Rule_reverseChainFromToToCommon.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_ChainFromTo : GRGEN_LGSP.LGSPSubpatternAction
    {
        private PatternAction_ChainFromTo(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_)
            : base(null)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
            patternGraph = Pattern_ChainFromTo.Instance.patternGraph;
        }

        public static PatternAction_ChainFromTo getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_) {
            PatternAction_ChainFromTo newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new PatternAction_ChainFromTo(actionEnv_, openTasks_);
            }
            return newTask;
        }

        public static void releaseTask(PatternAction_ChainFromTo oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static PatternAction_ChainFromTo freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private PatternAction_ChainFromTo next = null;

        public GRGEN_LGSP.LGSPNode ChainFromTo_node_from;
        public GRGEN_LGSP.LGSPNode ChainFromTo_node_to;
        
        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 ChainFromTo_node_from 
            GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_from = ChainFromTo_node_from;
            // SubPreset ChainFromTo_node_to 
            GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_to = ChainFromTo_node_to;
            // Push alternative matching task for ChainFromTo_alt_0
            AlternativeAction_ChainFromTo_alt_0 taskFor_alt_0 = AlternativeAction_ChainFromTo_alt_0.getNewTask(actionEnv, openTasks, Pattern_ChainFromTo.Instance.patternGraph.alternatives[(int)Pattern_ChainFromTo.ChainFromTo_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0.ChainFromTo_node_from = candidate_ChainFromTo_node_from;
            taskFor_alt_0.ChainFromTo_node_to = candidate_ChainFromTo_node_to;
            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 ChainFromTo_alt_0
            openTasks.Pop();
            AlternativeAction_ChainFromTo_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_ChainFromTo.Match_ChainFromTo match = new Pattern_ChainFromTo.Match_ChainFromTo();
                    match._node_from = candidate_ChainFromTo_node_from;
                    match._node_to = candidate_ChainFromTo_node_to;
                    match._alt_0 = (Pattern_ChainFromTo.IMatch_ChainFromTo_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)
                {
                    openTasks.Push(this);
                    return;
                }
                openTasks.Push(this);
                return;
            }
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ChainFromTo_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ChainFromTo_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ChainFromTo_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ChainFromTo_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_ChainFromTo_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ChainFromTo_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ChainFromTo_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ChainFromTo_alt_0 next = null;

        public GRGEN_LGSP.LGSPNode ChainFromTo_node_from;
        public GRGEN_LGSP.LGSPNode ChainFromTo_node_to;
        
        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 ChainFromTo_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromTo.ChainFromTo_alt_0_CaseNums.@base];
                // SubPreset ChainFromTo_node_from 
                GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_from = ChainFromTo_node_from;
                // SubPreset ChainFromTo_node_to 
                GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_to = ChainFromTo_node_to;
                // Extend Outgoing ChainFromTo_alt_0_base_edge__edge0 from ChainFromTo_node_from 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromTo_alt_0_base_edge__edge0 = candidate_ChainFromTo_node_from.lgspOuthead;
                if(head_candidate_ChainFromTo_alt_0_base_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromTo_alt_0_base_edge__edge0 = head_candidate_ChainFromTo_alt_0_base_edge__edge0;
                    do
                    {
                        if(candidate_ChainFromTo_alt_0_base_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_ChainFromTo_alt_0_base_edge__edge0.lgspTarget != candidate_ChainFromTo_node_to) {
                            continue;
                        }
                        if((candidate_ChainFromTo_alt_0_base_edge__edge0.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_ChainFromTo.Match_ChainFromTo_alt_0_base match = new Pattern_ChainFromTo.Match_ChainFromTo_alt_0_base();
                            match._node_from = candidate_ChainFromTo_node_from;
                            match._node_to = candidate_ChainFromTo_node_to;
                            match._edge__edge0 = candidate_ChainFromTo_alt_0_base_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_ChainFromTo_alt_0_base_edge__edge0;
                        prevGlobal__candidate_ChainFromTo_alt_0_base_edge__edge0 = candidate_ChainFromTo_alt_0_base_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromTo_alt_0_base_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)
                            {
                                Pattern_ChainFromTo.Match_ChainFromTo_alt_0_base match = new Pattern_ChainFromTo.Match_ChainFromTo_alt_0_base();
                                match._node_from = candidate_ChainFromTo_node_from;
                                match._node_to = candidate_ChainFromTo_node_to;
                                match._edge__edge0 = candidate_ChainFromTo_alt_0_base_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_ChainFromTo_alt_0_base_edge__edge0.lgspFlags = candidate_ChainFromTo_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_base_edge__edge0;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromTo_alt_0_base_edge__edge0.lgspFlags = candidate_ChainFromTo_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_base_edge__edge0;
                            continue;
                        }
                        candidate_ChainFromTo_alt_0_base_edge__edge0.lgspFlags = candidate_ChainFromTo_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_base_edge__edge0;
                    }
                    while( (candidate_ChainFromTo_alt_0_base_edge__edge0 = candidate_ChainFromTo_alt_0_base_edge__edge0.lgspOutNext) != head_candidate_ChainFromTo_alt_0_base_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 ChainFromTo_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromTo.ChainFromTo_alt_0_CaseNums.@rec];
                // SubPreset ChainFromTo_node_from 
                GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_from = ChainFromTo_node_from;
                // SubPreset ChainFromTo_node_to 
                GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_to = ChainFromTo_node_to;
                // Element ChainFromTo_node_to_inlined__sub0_0 assigned from other element ChainFromTo_node_to 
                GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_to_inlined__sub0_0 = candidate_ChainFromTo_node_to;
                // Extend Outgoing ChainFromTo_alt_0_rec_edge__edge0 from ChainFromTo_node_from 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromTo_alt_0_rec_edge__edge0 = candidate_ChainFromTo_node_from.lgspOuthead;
                if(head_candidate_ChainFromTo_alt_0_rec_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromTo_alt_0_rec_edge__edge0 = head_candidate_ChainFromTo_alt_0_rec_edge__edge0;
                    do
                    {
                        if(candidate_ChainFromTo_alt_0_rec_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFromTo_alt_0_rec_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 ChainFromTo_alt_0_rec_node_intermediate from ChainFromTo_alt_0_rec_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromTo_alt_0_rec_node_intermediate = candidate_ChainFromTo_alt_0_rec_edge__edge0.lgspTarget;
                        if((candidate_ChainFromTo_alt_0_rec_node_intermediate.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0
                            && candidate_ChainFromTo_alt_0_rec_node_intermediate==candidate_ChainFromTo_node_from
                            )
                        {
                            continue;
                        }
                        if((candidate_ChainFromTo_alt_0_rec_node_intermediate.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Element ChainFromTo_node_from_inlined__sub0_0 assigned from other element ChainFromTo_alt_0_rec_node_intermediate 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_from_inlined__sub0_0 = candidate_ChainFromTo_alt_0_rec_node_intermediate;
                        // Push alternative matching task for ChainFromTo_alt_0_rec_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec
                        AlternativeAction_ChainFromTo_alt_0_rec_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec taskFor_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec = AlternativeAction_ChainFromTo_alt_0_rec_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec.getNewTask(actionEnv, openTasks, Pattern_ChainFromTo.Instance.patternGraph.alternatives[(int)Pattern_ChainFromTo.ChainFromTo_AltNums.@alt_0].alternativeCases);
                        taskFor_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec.ChainFromTo_node_from_inlined__sub0_0 = candidate_ChainFromTo_node_from_inlined__sub0_0;
                        taskFor_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec.ChainFromTo_node_to_inlined__sub0_0 = candidate_ChainFromTo_node_to_inlined__sub0_0;
                        taskFor_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec.searchPatternpath = false;
                        taskFor_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec.matchOfNestingPattern = null;
                        taskFor_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec);
                        uint prevGlobal__candidate_ChainFromTo_alt_0_rec_node_intermediate;
                        prevGlobal__candidate_ChainFromTo_alt_0_rec_node_intermediate = candidate_ChainFromTo_alt_0_rec_node_intermediate.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromTo_alt_0_rec_node_intermediate.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFromTo_alt_0_rec_edge__edge0;
                        prevGlobal__candidate_ChainFromTo_alt_0_rec_edge__edge0 = candidate_ChainFromTo_alt_0_rec_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromTo_alt_0_rec_edge__edge0.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 ChainFromTo_alt_0_rec_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec
                        openTasks.Pop();
                        AlternativeAction_ChainFromTo_alt_0_rec_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec.releaseTask(taskFor_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec);
                        // 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_ChainFromTo.Match_ChainFromTo_alt_0_rec match = new Pattern_ChainFromTo.Match_ChainFromTo_alt_0_rec();
                                Pattern_ChainFromTo.Match_ChainFromTo match__sub0 = new Pattern_ChainFromTo.Match_ChainFromTo();
                                match__sub0.SetMatchOfEnclosingPattern(match);
                                match._node_from = candidate_ChainFromTo_node_from;
                                match._node_intermediate = candidate_ChainFromTo_alt_0_rec_node_intermediate;
                                match._node_to = candidate_ChainFromTo_node_to;
                                match__sub0._node_from = candidate_ChainFromTo_node_from_inlined__sub0_0;
                                match__sub0._node_to = candidate_ChainFromTo_node_to_inlined__sub0_0;
                                match._edge__edge0 = candidate_ChainFromTo_alt_0_rec_edge__edge0;
                                match.__sub0 = match__sub0;
                                match__sub0._alt_0 = (Pattern_ChainFromTo.IMatch_ChainFromTo_alt_0)currentFoundPartialMatch.Pop();
                                match__sub0._alt_0.SetMatchOfEnclosingPattern(match__sub0);
                                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_ChainFromTo_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromTo_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_edge__edge0;
                                candidate_ChainFromTo_alt_0_rec_node_intermediate.lgspFlags = candidate_ChainFromTo_alt_0_rec_node_intermediate.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_node_intermediate;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromTo_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromTo_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_edge__edge0;
                            candidate_ChainFromTo_alt_0_rec_node_intermediate.lgspFlags = candidate_ChainFromTo_alt_0_rec_node_intermediate.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_node_intermediate;
                            continue;
                        }
                        candidate_ChainFromTo_alt_0_rec_node_intermediate.lgspFlags = candidate_ChainFromTo_alt_0_rec_node_intermediate.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_node_intermediate;
                        candidate_ChainFromTo_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromTo_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_edge__edge0;
                    }
                    while( (candidate_ChainFromTo_alt_0_rec_edge__edge0 = candidate_ChainFromTo_alt_0_rec_edge__edge0.lgspOutNext) != head_candidate_ChainFromTo_alt_0_rec_edge__edge0 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ChainFromTo_alt_0_rec_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ChainFromTo_alt_0_rec_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ChainFromTo_alt_0_rec_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ChainFromTo_alt_0_rec_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_ChainFromTo_alt_0_rec_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ChainFromTo_alt_0_rec_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ChainFromTo_alt_0_rec_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ChainFromTo_alt_0_rec_alt_0_inlined__sub0_0_in_ChainFromTo_alt_0_rec next = null;

        public GRGEN_LGSP.LGSPNode ChainFromTo_node_from_inlined__sub0_0;
        public GRGEN_LGSP.LGSPNode ChainFromTo_node_to_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 ChainFromTo_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromTo.ChainFromTo_alt_0_CaseNums.@base];
                // SubPreset ChainFromTo_node_from_inlined__sub0_0 
                GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_from_inlined__sub0_0 = ChainFromTo_node_from_inlined__sub0_0;
                // SubPreset ChainFromTo_node_to_inlined__sub0_0 
                GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_to_inlined__sub0_0 = ChainFromTo_node_to_inlined__sub0_0;
                // Extend Outgoing ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0 from ChainFromTo_node_from_inlined__sub0_0 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0 = candidate_ChainFromTo_node_from_inlined__sub0_0.lgspOuthead;
                if(head_candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0 = head_candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0;
                    do
                    {
                        if(candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0.lgspTarget != candidate_ChainFromTo_node_to_inlined__sub0_0) {
                            continue;
                        }
                        if((candidate_ChainFromTo_alt_0_base_edge__edge0_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_ChainFromTo.Match_ChainFromTo_alt_0_base match = new Pattern_ChainFromTo.Match_ChainFromTo_alt_0_base();
                            match._node_from = candidate_ChainFromTo_node_from_inlined__sub0_0;
                            match._node_to = candidate_ChainFromTo_node_to_inlined__sub0_0;
                            match._edge__edge0 = candidate_ChainFromTo_alt_0_base_edge__edge0_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_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0;
                        prevGlobal__candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0 = candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromTo_alt_0_base_edge__edge0_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_ChainFromTo.Match_ChainFromTo_alt_0_base match = new Pattern_ChainFromTo.Match_ChainFromTo_alt_0_base();
                                match._node_from = candidate_ChainFromTo_node_from_inlined__sub0_0;
                                match._node_to = candidate_ChainFromTo_node_to_inlined__sub0_0;
                                match._edge__edge0 = candidate_ChainFromTo_alt_0_base_edge__edge0_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_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0.lgspFlags = candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0.lgspFlags = candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0;
                            continue;
                        }
                        candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0.lgspFlags = candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0;
                    }
                    while( (candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0 = candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_0.lgspOutNext) != head_candidate_ChainFromTo_alt_0_base_edge__edge0_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 ChainFromTo_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromTo.ChainFromTo_alt_0_CaseNums.@rec];
                // SubPreset ChainFromTo_node_from_inlined__sub0_0 
                GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_from_inlined__sub0_0 = ChainFromTo_node_from_inlined__sub0_0;
                // SubPreset ChainFromTo_node_to_inlined__sub0_0 
                GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_to_inlined__sub0_0 = ChainFromTo_node_to_inlined__sub0_0;
                // Extend Outgoing ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0 from ChainFromTo_node_from_inlined__sub0_0 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0 = candidate_ChainFromTo_node_from_inlined__sub0_0.lgspOuthead;
                if(head_candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0 = head_candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0;
                    do
                    {
                        if(candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFromTo_alt_0_rec_edge__edge0_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;
                        }
                        // Implicit Target ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0 from ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0 = candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0.lgspTarget;
                        if((candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0
                            && candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0==candidate_ChainFromTo_node_from_inlined__sub0_0
                            )
                        {
                            continue;
                        }
                        if((candidate_ChainFromTo_alt_0_rec_node_intermediate_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;
                        }
                        // Push subpattern matching task for _sub0_inlined__sub0_0
                        PatternAction_ChainFromTo taskFor__sub0_inlined__sub0_0 = PatternAction_ChainFromTo.getNewTask(actionEnv, openTasks);
                        taskFor__sub0_inlined__sub0_0.ChainFromTo_node_from = candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0;
                        taskFor__sub0_inlined__sub0_0.ChainFromTo_node_to = candidate_ChainFromTo_node_to_inlined__sub0_0;
                        taskFor__sub0_inlined__sub0_0.searchPatternpath = false;
                        taskFor__sub0_inlined__sub0_0.matchOfNestingPattern = null;
                        taskFor__sub0_inlined__sub0_0.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor__sub0_inlined__sub0_0);
                        uint prevGlobal__candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0;
                        prevGlobal__candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0 = candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0;
                        prevGlobal__candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0 = candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromTo_alt_0_rec_edge__edge0_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 subpattern matching task for _sub0_inlined__sub0_0
                        openTasks.Pop();
                        PatternAction_ChainFromTo.releaseTask(taskFor__sub0_inlined__sub0_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_ChainFromTo.Match_ChainFromTo_alt_0_rec match = new Pattern_ChainFromTo.Match_ChainFromTo_alt_0_rec();
                                match._node_from = candidate_ChainFromTo_node_from_inlined__sub0_0;
                                match._node_intermediate = candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0;
                                match._node_to = candidate_ChainFromTo_node_to_inlined__sub0_0;
                                match._edge__edge0 = candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0;
                                match.__sub0 = (@Pattern_ChainFromTo.Match_ChainFromTo)currentFoundPartialMatch.Pop();
                                match.__sub0._matchOfEnclosingPattern = 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_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0.lgspFlags = candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0;
                                candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0.lgspFlags = candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0.lgspFlags = candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0;
                            candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0.lgspFlags = candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0;
                            continue;
                        }
                        candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0.lgspFlags = candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_0;
                        candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0.lgspFlags = candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0;
                    }
                    while( (candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0 = candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0.lgspOutNext) != head_candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_0 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class PatternAction_ChainFrom : GRGEN_LGSP.LGSPSubpatternAction
    {
        private PatternAction_ChainFrom(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_)
            : base(null)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
            patternGraph = Pattern_ChainFrom.Instance.patternGraph;
        }

        public static PatternAction_ChainFrom getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_) {
            PatternAction_ChainFrom newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new PatternAction_ChainFrom(actionEnv_, openTasks_);
            }
            return newTask;
        }

        public static void releaseTask(PatternAction_ChainFrom oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static PatternAction_ChainFrom freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private PatternAction_ChainFrom next = null;

        public GRGEN_LGSP.LGSPNode ChainFrom_node_from;
        
        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 ChainFrom_node_from 
            GRGEN_LGSP.LGSPNode candidate_ChainFrom_node_from = ChainFrom_node_from;
            // Push alternative matching task for ChainFrom_alt_0
            AlternativeAction_ChainFrom_alt_0 taskFor_alt_0 = AlternativeAction_ChainFrom_alt_0.getNewTask(actionEnv, openTasks, Pattern_ChainFrom.Instance.patternGraph.alternatives[(int)Pattern_ChainFrom.ChainFrom_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0.ChainFrom_node_from = candidate_ChainFrom_node_from;
            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 ChainFrom_alt_0
            openTasks.Pop();
            AlternativeAction_ChainFrom_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_ChainFrom.Match_ChainFrom match = new Pattern_ChainFrom.Match_ChainFrom();
                    match._node_from = candidate_ChainFrom_node_from;
                    match._alt_0 = (Pattern_ChainFrom.IMatch_ChainFrom_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)
                {
                    openTasks.Push(this);
                    return;
                }
                openTasks.Push(this);
                return;
            }
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ChainFrom_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ChainFrom_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ChainFrom_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ChainFrom_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_ChainFrom_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ChainFrom_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ChainFrom_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ChainFrom_alt_0 next = null;

        public GRGEN_LGSP.LGSPNode ChainFrom_node_from;
        
        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 ChainFrom_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFrom.ChainFrom_alt_0_CaseNums.@base];
                // 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_ChainFrom.Match_ChainFrom_alt_0_base match = new Pattern_ChainFrom.Match_ChainFrom_alt_0_base();
                    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)
                    {
                        Pattern_ChainFrom.Match_ChainFrom_alt_0_base match = new Pattern_ChainFrom.Match_ChainFrom_alt_0_base();
                        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);
            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 ChainFrom_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFrom.ChainFrom_alt_0_CaseNums.@rec];
                // SubPreset ChainFrom_node_from 
                GRGEN_LGSP.LGSPNode candidate_ChainFrom_node_from = ChainFrom_node_from;
                // Extend Outgoing ChainFrom_alt_0_rec_edge__edge0 from ChainFrom_node_from 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFrom_alt_0_rec_edge__edge0 = candidate_ChainFrom_node_from.lgspOuthead;
                if(head_candidate_ChainFrom_alt_0_rec_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFrom_alt_0_rec_edge__edge0 = head_candidate_ChainFrom_alt_0_rec_edge__edge0;
                    do
                    {
                        if(candidate_ChainFrom_alt_0_rec_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFrom_alt_0_rec_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 ChainFrom_alt_0_rec_node_to from ChainFrom_alt_0_rec_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_ChainFrom_alt_0_rec_node_to = candidate_ChainFrom_alt_0_rec_edge__edge0.lgspTarget;
                        if((candidate_ChainFrom_alt_0_rec_node_to.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            continue;
                        }
                        if((candidate_ChainFrom_alt_0_rec_node_to.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Element ChainFrom_node_from_inlined__sub0_1 assigned from other element ChainFrom_alt_0_rec_node_to 
                        GRGEN_LGSP.LGSPNode candidate_ChainFrom_node_from_inlined__sub0_1 = candidate_ChainFrom_alt_0_rec_node_to;
                        // Push alternative matching task for ChainFrom_alt_0_rec_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec
                        AlternativeAction_ChainFrom_alt_0_rec_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec taskFor_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec = AlternativeAction_ChainFrom_alt_0_rec_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec.getNewTask(actionEnv, openTasks, Pattern_ChainFrom.Instance.patternGraph.alternatives[(int)Pattern_ChainFrom.ChainFrom_AltNums.@alt_0].alternativeCases);
                        taskFor_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec.ChainFrom_node_from_inlined__sub0_1 = candidate_ChainFrom_node_from_inlined__sub0_1;
                        taskFor_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec.searchPatternpath = false;
                        taskFor_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec.matchOfNestingPattern = null;
                        taskFor_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec);
                        uint prevGlobal__candidate_ChainFrom_alt_0_rec_node_to;
                        prevGlobal__candidate_ChainFrom_alt_0_rec_node_to = candidate_ChainFrom_alt_0_rec_node_to.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFrom_alt_0_rec_node_to.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFrom_alt_0_rec_edge__edge0;
                        prevGlobal__candidate_ChainFrom_alt_0_rec_edge__edge0 = candidate_ChainFrom_alt_0_rec_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFrom_alt_0_rec_edge__edge0.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 ChainFrom_alt_0_rec_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec
                        openTasks.Pop();
                        AlternativeAction_ChainFrom_alt_0_rec_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec.releaseTask(taskFor_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec);
                        // 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_ChainFrom.Match_ChainFrom_alt_0_rec match = new Pattern_ChainFrom.Match_ChainFrom_alt_0_rec();
                                Pattern_ChainFrom.Match_ChainFrom match__sub0 = new Pattern_ChainFrom.Match_ChainFrom();
                                match__sub0.SetMatchOfEnclosingPattern(match);
                                match._node_from = candidate_ChainFrom_node_from;
                                match._node_to = candidate_ChainFrom_alt_0_rec_node_to;
                                match__sub0._node_from = candidate_ChainFrom_node_from_inlined__sub0_1;
                                match._edge__edge0 = candidate_ChainFrom_alt_0_rec_edge__edge0;
                                match.__sub0 = match__sub0;
                                match__sub0._alt_0 = (Pattern_ChainFrom.IMatch_ChainFrom_alt_0)currentFoundPartialMatch.Pop();
                                match__sub0._alt_0.SetMatchOfEnclosingPattern(match__sub0);
                                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_ChainFrom_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFrom_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_edge__edge0;
                                candidate_ChainFrom_alt_0_rec_node_to.lgspFlags = candidate_ChainFrom_alt_0_rec_node_to.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_node_to;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFrom_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFrom_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_edge__edge0;
                            candidate_ChainFrom_alt_0_rec_node_to.lgspFlags = candidate_ChainFrom_alt_0_rec_node_to.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_node_to;
                            continue;
                        }
                        candidate_ChainFrom_alt_0_rec_node_to.lgspFlags = candidate_ChainFrom_alt_0_rec_node_to.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_node_to;
                        candidate_ChainFrom_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFrom_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_edge__edge0;
                    }
                    while( (candidate_ChainFrom_alt_0_rec_edge__edge0 = candidate_ChainFrom_alt_0_rec_edge__edge0.lgspOutNext) != head_candidate_ChainFrom_alt_0_rec_edge__edge0 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ChainFrom_alt_0_rec_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ChainFrom_alt_0_rec_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ChainFrom_alt_0_rec_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ChainFrom_alt_0_rec_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_ChainFrom_alt_0_rec_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ChainFrom_alt_0_rec_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ChainFrom_alt_0_rec_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ChainFrom_alt_0_rec_alt_0_inlined__sub0_1_in_ChainFrom_alt_0_rec next = null;

        public GRGEN_LGSP.LGSPNode ChainFrom_node_from_inlined__sub0_1;
        
        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 ChainFrom_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFrom.ChainFrom_alt_0_CaseNums.@base];
                // 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_ChainFrom.Match_ChainFrom_alt_0_base match = new Pattern_ChainFrom.Match_ChainFrom_alt_0_base();
                    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)
                    {
                        Pattern_ChainFrom.Match_ChainFrom_alt_0_base match = new Pattern_ChainFrom.Match_ChainFrom_alt_0_base();
                        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);
            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 ChainFrom_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFrom.ChainFrom_alt_0_CaseNums.@rec];
                // SubPreset ChainFrom_node_from_inlined__sub0_1 
                GRGEN_LGSP.LGSPNode candidate_ChainFrom_node_from_inlined__sub0_1 = ChainFrom_node_from_inlined__sub0_1;
                // Extend Outgoing ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1 from ChainFrom_node_from_inlined__sub0_1 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1 = candidate_ChainFrom_node_from_inlined__sub0_1.lgspOuthead;
                if(head_candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1 = head_candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1;
                    do
                    {
                        if(candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Implicit Target ChainFrom_alt_0_rec_node_to_inlined__sub0_1 from ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1 
                        GRGEN_LGSP.LGSPNode candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1 = candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1.lgspTarget;
                        if((candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            continue;
                        }
                        if((candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Push subpattern matching task for _sub0_inlined__sub0_1
                        PatternAction_ChainFrom taskFor__sub0_inlined__sub0_1 = PatternAction_ChainFrom.getNewTask(actionEnv, openTasks);
                        taskFor__sub0_inlined__sub0_1.ChainFrom_node_from = candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1;
                        taskFor__sub0_inlined__sub0_1.searchPatternpath = false;
                        taskFor__sub0_inlined__sub0_1.matchOfNestingPattern = null;
                        taskFor__sub0_inlined__sub0_1.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor__sub0_inlined__sub0_1);
                        uint prevGlobal__candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1;
                        prevGlobal__candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1 = candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1;
                        prevGlobal__candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1 = candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop subpattern matching task for _sub0_inlined__sub0_1
                        openTasks.Pop();
                        PatternAction_ChainFrom.releaseTask(taskFor__sub0_inlined__sub0_1);
                        // 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_ChainFrom.Match_ChainFrom_alt_0_rec match = new Pattern_ChainFrom.Match_ChainFrom_alt_0_rec();
                                match._node_from = candidate_ChainFrom_node_from_inlined__sub0_1;
                                match._node_to = candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1;
                                match._edge__edge0 = candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1;
                                match.__sub0 = (@Pattern_ChainFrom.Match_ChainFrom)currentFoundPartialMatch.Pop();
                                match.__sub0._matchOfEnclosingPattern = 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_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1.lgspFlags = candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1;
                                candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1.lgspFlags = candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1.lgspFlags = candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1;
                            candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1.lgspFlags = candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1;
                            continue;
                        }
                        candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1.lgspFlags = candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_1;
                        candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1.lgspFlags = candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1;
                    }
                    while( (candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1 = candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1.lgspOutNext) != head_candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_1 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class PatternAction_ChainFromComplete : GRGEN_LGSP.LGSPSubpatternAction
    {
        private PatternAction_ChainFromComplete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_)
            : base(null)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
            patternGraph = Pattern_ChainFromComplete.Instance.patternGraph;
        }

        public static PatternAction_ChainFromComplete getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_) {
            PatternAction_ChainFromComplete newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new PatternAction_ChainFromComplete(actionEnv_, openTasks_);
            }
            return newTask;
        }

        public static void releaseTask(PatternAction_ChainFromComplete oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static PatternAction_ChainFromComplete freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private PatternAction_ChainFromComplete next = null;

        public GRGEN_LGSP.LGSPNode ChainFromComplete_node_from;
        
        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 ChainFromComplete_node_from 
            GRGEN_LGSP.LGSPNode candidate_ChainFromComplete_node_from = ChainFromComplete_node_from;
            // Push alternative matching task for ChainFromComplete_alt_0
            AlternativeAction_ChainFromComplete_alt_0 taskFor_alt_0 = AlternativeAction_ChainFromComplete_alt_0.getNewTask(actionEnv, openTasks, Pattern_ChainFromComplete.Instance.patternGraph.alternatives[(int)Pattern_ChainFromComplete.ChainFromComplete_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0.ChainFromComplete_node_from = candidate_ChainFromComplete_node_from;
            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 ChainFromComplete_alt_0
            openTasks.Pop();
            AlternativeAction_ChainFromComplete_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_ChainFromComplete.Match_ChainFromComplete match = new Pattern_ChainFromComplete.Match_ChainFromComplete();
                    match._node_from = candidate_ChainFromComplete_node_from;
                    match._alt_0 = (Pattern_ChainFromComplete.IMatch_ChainFromComplete_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)
                {
                    openTasks.Push(this);
                    return;
                }
                openTasks.Push(this);
                return;
            }
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ChainFromComplete_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ChainFromComplete_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ChainFromComplete_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ChainFromComplete_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_ChainFromComplete_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ChainFromComplete_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ChainFromComplete_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ChainFromComplete_alt_0 next = null;

        public GRGEN_LGSP.LGSPNode ChainFromComplete_node_from;
        
        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 ChainFromComplete_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromComplete.ChainFromComplete_alt_0_CaseNums.@base];
                // SubPreset ChainFromComplete_node_from 
                GRGEN_LGSP.LGSPNode candidate_ChainFromComplete_node_from = ChainFromComplete_node_from;
                // NegativePattern 
                {
                    ++isoSpace;
                    uint prev_neg_0__candidate_ChainFromComplete_node_from;
                    prev_neg_0__candidate_ChainFromComplete_node_from = candidate_ChainFromComplete_node_from.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    candidate_ChainFromComplete_node_from.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    // Extend Outgoing ChainFromComplete_alt_0_base_neg_0_edge__edge0 from ChainFromComplete_node_from 
                    GRGEN_LGSP.LGSPEdge head_candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0 = candidate_ChainFromComplete_node_from.lgspOuthead;
                    if(head_candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0 != null)
                    {
                        GRGEN_LGSP.LGSPEdge candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0 = head_candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0;
                        do
                        {
                            if(candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0.lgspType.TypeID!=1) {
                                continue;
                            }
                            if((candidate_ChainFromComplete_alt_0_base_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 ChainFromComplete_alt_0_base_neg_0_node__node0 from ChainFromComplete_alt_0_base_neg_0_edge__edge0 
                            GRGEN_LGSP.LGSPNode candidate_ChainFromComplete_alt_0_base_neg_0_node__node0 = candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0.lgspTarget;
                            if((candidate_ChainFromComplete_alt_0_base_neg_0_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                            {
                                continue;
                            }
                            if((candidate_ChainFromComplete_alt_0_base_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_ChainFromComplete_node_from.lgspFlags = candidate_ChainFromComplete_node_from.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0__candidate_ChainFromComplete_node_from;
                            --isoSpace;
                            goto label0;
                        }
                        while( (candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0 = candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0.lgspOutNext) != head_candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0 );
                    }
                    candidate_ChainFromComplete_node_from.lgspFlags = candidate_ChainFromComplete_node_from.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0__candidate_ChainFromComplete_node_from;
                    --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);
                    Pattern_ChainFromComplete.Match_ChainFromComplete_alt_0_base match = new Pattern_ChainFromComplete.Match_ChainFromComplete_alt_0_base();
                    match._node_from = candidate_ChainFromComplete_node_from;
                    currentFoundPartialMatch.Push(match);
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        openTasks.Push(this);
                        return;
                    }
                    goto label1;
                }
                // 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_ChainFromComplete.Match_ChainFromComplete_alt_0_base match = new Pattern_ChainFromComplete.Match_ChainFromComplete_alt_0_base();
                        match._node_from = candidate_ChainFromComplete_node_from;
                        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;
                    }
                    goto label2;
                }
label0: ;
label1: ;
label2: ;
            } 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 ChainFromComplete_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromComplete.ChainFromComplete_alt_0_CaseNums.@rec];
                // SubPreset ChainFromComplete_node_from 
                GRGEN_LGSP.LGSPNode candidate_ChainFromComplete_node_from = ChainFromComplete_node_from;
                // Extend Outgoing ChainFromComplete_alt_0_rec_edge__edge0 from ChainFromComplete_node_from 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromComplete_alt_0_rec_edge__edge0 = candidate_ChainFromComplete_node_from.lgspOuthead;
                if(head_candidate_ChainFromComplete_alt_0_rec_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromComplete_alt_0_rec_edge__edge0 = head_candidate_ChainFromComplete_alt_0_rec_edge__edge0;
                    do
                    {
                        if(candidate_ChainFromComplete_alt_0_rec_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFromComplete_alt_0_rec_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 ChainFromComplete_alt_0_rec_node_to from ChainFromComplete_alt_0_rec_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromComplete_alt_0_rec_node_to = candidate_ChainFromComplete_alt_0_rec_edge__edge0.lgspTarget;
                        if((candidate_ChainFromComplete_alt_0_rec_node_to.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            continue;
                        }
                        if((candidate_ChainFromComplete_alt_0_rec_node_to.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Element ChainFromComplete_node_from_inlined__sub0_2 assigned from other element ChainFromComplete_alt_0_rec_node_to 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromComplete_node_from_inlined__sub0_2 = candidate_ChainFromComplete_alt_0_rec_node_to;
                        // Push alternative matching task for ChainFromComplete_alt_0_rec_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec
                        AlternativeAction_ChainFromComplete_alt_0_rec_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec taskFor_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec = AlternativeAction_ChainFromComplete_alt_0_rec_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec.getNewTask(actionEnv, openTasks, Pattern_ChainFromComplete.Instance.patternGraph.alternatives[(int)Pattern_ChainFromComplete.ChainFromComplete_AltNums.@alt_0].alternativeCases);
                        taskFor_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec.ChainFromComplete_node_from_inlined__sub0_2 = candidate_ChainFromComplete_node_from_inlined__sub0_2;
                        taskFor_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec.searchPatternpath = false;
                        taskFor_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec.matchOfNestingPattern = null;
                        taskFor_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec);
                        uint prevGlobal__candidate_ChainFromComplete_alt_0_rec_node_to;
                        prevGlobal__candidate_ChainFromComplete_alt_0_rec_node_to = candidate_ChainFromComplete_alt_0_rec_node_to.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromComplete_alt_0_rec_node_to.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFromComplete_alt_0_rec_edge__edge0;
                        prevGlobal__candidate_ChainFromComplete_alt_0_rec_edge__edge0 = candidate_ChainFromComplete_alt_0_rec_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromComplete_alt_0_rec_edge__edge0.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 ChainFromComplete_alt_0_rec_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec
                        openTasks.Pop();
                        AlternativeAction_ChainFromComplete_alt_0_rec_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec.releaseTask(taskFor_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec);
                        // 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_ChainFromComplete.Match_ChainFromComplete_alt_0_rec match = new Pattern_ChainFromComplete.Match_ChainFromComplete_alt_0_rec();
                                Pattern_ChainFromComplete.Match_ChainFromComplete match__sub0 = new Pattern_ChainFromComplete.Match_ChainFromComplete();
                                match__sub0.SetMatchOfEnclosingPattern(match);
                                match._node_from = candidate_ChainFromComplete_node_from;
                                match._node_to = candidate_ChainFromComplete_alt_0_rec_node_to;
                                match__sub0._node_from = candidate_ChainFromComplete_node_from_inlined__sub0_2;
                                match._edge__edge0 = candidate_ChainFromComplete_alt_0_rec_edge__edge0;
                                match.__sub0 = match__sub0;
                                match__sub0._alt_0 = (Pattern_ChainFromComplete.IMatch_ChainFromComplete_alt_0)currentFoundPartialMatch.Pop();
                                match__sub0._alt_0.SetMatchOfEnclosingPattern(match__sub0);
                                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_ChainFromComplete_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromComplete_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_edge__edge0;
                                candidate_ChainFromComplete_alt_0_rec_node_to.lgspFlags = candidate_ChainFromComplete_alt_0_rec_node_to.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_node_to;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromComplete_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromComplete_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_edge__edge0;
                            candidate_ChainFromComplete_alt_0_rec_node_to.lgspFlags = candidate_ChainFromComplete_alt_0_rec_node_to.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_node_to;
                            continue;
                        }
                        candidate_ChainFromComplete_alt_0_rec_node_to.lgspFlags = candidate_ChainFromComplete_alt_0_rec_node_to.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_node_to;
                        candidate_ChainFromComplete_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromComplete_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_edge__edge0;
                    }
                    while( (candidate_ChainFromComplete_alt_0_rec_edge__edge0 = candidate_ChainFromComplete_alt_0_rec_edge__edge0.lgspOutNext) != head_candidate_ChainFromComplete_alt_0_rec_edge__edge0 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ChainFromComplete_alt_0_rec_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ChainFromComplete_alt_0_rec_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ChainFromComplete_alt_0_rec_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ChainFromComplete_alt_0_rec_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_ChainFromComplete_alt_0_rec_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ChainFromComplete_alt_0_rec_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ChainFromComplete_alt_0_rec_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ChainFromComplete_alt_0_rec_alt_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec next = null;

        public GRGEN_LGSP.LGSPNode ChainFromComplete_node_from_inlined__sub0_2;
        
        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 ChainFromComplete_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromComplete.ChainFromComplete_alt_0_CaseNums.@base];
                // SubPreset ChainFromComplete_node_from_inlined__sub0_2 
                GRGEN_LGSP.LGSPNode candidate_ChainFromComplete_node_from_inlined__sub0_2 = ChainFromComplete_node_from_inlined__sub0_2;
                // NegativePattern 
                {
                    ++isoSpace;
                    uint prev_neg_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec__candidate_ChainFromComplete_node_from_inlined__sub0_2;
                    prev_neg_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec__candidate_ChainFromComplete_node_from_inlined__sub0_2 = candidate_ChainFromComplete_node_from_inlined__sub0_2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    candidate_ChainFromComplete_node_from_inlined__sub0_2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    // Extend Outgoing ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_2 from ChainFromComplete_node_from_inlined__sub0_2 
                    GRGEN_LGSP.LGSPEdge head_candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_2 = candidate_ChainFromComplete_node_from_inlined__sub0_2.lgspOuthead;
                    if(head_candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_2 != null)
                    {
                        GRGEN_LGSP.LGSPEdge candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_2 = head_candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_2;
                        do
                        {
                            if(candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_2.lgspType.TypeID!=1) {
                                continue;
                            }
                            if((candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                            {
                                continue;
                            }
                            // Implicit Target ChainFromComplete_alt_0_base_neg_0_node__node0_inlined__sub0_2 from ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_2 
                            GRGEN_LGSP.LGSPNode candidate_ChainFromComplete_alt_0_base_neg_0_node__node0_inlined__sub0_2 = candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_2.lgspTarget;
                            if((candidate_ChainFromComplete_alt_0_base_neg_0_node__node0_inlined__sub0_2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                            {
                                continue;
                            }
                            if((candidate_ChainFromComplete_alt_0_base_neg_0_node__node0_inlined__sub0_2.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_ChainFromComplete_node_from_inlined__sub0_2.lgspFlags = candidate_ChainFromComplete_node_from_inlined__sub0_2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec__candidate_ChainFromComplete_node_from_inlined__sub0_2;
                            --isoSpace;
                            goto label3;
                        }
                        while( (candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_2 = candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_2.lgspOutNext) != head_candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_2 );
                    }
                    candidate_ChainFromComplete_node_from_inlined__sub0_2.lgspFlags = candidate_ChainFromComplete_node_from_inlined__sub0_2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0_inlined__sub0_2_in_ChainFromComplete_alt_0_rec__candidate_ChainFromComplete_node_from_inlined__sub0_2;
                    --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);
                    Pattern_ChainFromComplete.Match_ChainFromComplete_alt_0_base match = new Pattern_ChainFromComplete.Match_ChainFromComplete_alt_0_base();
                    match._node_from = candidate_ChainFromComplete_node_from_inlined__sub0_2;
                    currentFoundPartialMatch.Push(match);
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        openTasks.Push(this);
                        return;
                    }
                    goto label4;
                }
                // 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_ChainFromComplete.Match_ChainFromComplete_alt_0_base match = new Pattern_ChainFromComplete.Match_ChainFromComplete_alt_0_base();
                        match._node_from = candidate_ChainFromComplete_node_from_inlined__sub0_2;
                        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;
                    }
                    goto label5;
                }
label3: ;
label4: ;
label5: ;
            } 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 ChainFromComplete_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromComplete.ChainFromComplete_alt_0_CaseNums.@rec];
                // SubPreset ChainFromComplete_node_from_inlined__sub0_2 
                GRGEN_LGSP.LGSPNode candidate_ChainFromComplete_node_from_inlined__sub0_2 = ChainFromComplete_node_from_inlined__sub0_2;
                // Extend Outgoing ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2 from ChainFromComplete_node_from_inlined__sub0_2 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2 = candidate_ChainFromComplete_node_from_inlined__sub0_2.lgspOuthead;
                if(head_candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2 = head_candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2;
                    do
                    {
                        if(candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Implicit Target ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2 from ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2 = candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2.lgspTarget;
                        if((candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            continue;
                        }
                        if((candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Push subpattern matching task for _sub0_inlined__sub0_2
                        PatternAction_ChainFromComplete taskFor__sub0_inlined__sub0_2 = PatternAction_ChainFromComplete.getNewTask(actionEnv, openTasks);
                        taskFor__sub0_inlined__sub0_2.ChainFromComplete_node_from = candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2;
                        taskFor__sub0_inlined__sub0_2.searchPatternpath = false;
                        taskFor__sub0_inlined__sub0_2.matchOfNestingPattern = null;
                        taskFor__sub0_inlined__sub0_2.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor__sub0_inlined__sub0_2);
                        uint prevGlobal__candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2;
                        prevGlobal__candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2 = candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2;
                        prevGlobal__candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2 = candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop subpattern matching task for _sub0_inlined__sub0_2
                        openTasks.Pop();
                        PatternAction_ChainFromComplete.releaseTask(taskFor__sub0_inlined__sub0_2);
                        // 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_ChainFromComplete.Match_ChainFromComplete_alt_0_rec match = new Pattern_ChainFromComplete.Match_ChainFromComplete_alt_0_rec();
                                match._node_from = candidate_ChainFromComplete_node_from_inlined__sub0_2;
                                match._node_to = candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2;
                                match._edge__edge0 = candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2;
                                match.__sub0 = (@Pattern_ChainFromComplete.Match_ChainFromComplete)currentFoundPartialMatch.Pop();
                                match.__sub0._matchOfEnclosingPattern = 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_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2.lgspFlags = candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2;
                                candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2.lgspFlags = candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2.lgspFlags = candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2;
                            candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2.lgspFlags = candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2;
                            continue;
                        }
                        candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2.lgspFlags = candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_2;
                        candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2.lgspFlags = candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2;
                    }
                    while( (candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2 = candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2.lgspOutNext) != head_candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_2 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class PatternAction_ChainFromCompleteArbitraryPatternpathLocked : GRGEN_LGSP.LGSPSubpatternAction
    {
        private PatternAction_ChainFromCompleteArbitraryPatternpathLocked(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_)
            : base(null)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
            patternGraph = Pattern_ChainFromCompleteArbitraryPatternpathLocked.Instance.patternGraph;
        }

        public static PatternAction_ChainFromCompleteArbitraryPatternpathLocked getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_) {
            PatternAction_ChainFromCompleteArbitraryPatternpathLocked newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new PatternAction_ChainFromCompleteArbitraryPatternpathLocked(actionEnv_, openTasks_);
            }
            return newTask;
        }

        public static void releaseTask(PatternAction_ChainFromCompleteArbitraryPatternpathLocked oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static PatternAction_ChainFromCompleteArbitraryPatternpathLocked freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private PatternAction_ChainFromCompleteArbitraryPatternpathLocked next = null;

        public GRGEN_LGSP.LGSPNode ChainFromCompleteArbitraryPatternpathLocked_node_from;
        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked patternpath_match_ChainFromCompleteArbitraryPatternpathLocked = null;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // SubPreset ChainFromCompleteArbitraryPatternpathLocked_node_from 
            GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from = ChainFromCompleteArbitraryPatternpathLocked_node_from;
            // build match of ChainFromCompleteArbitraryPatternpathLocked for patternpath checks
            if(patternpath_match_ChainFromCompleteArbitraryPatternpathLocked==null) patternpath_match_ChainFromCompleteArbitraryPatternpathLocked = new Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked();
            patternpath_match_ChainFromCompleteArbitraryPatternpathLocked._matchOfEnclosingPattern = matchOfNestingPattern;
            patternpath_match_ChainFromCompleteArbitraryPatternpathLocked._node_from = candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from;
            // Push alternative matching task for ChainFromCompleteArbitraryPatternpathLocked_alt_0
            AlternativeAction_ChainFromCompleteArbitraryPatternpathLocked_alt_0 taskFor_alt_0 = AlternativeAction_ChainFromCompleteArbitraryPatternpathLocked_alt_0.getNewTask(actionEnv, openTasks, Pattern_ChainFromCompleteArbitraryPatternpathLocked.Instance.patternGraph.alternatives[(int)Pattern_ChainFromCompleteArbitraryPatternpathLocked.ChainFromCompleteArbitraryPatternpathLocked_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0.ChainFromCompleteArbitraryPatternpathLocked_node_from = candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from;
            taskFor_alt_0.searchPatternpath = searchPatternpath;
            taskFor_alt_0.matchOfNestingPattern = patternpath_match_ChainFromCompleteArbitraryPatternpathLocked;
            taskFor_alt_0.lastMatchAtPreviousNestingLevel = lastMatchAtPreviousNestingLevel;
            openTasks.Push(taskFor_alt_0);
            // Match subpatterns 
            openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
            // Pop alternative matching task for ChainFromCompleteArbitraryPatternpathLocked_alt_0
            openTasks.Pop();
            AlternativeAction_ChainFromCompleteArbitraryPatternpathLocked_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_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked match = new Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked();
                    match._node_from = candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from;
                    match._alt_0 = (Pattern_ChainFromCompleteArbitraryPatternpathLocked.IMatch_ChainFromCompleteArbitraryPatternpathLocked_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)
                {
                    openTasks.Push(this);
                    return;
                }
                openTasks.Push(this);
                return;
            }
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ChainFromCompleteArbitraryPatternpathLocked_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ChainFromCompleteArbitraryPatternpathLocked_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ChainFromCompleteArbitraryPatternpathLocked_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ChainFromCompleteArbitraryPatternpathLocked_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_ChainFromCompleteArbitraryPatternpathLocked_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ChainFromCompleteArbitraryPatternpathLocked_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ChainFromCompleteArbitraryPatternpathLocked_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ChainFromCompleteArbitraryPatternpathLocked_alt_0 next = null;

        public GRGEN_LGSP.LGSPNode ChainFromCompleteArbitraryPatternpathLocked_node_from;
        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0 patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0 = null;
            Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base = null;
            Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec = null;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // Alternative case ChainFromCompleteArbitraryPatternpathLocked_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromCompleteArbitraryPatternpathLocked.ChainFromCompleteArbitraryPatternpathLocked_alt_0_CaseNums.@base];
                // SubPreset ChainFromCompleteArbitraryPatternpathLocked_node_from 
                GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from = ChainFromCompleteArbitraryPatternpathLocked_node_from;
                // build match of ChainFromCompleteArbitraryPatternpathLocked_alt_0_base for patternpath checks
                if(patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base==null) patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base = new Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base();
                patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base._matchOfEnclosingPattern = matchOfNestingPattern;
                patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base._node_from = candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from;
                // NegativePattern 
                {
                    ++isoSpace;
                    uint prev_neg_0__candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from;
                    prev_neg_0__candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from = candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    // both directions of ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0
                    for(int directionRunCounterOf_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0 = 0; directionRunCounterOf_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0 < 2; ++directionRunCounterOf_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0)
                    {
                        // Extend IncomingOrOutgoing ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0 from ChainFromCompleteArbitraryPatternpathLocked_node_from 
                        GRGEN_LGSP.LGSPEdge head_candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0 = directionRunCounterOf_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0==0 ? candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from.lgspInhead : candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from.lgspOuthead;
                        if(head_candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0 = head_candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0;
                            do
                            {
                                if((candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_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;
                                }
                                if((candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN && GRGEN_LGSP.PatternpathIsomorphyChecker.IsMatched(candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0, patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base))
                                {
                                    continue;
                                }
                                // Implicit TheOther ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0 from ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0 
                                GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0 = candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from==candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0.lgspSource ? candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0.lgspTarget : candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0.lgspSource;
                                if((candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_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;
                                }
                                if((candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN && GRGEN_LGSP.PatternpathIsomorphyChecker.IsMatched(candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0, patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base))
                                {
                                    continue;
                                }
                                // build match of ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0 for patternpath checks
                                if(patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0==null) patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0 = new Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0();
                                patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0._matchOfEnclosingPattern = patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base;
                                patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0._node_from = candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from;
                                patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0._node__node0 = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0;
                                patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0._edge__edge0 = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0;
                                uint prevSomeGlobal_neg_0__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0;
                                prevSomeGlobal_neg_0__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0 = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
                                candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
                                uint prevSomeGlobal_neg_0__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0;
                                prevSomeGlobal_neg_0__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0 = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
                                candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
                                // negative pattern found
                                candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal_neg_0__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0;
                                candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal_neg_0__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0;
                                candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0__candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from;
                                --isoSpace;
                                goto label6;
                                candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal_neg_0__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_node__node0;
                                candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal_neg_0__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0;
                            }
                            while( (directionRunCounterOf_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0==0 ? candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0 = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0.lgspInNext : candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0 = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0.lgspOutNext) != head_candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base_neg_0_edge__edge0 );
                        }
                    }
                    candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0__candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from;
                    --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);
                    Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base match = new Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base();
                    match._node_from = candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from;
                    currentFoundPartialMatch.Push(match);
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        openTasks.Push(this);
                        return;
                    }
                    goto label7;
                }
                // 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_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base match = new Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_base();
                        match._node_from = candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from;
                        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;
                    }
                    goto label8;
                }
label6: ;
label7: ;
label8: ;
            } 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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromCompleteArbitraryPatternpathLocked.ChainFromCompleteArbitraryPatternpathLocked_alt_0_CaseNums.@rec];
                // SubPreset ChainFromCompleteArbitraryPatternpathLocked_node_from 
                GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from = ChainFromCompleteArbitraryPatternpathLocked_node_from;
                // Extend Outgoing ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0 from ChainFromCompleteArbitraryPatternpathLocked_node_from 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0 = candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from.lgspOuthead;
                if(head_candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0 = head_candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0;
                    do
                    {
                        if(candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_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 ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to from ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspTarget;
                        if((candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            continue;
                        }
                        if((candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // build match of ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec for patternpath checks
                        if(patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec==null) patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec = new Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec();
                        patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec._matchOfEnclosingPattern = matchOfNestingPattern;
                        patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec._node_from = candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from;
                        patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec._node_to = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to;
                        patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec._edge__edge0 = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0;
                        uint prevSomeGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to;
                        prevSomeGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
                        candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
                        uint prevSomeGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0;
                        prevSomeGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0 = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
                        candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
                        // Push subpattern matching task for _sub0
                        PatternAction_ChainFromCompleteArbitraryPatternpathLocked taskFor__sub0 = PatternAction_ChainFromCompleteArbitraryPatternpathLocked.getNewTask(actionEnv, openTasks);
                        taskFor__sub0.ChainFromCompleteArbitraryPatternpathLocked_node_from = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to;
                        taskFor__sub0.searchPatternpath = searchPatternpath;
                        taskFor__sub0.matchOfNestingPattern = patternpath_match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec;
                        taskFor__sub0.lastMatchAtPreviousNestingLevel = lastMatchAtPreviousNestingLevel;
                        openTasks.Push(taskFor__sub0);
                        uint prevGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to;
                        prevGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0;
                        prevGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0 = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop subpattern matching task for _sub0
                        openTasks.Pop();
                        PatternAction_ChainFromCompleteArbitraryPatternpathLocked.releaseTask(taskFor__sub0);
                        // 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_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec match = new Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec();
                                match._node_from = candidate_ChainFromCompleteArbitraryPatternpathLocked_node_from;
                                match._node_to = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to;
                                match._edge__edge0 = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0;
                                match.__sub0 = (@Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked)currentFoundPartialMatch.Pop();
                                match.__sub0._matchOfEnclosingPattern = 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_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0;
                                candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to;
                                candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0;
                                candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0;
                            candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to;
                            candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0;
                            candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to;
                            continue;
                        }
                        candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to;
                        candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0;
                        candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_node_to;
                        candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0;
                    }
                    while( (candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0 = candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0.lgspOutNext) != head_candidate_ChainFromCompleteArbitraryPatternpathLocked_alt_0_rec_edge__edge0 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class PatternAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards : GRGEN_LGSP.LGSPSubpatternAction
    {
        private PatternAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_)
            : base(null)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
            patternGraph = Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph;
        }

        public static PatternAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_) {
            PatternAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new PatternAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards(actionEnv_, openTasks_);
            }
            return newTask;
        }

        public static void releaseTask(PatternAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static PatternAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private PatternAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards next = null;

        public GRGEN_LGSP.LGSPNode ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from;
        
        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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from 
            GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from = ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from;
            // Push alternative matching task for ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0
            AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0 taskFor_alt_0 = AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0.getNewTask(actionEnv, openTasks, Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph.alternatives[(int)Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from;
            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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0
            openTasks.Pop();
            AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards match = new Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards();
                    match._node_from = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from;
                    match._alt_0 = (Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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)
                {
                    openTasks.Push(this);
                    return;
                }
                openTasks.Push(this);
                return;
            }
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0 next = null;

        public GRGEN_LGSP.LGSPNode ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from;
        
        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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_CaseNums.@base];
                // SubPreset ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from 
                GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from = ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from;
                // NegativePattern 
                {
                    ++isoSpace;
                    uint prev_neg_0__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from;
                    prev_neg_0__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    // both directions of ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0
                    for(int directionRunCounterOf_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0 = 0; directionRunCounterOf_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0 < 2; ++directionRunCounterOf_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0)
                    {
                        // Extend IncomingOrOutgoing ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0 from ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from 
                        GRGEN_LGSP.LGSPEdge head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0 = directionRunCounterOf_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0==0 ? candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from.lgspInhead : candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from.lgspOuthead;
                        if(head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0 = head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0;
                            do
                            {
                                if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_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 TheOther ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0 from ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0 
                                GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from==candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0.lgspSource ? candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0.lgspTarget : candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0.lgspSource;
                                if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from;
                                --isoSpace;
                                goto label9;
                            }
                            while( (directionRunCounterOf_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0==0 ? candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0.lgspInNext : candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0.lgspOutNext) != head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0 );
                        }
                    }
                    candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from;
                    --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);
                    Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base match = new Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base();
                    match._node_from = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from;
                    currentFoundPartialMatch.Push(match);
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        openTasks.Push(this);
                        return;
                    }
                    goto label10;
                }
                // 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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base match = new Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base();
                        match._node_from = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from;
                        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;
                    }
                    goto label11;
                }
label9: ;
label10: ;
label11: ;
            } 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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_CaseNums.@rec];
                // SubPreset ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from 
                GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from = ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from;
                // Extend Outgoing ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0 from ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from.lgspOuthead;
                if(head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0 = head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0;
                    do
                    {
                        if(candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to from ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0.lgspTarget;
                        if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            continue;
                        }
                        if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Element ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3 assigned from other element ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to;
                        // Push alternative matching task for ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec
                        AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec taskFor_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec = AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec.getNewTask(actionEnv, openTasks, Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph.alternatives[(int)Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_AltNums.@alt_0].alternativeCases);
                        taskFor_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3;
                        taskFor_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec.searchPatternpath = false;
                        taskFor_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec.matchOfNestingPattern = null;
                        taskFor_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec);
                        uint prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to;
                        prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0;
                        prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0.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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec
                        openTasks.Pop();
                        AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec.releaseTask(taskFor_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec);
                        // 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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec match = new Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec();
                                Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards match__sub0 = new Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards();
                                match__sub0.SetMatchOfEnclosingPattern(match);
                                match._node_from = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from;
                                match._node_to = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to;
                                match__sub0._node_from = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3;
                                match._edge__edge0 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0;
                                match.__sub0 = match__sub0;
                                match__sub0._alt_0 = (Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0)currentFoundPartialMatch.Pop();
                                match__sub0._alt_0.SetMatchOfEnclosingPattern(match__sub0);
                                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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0;
                                candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0;
                            candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to;
                            continue;
                        }
                        candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to;
                        candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0;
                    }
                    while( (candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0.lgspOutNext) != head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_alt_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec next = null;

        public GRGEN_LGSP.LGSPNode ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3;
        
        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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_CaseNums.@base];
                // SubPreset ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3 
                GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3 = ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3;
                // NegativePattern 
                {
                    ++isoSpace;
                    uint prev_neg_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3;
                    prev_neg_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    // both directions of ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3
                    for(int directionRunCounterOf_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3 = 0; directionRunCounterOf_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3 < 2; ++directionRunCounterOf_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3)
                    {
                        // Extend IncomingOrOutgoing ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3 from ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3 
                        GRGEN_LGSP.LGSPEdge head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3 = directionRunCounterOf_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3==0 ? candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3.lgspInhead : candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3.lgspOuthead;
                        if(head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3 = head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3;
                            do
                            {
                                if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    continue;
                                }
                                // Implicit TheOther ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0_inlined__sub0_3 from ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3 
                                GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0_inlined__sub0_3 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3==candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3.lgspSource ? candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3.lgspTarget : candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3.lgspSource;
                                if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0_inlined__sub0_3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0_inlined__sub0_3.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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3;
                                --isoSpace;
                                goto label12;
                            }
                            while( (directionRunCounterOf_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3==0 ? candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3.lgspInNext : candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3.lgspOutNext) != head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_3 );
                        }
                    }
                    candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0_inlined__sub0_3_in_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3;
                    --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);
                    Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base match = new Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base();
                    match._node_from = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3;
                    currentFoundPartialMatch.Push(match);
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        openTasks.Push(this);
                        return;
                    }
                    goto label13;
                }
                // 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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base match = new Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base();
                        match._node_from = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3;
                        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;
                    }
                    goto label14;
                }
label12: ;
label13: ;
label14: ;
            } 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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_CaseNums.@rec];
                // SubPreset ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3 
                GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3 = ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3;
                // Extend Outgoing ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3 from ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3.lgspOuthead;
                if(head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3 = head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3;
                    do
                    {
                        if(candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Implicit Target ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3 from ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3.lgspTarget;
                        if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            continue;
                        }
                        if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Push subpattern matching task for _sub0_inlined__sub0_3
                        PatternAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards taskFor__sub0_inlined__sub0_3 = PatternAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.getNewTask(actionEnv, openTasks);
                        taskFor__sub0_inlined__sub0_3.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3;
                        taskFor__sub0_inlined__sub0_3.searchPatternpath = false;
                        taskFor__sub0_inlined__sub0_3.matchOfNestingPattern = null;
                        taskFor__sub0_inlined__sub0_3.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor__sub0_inlined__sub0_3);
                        uint prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3;
                        prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3;
                        prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop subpattern matching task for _sub0_inlined__sub0_3
                        openTasks.Pop();
                        PatternAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.releaseTask(taskFor__sub0_inlined__sub0_3);
                        // 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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec match = new Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec();
                                match._node_from = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_3;
                                match._node_to = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3;
                                match._edge__edge0 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3;
                                match.__sub0 = (@Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards)currentFoundPartialMatch.Pop();
                                match.__sub0._matchOfEnclosingPattern = 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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3;
                                candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3;
                            candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3;
                            continue;
                        }
                        candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_3;
                        candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3;
                    }
                    while( (candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3.lgspOutNext) != head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_3 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class PatternAction_Blowball : GRGEN_LGSP.LGSPSubpatternAction
    {
        private PatternAction_Blowball(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_)
            : base(null)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
            patternGraph = Pattern_Blowball.Instance.patternGraph;
        }

        public static PatternAction_Blowball getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_) {
            PatternAction_Blowball newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new PatternAction_Blowball(actionEnv_, openTasks_);
            }
            return newTask;
        }

        public static void releaseTask(PatternAction_Blowball oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static PatternAction_Blowball freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private PatternAction_Blowball next = null;

        public GRGEN_LGSP.LGSPNode Blowball_node_head;
        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            Pattern_Blowball.Match_Blowball patternpath_match_Blowball = null;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // SubPreset Blowball_node_head 
            GRGEN_LGSP.LGSPNode candidate_Blowball_node_head = Blowball_node_head;
            // build match of Blowball for patternpath checks
            if(patternpath_match_Blowball==null) patternpath_match_Blowball = new Pattern_Blowball.Match_Blowball();
            patternpath_match_Blowball._matchOfEnclosingPattern = matchOfNestingPattern;
            patternpath_match_Blowball._node_head = candidate_Blowball_node_head;
            // Push alternative matching task for Blowball_alt_0
            AlternativeAction_Blowball_alt_0 taskFor_alt_0 = AlternativeAction_Blowball_alt_0.getNewTask(actionEnv, openTasks, Pattern_Blowball.Instance.patternGraph.alternatives[(int)Pattern_Blowball.Blowball_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0.Blowball_node_head = candidate_Blowball_node_head;
            taskFor_alt_0.searchPatternpath = searchPatternpath;
            taskFor_alt_0.matchOfNestingPattern = patternpath_match_Blowball;
            taskFor_alt_0.lastMatchAtPreviousNestingLevel = lastMatchAtPreviousNestingLevel;
            openTasks.Push(taskFor_alt_0);
            // Match subpatterns 
            openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
            // Pop alternative matching task for Blowball_alt_0
            openTasks.Pop();
            AlternativeAction_Blowball_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_Blowball.Match_Blowball match = new Pattern_Blowball.Match_Blowball();
                    match._node_head = candidate_Blowball_node_head;
                    match._alt_0 = (Pattern_Blowball.IMatch_Blowball_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)
                {
                    openTasks.Push(this);
                    return;
                }
                openTasks.Push(this);
                return;
            }
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_Blowball_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_Blowball_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_Blowball_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_Blowball_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_Blowball_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_Blowball_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_Blowball_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_Blowball_alt_0 next = null;

        public GRGEN_LGSP.LGSPNode Blowball_node_head;
        
        public override void myMatch(List<Stack<GRGEN_LIBGR.IMatch>> foundPartialMatches, int maxMatches, int isoSpace)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            Pattern_Blowball.Match_Blowball_alt_0_end_neg_0 patternpath_match_Blowball_alt_0_end_neg_0 = null;
            Pattern_Blowball.Match_Blowball_alt_0_end patternpath_match_Blowball_alt_0_end = null;
            Pattern_Blowball.Match_Blowball_alt_0_further patternpath_match_Blowball_alt_0_further = null;
            openTasks.Pop();
            List<Stack<GRGEN_LIBGR.IMatch>> matchesList = foundPartialMatches;
            if(matchesList.Count!=0) throw new ApplicationException(); //debug assert
            // Alternative case Blowball_alt_0_end 
            do {
                patternGraph = patternGraphs[(int)Pattern_Blowball.Blowball_alt_0_CaseNums.@end];
                // SubPreset Blowball_node_head 
                GRGEN_LGSP.LGSPNode candidate_Blowball_node_head = Blowball_node_head;
                // build match of Blowball_alt_0_end for patternpath checks
                if(patternpath_match_Blowball_alt_0_end==null) patternpath_match_Blowball_alt_0_end = new Pattern_Blowball.Match_Blowball_alt_0_end();
                patternpath_match_Blowball_alt_0_end._matchOfEnclosingPattern = matchOfNestingPattern;
                patternpath_match_Blowball_alt_0_end._node_head = candidate_Blowball_node_head;
                // NegativePattern 
                {
                    ++isoSpace;
                    uint prev_neg_0__candidate_Blowball_node_head;
                    prev_neg_0__candidate_Blowball_node_head = candidate_Blowball_node_head.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    candidate_Blowball_node_head.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    // Extend Outgoing Blowball_alt_0_end_neg_0_edge__edge0 from Blowball_node_head 
                    GRGEN_LGSP.LGSPEdge head_candidate_Blowball_alt_0_end_neg_0_edge__edge0 = candidate_Blowball_node_head.lgspOuthead;
                    if(head_candidate_Blowball_alt_0_end_neg_0_edge__edge0 != null)
                    {
                        GRGEN_LGSP.LGSPEdge candidate_Blowball_alt_0_end_neg_0_edge__edge0 = head_candidate_Blowball_alt_0_end_neg_0_edge__edge0;
                        do
                        {
                            if(candidate_Blowball_alt_0_end_neg_0_edge__edge0.lgspType.TypeID!=1) {
                                continue;
                            }
                            if((candidate_Blowball_alt_0_end_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;
                            }
                            if((candidate_Blowball_alt_0_end_neg_0_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN && GRGEN_LGSP.PatternpathIsomorphyChecker.IsMatched(candidate_Blowball_alt_0_end_neg_0_edge__edge0, patternpath_match_Blowball_alt_0_end))
                            {
                                continue;
                            }
                            // Implicit Target Blowball_alt_0_end_neg_0_node__node0 from Blowball_alt_0_end_neg_0_edge__edge0 
                            GRGEN_LGSP.LGSPNode candidate_Blowball_alt_0_end_neg_0_node__node0 = candidate_Blowball_alt_0_end_neg_0_edge__edge0.lgspTarget;
                            if((candidate_Blowball_alt_0_end_neg_0_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                            {
                                continue;
                            }
                            if((candidate_Blowball_alt_0_end_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;
                            }
                            if((candidate_Blowball_alt_0_end_neg_0_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN && GRGEN_LGSP.PatternpathIsomorphyChecker.IsMatched(candidate_Blowball_alt_0_end_neg_0_node__node0, patternpath_match_Blowball_alt_0_end))
                            {
                                continue;
                            }
                            // build match of Blowball_alt_0_end_neg_0 for patternpath checks
                            if(patternpath_match_Blowball_alt_0_end_neg_0==null) patternpath_match_Blowball_alt_0_end_neg_0 = new Pattern_Blowball.Match_Blowball_alt_0_end_neg_0();
                            patternpath_match_Blowball_alt_0_end_neg_0._matchOfEnclosingPattern = patternpath_match_Blowball_alt_0_end;
                            patternpath_match_Blowball_alt_0_end_neg_0._node_head = candidate_Blowball_node_head;
                            patternpath_match_Blowball_alt_0_end_neg_0._node__node0 = candidate_Blowball_alt_0_end_neg_0_node__node0;
                            patternpath_match_Blowball_alt_0_end_neg_0._edge__edge0 = candidate_Blowball_alt_0_end_neg_0_edge__edge0;
                            uint prevSomeGlobal_neg_0__candidate_Blowball_alt_0_end_neg_0_node__node0;
                            prevSomeGlobal_neg_0__candidate_Blowball_alt_0_end_neg_0_node__node0 = candidate_Blowball_alt_0_end_neg_0_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
                            candidate_Blowball_alt_0_end_neg_0_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
                            uint prevSomeGlobal_neg_0__candidate_Blowball_alt_0_end_neg_0_edge__edge0;
                            prevSomeGlobal_neg_0__candidate_Blowball_alt_0_end_neg_0_edge__edge0 = candidate_Blowball_alt_0_end_neg_0_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
                            candidate_Blowball_alt_0_end_neg_0_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
                            // negative pattern found
                            candidate_Blowball_alt_0_end_neg_0_edge__edge0.lgspFlags = candidate_Blowball_alt_0_end_neg_0_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal_neg_0__candidate_Blowball_alt_0_end_neg_0_edge__edge0;
                            candidate_Blowball_alt_0_end_neg_0_node__node0.lgspFlags = candidate_Blowball_alt_0_end_neg_0_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal_neg_0__candidate_Blowball_alt_0_end_neg_0_node__node0;
                            candidate_Blowball_node_head.lgspFlags = candidate_Blowball_node_head.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0__candidate_Blowball_node_head;
                            --isoSpace;
                            goto label15;
                            candidate_Blowball_alt_0_end_neg_0_node__node0.lgspFlags = candidate_Blowball_alt_0_end_neg_0_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal_neg_0__candidate_Blowball_alt_0_end_neg_0_node__node0;
                            candidate_Blowball_alt_0_end_neg_0_edge__edge0.lgspFlags = candidate_Blowball_alt_0_end_neg_0_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal_neg_0__candidate_Blowball_alt_0_end_neg_0_edge__edge0;
                        }
                        while( (candidate_Blowball_alt_0_end_neg_0_edge__edge0 = candidate_Blowball_alt_0_end_neg_0_edge__edge0.lgspOutNext) != head_candidate_Blowball_alt_0_end_neg_0_edge__edge0 );
                    }
                    candidate_Blowball_node_head.lgspFlags = candidate_Blowball_node_head.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0__candidate_Blowball_node_head;
                    --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);
                    Pattern_Blowball.Match_Blowball_alt_0_end match = new Pattern_Blowball.Match_Blowball_alt_0_end();
                    match._node_head = candidate_Blowball_node_head;
                    currentFoundPartialMatch.Push(match);
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        openTasks.Push(this);
                        return;
                    }
                    goto label16;
                }
                // 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_Blowball.Match_Blowball_alt_0_end match = new Pattern_Blowball.Match_Blowball_alt_0_end();
                        match._node_head = candidate_Blowball_node_head;
                        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;
                    }
                    goto label17;
                }
label15: ;
label16: ;
label17: ;
            } 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 Blowball_alt_0_further 
            do {
                patternGraph = patternGraphs[(int)Pattern_Blowball.Blowball_alt_0_CaseNums.@further];
                // SubPreset Blowball_node_head 
                GRGEN_LGSP.LGSPNode candidate_Blowball_node_head = Blowball_node_head;
                // Extend Outgoing Blowball_alt_0_further_edge__edge0 from Blowball_node_head 
                GRGEN_LGSP.LGSPEdge head_candidate_Blowball_alt_0_further_edge__edge0 = candidate_Blowball_node_head.lgspOuthead;
                if(head_candidate_Blowball_alt_0_further_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_Blowball_alt_0_further_edge__edge0 = head_candidate_Blowball_alt_0_further_edge__edge0;
                    do
                    {
                        if(candidate_Blowball_alt_0_further_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_Blowball_alt_0_further_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 Blowball_alt_0_further_node__node0 from Blowball_alt_0_further_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_Blowball_alt_0_further_node__node0 = candidate_Blowball_alt_0_further_edge__edge0.lgspTarget;
                        if((candidate_Blowball_alt_0_further_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            continue;
                        }
                        if((candidate_Blowball_alt_0_further_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // build match of Blowball_alt_0_further for patternpath checks
                        if(patternpath_match_Blowball_alt_0_further==null) patternpath_match_Blowball_alt_0_further = new Pattern_Blowball.Match_Blowball_alt_0_further();
                        patternpath_match_Blowball_alt_0_further._matchOfEnclosingPattern = matchOfNestingPattern;
                        patternpath_match_Blowball_alt_0_further._node_head = candidate_Blowball_node_head;
                        patternpath_match_Blowball_alt_0_further._node__node0 = candidate_Blowball_alt_0_further_node__node0;
                        patternpath_match_Blowball_alt_0_further._edge__edge0 = candidate_Blowball_alt_0_further_edge__edge0;
                        uint prevSomeGlobal__candidate_Blowball_alt_0_further_node__node0;
                        prevSomeGlobal__candidate_Blowball_alt_0_further_node__node0 = candidate_Blowball_alt_0_further_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
                        candidate_Blowball_alt_0_further_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
                        uint prevSomeGlobal__candidate_Blowball_alt_0_further_edge__edge0;
                        prevSomeGlobal__candidate_Blowball_alt_0_further_edge__edge0 = candidate_Blowball_alt_0_further_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
                        candidate_Blowball_alt_0_further_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
                        // Push subpattern matching task for _sub0
                        PatternAction_Blowball taskFor__sub0 = PatternAction_Blowball.getNewTask(actionEnv, openTasks);
                        taskFor__sub0.Blowball_node_head = candidate_Blowball_node_head;
                        taskFor__sub0.searchPatternpath = searchPatternpath;
                        taskFor__sub0.matchOfNestingPattern = patternpath_match_Blowball_alt_0_further;
                        taskFor__sub0.lastMatchAtPreviousNestingLevel = lastMatchAtPreviousNestingLevel;
                        openTasks.Push(taskFor__sub0);
                        uint prevGlobal__candidate_Blowball_alt_0_further_node__node0;
                        prevGlobal__candidate_Blowball_alt_0_further_node__node0 = candidate_Blowball_alt_0_further_node__node0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_Blowball_alt_0_further_node__node0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_Blowball_alt_0_further_edge__edge0;
                        prevGlobal__candidate_Blowball_alt_0_further_edge__edge0 = candidate_Blowball_alt_0_further_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_Blowball_alt_0_further_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop subpattern matching task for _sub0
                        openTasks.Pop();
                        PatternAction_Blowball.releaseTask(taskFor__sub0);
                        // 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_Blowball.Match_Blowball_alt_0_further match = new Pattern_Blowball.Match_Blowball_alt_0_further();
                                match._node_head = candidate_Blowball_node_head;
                                match._node__node0 = candidate_Blowball_alt_0_further_node__node0;
                                match._edge__edge0 = candidate_Blowball_alt_0_further_edge__edge0;
                                match.__sub0 = (@Pattern_Blowball.Match_Blowball)currentFoundPartialMatch.Pop();
                                match.__sub0._matchOfEnclosingPattern = 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_Blowball_alt_0_further_edge__edge0.lgspFlags = candidate_Blowball_alt_0_further_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Blowball_alt_0_further_edge__edge0;
                                candidate_Blowball_alt_0_further_node__node0.lgspFlags = candidate_Blowball_alt_0_further_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Blowball_alt_0_further_node__node0;
                                candidate_Blowball_alt_0_further_edge__edge0.lgspFlags = candidate_Blowball_alt_0_further_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_Blowball_alt_0_further_edge__edge0;
                                candidate_Blowball_alt_0_further_node__node0.lgspFlags = candidate_Blowball_alt_0_further_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_Blowball_alt_0_further_node__node0;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_Blowball_alt_0_further_edge__edge0.lgspFlags = candidate_Blowball_alt_0_further_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Blowball_alt_0_further_edge__edge0;
                            candidate_Blowball_alt_0_further_node__node0.lgspFlags = candidate_Blowball_alt_0_further_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Blowball_alt_0_further_node__node0;
                            candidate_Blowball_alt_0_further_edge__edge0.lgspFlags = candidate_Blowball_alt_0_further_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_Blowball_alt_0_further_edge__edge0;
                            candidate_Blowball_alt_0_further_node__node0.lgspFlags = candidate_Blowball_alt_0_further_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_Blowball_alt_0_further_node__node0;
                            continue;
                        }
                        candidate_Blowball_alt_0_further_node__node0.lgspFlags = candidate_Blowball_alt_0_further_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Blowball_alt_0_further_node__node0;
                        candidate_Blowball_alt_0_further_edge__edge0.lgspFlags = candidate_Blowball_alt_0_further_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_Blowball_alt_0_further_edge__edge0;
                        candidate_Blowball_alt_0_further_node__node0.lgspFlags = candidate_Blowball_alt_0_further_node__node0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_Blowball_alt_0_further_node__node0;
                        candidate_Blowball_alt_0_further_edge__edge0.lgspFlags = candidate_Blowball_alt_0_further_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_Blowball_alt_0_further_edge__edge0;
                    }
                    while( (candidate_Blowball_alt_0_further_edge__edge0 = candidate_Blowball_alt_0_further_edge__edge0.lgspOutNext) != head_candidate_Blowball_alt_0_further_edge__edge0 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class PatternAction_ReverseChainFromTo : GRGEN_LGSP.LGSPSubpatternAction
    {
        private PatternAction_ReverseChainFromTo(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_)
            : base(null)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
            patternGraph = Pattern_ReverseChainFromTo.Instance.patternGraph;
        }

        public static PatternAction_ReverseChainFromTo getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_) {
            PatternAction_ReverseChainFromTo newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new PatternAction_ReverseChainFromTo(actionEnv_, openTasks_);
            }
            return newTask;
        }

        public static void releaseTask(PatternAction_ReverseChainFromTo oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static PatternAction_ReverseChainFromTo freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private PatternAction_ReverseChainFromTo next = null;

        public GRGEN_LGSP.LGSPNode ReverseChainFromTo_node_from;
        public GRGEN_LGSP.LGSPNode ReverseChainFromTo_node_to;
        
        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 ReverseChainFromTo_node_from 
            GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_from = ReverseChainFromTo_node_from;
            // SubPreset ReverseChainFromTo_node_to 
            GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_to = ReverseChainFromTo_node_to;
            // Push alternative matching task for ReverseChainFromTo_alt_0
            AlternativeAction_ReverseChainFromTo_alt_0 taskFor_alt_0 = AlternativeAction_ReverseChainFromTo_alt_0.getNewTask(actionEnv, openTasks, Pattern_ReverseChainFromTo.Instance.patternGraph.alternatives[(int)Pattern_ReverseChainFromTo.ReverseChainFromTo_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0.ReverseChainFromTo_node_to = candidate_ReverseChainFromTo_node_to;
            taskFor_alt_0.ReverseChainFromTo_node_from = candidate_ReverseChainFromTo_node_from;
            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 ReverseChainFromTo_alt_0
            openTasks.Pop();
            AlternativeAction_ReverseChainFromTo_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_ReverseChainFromTo.Match_ReverseChainFromTo match = new Pattern_ReverseChainFromTo.Match_ReverseChainFromTo();
                    match._node_from = candidate_ReverseChainFromTo_node_from;
                    match._node_to = candidate_ReverseChainFromTo_node_to;
                    match._alt_0 = (Pattern_ReverseChainFromTo.IMatch_ReverseChainFromTo_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)
                {
                    openTasks.Push(this);
                    return;
                }
                openTasks.Push(this);
                return;
            }
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ReverseChainFromTo_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ReverseChainFromTo_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ReverseChainFromTo_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ReverseChainFromTo_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_ReverseChainFromTo_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ReverseChainFromTo_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ReverseChainFromTo_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ReverseChainFromTo_alt_0 next = null;

        public GRGEN_LGSP.LGSPNode ReverseChainFromTo_node_to;
        public GRGEN_LGSP.LGSPNode ReverseChainFromTo_node_from;
        
        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 ReverseChainFromTo_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ReverseChainFromTo.ReverseChainFromTo_alt_0_CaseNums.@base];
                // SubPreset ReverseChainFromTo_node_to 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_to = ReverseChainFromTo_node_to;
                // SubPreset ReverseChainFromTo_node_from 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_from = ReverseChainFromTo_node_from;
                // Extend Outgoing ReverseChainFromTo_alt_0_base_edge__edge0 from ReverseChainFromTo_node_to 
                GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromTo_alt_0_base_edge__edge0 = candidate_ReverseChainFromTo_node_to.lgspOuthead;
                if(head_candidate_ReverseChainFromTo_alt_0_base_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromTo_alt_0_base_edge__edge0 = head_candidate_ReverseChainFromTo_alt_0_base_edge__edge0;
                    do
                    {
                        if(candidate_ReverseChainFromTo_alt_0_base_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_ReverseChainFromTo_alt_0_base_edge__edge0.lgspTarget != candidate_ReverseChainFromTo_node_from) {
                            continue;
                        }
                        if((candidate_ReverseChainFromTo_alt_0_base_edge__edge0.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_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_base match = new Pattern_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_base();
                            match._node_to = candidate_ReverseChainFromTo_node_to;
                            match._node_from = candidate_ReverseChainFromTo_node_from;
                            match._edge__edge0 = candidate_ReverseChainFromTo_alt_0_base_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_ReverseChainFromTo_alt_0_base_edge__edge0;
                        prevGlobal__candidate_ReverseChainFromTo_alt_0_base_edge__edge0 = candidate_ReverseChainFromTo_alt_0_base_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ReverseChainFromTo_alt_0_base_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)
                            {
                                Pattern_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_base match = new Pattern_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_base();
                                match._node_to = candidate_ReverseChainFromTo_node_to;
                                match._node_from = candidate_ReverseChainFromTo_node_from;
                                match._edge__edge0 = candidate_ReverseChainFromTo_alt_0_base_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_ReverseChainFromTo_alt_0_base_edge__edge0.lgspFlags = candidate_ReverseChainFromTo_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_base_edge__edge0;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ReverseChainFromTo_alt_0_base_edge__edge0.lgspFlags = candidate_ReverseChainFromTo_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_base_edge__edge0;
                            continue;
                        }
                        candidate_ReverseChainFromTo_alt_0_base_edge__edge0.lgspFlags = candidate_ReverseChainFromTo_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_base_edge__edge0;
                    }
                    while( (candidate_ReverseChainFromTo_alt_0_base_edge__edge0 = candidate_ReverseChainFromTo_alt_0_base_edge__edge0.lgspOutNext) != head_candidate_ReverseChainFromTo_alt_0_base_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 ReverseChainFromTo_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ReverseChainFromTo.ReverseChainFromTo_alt_0_CaseNums.@rec];
                // SubPreset ReverseChainFromTo_node_from 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_from = ReverseChainFromTo_node_from;
                // SubPreset ReverseChainFromTo_node_to 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_to = ReverseChainFromTo_node_to;
                // Element ReverseChainFromTo_node_to_inlined__sub0_4 assigned from other element ReverseChainFromTo_node_to 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_to_inlined__sub0_4 = candidate_ReverseChainFromTo_node_to;
                // Extend Incoming ReverseChainFromTo_alt_0_rec_edge__edge0 from ReverseChainFromTo_node_from 
                GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromTo_alt_0_rec_edge__edge0 = candidate_ReverseChainFromTo_node_from.lgspInhead;
                if(head_candidate_ReverseChainFromTo_alt_0_rec_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromTo_alt_0_rec_edge__edge0 = head_candidate_ReverseChainFromTo_alt_0_rec_edge__edge0;
                    do
                    {
                        if(candidate_ReverseChainFromTo_alt_0_rec_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ReverseChainFromTo_alt_0_rec_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 ReverseChainFromTo_alt_0_rec_node_intermediate from ReverseChainFromTo_alt_0_rec_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_alt_0_rec_node_intermediate = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0.lgspSource;
                        if((candidate_ReverseChainFromTo_alt_0_rec_node_intermediate.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0
                            && candidate_ReverseChainFromTo_alt_0_rec_node_intermediate==candidate_ReverseChainFromTo_node_from
                            )
                        {
                            continue;
                        }
                        if((candidate_ReverseChainFromTo_alt_0_rec_node_intermediate.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Element ReverseChainFromTo_node_from_inlined__sub0_4 assigned from other element ReverseChainFromTo_alt_0_rec_node_intermediate 
                        GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_from_inlined__sub0_4 = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate;
                        // Push alternative matching task for ReverseChainFromTo_alt_0_rec_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec
                        AlternativeAction_ReverseChainFromTo_alt_0_rec_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec taskFor_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec = AlternativeAction_ReverseChainFromTo_alt_0_rec_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec.getNewTask(actionEnv, openTasks, Pattern_ReverseChainFromTo.Instance.patternGraph.alternatives[(int)Pattern_ReverseChainFromTo.ReverseChainFromTo_AltNums.@alt_0].alternativeCases);
                        taskFor_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec.ReverseChainFromTo_node_to_inlined__sub0_4 = candidate_ReverseChainFromTo_node_to_inlined__sub0_4;
                        taskFor_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec.ReverseChainFromTo_node_from_inlined__sub0_4 = candidate_ReverseChainFromTo_node_from_inlined__sub0_4;
                        taskFor_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec.searchPatternpath = false;
                        taskFor_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec.matchOfNestingPattern = null;
                        taskFor_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec);
                        uint prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_node_intermediate;
                        prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_node_intermediate = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ReverseChainFromTo_alt_0_rec_node_intermediate.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_edge__edge0;
                        prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_edge__edge0 = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ReverseChainFromTo_alt_0_rec_edge__edge0.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 ReverseChainFromTo_alt_0_rec_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec
                        openTasks.Pop();
                        AlternativeAction_ReverseChainFromTo_alt_0_rec_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec.releaseTask(taskFor_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec);
                        // 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_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_rec match = new Pattern_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_rec();
                                Pattern_ReverseChainFromTo.Match_ReverseChainFromTo match__sub0 = new Pattern_ReverseChainFromTo.Match_ReverseChainFromTo();
                                match__sub0.SetMatchOfEnclosingPattern(match);
                                match._node_intermediate = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate;
                                match._node_from = candidate_ReverseChainFromTo_node_from;
                                match._node_to = candidate_ReverseChainFromTo_node_to;
                                match__sub0._node_from = candidate_ReverseChainFromTo_node_from_inlined__sub0_4;
                                match__sub0._node_to = candidate_ReverseChainFromTo_node_to_inlined__sub0_4;
                                match._edge__edge0 = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0;
                                match.__sub0 = match__sub0;
                                match__sub0._alt_0 = (Pattern_ReverseChainFromTo.IMatch_ReverseChainFromTo_alt_0)currentFoundPartialMatch.Pop();
                                match__sub0._alt_0.SetMatchOfEnclosingPattern(match__sub0);
                                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_ReverseChainFromTo_alt_0_rec_edge__edge0.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_edge__edge0;
                                candidate_ReverseChainFromTo_alt_0_rec_node_intermediate.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_node_intermediate;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ReverseChainFromTo_alt_0_rec_edge__edge0.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_edge__edge0;
                            candidate_ReverseChainFromTo_alt_0_rec_node_intermediate.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_node_intermediate;
                            continue;
                        }
                        candidate_ReverseChainFromTo_alt_0_rec_node_intermediate.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_node_intermediate;
                        candidate_ReverseChainFromTo_alt_0_rec_edge__edge0.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_edge__edge0;
                    }
                    while( (candidate_ReverseChainFromTo_alt_0_rec_edge__edge0 = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0.lgspInNext) != head_candidate_ReverseChainFromTo_alt_0_rec_edge__edge0 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ReverseChainFromTo_alt_0_rec_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ReverseChainFromTo_alt_0_rec_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ReverseChainFromTo_alt_0_rec_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ReverseChainFromTo_alt_0_rec_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_ReverseChainFromTo_alt_0_rec_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ReverseChainFromTo_alt_0_rec_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ReverseChainFromTo_alt_0_rec_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ReverseChainFromTo_alt_0_rec_alt_0_inlined__sub0_4_in_ReverseChainFromTo_alt_0_rec next = null;

        public GRGEN_LGSP.LGSPNode ReverseChainFromTo_node_to_inlined__sub0_4;
        public GRGEN_LGSP.LGSPNode ReverseChainFromTo_node_from_inlined__sub0_4;
        
        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 ReverseChainFromTo_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ReverseChainFromTo.ReverseChainFromTo_alt_0_CaseNums.@base];
                // SubPreset ReverseChainFromTo_node_to_inlined__sub0_4 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_to_inlined__sub0_4 = ReverseChainFromTo_node_to_inlined__sub0_4;
                // SubPreset ReverseChainFromTo_node_from_inlined__sub0_4 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_from_inlined__sub0_4 = ReverseChainFromTo_node_from_inlined__sub0_4;
                // Extend Outgoing ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4 from ReverseChainFromTo_node_to_inlined__sub0_4 
                GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4 = candidate_ReverseChainFromTo_node_to_inlined__sub0_4.lgspOuthead;
                if(head_candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4 = head_candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4;
                    do
                    {
                        if(candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4.lgspTarget != candidate_ReverseChainFromTo_node_from_inlined__sub0_4) {
                            continue;
                        }
                        if((candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4.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_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_base match = new Pattern_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_base();
                            match._node_to = candidate_ReverseChainFromTo_node_to_inlined__sub0_4;
                            match._node_from = candidate_ReverseChainFromTo_node_from_inlined__sub0_4;
                            match._edge__edge0 = candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4;
                            currentFoundPartialMatch.Push(match);
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                            {
                                openTasks.Push(this);
                                return;
                            }
                            continue;
                        }
                        uint prevGlobal__candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4;
                        prevGlobal__candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4 = candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4.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_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_base match = new Pattern_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_base();
                                match._node_to = candidate_ReverseChainFromTo_node_to_inlined__sub0_4;
                                match._node_from = candidate_ReverseChainFromTo_node_from_inlined__sub0_4;
                                match._edge__edge0 = candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4;
                                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_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4.lgspFlags = candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4.lgspFlags = candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4;
                            continue;
                        }
                        candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4.lgspFlags = candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4;
                    }
                    while( (candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4 = candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4.lgspOutNext) != head_candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_4 );
                }
            } 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 ReverseChainFromTo_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ReverseChainFromTo.ReverseChainFromTo_alt_0_CaseNums.@rec];
                // SubPreset ReverseChainFromTo_node_from_inlined__sub0_4 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_from_inlined__sub0_4 = ReverseChainFromTo_node_from_inlined__sub0_4;
                // SubPreset ReverseChainFromTo_node_to_inlined__sub0_4 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_to_inlined__sub0_4 = ReverseChainFromTo_node_to_inlined__sub0_4;
                // Extend Incoming ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4 from ReverseChainFromTo_node_from_inlined__sub0_4 
                GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4 = candidate_ReverseChainFromTo_node_from_inlined__sub0_4.lgspInhead;
                if(head_candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4 = head_candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4;
                    do
                    {
                        if(candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Implicit Source ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4 from ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4 
                        GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4 = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4.lgspSource;
                        if((candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0
                            && candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4==candidate_ReverseChainFromTo_node_from_inlined__sub0_4
                            )
                        {
                            continue;
                        }
                        if((candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Push subpattern matching task for _sub0_inlined__sub0_4
                        PatternAction_ReverseChainFromTo taskFor__sub0_inlined__sub0_4 = PatternAction_ReverseChainFromTo.getNewTask(actionEnv, openTasks);
                        taskFor__sub0_inlined__sub0_4.ReverseChainFromTo_node_from = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4;
                        taskFor__sub0_inlined__sub0_4.ReverseChainFromTo_node_to = candidate_ReverseChainFromTo_node_to_inlined__sub0_4;
                        taskFor__sub0_inlined__sub0_4.searchPatternpath = false;
                        taskFor__sub0_inlined__sub0_4.matchOfNestingPattern = null;
                        taskFor__sub0_inlined__sub0_4.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor__sub0_inlined__sub0_4);
                        uint prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4;
                        prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4 = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4;
                        prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4 = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop subpattern matching task for _sub0_inlined__sub0_4
                        openTasks.Pop();
                        PatternAction_ReverseChainFromTo.releaseTask(taskFor__sub0_inlined__sub0_4);
                        // 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_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_rec match = new Pattern_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_rec();
                                match._node_intermediate = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4;
                                match._node_from = candidate_ReverseChainFromTo_node_from_inlined__sub0_4;
                                match._node_to = candidate_ReverseChainFromTo_node_to_inlined__sub0_4;
                                match._edge__edge0 = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4;
                                match.__sub0 = (@Pattern_ReverseChainFromTo.Match_ReverseChainFromTo)currentFoundPartialMatch.Pop();
                                match.__sub0._matchOfEnclosingPattern = 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_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4;
                                candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4;
                            candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4;
                            continue;
                        }
                        candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_4;
                        candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4;
                    }
                    while( (candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4 = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4.lgspInNext) != head_candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_4 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class PatternAction_ChainFromToReverse : GRGEN_LGSP.LGSPSubpatternAction
    {
        private PatternAction_ChainFromToReverse(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_)
            : base(null)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
            patternGraph = Pattern_ChainFromToReverse.Instance.patternGraph;
        }

        public static PatternAction_ChainFromToReverse getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_) {
            PatternAction_ChainFromToReverse newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new PatternAction_ChainFromToReverse(actionEnv_, openTasks_);
            }
            return newTask;
        }

        public static void releaseTask(PatternAction_ChainFromToReverse oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static PatternAction_ChainFromToReverse freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private PatternAction_ChainFromToReverse next = null;

        public GRGEN_LGSP.LGSPNode ChainFromToReverse_node_from;
        public GRGEN_LGSP.LGSPNode ChainFromToReverse_node_to;
        
        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 ChainFromToReverse_node_from 
            GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_from = ChainFromToReverse_node_from;
            // SubPreset ChainFromToReverse_node_to 
            GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_to = ChainFromToReverse_node_to;
            // Push alternative matching task for ChainFromToReverse_alt_0
            AlternativeAction_ChainFromToReverse_alt_0 taskFor_alt_0 = AlternativeAction_ChainFromToReverse_alt_0.getNewTask(actionEnv, openTasks, Pattern_ChainFromToReverse.Instance.patternGraph.alternatives[(int)Pattern_ChainFromToReverse.ChainFromToReverse_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0.ChainFromToReverse_node_from = candidate_ChainFromToReverse_node_from;
            taskFor_alt_0.ChainFromToReverse_node_to = candidate_ChainFromToReverse_node_to;
            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 ChainFromToReverse_alt_0
            openTasks.Pop();
            AlternativeAction_ChainFromToReverse_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_ChainFromToReverse.Match_ChainFromToReverse match = new Pattern_ChainFromToReverse.Match_ChainFromToReverse();
                    match._node_from = candidate_ChainFromToReverse_node_from;
                    match._node_to = candidate_ChainFromToReverse_node_to;
                    match._alt_0 = (Pattern_ChainFromToReverse.IMatch_ChainFromToReverse_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)
                {
                    openTasks.Push(this);
                    return;
                }
                openTasks.Push(this);
                return;
            }
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ChainFromToReverse_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ChainFromToReverse_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ChainFromToReverse_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ChainFromToReverse_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_ChainFromToReverse_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ChainFromToReverse_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ChainFromToReverse_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ChainFromToReverse_alt_0 next = null;

        public GRGEN_LGSP.LGSPNode ChainFromToReverse_node_from;
        public GRGEN_LGSP.LGSPNode ChainFromToReverse_node_to;
        
        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 ChainFromToReverse_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromToReverse.ChainFromToReverse_alt_0_CaseNums.@base];
                // SubPreset ChainFromToReverse_node_from 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_from = ChainFromToReverse_node_from;
                // SubPreset ChainFromToReverse_node_to 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_to = ChainFromToReverse_node_to;
                // Extend Outgoing ChainFromToReverse_alt_0_base_edge__edge0 from ChainFromToReverse_node_from 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromToReverse_alt_0_base_edge__edge0 = candidate_ChainFromToReverse_node_from.lgspOuthead;
                if(head_candidate_ChainFromToReverse_alt_0_base_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromToReverse_alt_0_base_edge__edge0 = head_candidate_ChainFromToReverse_alt_0_base_edge__edge0;
                    do
                    {
                        if(candidate_ChainFromToReverse_alt_0_base_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_ChainFromToReverse_alt_0_base_edge__edge0.lgspTarget != candidate_ChainFromToReverse_node_to) {
                            continue;
                        }
                        if((candidate_ChainFromToReverse_alt_0_base_edge__edge0.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_ChainFromToReverse.Match_ChainFromToReverse_alt_0_base match = new Pattern_ChainFromToReverse.Match_ChainFromToReverse_alt_0_base();
                            match._node_from = candidate_ChainFromToReverse_node_from;
                            match._node_to = candidate_ChainFromToReverse_node_to;
                            match._edge__edge0 = candidate_ChainFromToReverse_alt_0_base_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_ChainFromToReverse_alt_0_base_edge__edge0;
                        prevGlobal__candidate_ChainFromToReverse_alt_0_base_edge__edge0 = candidate_ChainFromToReverse_alt_0_base_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverse_alt_0_base_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)
                            {
                                Pattern_ChainFromToReverse.Match_ChainFromToReverse_alt_0_base match = new Pattern_ChainFromToReverse.Match_ChainFromToReverse_alt_0_base();
                                match._node_from = candidate_ChainFromToReverse_node_from;
                                match._node_to = candidate_ChainFromToReverse_node_to;
                                match._edge__edge0 = candidate_ChainFromToReverse_alt_0_base_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_ChainFromToReverse_alt_0_base_edge__edge0.lgspFlags = candidate_ChainFromToReverse_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_base_edge__edge0;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromToReverse_alt_0_base_edge__edge0.lgspFlags = candidate_ChainFromToReverse_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_base_edge__edge0;
                            continue;
                        }
                        candidate_ChainFromToReverse_alt_0_base_edge__edge0.lgspFlags = candidate_ChainFromToReverse_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_base_edge__edge0;
                    }
                    while( (candidate_ChainFromToReverse_alt_0_base_edge__edge0 = candidate_ChainFromToReverse_alt_0_base_edge__edge0.lgspOutNext) != head_candidate_ChainFromToReverse_alt_0_base_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 ChainFromToReverse_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromToReverse.ChainFromToReverse_alt_0_CaseNums.@rec];
                // SubPreset ChainFromToReverse_node_from 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_from = ChainFromToReverse_node_from;
                // SubPreset ChainFromToReverse_node_to 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_to = ChainFromToReverse_node_to;
                // Element ChainFromToReverse_node_to_inlined_cftr_5 assigned from other element ChainFromToReverse_node_to 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_to_inlined_cftr_5 = candidate_ChainFromToReverse_node_to;
                // Extend Outgoing ChainFromToReverse_alt_0_rec_edge__edge0 from ChainFromToReverse_node_from 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromToReverse_alt_0_rec_edge__edge0 = candidate_ChainFromToReverse_node_from.lgspOuthead;
                if(head_candidate_ChainFromToReverse_alt_0_rec_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromToReverse_alt_0_rec_edge__edge0 = head_candidate_ChainFromToReverse_alt_0_rec_edge__edge0;
                    do
                    {
                        if(candidate_ChainFromToReverse_alt_0_rec_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFromToReverse_alt_0_rec_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 ChainFromToReverse_alt_0_rec_node_intermediate from ChainFromToReverse_alt_0_rec_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_alt_0_rec_node_intermediate = candidate_ChainFromToReverse_alt_0_rec_edge__edge0.lgspTarget;
                        if((candidate_ChainFromToReverse_alt_0_rec_node_intermediate.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0
                            && candidate_ChainFromToReverse_alt_0_rec_node_intermediate==candidate_ChainFromToReverse_node_from
                            )
                        {
                            continue;
                        }
                        if((candidate_ChainFromToReverse_alt_0_rec_node_intermediate.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Element ChainFromToReverse_node_from_inlined_cftr_5 assigned from other element ChainFromToReverse_alt_0_rec_node_intermediate 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_from_inlined_cftr_5 = candidate_ChainFromToReverse_alt_0_rec_node_intermediate;
                        // Push alternative matching task for ChainFromToReverse_alt_0_rec_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec
                        AlternativeAction_ChainFromToReverse_alt_0_rec_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec taskFor_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec = AlternativeAction_ChainFromToReverse_alt_0_rec_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec.getNewTask(actionEnv, openTasks, Pattern_ChainFromToReverse.Instance.patternGraph.alternatives[(int)Pattern_ChainFromToReverse.ChainFromToReverse_AltNums.@alt_0].alternativeCases);
                        taskFor_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec.ChainFromToReverse_node_from_inlined_cftr_5 = candidate_ChainFromToReverse_node_from_inlined_cftr_5;
                        taskFor_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec.ChainFromToReverse_node_to_inlined_cftr_5 = candidate_ChainFromToReverse_node_to_inlined_cftr_5;
                        taskFor_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec.searchPatternpath = false;
                        taskFor_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec.matchOfNestingPattern = null;
                        taskFor_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec);
                        uint prevGlobal__candidate_ChainFromToReverse_alt_0_rec_node_intermediate;
                        prevGlobal__candidate_ChainFromToReverse_alt_0_rec_node_intermediate = candidate_ChainFromToReverse_alt_0_rec_node_intermediate.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverse_alt_0_rec_node_intermediate.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFromToReverse_alt_0_rec_edge__edge0;
                        prevGlobal__candidate_ChainFromToReverse_alt_0_rec_edge__edge0 = candidate_ChainFromToReverse_alt_0_rec_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverse_alt_0_rec_edge__edge0.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 ChainFromToReverse_alt_0_rec_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec
                        openTasks.Pop();
                        AlternativeAction_ChainFromToReverse_alt_0_rec_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec.releaseTask(taskFor_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec);
                        // 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_ChainFromToReverse.Match_ChainFromToReverse_alt_0_rec match = new Pattern_ChainFromToReverse.Match_ChainFromToReverse_alt_0_rec();
                                Pattern_ChainFromToReverse.Match_ChainFromToReverse match_cftr = new Pattern_ChainFromToReverse.Match_ChainFromToReverse();
                                match_cftr.SetMatchOfEnclosingPattern(match);
                                match._node_from = candidate_ChainFromToReverse_node_from;
                                match._node_intermediate = candidate_ChainFromToReverse_alt_0_rec_node_intermediate;
                                match._node_to = candidate_ChainFromToReverse_node_to;
                                match_cftr._node_from = candidate_ChainFromToReverse_node_from_inlined_cftr_5;
                                match_cftr._node_to = candidate_ChainFromToReverse_node_to_inlined_cftr_5;
                                match._edge__edge0 = candidate_ChainFromToReverse_alt_0_rec_edge__edge0;
                                match._cftr = match_cftr;
                                match_cftr._alt_0 = (Pattern_ChainFromToReverse.IMatch_ChainFromToReverse_alt_0)currentFoundPartialMatch.Pop();
                                match_cftr._alt_0.SetMatchOfEnclosingPattern(match_cftr);
                                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_ChainFromToReverse_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_edge__edge0;
                                candidate_ChainFromToReverse_alt_0_rec_node_intermediate.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_node_intermediate.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_node_intermediate;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromToReverse_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_edge__edge0;
                            candidate_ChainFromToReverse_alt_0_rec_node_intermediate.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_node_intermediate.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_node_intermediate;
                            continue;
                        }
                        candidate_ChainFromToReverse_alt_0_rec_node_intermediate.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_node_intermediate.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_node_intermediate;
                        candidate_ChainFromToReverse_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_edge__edge0;
                    }
                    while( (candidate_ChainFromToReverse_alt_0_rec_edge__edge0 = candidate_ChainFromToReverse_alt_0_rec_edge__edge0.lgspOutNext) != head_candidate_ChainFromToReverse_alt_0_rec_edge__edge0 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ChainFromToReverse_alt_0_rec_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ChainFromToReverse_alt_0_rec_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ChainFromToReverse_alt_0_rec_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ChainFromToReverse_alt_0_rec_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_ChainFromToReverse_alt_0_rec_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ChainFromToReverse_alt_0_rec_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ChainFromToReverse_alt_0_rec_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ChainFromToReverse_alt_0_rec_alt_0_inlined_cftr_5_in_ChainFromToReverse_alt_0_rec next = null;

        public GRGEN_LGSP.LGSPNode ChainFromToReverse_node_from_inlined_cftr_5;
        public GRGEN_LGSP.LGSPNode ChainFromToReverse_node_to_inlined_cftr_5;
        
        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 ChainFromToReverse_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromToReverse.ChainFromToReverse_alt_0_CaseNums.@base];
                // SubPreset ChainFromToReverse_node_from_inlined_cftr_5 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_from_inlined_cftr_5 = ChainFromToReverse_node_from_inlined_cftr_5;
                // SubPreset ChainFromToReverse_node_to_inlined_cftr_5 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_to_inlined_cftr_5 = ChainFromToReverse_node_to_inlined_cftr_5;
                // Extend Outgoing ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5 from ChainFromToReverse_node_from_inlined_cftr_5 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5 = candidate_ChainFromToReverse_node_from_inlined_cftr_5.lgspOuthead;
                if(head_candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5 = head_candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5;
                    do
                    {
                        if(candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5.lgspTarget != candidate_ChainFromToReverse_node_to_inlined_cftr_5) {
                            continue;
                        }
                        if((candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5.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_ChainFromToReverse.Match_ChainFromToReverse_alt_0_base match = new Pattern_ChainFromToReverse.Match_ChainFromToReverse_alt_0_base();
                            match._node_from = candidate_ChainFromToReverse_node_from_inlined_cftr_5;
                            match._node_to = candidate_ChainFromToReverse_node_to_inlined_cftr_5;
                            match._edge__edge0 = candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5;
                            currentFoundPartialMatch.Push(match);
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                            {
                                openTasks.Push(this);
                                return;
                            }
                            continue;
                        }
                        uint prevGlobal__candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5;
                        prevGlobal__candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5 = candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5.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_ChainFromToReverse.Match_ChainFromToReverse_alt_0_base match = new Pattern_ChainFromToReverse.Match_ChainFromToReverse_alt_0_base();
                                match._node_from = candidate_ChainFromToReverse_node_from_inlined_cftr_5;
                                match._node_to = candidate_ChainFromToReverse_node_to_inlined_cftr_5;
                                match._edge__edge0 = candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5;
                                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_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5.lgspFlags = candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5.lgspFlags = candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5;
                            continue;
                        }
                        candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5.lgspFlags = candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5;
                    }
                    while( (candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5 = candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5.lgspOutNext) != head_candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_5 );
                }
            } 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 ChainFromToReverse_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromToReverse.ChainFromToReverse_alt_0_CaseNums.@rec];
                // SubPreset ChainFromToReverse_node_from_inlined_cftr_5 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_from_inlined_cftr_5 = ChainFromToReverse_node_from_inlined_cftr_5;
                // SubPreset ChainFromToReverse_node_to_inlined_cftr_5 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_to_inlined_cftr_5 = ChainFromToReverse_node_to_inlined_cftr_5;
                // Extend Outgoing ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5 from ChainFromToReverse_node_from_inlined_cftr_5 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5 = candidate_ChainFromToReverse_node_from_inlined_cftr_5.lgspOuthead;
                if(head_candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5 = head_candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5;
                    do
                    {
                        if(candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Implicit Target ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5 from ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5 = candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5.lgspTarget;
                        if((candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0
                            && candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5==candidate_ChainFromToReverse_node_from_inlined_cftr_5
                            )
                        {
                            continue;
                        }
                        if((candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Push subpattern matching task for cftr_inlined_cftr_5
                        PatternAction_ChainFromToReverse taskFor_cftr_inlined_cftr_5 = PatternAction_ChainFromToReverse.getNewTask(actionEnv, openTasks);
                        taskFor_cftr_inlined_cftr_5.ChainFromToReverse_node_from = candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5;
                        taskFor_cftr_inlined_cftr_5.ChainFromToReverse_node_to = candidate_ChainFromToReverse_node_to_inlined_cftr_5;
                        taskFor_cftr_inlined_cftr_5.searchPatternpath = false;
                        taskFor_cftr_inlined_cftr_5.matchOfNestingPattern = null;
                        taskFor_cftr_inlined_cftr_5.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor_cftr_inlined_cftr_5);
                        uint prevGlobal__candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5;
                        prevGlobal__candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5 = candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5;
                        prevGlobal__candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5 = candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop subpattern matching task for cftr_inlined_cftr_5
                        openTasks.Pop();
                        PatternAction_ChainFromToReverse.releaseTask(taskFor_cftr_inlined_cftr_5);
                        // 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_ChainFromToReverse.Match_ChainFromToReverse_alt_0_rec match = new Pattern_ChainFromToReverse.Match_ChainFromToReverse_alt_0_rec();
                                match._node_from = candidate_ChainFromToReverse_node_from_inlined_cftr_5;
                                match._node_intermediate = candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5;
                                match._node_to = candidate_ChainFromToReverse_node_to_inlined_cftr_5;
                                match._edge__edge0 = candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5;
                                match._cftr = (@Pattern_ChainFromToReverse.Match_ChainFromToReverse)currentFoundPartialMatch.Pop();
                                match._cftr._matchOfEnclosingPattern = 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_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5;
                                candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5;
                            candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5;
                            continue;
                        }
                        candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_5;
                        candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5;
                    }
                    while( (candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5 = candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5.lgspOutNext) != head_candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_5 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class PatternAction_ChainFromToReverseToCommon : GRGEN_LGSP.LGSPSubpatternAction
    {
        private PatternAction_ChainFromToReverseToCommon(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_)
            : base(null)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
            patternGraph = Pattern_ChainFromToReverseToCommon.Instance.patternGraph;
        }

        public static PatternAction_ChainFromToReverseToCommon getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_) {
            PatternAction_ChainFromToReverseToCommon newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new PatternAction_ChainFromToReverseToCommon(actionEnv_, openTasks_);
            }
            return newTask;
        }

        public static void releaseTask(PatternAction_ChainFromToReverseToCommon oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static PatternAction_ChainFromToReverseToCommon freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private PatternAction_ChainFromToReverseToCommon next = null;

        public GRGEN_LGSP.LGSPNode ChainFromToReverseToCommon_node_from;
        public GRGEN_LGSP.LGSPNode ChainFromToReverseToCommon_node_to;
        
        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 ChainFromToReverseToCommon_node_from 
            GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_from = ChainFromToReverseToCommon_node_from;
            // SubPreset ChainFromToReverseToCommon_node_to 
            GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_to = ChainFromToReverseToCommon_node_to;
            // Push alternative matching task for ChainFromToReverseToCommon_alt_0
            AlternativeAction_ChainFromToReverseToCommon_alt_0 taskFor_alt_0 = AlternativeAction_ChainFromToReverseToCommon_alt_0.getNewTask(actionEnv, openTasks, Pattern_ChainFromToReverseToCommon.Instance.patternGraph.alternatives[(int)Pattern_ChainFromToReverseToCommon.ChainFromToReverseToCommon_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0.ChainFromToReverseToCommon_node_from = candidate_ChainFromToReverseToCommon_node_from;
            taskFor_alt_0.ChainFromToReverseToCommon_node_to = candidate_ChainFromToReverseToCommon_node_to;
            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 ChainFromToReverseToCommon_alt_0
            openTasks.Pop();
            AlternativeAction_ChainFromToReverseToCommon_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_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon match = new Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon();
                    match._node_from = candidate_ChainFromToReverseToCommon_node_from;
                    match._node_to = candidate_ChainFromToReverseToCommon_node_to;
                    match._alt_0 = (Pattern_ChainFromToReverseToCommon.IMatch_ChainFromToReverseToCommon_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)
                {
                    openTasks.Push(this);
                    return;
                }
                openTasks.Push(this);
                return;
            }
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ChainFromToReverseToCommon_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ChainFromToReverseToCommon_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ChainFromToReverseToCommon_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ChainFromToReverseToCommon_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_ChainFromToReverseToCommon_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ChainFromToReverseToCommon_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ChainFromToReverseToCommon_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ChainFromToReverseToCommon_alt_0 next = null;

        public GRGEN_LGSP.LGSPNode ChainFromToReverseToCommon_node_from;
        public GRGEN_LGSP.LGSPNode ChainFromToReverseToCommon_node_to;
        
        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 ChainFromToReverseToCommon_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromToReverseToCommon.ChainFromToReverseToCommon_alt_0_CaseNums.@base];
                // SubPreset ChainFromToReverseToCommon_node_from 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_from = ChainFromToReverseToCommon_node_from;
                // SubPreset ChainFromToReverseToCommon_node_to 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_to = ChainFromToReverseToCommon_node_to;
                // Extend Outgoing ChainFromToReverseToCommon_alt_0_base_edge__edge0 from ChainFromToReverseToCommon_node_from 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0 = candidate_ChainFromToReverseToCommon_node_from.lgspOuthead;
                if(head_candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0 = head_candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0;
                    do
                    {
                        if(candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0.lgspTarget != candidate_ChainFromToReverseToCommon_node_to) {
                            continue;
                        }
                        if((candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0.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_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_base match = new Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_base();
                            match._node_from = candidate_ChainFromToReverseToCommon_node_from;
                            match._node_to = candidate_ChainFromToReverseToCommon_node_to;
                            match._edge__edge0 = candidate_ChainFromToReverseToCommon_alt_0_base_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_ChainFromToReverseToCommon_alt_0_base_edge__edge0;
                        prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0 = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverseToCommon_alt_0_base_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)
                            {
                                Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_base match = new Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_base();
                                match._node_from = candidate_ChainFromToReverseToCommon_node_from;
                                match._node_to = candidate_ChainFromToReverseToCommon_node_to;
                                match._edge__edge0 = candidate_ChainFromToReverseToCommon_alt_0_base_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_ChainFromToReverseToCommon_alt_0_base_edge__edge0.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0;
                            continue;
                        }
                        candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0;
                    }
                    while( (candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0 = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0.lgspOutNext) != head_candidate_ChainFromToReverseToCommon_alt_0_base_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 ChainFromToReverseToCommon_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromToReverseToCommon.ChainFromToReverseToCommon_alt_0_CaseNums.@rec];
                // SubPreset ChainFromToReverseToCommon_node_from 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_from = ChainFromToReverseToCommon_node_from;
                // SubPreset ChainFromToReverseToCommon_node_to 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_to = ChainFromToReverseToCommon_node_to;
                // Element ChainFromToReverseToCommon_node_to_inlined_cftrtc_6 assigned from other element ChainFromToReverseToCommon_node_to 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_6 = candidate_ChainFromToReverseToCommon_node_to;
                // Extend Outgoing ChainFromToReverseToCommon_alt_0_rec_edge__edge0 from ChainFromToReverseToCommon_node_from 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0 = candidate_ChainFromToReverseToCommon_node_from.lgspOuthead;
                if(head_candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0 = head_candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0;
                    do
                    {
                        if(candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFromToReverseToCommon_alt_0_rec_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 ChainFromToReverseToCommon_alt_0_rec_node_intermediate from ChainFromToReverseToCommon_alt_0_rec_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0.lgspTarget;
                        if((candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0
                            && candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate==candidate_ChainFromToReverseToCommon_node_from
                            )
                        {
                            continue;
                        }
                        if((candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Element ChainFromToReverseToCommon_node_from_inlined_cftrtc_6 assigned from other element ChainFromToReverseToCommon_alt_0_rec_node_intermediate 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_6 = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate;
                        // Push alternative matching task for ChainFromToReverseToCommon_alt_0_rec_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec
                        AlternativeAction_ChainFromToReverseToCommon_alt_0_rec_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec taskFor_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec = AlternativeAction_ChainFromToReverseToCommon_alt_0_rec_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec.getNewTask(actionEnv, openTasks, Pattern_ChainFromToReverseToCommon.Instance.patternGraph.alternatives[(int)Pattern_ChainFromToReverseToCommon.ChainFromToReverseToCommon_AltNums.@alt_0].alternativeCases);
                        taskFor_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec.ChainFromToReverseToCommon_node_from_inlined_cftrtc_6 = candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_6;
                        taskFor_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec.ChainFromToReverseToCommon_node_to_inlined_cftrtc_6 = candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_6;
                        taskFor_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec.searchPatternpath = false;
                        taskFor_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec.matchOfNestingPattern = null;
                        taskFor_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec);
                        uint prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate;
                        prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0;
                        prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0 = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0.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 ChainFromToReverseToCommon_alt_0_rec_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec
                        openTasks.Pop();
                        AlternativeAction_ChainFromToReverseToCommon_alt_0_rec_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec.releaseTask(taskFor_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec);
                        // 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_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_rec match = new Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_rec();
                                Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon match_cftrtc = new Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon();
                                match_cftrtc.SetMatchOfEnclosingPattern(match);
                                match._node_from = candidate_ChainFromToReverseToCommon_node_from;
                                match._node_intermediate = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate;
                                match._node_to = candidate_ChainFromToReverseToCommon_node_to;
                                match_cftrtc._node_from = candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_6;
                                match_cftrtc._node_to = candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_6;
                                match._edge__edge0 = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0;
                                match._cftrtc = match_cftrtc;
                                match_cftrtc._alt_0 = (Pattern_ChainFromToReverseToCommon.IMatch_ChainFromToReverseToCommon_alt_0)currentFoundPartialMatch.Pop();
                                match_cftrtc._alt_0.SetMatchOfEnclosingPattern(match_cftrtc);
                                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_ChainFromToReverseToCommon_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0;
                                candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0;
                            candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate;
                            continue;
                        }
                        candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate;
                        candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0;
                    }
                    while( (candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0 = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0.lgspOutNext) != head_candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ChainFromToReverseToCommon_alt_0_rec_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ChainFromToReverseToCommon_alt_0_rec_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ChainFromToReverseToCommon_alt_0_rec_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ChainFromToReverseToCommon_alt_0_rec_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_ChainFromToReverseToCommon_alt_0_rec_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ChainFromToReverseToCommon_alt_0_rec_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ChainFromToReverseToCommon_alt_0_rec_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ChainFromToReverseToCommon_alt_0_rec_alt_0_inlined_cftrtc_6_in_ChainFromToReverseToCommon_alt_0_rec next = null;

        public GRGEN_LGSP.LGSPNode ChainFromToReverseToCommon_node_from_inlined_cftrtc_6;
        public GRGEN_LGSP.LGSPNode ChainFromToReverseToCommon_node_to_inlined_cftrtc_6;
        
        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 ChainFromToReverseToCommon_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromToReverseToCommon.ChainFromToReverseToCommon_alt_0_CaseNums.@base];
                // SubPreset ChainFromToReverseToCommon_node_from_inlined_cftrtc_6 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_6 = ChainFromToReverseToCommon_node_from_inlined_cftrtc_6;
                // SubPreset ChainFromToReverseToCommon_node_to_inlined_cftrtc_6 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_6 = ChainFromToReverseToCommon_node_to_inlined_cftrtc_6;
                // Extend Outgoing ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6 from ChainFromToReverseToCommon_node_from_inlined_cftrtc_6 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6 = candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_6.lgspOuthead;
                if(head_candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6 = head_candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6;
                    do
                    {
                        if(candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6.lgspTarget != candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_6) {
                            continue;
                        }
                        if((candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6.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_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_base match = new Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_base();
                            match._node_from = candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_6;
                            match._node_to = candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_6;
                            match._edge__edge0 = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6;
                            currentFoundPartialMatch.Push(match);
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                            {
                                openTasks.Push(this);
                                return;
                            }
                            continue;
                        }
                        uint prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6;
                        prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6 = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6.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_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_base match = new Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_base();
                                match._node_from = candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_6;
                                match._node_to = candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_6;
                                match._edge__edge0 = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6;
                                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_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6;
                            continue;
                        }
                        candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6;
                    }
                    while( (candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6 = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6.lgspOutNext) != head_candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_6 );
                }
            } 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 ChainFromToReverseToCommon_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromToReverseToCommon.ChainFromToReverseToCommon_alt_0_CaseNums.@rec];
                // SubPreset ChainFromToReverseToCommon_node_from_inlined_cftrtc_6 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_6 = ChainFromToReverseToCommon_node_from_inlined_cftrtc_6;
                // SubPreset ChainFromToReverseToCommon_node_to_inlined_cftrtc_6 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_6 = ChainFromToReverseToCommon_node_to_inlined_cftrtc_6;
                // Extend Outgoing ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6 from ChainFromToReverseToCommon_node_from_inlined_cftrtc_6 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6 = candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_6.lgspOuthead;
                if(head_candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6 = head_candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6;
                    do
                    {
                        if(candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Implicit Target ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6 from ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6 = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6.lgspTarget;
                        if((candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0
                            && candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6==candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_6
                            )
                        {
                            continue;
                        }
                        if((candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Push subpattern matching task for cftrtc_inlined_cftrtc_6
                        PatternAction_ChainFromToReverseToCommon taskFor_cftrtc_inlined_cftrtc_6 = PatternAction_ChainFromToReverseToCommon.getNewTask(actionEnv, openTasks);
                        taskFor_cftrtc_inlined_cftrtc_6.ChainFromToReverseToCommon_node_from = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6;
                        taskFor_cftrtc_inlined_cftrtc_6.ChainFromToReverseToCommon_node_to = candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_6;
                        taskFor_cftrtc_inlined_cftrtc_6.searchPatternpath = false;
                        taskFor_cftrtc_inlined_cftrtc_6.matchOfNestingPattern = null;
                        taskFor_cftrtc_inlined_cftrtc_6.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor_cftrtc_inlined_cftrtc_6);
                        uint prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6;
                        prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6 = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6;
                        prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6 = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop subpattern matching task for cftrtc_inlined_cftrtc_6
                        openTasks.Pop();
                        PatternAction_ChainFromToReverseToCommon.releaseTask(taskFor_cftrtc_inlined_cftrtc_6);
                        // 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_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_rec match = new Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_rec();
                                match._node_from = candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_6;
                                match._node_intermediate = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6;
                                match._node_to = candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_6;
                                match._edge__edge0 = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6;
                                match._cftrtc = (@Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon)currentFoundPartialMatch.Pop();
                                match._cftrtc._matchOfEnclosingPattern = 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_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6;
                                candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6;
                            candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6;
                            continue;
                        }
                        candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_6;
                        candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6;
                    }
                    while( (candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6 = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6.lgspOutNext) != head_candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_6 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class PatternAction_ReverseChainFromToToCommon : GRGEN_LGSP.LGSPSubpatternAction
    {
        private PatternAction_ReverseChainFromToToCommon(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_)
            : base(null)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
            patternGraph = Pattern_ReverseChainFromToToCommon.Instance.patternGraph;
        }

        public static PatternAction_ReverseChainFromToToCommon getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_) {
            PatternAction_ReverseChainFromToToCommon newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new PatternAction_ReverseChainFromToToCommon(actionEnv_, openTasks_);
            }
            return newTask;
        }

        public static void releaseTask(PatternAction_ReverseChainFromToToCommon oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static PatternAction_ReverseChainFromToToCommon freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private PatternAction_ReverseChainFromToToCommon next = null;

        public GRGEN_LGSP.LGSPNode ReverseChainFromToToCommon_node_from;
        public GRGEN_LGSP.LGSPNode ReverseChainFromToToCommon_node_to;
        public GRGEN_LGSP.LGSPNode ReverseChainFromToToCommon_node_common;
        
        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 ReverseChainFromToToCommon_node_from 
            GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_from = ReverseChainFromToToCommon_node_from;
            // SubPreset ReverseChainFromToToCommon_node_to 
            GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_to = ReverseChainFromToToCommon_node_to;
            // SubPreset ReverseChainFromToToCommon_node_common 
            GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_common = ReverseChainFromToToCommon_node_common;
            // Push alternative matching task for ReverseChainFromToToCommon_alt_0
            AlternativeAction_ReverseChainFromToToCommon_alt_0 taskFor_alt_0 = AlternativeAction_ReverseChainFromToToCommon_alt_0.getNewTask(actionEnv, openTasks, Pattern_ReverseChainFromToToCommon.Instance.patternGraph.alternatives[(int)Pattern_ReverseChainFromToToCommon.ReverseChainFromToToCommon_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0.ReverseChainFromToToCommon_node_to = candidate_ReverseChainFromToToCommon_node_to;
            taskFor_alt_0.ReverseChainFromToToCommon_node_from = candidate_ReverseChainFromToToCommon_node_from;
            taskFor_alt_0.ReverseChainFromToToCommon_node_common = candidate_ReverseChainFromToToCommon_node_common;
            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 ReverseChainFromToToCommon_alt_0
            openTasks.Pop();
            AlternativeAction_ReverseChainFromToToCommon_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_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon match = new Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon();
                    match._node_from = candidate_ReverseChainFromToToCommon_node_from;
                    match._node_to = candidate_ReverseChainFromToToCommon_node_to;
                    match._node_common = candidate_ReverseChainFromToToCommon_node_common;
                    match._alt_0 = (Pattern_ReverseChainFromToToCommon.IMatch_ReverseChainFromToToCommon_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)
                {
                    openTasks.Push(this);
                    return;
                }
                openTasks.Push(this);
                return;
            }
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ReverseChainFromToToCommon_alt_0 : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ReverseChainFromToToCommon_alt_0(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ReverseChainFromToToCommon_alt_0 getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ReverseChainFromToToCommon_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_ReverseChainFromToToCommon_alt_0(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ReverseChainFromToToCommon_alt_0 oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ReverseChainFromToToCommon_alt_0 freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ReverseChainFromToToCommon_alt_0 next = null;

        public GRGEN_LGSP.LGSPNode ReverseChainFromToToCommon_node_to;
        public GRGEN_LGSP.LGSPNode ReverseChainFromToToCommon_node_from;
        public GRGEN_LGSP.LGSPNode ReverseChainFromToToCommon_node_common;
        
        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 ReverseChainFromToToCommon_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ReverseChainFromToToCommon.ReverseChainFromToToCommon_alt_0_CaseNums.@base];
                // SubPreset ReverseChainFromToToCommon_node_to 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_to = ReverseChainFromToToCommon_node_to;
                // SubPreset ReverseChainFromToToCommon_node_from 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_from = ReverseChainFromToToCommon_node_from;
                // SubPreset ReverseChainFromToToCommon_node_common 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_common = ReverseChainFromToToCommon_node_common;
                // Extend Outgoing ReverseChainFromToToCommon_alt_0_base_edge__edge0 from ReverseChainFromToToCommon_node_to 
                GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0 = candidate_ReverseChainFromToToCommon_node_to.lgspOuthead;
                if(head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0 = head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0;
                    do
                    {
                        if(candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspTarget != candidate_ReverseChainFromToToCommon_node_from) {
                            continue;
                        }
                        if((candidate_ReverseChainFromToToCommon_alt_0_base_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_ReverseChainFromToToCommon_alt_0_base_edge__edge0;
                        prev__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        // Extend Outgoing ReverseChainFromToToCommon_alt_0_base_edge__edge1 from ReverseChainFromToToCommon_node_from 
                        GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1 = candidate_ReverseChainFromToToCommon_node_from.lgspOuthead;
                        if(head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1 = head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1;
                            do
                            {
                                if(candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1.lgspType.TypeID!=1) {
                                    continue;
                                }
                                if(candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1.lgspTarget != candidate_ReverseChainFromToToCommon_node_common) {
                                    continue;
                                }
                                if((candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_ReverseChainFromToToCommon_alt_0_base_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);
                                    Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_base match = new Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_base();
                                    match._node_to = candidate_ReverseChainFromToToCommon_node_to;
                                    match._node_from = candidate_ReverseChainFromToToCommon_node_from;
                                    match._node_common = candidate_ReverseChainFromToToCommon_node_common;
                                    match._edge__edge0 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0;
                                    match._edge__edge1 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1;
                                    currentFoundPartialMatch.Push(match);
                                    // if enough matches were found, we leave
                                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                    {
                                        candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0;
                                        openTasks.Push(this);
                                        return;
                                    }
                                    continue;
                                }
                                uint prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0;
                                prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                uint prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1;
                                prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_ReverseChainFromToToCommon_alt_0_base_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)
                                    {
                                        Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_base match = new Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_base();
                                        match._node_to = candidate_ReverseChainFromToToCommon_node_to;
                                        match._node_from = candidate_ReverseChainFromToToCommon_node_from;
                                        match._node_common = candidate_ReverseChainFromToToCommon_node_common;
                                        match._edge__edge0 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0;
                                        match._edge__edge1 = candidate_ReverseChainFromToToCommon_alt_0_base_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_ReverseChainFromToToCommon_alt_0_base_edge__edge1.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1;
                                        candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0;
                                        candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0;
                                        openTasks.Push(this);
                                        return;
                                    }
                                    candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1;
                                    candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0;
                                    continue;
                                }
                                candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0;
                                candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1;
                            }
                            while( (candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1.lgspOutNext) != head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1 );
                        }
                        candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0;
                    }
                    while( (candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0.lgspOutNext) != head_candidate_ReverseChainFromToToCommon_alt_0_base_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 ReverseChainFromToToCommon_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ReverseChainFromToToCommon.ReverseChainFromToToCommon_alt_0_CaseNums.@rec];
                // SubPreset ReverseChainFromToToCommon_node_from 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_from = ReverseChainFromToToCommon_node_from;
                // SubPreset ReverseChainFromToToCommon_node_common 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_common = ReverseChainFromToToCommon_node_common;
                // SubPreset ReverseChainFromToToCommon_node_to 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_to = ReverseChainFromToToCommon_node_to;
                // Element ReverseChainFromToToCommon_node_to_inlined__sub0_7 assigned from other element ReverseChainFromToToCommon_node_to 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_node_to;
                // Element ReverseChainFromToToCommon_node_common_inlined__sub0_7 assigned from other element ReverseChainFromToToCommon_node_common 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_node_common;
                // Extend Incoming ReverseChainFromToToCommon_alt_0_rec_edge__edge0 from ReverseChainFromToToCommon_node_from 
                GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0 = candidate_ReverseChainFromToToCommon_node_from.lgspInhead;
                if(head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0 = head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0;
                    do
                    {
                        if(candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ReverseChainFromToToCommon_alt_0_rec_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_ReverseChainFromToToCommon_alt_0_rec_edge__edge0;
                        prev__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        // Implicit Source ReverseChainFromToToCommon_alt_0_rec_node_intermediate from ReverseChainFromToToCommon_alt_0_rec_edge__edge0 
                        GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspSource;
                        if((candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0
                            && (candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate==candidate_ReverseChainFromToToCommon_node_from
                                || candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate==candidate_ReverseChainFromToToCommon_node_common
                                )
                            )
                        {
                            candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0;
                            continue;
                        }
                        if((candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0;
                            continue;
                        }
                        // Element ReverseChainFromToToCommon_node_from_inlined__sub0_7 assigned from other element ReverseChainFromToToCommon_alt_0_rec_node_intermediate 
                        GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate;
                        // Extend Outgoing ReverseChainFromToToCommon_alt_0_rec_edge__edge1 from ReverseChainFromToToCommon_node_from 
                        GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1 = candidate_ReverseChainFromToToCommon_node_from.lgspOuthead;
                        if(head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1 = head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1;
                            do
                            {
                                if(candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1.lgspType.TypeID!=1) {
                                    continue;
                                }
                                if(candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1.lgspTarget != candidate_ReverseChainFromToToCommon_node_common) {
                                    continue;
                                }
                                if((candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1.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 ReverseChainFromToToCommon_alt_0_rec_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec
                                AlternativeAction_ReverseChainFromToToCommon_alt_0_rec_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec taskFor_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec = AlternativeAction_ReverseChainFromToToCommon_alt_0_rec_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec.getNewTask(actionEnv, openTasks, Pattern_ReverseChainFromToToCommon.Instance.patternGraph.alternatives[(int)Pattern_ReverseChainFromToToCommon.ReverseChainFromToToCommon_AltNums.@alt_0].alternativeCases);
                                taskFor_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec.ReverseChainFromToToCommon_node_to_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_7;
                                taskFor_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec.ReverseChainFromToToCommon_node_from_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_7;
                                taskFor_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec.ReverseChainFromToToCommon_node_common_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_7;
                                taskFor_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec.searchPatternpath = false;
                                taskFor_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec.matchOfNestingPattern = null;
                                taskFor_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec.lastMatchAtPreviousNestingLevel = null;
                                openTasks.Push(taskFor_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec);
                                uint prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate;
                                prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                uint prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0;
                                prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                uint prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1;
                                prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_ReverseChainFromToToCommon_alt_0_rec_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 ReverseChainFromToToCommon_alt_0_rec_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec
                                openTasks.Pop();
                                AlternativeAction_ReverseChainFromToToCommon_alt_0_rec_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec.releaseTask(taskFor_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec);
                                // 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_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_rec match = new Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_rec();
                                        Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon match__sub0 = new Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon();
                                        match__sub0.SetMatchOfEnclosingPattern(match);
                                        match._node_intermediate = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate;
                                        match._node_from = candidate_ReverseChainFromToToCommon_node_from;
                                        match._node_common = candidate_ReverseChainFromToToCommon_node_common;
                                        match._node_to = candidate_ReverseChainFromToToCommon_node_to;
                                        match__sub0._node_from = candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_7;
                                        match__sub0._node_to = candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_7;
                                        match__sub0._node_common = candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_7;
                                        match._edge__edge0 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0;
                                        match._edge__edge1 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1;
                                        match.__sub0 = match__sub0;
                                        match__sub0._alt_0 = (Pattern_ReverseChainFromToToCommon.IMatch_ReverseChainFromToToCommon_alt_0)currentFoundPartialMatch.Pop();
                                        match__sub0._alt_0.SetMatchOfEnclosingPattern(match__sub0);
                                        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_ReverseChainFromToToCommon_alt_0_rec_edge__edge1.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1;
                                        candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0;
                                        candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate;
                                        candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0;
                                        openTasks.Push(this);
                                        return;
                                    }
                                    candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1;
                                    candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0;
                                    candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate;
                                    continue;
                                }
                                candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate;
                                candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0;
                                candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1;
                            }
                            while( (candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1.lgspOutNext) != head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1 );
                        }
                        candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0;
                    }
                    while( (candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0.lgspInNext) != head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0 );
                }
            } while(false);
            openTasks.Push(this);
            return;
        }
    }
    
    public class AlternativeAction_ReverseChainFromToToCommon_alt_0_rec_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_ReverseChainFromToToCommon_alt_0_rec_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_ReverseChainFromToToCommon_alt_0_rec_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_ReverseChainFromToToCommon_alt_0_rec_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_ReverseChainFromToToCommon_alt_0_rec_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_ReverseChainFromToToCommon_alt_0_rec_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_ReverseChainFromToToCommon_alt_0_rec_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_ReverseChainFromToToCommon_alt_0_rec_alt_0_inlined__sub0_7_in_ReverseChainFromToToCommon_alt_0_rec next = null;

        public GRGEN_LGSP.LGSPNode ReverseChainFromToToCommon_node_to_inlined__sub0_7;
        public GRGEN_LGSP.LGSPNode ReverseChainFromToToCommon_node_from_inlined__sub0_7;
        public GRGEN_LGSP.LGSPNode ReverseChainFromToToCommon_node_common_inlined__sub0_7;
        
        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 ReverseChainFromToToCommon_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ReverseChainFromToToCommon.ReverseChainFromToToCommon_alt_0_CaseNums.@base];
                // SubPreset ReverseChainFromToToCommon_node_to_inlined__sub0_7 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_7 = ReverseChainFromToToCommon_node_to_inlined__sub0_7;
                // SubPreset ReverseChainFromToToCommon_node_from_inlined__sub0_7 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_7 = ReverseChainFromToToCommon_node_from_inlined__sub0_7;
                // SubPreset ReverseChainFromToToCommon_node_common_inlined__sub0_7 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_7 = ReverseChainFromToToCommon_node_common_inlined__sub0_7;
                // Extend Outgoing ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7 from ReverseChainFromToToCommon_node_to_inlined__sub0_7 
                GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_7.lgspOuthead;
                if(head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7 = head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7;
                    do
                    {
                        if(candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspTarget != candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_7) {
                            continue;
                        }
                        if((candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.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_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7;
                        prev__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        // Extend Outgoing ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7 from ReverseChainFromToToCommon_node_from_inlined__sub0_7 
                        GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_7.lgspOuthead;
                        if(head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7 = head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7;
                            do
                            {
                                if(candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7.lgspType.TypeID!=1) {
                                    continue;
                                }
                                if(candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7.lgspTarget != candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_7) {
                                    continue;
                                }
                                if((candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7.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_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_base match = new Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_base();
                                    match._node_to = candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_7;
                                    match._node_from = candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_7;
                                    match._node_common = candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_7;
                                    match._edge__edge0 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7;
                                    match._edge__edge1 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7;
                                    currentFoundPartialMatch.Push(match);
                                    // if enough matches were found, we leave
                                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                    {
                                        candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7;
                                        openTasks.Push(this);
                                        return;
                                    }
                                    continue;
                                }
                                uint prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7;
                                prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                uint prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7;
                                prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7.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_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_base match = new Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_base();
                                        match._node_to = candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_7;
                                        match._node_from = candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_7;
                                        match._node_common = candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_7;
                                        match._edge__edge0 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7;
                                        match._edge__edge1 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7;
                                        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_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7;
                                        candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7;
                                        candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7;
                                        openTasks.Push(this);
                                        return;
                                    }
                                    candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7;
                                    candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7;
                                    continue;
                                }
                                candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7;
                                candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7;
                            }
                            while( (candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7.lgspOutNext) != head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_7 );
                        }
                        candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7;
                    }
                    while( (candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7.lgspOutNext) != head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_7 );
                }
            } 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 ReverseChainFromToToCommon_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ReverseChainFromToToCommon.ReverseChainFromToToCommon_alt_0_CaseNums.@rec];
                // SubPreset ReverseChainFromToToCommon_node_from_inlined__sub0_7 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_7 = ReverseChainFromToToCommon_node_from_inlined__sub0_7;
                // SubPreset ReverseChainFromToToCommon_node_common_inlined__sub0_7 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_7 = ReverseChainFromToToCommon_node_common_inlined__sub0_7;
                // SubPreset ReverseChainFromToToCommon_node_to_inlined__sub0_7 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_7 = ReverseChainFromToToCommon_node_to_inlined__sub0_7;
                // Extend Incoming ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7 from ReverseChainFromToToCommon_node_from_inlined__sub0_7 
                GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_7.lgspInhead;
                if(head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7 = head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7;
                    do
                    {
                        if(candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.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_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7;
                        prev__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        // Implicit Source ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7 from ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7 
                        GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspSource;
                        if((candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0
                            && (candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7==candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_7
                                || candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7==candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_7
                                )
                            )
                        {
                            candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7;
                            continue;
                        }
                        if((candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7;
                            continue;
                        }
                        // Extend Outgoing ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7 from ReverseChainFromToToCommon_node_from_inlined__sub0_7 
                        GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_7.lgspOuthead;
                        if(head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7 = head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7;
                            do
                            {
                                if(candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7.lgspType.TypeID!=1) {
                                    continue;
                                }
                                if(candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7.lgspTarget != candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_7) {
                                    continue;
                                }
                                if((candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    continue;
                                }
                                // Push subpattern matching task for _sub0_inlined__sub0_7
                                PatternAction_ReverseChainFromToToCommon taskFor__sub0_inlined__sub0_7 = PatternAction_ReverseChainFromToToCommon.getNewTask(actionEnv, openTasks);
                                taskFor__sub0_inlined__sub0_7.ReverseChainFromToToCommon_node_from = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7;
                                taskFor__sub0_inlined__sub0_7.ReverseChainFromToToCommon_node_to = candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_7;
                                taskFor__sub0_inlined__sub0_7.ReverseChainFromToToCommon_node_common = candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_7;
                                taskFor__sub0_inlined__sub0_7.searchPatternpath = false;
                                taskFor__sub0_inlined__sub0_7.matchOfNestingPattern = null;
                                taskFor__sub0_inlined__sub0_7.lastMatchAtPreviousNestingLevel = null;
                                openTasks.Push(taskFor__sub0_inlined__sub0_7);
                                uint prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7;
                                prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                uint prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7;
                                prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                uint prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7;
                                prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                // Match subpatterns 
                                openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                                // Pop subpattern matching task for _sub0_inlined__sub0_7
                                openTasks.Pop();
                                PatternAction_ReverseChainFromToToCommon.releaseTask(taskFor__sub0_inlined__sub0_7);
                                // 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_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_rec match = new Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_rec();
                                        match._node_intermediate = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7;
                                        match._node_from = candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_7;
                                        match._node_common = candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_7;
                                        match._node_to = candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_7;
                                        match._edge__edge0 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7;
                                        match._edge__edge1 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7;
                                        match.__sub0 = (@Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon)currentFoundPartialMatch.Pop();
                                        match.__sub0._matchOfEnclosingPattern = 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_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7;
                                        candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7;
                                        candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7;
                                        candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7;
                                        openTasks.Push(this);
                                        return;
                                    }
                                    candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7;
                                    candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7;
                                    candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7;
                                    continue;
                                }
                                candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_7;
                                candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7;
                                candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7;
                            }
                            while( (candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7.lgspOutNext) != head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_7 );
                        }
                        candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7;
                    }
                    while( (candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7.lgspInNext) != head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_7 );
                }
            } 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_createChain
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_createChain.IMatch_createChain> 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_createChain.IMatch_createChain match, out GRGEN_LIBGR.INode output_0, out GRGEN_LIBGR.INode output_1);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createChain.IMatch_createChain> matches, List<GRGEN_LIBGR.INode> output_0, List<GRGEN_LIBGR.INode> output_1);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, ref GRGEN_LIBGR.INode output_0, ref GRGEN_LIBGR.INode output_1);
        /// <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, List<GRGEN_LIBGR.INode> output_0, List<GRGEN_LIBGR.INode> output_1);
        /// <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_createChain : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_createChain
    {
        public Action_createChain()
            : base(Rule_createChain.Instance.patternGraph)
        {
            _rulePattern = Rule_createChain.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_createChain _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "createChain"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_createChain.Match_createChain, Rule_createChain.IMatch_createChain> 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_createChain Instance { get { return instance; } set { instance = value; } }
        private static Action_createChain instance = new Action_createChain();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_createChain.IMatch_createChain> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_createChain.Match_createChain, Rule_createChain.IMatch_createChain>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[2];
            int isoSpace = 0;
            Rule_createChain.Match_createChain 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_createChain.IMatch_createChain> 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; } }
        List<GRGEN_LIBGR.INode> output_list_0 = new List<GRGEN_LIBGR.INode>();
        List<GRGEN_LIBGR.INode> output_list_1 = new List<GRGEN_LIBGR.INode>();
        public GRGEN_LIBGR.IMatchesExact<Rule_createChain.IMatch_createChain> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_createChain.IMatch_createChain match, out GRGEN_LIBGR.INode output_0, out GRGEN_LIBGR.INode output_1)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match, out output_0, out output_1);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createChain.IMatch_createChain> matches, List<GRGEN_LIBGR.INode> output_0, List<GRGEN_LIBGR.INode> output_1)
        {
            foreach(Rule_createChain.IMatch_createChain match in matches)
            {
                GRGEN_LIBGR.INode output_local_0; GRGEN_LIBGR.INode output_local_1; 
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match, out output_local_0, out output_local_1);
                output_0.Add(output_local_0);
                output_1.Add(output_local_1);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, ref GRGEN_LIBGR.INode output_0, ref GRGEN_LIBGR.INode output_1)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createChain.IMatch_createChain> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First, out output_0, out output_1);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, List<GRGEN_LIBGR.INode> output_0, List<GRGEN_LIBGR.INode> output_1)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createChain.IMatch_createChain> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_createChain.IMatch_createChain match in matches)
            {
                GRGEN_LIBGR.INode output_local_0; GRGEN_LIBGR.INode output_local_1; 
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match, out output_local_0, out output_local_1);
                output_0.Add(output_local_0);
                output_1.Add(output_local_1);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createChain.IMatch_createChain> matches;
            GRGEN_LIBGR.INode output_0; GRGEN_LIBGR.INode output_1; 
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First, out output_0, out output_1);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createChain.IMatch_createChain> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            GRGEN_LIBGR.INode output_0; GRGEN_LIBGR.INode output_1; 
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First, out output_0, out output_1);
                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_createChain.IMatch_createChain> matches;
            GRGEN_LIBGR.INode output_0; GRGEN_LIBGR.INode output_1; 
            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, out output_0, out output_1);
            }
            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)
        {
            GRGEN_LIBGR.INode output_0; GRGEN_LIBGR.INode output_1; 
            Modify(actionEnv, (Rule_createChain.IMatch_createChain)match, out output_0, out output_1);
            ReturnArray[0] = output_0;
            ReturnArray[1] = output_1;
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            output_list_0.Clear();
            output_list_1.Clear();
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_createChain.IMatch_createChain>)matches, output_list_0, output_list_1);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[2]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
                ReturnArrayListForAll[i][0] = output_list_0[i];
                ReturnArrayListForAll[i][1] = output_list_1[i];
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.INode output_0 = null; GRGEN_LIBGR.INode output_1 = null; 
            if(Apply(actionEnv, ref output_0, ref output_1)) {
                ReturnArray[0] = output_0;
                ReturnArray[1] = output_1;
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            GRGEN_LIBGR.INode output_0 = null; GRGEN_LIBGR.INode output_1 = null; 
            if(Apply(actionEnv, ref output_0, ref output_1)) {
                ReturnArray[0] = output_0;
                ReturnArray[1] = output_1;
                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[2]);
            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)
        {
            output_list_0.Clear();
            output_list_1.Clear();
            int matchesCount = ApplyAll(maxMatches, actionEnv, output_list_0, output_list_1);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[2]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
                ReturnArrayListForAll[i][0] = output_list_0[i];
                ReturnArrayListForAll[i][1] = output_list_1[i];
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            output_list_0.Clear();
            output_list_1.Clear();
            int matchesCount = ApplyAll(maxMatches, actionEnv, output_list_0, output_list_1);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[2]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
                ReturnArrayListForAll[i][0] = output_list_0[i];
                ReturnArrayListForAll[i][1] = output_list_1[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_chainFromTo
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_chainFromTo.IMatch_chainFromTo> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromTo_node_beg, GRGEN_LIBGR.INode chainFromTo_node_end);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_chainFromTo.IMatch_chainFromTo match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_chainFromTo.IMatch_chainFromTo> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromTo_node_beg, GRGEN_LIBGR.INode chainFromTo_node_end);
        /// <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, GRGEN_LIBGR.INode chainFromTo_node_beg, GRGEN_LIBGR.INode chainFromTo_node_end);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromTo_node_beg, GRGEN_LIBGR.INode chainFromTo_node_end);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromTo_node_beg, GRGEN_LIBGR.INode chainFromTo_node_end);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode chainFromTo_node_beg, GRGEN_LIBGR.INode chainFromTo_node_end);
    }
    
    public class Action_chainFromTo : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_chainFromTo
    {
        public Action_chainFromTo()
            : base(Rule_chainFromTo.Instance.patternGraph)
        {
            _rulePattern = Rule_chainFromTo.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_chainFromTo _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "chainFromTo"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_chainFromTo.Match_chainFromTo, Rule_chainFromTo.IMatch_chainFromTo> 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_chainFromTo Instance { get { return instance; } set { instance = value; } }
        private static Action_chainFromTo instance = new Action_chainFromTo();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_chainFromTo.IMatch_chainFromTo> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromTo_node_beg, GRGEN_LIBGR.INode chainFromTo_node_end)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_chainFromTo.Match_chainFromTo, Rule_chainFromTo.IMatch_chainFromTo>(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;
            // Preset chainFromTo_node_beg 
            GRGEN_LGSP.LGSPNode candidate_chainFromTo_node_beg = (GRGEN_LGSP.LGSPNode)chainFromTo_node_beg;
            uint prev__candidate_chainFromTo_node_beg;
            prev__candidate_chainFromTo_node_beg = candidate_chainFromTo_node_beg.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            candidate_chainFromTo_node_beg.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            // Preset chainFromTo_node_end 
            GRGEN_LGSP.LGSPNode candidate_chainFromTo_node_end = (GRGEN_LGSP.LGSPNode)chainFromTo_node_end;
            if((candidate_chainFromTo_node_end.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
            {
                candidate_chainFromTo_node_beg.lgspFlags = candidate_chainFromTo_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromTo_node_beg;
                return matches;
            }
            uint prev__candidate_chainFromTo_node_end;
            prev__candidate_chainFromTo_node_end = candidate_chainFromTo_node_end.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            candidate_chainFromTo_node_end.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            // Element ChainFromTo_node_to_inlined__sub0_8 assigned from other element chainFromTo_node_end 
            GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_to_inlined__sub0_8 = candidate_chainFromTo_node_end;
            // Element ChainFromTo_node_from_inlined__sub0_8 assigned from other element chainFromTo_node_beg 
            GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_from_inlined__sub0_8 = candidate_chainFromTo_node_beg;
            // Push alternative matching task for chainFromTo_alt_0_inlined__sub0_8_in_chainFromTo
            AlternativeAction_chainFromTo_alt_0_inlined__sub0_8_in_chainFromTo taskFor_alt_0_inlined__sub0_8_in_chainFromTo = AlternativeAction_chainFromTo_alt_0_inlined__sub0_8_in_chainFromTo.getNewTask(actionEnv, openTasks, Pattern_ChainFromTo.Instance.patternGraph.alternatives[(int)Pattern_ChainFromTo.ChainFromTo_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0_inlined__sub0_8_in_chainFromTo.ChainFromTo_node_from_inlined__sub0_8 = candidate_ChainFromTo_node_from_inlined__sub0_8;
            taskFor_alt_0_inlined__sub0_8_in_chainFromTo.ChainFromTo_node_to_inlined__sub0_8 = candidate_ChainFromTo_node_to_inlined__sub0_8;
            taskFor_alt_0_inlined__sub0_8_in_chainFromTo.searchPatternpath = false;
            taskFor_alt_0_inlined__sub0_8_in_chainFromTo.matchOfNestingPattern = null;
            taskFor_alt_0_inlined__sub0_8_in_chainFromTo.lastMatchAtPreviousNestingLevel = null;
            openTasks.Push(taskFor_alt_0_inlined__sub0_8_in_chainFromTo);
            uint prevGlobal__candidate_chainFromTo_node_beg;
            prevGlobal__candidate_chainFromTo_node_beg = candidate_chainFromTo_node_beg.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            candidate_chainFromTo_node_beg.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            uint prevGlobal__candidate_chainFromTo_node_end;
            prevGlobal__candidate_chainFromTo_node_end = candidate_chainFromTo_node_end.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            candidate_chainFromTo_node_end.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 chainFromTo_alt_0_inlined__sub0_8_in_chainFromTo
            openTasks.Pop();
            AlternativeAction_chainFromTo_alt_0_inlined__sub0_8_in_chainFromTo.releaseTask(taskFor_alt_0_inlined__sub0_8_in_chainFromTo);
            // 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_chainFromTo.Match_chainFromTo match = matches.GetNextUnfilledPosition();
                    Pattern_ChainFromTo.Match_ChainFromTo match__sub0 = new Pattern_ChainFromTo.Match_ChainFromTo();
                    match__sub0.SetMatchOfEnclosingPattern(match);
                    match._node_beg = candidate_chainFromTo_node_beg;
                    match._node_end = candidate_chainFromTo_node_end;
                    match__sub0._node_from = candidate_ChainFromTo_node_from_inlined__sub0_8;
                    match__sub0._node_to = candidate_ChainFromTo_node_to_inlined__sub0_8;
                    match.__sub0 = match__sub0;
                    match__sub0._alt_0 = (Pattern_ChainFromTo.IMatch_ChainFromTo_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_chainFromTo_node_end.lgspFlags = candidate_chainFromTo_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromTo_node_end;
                    candidate_chainFromTo_node_beg.lgspFlags = candidate_chainFromTo_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromTo_node_beg;
                    candidate_chainFromTo_node_end.lgspFlags = candidate_chainFromTo_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromTo_node_end;
                    candidate_chainFromTo_node_beg.lgspFlags = candidate_chainFromTo_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromTo_node_beg;
                    return matches;
                }
                candidate_chainFromTo_node_end.lgspFlags = candidate_chainFromTo_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromTo_node_end;
                candidate_chainFromTo_node_beg.lgspFlags = candidate_chainFromTo_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromTo_node_beg;
                candidate_chainFromTo_node_end.lgspFlags = candidate_chainFromTo_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromTo_node_end;
                candidate_chainFromTo_node_beg.lgspFlags = candidate_chainFromTo_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromTo_node_beg;
                return matches;
            }
            candidate_chainFromTo_node_beg.lgspFlags = candidate_chainFromTo_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromTo_node_beg;
            candidate_chainFromTo_node_end.lgspFlags = candidate_chainFromTo_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromTo_node_end;
            candidate_chainFromTo_node_end.lgspFlags = candidate_chainFromTo_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromTo_node_end;
            candidate_chainFromTo_node_beg.lgspFlags = candidate_chainFromTo_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromTo_node_beg;
            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_chainFromTo.IMatch_chainFromTo> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromTo_node_beg, GRGEN_LIBGR.INode chainFromTo_node_end);
        /// <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_chainFromTo.IMatch_chainFromTo> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromTo_node_beg, GRGEN_LIBGR.INode chainFromTo_node_end)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, chainFromTo_node_beg, chainFromTo_node_end);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_chainFromTo.IMatch_chainFromTo match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_chainFromTo.IMatch_chainFromTo> matches)
        {
            foreach(Rule_chainFromTo.IMatch_chainFromTo match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromTo_node_beg, GRGEN_LIBGR.INode chainFromTo_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromTo.IMatch_chainFromTo> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromTo_node_beg, chainFromTo_node_end);
            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.INode chainFromTo_node_beg, GRGEN_LIBGR.INode chainFromTo_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromTo.IMatch_chainFromTo> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, chainFromTo_node_beg, chainFromTo_node_end);
            if(matches.Count <= 0) return 0;
            foreach(Rule_chainFromTo.IMatch_chainFromTo match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromTo_node_beg, GRGEN_LIBGR.INode chainFromTo_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromTo.IMatch_chainFromTo> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromTo_node_beg, chainFromTo_node_end);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromTo_node_beg, GRGEN_LIBGR.INode chainFromTo_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromTo.IMatch_chainFromTo> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromTo_node_beg, chainFromTo_node_end);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromTo_node_beg, chainFromTo_node_end);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode chainFromTo_node_beg, GRGEN_LIBGR.INode chainFromTo_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromTo.IMatch_chainFromTo> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromTo_node_beg, chainFromTo_node_end);
                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, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_chainFromTo.IMatch_chainFromTo)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_chainFromTo.IMatch_chainFromTo>)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)
        {
            throw new Exception();
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1])) {
                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)
        {
            throw new Exception();
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
            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)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
        }
        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_chainFromTo_alt_0_inlined__sub0_8_in_chainFromTo : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_chainFromTo_alt_0_inlined__sub0_8_in_chainFromTo(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_chainFromTo_alt_0_inlined__sub0_8_in_chainFromTo getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_chainFromTo_alt_0_inlined__sub0_8_in_chainFromTo newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_chainFromTo_alt_0_inlined__sub0_8_in_chainFromTo(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_chainFromTo_alt_0_inlined__sub0_8_in_chainFromTo oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_chainFromTo_alt_0_inlined__sub0_8_in_chainFromTo freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_chainFromTo_alt_0_inlined__sub0_8_in_chainFromTo next = null;

        public GRGEN_LGSP.LGSPNode ChainFromTo_node_from_inlined__sub0_8;
        public GRGEN_LGSP.LGSPNode ChainFromTo_node_to_inlined__sub0_8;
        
        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 ChainFromTo_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromTo.ChainFromTo_alt_0_CaseNums.@base];
                // SubPreset ChainFromTo_node_from_inlined__sub0_8 
                GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_from_inlined__sub0_8 = ChainFromTo_node_from_inlined__sub0_8;
                // SubPreset ChainFromTo_node_to_inlined__sub0_8 
                GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_to_inlined__sub0_8 = ChainFromTo_node_to_inlined__sub0_8;
                // Extend Outgoing ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8 from ChainFromTo_node_from_inlined__sub0_8 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8 = candidate_ChainFromTo_node_from_inlined__sub0_8.lgspOuthead;
                if(head_candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8 = head_candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8;
                    do
                    {
                        if(candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8.lgspTarget != candidate_ChainFromTo_node_to_inlined__sub0_8) {
                            continue;
                        }
                        if((candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8.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_ChainFromTo.Match_ChainFromTo_alt_0_base match = new Pattern_ChainFromTo.Match_ChainFromTo_alt_0_base();
                            match._node_from = candidate_ChainFromTo_node_from_inlined__sub0_8;
                            match._node_to = candidate_ChainFromTo_node_to_inlined__sub0_8;
                            match._edge__edge0 = candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8;
                            currentFoundPartialMatch.Push(match);
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                            {
                                openTasks.Push(this);
                                return;
                            }
                            continue;
                        }
                        uint prevGlobal__candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8;
                        prevGlobal__candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8 = candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8.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_ChainFromTo.Match_ChainFromTo_alt_0_base match = new Pattern_ChainFromTo.Match_ChainFromTo_alt_0_base();
                                match._node_from = candidate_ChainFromTo_node_from_inlined__sub0_8;
                                match._node_to = candidate_ChainFromTo_node_to_inlined__sub0_8;
                                match._edge__edge0 = candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8;
                                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_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8.lgspFlags = candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8.lgspFlags = candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8;
                            continue;
                        }
                        candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8.lgspFlags = candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8;
                    }
                    while( (candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8 = candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8.lgspOutNext) != head_candidate_ChainFromTo_alt_0_base_edge__edge0_inlined__sub0_8 );
                }
            } 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 ChainFromTo_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromTo.ChainFromTo_alt_0_CaseNums.@rec];
                // SubPreset ChainFromTo_node_from_inlined__sub0_8 
                GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_from_inlined__sub0_8 = ChainFromTo_node_from_inlined__sub0_8;
                // SubPreset ChainFromTo_node_to_inlined__sub0_8 
                GRGEN_LGSP.LGSPNode candidate_ChainFromTo_node_to_inlined__sub0_8 = ChainFromTo_node_to_inlined__sub0_8;
                // Extend Outgoing ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8 from ChainFromTo_node_from_inlined__sub0_8 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8 = candidate_ChainFromTo_node_from_inlined__sub0_8.lgspOuthead;
                if(head_candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8 = head_candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8;
                    do
                    {
                        if(candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Implicit Target ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8 from ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8 = candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8.lgspTarget;
                        if((candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0
                            && candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8==candidate_ChainFromTo_node_from_inlined__sub0_8
                            )
                        {
                            continue;
                        }
                        if((candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Push subpattern matching task for _sub0_inlined__sub0_8
                        PatternAction_ChainFromTo taskFor__sub0_inlined__sub0_8 = PatternAction_ChainFromTo.getNewTask(actionEnv, openTasks);
                        taskFor__sub0_inlined__sub0_8.ChainFromTo_node_from = candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8;
                        taskFor__sub0_inlined__sub0_8.ChainFromTo_node_to = candidate_ChainFromTo_node_to_inlined__sub0_8;
                        taskFor__sub0_inlined__sub0_8.searchPatternpath = false;
                        taskFor__sub0_inlined__sub0_8.matchOfNestingPattern = null;
                        taskFor__sub0_inlined__sub0_8.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor__sub0_inlined__sub0_8);
                        uint prevGlobal__candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8;
                        prevGlobal__candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8 = candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8;
                        prevGlobal__candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8 = candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop subpattern matching task for _sub0_inlined__sub0_8
                        openTasks.Pop();
                        PatternAction_ChainFromTo.releaseTask(taskFor__sub0_inlined__sub0_8);
                        // 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_ChainFromTo.Match_ChainFromTo_alt_0_rec match = new Pattern_ChainFromTo.Match_ChainFromTo_alt_0_rec();
                                match._node_from = candidate_ChainFromTo_node_from_inlined__sub0_8;
                                match._node_intermediate = candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8;
                                match._node_to = candidate_ChainFromTo_node_to_inlined__sub0_8;
                                match._edge__edge0 = candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8;
                                match.__sub0 = (@Pattern_ChainFromTo.Match_ChainFromTo)currentFoundPartialMatch.Pop();
                                match.__sub0._matchOfEnclosingPattern = 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_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8.lgspFlags = candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8;
                                candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8.lgspFlags = candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8.lgspFlags = candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8;
                            candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8.lgspFlags = candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8;
                            continue;
                        }
                        candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8.lgspFlags = candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_8;
                        candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8.lgspFlags = candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8;
                    }
                    while( (candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8 = candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8.lgspOutNext) != head_candidate_ChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_8 );
                }
            } 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_chainFrom
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_chainFrom.IMatch_chainFrom> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFrom_node_beg);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_chainFrom.IMatch_chainFrom match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_chainFrom.IMatch_chainFrom> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFrom_node_beg);
        /// <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, GRGEN_LIBGR.INode chainFrom_node_beg);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFrom_node_beg);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFrom_node_beg);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode chainFrom_node_beg);
    }
    
    public class Action_chainFrom : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_chainFrom
    {
        public Action_chainFrom()
            : base(Rule_chainFrom.Instance.patternGraph)
        {
            _rulePattern = Rule_chainFrom.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_chainFrom _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "chainFrom"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_chainFrom.Match_chainFrom, Rule_chainFrom.IMatch_chainFrom> 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_chainFrom Instance { get { return instance; } set { instance = value; } }
        private static Action_chainFrom instance = new Action_chainFrom();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_chainFrom.IMatch_chainFrom> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFrom_node_beg)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_chainFrom.Match_chainFrom, Rule_chainFrom.IMatch_chainFrom>(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;
            // Preset chainFrom_node_beg 
            GRGEN_LGSP.LGSPNode candidate_chainFrom_node_beg = (GRGEN_LGSP.LGSPNode)chainFrom_node_beg;
            // Element ChainFrom_node_from_inlined__sub0_9 assigned from other element chainFrom_node_beg 
            GRGEN_LGSP.LGSPNode candidate_ChainFrom_node_from_inlined__sub0_9 = candidate_chainFrom_node_beg;
            // Push alternative matching task for chainFrom_alt_0_inlined__sub0_9_in_chainFrom
            AlternativeAction_chainFrom_alt_0_inlined__sub0_9_in_chainFrom taskFor_alt_0_inlined__sub0_9_in_chainFrom = AlternativeAction_chainFrom_alt_0_inlined__sub0_9_in_chainFrom.getNewTask(actionEnv, openTasks, Pattern_ChainFrom.Instance.patternGraph.alternatives[(int)Pattern_ChainFrom.ChainFrom_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0_inlined__sub0_9_in_chainFrom.ChainFrom_node_from_inlined__sub0_9 = candidate_ChainFrom_node_from_inlined__sub0_9;
            taskFor_alt_0_inlined__sub0_9_in_chainFrom.searchPatternpath = false;
            taskFor_alt_0_inlined__sub0_9_in_chainFrom.matchOfNestingPattern = null;
            taskFor_alt_0_inlined__sub0_9_in_chainFrom.lastMatchAtPreviousNestingLevel = null;
            openTasks.Push(taskFor_alt_0_inlined__sub0_9_in_chainFrom);
            uint prevGlobal__candidate_chainFrom_node_beg;
            prevGlobal__candidate_chainFrom_node_beg = candidate_chainFrom_node_beg.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            candidate_chainFrom_node_beg.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 chainFrom_alt_0_inlined__sub0_9_in_chainFrom
            openTasks.Pop();
            AlternativeAction_chainFrom_alt_0_inlined__sub0_9_in_chainFrom.releaseTask(taskFor_alt_0_inlined__sub0_9_in_chainFrom);
            // 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_chainFrom.Match_chainFrom match = matches.GetNextUnfilledPosition();
                    Pattern_ChainFrom.Match_ChainFrom match__sub0 = new Pattern_ChainFrom.Match_ChainFrom();
                    match__sub0.SetMatchOfEnclosingPattern(match);
                    match._node_beg = candidate_chainFrom_node_beg;
                    match__sub0._node_from = candidate_ChainFrom_node_from_inlined__sub0_9;
                    match.__sub0 = match__sub0;
                    match__sub0._alt_0 = (Pattern_ChainFrom.IMatch_ChainFrom_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_chainFrom_node_beg.lgspFlags = candidate_chainFrom_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFrom_node_beg;
                    return matches;
                }
                candidate_chainFrom_node_beg.lgspFlags = candidate_chainFrom_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFrom_node_beg;
                return matches;
            }
            candidate_chainFrom_node_beg.lgspFlags = candidate_chainFrom_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFrom_node_beg;
            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_chainFrom.IMatch_chainFrom> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFrom_node_beg);
        /// <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_chainFrom.IMatch_chainFrom> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFrom_node_beg)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, chainFrom_node_beg);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_chainFrom.IMatch_chainFrom match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_chainFrom.IMatch_chainFrom> matches)
        {
            foreach(Rule_chainFrom.IMatch_chainFrom match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFrom_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFrom.IMatch_chainFrom> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFrom_node_beg);
            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.INode chainFrom_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFrom.IMatch_chainFrom> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, chainFrom_node_beg);
            if(matches.Count <= 0) return 0;
            foreach(Rule_chainFrom.IMatch_chainFrom match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFrom_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFrom.IMatch_chainFrom> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFrom_node_beg);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFrom_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFrom.IMatch_chainFrom> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFrom_node_beg);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFrom_node_beg);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode chainFrom_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFrom.IMatch_chainFrom> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFrom_node_beg);
                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, (GRGEN_LIBGR.INode) parameters[0]);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_chainFrom.IMatch_chainFrom)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_chainFrom.IMatch_chainFrom>)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)
        {
            throw new Exception();
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv, (GRGEN_LIBGR.INode) parameters[0])) {
                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)
        {
            throw new Exception();
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv, (GRGEN_LIBGR.INode) parameters[0]);
            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)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv, (GRGEN_LIBGR.INode) parameters[0]);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv, (GRGEN_LIBGR.INode) parameters[0]);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max, (GRGEN_LIBGR.INode) parameters[0]);
        }
        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_chainFrom_alt_0_inlined__sub0_9_in_chainFrom : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_chainFrom_alt_0_inlined__sub0_9_in_chainFrom(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_chainFrom_alt_0_inlined__sub0_9_in_chainFrom getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_chainFrom_alt_0_inlined__sub0_9_in_chainFrom newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_chainFrom_alt_0_inlined__sub0_9_in_chainFrom(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_chainFrom_alt_0_inlined__sub0_9_in_chainFrom oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_chainFrom_alt_0_inlined__sub0_9_in_chainFrom freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_chainFrom_alt_0_inlined__sub0_9_in_chainFrom next = null;

        public GRGEN_LGSP.LGSPNode ChainFrom_node_from_inlined__sub0_9;
        
        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 ChainFrom_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFrom.ChainFrom_alt_0_CaseNums.@base];
                // 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_ChainFrom.Match_ChainFrom_alt_0_base match = new Pattern_ChainFrom.Match_ChainFrom_alt_0_base();
                    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)
                    {
                        Pattern_ChainFrom.Match_ChainFrom_alt_0_base match = new Pattern_ChainFrom.Match_ChainFrom_alt_0_base();
                        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);
            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 ChainFrom_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFrom.ChainFrom_alt_0_CaseNums.@rec];
                // SubPreset ChainFrom_node_from_inlined__sub0_9 
                GRGEN_LGSP.LGSPNode candidate_ChainFrom_node_from_inlined__sub0_9 = ChainFrom_node_from_inlined__sub0_9;
                // Extend Outgoing ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9 from ChainFrom_node_from_inlined__sub0_9 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9 = candidate_ChainFrom_node_from_inlined__sub0_9.lgspOuthead;
                if(head_candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9 = head_candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9;
                    do
                    {
                        if(candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Implicit Target ChainFrom_alt_0_rec_node_to_inlined__sub0_9 from ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9 
                        GRGEN_LGSP.LGSPNode candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9 = candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9.lgspTarget;
                        if((candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            continue;
                        }
                        if((candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Push subpattern matching task for _sub0_inlined__sub0_9
                        PatternAction_ChainFrom taskFor__sub0_inlined__sub0_9 = PatternAction_ChainFrom.getNewTask(actionEnv, openTasks);
                        taskFor__sub0_inlined__sub0_9.ChainFrom_node_from = candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9;
                        taskFor__sub0_inlined__sub0_9.searchPatternpath = false;
                        taskFor__sub0_inlined__sub0_9.matchOfNestingPattern = null;
                        taskFor__sub0_inlined__sub0_9.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor__sub0_inlined__sub0_9);
                        uint prevGlobal__candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9;
                        prevGlobal__candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9 = candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9;
                        prevGlobal__candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9 = candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop subpattern matching task for _sub0_inlined__sub0_9
                        openTasks.Pop();
                        PatternAction_ChainFrom.releaseTask(taskFor__sub0_inlined__sub0_9);
                        // 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_ChainFrom.Match_ChainFrom_alt_0_rec match = new Pattern_ChainFrom.Match_ChainFrom_alt_0_rec();
                                match._node_from = candidate_ChainFrom_node_from_inlined__sub0_9;
                                match._node_to = candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9;
                                match._edge__edge0 = candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9;
                                match.__sub0 = (@Pattern_ChainFrom.Match_ChainFrom)currentFoundPartialMatch.Pop();
                                match.__sub0._matchOfEnclosingPattern = 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_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9.lgspFlags = candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9;
                                candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9.lgspFlags = candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9.lgspFlags = candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9;
                            candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9.lgspFlags = candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9;
                            continue;
                        }
                        candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9.lgspFlags = candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_node_to_inlined__sub0_9;
                        candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9.lgspFlags = candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9;
                    }
                    while( (candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9 = candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9.lgspOutNext) != head_candidate_ChainFrom_alt_0_rec_edge__edge0_inlined__sub0_9 );
                }
            } 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_chainFromComplete
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_chainFromComplete.IMatch_chainFromComplete> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromComplete_node_beg);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_chainFromComplete.IMatch_chainFromComplete match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_chainFromComplete.IMatch_chainFromComplete> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromComplete_node_beg);
        /// <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, GRGEN_LIBGR.INode chainFromComplete_node_beg);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromComplete_node_beg);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromComplete_node_beg);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode chainFromComplete_node_beg);
    }
    
    public class Action_chainFromComplete : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_chainFromComplete
    {
        public Action_chainFromComplete()
            : base(Rule_chainFromComplete.Instance.patternGraph)
        {
            _rulePattern = Rule_chainFromComplete.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_chainFromComplete _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "chainFromComplete"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_chainFromComplete.Match_chainFromComplete, Rule_chainFromComplete.IMatch_chainFromComplete> 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_chainFromComplete Instance { get { return instance; } set { instance = value; } }
        private static Action_chainFromComplete instance = new Action_chainFromComplete();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_chainFromComplete.IMatch_chainFromComplete> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromComplete_node_beg)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_chainFromComplete.Match_chainFromComplete, Rule_chainFromComplete.IMatch_chainFromComplete>(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;
            // Preset chainFromComplete_node_beg 
            GRGEN_LGSP.LGSPNode candidate_chainFromComplete_node_beg = (GRGEN_LGSP.LGSPNode)chainFromComplete_node_beg;
            // Element ChainFromComplete_node_from_inlined__sub0_10 assigned from other element chainFromComplete_node_beg 
            GRGEN_LGSP.LGSPNode candidate_ChainFromComplete_node_from_inlined__sub0_10 = candidate_chainFromComplete_node_beg;
            // Push alternative matching task for chainFromComplete_alt_0_inlined__sub0_10_in_chainFromComplete
            AlternativeAction_chainFromComplete_alt_0_inlined__sub0_10_in_chainFromComplete taskFor_alt_0_inlined__sub0_10_in_chainFromComplete = AlternativeAction_chainFromComplete_alt_0_inlined__sub0_10_in_chainFromComplete.getNewTask(actionEnv, openTasks, Pattern_ChainFromComplete.Instance.patternGraph.alternatives[(int)Pattern_ChainFromComplete.ChainFromComplete_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0_inlined__sub0_10_in_chainFromComplete.ChainFromComplete_node_from_inlined__sub0_10 = candidate_ChainFromComplete_node_from_inlined__sub0_10;
            taskFor_alt_0_inlined__sub0_10_in_chainFromComplete.searchPatternpath = false;
            taskFor_alt_0_inlined__sub0_10_in_chainFromComplete.matchOfNestingPattern = null;
            taskFor_alt_0_inlined__sub0_10_in_chainFromComplete.lastMatchAtPreviousNestingLevel = null;
            openTasks.Push(taskFor_alt_0_inlined__sub0_10_in_chainFromComplete);
            uint prevGlobal__candidate_chainFromComplete_node_beg;
            prevGlobal__candidate_chainFromComplete_node_beg = candidate_chainFromComplete_node_beg.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            candidate_chainFromComplete_node_beg.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 chainFromComplete_alt_0_inlined__sub0_10_in_chainFromComplete
            openTasks.Pop();
            AlternativeAction_chainFromComplete_alt_0_inlined__sub0_10_in_chainFromComplete.releaseTask(taskFor_alt_0_inlined__sub0_10_in_chainFromComplete);
            // 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_chainFromComplete.Match_chainFromComplete match = matches.GetNextUnfilledPosition();
                    Pattern_ChainFromComplete.Match_ChainFromComplete match__sub0 = new Pattern_ChainFromComplete.Match_ChainFromComplete();
                    match__sub0.SetMatchOfEnclosingPattern(match);
                    match._node_beg = candidate_chainFromComplete_node_beg;
                    match__sub0._node_from = candidate_ChainFromComplete_node_from_inlined__sub0_10;
                    match.__sub0 = match__sub0;
                    match__sub0._alt_0 = (Pattern_ChainFromComplete.IMatch_ChainFromComplete_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_chainFromComplete_node_beg.lgspFlags = candidate_chainFromComplete_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromComplete_node_beg;
                    return matches;
                }
                candidate_chainFromComplete_node_beg.lgspFlags = candidate_chainFromComplete_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromComplete_node_beg;
                return matches;
            }
            candidate_chainFromComplete_node_beg.lgspFlags = candidate_chainFromComplete_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromComplete_node_beg;
            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_chainFromComplete.IMatch_chainFromComplete> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromComplete_node_beg);
        /// <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_chainFromComplete.IMatch_chainFromComplete> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromComplete_node_beg)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, chainFromComplete_node_beg);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_chainFromComplete.IMatch_chainFromComplete match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_chainFromComplete.IMatch_chainFromComplete> matches)
        {
            foreach(Rule_chainFromComplete.IMatch_chainFromComplete match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromComplete_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromComplete.IMatch_chainFromComplete> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromComplete_node_beg);
            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.INode chainFromComplete_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromComplete.IMatch_chainFromComplete> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, chainFromComplete_node_beg);
            if(matches.Count <= 0) return 0;
            foreach(Rule_chainFromComplete.IMatch_chainFromComplete match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromComplete_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromComplete.IMatch_chainFromComplete> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromComplete_node_beg);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromComplete_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromComplete.IMatch_chainFromComplete> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromComplete_node_beg);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromComplete_node_beg);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode chainFromComplete_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromComplete.IMatch_chainFromComplete> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromComplete_node_beg);
                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, (GRGEN_LIBGR.INode) parameters[0]);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_chainFromComplete.IMatch_chainFromComplete)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_chainFromComplete.IMatch_chainFromComplete>)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)
        {
            throw new Exception();
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv, (GRGEN_LIBGR.INode) parameters[0])) {
                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)
        {
            throw new Exception();
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv, (GRGEN_LIBGR.INode) parameters[0]);
            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)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv, (GRGEN_LIBGR.INode) parameters[0]);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv, (GRGEN_LIBGR.INode) parameters[0]);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max, (GRGEN_LIBGR.INode) parameters[0]);
        }
        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_chainFromComplete_alt_0_inlined__sub0_10_in_chainFromComplete : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_chainFromComplete_alt_0_inlined__sub0_10_in_chainFromComplete(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_chainFromComplete_alt_0_inlined__sub0_10_in_chainFromComplete getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_chainFromComplete_alt_0_inlined__sub0_10_in_chainFromComplete newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_chainFromComplete_alt_0_inlined__sub0_10_in_chainFromComplete(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_chainFromComplete_alt_0_inlined__sub0_10_in_chainFromComplete oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_chainFromComplete_alt_0_inlined__sub0_10_in_chainFromComplete freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_chainFromComplete_alt_0_inlined__sub0_10_in_chainFromComplete next = null;

        public GRGEN_LGSP.LGSPNode ChainFromComplete_node_from_inlined__sub0_10;
        
        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 ChainFromComplete_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromComplete.ChainFromComplete_alt_0_CaseNums.@base];
                // SubPreset ChainFromComplete_node_from_inlined__sub0_10 
                GRGEN_LGSP.LGSPNode candidate_ChainFromComplete_node_from_inlined__sub0_10 = ChainFromComplete_node_from_inlined__sub0_10;
                // NegativePattern 
                {
                    ++isoSpace;
                    uint prev_neg_0_inlined__sub0_10_in_chainFromComplete__candidate_ChainFromComplete_node_from_inlined__sub0_10;
                    prev_neg_0_inlined__sub0_10_in_chainFromComplete__candidate_ChainFromComplete_node_from_inlined__sub0_10 = candidate_ChainFromComplete_node_from_inlined__sub0_10.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    candidate_ChainFromComplete_node_from_inlined__sub0_10.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    // Extend Outgoing ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_10 from ChainFromComplete_node_from_inlined__sub0_10 
                    GRGEN_LGSP.LGSPEdge head_candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_10 = candidate_ChainFromComplete_node_from_inlined__sub0_10.lgspOuthead;
                    if(head_candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_10 != null)
                    {
                        GRGEN_LGSP.LGSPEdge candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_10 = head_candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_10;
                        do
                        {
                            if(candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_10.lgspType.TypeID!=1) {
                                continue;
                            }
                            if((candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_10.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                            {
                                continue;
                            }
                            // Implicit Target ChainFromComplete_alt_0_base_neg_0_node__node0_inlined__sub0_10 from ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_10 
                            GRGEN_LGSP.LGSPNode candidate_ChainFromComplete_alt_0_base_neg_0_node__node0_inlined__sub0_10 = candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_10.lgspTarget;
                            if((candidate_ChainFromComplete_alt_0_base_neg_0_node__node0_inlined__sub0_10.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                            {
                                continue;
                            }
                            if((candidate_ChainFromComplete_alt_0_base_neg_0_node__node0_inlined__sub0_10.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_ChainFromComplete_node_from_inlined__sub0_10.lgspFlags = candidate_ChainFromComplete_node_from_inlined__sub0_10.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0_inlined__sub0_10_in_chainFromComplete__candidate_ChainFromComplete_node_from_inlined__sub0_10;
                            --isoSpace;
                            goto label18;
                        }
                        while( (candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_10 = candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_10.lgspOutNext) != head_candidate_ChainFromComplete_alt_0_base_neg_0_edge__edge0_inlined__sub0_10 );
                    }
                    candidate_ChainFromComplete_node_from_inlined__sub0_10.lgspFlags = candidate_ChainFromComplete_node_from_inlined__sub0_10.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0_inlined__sub0_10_in_chainFromComplete__candidate_ChainFromComplete_node_from_inlined__sub0_10;
                    --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);
                    Pattern_ChainFromComplete.Match_ChainFromComplete_alt_0_base match = new Pattern_ChainFromComplete.Match_ChainFromComplete_alt_0_base();
                    match._node_from = candidate_ChainFromComplete_node_from_inlined__sub0_10;
                    currentFoundPartialMatch.Push(match);
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        openTasks.Push(this);
                        return;
                    }
                    goto label19;
                }
                // 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_ChainFromComplete.Match_ChainFromComplete_alt_0_base match = new Pattern_ChainFromComplete.Match_ChainFromComplete_alt_0_base();
                        match._node_from = candidate_ChainFromComplete_node_from_inlined__sub0_10;
                        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;
                    }
                    goto label20;
                }
label18: ;
label19: ;
label20: ;
            } 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 ChainFromComplete_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromComplete.ChainFromComplete_alt_0_CaseNums.@rec];
                // SubPreset ChainFromComplete_node_from_inlined__sub0_10 
                GRGEN_LGSP.LGSPNode candidate_ChainFromComplete_node_from_inlined__sub0_10 = ChainFromComplete_node_from_inlined__sub0_10;
                // Extend Outgoing ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10 from ChainFromComplete_node_from_inlined__sub0_10 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10 = candidate_ChainFromComplete_node_from_inlined__sub0_10.lgspOuthead;
                if(head_candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10 = head_candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10;
                    do
                    {
                        if(candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Implicit Target ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10 from ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10 = candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10.lgspTarget;
                        if((candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            continue;
                        }
                        if((candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Push subpattern matching task for _sub0_inlined__sub0_10
                        PatternAction_ChainFromComplete taskFor__sub0_inlined__sub0_10 = PatternAction_ChainFromComplete.getNewTask(actionEnv, openTasks);
                        taskFor__sub0_inlined__sub0_10.ChainFromComplete_node_from = candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10;
                        taskFor__sub0_inlined__sub0_10.searchPatternpath = false;
                        taskFor__sub0_inlined__sub0_10.matchOfNestingPattern = null;
                        taskFor__sub0_inlined__sub0_10.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor__sub0_inlined__sub0_10);
                        uint prevGlobal__candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10;
                        prevGlobal__candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10 = candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10;
                        prevGlobal__candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10 = candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop subpattern matching task for _sub0_inlined__sub0_10
                        openTasks.Pop();
                        PatternAction_ChainFromComplete.releaseTask(taskFor__sub0_inlined__sub0_10);
                        // 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_ChainFromComplete.Match_ChainFromComplete_alt_0_rec match = new Pattern_ChainFromComplete.Match_ChainFromComplete_alt_0_rec();
                                match._node_from = candidate_ChainFromComplete_node_from_inlined__sub0_10;
                                match._node_to = candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10;
                                match._edge__edge0 = candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10;
                                match.__sub0 = (@Pattern_ChainFromComplete.Match_ChainFromComplete)currentFoundPartialMatch.Pop();
                                match.__sub0._matchOfEnclosingPattern = 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_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10.lgspFlags = candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10;
                                candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10.lgspFlags = candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10.lgspFlags = candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10;
                            candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10.lgspFlags = candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10;
                            continue;
                        }
                        candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10.lgspFlags = candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_node_to_inlined__sub0_10;
                        candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10.lgspFlags = candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10;
                    }
                    while( (candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10 = candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10.lgspOutNext) != head_candidate_ChainFromComplete_alt_0_rec_edge__edge0_inlined__sub0_10 );
                }
            } 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_chainFromCompleteArbitraryPatternpathLocked
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromCompleteArbitraryPatternpathLocked_node_beg);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromCompleteArbitraryPatternpathLocked_node_beg);
        /// <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, GRGEN_LIBGR.INode chainFromCompleteArbitraryPatternpathLocked_node_beg);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromCompleteArbitraryPatternpathLocked_node_beg);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromCompleteArbitraryPatternpathLocked_node_beg);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode chainFromCompleteArbitraryPatternpathLocked_node_beg);
    }
    
    public class Action_chainFromCompleteArbitraryPatternpathLocked : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_chainFromCompleteArbitraryPatternpathLocked
    {
        public Action_chainFromCompleteArbitraryPatternpathLocked()
            : base(Rule_chainFromCompleteArbitraryPatternpathLocked.Instance.patternGraph)
        {
            _rulePattern = Rule_chainFromCompleteArbitraryPatternpathLocked.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_chainFromCompleteArbitraryPatternpathLocked _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "chainFromCompleteArbitraryPatternpathLocked"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_chainFromCompleteArbitraryPatternpathLocked.Match_chainFromCompleteArbitraryPatternpathLocked, Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> 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_chainFromCompleteArbitraryPatternpathLocked Instance { get { return instance; } set { instance = value; } }
        private static Action_chainFromCompleteArbitraryPatternpathLocked instance = new Action_chainFromCompleteArbitraryPatternpathLocked();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromCompleteArbitraryPatternpathLocked_node_beg)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_chainFromCompleteArbitraryPatternpathLocked.Match_chainFromCompleteArbitraryPatternpathLocked, Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            bool searchPatternpath = false;
            Rule_chainFromCompleteArbitraryPatternpathLocked.Match_chainFromCompleteArbitraryPatternpathLocked patternpath_match_chainFromCompleteArbitraryPatternpathLocked = null;
            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;
            // Preset chainFromCompleteArbitraryPatternpathLocked_node_beg 
            GRGEN_LGSP.LGSPNode candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg = (GRGEN_LGSP.LGSPNode)chainFromCompleteArbitraryPatternpathLocked_node_beg;
            // build match of chainFromCompleteArbitraryPatternpathLocked for patternpath checks
            if(patternpath_match_chainFromCompleteArbitraryPatternpathLocked==null) patternpath_match_chainFromCompleteArbitraryPatternpathLocked = new Rule_chainFromCompleteArbitraryPatternpathLocked.Match_chainFromCompleteArbitraryPatternpathLocked();
            patternpath_match_chainFromCompleteArbitraryPatternpathLocked._matchOfEnclosingPattern = null;
            patternpath_match_chainFromCompleteArbitraryPatternpathLocked._node_beg = candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg;
            uint prevSomeGlobal__candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg;
            prevSomeGlobal__candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg = candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
            candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
            // Push subpattern matching task for _sub0
            PatternAction_ChainFromCompleteArbitraryPatternpathLocked taskFor__sub0 = PatternAction_ChainFromCompleteArbitraryPatternpathLocked.getNewTask(actionEnv, openTasks);
            taskFor__sub0.ChainFromCompleteArbitraryPatternpathLocked_node_from = candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg;
            taskFor__sub0.searchPatternpath = false;
            taskFor__sub0.matchOfNestingPattern = patternpath_match_chainFromCompleteArbitraryPatternpathLocked;
            taskFor__sub0.lastMatchAtPreviousNestingLevel = null;
            openTasks.Push(taskFor__sub0);
            uint prevGlobal__candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg;
            prevGlobal__candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg = candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            // Match subpatterns 
            openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
            // Pop subpattern matching task for _sub0
            openTasks.Pop();
            PatternAction_ChainFromCompleteArbitraryPatternpathLocked.releaseTask(taskFor__sub0);
            // 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_chainFromCompleteArbitraryPatternpathLocked.Match_chainFromCompleteArbitraryPatternpathLocked match = matches.GetNextUnfilledPosition();
                    match._node_beg = candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg;
                    match.__sub0 = (@Pattern_ChainFromCompleteArbitraryPatternpathLocked.Match_ChainFromCompleteArbitraryPatternpathLocked)currentFoundPartialMatch.Pop();
                    match.__sub0._matchOfEnclosingPattern = match;
                    matches.PositionWasFilledFixIt();
                }
                matchesList.Clear();
                // if enough matches were found, we leave
                if(maxMatches > 0 && matches.Count >= maxMatches)
                {
                    candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg.lgspFlags = candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg;
                    candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg.lgspFlags = candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg;
                    return matches;
                }
                candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg.lgspFlags = candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg;
                candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg.lgspFlags = candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg;
                return matches;
            }
            candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg.lgspFlags = candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg;
            candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg.lgspFlags = candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_chainFromCompleteArbitraryPatternpathLocked_node_beg;
            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_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromCompleteArbitraryPatternpathLocked_node_beg);
        /// <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_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromCompleteArbitraryPatternpathLocked_node_beg)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, chainFromCompleteArbitraryPatternpathLocked_node_beg);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> matches)
        {
            foreach(Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromCompleteArbitraryPatternpathLocked_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromCompleteArbitraryPatternpathLocked_node_beg);
            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.INode chainFromCompleteArbitraryPatternpathLocked_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, chainFromCompleteArbitraryPatternpathLocked_node_beg);
            if(matches.Count <= 0) return 0;
            foreach(Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromCompleteArbitraryPatternpathLocked_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromCompleteArbitraryPatternpathLocked_node_beg);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromCompleteArbitraryPatternpathLocked_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromCompleteArbitraryPatternpathLocked_node_beg);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromCompleteArbitraryPatternpathLocked_node_beg);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode chainFromCompleteArbitraryPatternpathLocked_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromCompleteArbitraryPatternpathLocked_node_beg);
                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, (GRGEN_LIBGR.INode) parameters[0]);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryPatternpathLocked.IMatch_chainFromCompleteArbitraryPatternpathLocked>)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)
        {
            throw new Exception();
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv, (GRGEN_LIBGR.INode) parameters[0])) {
                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)
        {
            throw new Exception();
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv, (GRGEN_LIBGR.INode) parameters[0]);
            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)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv, (GRGEN_LIBGR.INode) parameters[0]);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv, (GRGEN_LIBGR.INode) parameters[0]);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max, (GRGEN_LIBGR.INode) parameters[0]);
        }
        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_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg);
        /// <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, GRGEN_LIBGR.INode chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg);
    }
    
    public class Action_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards
    {
        public Action_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards()
            : base(Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph)
        {
            _rulePattern = Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards, Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> 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_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards Instance { get { return instance; } set { instance = value; } }
        private static Action_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards instance = new Action_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards, Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards>(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;
            // Preset chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg 
            GRGEN_LGSP.LGSPNode candidate_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg = (GRGEN_LGSP.LGSPNode)chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg;
            // Element ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11 assigned from other element chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg 
            GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11 = candidate_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg;
            // Push alternative matching task for chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards
            AlternativeAction_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards taskFor_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards = AlternativeAction_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.getNewTask(actionEnv, openTasks, Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph.alternatives[(int)Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11;
            taskFor_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.searchPatternpath = false;
            taskFor_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.matchOfNestingPattern = null;
            taskFor_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.lastMatchAtPreviousNestingLevel = null;
            openTasks.Push(taskFor_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards);
            uint prevGlobal__candidate_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg;
            prevGlobal__candidate_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg = candidate_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            candidate_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg.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 chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards
            openTasks.Pop();
            AlternativeAction_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.releaseTask(taskFor_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards);
            // 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_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards match = matches.GetNextUnfilledPosition();
                    Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards match__sub0 = new Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards();
                    match__sub0.SetMatchOfEnclosingPattern(match);
                    match._node_beg = candidate_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg;
                    match__sub0._node_from = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11;
                    match.__sub0 = match__sub0;
                    match__sub0._alt_0 = (Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_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_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg.lgspFlags = candidate_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg;
                    return matches;
                }
                candidate_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg.lgspFlags = candidate_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg;
                return matches;
            }
            candidate_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg.lgspFlags = candidate_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg;
            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_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg);
        /// <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_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> matches)
        {
            foreach(Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg);
            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.INode chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg);
            if(matches.Count <= 0) return 0;
            foreach(Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_beg);
                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, (GRGEN_LIBGR.INode) parameters[0]);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.IMatch_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards>)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)
        {
            throw new Exception();
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv, (GRGEN_LIBGR.INode) parameters[0])) {
                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)
        {
            throw new Exception();
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv, (GRGEN_LIBGR.INode) parameters[0]);
            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)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv, (GRGEN_LIBGR.INode) parameters[0]);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv, (GRGEN_LIBGR.INode) parameters[0]);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max, (GRGEN_LIBGR.INode) parameters[0]);
        }
        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_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards next = null;

        public GRGEN_LGSP.LGSPNode ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11;
        
        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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_CaseNums.@base];
                // SubPreset ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11 
                GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11 = ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11;
                // NegativePattern 
                {
                    ++isoSpace;
                    uint prev_neg_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11;
                    prev_neg_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                    // both directions of ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11
                    for(int directionRunCounterOf_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11 = 0; directionRunCounterOf_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11 < 2; ++directionRunCounterOf_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11)
                    {
                        // Extend IncomingOrOutgoing ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11 from ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11 
                        GRGEN_LGSP.LGSPEdge head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11 = directionRunCounterOf_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11==0 ? candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11.lgspInhead : candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11.lgspOuthead;
                        if(head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11 = head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11;
                            do
                            {
                                if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    continue;
                                }
                                // Implicit TheOther ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0_inlined__sub0_11 from ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11 
                                GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0_inlined__sub0_11 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11==candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11.lgspSource ? candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11.lgspTarget : candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11.lgspSource;
                                if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0_inlined__sub0_11.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_node__node0_inlined__sub0_11.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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11;
                                --isoSpace;
                                goto label21;
                            }
                            while( (directionRunCounterOf_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11==0 ? candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11.lgspInNext : candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11.lgspOutNext) != head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base_neg_0_edge__edge0_inlined__sub0_11 );
                        }
                    }
                    candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev_neg_0_inlined__sub0_11_in_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11;
                    --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);
                    Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base match = new Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base();
                    match._node_from = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11;
                    currentFoundPartialMatch.Push(match);
                    // if enough matches were found, we leave
                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                    {
                        openTasks.Push(this);
                        return;
                    }
                    goto label22;
                }
                // 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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base match = new Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_base();
                        match._node_from = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11;
                        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;
                    }
                    goto label23;
                }
label21: ;
label22: ;
label23: ;
            } 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 ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_CaseNums.@rec];
                // SubPreset ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11 
                GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11 = ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11;
                // Extend Outgoing ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11 from ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11.lgspOuthead;
                if(head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11 = head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11;
                    do
                    {
                        if(candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Implicit Target ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11 from ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11.lgspTarget;
                        if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                        {
                            continue;
                        }
                        if((candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Push subpattern matching task for _sub0_inlined__sub0_11
                        PatternAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards taskFor__sub0_inlined__sub0_11 = PatternAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.getNewTask(actionEnv, openTasks);
                        taskFor__sub0_inlined__sub0_11.ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11;
                        taskFor__sub0_inlined__sub0_11.searchPatternpath = false;
                        taskFor__sub0_inlined__sub0_11.matchOfNestingPattern = null;
                        taskFor__sub0_inlined__sub0_11.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor__sub0_inlined__sub0_11);
                        uint prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11;
                        prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11;
                        prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop subpattern matching task for _sub0_inlined__sub0_11
                        openTasks.Pop();
                        PatternAction_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.releaseTask(taskFor__sub0_inlined__sub0_11);
                        // 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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec match = new Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec();
                                match._node_from = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_node_from_inlined__sub0_11;
                                match._node_to = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11;
                                match._edge__edge0 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11;
                                match.__sub0 = (@Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Match_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards)currentFoundPartialMatch.Pop();
                                match.__sub0._matchOfEnclosingPattern = 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_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11;
                                candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11;
                            candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11;
                            continue;
                        }
                        candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_node_to_inlined__sub0_11;
                        candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11.lgspFlags = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11;
                    }
                    while( (candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11 = candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11.lgspOutNext) != head_candidate_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_alt_0_rec_edge__edge0_inlined__sub0_11 );
                }
            } 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_createBlowball
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_createBlowball.IMatch_createBlowball> 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_createBlowball.IMatch_createBlowball match, out GRGEN_LIBGR.INode output_0);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createBlowball.IMatch_createBlowball> matches, List<GRGEN_LIBGR.INode> output_0);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, ref GRGEN_LIBGR.INode output_0);
        /// <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, List<GRGEN_LIBGR.INode> output_0);
        /// <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_createBlowball : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_createBlowball
    {
        public Action_createBlowball()
            : base(Rule_createBlowball.Instance.patternGraph)
        {
            _rulePattern = Rule_createBlowball.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_createBlowball _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "createBlowball"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_createBlowball.Match_createBlowball, Rule_createBlowball.IMatch_createBlowball> 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_createBlowball Instance { get { return instance; } set { instance = value; } }
        private static Action_createBlowball instance = new Action_createBlowball();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_createBlowball.IMatch_createBlowball> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_createBlowball.Match_createBlowball, Rule_createBlowball.IMatch_createBlowball>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[1];
            int isoSpace = 0;
            Rule_createBlowball.Match_createBlowball 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_createBlowball.IMatch_createBlowball> 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; } }
        List<GRGEN_LIBGR.INode> output_list_0 = new List<GRGEN_LIBGR.INode>();
        public GRGEN_LIBGR.IMatchesExact<Rule_createBlowball.IMatch_createBlowball> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_createBlowball.IMatch_createBlowball match, out GRGEN_LIBGR.INode output_0)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match, out output_0);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createBlowball.IMatch_createBlowball> matches, List<GRGEN_LIBGR.INode> output_0)
        {
            foreach(Rule_createBlowball.IMatch_createBlowball match in matches)
            {
                GRGEN_LIBGR.INode output_local_0; 
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match, out output_local_0);
                output_0.Add(output_local_0);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, ref GRGEN_LIBGR.INode output_0)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createBlowball.IMatch_createBlowball> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First, out output_0);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, List<GRGEN_LIBGR.INode> output_0)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createBlowball.IMatch_createBlowball> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_createBlowball.IMatch_createBlowball match in matches)
            {
                GRGEN_LIBGR.INode output_local_0; 
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match, out output_local_0);
                output_0.Add(output_local_0);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createBlowball.IMatch_createBlowball> matches;
            GRGEN_LIBGR.INode output_0; 
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First, out output_0);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createBlowball.IMatch_createBlowball> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            GRGEN_LIBGR.INode output_0; 
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First, out output_0);
                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_createBlowball.IMatch_createBlowball> matches;
            GRGEN_LIBGR.INode output_0; 
            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, out output_0);
            }
            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)
        {
            GRGEN_LIBGR.INode output_0; 
            Modify(actionEnv, (Rule_createBlowball.IMatch_createBlowball)match, out output_0);
            ReturnArray[0] = output_0;
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            output_list_0.Clear();
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_createBlowball.IMatch_createBlowball>)matches, output_list_0);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[1]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
                ReturnArrayListForAll[i][0] = output_list_0[i];
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.INode output_0 = null; 
            if(Apply(actionEnv, ref output_0)) {
                ReturnArray[0] = output_0;
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            GRGEN_LIBGR.INode output_0 = null; 
            if(Apply(actionEnv, ref output_0)) {
                ReturnArray[0] = output_0;
                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[1]);
            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)
        {
            output_list_0.Clear();
            int matchesCount = ApplyAll(maxMatches, actionEnv, output_list_0);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[1]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
                ReturnArrayListForAll[i][0] = output_list_0[i];
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            output_list_0.Clear();
            int matchesCount = ApplyAll(maxMatches, actionEnv, output_list_0);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[1]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
                ReturnArrayListForAll[i][0] = output_list_0[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_blowball
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_blowball.IMatch_blowball> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode blowball_node_head);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_blowball.IMatch_blowball match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_blowball.IMatch_blowball> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode blowball_node_head);
        /// <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, GRGEN_LIBGR.INode blowball_node_head);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode blowball_node_head);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode blowball_node_head);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode blowball_node_head);
    }
    
    public class Action_blowball : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_blowball
    {
        public Action_blowball()
            : base(Rule_blowball.Instance.patternGraph)
        {
            _rulePattern = Rule_blowball.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_blowball _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "blowball"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_blowball.Match_blowball, Rule_blowball.IMatch_blowball> 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_blowball Instance { get { return instance; } set { instance = value; } }
        private static Action_blowball instance = new Action_blowball();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_blowball.IMatch_blowball> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode blowball_node_head)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_blowball.Match_blowball, Rule_blowball.IMatch_blowball>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[0];
            int isoSpace = 0;
            bool searchPatternpath = false;
            Rule_blowball.Match_blowball patternpath_match_blowball = null;
            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;
            // Preset blowball_node_head 
            GRGEN_LGSP.LGSPNode candidate_blowball_node_head = (GRGEN_LGSP.LGSPNode)blowball_node_head;
            // build match of blowball for patternpath checks
            if(patternpath_match_blowball==null) patternpath_match_blowball = new Rule_blowball.Match_blowball();
            patternpath_match_blowball._matchOfEnclosingPattern = null;
            patternpath_match_blowball._node_head = candidate_blowball_node_head;
            uint prevSomeGlobal__candidate_blowball_node_head;
            prevSomeGlobal__candidate_blowball_node_head = candidate_blowball_node_head.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
            candidate_blowball_node_head.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN;
            // Push subpattern matching task for _sub0
            PatternAction_Blowball taskFor__sub0 = PatternAction_Blowball.getNewTask(actionEnv, openTasks);
            taskFor__sub0.Blowball_node_head = candidate_blowball_node_head;
            taskFor__sub0.searchPatternpath = false;
            taskFor__sub0.matchOfNestingPattern = patternpath_match_blowball;
            taskFor__sub0.lastMatchAtPreviousNestingLevel = null;
            openTasks.Push(taskFor__sub0);
            uint prevGlobal__candidate_blowball_node_head;
            prevGlobal__candidate_blowball_node_head = candidate_blowball_node_head.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            candidate_blowball_node_head.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            // Match subpatterns 
            openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
            // Pop subpattern matching task for _sub0
            openTasks.Pop();
            PatternAction_Blowball.releaseTask(taskFor__sub0);
            // 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_blowball.Match_blowball match = matches.GetNextUnfilledPosition();
                    match._node_head = candidate_blowball_node_head;
                    match.__sub0 = (@Pattern_Blowball.Match_Blowball)currentFoundPartialMatch.Pop();
                    match.__sub0._matchOfEnclosingPattern = match;
                    matches.PositionWasFilledFixIt();
                }
                matchesList.Clear();
                // if enough matches were found, we leave
                if(maxMatches > 0 && matches.Count >= maxMatches)
                {
                    candidate_blowball_node_head.lgspFlags = candidate_blowball_node_head.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_blowball_node_head;
                    candidate_blowball_node_head.lgspFlags = candidate_blowball_node_head.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_blowball_node_head;
                    return matches;
                }
                candidate_blowball_node_head.lgspFlags = candidate_blowball_node_head.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_blowball_node_head;
                candidate_blowball_node_head.lgspFlags = candidate_blowball_node_head.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_blowball_node_head;
                return matches;
            }
            candidate_blowball_node_head.lgspFlags = candidate_blowball_node_head.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_blowball_node_head;
            candidate_blowball_node_head.lgspFlags = candidate_blowball_node_head.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_SOME_ENCLOSING_PATTERN) | prevSomeGlobal__candidate_blowball_node_head;
            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_blowball.IMatch_blowball> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode blowball_node_head);
        /// <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_blowball.IMatch_blowball> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode blowball_node_head)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, blowball_node_head);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_blowball.IMatch_blowball match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_blowball.IMatch_blowball> matches)
        {
            foreach(Rule_blowball.IMatch_blowball match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode blowball_node_head)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_blowball.IMatch_blowball> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, blowball_node_head);
            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.INode blowball_node_head)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_blowball.IMatch_blowball> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, blowball_node_head);
            if(matches.Count <= 0) return 0;
            foreach(Rule_blowball.IMatch_blowball match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode blowball_node_head)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_blowball.IMatch_blowball> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, blowball_node_head);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode blowball_node_head)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_blowball.IMatch_blowball> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, blowball_node_head);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, blowball_node_head);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode blowball_node_head)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_blowball.IMatch_blowball> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, blowball_node_head);
                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, (GRGEN_LIBGR.INode) parameters[0]);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_blowball.IMatch_blowball)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_blowball.IMatch_blowball>)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)
        {
            throw new Exception();
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv, (GRGEN_LIBGR.INode) parameters[0])) {
                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)
        {
            throw new Exception();
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv, (GRGEN_LIBGR.INode) parameters[0]);
            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)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv, (GRGEN_LIBGR.INode) parameters[0]);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv, (GRGEN_LIBGR.INode) parameters[0]);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max, (GRGEN_LIBGR.INode) parameters[0]);
        }
        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_reverseChainFromTo
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromTo.IMatch_reverseChainFromTo> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode reverseChainFromTo_node_beg, GRGEN_LIBGR.INode reverseChainFromTo_node_end);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_reverseChainFromTo.IMatch_reverseChainFromTo match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromTo.IMatch_reverseChainFromTo> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode reverseChainFromTo_node_beg, GRGEN_LIBGR.INode reverseChainFromTo_node_end);
        /// <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, GRGEN_LIBGR.INode reverseChainFromTo_node_beg, GRGEN_LIBGR.INode reverseChainFromTo_node_end);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode reverseChainFromTo_node_beg, GRGEN_LIBGR.INode reverseChainFromTo_node_end);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode reverseChainFromTo_node_beg, GRGEN_LIBGR.INode reverseChainFromTo_node_end);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode reverseChainFromTo_node_beg, GRGEN_LIBGR.INode reverseChainFromTo_node_end);
    }
    
    public class Action_reverseChainFromTo : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_reverseChainFromTo
    {
        public Action_reverseChainFromTo()
            : base(Rule_reverseChainFromTo.Instance.patternGraph)
        {
            _rulePattern = Rule_reverseChainFromTo.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_reverseChainFromTo _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "reverseChainFromTo"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_reverseChainFromTo.Match_reverseChainFromTo, Rule_reverseChainFromTo.IMatch_reverseChainFromTo> 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_reverseChainFromTo Instance { get { return instance; } set { instance = value; } }
        private static Action_reverseChainFromTo instance = new Action_reverseChainFromTo();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromTo.IMatch_reverseChainFromTo> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode reverseChainFromTo_node_beg, GRGEN_LIBGR.INode reverseChainFromTo_node_end)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_reverseChainFromTo.Match_reverseChainFromTo, Rule_reverseChainFromTo.IMatch_reverseChainFromTo>(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;
            // Preset reverseChainFromTo_node_beg 
            GRGEN_LGSP.LGSPNode candidate_reverseChainFromTo_node_beg = (GRGEN_LGSP.LGSPNode)reverseChainFromTo_node_beg;
            uint prev__candidate_reverseChainFromTo_node_beg;
            prev__candidate_reverseChainFromTo_node_beg = candidate_reverseChainFromTo_node_beg.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            candidate_reverseChainFromTo_node_beg.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            // Preset reverseChainFromTo_node_end 
            GRGEN_LGSP.LGSPNode candidate_reverseChainFromTo_node_end = (GRGEN_LGSP.LGSPNode)reverseChainFromTo_node_end;
            if((candidate_reverseChainFromTo_node_end.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
            {
                candidate_reverseChainFromTo_node_beg.lgspFlags = candidate_reverseChainFromTo_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromTo_node_beg;
                return matches;
            }
            uint prev__candidate_reverseChainFromTo_node_end;
            prev__candidate_reverseChainFromTo_node_end = candidate_reverseChainFromTo_node_end.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            candidate_reverseChainFromTo_node_end.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            // Element ReverseChainFromTo_node_to_inlined__sub0_12 assigned from other element reverseChainFromTo_node_end 
            GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_to_inlined__sub0_12 = candidate_reverseChainFromTo_node_end;
            // Element ReverseChainFromTo_node_from_inlined__sub0_12 assigned from other element reverseChainFromTo_node_beg 
            GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_from_inlined__sub0_12 = candidate_reverseChainFromTo_node_beg;
            // Push alternative matching task for reverseChainFromTo_alt_0_inlined__sub0_12_in_reverseChainFromTo
            AlternativeAction_reverseChainFromTo_alt_0_inlined__sub0_12_in_reverseChainFromTo taskFor_alt_0_inlined__sub0_12_in_reverseChainFromTo = AlternativeAction_reverseChainFromTo_alt_0_inlined__sub0_12_in_reverseChainFromTo.getNewTask(actionEnv, openTasks, Pattern_ReverseChainFromTo.Instance.patternGraph.alternatives[(int)Pattern_ReverseChainFromTo.ReverseChainFromTo_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0_inlined__sub0_12_in_reverseChainFromTo.ReverseChainFromTo_node_to_inlined__sub0_12 = candidate_ReverseChainFromTo_node_to_inlined__sub0_12;
            taskFor_alt_0_inlined__sub0_12_in_reverseChainFromTo.ReverseChainFromTo_node_from_inlined__sub0_12 = candidate_ReverseChainFromTo_node_from_inlined__sub0_12;
            taskFor_alt_0_inlined__sub0_12_in_reverseChainFromTo.searchPatternpath = false;
            taskFor_alt_0_inlined__sub0_12_in_reverseChainFromTo.matchOfNestingPattern = null;
            taskFor_alt_0_inlined__sub0_12_in_reverseChainFromTo.lastMatchAtPreviousNestingLevel = null;
            openTasks.Push(taskFor_alt_0_inlined__sub0_12_in_reverseChainFromTo);
            uint prevGlobal__candidate_reverseChainFromTo_node_beg;
            prevGlobal__candidate_reverseChainFromTo_node_beg = candidate_reverseChainFromTo_node_beg.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            candidate_reverseChainFromTo_node_beg.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            uint prevGlobal__candidate_reverseChainFromTo_node_end;
            prevGlobal__candidate_reverseChainFromTo_node_end = candidate_reverseChainFromTo_node_end.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            candidate_reverseChainFromTo_node_end.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 reverseChainFromTo_alt_0_inlined__sub0_12_in_reverseChainFromTo
            openTasks.Pop();
            AlternativeAction_reverseChainFromTo_alt_0_inlined__sub0_12_in_reverseChainFromTo.releaseTask(taskFor_alt_0_inlined__sub0_12_in_reverseChainFromTo);
            // 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_reverseChainFromTo.Match_reverseChainFromTo match = matches.GetNextUnfilledPosition();
                    Pattern_ReverseChainFromTo.Match_ReverseChainFromTo match__sub0 = new Pattern_ReverseChainFromTo.Match_ReverseChainFromTo();
                    match__sub0.SetMatchOfEnclosingPattern(match);
                    match._node_beg = candidate_reverseChainFromTo_node_beg;
                    match._node_end = candidate_reverseChainFromTo_node_end;
                    match__sub0._node_from = candidate_ReverseChainFromTo_node_from_inlined__sub0_12;
                    match__sub0._node_to = candidate_ReverseChainFromTo_node_to_inlined__sub0_12;
                    match.__sub0 = match__sub0;
                    match__sub0._alt_0 = (Pattern_ReverseChainFromTo.IMatch_ReverseChainFromTo_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_reverseChainFromTo_node_end.lgspFlags = candidate_reverseChainFromTo_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_reverseChainFromTo_node_end;
                    candidate_reverseChainFromTo_node_beg.lgspFlags = candidate_reverseChainFromTo_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_reverseChainFromTo_node_beg;
                    candidate_reverseChainFromTo_node_end.lgspFlags = candidate_reverseChainFromTo_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromTo_node_end;
                    candidate_reverseChainFromTo_node_beg.lgspFlags = candidate_reverseChainFromTo_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromTo_node_beg;
                    return matches;
                }
                candidate_reverseChainFromTo_node_end.lgspFlags = candidate_reverseChainFromTo_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_reverseChainFromTo_node_end;
                candidate_reverseChainFromTo_node_beg.lgspFlags = candidate_reverseChainFromTo_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_reverseChainFromTo_node_beg;
                candidate_reverseChainFromTo_node_end.lgspFlags = candidate_reverseChainFromTo_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromTo_node_end;
                candidate_reverseChainFromTo_node_beg.lgspFlags = candidate_reverseChainFromTo_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromTo_node_beg;
                return matches;
            }
            candidate_reverseChainFromTo_node_beg.lgspFlags = candidate_reverseChainFromTo_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_reverseChainFromTo_node_beg;
            candidate_reverseChainFromTo_node_end.lgspFlags = candidate_reverseChainFromTo_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_reverseChainFromTo_node_end;
            candidate_reverseChainFromTo_node_end.lgspFlags = candidate_reverseChainFromTo_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromTo_node_end;
            candidate_reverseChainFromTo_node_beg.lgspFlags = candidate_reverseChainFromTo_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromTo_node_beg;
            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_reverseChainFromTo.IMatch_reverseChainFromTo> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode reverseChainFromTo_node_beg, GRGEN_LIBGR.INode reverseChainFromTo_node_end);
        /// <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_reverseChainFromTo.IMatch_reverseChainFromTo> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode reverseChainFromTo_node_beg, GRGEN_LIBGR.INode reverseChainFromTo_node_end)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, reverseChainFromTo_node_beg, reverseChainFromTo_node_end);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_reverseChainFromTo.IMatch_reverseChainFromTo match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromTo.IMatch_reverseChainFromTo> matches)
        {
            foreach(Rule_reverseChainFromTo.IMatch_reverseChainFromTo match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode reverseChainFromTo_node_beg, GRGEN_LIBGR.INode reverseChainFromTo_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromTo.IMatch_reverseChainFromTo> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, reverseChainFromTo_node_beg, reverseChainFromTo_node_end);
            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.INode reverseChainFromTo_node_beg, GRGEN_LIBGR.INode reverseChainFromTo_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromTo.IMatch_reverseChainFromTo> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, reverseChainFromTo_node_beg, reverseChainFromTo_node_end);
            if(matches.Count <= 0) return 0;
            foreach(Rule_reverseChainFromTo.IMatch_reverseChainFromTo match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode reverseChainFromTo_node_beg, GRGEN_LIBGR.INode reverseChainFromTo_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromTo.IMatch_reverseChainFromTo> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, reverseChainFromTo_node_beg, reverseChainFromTo_node_end);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode reverseChainFromTo_node_beg, GRGEN_LIBGR.INode reverseChainFromTo_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromTo.IMatch_reverseChainFromTo> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, reverseChainFromTo_node_beg, reverseChainFromTo_node_end);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, reverseChainFromTo_node_beg, reverseChainFromTo_node_end);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode reverseChainFromTo_node_beg, GRGEN_LIBGR.INode reverseChainFromTo_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromTo.IMatch_reverseChainFromTo> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, reverseChainFromTo_node_beg, reverseChainFromTo_node_end);
                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, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_reverseChainFromTo.IMatch_reverseChainFromTo)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromTo.IMatch_reverseChainFromTo>)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)
        {
            throw new Exception();
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1])) {
                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)
        {
            throw new Exception();
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
            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)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
        }
        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_reverseChainFromTo_alt_0_inlined__sub0_12_in_reverseChainFromTo : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_reverseChainFromTo_alt_0_inlined__sub0_12_in_reverseChainFromTo(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_reverseChainFromTo_alt_0_inlined__sub0_12_in_reverseChainFromTo getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_reverseChainFromTo_alt_0_inlined__sub0_12_in_reverseChainFromTo newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_reverseChainFromTo_alt_0_inlined__sub0_12_in_reverseChainFromTo(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_reverseChainFromTo_alt_0_inlined__sub0_12_in_reverseChainFromTo oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_reverseChainFromTo_alt_0_inlined__sub0_12_in_reverseChainFromTo freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_reverseChainFromTo_alt_0_inlined__sub0_12_in_reverseChainFromTo next = null;

        public GRGEN_LGSP.LGSPNode ReverseChainFromTo_node_to_inlined__sub0_12;
        public GRGEN_LGSP.LGSPNode ReverseChainFromTo_node_from_inlined__sub0_12;
        
        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 ReverseChainFromTo_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ReverseChainFromTo.ReverseChainFromTo_alt_0_CaseNums.@base];
                // SubPreset ReverseChainFromTo_node_to_inlined__sub0_12 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_to_inlined__sub0_12 = ReverseChainFromTo_node_to_inlined__sub0_12;
                // SubPreset ReverseChainFromTo_node_from_inlined__sub0_12 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_from_inlined__sub0_12 = ReverseChainFromTo_node_from_inlined__sub0_12;
                // Extend Outgoing ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12 from ReverseChainFromTo_node_to_inlined__sub0_12 
                GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12 = candidate_ReverseChainFromTo_node_to_inlined__sub0_12.lgspOuthead;
                if(head_candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12 = head_candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12;
                    do
                    {
                        if(candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12.lgspTarget != candidate_ReverseChainFromTo_node_from_inlined__sub0_12) {
                            continue;
                        }
                        if((candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12.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_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_base match = new Pattern_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_base();
                            match._node_to = candidate_ReverseChainFromTo_node_to_inlined__sub0_12;
                            match._node_from = candidate_ReverseChainFromTo_node_from_inlined__sub0_12;
                            match._edge__edge0 = candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12;
                            currentFoundPartialMatch.Push(match);
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                            {
                                openTasks.Push(this);
                                return;
                            }
                            continue;
                        }
                        uint prevGlobal__candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12;
                        prevGlobal__candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12 = candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12.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_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_base match = new Pattern_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_base();
                                match._node_to = candidate_ReverseChainFromTo_node_to_inlined__sub0_12;
                                match._node_from = candidate_ReverseChainFromTo_node_from_inlined__sub0_12;
                                match._edge__edge0 = candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12;
                                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_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12.lgspFlags = candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12.lgspFlags = candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12;
                            continue;
                        }
                        candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12.lgspFlags = candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12;
                    }
                    while( (candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12 = candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12.lgspOutNext) != head_candidate_ReverseChainFromTo_alt_0_base_edge__edge0_inlined__sub0_12 );
                }
            } 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 ReverseChainFromTo_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ReverseChainFromTo.ReverseChainFromTo_alt_0_CaseNums.@rec];
                // SubPreset ReverseChainFromTo_node_from_inlined__sub0_12 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_from_inlined__sub0_12 = ReverseChainFromTo_node_from_inlined__sub0_12;
                // SubPreset ReverseChainFromTo_node_to_inlined__sub0_12 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_node_to_inlined__sub0_12 = ReverseChainFromTo_node_to_inlined__sub0_12;
                // Extend Incoming ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12 from ReverseChainFromTo_node_from_inlined__sub0_12 
                GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12 = candidate_ReverseChainFromTo_node_from_inlined__sub0_12.lgspInhead;
                if(head_candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12 = head_candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12;
                    do
                    {
                        if(candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Implicit Source ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12 from ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12 
                        GRGEN_LGSP.LGSPNode candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12 = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12.lgspSource;
                        if((candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0
                            && candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12==candidate_ReverseChainFromTo_node_from_inlined__sub0_12
                            )
                        {
                            continue;
                        }
                        if((candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Push subpattern matching task for _sub0_inlined__sub0_12
                        PatternAction_ReverseChainFromTo taskFor__sub0_inlined__sub0_12 = PatternAction_ReverseChainFromTo.getNewTask(actionEnv, openTasks);
                        taskFor__sub0_inlined__sub0_12.ReverseChainFromTo_node_from = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12;
                        taskFor__sub0_inlined__sub0_12.ReverseChainFromTo_node_to = candidate_ReverseChainFromTo_node_to_inlined__sub0_12;
                        taskFor__sub0_inlined__sub0_12.searchPatternpath = false;
                        taskFor__sub0_inlined__sub0_12.matchOfNestingPattern = null;
                        taskFor__sub0_inlined__sub0_12.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor__sub0_inlined__sub0_12);
                        uint prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12;
                        prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12 = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12;
                        prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12 = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop subpattern matching task for _sub0_inlined__sub0_12
                        openTasks.Pop();
                        PatternAction_ReverseChainFromTo.releaseTask(taskFor__sub0_inlined__sub0_12);
                        // 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_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_rec match = new Pattern_ReverseChainFromTo.Match_ReverseChainFromTo_alt_0_rec();
                                match._node_intermediate = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12;
                                match._node_from = candidate_ReverseChainFromTo_node_from_inlined__sub0_12;
                                match._node_to = candidate_ReverseChainFromTo_node_to_inlined__sub0_12;
                                match._edge__edge0 = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12;
                                match.__sub0 = (@Pattern_ReverseChainFromTo.Match_ReverseChainFromTo)currentFoundPartialMatch.Pop();
                                match.__sub0._matchOfEnclosingPattern = 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_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12;
                                candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12;
                            candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12;
                            continue;
                        }
                        candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_node_intermediate_inlined__sub0_12;
                        candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12.lgspFlags = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12;
                    }
                    while( (candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12 = candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12.lgspInNext) != head_candidate_ReverseChainFromTo_alt_0_rec_edge__edge0_inlined__sub0_12 );
                }
            } 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_createReverseChain
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_createReverseChain.IMatch_createReverseChain> 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_createReverseChain.IMatch_createReverseChain match, out GRGEN_LIBGR.INode output_0, out GRGEN_LIBGR.INode output_1);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createReverseChain.IMatch_createReverseChain> matches, List<GRGEN_LIBGR.INode> output_0, List<GRGEN_LIBGR.INode> output_1);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, ref GRGEN_LIBGR.INode output_0, ref GRGEN_LIBGR.INode output_1);
        /// <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, List<GRGEN_LIBGR.INode> output_0, List<GRGEN_LIBGR.INode> output_1);
        /// <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_createReverseChain : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_createReverseChain
    {
        public Action_createReverseChain()
            : base(Rule_createReverseChain.Instance.patternGraph)
        {
            _rulePattern = Rule_createReverseChain.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_createReverseChain _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "createReverseChain"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_createReverseChain.Match_createReverseChain, Rule_createReverseChain.IMatch_createReverseChain> 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_createReverseChain Instance { get { return instance; } set { instance = value; } }
        private static Action_createReverseChain instance = new Action_createReverseChain();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_createReverseChain.IMatch_createReverseChain> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_createReverseChain.Match_createReverseChain, Rule_createReverseChain.IMatch_createReverseChain>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[2];
            int isoSpace = 0;
            Rule_createReverseChain.Match_createReverseChain 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_createReverseChain.IMatch_createReverseChain> 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; } }
        List<GRGEN_LIBGR.INode> output_list_0 = new List<GRGEN_LIBGR.INode>();
        List<GRGEN_LIBGR.INode> output_list_1 = new List<GRGEN_LIBGR.INode>();
        public GRGEN_LIBGR.IMatchesExact<Rule_createReverseChain.IMatch_createReverseChain> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_createReverseChain.IMatch_createReverseChain match, out GRGEN_LIBGR.INode output_0, out GRGEN_LIBGR.INode output_1)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match, out output_0, out output_1);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_createReverseChain.IMatch_createReverseChain> matches, List<GRGEN_LIBGR.INode> output_0, List<GRGEN_LIBGR.INode> output_1)
        {
            foreach(Rule_createReverseChain.IMatch_createReverseChain match in matches)
            {
                GRGEN_LIBGR.INode output_local_0; GRGEN_LIBGR.INode output_local_1; 
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match, out output_local_0, out output_local_1);
                output_0.Add(output_local_0);
                output_1.Add(output_local_1);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, ref GRGEN_LIBGR.INode output_0, ref GRGEN_LIBGR.INode output_1)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createReverseChain.IMatch_createReverseChain> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First, out output_0, out output_1);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, List<GRGEN_LIBGR.INode> output_0, List<GRGEN_LIBGR.INode> output_1)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createReverseChain.IMatch_createReverseChain> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches);
            if(matches.Count <= 0) return 0;
            foreach(Rule_createReverseChain.IMatch_createReverseChain match in matches)
            {
                GRGEN_LIBGR.INode output_local_0; GRGEN_LIBGR.INode output_local_1; 
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match, out output_local_0, out output_local_1);
                output_0.Add(output_local_0);
                output_1.Add(output_local_1);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createReverseChain.IMatch_createReverseChain> matches;
            GRGEN_LIBGR.INode output_0; GRGEN_LIBGR.INode output_1; 
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First, out output_0, out output_1);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_createReverseChain.IMatch_createReverseChain> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1);
            if(matches.Count <= 0) return false;
            GRGEN_LIBGR.INode output_0; GRGEN_LIBGR.INode output_1; 
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First, out output_0, out output_1);
                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_createReverseChain.IMatch_createReverseChain> matches;
            GRGEN_LIBGR.INode output_0; GRGEN_LIBGR.INode output_1; 
            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, out output_0, out output_1);
            }
            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)
        {
            GRGEN_LIBGR.INode output_0; GRGEN_LIBGR.INode output_1; 
            Modify(actionEnv, (Rule_createReverseChain.IMatch_createReverseChain)match, out output_0, out output_1);
            ReturnArray[0] = output_0;
            ReturnArray[1] = output_1;
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            output_list_0.Clear();
            output_list_1.Clear();
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_createReverseChain.IMatch_createReverseChain>)matches, output_list_0, output_list_1);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[2]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
                ReturnArrayListForAll[i][0] = output_list_0[i];
                ReturnArrayListForAll[i][1] = output_list_1[i];
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            GRGEN_LIBGR.INode output_0 = null; GRGEN_LIBGR.INode output_1 = null; 
            if(Apply(actionEnv, ref output_0, ref output_1)) {
                ReturnArray[0] = output_0;
                ReturnArray[1] = output_1;
                return ReturnArray;
            }
            else return null;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            GRGEN_LIBGR.INode output_0 = null; GRGEN_LIBGR.INode output_1 = null; 
            if(Apply(actionEnv, ref output_0, ref output_1)) {
                ReturnArray[0] = output_0;
                ReturnArray[1] = output_1;
                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[2]);
            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)
        {
            output_list_0.Clear();
            output_list_1.Clear();
            int matchesCount = ApplyAll(maxMatches, actionEnv, output_list_0, output_list_1);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[2]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
                ReturnArrayListForAll[i][0] = output_list_0[i];
                ReturnArrayListForAll[i][1] = output_list_1[i];
            }
            return ReturnArrayListForAll;
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            output_list_0.Clear();
            output_list_1.Clear();
            int matchesCount = ApplyAll(maxMatches, actionEnv, output_list_0, output_list_1);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[2]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
                ReturnArrayListForAll[i][0] = output_list_0[i];
                ReturnArrayListForAll[i][1] = output_list_1[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_chainFromToReverse
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverse.IMatch_chainFromToReverse> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromToReverse_node_beg, GRGEN_LIBGR.INode chainFromToReverse_node_end);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_chainFromToReverse.IMatch_chainFromToReverse match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverse.IMatch_chainFromToReverse> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromToReverse_node_beg, GRGEN_LIBGR.INode chainFromToReverse_node_end);
        /// <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, GRGEN_LIBGR.INode chainFromToReverse_node_beg, GRGEN_LIBGR.INode chainFromToReverse_node_end);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromToReverse_node_beg, GRGEN_LIBGR.INode chainFromToReverse_node_end);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromToReverse_node_beg, GRGEN_LIBGR.INode chainFromToReverse_node_end);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode chainFromToReverse_node_beg, GRGEN_LIBGR.INode chainFromToReverse_node_end);
    }
    
    public class Action_chainFromToReverse : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_chainFromToReverse
    {
        public Action_chainFromToReverse()
            : base(Rule_chainFromToReverse.Instance.patternGraph)
        {
            _rulePattern = Rule_chainFromToReverse.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_chainFromToReverse _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "chainFromToReverse"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_chainFromToReverse.Match_chainFromToReverse, Rule_chainFromToReverse.IMatch_chainFromToReverse> 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_chainFromToReverse Instance { get { return instance; } set { instance = value; } }
        private static Action_chainFromToReverse instance = new Action_chainFromToReverse();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverse.IMatch_chainFromToReverse> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromToReverse_node_beg, GRGEN_LIBGR.INode chainFromToReverse_node_end)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_chainFromToReverse.Match_chainFromToReverse, Rule_chainFromToReverse.IMatch_chainFromToReverse>(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;
            // Preset chainFromToReverse_node_beg 
            GRGEN_LGSP.LGSPNode candidate_chainFromToReverse_node_beg = (GRGEN_LGSP.LGSPNode)chainFromToReverse_node_beg;
            uint prev__candidate_chainFromToReverse_node_beg;
            prev__candidate_chainFromToReverse_node_beg = candidate_chainFromToReverse_node_beg.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            candidate_chainFromToReverse_node_beg.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            // Preset chainFromToReverse_node_end 
            GRGEN_LGSP.LGSPNode candidate_chainFromToReverse_node_end = (GRGEN_LGSP.LGSPNode)chainFromToReverse_node_end;
            if((candidate_chainFromToReverse_node_end.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
            {
                candidate_chainFromToReverse_node_beg.lgspFlags = candidate_chainFromToReverse_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromToReverse_node_beg;
                return matches;
            }
            uint prev__candidate_chainFromToReverse_node_end;
            prev__candidate_chainFromToReverse_node_end = candidate_chainFromToReverse_node_end.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            candidate_chainFromToReverse_node_end.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            // Element ChainFromToReverse_node_to_inlined_cftr_13 assigned from other element chainFromToReverse_node_end 
            GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_to_inlined_cftr_13 = candidate_chainFromToReverse_node_end;
            // Element ChainFromToReverse_node_from_inlined_cftr_13 assigned from other element chainFromToReverse_node_beg 
            GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_from_inlined_cftr_13 = candidate_chainFromToReverse_node_beg;
            // Push alternative matching task for chainFromToReverse_alt_0_inlined_cftr_13_in_chainFromToReverse
            AlternativeAction_chainFromToReverse_alt_0_inlined_cftr_13_in_chainFromToReverse taskFor_alt_0_inlined_cftr_13_in_chainFromToReverse = AlternativeAction_chainFromToReverse_alt_0_inlined_cftr_13_in_chainFromToReverse.getNewTask(actionEnv, openTasks, Pattern_ChainFromToReverse.Instance.patternGraph.alternatives[(int)Pattern_ChainFromToReverse.ChainFromToReverse_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0_inlined_cftr_13_in_chainFromToReverse.ChainFromToReverse_node_from_inlined_cftr_13 = candidate_ChainFromToReverse_node_from_inlined_cftr_13;
            taskFor_alt_0_inlined_cftr_13_in_chainFromToReverse.ChainFromToReverse_node_to_inlined_cftr_13 = candidate_ChainFromToReverse_node_to_inlined_cftr_13;
            taskFor_alt_0_inlined_cftr_13_in_chainFromToReverse.searchPatternpath = false;
            taskFor_alt_0_inlined_cftr_13_in_chainFromToReverse.matchOfNestingPattern = null;
            taskFor_alt_0_inlined_cftr_13_in_chainFromToReverse.lastMatchAtPreviousNestingLevel = null;
            openTasks.Push(taskFor_alt_0_inlined_cftr_13_in_chainFromToReverse);
            uint prevGlobal__candidate_chainFromToReverse_node_beg;
            prevGlobal__candidate_chainFromToReverse_node_beg = candidate_chainFromToReverse_node_beg.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            candidate_chainFromToReverse_node_beg.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            uint prevGlobal__candidate_chainFromToReverse_node_end;
            prevGlobal__candidate_chainFromToReverse_node_end = candidate_chainFromToReverse_node_end.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            candidate_chainFromToReverse_node_end.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 chainFromToReverse_alt_0_inlined_cftr_13_in_chainFromToReverse
            openTasks.Pop();
            AlternativeAction_chainFromToReverse_alt_0_inlined_cftr_13_in_chainFromToReverse.releaseTask(taskFor_alt_0_inlined_cftr_13_in_chainFromToReverse);
            // 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_chainFromToReverse.Match_chainFromToReverse match = matches.GetNextUnfilledPosition();
                    Pattern_ChainFromToReverse.Match_ChainFromToReverse match_cftr = new Pattern_ChainFromToReverse.Match_ChainFromToReverse();
                    match_cftr.SetMatchOfEnclosingPattern(match);
                    match._node_beg = candidate_chainFromToReverse_node_beg;
                    match._node_end = candidate_chainFromToReverse_node_end;
                    match_cftr._node_from = candidate_ChainFromToReverse_node_from_inlined_cftr_13;
                    match_cftr._node_to = candidate_ChainFromToReverse_node_to_inlined_cftr_13;
                    match._cftr = match_cftr;
                    match_cftr._alt_0 = (Pattern_ChainFromToReverse.IMatch_ChainFromToReverse_alt_0)currentFoundPartialMatch.Pop();
                    match_cftr._alt_0.SetMatchOfEnclosingPattern(match_cftr);
                    matches.PositionWasFilledFixIt();
                }
                matchesList.Clear();
                // if enough matches were found, we leave
                if(maxMatches > 0 && matches.Count >= maxMatches)
                {
                    candidate_chainFromToReverse_node_end.lgspFlags = candidate_chainFromToReverse_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromToReverse_node_end;
                    candidate_chainFromToReverse_node_beg.lgspFlags = candidate_chainFromToReverse_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromToReverse_node_beg;
                    candidate_chainFromToReverse_node_end.lgspFlags = candidate_chainFromToReverse_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromToReverse_node_end;
                    candidate_chainFromToReverse_node_beg.lgspFlags = candidate_chainFromToReverse_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromToReverse_node_beg;
                    return matches;
                }
                candidate_chainFromToReverse_node_end.lgspFlags = candidate_chainFromToReverse_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromToReverse_node_end;
                candidate_chainFromToReverse_node_beg.lgspFlags = candidate_chainFromToReverse_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromToReverse_node_beg;
                candidate_chainFromToReverse_node_end.lgspFlags = candidate_chainFromToReverse_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromToReverse_node_end;
                candidate_chainFromToReverse_node_beg.lgspFlags = candidate_chainFromToReverse_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromToReverse_node_beg;
                return matches;
            }
            candidate_chainFromToReverse_node_beg.lgspFlags = candidate_chainFromToReverse_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromToReverse_node_beg;
            candidate_chainFromToReverse_node_end.lgspFlags = candidate_chainFromToReverse_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromToReverse_node_end;
            candidate_chainFromToReverse_node_end.lgspFlags = candidate_chainFromToReverse_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromToReverse_node_end;
            candidate_chainFromToReverse_node_beg.lgspFlags = candidate_chainFromToReverse_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromToReverse_node_beg;
            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_chainFromToReverse.IMatch_chainFromToReverse> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromToReverse_node_beg, GRGEN_LIBGR.INode chainFromToReverse_node_end);
        /// <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_chainFromToReverse.IMatch_chainFromToReverse> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromToReverse_node_beg, GRGEN_LIBGR.INode chainFromToReverse_node_end)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, chainFromToReverse_node_beg, chainFromToReverse_node_end);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_chainFromToReverse.IMatch_chainFromToReverse match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverse.IMatch_chainFromToReverse> matches)
        {
            foreach(Rule_chainFromToReverse.IMatch_chainFromToReverse match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromToReverse_node_beg, GRGEN_LIBGR.INode chainFromToReverse_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverse.IMatch_chainFromToReverse> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromToReverse_node_beg, chainFromToReverse_node_end);
            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.INode chainFromToReverse_node_beg, GRGEN_LIBGR.INode chainFromToReverse_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverse.IMatch_chainFromToReverse> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, chainFromToReverse_node_beg, chainFromToReverse_node_end);
            if(matches.Count <= 0) return 0;
            foreach(Rule_chainFromToReverse.IMatch_chainFromToReverse match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromToReverse_node_beg, GRGEN_LIBGR.INode chainFromToReverse_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverse.IMatch_chainFromToReverse> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromToReverse_node_beg, chainFromToReverse_node_end);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromToReverse_node_beg, GRGEN_LIBGR.INode chainFromToReverse_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverse.IMatch_chainFromToReverse> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromToReverse_node_beg, chainFromToReverse_node_end);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromToReverse_node_beg, chainFromToReverse_node_end);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode chainFromToReverse_node_beg, GRGEN_LIBGR.INode chainFromToReverse_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverse.IMatch_chainFromToReverse> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromToReverse_node_beg, chainFromToReverse_node_end);
                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, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_chainFromToReverse.IMatch_chainFromToReverse)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverse.IMatch_chainFromToReverse>)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)
        {
            throw new Exception();
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1])) {
                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)
        {
            throw new Exception();
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
            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)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
        }
        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_chainFromToReverse_alt_0_inlined_cftr_13_in_chainFromToReverse : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_chainFromToReverse_alt_0_inlined_cftr_13_in_chainFromToReverse(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_chainFromToReverse_alt_0_inlined_cftr_13_in_chainFromToReverse getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_chainFromToReverse_alt_0_inlined_cftr_13_in_chainFromToReverse newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_chainFromToReverse_alt_0_inlined_cftr_13_in_chainFromToReverse(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_chainFromToReverse_alt_0_inlined_cftr_13_in_chainFromToReverse oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_chainFromToReverse_alt_0_inlined_cftr_13_in_chainFromToReverse freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_chainFromToReverse_alt_0_inlined_cftr_13_in_chainFromToReverse next = null;

        public GRGEN_LGSP.LGSPNode ChainFromToReverse_node_from_inlined_cftr_13;
        public GRGEN_LGSP.LGSPNode ChainFromToReverse_node_to_inlined_cftr_13;
        
        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 ChainFromToReverse_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromToReverse.ChainFromToReverse_alt_0_CaseNums.@base];
                // SubPreset ChainFromToReverse_node_from_inlined_cftr_13 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_from_inlined_cftr_13 = ChainFromToReverse_node_from_inlined_cftr_13;
                // SubPreset ChainFromToReverse_node_to_inlined_cftr_13 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_to_inlined_cftr_13 = ChainFromToReverse_node_to_inlined_cftr_13;
                // Extend Outgoing ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13 from ChainFromToReverse_node_from_inlined_cftr_13 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13 = candidate_ChainFromToReverse_node_from_inlined_cftr_13.lgspOuthead;
                if(head_candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13 = head_candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13;
                    do
                    {
                        if(candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13.lgspTarget != candidate_ChainFromToReverse_node_to_inlined_cftr_13) {
                            continue;
                        }
                        if((candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13.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_ChainFromToReverse.Match_ChainFromToReverse_alt_0_base match = new Pattern_ChainFromToReverse.Match_ChainFromToReverse_alt_0_base();
                            match._node_from = candidate_ChainFromToReverse_node_from_inlined_cftr_13;
                            match._node_to = candidate_ChainFromToReverse_node_to_inlined_cftr_13;
                            match._edge__edge0 = candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13;
                            currentFoundPartialMatch.Push(match);
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                            {
                                openTasks.Push(this);
                                return;
                            }
                            continue;
                        }
                        uint prevGlobal__candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13;
                        prevGlobal__candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13 = candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13.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_ChainFromToReverse.Match_ChainFromToReverse_alt_0_base match = new Pattern_ChainFromToReverse.Match_ChainFromToReverse_alt_0_base();
                                match._node_from = candidate_ChainFromToReverse_node_from_inlined_cftr_13;
                                match._node_to = candidate_ChainFromToReverse_node_to_inlined_cftr_13;
                                match._edge__edge0 = candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13;
                                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_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13.lgspFlags = candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13.lgspFlags = candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13;
                            continue;
                        }
                        candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13.lgspFlags = candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13;
                    }
                    while( (candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13 = candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13.lgspOutNext) != head_candidate_ChainFromToReverse_alt_0_base_edge__edge0_inlined_cftr_13 );
                }
            } 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 ChainFromToReverse_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromToReverse.ChainFromToReverse_alt_0_CaseNums.@rec];
                // SubPreset ChainFromToReverse_node_from_inlined_cftr_13 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_from_inlined_cftr_13 = ChainFromToReverse_node_from_inlined_cftr_13;
                // SubPreset ChainFromToReverse_node_to_inlined_cftr_13 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_node_to_inlined_cftr_13 = ChainFromToReverse_node_to_inlined_cftr_13;
                // Extend Outgoing ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13 from ChainFromToReverse_node_from_inlined_cftr_13 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13 = candidate_ChainFromToReverse_node_from_inlined_cftr_13.lgspOuthead;
                if(head_candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13 = head_candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13;
                    do
                    {
                        if(candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Implicit Target ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13 from ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13 = candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13.lgspTarget;
                        if((candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0
                            && candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13==candidate_ChainFromToReverse_node_from_inlined_cftr_13
                            )
                        {
                            continue;
                        }
                        if((candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Push subpattern matching task for cftr_inlined_cftr_13
                        PatternAction_ChainFromToReverse taskFor_cftr_inlined_cftr_13 = PatternAction_ChainFromToReverse.getNewTask(actionEnv, openTasks);
                        taskFor_cftr_inlined_cftr_13.ChainFromToReverse_node_from = candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13;
                        taskFor_cftr_inlined_cftr_13.ChainFromToReverse_node_to = candidate_ChainFromToReverse_node_to_inlined_cftr_13;
                        taskFor_cftr_inlined_cftr_13.searchPatternpath = false;
                        taskFor_cftr_inlined_cftr_13.matchOfNestingPattern = null;
                        taskFor_cftr_inlined_cftr_13.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor_cftr_inlined_cftr_13);
                        uint prevGlobal__candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13;
                        prevGlobal__candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13 = candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13;
                        prevGlobal__candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13 = candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop subpattern matching task for cftr_inlined_cftr_13
                        openTasks.Pop();
                        PatternAction_ChainFromToReverse.releaseTask(taskFor_cftr_inlined_cftr_13);
                        // 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_ChainFromToReverse.Match_ChainFromToReverse_alt_0_rec match = new Pattern_ChainFromToReverse.Match_ChainFromToReverse_alt_0_rec();
                                match._node_from = candidate_ChainFromToReverse_node_from_inlined_cftr_13;
                                match._node_intermediate = candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13;
                                match._node_to = candidate_ChainFromToReverse_node_to_inlined_cftr_13;
                                match._edge__edge0 = candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13;
                                match._cftr = (@Pattern_ChainFromToReverse.Match_ChainFromToReverse)currentFoundPartialMatch.Pop();
                                match._cftr._matchOfEnclosingPattern = 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_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13;
                                candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13;
                            candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13;
                            continue;
                        }
                        candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_node_intermediate_inlined_cftr_13;
                        candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13.lgspFlags = candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13;
                    }
                    while( (candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13 = candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13.lgspOutNext) != head_candidate_ChainFromToReverse_alt_0_rec_edge__edge0_inlined_cftr_13 );
                }
            } 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_chainFromToReverseToCommon
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_beg, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_end);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon match, out GRGEN_LIBGR.INode output_0);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> matches, List<GRGEN_LIBGR.INode> output_0);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_beg, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_end, ref GRGEN_LIBGR.INode output_0);
        /// <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, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_beg, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_end, List<GRGEN_LIBGR.INode> output_0);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_beg, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_end);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_beg, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_end);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_beg, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_end);
    }
    
    public class Action_chainFromToReverseToCommon : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_chainFromToReverseToCommon
    {
        public Action_chainFromToReverseToCommon()
            : base(Rule_chainFromToReverseToCommon.Instance.patternGraph)
        {
            _rulePattern = Rule_chainFromToReverseToCommon.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_chainFromToReverseToCommon _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "chainFromToReverseToCommon"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_chainFromToReverseToCommon.Match_chainFromToReverseToCommon, Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> 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_chainFromToReverseToCommon Instance { get { return instance; } set { instance = value; } }
        private static Action_chainFromToReverseToCommon instance = new Action_chainFromToReverseToCommon();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_beg, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_end)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_chainFromToReverseToCommon.Match_chainFromToReverseToCommon, Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon>(this);
            matches.Clear();
            if(ReturnArray == null)
                ReturnArray = new object[1];
            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;
            // Preset chainFromToReverseToCommon_node_beg 
            GRGEN_LGSP.LGSPNode candidate_chainFromToReverseToCommon_node_beg = (GRGEN_LGSP.LGSPNode)chainFromToReverseToCommon_node_beg;
            uint prev__candidate_chainFromToReverseToCommon_node_beg;
            prev__candidate_chainFromToReverseToCommon_node_beg = candidate_chainFromToReverseToCommon_node_beg.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            candidate_chainFromToReverseToCommon_node_beg.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            // Preset chainFromToReverseToCommon_node_end 
            GRGEN_LGSP.LGSPNode candidate_chainFromToReverseToCommon_node_end = (GRGEN_LGSP.LGSPNode)chainFromToReverseToCommon_node_end;
            if((candidate_chainFromToReverseToCommon_node_end.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
            {
                candidate_chainFromToReverseToCommon_node_beg.lgspFlags = candidate_chainFromToReverseToCommon_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromToReverseToCommon_node_beg;
                return matches;
            }
            uint prev__candidate_chainFromToReverseToCommon_node_end;
            prev__candidate_chainFromToReverseToCommon_node_end = candidate_chainFromToReverseToCommon_node_end.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            candidate_chainFromToReverseToCommon_node_end.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            // Element ChainFromToReverseToCommon_node_to_inlined_cftrtc_14 assigned from other element chainFromToReverseToCommon_node_end 
            GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_14 = candidate_chainFromToReverseToCommon_node_end;
            // Element ChainFromToReverseToCommon_node_from_inlined_cftrtc_14 assigned from other element chainFromToReverseToCommon_node_beg 
            GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_14 = candidate_chainFromToReverseToCommon_node_beg;
            // Push alternative matching task for chainFromToReverseToCommon_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon
            AlternativeAction_chainFromToReverseToCommon_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon taskFor_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon = AlternativeAction_chainFromToReverseToCommon_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon.getNewTask(actionEnv, openTasks, Pattern_ChainFromToReverseToCommon.Instance.patternGraph.alternatives[(int)Pattern_ChainFromToReverseToCommon.ChainFromToReverseToCommon_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon.ChainFromToReverseToCommon_node_from_inlined_cftrtc_14 = candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_14;
            taskFor_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon.ChainFromToReverseToCommon_node_to_inlined_cftrtc_14 = candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_14;
            taskFor_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon.searchPatternpath = false;
            taskFor_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon.matchOfNestingPattern = null;
            taskFor_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon.lastMatchAtPreviousNestingLevel = null;
            openTasks.Push(taskFor_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon);
            uint prevGlobal__candidate_chainFromToReverseToCommon_node_beg;
            prevGlobal__candidate_chainFromToReverseToCommon_node_beg = candidate_chainFromToReverseToCommon_node_beg.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            candidate_chainFromToReverseToCommon_node_beg.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            uint prevGlobal__candidate_chainFromToReverseToCommon_node_end;
            prevGlobal__candidate_chainFromToReverseToCommon_node_end = candidate_chainFromToReverseToCommon_node_end.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            candidate_chainFromToReverseToCommon_node_end.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 chainFromToReverseToCommon_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon
            openTasks.Pop();
            AlternativeAction_chainFromToReverseToCommon_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon.releaseTask(taskFor_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon);
            // 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_chainFromToReverseToCommon.Match_chainFromToReverseToCommon match = matches.GetNextUnfilledPosition();
                    Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon match_cftrtc = new Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon();
                    match_cftrtc.SetMatchOfEnclosingPattern(match);
                    match._node_beg = candidate_chainFromToReverseToCommon_node_beg;
                    match._node_end = candidate_chainFromToReverseToCommon_node_end;
                    match_cftrtc._node_from = candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_14;
                    match_cftrtc._node_to = candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_14;
                    match._cftrtc = match_cftrtc;
                    match_cftrtc._alt_0 = (Pattern_ChainFromToReverseToCommon.IMatch_ChainFromToReverseToCommon_alt_0)currentFoundPartialMatch.Pop();
                    match_cftrtc._alt_0.SetMatchOfEnclosingPattern(match_cftrtc);
                    matches.PositionWasFilledFixIt();
                }
                matchesList.Clear();
                // if enough matches were found, we leave
                if(maxMatches > 0 && matches.Count >= maxMatches)
                {
                    candidate_chainFromToReverseToCommon_node_end.lgspFlags = candidate_chainFromToReverseToCommon_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromToReverseToCommon_node_end;
                    candidate_chainFromToReverseToCommon_node_beg.lgspFlags = candidate_chainFromToReverseToCommon_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromToReverseToCommon_node_beg;
                    candidate_chainFromToReverseToCommon_node_end.lgspFlags = candidate_chainFromToReverseToCommon_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromToReverseToCommon_node_end;
                    candidate_chainFromToReverseToCommon_node_beg.lgspFlags = candidate_chainFromToReverseToCommon_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromToReverseToCommon_node_beg;
                    return matches;
                }
                candidate_chainFromToReverseToCommon_node_end.lgspFlags = candidate_chainFromToReverseToCommon_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromToReverseToCommon_node_end;
                candidate_chainFromToReverseToCommon_node_beg.lgspFlags = candidate_chainFromToReverseToCommon_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromToReverseToCommon_node_beg;
                candidate_chainFromToReverseToCommon_node_end.lgspFlags = candidate_chainFromToReverseToCommon_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromToReverseToCommon_node_end;
                candidate_chainFromToReverseToCommon_node_beg.lgspFlags = candidate_chainFromToReverseToCommon_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromToReverseToCommon_node_beg;
                return matches;
            }
            candidate_chainFromToReverseToCommon_node_beg.lgspFlags = candidate_chainFromToReverseToCommon_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromToReverseToCommon_node_beg;
            candidate_chainFromToReverseToCommon_node_end.lgspFlags = candidate_chainFromToReverseToCommon_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_chainFromToReverseToCommon_node_end;
            candidate_chainFromToReverseToCommon_node_end.lgspFlags = candidate_chainFromToReverseToCommon_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromToReverseToCommon_node_end;
            candidate_chainFromToReverseToCommon_node_beg.lgspFlags = candidate_chainFromToReverseToCommon_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_chainFromToReverseToCommon_node_beg;
            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_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_beg, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_end);
        /// <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; } }
        List<GRGEN_LIBGR.INode> output_list_0 = new List<GRGEN_LIBGR.INode>();
        public GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_beg, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_end)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, chainFromToReverseToCommon_node_beg, chainFromToReverseToCommon_node_end);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon match, out GRGEN_LIBGR.INode output_0)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match, out output_0);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> matches, List<GRGEN_LIBGR.INode> output_0)
        {
            foreach(Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon match in matches)
            {
                GRGEN_LIBGR.INode output_local_0; 
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match, out output_local_0);
                output_0.Add(output_local_0);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_beg, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_end, ref GRGEN_LIBGR.INode output_0)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromToReverseToCommon_node_beg, chainFromToReverseToCommon_node_end);
            if(matches.Count <= 0) return false;
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First, out output_0);
            return true;
        }
        public int ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_beg, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_end, List<GRGEN_LIBGR.INode> output_0)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, chainFromToReverseToCommon_node_beg, chainFromToReverseToCommon_node_end);
            if(matches.Count <= 0) return 0;
            foreach(Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon match in matches)
            {
                GRGEN_LIBGR.INode output_local_0; 
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match, out output_local_0);
                output_0.Add(output_local_0);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_beg, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> matches;
            GRGEN_LIBGR.INode output_0; 
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromToReverseToCommon_node_beg, chainFromToReverseToCommon_node_end);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First, out output_0);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_beg, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromToReverseToCommon_node_beg, chainFromToReverseToCommon_node_end);
            if(matches.Count <= 0) return false;
            GRGEN_LIBGR.INode output_0; 
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First, out output_0);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromToReverseToCommon_node_beg, chainFromToReverseToCommon_node_end);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_beg, GRGEN_LIBGR.INode chainFromToReverseToCommon_node_end)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon> matches;
            GRGEN_LIBGR.INode output_0; 
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, chainFromToReverseToCommon_node_beg, chainFromToReverseToCommon_node_end);
                if(matches.Count <= 0) return i >= min;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First, out output_0);
            }
            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, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            GRGEN_LIBGR.INode output_0; 
            Modify(actionEnv, (Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon)match, out output_0);
            ReturnArray[0] = output_0;
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            output_list_0.Clear();
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_chainFromToReverseToCommon.IMatch_chainFromToReverseToCommon>)matches, output_list_0);
            while(AvailableReturnArrays.Count < matches.Count) AvailableReturnArrays.Add(new object[1]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matches.Count; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
                ReturnArrayListForAll[i][0] = output_list_0[i];
            }
            return ReturnArrayListForAll;
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            throw new Exception();
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            GRGEN_LIBGR.INode output_0 = null; 
            if(Apply(actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1], ref output_0)) {
                ReturnArray[0] = output_0;
                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[1]);
            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)
        {
            throw new Exception();
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            output_list_0.Clear();
            int matchesCount = ApplyAll(maxMatches, actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1], output_list_0);
            while(AvailableReturnArrays.Count < matchesCount) AvailableReturnArrays.Add(new object[1]);
            ReturnArrayListForAll.Clear();
            for(int i=0; i<matchesCount; ++i)
            {
                ReturnArrayListForAll.Add(AvailableReturnArrays[i]);
                ReturnArrayListForAll[i][0] = output_list_0[i];
            }
            return ReturnArrayListForAll;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1]);
        }
        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_chainFromToReverseToCommon_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_chainFromToReverseToCommon_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_chainFromToReverseToCommon_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_chainFromToReverseToCommon_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_chainFromToReverseToCommon_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_chainFromToReverseToCommon_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_chainFromToReverseToCommon_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_chainFromToReverseToCommon_alt_0_inlined_cftrtc_14_in_chainFromToReverseToCommon next = null;

        public GRGEN_LGSP.LGSPNode ChainFromToReverseToCommon_node_from_inlined_cftrtc_14;
        public GRGEN_LGSP.LGSPNode ChainFromToReverseToCommon_node_to_inlined_cftrtc_14;
        
        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 ChainFromToReverseToCommon_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromToReverseToCommon.ChainFromToReverseToCommon_alt_0_CaseNums.@base];
                // SubPreset ChainFromToReverseToCommon_node_from_inlined_cftrtc_14 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_14 = ChainFromToReverseToCommon_node_from_inlined_cftrtc_14;
                // SubPreset ChainFromToReverseToCommon_node_to_inlined_cftrtc_14 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_14 = ChainFromToReverseToCommon_node_to_inlined_cftrtc_14;
                // Extend Outgoing ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14 from ChainFromToReverseToCommon_node_from_inlined_cftrtc_14 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14 = candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_14.lgspOuthead;
                if(head_candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14 = head_candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14;
                    do
                    {
                        if(candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14.lgspTarget != candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_14) {
                            continue;
                        }
                        if((candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14.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_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_base match = new Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_base();
                            match._node_from = candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_14;
                            match._node_to = candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_14;
                            match._edge__edge0 = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14;
                            currentFoundPartialMatch.Push(match);
                            // if enough matches were found, we leave
                            if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                            {
                                openTasks.Push(this);
                                return;
                            }
                            continue;
                        }
                        uint prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14;
                        prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14 = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14.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_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_base match = new Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_base();
                                match._node_from = candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_14;
                                match._node_to = candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_14;
                                match._edge__edge0 = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14;
                                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_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14;
                            continue;
                        }
                        candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14;
                    }
                    while( (candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14 = candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14.lgspOutNext) != head_candidate_ChainFromToReverseToCommon_alt_0_base_edge__edge0_inlined_cftrtc_14 );
                }
            } 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 ChainFromToReverseToCommon_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ChainFromToReverseToCommon.ChainFromToReverseToCommon_alt_0_CaseNums.@rec];
                // SubPreset ChainFromToReverseToCommon_node_from_inlined_cftrtc_14 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_14 = ChainFromToReverseToCommon_node_from_inlined_cftrtc_14;
                // SubPreset ChainFromToReverseToCommon_node_to_inlined_cftrtc_14 
                GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_14 = ChainFromToReverseToCommon_node_to_inlined_cftrtc_14;
                // Extend Outgoing ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14 from ChainFromToReverseToCommon_node_from_inlined_cftrtc_14 
                GRGEN_LGSP.LGSPEdge head_candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14 = candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_14.lgspOuthead;
                if(head_candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14 = head_candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14;
                    do
                    {
                        if(candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Implicit Target ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14 from ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14 
                        GRGEN_LGSP.LGSPNode candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14 = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14.lgspTarget;
                        if((candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0
                            && candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14==candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_14
                            )
                        {
                            continue;
                        }
                        if((candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            continue;
                        }
                        // Push subpattern matching task for cftrtc_inlined_cftrtc_14
                        PatternAction_ChainFromToReverseToCommon taskFor_cftrtc_inlined_cftrtc_14 = PatternAction_ChainFromToReverseToCommon.getNewTask(actionEnv, openTasks);
                        taskFor_cftrtc_inlined_cftrtc_14.ChainFromToReverseToCommon_node_from = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14;
                        taskFor_cftrtc_inlined_cftrtc_14.ChainFromToReverseToCommon_node_to = candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_14;
                        taskFor_cftrtc_inlined_cftrtc_14.searchPatternpath = false;
                        taskFor_cftrtc_inlined_cftrtc_14.matchOfNestingPattern = null;
                        taskFor_cftrtc_inlined_cftrtc_14.lastMatchAtPreviousNestingLevel = null;
                        openTasks.Push(taskFor_cftrtc_inlined_cftrtc_14);
                        uint prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14;
                        prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14 = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        uint prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14;
                        prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14 = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                        // Match subpatterns 
                        openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                        // Pop subpattern matching task for cftrtc_inlined_cftrtc_14
                        openTasks.Pop();
                        PatternAction_ChainFromToReverseToCommon.releaseTask(taskFor_cftrtc_inlined_cftrtc_14);
                        // 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_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_rec match = new Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon_alt_0_rec();
                                match._node_from = candidate_ChainFromToReverseToCommon_node_from_inlined_cftrtc_14;
                                match._node_intermediate = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14;
                                match._node_to = candidate_ChainFromToReverseToCommon_node_to_inlined_cftrtc_14;
                                match._edge__edge0 = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14;
                                match._cftrtc = (@Pattern_ChainFromToReverseToCommon.Match_ChainFromToReverseToCommon)currentFoundPartialMatch.Pop();
                                match._cftrtc._matchOfEnclosingPattern = 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_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14;
                                candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14;
                                openTasks.Push(this);
                                return;
                            }
                            candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14;
                            candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14;
                            continue;
                        }
                        candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_node_intermediate_inlined_cftrtc_14;
                        candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14.lgspFlags = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14;
                    }
                    while( (candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14 = candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14.lgspOutNext) != head_candidate_ChainFromToReverseToCommon_alt_0_rec_edge__edge0_inlined_cftrtc_14 );
                }
            } 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_reverseChainFromToToCommon
    {
        /// <summary> same as IAction.Match, but with exact types and distinct parameters. </summary>
        GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_beg, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_end, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_common);
        /// <summary> same as IAction.Modify, but with exact types and distinct parameters. </summary>
        void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon match);
        /// <summary> same as IAction.ModifyAll, but with exact types and distinct parameters. </summary>
        void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> matches);
        /// <summary> same as IAction.Apply, but with exact types and distinct parameters; returns true if applied </summary>
        bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_beg, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_end, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_common);
        /// <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, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_beg, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_end, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_common);
        /// <summary> same as IAction.ApplyStar, but with exact types and distinct parameters. </summary>
        bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_beg, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_end, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_common);
        /// <summary> same as IAction.ApplyPlus, but with exact types and distinct parameters. </summary>
        bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_beg, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_end, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_common);
        /// <summary> same as IAction.ApplyMinMax, but with exact types and distinct parameters. </summary>
        bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_beg, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_end, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_common);
    }
    
    public class Action_reverseChainFromToToCommon : GRGEN_LGSP.LGSPAction, GRGEN_LIBGR.IAction, IAction_reverseChainFromToToCommon
    {
        public Action_reverseChainFromToToCommon()
            : base(Rule_reverseChainFromToToCommon.Instance.patternGraph)
        {
            _rulePattern = Rule_reverseChainFromToToCommon.Instance;
            DynamicMatch = myMatch;
        }

        public Rule_reverseChainFromToToCommon _rulePattern;
        public override GRGEN_LGSP.LGSPRulePattern rulePattern { get { return _rulePattern; } }
        public override string Name { get { return "reverseChainFromToToCommon"; } }
        [ThreadStatic] private static GRGEN_LGSP.LGSPMatchesList<Rule_reverseChainFromToToCommon.Match_reverseChainFromToToCommon, Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> 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_reverseChainFromToToCommon Instance { get { return instance; } set { instance = value; } }
        private static Action_reverseChainFromToToCommon instance = new Action_reverseChainFromToToCommon();
        
        public GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> myMatch(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_beg, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_end, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_common)
        {
            GRGEN_LGSP.LGSPGraph graph = actionEnv.graph;
            if(matches == null)
                matches = new GRGEN_LGSP.LGSPMatchesList<Rule_reverseChainFromToToCommon.Match_reverseChainFromToToCommon, Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>(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;
            // Preset reverseChainFromToToCommon_node_beg 
            GRGEN_LGSP.LGSPNode candidate_reverseChainFromToToCommon_node_beg = (GRGEN_LGSP.LGSPNode)reverseChainFromToToCommon_node_beg;
            uint prev__candidate_reverseChainFromToToCommon_node_beg;
            prev__candidate_reverseChainFromToToCommon_node_beg = candidate_reverseChainFromToToCommon_node_beg.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            candidate_reverseChainFromToToCommon_node_beg.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            // Preset reverseChainFromToToCommon_node_end 
            GRGEN_LGSP.LGSPNode candidate_reverseChainFromToToCommon_node_end = (GRGEN_LGSP.LGSPNode)reverseChainFromToToCommon_node_end;
            if((candidate_reverseChainFromToToCommon_node_end.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
            {
                candidate_reverseChainFromToToCommon_node_beg.lgspFlags = candidate_reverseChainFromToToCommon_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromToToCommon_node_beg;
                return matches;
            }
            uint prev__candidate_reverseChainFromToToCommon_node_end;
            prev__candidate_reverseChainFromToToCommon_node_end = candidate_reverseChainFromToToCommon_node_end.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            candidate_reverseChainFromToToCommon_node_end.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            // Preset reverseChainFromToToCommon_node_common 
            GRGEN_LGSP.LGSPNode candidate_reverseChainFromToToCommon_node_common = (GRGEN_LGSP.LGSPNode)reverseChainFromToToCommon_node_common;
            if((candidate_reverseChainFromToToCommon_node_common.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
            {
                candidate_reverseChainFromToToCommon_node_end.lgspFlags = candidate_reverseChainFromToToCommon_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromToToCommon_node_end;
                candidate_reverseChainFromToToCommon_node_beg.lgspFlags = candidate_reverseChainFromToToCommon_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromToToCommon_node_beg;
                return matches;
            }
            uint prev__candidate_reverseChainFromToToCommon_node_common;
            prev__candidate_reverseChainFromToToCommon_node_common = candidate_reverseChainFromToToCommon_node_common.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            candidate_reverseChainFromToToCommon_node_common.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
            // Element ReverseChainFromToToCommon_node_common_inlined__sub0_15 assigned from other element reverseChainFromToToCommon_node_common 
            GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_15 = candidate_reverseChainFromToToCommon_node_common;
            // Element ReverseChainFromToToCommon_node_to_inlined__sub0_15 assigned from other element reverseChainFromToToCommon_node_end 
            GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_15 = candidate_reverseChainFromToToCommon_node_end;
            // Element ReverseChainFromToToCommon_node_from_inlined__sub0_15 assigned from other element reverseChainFromToToCommon_node_beg 
            GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_15 = candidate_reverseChainFromToToCommon_node_beg;
            // Push alternative matching task for reverseChainFromToToCommon_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon
            AlternativeAction_reverseChainFromToToCommon_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon taskFor_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon = AlternativeAction_reverseChainFromToToCommon_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon.getNewTask(actionEnv, openTasks, Pattern_ReverseChainFromToToCommon.Instance.patternGraph.alternatives[(int)Pattern_ReverseChainFromToToCommon.ReverseChainFromToToCommon_AltNums.@alt_0].alternativeCases);
            taskFor_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon.ReverseChainFromToToCommon_node_to_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_15;
            taskFor_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon.ReverseChainFromToToCommon_node_from_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_15;
            taskFor_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon.ReverseChainFromToToCommon_node_common_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_15;
            taskFor_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon.searchPatternpath = false;
            taskFor_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon.matchOfNestingPattern = null;
            taskFor_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon.lastMatchAtPreviousNestingLevel = null;
            openTasks.Push(taskFor_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon);
            uint prevGlobal__candidate_reverseChainFromToToCommon_node_beg;
            prevGlobal__candidate_reverseChainFromToToCommon_node_beg = candidate_reverseChainFromToToCommon_node_beg.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            candidate_reverseChainFromToToCommon_node_beg.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            uint prevGlobal__candidate_reverseChainFromToToCommon_node_end;
            prevGlobal__candidate_reverseChainFromToToCommon_node_end = candidate_reverseChainFromToToCommon_node_end.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            candidate_reverseChainFromToToCommon_node_end.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            uint prevGlobal__candidate_reverseChainFromToToCommon_node_common;
            prevGlobal__candidate_reverseChainFromToToCommon_node_common = candidate_reverseChainFromToToCommon_node_common.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
            candidate_reverseChainFromToToCommon_node_common.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 reverseChainFromToToCommon_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon
            openTasks.Pop();
            AlternativeAction_reverseChainFromToToCommon_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon.releaseTask(taskFor_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon);
            // 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_reverseChainFromToToCommon.Match_reverseChainFromToToCommon match = matches.GetNextUnfilledPosition();
                    Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon match__sub0 = new Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon();
                    match__sub0.SetMatchOfEnclosingPattern(match);
                    match._node_beg = candidate_reverseChainFromToToCommon_node_beg;
                    match._node_end = candidate_reverseChainFromToToCommon_node_end;
                    match._node_common = candidate_reverseChainFromToToCommon_node_common;
                    match__sub0._node_from = candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_15;
                    match__sub0._node_to = candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_15;
                    match__sub0._node_common = candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_15;
                    match.__sub0 = match__sub0;
                    match__sub0._alt_0 = (Pattern_ReverseChainFromToToCommon.IMatch_ReverseChainFromToToCommon_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_reverseChainFromToToCommon_node_common.lgspFlags = candidate_reverseChainFromToToCommon_node_common.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_reverseChainFromToToCommon_node_common;
                    candidate_reverseChainFromToToCommon_node_end.lgspFlags = candidate_reverseChainFromToToCommon_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_reverseChainFromToToCommon_node_end;
                    candidate_reverseChainFromToToCommon_node_beg.lgspFlags = candidate_reverseChainFromToToCommon_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_reverseChainFromToToCommon_node_beg;
                    candidate_reverseChainFromToToCommon_node_common.lgspFlags = candidate_reverseChainFromToToCommon_node_common.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromToToCommon_node_common;
                    candidate_reverseChainFromToToCommon_node_end.lgspFlags = candidate_reverseChainFromToToCommon_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromToToCommon_node_end;
                    candidate_reverseChainFromToToCommon_node_beg.lgspFlags = candidate_reverseChainFromToToCommon_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromToToCommon_node_beg;
                    return matches;
                }
                candidate_reverseChainFromToToCommon_node_common.lgspFlags = candidate_reverseChainFromToToCommon_node_common.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_reverseChainFromToToCommon_node_common;
                candidate_reverseChainFromToToCommon_node_end.lgspFlags = candidate_reverseChainFromToToCommon_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_reverseChainFromToToCommon_node_end;
                candidate_reverseChainFromToToCommon_node_beg.lgspFlags = candidate_reverseChainFromToToCommon_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_reverseChainFromToToCommon_node_beg;
                candidate_reverseChainFromToToCommon_node_common.lgspFlags = candidate_reverseChainFromToToCommon_node_common.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromToToCommon_node_common;
                candidate_reverseChainFromToToCommon_node_end.lgspFlags = candidate_reverseChainFromToToCommon_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromToToCommon_node_end;
                candidate_reverseChainFromToToCommon_node_beg.lgspFlags = candidate_reverseChainFromToToCommon_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromToToCommon_node_beg;
                return matches;
            }
            candidate_reverseChainFromToToCommon_node_beg.lgspFlags = candidate_reverseChainFromToToCommon_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_reverseChainFromToToCommon_node_beg;
            candidate_reverseChainFromToToCommon_node_end.lgspFlags = candidate_reverseChainFromToToCommon_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_reverseChainFromToToCommon_node_end;
            candidate_reverseChainFromToToCommon_node_common.lgspFlags = candidate_reverseChainFromToToCommon_node_common.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_reverseChainFromToToCommon_node_common;
            candidate_reverseChainFromToToCommon_node_common.lgspFlags = candidate_reverseChainFromToToCommon_node_common.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromToToCommon_node_common;
            candidate_reverseChainFromToToCommon_node_end.lgspFlags = candidate_reverseChainFromToToCommon_node_end.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromToToCommon_node_end;
            candidate_reverseChainFromToToCommon_node_beg.lgspFlags = candidate_reverseChainFromToToCommon_node_beg.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_reverseChainFromToToCommon_node_beg;
            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_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> MatchInvoker(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_beg, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_end, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_common);
        /// <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_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> Match(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int maxMatches, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_beg, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_end, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_common)
        {
            return DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, reverseChainFromToToCommon_node_beg, reverseChainFromToToCommon_node_end, reverseChainFromToToCommon_node_common);
        }
        public void Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon match)
        {
            _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
        }
        public void ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> matches)
        {
            foreach(Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
        }
        public bool Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_beg, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_end, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_common)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, reverseChainFromToToCommon_node_beg, reverseChainFromToToCommon_node_end, reverseChainFromToToCommon_node_common);
            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.INode reverseChainFromToToCommon_node_beg, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_end, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_common)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, maxMatches, reverseChainFromToToCommon_node_beg, reverseChainFromToToCommon_node_end, reverseChainFromToToCommon_node_common);
            if(matches.Count <= 0) return 0;
            foreach(Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon match in matches)
            {
                
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, match);
            }
            return matches.Count;
        }
        public bool ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_beg, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_end, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_common)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> matches;
            
            while(true)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, reverseChainFromToToCommon_node_beg, reverseChainFromToToCommon_node_end, reverseChainFromToToCommon_node_common);
                if(matches.Count <= 0) return true;
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
            }
        }
        public bool ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_beg, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_end, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_common)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, reverseChainFromToToCommon_node_beg, reverseChainFromToToCommon_node_end, reverseChainFromToToCommon_node_common);
            if(matches.Count <= 0) return false;
            
            do
            {
                _rulePattern.Modify((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, matches.First);
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, reverseChainFromToToCommon_node_beg, reverseChainFromToToCommon_node_end, reverseChainFromToToCommon_node_common);
            }
            while(matches.Count > 0) ;
            return true;
        }
        public bool ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_beg, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_end, GRGEN_LIBGR.INode reverseChainFromToToCommon_node_common)
        {
            GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon> matches;
            
            for(int i = 0; i < max; i++)
            {
                matches = DynamicMatch((GRGEN_LGSP.LGSPActionExecutionEnvironment)actionEnv, 1, reverseChainFromToToCommon_node_beg, reverseChainFromToToCommon_node_end, reverseChainFromToToCommon_node_common);
                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, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1], (GRGEN_LIBGR.INode) parameters[2]);
        }
        public object[] Modify(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatch match)
        {
            
            Modify(actionEnv, (Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon)match);
            return ReturnArray;
        }
        public List<object[]> ModifyAll(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, GRGEN_LIBGR.IMatches matches)
        {
            ModifyAll(actionEnv, (GRGEN_LIBGR.IMatchesExact<Rule_reverseChainFromToToCommon.IMatch_reverseChainFromToToCommon>)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)
        {
            throw new Exception();
        }
        object[] GRGEN_LIBGR.IAction.Apply(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            
            if(Apply(actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1], (GRGEN_LIBGR.INode) parameters[2])) {
                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)
        {
            throw new Exception();
        }
        List<object[]> GRGEN_LIBGR.IAction.ApplyAll(int maxMatches, GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            int matchesCount = ApplyAll(maxMatches, actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1], (GRGEN_LIBGR.INode) parameters[2]);
            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)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyStar(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyStar(actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1], (GRGEN_LIBGR.INode) parameters[2]);
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyPlus(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, params object[] parameters)
        {
            return ApplyPlus(actionEnv, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1], (GRGEN_LIBGR.INode) parameters[2]);
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max)
        {
            throw new Exception(); return false;
        }
        bool GRGEN_LIBGR.IAction.ApplyMinMax(GRGEN_LIBGR.IActionExecutionEnvironment actionEnv, int min, int max, params object[] parameters)
        {
            return ApplyMinMax(actionEnv, min, max, (GRGEN_LIBGR.INode) parameters[0], (GRGEN_LIBGR.INode) parameters[1], (GRGEN_LIBGR.INode) parameters[2]);
        }
        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_reverseChainFromToToCommon_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon : GRGEN_LGSP.LGSPSubpatternAction
    {
        private AlternativeAction_reverseChainFromToToCommon_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_)
            : base(patternGraphs_)
        {
            actionEnv = actionEnv_; openTasks = openTasks_;
        }

        public static AlternativeAction_reverseChainFromToToCommon_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon getNewTask(GRGEN_LGSP.LGSPActionExecutionEnvironment actionEnv_, Stack<GRGEN_LGSP.LGSPSubpatternAction> openTasks_, GRGEN_LGSP.PatternGraph[] patternGraphs_) {
            AlternativeAction_reverseChainFromToToCommon_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon newTask;
            if(numFreeTasks>0) {
                newTask = freeListHead;
                newTask.actionEnv = actionEnv_; newTask.openTasks = openTasks_;
                freeListHead = newTask.next;
                newTask.next = null;
                --numFreeTasks;
            } else {
                newTask = new AlternativeAction_reverseChainFromToToCommon_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon(actionEnv_, openTasks_, patternGraphs_);
            }
            return newTask;
        }

        public static void releaseTask(AlternativeAction_reverseChainFromToToCommon_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon oldTask) {
            if(numFreeTasks<MAX_NUM_FREE_TASKS) {
                oldTask.next = freeListHead;
                oldTask.actionEnv = null; oldTask.openTasks = null;
                freeListHead = oldTask;
                ++numFreeTasks;
            }
        }

        private static AlternativeAction_reverseChainFromToToCommon_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon freeListHead = null;
        private static int numFreeTasks = 0;
        private const int MAX_NUM_FREE_TASKS = 100;

        private AlternativeAction_reverseChainFromToToCommon_alt_0_inlined__sub0_15_in_reverseChainFromToToCommon next = null;

        public GRGEN_LGSP.LGSPNode ReverseChainFromToToCommon_node_to_inlined__sub0_15;
        public GRGEN_LGSP.LGSPNode ReverseChainFromToToCommon_node_from_inlined__sub0_15;
        public GRGEN_LGSP.LGSPNode ReverseChainFromToToCommon_node_common_inlined__sub0_15;
        
        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 ReverseChainFromToToCommon_alt_0_base 
            do {
                patternGraph = patternGraphs[(int)Pattern_ReverseChainFromToToCommon.ReverseChainFromToToCommon_alt_0_CaseNums.@base];
                // SubPreset ReverseChainFromToToCommon_node_to_inlined__sub0_15 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_15 = ReverseChainFromToToCommon_node_to_inlined__sub0_15;
                // SubPreset ReverseChainFromToToCommon_node_from_inlined__sub0_15 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_15 = ReverseChainFromToToCommon_node_from_inlined__sub0_15;
                // SubPreset ReverseChainFromToToCommon_node_common_inlined__sub0_15 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_15 = ReverseChainFromToToCommon_node_common_inlined__sub0_15;
                // Extend Outgoing ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15 from ReverseChainFromToToCommon_node_to_inlined__sub0_15 
                GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_15.lgspOuthead;
                if(head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15 = head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15;
                    do
                    {
                        if(candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspType.TypeID!=1) {
                            continue;
                        }
                        if(candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspTarget != candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_15) {
                            continue;
                        }
                        if((candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.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_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15;
                        prev__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        // Extend Outgoing ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15 from ReverseChainFromToToCommon_node_from_inlined__sub0_15 
                        GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_15.lgspOuthead;
                        if(head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15 = head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15;
                            do
                            {
                                if(candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15.lgspType.TypeID!=1) {
                                    continue;
                                }
                                if(candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15.lgspTarget != candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_15) {
                                    continue;
                                }
                                if((candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15.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_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_base match = new Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_base();
                                    match._node_to = candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_15;
                                    match._node_from = candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_15;
                                    match._node_common = candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_15;
                                    match._edge__edge0 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15;
                                    match._edge__edge1 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15;
                                    currentFoundPartialMatch.Push(match);
                                    // if enough matches were found, we leave
                                    if(maxMatches > 0 && foundPartialMatches.Count >= maxMatches)
                                    {
                                        candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15;
                                        openTasks.Push(this);
                                        return;
                                    }
                                    continue;
                                }
                                uint prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15;
                                prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                uint prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15;
                                prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15.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_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_base match = new Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_base();
                                        match._node_to = candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_15;
                                        match._node_from = candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_15;
                                        match._node_common = candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_15;
                                        match._edge__edge0 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15;
                                        match._edge__edge1 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15;
                                        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_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15;
                                        candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15;
                                        candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15;
                                        openTasks.Push(this);
                                        return;
                                    }
                                    candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15;
                                    candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15;
                                    continue;
                                }
                                candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15;
                                candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15;
                            }
                            while( (candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15.lgspOutNext) != head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge1_inlined__sub0_15 );
                        }
                        candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15;
                    }
                    while( (candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15.lgspOutNext) != head_candidate_ReverseChainFromToToCommon_alt_0_base_edge__edge0_inlined__sub0_15 );
                }
            } 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 ReverseChainFromToToCommon_alt_0_rec 
            do {
                patternGraph = patternGraphs[(int)Pattern_ReverseChainFromToToCommon.ReverseChainFromToToCommon_alt_0_CaseNums.@rec];
                // SubPreset ReverseChainFromToToCommon_node_from_inlined__sub0_15 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_15 = ReverseChainFromToToCommon_node_from_inlined__sub0_15;
                // SubPreset ReverseChainFromToToCommon_node_common_inlined__sub0_15 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_15 = ReverseChainFromToToCommon_node_common_inlined__sub0_15;
                // SubPreset ReverseChainFromToToCommon_node_to_inlined__sub0_15 
                GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_15 = ReverseChainFromToToCommon_node_to_inlined__sub0_15;
                // Extend Incoming ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15 from ReverseChainFromToToCommon_node_from_inlined__sub0_15 
                GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_15.lgspInhead;
                if(head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15 != null)
                {
                    GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15 = head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15;
                    do
                    {
                        if(candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspType.TypeID!=1) {
                            continue;
                        }
                        if((candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.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_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15;
                        prev__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace;
                        // Implicit Source ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15 from ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15 
                        GRGEN_LGSP.LGSPNode candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspSource;
                        if((candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0
                            && (candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15==candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_15
                                || candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15==candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_15
                                )
                            )
                        {
                            candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15;
                            continue;
                        }
                        if((candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                        {
                            candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15;
                            continue;
                        }
                        // Extend Outgoing ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15 from ReverseChainFromToToCommon_node_from_inlined__sub0_15 
                        GRGEN_LGSP.LGSPEdge head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_15.lgspOuthead;
                        if(head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15 != null)
                        {
                            GRGEN_LGSP.LGSPEdge candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15 = head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15;
                            do
                            {
                                if(candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15.lgspType.TypeID!=1) {
                                    continue;
                                }
                                if(candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15.lgspTarget != candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_15) {
                                    continue;
                                }
                                if((candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) != 0)
                                {
                                    continue;
                                }
                                if((candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)==(uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace)
                                {
                                    continue;
                                }
                                // Push subpattern matching task for _sub0_inlined__sub0_15
                                PatternAction_ReverseChainFromToToCommon taskFor__sub0_inlined__sub0_15 = PatternAction_ReverseChainFromToToCommon.getNewTask(actionEnv, openTasks);
                                taskFor__sub0_inlined__sub0_15.ReverseChainFromToToCommon_node_from = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15;
                                taskFor__sub0_inlined__sub0_15.ReverseChainFromToToCommon_node_to = candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_15;
                                taskFor__sub0_inlined__sub0_15.ReverseChainFromToToCommon_node_common = candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_15;
                                taskFor__sub0_inlined__sub0_15.searchPatternpath = false;
                                taskFor__sub0_inlined__sub0_15.matchOfNestingPattern = null;
                                taskFor__sub0_inlined__sub0_15.lastMatchAtPreviousNestingLevel = null;
                                openTasks.Push(taskFor__sub0_inlined__sub0_15);
                                uint prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15;
                                prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                uint prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15;
                                prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                uint prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15;
                                prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15.lgspFlags & (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15.lgspFlags |= (uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace;
                                // Match subpatterns 
                                openTasks.Peek().myMatch(matchesList, maxMatches - foundPartialMatches.Count, isoSpace);
                                // Pop subpattern matching task for _sub0_inlined__sub0_15
                                openTasks.Pop();
                                PatternAction_ReverseChainFromToToCommon.releaseTask(taskFor__sub0_inlined__sub0_15);
                                // 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_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_rec match = new Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon_alt_0_rec();
                                        match._node_intermediate = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15;
                                        match._node_from = candidate_ReverseChainFromToToCommon_node_from_inlined__sub0_15;
                                        match._node_common = candidate_ReverseChainFromToToCommon_node_common_inlined__sub0_15;
                                        match._node_to = candidate_ReverseChainFromToToCommon_node_to_inlined__sub0_15;
                                        match._edge__edge0 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15;
                                        match._edge__edge1 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15;
                                        match.__sub0 = (@Pattern_ReverseChainFromToToCommon.Match_ReverseChainFromToToCommon)currentFoundPartialMatch.Pop();
                                        match.__sub0._matchOfEnclosingPattern = 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_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15;
                                        candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15;
                                        candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15;
                                        candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15;
                                        openTasks.Push(this);
                                        return;
                                    }
                                    candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15;
                                    candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15;
                                    candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15;
                                    continue;
                                }
                                candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_node_intermediate_inlined__sub0_15;
                                candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15;
                                candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED_BY_ENCLOSING_PATTERN << isoSpace) | prevGlobal__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15;
                            }
                            while( (candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15.lgspOutNext) != head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge1_inlined__sub0_15 );
                        }
                        candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspFlags & ~((uint)GRGEN_LGSP.LGSPElemFlags.IS_MATCHED << isoSpace) | prev__candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15;
                    }
                    while( (candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15 = candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15.lgspInNext) != head_candidate_ReverseChainFromToToCommon_alt_0_rec_edge__edge0_inlined__sub0_15 );
                }
            } 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 RecursiveActions : GRGEN_LGSP.LGSPActions
    {
        public RecursiveActions(GRGEN_LGSP.LGSPGraph lgspgraph, string modelAsmName, string actionsAsmName)
            : base(lgspgraph, modelAsmName, actionsAsmName)
        {
            InitActions();
        }

        public RecursiveActions(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_ChainFromTo.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Pattern_ChainFromTo.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Pattern_ChainFromTo.Instance);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ChainFrom.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Pattern_ChainFrom.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Pattern_ChainFrom.Instance);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ChainFromComplete.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Pattern_ChainFromComplete.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Pattern_ChainFromComplete.Instance);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryPatternpathLocked.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryPatternpathLocked.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryPatternpathLocked.Instance);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_Blowball.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Pattern_Blowball.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Pattern_Blowball.Instance);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ReverseChainFromTo.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Pattern_ReverseChainFromTo.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Pattern_ReverseChainFromTo.Instance);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ChainFromToReverse.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Pattern_ChainFromToReverse.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Pattern_ChainFromToReverse.Instance);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Instance);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ReverseChainFromToToCommon.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Pattern_ReverseChainFromToToCommon.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Pattern_ReverseChainFromToToCommon.Instance);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createChain.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_createChain.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_createChain.Instance);
            actions.Add("createChain", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_createChain.Instance);
            @createChain = GRGEN_ACTIONS.Action_createChain.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_chainFromTo.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_chainFromTo.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_chainFromTo.Instance);
            actions.Add("chainFromTo", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_chainFromTo.Instance);
            @chainFromTo = GRGEN_ACTIONS.Action_chainFromTo.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_chainFrom.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_chainFrom.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_chainFrom.Instance);
            actions.Add("chainFrom", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_chainFrom.Instance);
            @chainFrom = GRGEN_ACTIONS.Action_chainFrom.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_chainFromComplete.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_chainFromComplete.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_chainFromComplete.Instance);
            actions.Add("chainFromComplete", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_chainFromComplete.Instance);
            @chainFromComplete = GRGEN_ACTIONS.Action_chainFromComplete.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.Instance);
            actions.Add("chainFromCompleteArbitraryPatternpathLocked", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_chainFromCompleteArbitraryPatternpathLocked.Instance);
            @chainFromCompleteArbitraryPatternpathLocked = GRGEN_ACTIONS.Action_chainFromCompleteArbitraryPatternpathLocked.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance);
            actions.Add("chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance);
            @chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards = GRGEN_ACTIONS.Action_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createBlowball.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_createBlowball.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_createBlowball.Instance);
            actions.Add("createBlowball", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_createBlowball.Instance);
            @createBlowball = GRGEN_ACTIONS.Action_createBlowball.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_blowball.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_blowball.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_blowball.Instance);
            actions.Add("blowball", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_blowball.Instance);
            @blowball = GRGEN_ACTIONS.Action_blowball.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_reverseChainFromTo.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_reverseChainFromTo.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_reverseChainFromTo.Instance);
            actions.Add("reverseChainFromTo", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_reverseChainFromTo.Instance);
            @reverseChainFromTo = GRGEN_ACTIONS.Action_reverseChainFromTo.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createReverseChain.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_createReverseChain.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_createReverseChain.Instance);
            actions.Add("createReverseChain", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_createReverseChain.Instance);
            @createReverseChain = GRGEN_ACTIONS.Action_createReverseChain.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_chainFromToReverse.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_chainFromToReverse.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_chainFromToReverse.Instance);
            actions.Add("chainFromToReverse", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_chainFromToReverse.Instance);
            @chainFromToReverse = GRGEN_ACTIONS.Action_chainFromToReverse.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.Instance);
            actions.Add("chainFromToReverseToCommon", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_chainFromToReverseToCommon.Instance);
            @chainFromToReverseToCommon = GRGEN_ACTIONS.Action_chainFromToReverseToCommon.Instance;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.Instance.patternGraph, false);
            GRGEN_LGSP.PatternGraphAnalyzer.PrepareInline(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.Instance.patternGraph);
            analyzer.RememberMatchingPattern(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.Instance);
            actions.Add("reverseChainFromToToCommon", (GRGEN_LGSP.LGSPAction) GRGEN_ACTIONS.Action_reverseChainFromToToCommon.Instance);
            @reverseChainFromToToCommon = GRGEN_ACTIONS.Action_reverseChainFromToToCommon.Instance;
            analyzer.ComputeInterPatternRelations(false);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Pattern_ChainFromTo.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Pattern_ChainFrom.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Pattern_ChainFromComplete.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryPatternpathLocked.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Pattern_Blowball.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Pattern_ReverseChainFromTo.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Pattern_ChainFromToReverse.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Pattern_ReverseChainFromToToCommon.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_createChain.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_chainFromTo.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_chainFrom.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_chainFromComplete.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_createBlowball.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_blowball.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_reverseChainFromTo.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_createReverseChain.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_chainFromToReverse.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.Instance.patternGraph);
            analyzer.AnalyzeWithInterPatternRelationsKnown(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Pattern_ChainFromTo.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Pattern_ChainFrom.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Pattern_ChainFromComplete.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryPatternpathLocked.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Pattern_Blowball.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Pattern_ReverseChainFromTo.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Pattern_ChainFromToReverse.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Pattern_ReverseChainFromToToCommon.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_createChain.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_chainFromTo.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_chainFrom.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_chainFromComplete.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_createBlowball.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_blowball.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_reverseChainFromTo.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_createReverseChain.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_chainFromToReverse.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.Instance.patternGraph);
            analyzer.InlineSubpatternUsages(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.Instance.patternGraph);
            GRGEN_ACTIONS.Pattern_ChainFromTo.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Pattern_ChainFrom.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Pattern_ChainFromComplete.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryPatternpathLocked.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Pattern_Blowball.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Pattern_ReverseChainFromTo.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Pattern_ChainFromToReverse.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Pattern_ReverseChainFromToToCommon.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_createChain.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_chainFromTo.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_chainFrom.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_chainFromComplete.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_createBlowball.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_blowball.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_reverseChainFromTo.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_createReverseChain.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_chainFromToReverse.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.Instance.patternGraph.maxIsoSpace = 0;
            GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.Instance.patternGraph.maxIsoSpace = 0;
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ChainFromTo.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ChainFrom.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ChainFromComplete.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryPatternpathLocked.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ChainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_Blowball.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ReverseChainFromTo.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ChainFromToReverse.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ChainFromToReverseToCommon.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Pattern_ReverseChainFromToToCommon.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createChain.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_chainFromTo.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_chainFrom.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_chainFromComplete.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createBlowball.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_blowball.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_reverseChainFromTo.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_createReverseChain.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_chainFromToReverse.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.Instance.patternGraph, true);
            analyzer.AnalyzeNestingOfPatternGraph(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.Instance.patternGraph, true);
            analyzer.ComputeInterPatternRelations(true);
        }
        
        public GRGEN_ACTIONS.IAction_createChain @createChain;
        public GRGEN_ACTIONS.IAction_chainFromTo @chainFromTo;
        public GRGEN_ACTIONS.IAction_chainFrom @chainFrom;
        public GRGEN_ACTIONS.IAction_chainFromComplete @chainFromComplete;
        public GRGEN_ACTIONS.IAction_chainFromCompleteArbitraryPatternpathLocked @chainFromCompleteArbitraryPatternpathLocked;
        public GRGEN_ACTIONS.IAction_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards @chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards;
        public GRGEN_ACTIONS.IAction_createBlowball @createBlowball;
        public GRGEN_ACTIONS.IAction_blowball @blowball;
        public GRGEN_ACTIONS.IAction_reverseChainFromTo @reverseChainFromTo;
        public GRGEN_ACTIONS.IAction_createReverseChain @createReverseChain;
        public GRGEN_ACTIONS.IAction_chainFromToReverse @chainFromToReverse;
        public GRGEN_ACTIONS.IAction_chainFromToReverseToCommon @chainFromToReverseToCommon;
        public GRGEN_ACTIONS.IAction_reverseChainFromToToCommon @reverseChainFromToToCommon;
        
        
        public override string[] Packages { get { return packages; } }
        private string[] packages;
        
        public override string Name { get { return "RecursiveActions"; } }
        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 "createChain":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFromTo":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFrom":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFromComplete":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFromCompleteArbitraryPatternpathLocked":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createBlowball":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "blowball":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "reverseChainFromTo":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createReverseChain":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFromToReverse":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFromToReverseToCommon":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "reverseChainFromToToCommon":
                    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 "createChain":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFromTo":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFrom":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFromComplete":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFromCompleteArbitraryPatternpathLocked":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createBlowball":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "blowball":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "reverseChainFromTo":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "createReverseChain":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFromToReverse":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFromToReverseToCommon":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "reverseChainFromToToCommon":
                    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 "createChain":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFromTo":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromTo_groupBy_beg(GRGEN_ACTIONS.Rule_chainFromTo.ConvertAsNeeded(array));
                    case "end":
                        return ArrayHelper.Array_chainFromTo_groupBy_end(GRGEN_ACTIONS.Rule_chainFromTo.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "chainFrom":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFrom_groupBy_beg(GRGEN_ACTIONS.Rule_chainFrom.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "chainFromComplete":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromComplete_groupBy_beg(GRGEN_ACTIONS.Rule_chainFromComplete.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "chainFromCompleteArbitraryPatternpathLocked":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromCompleteArbitraryPatternpathLocked_groupBy_beg(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_groupBy_beg(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "createBlowball":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "blowball":
                    switch(member)
                    {
                    case "head":
                        return ArrayHelper.Array_blowball_groupBy_head(GRGEN_ACTIONS.Rule_blowball.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "reverseChainFromTo":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_reverseChainFromTo_groupBy_beg(GRGEN_ACTIONS.Rule_reverseChainFromTo.ConvertAsNeeded(array));
                    case "end":
                        return ArrayHelper.Array_reverseChainFromTo_groupBy_end(GRGEN_ACTIONS.Rule_reverseChainFromTo.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "createReverseChain":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFromToReverse":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromToReverse_groupBy_beg(GRGEN_ACTIONS.Rule_chainFromToReverse.ConvertAsNeeded(array));
                    case "end":
                        return ArrayHelper.Array_chainFromToReverse_groupBy_end(GRGEN_ACTIONS.Rule_chainFromToReverse.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "chainFromToReverseToCommon":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromToReverseToCommon_groupBy_beg(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.ConvertAsNeeded(array));
                    case "end":
                        return ArrayHelper.Array_chainFromToReverseToCommon_groupBy_end(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "reverseChainFromToToCommon":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_reverseChainFromToToCommon_groupBy_beg(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array));
                    case "end":
                        return ArrayHelper.Array_reverseChainFromToToCommon_groupBy_end(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array));
                    case "common":
                        return ArrayHelper.Array_reverseChainFromToToCommon_groupBy_common(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array));
                    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 "createChain":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFromTo":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromTo_keepOneForEachBy_beg(GRGEN_ACTIONS.Rule_chainFromTo.ConvertAsNeeded(array));
                    case "end":
                        return ArrayHelper.Array_chainFromTo_keepOneForEachBy_end(GRGEN_ACTIONS.Rule_chainFromTo.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "chainFrom":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFrom_keepOneForEachBy_beg(GRGEN_ACTIONS.Rule_chainFrom.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "chainFromComplete":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromComplete_keepOneForEachBy_beg(GRGEN_ACTIONS.Rule_chainFromComplete.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "chainFromCompleteArbitraryPatternpathLocked":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromCompleteArbitraryPatternpathLocked_keepOneForEachBy_beg(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_keepOneForEachBy_beg(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "createBlowball":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "blowball":
                    switch(member)
                    {
                    case "head":
                        return ArrayHelper.Array_blowball_keepOneForEachBy_head(GRGEN_ACTIONS.Rule_blowball.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "reverseChainFromTo":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_reverseChainFromTo_keepOneForEachBy_beg(GRGEN_ACTIONS.Rule_reverseChainFromTo.ConvertAsNeeded(array));
                    case "end":
                        return ArrayHelper.Array_reverseChainFromTo_keepOneForEachBy_end(GRGEN_ACTIONS.Rule_reverseChainFromTo.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "createReverseChain":
                    switch(member)
                    {
                    default:
                        return null;
                    }
                case "chainFromToReverse":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromToReverse_keepOneForEachBy_beg(GRGEN_ACTIONS.Rule_chainFromToReverse.ConvertAsNeeded(array));
                    case "end":
                        return ArrayHelper.Array_chainFromToReverse_keepOneForEachBy_end(GRGEN_ACTIONS.Rule_chainFromToReverse.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "chainFromToReverseToCommon":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromToReverseToCommon_keepOneForEachBy_beg(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.ConvertAsNeeded(array));
                    case "end":
                        return ArrayHelper.Array_chainFromToReverseToCommon_keepOneForEachBy_end(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.ConvertAsNeeded(array));
                    default:
                        return null;
                    }
                case "reverseChainFromToToCommon":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_reverseChainFromToToCommon_keepOneForEachBy_beg(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array));
                    case "end":
                        return ArrayHelper.Array_reverseChainFromToToCommon_keepOneForEachBy_end(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array));
                    case "common":
                        return ArrayHelper.Array_reverseChainFromToToCommon_keepOneForEachBy_common(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array));
                    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 "createChain":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "chainFromTo":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromTo_indexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromTo.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    case "end":
                        return ArrayHelper.Array_chainFromTo_indexOfBy_end(GRGEN_ACTIONS.Rule_chainFromTo.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "chainFrom":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFrom_indexOfBy_beg(GRGEN_ACTIONS.Rule_chainFrom.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "chainFromComplete":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromComplete_indexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromComplete.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "chainFromCompleteArbitraryPatternpathLocked":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromCompleteArbitraryPatternpathLocked_indexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_indexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "createBlowball":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "blowball":
                    switch(member)
                    {
                    case "head":
                        return ArrayHelper.Array_blowball_indexOfBy_head(GRGEN_ACTIONS.Rule_blowball.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "reverseChainFromTo":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_reverseChainFromTo_indexOfBy_beg(GRGEN_ACTIONS.Rule_reverseChainFromTo.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    case "end":
                        return ArrayHelper.Array_reverseChainFromTo_indexOfBy_end(GRGEN_ACTIONS.Rule_reverseChainFromTo.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "createReverseChain":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "chainFromToReverse":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromToReverse_indexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromToReverse.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    case "end":
                        return ArrayHelper.Array_chainFromToReverse_indexOfBy_end(GRGEN_ACTIONS.Rule_chainFromToReverse.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "chainFromToReverseToCommon":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromToReverseToCommon_indexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    case "end":
                        return ArrayHelper.Array_chainFromToReverseToCommon_indexOfBy_end(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "reverseChainFromToToCommon":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_reverseChainFromToToCommon_indexOfBy_beg(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    case "end":
                        return ArrayHelper.Array_reverseChainFromToToCommon_indexOfBy_end(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    case "common":
                        return ArrayHelper.Array_reverseChainFromToToCommon_indexOfBy_common(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    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 "createChain":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "chainFromTo":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromTo_indexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromTo.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    case "end":
                        return ArrayHelper.Array_chainFromTo_indexOfBy_end(GRGEN_ACTIONS.Rule_chainFromTo.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "chainFrom":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFrom_indexOfBy_beg(GRGEN_ACTIONS.Rule_chainFrom.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "chainFromComplete":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromComplete_indexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromComplete.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "chainFromCompleteArbitraryPatternpathLocked":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromCompleteArbitraryPatternpathLocked_indexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_indexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "createBlowball":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "blowball":
                    switch(member)
                    {
                    case "head":
                        return ArrayHelper.Array_blowball_indexOfBy_head(GRGEN_ACTIONS.Rule_blowball.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "reverseChainFromTo":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_reverseChainFromTo_indexOfBy_beg(GRGEN_ACTIONS.Rule_reverseChainFromTo.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    case "end":
                        return ArrayHelper.Array_reverseChainFromTo_indexOfBy_end(GRGEN_ACTIONS.Rule_reverseChainFromTo.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "createReverseChain":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "chainFromToReverse":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromToReverse_indexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromToReverse.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    case "end":
                        return ArrayHelper.Array_chainFromToReverse_indexOfBy_end(GRGEN_ACTIONS.Rule_chainFromToReverse.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "chainFromToReverseToCommon":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromToReverseToCommon_indexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    case "end":
                        return ArrayHelper.Array_chainFromToReverseToCommon_indexOfBy_end(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "reverseChainFromToToCommon":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_reverseChainFromToToCommon_indexOfBy_beg(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    case "end":
                        return ArrayHelper.Array_reverseChainFromToToCommon_indexOfBy_end(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    case "common":
                        return ArrayHelper.Array_reverseChainFromToToCommon_indexOfBy_common(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    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 "createChain":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "chainFromTo":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromTo_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromTo.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    case "end":
                        return ArrayHelper.Array_chainFromTo_lastIndexOfBy_end(GRGEN_ACTIONS.Rule_chainFromTo.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "chainFrom":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFrom_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_chainFrom.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "chainFromComplete":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromComplete_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromComplete.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "chainFromCompleteArbitraryPatternpathLocked":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromCompleteArbitraryPatternpathLocked_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "createBlowball":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "blowball":
                    switch(member)
                    {
                    case "head":
                        return ArrayHelper.Array_blowball_lastIndexOfBy_head(GRGEN_ACTIONS.Rule_blowball.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "reverseChainFromTo":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_reverseChainFromTo_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_reverseChainFromTo.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    case "end":
                        return ArrayHelper.Array_reverseChainFromTo_lastIndexOfBy_end(GRGEN_ACTIONS.Rule_reverseChainFromTo.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "createReverseChain":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "chainFromToReverse":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromToReverse_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromToReverse.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    case "end":
                        return ArrayHelper.Array_chainFromToReverse_lastIndexOfBy_end(GRGEN_ACTIONS.Rule_chainFromToReverse.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "chainFromToReverseToCommon":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromToReverseToCommon_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    case "end":
                        return ArrayHelper.Array_chainFromToReverseToCommon_lastIndexOfBy_end(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    default:
                        return -1;
                    }
                case "reverseChainFromToToCommon":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_reverseChainFromToToCommon_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    case "end":
                        return ArrayHelper.Array_reverseChainFromToToCommon_lastIndexOfBy_end(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    case "common":
                        return ArrayHelper.Array_reverseChainFromToToCommon_lastIndexOfBy_common(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value);
                    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 "createChain":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "chainFromTo":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromTo_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromTo.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    case "end":
                        return ArrayHelper.Array_chainFromTo_lastIndexOfBy_end(GRGEN_ACTIONS.Rule_chainFromTo.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "chainFrom":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFrom_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_chainFrom.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "chainFromComplete":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromComplete_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromComplete.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "chainFromCompleteArbitraryPatternpathLocked":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromCompleteArbitraryPatternpathLocked_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryPatternpathLocked.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "createBlowball":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "blowball":
                    switch(member)
                    {
                    case "head":
                        return ArrayHelper.Array_blowball_lastIndexOfBy_head(GRGEN_ACTIONS.Rule_blowball.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "reverseChainFromTo":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_reverseChainFromTo_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_reverseChainFromTo.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    case "end":
                        return ArrayHelper.Array_reverseChainFromTo_lastIndexOfBy_end(GRGEN_ACTIONS.Rule_reverseChainFromTo.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "createReverseChain":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "chainFromToReverse":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromToReverse_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromToReverse.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    case "end":
                        return ArrayHelper.Array_chainFromToReverse_lastIndexOfBy_end(GRGEN_ACTIONS.Rule_chainFromToReverse.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "chainFromToReverseToCommon":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_chainFromToReverseToCommon_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    case "end":
                        return ArrayHelper.Array_chainFromToReverseToCommon_lastIndexOfBy_end(GRGEN_ACTIONS.Rule_chainFromToReverseToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    default:
                        return -1;
                    }
                case "reverseChainFromToToCommon":
                    switch(member)
                    {
                    case "beg":
                        return ArrayHelper.Array_reverseChainFromToToCommon_lastIndexOfBy_beg(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    case "end":
                        return ArrayHelper.Array_reverseChainFromToToCommon_lastIndexOfBy_end(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    case "common":
                        return ArrayHelper.Array_reverseChainFromToToCommon_lastIndexOfBy_common(GRGEN_ACTIONS.Rule_reverseChainFromToToCommon.ConvertAsNeeded(array), (GRGEN_LIBGR.INode)value, startIndex);
                    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 "createChain":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "chainFromTo":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "chainFrom":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "chainFromComplete":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "chainFromCompleteArbitraryPatternpathLocked":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "chainFromCompleteArbitraryBaseAlwaysFailesByGoingBackwards":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createBlowball":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "blowball":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "reverseChainFromTo":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "createReverseChain":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "chainFromToReverse":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "chainFromToReverseToCommon":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                case "reverseChainFromToToCommon":
                    switch(member)
                    {
                    default:
                        return -1;
                    }
                default:
                    return -1;
                }
            }
        }
        public override void FailAssertion() { Debug.Assert(false); }
        public override string ModelMD5Hash { get { return "3fd10d45f2c120dfa544acdd2c0cc30a"; } }
    }
}