//// Recognizing a left-recursive grammar
//// Reproduced from [FD92]
//// Adopted from DES

// The recognizer is a parser of the following grammar rules.
// A -> a
// A -> Ab
// A -> Aa
// It was tested with the output string ababa.

.type Node <: symbol

.decl t (node1:Node, node2:Node, node3:Node)
.output t ()
.decl a (node1:Node, node2:Node)
.output a ()

t("1","a","2").
t("2","b","3").
t("3","a","4").
t("4","b","5").
t("5","a","6").

a(F,L) :- t(F,"a",L).
a(F,L) :- a(F,M), t(M,"b",L).
a(F,L) :- a(F,M), t(M,"a",L).

