úÎ W&S”:      !"#$%&'()*+,-./0123456789/Error monad for reading matrices from strings. +Errors when reading matrices from strings. Explanatory message Offending value Words are lists of symbols. <Finite state machine whose nodes are labelled with type sy. Actions are lists of DestinationSets, indexed by source  . #Destination sets are just lists of s. )States are integers, counting from zero. 3Create an FSM from a list of symbol, Action pairs. 1Turn an FSM into a list of symbol, Action pairs. ,Delete a symbol and its action from an FSM. Look up a symbol's   in an  Map a function over the FSM. "Compute the list of states of the . Only really meaningful  if the FSM's well-formedness is not  BadLengths. With current  implementation, is just [0..n] for some n (or empty). Compute the alphabet of an . ;Build an action given a nested list of destination states. ABuild a deterministic action given a list of destination states.  Append two  s, ie compute the   corresponding to 6 the application of the first followed by the second.  Compute the    reached by following some    from some .  Compute the   for some  over some  . The word & might contain symbols outside the FSM's alphabet, so the result  could be Nothing.  Test if two 's are action-equivalent over some FSM.  Compute the    for some  at some  of  an 1. The word might contain symbols outside the FSM's C alphabet, or the state might be out of range, so the result could  be Nothing.  Test if two %s are destination-equivalent at some  of  an . -Compute the identity action for a given FSM. 9Compute the identity action for a given number of states  Test if an   is deterministic or not. !Compute whether an  is deterministic or not. " Normalise an , i.e. normalise all its Actions.   !"#  "# !   !"#: This module'5s internal represenation of adjacency matrices is as E nested lists of booleans. These are only ever used as intermediate = data structures, and should not be generated or manipulated ; directly. If you want to work with actions, use the Core   , type. If you want serialised matrices for E storage or transmission, convert them to strings of 0s and 1s using  the functions in this module. $1Given a list of (symbol, path) pairs, compute an  - whose actions are read from action matrices = in the specified paths, associated with their corresponding  symbols. >Note that if the same symbol appears multiple times, only one  instance will appear in the ; the choice of which  appears is not defined. %BRead an action matrix from a specified file, and parse it into an   . &3Parse an action matrix string, and turn it into an   . ;&Parse an action matrix from a string. ?The string being parsed should contain newline-separated rows, E where each row contains comma-separated cells, where each cell is a + 0 or a 1. Trailing newlines are ignored. < Given an :, compute the corresponding   . = Given an >', compute the list of indices of cells > in the row which are set (i.e. which represent transitions). '0Pretty-print an action in action matrix format. $%&'$%&'$%&'( Subclass ? so that @ calls on A s and B s  don't get quotes inserted. )When converting an  into a graph, do we keep D all self-loops, or only those which are sources of nondeterminism? ,3Turn an FSM into an fgl graph with labelled edges. -Compute an FSM'!s strongly-connected components. .Compute an FSM's weakly-connected components. C@The PatriciaTree instance of Graph is faster, but not generally  useful to us because it doesn'#t allow multiple edges between the 9 same pair of nodes. For SCC checks, however, that doesn' t matter,  so we use it. /Turn an FSM into a D E , trimming any  self-loops which aren't sources of nondeterminism. 0&Turn an FSM into a GML-formatted graph', trimming any self-loops  which aren't sources of nondeterminism. ()*+,-./0 )+*,-.(/0 ()+**+,-./01An 8 is well-formed if all its actions are the same length, B none of its actions contain destinations which are out of range,  and it is not disjoint. 2 Well-formed. 39The FSM is disconnected, i.e. not even weakly-connected. > Carries a list of its weakly-connected components (each is a  list of s). 4Some  .s contain out-of-range (negative or too-high) > destinations. Carries a sorted list of all such actions and  their corresponding symbols. 5Lengths of Actions in the  don't all match. Carries a  sorted list of (symbol,   length) pairs, one for every  symbol in the alphabet of the . 6 Check if an  is well-formed or not. 12345615432615432234567@Parse an FsmMatrix-formatted FSM held in a file, by reading the  file and calling parseFsmString. 8=Parse an FsmMatrix-formatted FSM held in a string. Includes + normalisation and well-formedness checks. 9/Pretty-print a string FSM in FsmMatrix format. 789789789F !"#$%&'()*+,-./0123456789:;;<=>?@ABCDEFGHIHJKL MN O OPfsmActions-0.3.0Data.FsmActions.ErrorData.FsmActionsData.FsmActions.ActionMatrixData.FsmActions.GraphData.FsmActions.WellFormedData.FsmActions.FsmMatrixbase Text.Show Data.Charghc-prim GHC.Typesgraphviz-2999.1.0.1Data.GraphViz.Types ReadMxMonadMxErrormsgvalueWordFSMActiondestinationSetsDestinationSet destinationsStatefromListtoListdeletelookupfsmMapstatesalphabetmkAction mkDActionappend actionLookupaction actionEquivdestinationSetdestinationEquiv fsmIdentityidentity isDActionisDFSM normalisenormaliseActionparseFsmActionMxFilesparseActionMxFile parseActionMx printActionMx CleanShow SelfLoopsTrimKeepfsmToFGL strongCCsweakCCsfsmToDotfsmToGML WellFormed Disconnected BadActions BadLengths isWellFormedparseFsmMxFile parseFsmMx printFsmMx ActionMatrixactionMxParserinterpretActionMxparseActionMxRowActionMatrixRowGHC.ShowShowshowGHC.BaseStringCharfsmToPatriciaTreeDotGraph