| B. Martens and D. De Schreye. Automatic finite unfolding using well-founded measures. The Journal of Logic Programming, 28(2):89--146, August 1996. |
....simply be due to unprovable statements. This is why, contrary to maybe functional programming, measures in addition to determinacy have to be adopted to ensure local termination. Well founded Orders Luckily, more refined approaches to ensure local termination exist. The first non ad hoc methods [7, 48, 47, 44] in logic and [58, 67] functional programming were based on well founded orders, inspired by their usefulness in the context of static termination analysis. These techniques ensure termination, while at the same time allowing unfolding related to the structural aspect of the program and goal to be ....
....unfolded into rev(T ; b; a] R) because there is no such strict decrease. Much more elaborate techniques, which e.g. split the expressions into classes, use lexicographical ordering on subsequences of the arguments and even continuously refine the orders during the unfolding process, exist [7, 48, 47, 44] for precise details. These works also present some further refinements on how to apply wfo s, especially in the context of partial deduction. For instance, instead of requiring a decrease wrt every ancestor, one can only request a decrease wrt the covering ancestors, i.e. one only compares with ....
[Article contains additional citation context not shown here]
B. Martens and D. De Schreye. Automatic finite unfolding using well-founded measures. The Journal of Logic Programming, 28(2):89--146, August 1996.
....the control decisions to be made by the specialiser, so that the specialiser becomes much more simple and efficient. Partial evaluation of functional programs [8, 15] has mainly stressed off line approaches, while supercompilation of functional [32, 31] and partial deduction of logic programs [13, 3, 1, 30, 25, 20] have concentrated on on line control. On line methods, usually obtain better specialisation, because no control decisions have to be taken beforehand, i.e. at a point where the full specialisation 1 Formally, an SLDNF tree is obtained from an atom or goal by what is called an unfolding rule. ....
B. Martens and D. De Schreye. Automatic Finite Unfolding Using Well-Founded Measures. The Journal of Logic Programming, 28(2):89--146, August 1996.
....once) 40 selects atoms that match a single clause head. This strategy does not guarantee termination and seems often too conservative (even including look ahead ) 23] It is easy to verify that these limitations carry over to the case of our meta interpreters. Imposing well founded orders [9, 34] ensures local termination and provides a higher degree of specialisation. Bruynooghe et al. 9] showed how well founded measures can be employed (with some care) for partially evaluating vanilla meta interpreters. Our meta interpreter M extends the standard vanilla meta interpreter by ....
B. Martens and D. De Schreye. Automatic Finite Unfolding using Well-Founded Measures. To appear in Journal of Logic Programming, 1996.
....annotations which then guide the specialisation phase proper, often to the point of making it almost trivial. Partial evaluation of functional programs ( 13, 31] has mainly stressed offline approaches, while supercompilation of functional ( 70, 67] and partial deduction of logic programs ([21, 64, 6, 9, 54, 55, 39, 48, 49, 34]) have concentrated on on line control. Some exceptions are [57, 42, 38] The main reason for using the off line approach is to achieve effective selfapplication ( 32] But the off line approach is in general also much more efficient, since many decisions concerning control are made before and ....
....the third argument corresponds to code produced at the next level, i.e. at the level of the specialised program. 3. 5 An Example We now show that our cogen approach is actually powerful enough to satisfactorily specialise the vanilla metainterpreter (a task which has attracted a lot of attention [14, 54, 71] and is far from trivial) Example 4. The following is the well known vanilla metainterpreter for the nonground representation: demo(true) demo( P Q) demo(P) demo(Q) demo(A) dclause(A,Body) demo(Body) dclause(append( L,L) true) dclause(append( H X] Y, H Z] append(X,Y,Z) ....
B. Martens and D. De Schreye. Automatic finite unfolding using well-founded measures. The Journal of Logic Programming, 28(2):89--146, August 1996.
....component: an unfolding rule which describes how an incomplete SLDNF tree should be constructed for a given goal and program. It is a requirement of any terminating partial deduction system that such trees are necessarily finite. Techniques developed to ensure finite unfolding of logic programs [9, 36, 35] have been inspired by the various methods used to prove termination of rewrite systems [17, 16] Whilst, by no means ad hoc, there is little direct relation between these techniques and those used for proving termination of logic programs (or even those of rewrite systems) This means that ....
....means that advances in the static termination analysis technology do not directly contribute to improving the control of partial deduction and the quality of specialised code produced by partial deduction systems. The work of this chapter aims to bridge this gap. Moreover, the control described in [9, 36, 35] as well as the more recent [43, 29] are inherently online, meaning that they are much slower than offline approaches and that they are not based on a global analysis of the program s behaviour which enables control decisions to be taken before the actual specialisation phase itself. Offline ....
[Article contains additional citation context not shown here]
B. Martens and D. De Schreye. Automatic finite unfolding using well-founded measures. Journal of Logic Programming, 28(2):89--146, 1996.
....simply be due to unprovable statements. This is why, except in very special circumstances, measures in addition to determinacy have to be adopted to ensure local termination. Well founded Orders Luckily, more refined approaches to ensure local termination exist. The first non ad hoc methods [8, 56, 55, 53] in logic and [68, 78] functional programming were based on well founded orders, inspired by their usefulness in the context of static termination analysis. These techniques ensure termination, while at the same time allowing unfolding related to the structural aspect of the program and goal to be ....
....because the termsize of the first argument strictly decreases at each step (even though the overall termsize does not) However, rev(T; b; a] R) cannot be further unfolded into rev(T 0 ; H 0 ; b; a] R) because there is no such strict decrease. Much more elaborate techniques exist [8, 56, 55, 53], which, e.g. split the expressions into classes, use lexicographical ordering on subsequences of the arguments and even continuously refine the orders during the unfolding process. 1 Alternatively, one could define a wfo on entire goals. However, this is rarely done in practice. These works ....
[Article contains additional citation context not shown here]
B. Martens and D. De Schreye. Automatic finite unfolding using well-founded measures. The Journal of Logic Programming, 28(2):89--146, August 1996.
....then guide the control aspect of the proper specialisation phase, often to the point of making it completely trivial. Partial evaluation of functional programs [5, 17] has mainly stressed off line approaches, while supercompilation of functional [52, 51, 14] and partial deduction of logic programs [11, 50, 1, 2, 40, 42, 24, 32] have concentrated on on line control. The main reason for using the off line approach is to make specialisation more amenable to effective self application [18] On line methods, however, usually obtain better specialisation, 2 Formally, an SLDNF tree is obtained from an atom or goal by what is ....
....can also be divided into a local and a global one. First, the problem of keeping each SLDNF tree finite is referred to as the local termination problem. Secondly keeping the set A finite is referred to as the global termination problem. To ensure termination well founded orders can be used [2, 41, 40, 39]. However, in an on line setting, well founded orders are sometimes too rigid or too complex [27] The ecce partial deduction system therefore mainly relies on well quasi orders to ensure local and global termination (although other unfolding rules and abstraction operators can be added to the ....
B. Martens and D. De Schreye. Automatic finite unfolding using well-founded measures. The Journal of Logic Programming, 28(2):89--146, August 1996.
....Specialisation is obtained since unfolding is guided by the (partial) input provided in the root atom and the appropriate input part is propagated down the tree. An unfolding criterion decides whether or not a certain atom in a goal may be unfolded while not endangering termination of the process [15, 4, 6]. This decision is based on comparing the atom under consideration with atoms previously encountered in the derivation (i.e. the SLD tree built so far) An atom B will not be unfolded if its arguments are in some way growing w.r.t. a previously unfolded atom A, in which case the relation ....
....relation. In the examples throughout the remainder of this paper we use the homeomorphic embedding relation ( Theta) 18, 10] as a concrete, elegant and simple, instance of the WHISTLE relation. 2 1 Terminology taken from [18] 2 Of course, other WHISTLE relations may also give good results [15]. See Section 5 Definition 2.4 Let X; Y range over variables, f over functors, and p over predicates. As usual, e 1 OE e 2 denotes that e 2 is a strict instance of e 1 . Define Theta on terms and atoms: X Theta Y s Theta f(t 1 ; t n ) s Theta t i for some i f(s 1 ; s n ) ....
[Article contains additional citation context not shown here]
B. Martens and D. De Schreye. Automatic finite unfolding using well-founded measures. Journal of Logic Programming, 28(2):89--146, 1996.
.... only (except once) select atoms that match a single clause head has proven to prevent these kinds of problems. The strategy can be refined with a so called look ahead to detect failure at a deeper level. ffl Termination: Imposing some (essentially) well founded [Bruynooghe et al. 1992; Martens and De Schreye 1996] or well quasi relations on selected atoms ensures termination in a non ad hoc fashion, taking the structural properties of the program into account. Recently, well quasi relations such as the homeomorphic embedding relation, extended to improve the treatment of variables [Leuschel et al. 1998] ....
Martens, B. and De Schreye, D. 1996. Automatic finite unfolding using well-founded measures. J. Logic Program. 28, 2, 89--146.
....d2 ( X1 ; X1 ] d2 ( X1 jX2 ] X3 ; X4) d2 ( X3 ] X2 ; X1 ; X4) d2 ( X1 jX2 ] X3 ; X3 ; X1 jX2 ] d3(X2) d2 ( X1 jX2 ] X3 jX4 ] X5 ; X6) d3(X2) d2 ( X5 ; X1 jX2 ] X4 ; X3 ; X6) 3. 2 In Case Generalisations Take Place U Theta (and similar unfolding rules [25]) performs well when predicate arguments either shrink or grow throughout the unfolding process. Unfolding is allowed as long as information is consumed and appropriately halted when such is no longer the case. Problems however arise for predicates handling fluctuating structure(s) structures ....
B. Martens and D. De Schreye. Automatic finite unfolding using well-founded measures. Journal of Logic Programming, 28(2):89--146, 1996.
....of an if then else. A further improvement lies in generating multiple specialisations of a predicate call according to varying freeness information of the arguments. In summary, partial evaluation of ITE Prolog, can be situated somewhere between partial deduction of pure logic programs (see [60, 31, 10, 69, 68] and systems like sp [30, 29] sage [34, 33] or more recently ecce [50, 51, 57] and partial evaluation of full Prolog (e.g. mixtus [83, 82] or paddy [77, 78, 76] 5.3. Some Aspects of leupel The partial evaluation system leupel, includes all the techniques sketched so far in this section. The ....
B. Martens and D. De Schreye. Automatic finite unfolding using well-founded measures. The Journal of Logic Programming, 28(2):89--146, August 1996.
....As common in partial deduction, the notion of SLDNF trees is extended to also allow incomplete SLDNF trees which, in addition to success and failure leaves, may also contain leaves where no literal has been selected for a further derivation step. Leaves of the latter kind will be called dangling [49]. Also, a trivial SLDNF tree is one whose root is a dangling leaf. 2.1 Partial Deduction Given a logic program P and a goal G, partial deduction produces a new program P 0 which is P specialised to the goal G; the aim being that the specialised program P 0 is more efficient than the ....
....steps follow the computation rule of the underlying system. 6 does not guarantee termination, as there can be infinitely failing determinate computations. Termination can be ensured by imposing a depth bound, but much more refined approaches to ensure local termination exist. The methods in [6, 50, 49, 46] are based on well founded orders, inspired by their usefulness in the context of static termination analysis (see e.g. 13, 10] Instead of well founded ones, well quasi orders can be used [4, 58] Homeomorphic embedding [63, 40] on selected atoms has recently gained popularity as the basis for ....
[Article contains additional citation context not shown here]
B. Martens and D. De Schreye. Automatic finite unfolding using well-founded measures. The Journal of Logic Programming, 28(2):89--146, August 1996.
....control determines which new conjunctions will be considered as potential candidates for specialisation at the global level. Determining U consists in defining how to extend an SLD tree with new nodes. There exists an extensive literature on this topic in classical partial deduction, see e.g. [2, 4, 25]. We propose a method which is sophisticated enough to usually give good results for the kind of transformations we have in mind. The following homeomorphic embedding relation Theta is adapted from [30, 20] As usual, e 1 OE e 2 denotes that e 2 is a strict instance of e 1 . Definition18. ....
B. Martens, D. De Schreye. Automatic finite unfolding using well-founded measures. Journal of Logic Programming, 1996. 28(2):89--146, 1996.
....in the current state of the art, have obtained a level of refinement which goes beyond mere heuristic strategies, as we find in unfold fold. Indeed, formal frameworks have been developed, analysing issues of termination and of code and search explosion, and efficiency gains have been obtained [11, 58, 23, 24, 40, 50]. Several fully automated systems (sp [22] sage [27] paddy[63] mixtus [67] ecce [40, 50, 51, 53] as well as semi automated ones (logimix [60] leupel [39, 46] cogen [30] have been developed and successfully applied to at least medium size applications [46, 49, 18, 37] A similar ....
....As usual in partial deduction, we assume that the standard notions of SLD trees and SLD derivations are generalised [55] to allow them to be incomplete: at any point we may decide not to select any atom and terminate a derivation. Within an SLDtree, leaves of this kind will be called dangling [58]. Also, we will call an SLD tree trivial iff its root is a dangling leaf. The following basic notion is adapted from [55] and associates a first order formula with a finite SLD derivation. Definition 2.1. Let P be a program, Q a goal and D a finite SLD derivation for P [ f Qg with computed ....
[Article contains additional citation context not shown here]
B. Martens, D. De Schreye. Automatic finite unfolding using well-founded measures. Journal of Logic Programming, 28:89--146, 1996.
....one version where X is guaranteed to be free and one where it is not. Under some circumstances this can substantially improve the quality of the generated code. In summary, partial evaluation of RLP, can be situated somewhere in the middle between partial deduction of pure logic programs (see [8, 28, 52, 60, 61] and systems like sp [26, 27] sage [29, 30] or more recently ecce [43, 45, 49] and partial evaluation of full Prolog (e.g. mixtus [72, 73] or paddy [66 68] A partial evaluation system (leupel) which includes all the techniques sketched in this section, has been developed. The ....
B. Martens and D. De Schreye. Automatic finite unfolding using well-founded measures. The Journal of Logic Programming, 28(2):89--146, August 1996. To Appear.
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