úÎy´pR©      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“” • – — ˜ ™ š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨  Aux Functions((c) Jorge Santiago Alvarez Cuadros, 2016GPL-3sanjorgek@ciencias.unam.mx experimentalportableSafe;= nUnion of set monad"Size of a set, with large integersSimple label state data((c) Jorge Santiago Alvarez Cuadros, 2016GPL-3sanjorgek@ciencias.unam.mx experimentalportableSafe 0Alias for a label state of a set of label states Alias for a set of lalbel statesQFinal label state represent a set of states which elements put end to computation/Machine states are only a label, maybe a letterState constructor Error stateTells if a label state is final 'Tells if a label state is a error state AIn this differ with Maybe because this show a upper bounded orderHolds(QE /= (toEnum:: State Int) . fromEnum QETrue Same as Maybe Same as Maybe Same as Maybe   Cardinal Def((c) Jorge Santiago Alvarez Cuadros, 2016GPL-3sanjorgek@ciencias.unam.mx experimentalportableSafe;=ç@Simple cardinality definition, we work here with numerable sets.(All numerable set have one and only one:  A finite sizeA infinite size!All sets can be one and only one: a empty set!a set with, at least, one element&Bound limits for numerable cardinalityOrder for numerable cardinalityAlphabet and symbols((c) Jorge Santiago Alvarez Cuadros, 2016GPL-3sanjorgek@ciencias.unam.mx experimentalportableSafe;=( "An alphabet is a set of symbols#.List symbol alias, Word are defined in Prelude$MSymbols are character, and with Unicode CharSet we have a big amount of them.% Blank symbol&'For every alphabet there is a function h0 that maps one symbol to one natural. For every hI function there is a function that enumerete every words in that alphabet'TGives the Kleene Closure for all alphabets. closureAlph is a infinite list of words.(For some alphabet S and a natural number n take all words of length n or less)For some alphabet S and a natural number n take all words of length n*%Symbol type are forced to be a monoid"#$%&'()$%#"&'()Partial functions((c) Jorge Santiago Alvarez Cuadros, 2016GPL-3sanjorgek@ciencias.unam.mx experimentalportableSafeST;R+Non-Deterministic DeltaHMaps a tuple, a state and a param, to a tuple, a state list and a param.,Deterministic DeltaIMaps a tuple, a state and a param, to another tuple, a state and a param.-0Map a tuple, a state and a param, to some output.,Lift a generic delta/map from a 3-tuple list/6Take a state and a param and maybe resolve some output0For simple map with Chars range1/Lifts a deterministic delta from a 4-tuple list2+Next state function for deterministic delta33Lifts a non-deterministic delta from a 4-tuple list4/Next state function for non-deterministic delta50Gets all params at domain, for (:->:) and (:-<:)60Gets all params at domain, for (:-<:) and (:-<:)70Gets all states at domain, for (:->:) and (:-<:)80Gets all states at domain, for (:->:) and (:-<:)9$Gets all params at range, for (:->:):$Gets all params at range, for (:->:);$Gets all params at range, for (:-<:)<$Gets all params at range, for (:-<:)=%Gets first param at range, for (:->:)>%Gets first param at range, for (:->:)?)Gets state at range in a list, for (:-<:)@(Gets state at range in a set, for (:-<:)+,-./0123456789:;<=>?@-,12+34./0569;:<78=?>@Finite Automaton((c) Jorge Santiago Alvarez Cuadros, 2016GPL-3sanjorgek@ciencias.unam.mx experimentalportableSafeST\A Transducer Autmaton, both types: MooreMealyDFinite deterministic AutomatonE/let autFin = F delta (Set.fromList [Q 0]) (Q 0)F2let autFinN = FN deltaN (Set.fromList [Q 0]) (Q 0)G-Transducer function with output at transitionHTransducer functionInTransition function that for every pair, a State and a Symbol by domain, decide next list of states in machineJeTransition function that for every pair, a State and a Symbol by domain, decide next state in machine©Union of set monadª"Size of a set, with large integersK"Lift a list of 3-tuples to a Delta?let delta = liftDelta [(0,'0',0),(0,'1',1),(1,'0',1),(1,'1',0)]L4Lift a list of 3-tuples to a non deterministic deltaIlet deltaN = liftNDelta [(0,'0',[0]),(0,'1',[1]),(1,'0',[1]),(1,'1',[0])]MLift simple transducer functionNLift second transducer functionO'Gets alphabet for some finite automatonPMFor some delta, an initial state anf a word returns final state for that wordQ5Same as endState but work with no deterministic deltaR Executes a automaton over a word%checkString autFin "1010010101101010"True1checkString autFin "1010010101101010001010101010"FalseSMFor every transducer, given a word the automaton change all symbols in lambdaT,Transforms a Transducer to a Finite AutmatonUCTransforms a Finite Autmaton with some lambda to a Moore TransducerVCTransforms a Finite Autmaton with some lambda to a Mealy TransducerWgMinimaize a delta for some finite automaton. Gets a delta with all reachable states from initial state.XžDelete redundant states and their transitions, if a state is equivalent to another then is redundant, two state are equivalent if they are undistinguisahbles.YMinimize a finite automaton, Delete redundant states/Delete unreachable states and their transitionsZFinite Autmaton Equivalence[6Tells if a finite automaton had empty language or not.\XTells if a finite automaton had infinite language or the number or words in his languageABCDEFGHIJKLMNOPQRSTUVWXYZ[\JIDEFRHGABCSOPQKLMNWXYZTUV[\ABCDEFStack Automaton((c) Jorge Santiago Alvarez Cuadros, 2016GPL-3sanjorgek@ciencias.unam.mx experimentalportableSafeSTe„aFStack machine only needs a delta, an init state and an initial symbol.3This works for empty stack and final state acceptorgA key for a delta.hŠDelta for stack machine, takes a state, a symbol in string input or not and a symbol in stack head and returns next state and update stacki'Takes a list of tuples and lift a DeltaZlet delta = liftD [(0,"(",'Z',0,"IZ"),(0,"",'Z',0,""),(0,"(",'I',0,"II"),(0,")",'I',0,"")] abfedcghijk hgijabcdefkabcdefTuring machine abstaction((c) Jorge Santiago Alvarez Cuadros, 2016GPL-3sanjorgek@ciencias.unam.mx experimentalportableSafe &'>?CSTVhÍ Left move‚No moveƒ Right movenopqrstuvxwyz{~}|€‚ƒ„…†‡ˆ‰Š„…€‚ƒ‹{|}~Œzy†‡ˆvwxtu‰Šrspqnonopqrstuvwx{|}~€‚ƒ„… Two ways turing machine((c) Jorge Santiago Alvarez Cuadros, 2016GPL-3sanjorgek@ciencias.unam.mx experimentalportableSafe ;=>?FSTm•™/let tapeLifted = (liftTape "word")::Tape Symbol tapeLiftedT "" 'w' "ord"”• ”•œ›š™˜—–”• Four ways turing machine((c) Jorge Santiago Alvarez Cuadros, 2016GPL-3sanjorgek@ciencias.unam.mx experimentalportableSafe;>?FSTpŸ  Ÿ §¦¥¤£¡¢Ÿ «    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrUVstuvwxyz{|}~€‚Uƒ„…†‡ˆ‰Š‹Œ<Ž‘’“”•–—˜™š › œ ž Ÿ   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯  °,turingMachine-1.0.0.0-4d5BhfTnZHhHuJ4ByAMyEE Data.Helper Data.LabelData.Numerable Data.Sigma Data.DeltaMath.Model.Automaton.FiniteMath.Model.Automaton.StackMath.Model.TuringMath.Model.Turing.TwoWaysMath.Model.Turing.FourWays unionsFoldsetGenericSizeLabelSSSetLabelFinalLabelQQEterminalisError$fFoldableLabel $fMonoidLabel $fOrdLabel$fBoundedLabel $fEnumLabel $fMonadLabel$fApplicativeLabel$fFunctorLabel $fShowLabel $fEqLabelDiscreteFin NumerableEssenceEmptyOccupied$fBoundedDiscrete $fOrdDiscrete $fShowEssence $fEqEssence $fOrdEssence$fBoundedEssence$fShowDiscrete $fEqDiscreteAlphabetWdSymbolblankenumWord closureAlph lessKWordskWords $fMonoidChar:-<::->::*>:liftL nextTMaybe nextSymbolliftDnextDliftNDnextND getFirstParamgetFirstParamSetgetStateDomaingetStateDomainSetgetSecondParamDgetSecondParamSetDgetSecondParamNDgetSecondParamSetNDgetStateRangeDgetStateRangeSetDgetStateRangeNDgetStateRangeSetND TransductorMooreMealyFiniteAFFNLambda2Lambda1NDeltaDelta liftDelta liftNDeltaliftL1liftL2 getAlphabetendState endStates checkString translatetransducerToFinite finiteToMoore finiteToMealyreachableDeltadistinguishableDeltaminimizeFinite convertFAautomatonEssenceautomatonCardinality $fShowFiniteA $fEqFiniteA$fShowTransductor$fEqTransductorStackAStackgetDelta getInitStategetFinal getInitSymbolKey nextDTuple nextState $fShowStackA $fEqStackA MultiModelMTSModelTSTuringMmoveHead MultiTapeMTTapeablegetHeadliftTapeMDeltaFWDwLfRtUpLRSLSRWaysopositeliftMDliftDAuxgetMHead liftMTape $fWaysLRS$fWaysFW $fShowLRS$fEqLRS$fOrdLRS $fBoundedLRS$fShowFW$fEqFW $fBoundedFWTapeT$fTuringMTape[]LRS$fTuringMTapeCharLRS$fTapeableTape[]$fTapeableTapeChar $fMonoidTape$fApplicativeTape $fFunctorTape $fShowTape$fEqTapeTracksTrack$fTuringMTapeCharFW$fTuringMTracksCharFW$fTapeableTracksChar$fMonoidTracks$fApplicativeTracks$fFunctorTracks $fShowTracks $fEqTracks