| P. Tarau. Program Transformations and WAM-support for the Compilation of De nite Metaprograms. In A. Voronkov, editor, Logic Programming, RCLP Proceedings, number 592 in Lecture Notes in Arti cial Intelligence, pages 462-473, Berlin, Heidelberg, 1992. Springer-Verlag. |
....indexing, one should combine indexing instructions with the compilation of disjunctions: this was already hinted at in a totally di erent context in [14] Mercury has such indexing and WAM variants should as well. Finally, let us point at the analogy between BinProlog principle of binarization ([11]) and B Prolog s principle of pushing only one environment per predicate invocation. Take the clause: p(P) q(Q) r(R) s(S) t(T) which BinProlog binarizes to p(P,Cont) q(Q,r(R,s(S,t(T,Cont) One could go one step further and also unarize predicates, that is transform a predicate to ....
P. Tarau. Program Transformations and WAM-support for the Compilation of De nite Metaprograms. In A. Voronkov, editor, Logic Programming, RCLP Proceedings, number 592 in Lecture Notes in Arti cial Intelligence, pages 462-473, Berlin, Heidelberg, 1992. Springer-Verlag.
....has constant time dereferencing; BinProlog [13] employs a tag on data schema instead of the WAM tag on pointer schema. Each of these WAM variations was e ective within its own context: BIM Prolog used native code generation (not common in 1985 ) BinProlog binarizes clauses before compiling them [12]; PARMA and AQUARIUS rely on abstract interpretation for their top speed. Because the implementation context of these term representations was di erent from each other and from the original WAM, it is not at all clear how they really compare, i.e. there has been no empirical study of the impact of ....
P. Tarau. Program Transformations and WAM-support for the Compilation of Denite Metaprograms. In A. Voronkov, editor, Logic Programming, RCLP Proceedings, number 592 in Lecture Notes in Articial Intelligence, pages 462-473, Berlin, Heidelberg, 1992. Springer-Verlag.
....and B Prolog for example) don t do that. Also, in order not to loose indexing, one should combine indexing instructions with the compilation of disjunctions: this was already hinted at in a di erent context in [14] Finally, let us point at the analogy between BinProlog principle of binarization ([12]) and BProlog s principle of pushing only one environment per predicate invocation. Take the clause: p(P) q(Q) r(R) s(S) t(T) which BinProlog binarizes to p(P,Cont) q(Q,r(R,s(S,t(T,Cont) In this clause, the term r(R; s(S; t(T ; Cont) acts like the frame from which each clause ....
P. Tarau. Program Transformations and WAM-support for the Compilation of Denite Metaprograms. In A. Voronkov, editor, Logic Programming, RCLP Proceedings, number 592 in Lecture Notes in Articial Intelligence, pages 462-473, Berlin, Heidelberg, 1992. SpringerVerlag.
....N U ffi Gamma eval (R U ) V: eval (abs R) abs R) In order to add side effecting features, this specification must be made more explicit: in particular, the exact order in which M , N , and (R U ) are evaluated must be specified. Using a continuation passing technique from logic programming [33], this ordering can be made explicit using the following two clauses, this time using the predicate eval at type tm tm o o. eval (app M N ) V K ffi Gamma eval M (abs R) eval N U (eval (R U ) V K) eval (abs R) abs R) K ffi Gamma K: From these clauses, the goal (eval M V ) is provable ....
Paul Tarau. Program transformations and WAM-support for the compilation of definite metaprograms. In Logic Programming: Proceedings of the First and Second Russian Conferences on Logic Programming, number 592 in LNAI, pages 462--473. Springer-Verlag, 1992.
....have considered various techniques to speed up their own Prolog extensions, and similar techniques are applicable for COPr, too. It may be possible to optimise the WAM to support COPr like primitives so that the system can be more efficient. In a way, something similar has been tried in BinProlog [Tarau 1992] and MultiBinProlog [de Bosschere Tarau 1993] A full comparison with the latter system has yet to be made. There seems to be good potential for (Multi )BinProlog techniques because those systems support efficient continuation passing, which is used much in COPr. Also, it is said [Tarau, ....
Tarau, Paul. [1992] Program transformations and WAM support for the compilation of definite metaprograms. In [Voronkov 1992], pages 462-473.
....rev( X Xs] Ys,Cont) rev(Xs, X Ys] Cont) with a suitable definition for true 1 as: true(C) C. and with a clause like reverse(Xs,Ys) reverse(Xs,Ys,true) Notice that such definitions are virtual (i.e. supplied by generic WAM level operations) in BinProlog, for space and efficiency reasons [23]. By replacing true(C) C an appropriate set of clauses where C=p(X1, Xn) for every head of clause p n occurring in the program, we obtain a definite binary program which accurately describes the operational semantics of the original multi headed program. Although the existence of such a ....
P. Tarau. Program Transformations and WAM-support for the Compilation of Definite Metaprograms. In A. Voronkov, editor, Logic Programming, RCLP Proceedings, number 592 in Lecture Notes in Artificial Intelligence, pages 462--473, Berlin, Heidelberg, 1992. Springer-Verlag.
....ffl late and repeated construction (standard WAMs with AND stack) ffl eager early construction (once) and reuse on demand as in BinWAM will favor different programming styles. Let s note at this point that the WAM s assumptions are subject to the following paradox: 4 We refer the reader to [7, 9, 10] for the details of BinProlog optimizations 5 Called the BinWAM i.e. a simplified WAM like abstract machine specialized for the execution of binary logic programs. ffl If a program is mostly deterministic then it will tend to fail only in the guards (shallow backtracking) In this case, when a ....
P. Tarau. Program Transformations and WAM-support for the Compilation of Definite Metaprograms. In A. Voronkov, editor, Logic Programming, RCLP Proceedings, number 592 in Lecture Notes in Artificial Intelligence, pages 462-- 473, Berlin, Heidelberg, 1992. Springer-Verlag.
....he did not have them ) 12 Related work BinProlog related papers can be found following links from http: www.cs. unt.edu tarau The reader interested in the internals of BinProlog and other issues related to binary logic programs, their transformations and performance evaluation is referred to [23, 12, 14, 6, 8, 15, 13, 11, 10, 17, 16, 2, 32, 9, 29, 18, 31, 26, 4, 3, 7, 24, 5, 1, 25, 27, 28] Related BinProlog documentation is available at: 22, 19, 20, 21] ....
P. Tarau. Program Transformations and WAM-support for the Compilation of Definite Metaprograms. In A. Voronkov, editor, Logic Programming, RCLP Proceedings, number 592 in Lecture Notes in Artificial Intelligence, pages 462--473, Berlin, Heidelberg, 1992. Springer-Verlag.
....as continuation. The continuation append(L1, X] R,Cont) is created on the heap before the body goal is called. This is achieved by a sequence of fine grained put instructions. The abstract machine (BinWAM) used to execute binarized clauses is simpler than the standard WAM, and is described in [20, 21, 22, 25]. The main difference at code generation level between the WAM and the BinWAM is that in the latter (i) there is no return from predicate calls, and (ii) continuations have to be created explicitly. The creation of continuations is well suited to be C ified as it consists of long sequences of ....
.... var(10) term compression [13] writevalue var(6) Right [14] writevalue var(9) S2 [15] writevalue var(3) S [16] writevalue var(4) C [17] putconstant arg(2) 1 1 [18] putvalue arg(3) var(5) S1 [19] putvalue arg(4) var(8) move continuation [20] endcchunk var(7) to its register [21] execute add 4 call body Note the presence of begincchunk and endcchunk in the WAM code. The var(7) comes from a compile time logical variable which allows them to exchange information without an additional pass. In the generated code, endcchunk will know the heap offset (computed at compile ....
P. Tarau. Program Transformations and WAM-support for the Compilation of Definite Metaprograms. In A. Voronkov, editor, Logic Programming, RCLP Proceedings, number 592 in Lecture Notes in Artificial Intelligence, pages 462-- 473, Berlin, Heidelberg, 1992. Springer-Verlag.
Online articles have much greater impact More about CiteSeer.IST Add search form to your site Submit documents Feedback
CiteSeer.IST - Copyright Penn State and NEC