Help:=proc(): print(`fAFt(A,F,t) , FindEq(A,F,T,a,W) `): end: #fAFt(A,F,t): Inputs a set A (the alphabet) and a set #F of words in the alphabet A, and a variable t, #and outputs the formal power series (that will turn out) #to be a rational function of t, whose (Maclaurin) coeff. #of t^n equals exactly the number of words in the letters #A that do not have as FACTORS (i.e. consecutive subword) #any of the "curse words" of F. For example #f({1,2},{[1,1]},t) should give the (ordinary) generating #function for the sequence a[n]:=number of n-letter words #in {1,2} that never have two 1's next to each other fAFt:=proc(A,F,t) local eq,var,W: end: #FindEq(A,F,T,t,W): inputs an alphabet A, a set of #global restrictions F, another set of restrictions #T (that correspond to not starting with any word of T) #and outputs the equation for W[T] as a linear combination #of w[T']-s for various different T', followed by the #set of T' used FindEq:=proc(A,F,T,t,W) local aek,a,T1: aek:=W[T]-1: for a in A do T1:=newT(A,F,T,a): aek:=aek-t*W[T1]: od: aek: end: #newT(A,F,T,a): inputs an alphabet A, a set #of global restrctions F, a set of starting #restrictions T, and a letter a (a in A) #and ouputs the set of starting restrictions #that a word in A should have such that if #you stick a at the very beginning you neither #get anything in F, nor anything in T newT:=proc(A,F,T,a) local T1,f,t: T1:={}: for f in F do if f[1]=a then T1:=T1 union {[op(2..nops(f),f)]}: fi: od: for t in T do od: end: