  
  [1m[4m[31m6. Finite regular languages[0m
  
  This chapter describes some functions to deal with finite regular languages.
  
  
  [1m[4m[31m6.1 Dealing with finite regular languages[0m
  
  [1m[4m[31m6.1-1 IsFiniteRegularLanguage[0m
  
  [1m[34m> IsFiniteRegularLanguage( [0m[22m[34mL[0m[1m[34m ) _____________________________________[0mfunction
  
  [22m[34mL[0m  is an automaton or a rational expression. This function tests whether its
  argument represents a finite language or not.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> RandomRatExp(2);[0m
    [22m[35mb*(aU@)[0m
    [22m[35mgap> IsFiniteRegularLanguage(last);[0m
    [22m[35mfalse[0m
    [22m[35mgap> RandomRatExp(2);[0m
    [22m[35maUbU@[0m
    [22m[35mgap> IsFiniteRegularLanguage(last);[0m
    [22m[35mtrue[0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m6.1-2 FiniteRegularLanguageToListOfWords[0m
  
  [1m[34m> FiniteRegularLanguageToListOfWords( [0m[22m[34mL[0m[1m[34m ) __________________________[0mfunction
  
  [22m[34mL[0m  is  an  automaton  or  a  rational  expression. This function outputs the
  recognized language as a list of words.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> r:=RationalExpression("aaUb(aUb)");[0m
    [22m[35maaUb(aUb)[0m
    [22m[35mgap> FiniteRegularLanguageToListOfWords(r);[0m
    [22m[35m[ "aa", "ba", "bb" ][0m
  [22m[35m------------------------------------------------------------------[0m
  
  [1m[4m[31m6.1-3 ListOfWordsToAutomaton[0m
  
  [1m[34m> ListOfWordsToAutomaton( [0m[22m[34malph, L[0m[1m[34m ) ________________________________[0mfunction
  
  Given  an  alphabet  [22m[34malph[0m  (a list) and a list of words [22m[34mL[0m (a list of lists),
  outputs an automaton that recognizes the given list of words.
  
  [22m[35m---------------------------  Example  ----------------------------[0m
    [22m[35mgap> ListOfWordsToAutomaton("ab",["aaa","bba",""]);[0m
    [22m[35m< deterministic automaton on 2 letters with 6 states >[0m
    [22m[35mgap> FAtoRatExp(last);[0m
    [22m[35m(bbUaa)aU@[0m
  [22m[35m------------------------------------------------------------------[0m
  
