úÎSYP"      !Safe7hNode structure contains the node's id, suf binding (Nothing iff root) and the map of all outgoing edges.Returns id of the node.Returns node's suf binding.Returns node's outgoing edges.RGraph structure contains ids of its root and sink as well as the map of all nodes.Returns id of the root.Returns id of the sink. Edge with its startpoint. Edge with its label. Destination node, edge type. Indicates unique id of a node."Index of a root in every graph.#Helper for creating nodes.$ Subword graph for an empty word.rConstructs a subword graph for a given word. The performance of this function is linear in the length of a word.uConstructs a subword graph for a reversed word. The performance of this function is linear in the length of a word.mIndicates whether the subword graph contains the given word. Performance is linear in the length of the word.BReturns the list of all subwords present in a given subword graph.vReturns the number of all subwords present in the given subword graph. Performance is linear in the size of the graph.%cFinds the given word in the subword graph starting at the given node. Helper function for findNode.ÄFinds the given word in the subword graph. On failure, returns Nothing. On success, returns the node in the subword graph at which the word ends. Performance is linear in the length of the word.fReturns a word corresponding the given subword graph. Performance is linear in the length of the word.&Helper function for toWord.¼Folds the edges in a graph, using post-order traversal. Transformer function takes an edge, current node's state and state along the edge. Init state at node is equal to the accumulator.~Folds the edges in a graph starting at a given node. Returns computed value, as well as a mapping: vertex -> computed value.'KProcess the node in a postorder fashion. Helper function for foldrFromNode.("Helper function for postorderNode.õFolds the edges in a graph, using topological order traversal. Transformer function takes current node's state, current state along the edge, an edge and it produces a new state along the edge. Init state at node is equal to the accumulator.xFolds the edges in a graph up to a given node. Returns computed value, as well as a mapping: vertex -> computed value.)ÇHelper function for foldlToNode. It takes a transformer function, accumulator, a subword graph a node up to which we want to continue folding and a list of unprocessed nodes in a topological order.*‡Helper function for extracting node's state. It takes a default value which is returned in case of given vertex absence in the state.sFor a given graph returns the list of nodes in a topological order. Performance is linear in the size of the graph.+žHelper function for topsort. It takes a graph, list of unprocessed nodes with indegree equal to 0, current result and a mapping: vertex -> current indegree.,hFor a given graph returns a mapping: vertex -> indegree. Performance is linear in the size of the graph.\Adds an element to a given graph creating a new graph for a word with this element appended.-üPerforms fixing nodes in the suf bindings chain after inserting a new node. Function takes a predicate which indicates the end of fixing, node id where we need to redirect edges, edge type to redirect, starting node, edge label and a current graph..¹Another necessary update of a graph after inserting a new node. Performs splitting given node in two after fixSufBindings to preserve correctness. For further details please visit:  "http://smurf.mimuw.edu.pl/node/581* (lecture in Polish, contains pseudocode)./?Updates the suf binding of a graph's sink node with a given id.05Updates the suf binding of a node with a given id of v.1MUpdates the suf binding of a node with a given id with a node represented by sufNode value.2Adds node to a given graph.3DAdds new node to a given graph. Returns new graph and new node's id.4HAdds or updates an edge from a node with a given index in a given graph.5<Updates node with a given index in a graph with a new value.*Returns number of nodes for a given graph.*Returns number of edges for a given graph.6?Returns node with a given index. Error when such doesn't exist.AReturns node with a given index. Nothing iff such does not exist.(For a given graph returns its root node.<For a given node in a given graph returns its suf link node. (For a given graph returns its sink node.!6Looks up an edge from a given node with a given label.7bReturns an edge from a given node with a given label. Error when the specific edge does not exist.8EChecks whether there is an edge from a given node with a given label.9eChecks whether an edge from a given node with a given label is solid. Error when such does not exist.?:;< "#$%&'()*+,-./0123456 !7=8>9"  !'  ! 5:;< "#$%&'()*+,-./0123456 !7=8>9?      !"#$%&'()*+,-./0123456789:;<=>?subwo_5Yu2lNK5FsT5ddNZb6BApaData.SubwordGraphNodenodeIdsufIdedgesSGraphrootIdsinkIdEdgeTypeSolidSoft RootedEdge LabeledEdgeEdgeVertex constructconstructReversedelemsubwords subwordsNumfindNodetoWordfoldr foldrFromNodefoldl foldlToNodetopsortinsertnodesNumedgesNum lookupNode getRootNode getSufNode getSinkNodefindEdgerootIx defaultNode emptyGraphfindNodeInternaltoWordWithStack postorderNode postorderGo toporderNode getNodeStatetopordercountInDegreesfixSufBindings splitByNode changeSinkSuf changeSuf changeSufNodeaddNode addNewNodesetEdge updateNodegetNodegetEdgeisEdgeisNodeEdgeSolidnodesgetNodeSolidEdges isEdgeSolid