How code generation works for Ait-Kaci's WAM L1?

109 Views Asked by At

Hassan Aït-Kaci's "Warren's Abstract Machine: A Tutorial Reconstruction" Section 2.4 extends L0 to L1 in order to support a set of facts in the abstract machine. The four new instructions put_variable, put_value, get_variable and get_value have arguments Xn and Ai, whose meanings are not clear. The description only mentions index i of argument Ai: the i-th argument position of the predicate. Where n of Xn comes from? Figure 2.9 presents an example of generated code for query p(Z,h(Z,W),f(W)). Since predicate p has arity 3 and the first instruction is put_variable X4, A1, n can't be the predicate's arity.

0

There are 0 best solutions below