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.
Asked
Active
Viewed 97 times
2

matheuscscp
- 827
- 7
- 23
-
1*Too much is left untold, ...* says the author in the introduction about the original paper, and now well, the biggest critics of the elves later become elves themselves. – false Oct 31 '16 at 17:11
-
1In 2.4 nevertheless, it is explained that `Ai `is just a *conspicuous* notation for `Xi` when the register is meant as an argument register. So `X4` is an auxiliary scratch register, the next free register. The `put_variable X4, A1` thus means: Make both register 4 and register 1 point to the same variable. – false Oct 31 '16 at 17:24