úÎrĪkßc      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\] ^ _ ` a b >a hyperedge really, connecting a non-empty subset of the graph' s nodes (see  attachedNodes) cdef$Hypergraph that holds nodes of type n". Nodes can be referenced by type , edges by type , see GraphRewriting.Graph.Read and GraphRewriting.Graph.Write ghijklmnocdefghijklmnocdcdefefghijghijklmno fA pattern represents a graph scrutinisation that memorises all the scrutinised nodes during matching. pqr'Something like an implicit monadic map st?From a graph scrutinisation returning a list of results make a  that branches on that list u=From a graph scrutinisation returning a list of nodes make a  that branches on these nodes. ; For each branch the node matched is added to the history. pqrstupqpqrstu 6Each edge corresponds to the set of nodes it connects =unsafe, as no check for changed edge references is performed Junsafe map that supplies an additional unique key to the mapping function .apply a monadic graph modification to a graph     Minimal complete definition: inspect and one of {update, adjust} Rconvenience function that can be used to access record fields of the exposed type This forces the use of the vwĄ monad. Wrapping a sequence of monadic read-only operations (such as those defined below) into a read-only block can save much overhead e.g. in the state monad.  a wrapper to  the given node  a wrapper to  the given node all of the graph's nodes all of the graph's edges !edges attached to the given node 2non-empty set of nodes attached to the given edge 4amount of ports the given hyperedge is connected to Rlist of nodes that are connected to the given node, not including the node itself Nlist of nodes that are connected to the given node, including the node itself !Snodes connected to given port of the specified node, not including the node itself " whether two nodes are connected #1whether the given ports features a dangling edge $7Map node-relative enquiry over the nodes of the graph.  !"#$ !"#$ !"#$%wApply a pattern on a graph returning a result for each matching position in the graph together with the matched nodes. &'(\Probe whether a pattern matches somewhere on the graph. You might want to combine this with 8. )_probe a pattern returning the matches it has on the graph. You might want to combine this with 8. *choice +choice over a list of patterns ,conditional rewriting: x when predicate is not met -x1 if given pattern succeeds, succeed if it fails. .x# when monadic predicate is not met /Lift a scrutinisation from vw to  leaving the history unchanged. 0any node anywhere in the graph 1'a reference to the lastly matched node 2any edge anywhere in the graph 3%node that is connected to given edge 4$edge that is attached to given node 5Cnode that is connected to the given node, but not that node itself 6Enode that is connected to the given node, permitting the node itself 7Snodes connected to given port of the specified node, not including the node itself 8ADo not remember any of the nodes matched by the supplied pattern 9Klist of nodes matched until now with the most recent node in head position :Gonly match nodes in the next pattern that have not been matched before ;-only accept the given node in the next match <™First match is the history with the most recently matched node in head position. Second match is the future with the next matched node in head position. =7Nodes in the future may not be matched more than once. %&'()*+,-./0123456789:;<=%&'()*+,-./0123456789:;<=%&'()*+,-./0123456789:;<=>?@ABCD>?@ABCD>?@ABCD>?@ABCD Eassign new value to given node Fmodify the node value GWraps  to update aspect v of a node. HWraps  to adjust aspect v of a node. IJadd a new node with value n to the graph KGCreate a new node by cloning another, at the same time updating aspect vF. When defining rewrites in a context where it is not known what type nR the nodes of the graph have, this is the only way to add new nodes to the graph. LĄCreate a new (unconnected) edge. It is expected that the created edge is connected to a port sooner or later. Otherwise the graph will invove unconnected edges. Mremove node from the graph N€Disconnect ports connected to the given edge by assigning a new (dangling) edge to each of the ports. Then the edge is deleted. OeReconnects the ports connected to the second edge to the first one. Then the second edge is deleted. EFGHIJKLMNO EFGHIJKLMNO EFGHIJKLMNO yz{FJoin pairs of sets with a common element until all sets are disjoint. |Add to a list of disjoint sets a further set and join sets with common elements such that the resulting list again only contains disjoint sets. y}z{|yz{| PQRST!A rewriting rule is defined as a  that returns a  U2Apply rule at an arbitrary position if applicable VXprimitive rule construction with the matched nodes of the left hand side as a parameter WGconstructs a rule that deletes all of the matched nodes from the graph XŊConstructs a rule from a list of rewirings. Each rewiring specifies a list of hyperedges that are to be merged into a single hyperedge. All matched nodes of the left-hand side are removed. Y™Constructs a rule that replaces the matched nodes of the left-hand side by new nodes and rewirings. It generates an amount of new edges specified by the ~*. In most cases the functions below named replace* should be sufficient. ZAReplaces the matched nodes by a list of new nodes and rewirings. aReplaces the matched nodes by a list of new nodes and rewirings. It also generates one new edge. bReplaces the matched nodes by a list of new nodes and rewirings. It also generates two new edges. You get the idea. {Apply two rules consecutively. Second rule is only applied if first one succeeds. Fails if (and only if) first rule fails. [rMake a rule exhaustive, i.e. such that (when applied) it reduces redexes until no redexes are occur in the graph. \™Make a rule parallel, i.e. such that (when applied) all current redexes are contracted one by one. Neither new redexes or destroyed redexes are reduced. PQRSTUVWXY€‚ƒ„…†‡Z[\ TUVWXPSRQYZ[\ PSRQQRSTUVWXYZ[\ _  !"#$%&'()*+,-./0123456789:;<=EFGHIJKLMNOPQRSTUVWXY€‚ƒ„…†‡Z[\ ] Instead of (,) to save parentheses ^_BIndex that identifies the principal port within the list of ports `ab]^_`ab_`]^ab]^^_``abˆ        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRPLMNOSTUVWXYZ[\]^_`abcd e f g h i j  k  l  m n o p q r s t  u v w x yz{|z{|}~ €  ‚ ƒ „…†‡ˆ‰Š‹ŒŽ‘graph-rewriting-0.5GraphRewriting.Graph.TypesGraphRewriting.PatternGraphRewriting.Graph Data.ViewGraphRewriting.Graph.Read!GraphRewriting.Graph.Write.UnsafeGraphRewriting.Graph.WriteGraphRewriting.Rule%GraphRewriting.Pattern.InteractionNetGraphRewriting.Graph.InternalGraphRewriting.Pattern.InternalGraphRewriting.Rule.InternalGraphRewritingEdgePortNodeRewriteGraphMatchPattern emptyGraphnodesedgesunsafeMapNodesunsafeMapNodesUniquerunGraph evalGraph execGraphViewinspectupdateadjustexamineadjustM WithGraphreadOnlyreadNode inspectNode examineNode readNodeList readEdgeList attachedEdges attachedNodesedgeCardinality neighbours relatives adverseNodes connectedfree withNodes runPattern evalPattern execPatternprobematches<|>anyOfrequirerequireFailurerequireM liftReadernodepreviousedgenodeAtedgeOf neighbourrelativeadverseamnesiahistory nextFreshnextIsrestrictOverlaplinear modifyNode updateNode adjustNode adjustNodeM writeNode unregisterregisternewNodecopyNodenewEdge deleteNode deleteEdge mergeEdgesRHSMergeWireRuleapplyrewriteeraserewirereplace>>> exhaustive everywherePair:-:INet principalPortpair activePaireKeynKeynodeMapedgeMapnextKeyreadRefreadEdge modifyNodeMap modifyEdgeMapnewRefpatternbranchvisitliftList liftMatches mtl-1.1.1.1Control.Monad.ReaderReaderbaseGHC.BasefailSet joinEdgesjoinjoin1mergeEsghc-prim GHC.TypesIntreplace0replace1replace2replace3replace4replace5replace6replace7replace8