Finite regular languages This chapter describes some functions to deal with finite regular languages.
Dealing with finite regular languages L is an automaton or a rational expression. This function tests whether its argument represents a finite language or not.
gap> r:=RationalExpression("b*(aU@)");; gap> IsFiniteRegularLanguage(last); false gap> r:=RationalExpression("aUbU@");; gap> IsFiniteRegularLanguage(last); true
L is an automaton or a rational expression. This function outputs the recognized language as a list of words.
gap> r:=RationalExpression("aaUx(aUb)"); aaUx(aUb) gap> FiniteRegularLanguageToListOfWords(r); [ "aa", "xa", "xb" ]
Given an alphabet alph (a list) and a list of words L (a list of lists), outputs an automaton that recognizes the given list of words.
gap> ListOfWordsToAutomaton("ab",["aaa","bba",""]); < deterministic automaton on 2 letters with 6 states > gap> FAtoRatExp(last); (bbUaa)aU@