Read("RegLangUtilities.g"); # I = intersection (variable numbers of args) # U = union (variable number of args) # C = complement # P = product (variable numbers of args) # SS = Sigma Star # S = Star (variable number of args, implicit union) # To define letters, use Letter(index, alphabetSize) # The rational expressions package is quite sensitive to everything # being on the same sized alphabet, so make sure to always use the # same (or a global variable) AlphabetSize := 4; a := Letter(1, AlphabetSize); b := Letter(2, AlphabetSize); c := Letter(3, AlphabetSize); d := Letter(4, AlphabetSize); SS := S(a,b,c,d); Lang := I( C(P(SS, c, a, SS)), C(P(SS, d, a, SS)), C(P(SS, d, b, SS)), C(P(b, SS)), C(P(S(a), c, SS)), C(P(SS, d)), C(P(d, S(a,b))), C(P(S(a), U(c,d), S(c,d))), C(P(SS, a, a, SS)), C(P(SS, b, b, SS)), C(P(SS, c, c, SS)), C(P(SS, d, d, SS)), C(P(U(a,b,c), U(a,b,c), SS)), C(P(SS, c, S(a), d, S(a))), C(P(SS, d, S(a, b), c, S(a))), C(P(SS, a, S(c,d))), C(P(d, c, b)) ); # Useful functions: # Spec(L) = Spectrum of L (up to length 15) # AW(L, n) = Accepted words of L of length n # GF(L) = generating function