Note on the Order of Removal Steps
| > | cfg1:=mkCFG({S, A, B},{a,b},S,table([A = {[lambda]}, B = {[lambda], [S]}, S = {[lambda], [a, A, b, B]}])); |
| (10.6.1) |
| > | # Removal of Lambda Production Rules may
# introduce new useless production rules removeLambdaCFG(cfg1); |
| (10.6.2) |
| > | cfg2:=mkCFG({S,A,B},{a},S,table([S={[a,A]},A={[B]},B={[\lambda]}])); |
| (10.6.3) |
| > | # Removal of Unit Production Rules may
# introduce new useless production rules # and new lambda production rules removeUnitCFG(cfg2); |
| (10.6.4) |
| > | # Removal of Lambda Production Rules may
# introduce new unit production rules cfg3:=mkCFG({B, S, A},{a, b},S,table([S = {[a,b], [A,B]}, B = {[lambda], [a, A, b, B]}, A = {[lambda]}])); |
| (10.6.5) |
| > | removeLambdaCFG(cfg3); |
| (10.6.6) |
| > |
| > |