; ** p7.stax ************************************************ ; STAX program to accept the language { w | w = 0^(2^n), n>=0 } ; ; John Haskins, Jr. ; l'Universite de Virginie (University of Virginia) ; jwh6q@virginia.edu ; ----------------------------------------------------------- .input_alphabet "0" .stack_alphabet "a" ; initialize stacks... qinit0: deny -, -, push[0]:$, q1 $, -, nop, qdone q1: deny '0', -, push[0]:'a', q1 $, -, push[1]:$, q2 q2: deny -, 'a'[0], pop[0], q3 -, $[0], nop, q5 q3: deny -, 'a'[0], pop[0], q4 -, $[0], nop, q9 q4: deny -, -, push[1]:'a', q2 q5: deny -, 'a'[1], pop[1], q6 -, $[1], nop, q2 q6: deny -, 'a'[1], pop[1], q7 -, $[1], nop, q8 q7: deny -, -, push[0]:'a', q5 q8: deny -, $[0], nop, qdone q9: deny -, $[1], nop, qdone qdone: accept halt