| Demoen, B. and Sagonas, K.: CHAT: The Copy-Hybrid Approach to Tabling, Proceedings of PADL'99, LNCS 1551, pp.106-121, 1999. |
....as the instruction set presented in the SLGWAM de nition of [11] In that sense, the SLGWAM implementation in [11] which we refer to as SLGWAM 98 , was the rst instantiation of the SLGWAM architecture. Other implementations of the SLGWAM architecture have been developed, notably CAT [3] CHAT [5], and S ntese (the Portuguese word for synthesis ) which is a combination of SLGWAM 98 and CHAT. These implementations show a great deal of similarity overall, but di er in what we term environment management, which consists of how information for suspended computations is managed, and in what ....
....require only one word rather than the 3 words for the SLGWAM 98 , while no unused memory is ever trapped in execution stacks as in SLGWAM 98 . However, the cost of suspending and resuming goals may be arbitrarily worse than SLGWAM 98 , due to the copying involved [3] CHAT The goal of CHAT [5] is to keep the overhead on non tabled Prolog execution as low as possible, while having a better behavior for tabled programs than CAT. CHAT, like SLGWAM, uses the freezing technique to conserve suspended portions of the Heap and Local stacks; like CAT, it copies suspended computation states out ....
B. Demoen and K. Sagonas. CHAT: the Copy-Hybrid Approach to Tabling. In Practical Aspects of Declarative Languages: First International Workshop, 1999.
....Since only relevant portions of the stacks are copied, and released as soon as they are no longer necessary, no unused memory is ever trapped as in SLGWAM. On the other hand, the cost of suspending a goal may be arbitrarily worse than SLGWAM, due to the copying involved [3] 4. 3 CHAT CHAT [5] is the rst implementation of a hybrid approach that aims at getting the best advantages from both CAT and SLGWAM. The main goal of CHAT is to keep the overhead on non tabled Prolog execution as low as possible, while having a better behavior for tabled programs than CAT. CHAT, like SLGWAM, uses ....
B. Demoen and K. Sagonas. CHAT: the Copy-Hybrid Approach to Tabling. In Practical Aspects of Declarative Languages: First International Workshop, 1999.
....them terminates; and the Trail, that stores the data required to reset bindings to variables when backtracking. 1 Extensions such as co routining or tabling may require extra stacks. Tabling also complicates stack management [20] or may require extra data areas to store suspended computations [11]. Under some circumstances, namely for deterministic tail recursive calls, the WAM can reclaim space on the Local stack during forward execution [31] Some space on the trail can also be reclaimed after pruning [1] Similar optimizations for the Heap require global analysis [18] Most Prolog ....
....quite di erent beasts, and several WAM derived systems, such as SICStus Prolog [2] or XSB [25] maintain separate choice point and environment stacks. Having less stacks simpli es memory management, but having two stacks may allow some extra exibility, see for instance the CHAT design for tabling [11]. The Trail The trail is a data structure unique to Prolog. It stores all conditional bindings, that is, all bindings that must be reset after backtracking. It grows as we perform uni cations and it contracts during backtracking. Cut may also contract the trail, because it means that some ....
B. Demoen and K. F. Sagonas. CHAT: The copy-hybrid approach to tabling. In Practical Aspects of Declarative Languages, pages 106-121, 1999.
....the forward trail, to keep track of the bindings values. An alternative to the SLG WAM is to keep on working on the current stacks but store the frozen stacks away on an external space, as is done in CAT [5] the same principle was used to suspend orparallel work in Muse [1] The CHAT model [6] signi cantly reduces the overheads of copying and is currently the default scheme in XSB Prolog. In more recent work some authors have proposed a linear tabling mechanism [20] and a reordering based tabling mechanism [9] Both of these schemes avoid freezing by recomputing goals until a xed ....
B. Demoen and K. Sagonas. CHAT: The Copy-Hybrid Approach to Tabling. Lecture Notes in Computer Science, 1551:106-121, 1999.
....erased. To later resume a suspended branch, the bindings belonging to the branch must be restored. SLG WAM achieves this by using an extension of the standard trail, the forward trail, to keep track of the bindings values. Other implementation mechanisms for tabling have been proposed recently [6, 5, 9, 16]. 3 Tabling and Parallelism In previous work [11] we proposed two computational models to combine tabling with or parallelism, the OPT and the TOP approaches. We have decided to implement the OPT approach [12] The OPT approach generalizes Warren s multisequential engine framework for ....
B. Demoen and K. Sagonas. CHAT: The Copy-Hybrid Approach to Tabling. Lecture Notes in Computer Science, 1551:106-121, 1999.
....considerably complicates the implementation and the handling of the cut operator. In SLG WAM [8] the abstract machine adopted by XSB, the state of a consumer is preserved by freezing the stacks, i.e. by not allowing backtracking to reclaim the space on the stacks as is done in the WAM [12] CHAT [4] preserves the state by copying part of it to a separate area and copying it back when the execution of the consumer needs to be resumed. In XSB, tabled calls are not allowed to occur in the scope of a cut. Shen et al. [9] proposed a strictly linear tabulated resolution, called SLDT in this paper, ....
....in general, we show in Section 4 that it can be avoided for a class of tabled calls. Most calls of predicates in deductive databases, such as transitive closure and same generation, belong to this class. We have implemented the linear tabling mechanism in B Prolog. For the CHAT benchmark suite [4] for which re computation is necessary, B Prolog is about 20 slower than XSB. Nevertheless, for another benchmark suite for which re computation is avoidable, B Prolog is faster than XSB. The experimental results will be presented in Section 5. 2 An Introduction to SLDT In this section, we give ....
[Article contains additional citation context not shown here]
Demoen, B. and Sagonas, K.: CHAT: The Copy-Hybrid Approach to Tabling, Proceedings of PADL'99, LNCS 1551, pp.106-121, 1999.
....strategies based purely on copying alone proved inecient due to the cost of copying all information in a computation path into and out of memory. As a result a hybrid was proposed providing for copying of trail and choice point stacks and sharing of heap and local stacks the CHAT memory model of [3]. The weakness of memory sharing for tabled evaluations, then, is that they may trap unneeded information in frozen areas of memory. Of course unneeded information can be freed by using garbage collection algorithms to reclaim trapped choice points, environments and so on, but so far a garbage ....
....information in frozen areas of memory. Of course unneeded information can be freed by using garbage collection algorithms to reclaim trapped choice points, environments and so on, but so far a garbage collector suitable for tabled logic programs has been implemented only for heap information [3]. To date, memory sharing has been to be used more for tabling systems. The current version of XSB shares all stacks except the choice point stack, while YAP[8] shares all stacks during sequential evaluation. Table Access Methods Tabling systems must support ecient algorithms for maintaining ....
B. Demoen and K. Sagonas. CHAT: the Copy-Hybrid Approach to Tabling. In Practical Aspects of Declarative Languages: First International Workshop, 1999.
....on a consumer, the generator and the consumer must be able to work in a coroutining fashion, something that is not readily possible in the WAM which reclaims space on backtracking. The need to suspend computations means that execution environments of these computations must be preserved. CHAT [DS00] the default abstract machine of XSB, preserves consumer states partly by freezing them, i.e. by not reclaiming space on backtracking as is done in WAM and by allocating new space outside the frozen areas. Execution environments of consumers are shared and end up interspersed on the stacks as ....
.... By now, several possibilities for implementing suspension resumption in the WAM exist: either by totally sharing the execution environments by interspersing them in the WAM stacks (as in the SLG WAM [SS98] or by a total copying approach (as in CAT [DS99] or by a hybrid approach (as in CHAT [DS00] In this article, we mainly concentrate on a CHAT implementation of tabling, and refer the interested reader to the above references for differences between these abstract machines. Note that recently a different form of a tabling mechanism, named linear tabling, has emerged which does not ....
[Article contains additional citation context not shown here]
Bart Demoen and Konstantinos Sagonas. CHAT: the CopyHybrid Approach to Tabling. Future Generation Computer Systems, 16(7):809--830, May 2000.
....be preserved and reinstated. By now, several alternatives for suspension resumption exist: either by totally sharing the execution environments by interspersing them in the WAM stacks (as in the SLG WAM [14] or by a total copying approach (as in CAT [7] or by a hybrid approach (as in CHAT [9]) In this paper, we stick to a CHAT implementation, and refer the interested reader to the above references for di erences between these abstract machines 1 . Independently of the implementation model chosen for the suspension resumption mechanism, tabling calls for sophisticated memory ....
....systems with tabling and how operations such as early reset can in principle be implemented with equal accuracy in an SLG WAM or in a CAT based abstract machine. As our aim is to discuss garbage collection issues in the context of tabled execution of logic programs, we only review information from [8, 9] which is necessary to make this paper reasonably self contained. We concentrate on the following typical scenario: The memory management policy has decided that the heap better be garbage collected. The garbage collection process then consists of 1) nding the set of useful data in the heap, and ....
[Article contains additional citation context not shown here]
B. Demoen and K. Sagonas. CHAT: the Copy-Hybrid Approach to Tabling. In G. Gupta, editor, Practical Aspects of Declarative Languages (PADL), number 1551 in LNCS, pages 106-121, San Antonio, Texas, Jan. 1999. Springer.
....remedy this by copying only data that could be reachable in forward execution; i.e. not saving any data that will be garbage on resumption of a consumer. Although this lowers the space requirements of CAT, the worst case complexity of CAT remains una ected. Thus, still not satis ed, we proposed in [5] another alternative, CHAT, which combines certain features of CAT with SLG WAM, hence the H in its name which stands for Hybrid. In particular, heap and local stack are frozen without the need for freeze registers and the trail is partially and incrementally copied so that the WAM trail can be ....
....principle of CHAT (i.e. still without changing the underlying WAM for Prolog execution) CHAT can be implemented in such a way that it performs no worse complexity wise (in both time and space) than SLG WAM. We also note, however, that in practice CHAT performs better than SLG WAM. CHAT as in [5] is our starting point. We will improve on its incremental copying of trail segments, so that the same sharing of trail between consumers is possible as in SLG WAM, and on the installation of the equivalent of freeze registers in choice points which in CHAT leads to repeated traversal of the ....
[Article contains additional citation context not shown here]
B. Demoen and K. Sagonas. CHAT: the Copy-Hybrid Approach to Tabling. In G. Gupta, editor, Practical Aspects of Declarative Languages (PADL), number 1551 in LNCS, pages 106-121, San Antonio, Texas, Jan. 1999. Springer.
....tradeo for which it is not clear cut what choice is best. It was mainly the above described behaviour of CAT, for which there seemed no completely satisfactory solution, that drove us to design another alternative for implementing suspension resumption. Its name is CHAT and it is described in [DS99b] see also Section 7) 5 Implementation of CAT and relation to SLG WAM We implemented CAT starting from XSB version 1.7.2; XSB itself implements SLG WAM, which freezes stacks as a way to save a consumer state. This means that XSB has a more complicated trail, trail test, setting of topof ....
....by taking the (static) knowledge about scheduling components into account, instead of going up the stack again. As mentioned in Section 4, since the birth of CAT we have also worked on yet another alternative to freezing for implementing suspension resumption: the results can be found in [DS99b] One interesting outcome of the work in [DS99b] as far as this article is concerned, is that CAT and SLG WAM o er two extremes in a wide spectrum of possible implementations of suspension resumption: While the SLG WAM is extreme in its sharing of states, CAT is extreme in its copying of ....
[Article contains additional citation context not shown here]
Bart Demoen and Konstantinos Sagonas. CHAT: The copyhybrid approach to tabling. In Gupta [Gup99], pages 106-121. Extended version to appear in the journal of Future Generation Computer Systems.
....rst try to nd the reason elsewhere. As dProlog relies on the XSB compiler for generating abstract machine code, it su ers from the problem that nested terms in the head of a clause are always constructed (from a certain depth on) even if the argument is instantiated. As an example, the fact foo([6,7,8]) Is translated as shown in the rst column of the next table: generated by XSB plain WAM compressed WAM getlist Areg1 getlist Areg1 getlist Areg1 uninumcon 6 uninumcon 6 uninumcon 6 unitvar Areg1 unitvar Areg1 unilist putlist Areg2 getlist Areg1 bldnumcon 8 uninumcon 7 uninumcon 7 bldcon ....
.... suspending consumers in a tabling Prolog by freezing the stacks (as XSB does) or by copying their relevant parts as in CAT [6] Freezing stacks requires an extra freeze register the SF register from B Prolog was introduced for such purpose unless one is lucky and can apply a trick like in CHAT [7] and can have an overal impact on performance and the implementation, while a copying approach is more orthogonal to the rest of the machinery. Also, freezing the stack might necessitate a control stack compactor because unneeded environments cannot be deallocated easily. e.g. in the code: 8 ....
B. Demoen, K. Sagonas. CHAT: the Copy-Hybrid Approach to Tabling. Future Generation Computer Systems, Vol 16, Iss 7, May 2000, 0167-739X
....The default con guration of XSB shares these elements while the option enable chat copies these elements. While sharing and copying have minor performance di erences, the main reason to try the enable chat con guration is to use a heap garbage collector that has been written for it. See [35, 14, 15, 16] for in depth discussion of the engine memory management. 2.1.1 Possible Installation Problems Lack of Space for Optimized Compilation of C Code When making the optimized version of the emulator, the temporary space available to the C compiler for intermediate les is sometimes not sucient. For ....
B. Demoen and K. Sagonas. CHAT: the Copy-Hybrid Approach to Tabling. In G. Gupta, editor, Practical Aspects of Declarative Languages: First International Workshop, number 1551 in LNCS, pages 106-121, San Antonio, Texas, Jan. 1999. Springer.
....remedy this by copying only data that could be reachable in forward execution; i.e. not saving any data that will be garbage on resumption of a consumer. Although this lowers the space requirements of CAT, the worst case complexity of CAT remains una ected. Thus, still not satis ed, we proposed in [5] another alternative, CHAT, which combines certain features of CAT with SLG WAM, hence the H in its name which stands for Hybrid. In particular, heap and local stack are frozen without the need for freeze registers and the trail is partially and incrementally copied so that the WAM trail can be ....
....of CHAT (i.e. still without changing the underlying WAM for Prolog execution) CHAT can be implemented in such a way that it performs no worse complexity wise (in both time and space) than SLG WAM. We also note, however, that in practice CHAT performs better than SLG WAM. CHAT as described in [5] is our starting point. We will improve on its incremental copying of trail segments, so that the same sharing of trail between consumers is possible as in SLG WAM, and on the installation of the equivalent of freeze registers in choice points which in CHAT leads to repeated traversal of the ....
[Article contains additional citation context not shown here]
B. Demoen and K. Sagonas. CHAT: the Copy-Hybrid Approach to Tabling. In G. Gupta, editor, Practical Aspects of Declarative Languages: First International Workshop, number 1551 in LNCS, pages 106-121, San Antonio, Texas, Jan. 1999. Springer.
....be preserved and reinstated. By now, several possibilities for suspension resumption exist: either by totally sharing the execution environments by interspersing them in the WAM stacks (as in the SLG WAM [14] or by a total copying approach (as in CAT [7] or by a hybrid approach (as in CHAT [9]) In this paper, we stick to a CHAT implementation of tabling, and refer the interesting reader to the above references for differences between these abstract machines 1 . Independently of the implementation model that is chosen for the suspension resumption mechanism, tabling calls for ....
....when garbage collection is triggered. rience by discussing garbage collection issues that are nowhere presented in the literature and to experimentally evaluate alternative garbage collection schemes in the context of tabled execution of logic programs, this section only contains information from [8, 9] that is necessary to make the current document reasonably self contained. It should be relatively straightforward to deduce how the discussed issues translate in a CAT or in an SLG WAM based implementation; whenever it is not the case, their translation is explicitly mentioned. We concentrate on ....
[Article contains additional citation context not shown here]
B. Demoen and K. Sagonas. CHAT: the Copy-Hybrid Approach to Tabling. In G. Gupta, editor, Practical Aspects of Declarative Languages: First International Workshop, number 1551 in LNCS, pages 106--121, San Antonio, Texas, Jan. 1999. Springer.
No context found.
Demoen, B. and Sagonas, K.: CHAT: The Copy-Hybrid Approach to Tabling, Proceedings of PADL'99, LNCS 1551, pp.106-121, 1999.
No context found.
B. Demoen and K. Sagonas. CHAT: the Copy-Hybrid Approach to Tabling. In Practical Aspects of Declarative Languages: First International Workshop, 1999.
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