In Hassan Aït-Kaci's "Warren's Abstract Machine: A Tutorial Reconstruction" Section 2.2, the orders for compilation of L0 queries are clear enough: registers must be allocated with left-to-right breadth-first search and code must be generated with left-to-right post-order depth-first search.
In Section 2.3, the order for register allocation (of L0 programs) is clear: left-to-right breadth-first search. The order for code generation isn't. With the only example given, I can't tell if I should use BFS or DFS to generate code.
Can someone give me the WAM code for the following L0 program?
p(q(r(a)),s(b)).