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, d, SS, d, SS)), C(P(SS, c, a, SS)), C(P(SS, d, a, SS)), C(P(SS, d, b, SS)), C(P(SS, d, c, SS)), C(P(b, SS)), C(P(S(a), c, S(a,b,c))), C(P(S(a,c,d), U(c,d), S(a,c,d))), C(P(S(a,b,d), d, S(a,b,d))), C(P(SS, a, a, SS)), C(P(SS, b, b, SS)), C(P(SS, c, c, SS)), C(P(SS, a, S(c,d))), C(P(a, b, SS)), C(P(c, b, d)) ); # 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