warren-abstract-machine

Flattened form in WAM

微笑、不失礼 提交于 2020-12-12 10:45:10
问题 The WAM: A Tutorial Reconstruction states that a query, p(Z, h(Z,W), f(W)), needs to be flattened using the following principles: That being said, the query flattened form is: X3=h(X2, X5), X4=f(X5), X1=p(X2, X3, X4); I am lost with the definition of external variable, consider the following: p(Z, h(Y, a(K, C), b(W)), f(W)). Is Y an external variable? How should be the flattened form for this? From my understanding this would be the construction: X1 = p(X2, X3, X4) X2 = Z X3 = h(X5, X6, X7)

In a Warren's Abstract Machine, how does bind work, if one of the arguments is a register?

落爺英雄遲暮 提交于 2019-12-01 17:56:02
问题 I'm trying to create my own WAM implementation and I'm stuck at the exercise 2.4 I can't understand how to execute instruction unify_value X4 in figure 2.4. As far as I understand, this instruction should unify Y from the program with f(W) from the query. unify_value X4 calls unify (X4,S) where S=2 (see Figure 2.1) and a corresponding heap cell is "REF 2", and X4 is "STR 5". Unify (Figure 2.7) should bind those values, but I do not understand how to deref a register. "REF 2" is in the heap,

Alternatives to the WAM

二次信任 提交于 2019-11-28 21:11:17
I remember once reading that there were at least two other alternatives invented roughly at the same time as the WAM. Any pointers? false Prior to the WAM, there was the ZIP by Clocksin. Its design is still very interesting. SWI-Prolog uses it. And also B-Prolog has slowly migrated from a WAM design towards the ZIP. Of course, on that way many new innovations were developed. Another alternative is the VAM. A comparison as of 1993 is: http://www.complang.tuwien.ac.at/ulrich/papers/PDF/binwam-nov93.pdf In the meantime, the most interesting architectural developments are related to B-Prolog. WAM

Alternatives to the WAM

老子叫甜甜 提交于 2019-11-27 13:35:27
问题 I remember once reading that there were at least two other alternatives invented roughly at the same time as the WAM. Any pointers? 回答1: Prior to the WAM, there was the ZIP by Clocksin. Its design is still very interesting. SWI-Prolog uses it. And also B-Prolog has slowly migrated from a WAM design towards the ZIP. Of course, on that way many new innovations were developed. Another alternative is the VAM. A comparison as of 1993 is: http://www.complang.tuwien.ac.at/ulrich/papers/PDF/binwam