| J. Gallagher and D. A. de Waal. Regular Approximations of Logic Programs and Their Uses. Technical Report CSTR-92-06, Department of Computer Science, University of Bristol, 1992. |
....This is the descriptive approach to types. The abstract domain is a space of types, described by a restricted class of CLP programs called regular unary constraint logic (RULC) programs [15] This class is a generalization to constraint logic programming of regular unary programs (used by [17,16]) Thus, the speci cation S is a RULC program and the abstract immediate consequence operator is the one operating on RULC programs of [15] If the type generated for the head of a clause c by T fcg (S) is not a subtype of the corresponding predicate in S, then the clause is responsible of ....
J. Gallagher and D. A. de Waal. Regular Approximations of Logic Programs and Their Uses. Technical Report CSTR-92-06, Department of Computer Science, University of Bristol, 1992.
....expect. A typical example here is a clause append( L; L) Most of the systems approximate the success set of this clause by the set of triples h[ x; yi where x and y are any terms and thus loose the information that a second and third argument are of the same type. To overcome this problem, [36, 30] introduced approximations based on magic set transformation of the input program. In Section 5 we observe that types of the magic set transformation of a program coincide with directional types of the initial program as they appear in [50, 9, 4, 2, 1, 3, 7, 6, 8] Directional types. Directional ....
....this paper are general regular types, that is, they are not restricted to be discriminative. In Section 5, we establish that the directional types of a program P are exactly the models of an associated logic program P I nOut . In fact, P I nOut is a kind of magic set transformation (see, e.g. [30]) of P . This gives a new, model theoretic characterization of directional types. Both aour algorithms for inference and checking of types are based on this characterization. In Section 4 we prove several basic properties of three kinds of abstraction of logic programs. These properties are then ....
[Article contains additional citation context not shown here]
J. Gallagher and D. A. de Waal. Regular approximations of logic programs and their uses. Technical Report CSTR-92-06, Department of Computer Science, University of Bristol, 1992.
.... to the type checking procedure for arbitrary types) and path closure abstraction (related to the type checking procedure for discriminative types) These properties, that we collect in Section 2, are of general interest; in particular, the abstraction by path closure keeps reappearing (see, e.g. [27, 26, 31, 19, 20]) Furthermore, we establish that the directional types of a program P are exactly the models of an associated logic program P I nOut . In fact, P I nOut is a kind of magic set transformation (see, e.g. 20] of P . We obtain our results (and the soundness and completeness results in [1] by ....
....the abstraction by path closure keeps reappearing (see, e.g. 27, 26, 31, 19, 20] Furthermore, we establish that the directional types of a program P are exactly the models of an associated logic program P I nOut . In fact, P I nOut is a kind of magic set transformation (see, e.g. [20]) of P . We obtain our results (and the soundness and completeness results in [1] by combining the modeltheoretic characterization of directional types with the properties of abstractions established in Section 2. In fact, by having factored out general properties of abstractions from the aspects ....
[Article contains additional citation context not shown here]
J. Gallagher and D. A. de Waal. Regular approximations of logic programs and their uses. Technical Report CSTR-92-06, Department of Computer Science, University of Bristol, 1992.
....expect. A typical example here is a clause append( L; L) Most of the systems approximate the success set of this clause by the set of triples h[ x; yi where x and y are any terms and thus loose the information that a second and third argument are of the same type. To overcome this problem, [24, 20] introduced approximations based on magic set transformation of the input program. It was observed in [12] that types of the magic set transformation of a program coincide with directional types of the initial program as they appear in [32, 8, 4, 2, 1, 3, 6, 5, 7] Directional types form a type ....
J. Gallagher and D. A. de Waal. Regular approximations of logic programs and their uses. Technical Report CSTR-92-06, Department of Computer Science, University of Bristol, 1992.
....this latter. One of the most important properties of a program is its computational semantics which is known not to be computable. Thus, for decidability and efficiency reasons, only an approximation of the semantics could be computed. Different kinds of approximation have been considered [XW88] [GdW92] giving methods with various accuracies. An elegant method for semantics approximation is the set based analysis [Hei92b] It has been introduced for different programming paradigms such as imperative [Hei92b] functional [Hei94] and logic [HJ90] programming. The main feature of this analysis is ....
....vs Top down One should notice that the least set based model corresponds with the bottom up approximate semantics described in [Hei92b] In this latter, a top down (i:e: goal directed) approximate semantics is also described. However, the idea of this method is rather close to one developed in [GdW92] and [GdW94] This latter is based on a program transformation, called Magic set Transformation. This technics aims to simulate with a bottom up algorithm the top down behavior of a (goal directed) resolution. Therefore, performing a top down approximate computation for a program and a goal is ....
J. Gallagher and D.A. de Waal. Regular approximations of logic programs and their uses. Technical Report CSTR-92-06, University of Bristol, mar 1992.
....Types are expressed by a generalization of RUL (regular unary logic) programs. Our approach is based on bottom up abstract interpretation, which is used to approximate the declarative semantics. We generalize the approach of Gallagher and de Waal for deriving regular descriptions of logic programs [GdW94, GdW92]. To approximate the operational semantics, we characterize it by the declarative semantics of a transformed program. This approach is sometimes called magic transformation ) We show that RUL programs (and our generalization of them) are an un2 usual case of abstract domain. Most of the common ....
....of abstract domain. Most of the common requirements of abstract interpretation are not satisfied. The abstract domain is not a partial order, an abstraction function does not exist, the abstract semantic function is not monotonic and may not have the least fixed point. This fact was not noticed in [GdW94, GdW92]. We are focused on type inference for the CHIP language [Cos96] restricted to finite domain constraints. The semantics of CHIP (and of some other CLP languages) differs from the theoretical semantics of CLP because syntactic unification is used. Symbols like , Gamma are treated as constructors ....
[Article contains additional citation context not shown here]
J. Gallagher and D. A. de Waal. Regular Approximations of Logic Programs and Their Uses. Technical Report CSTR-92-06, Department of Computer Science, University of Bristol, 1992.
....are over approximations of program semantics. This is the descriptive approach to types. As the abstract domain we use a certain space of types, described by a restricted class of CLP programs [7] This class is a generalization to constraint logic programming of regular unary programs (used by [10, 9]) Our abstract domain does not satisfy most of the requirements usually posed on domains in abstract interpretation. Neither it satisfies the conditions of the abstract diagnosis method, so the method is inapplicable. We present an incorrectness diagnosis algorithm. It uses a specification of the ....
J. Gallagher and D. A. de Waal. Regular approximations of logic programs and their uses. Technical Report CSTR-92-06, Department of Computer Science, University of Bristol, 1992.
....programming language CHIP [Hen89, Cos96] which has no type system. Consequently the types we consider are descriptive types. For a while our interest is restricted to finite domains (and Herbrand domain of terms) We propose to adopt and extend the type inference system described in [SG95, GdW94, GdW92] In this approach the programmer is not required to declare types for predicates and terms. We introduce some predefined types for most common terms (like lists) and for finite domains. We also impose types for built in predicates operating on finite domain variables. Our original motivation is ....
....to be more relevant. Example 3 Consider variables with the finite domain f1, 2, 3, 5g, list consisting of them and type denoting this structure list( list(fd f1;2;3;5g ) fd f1;2;3;5g j list(fd f1;2;3;5g ) 2 3 Regular approximation The following definitions are quoted from [GdW92, GdW94] Definition 3.1 A regular unary clause is of the form t 0 (f(x 1 ; x n ) t 1 (x 1 ) t n (x n ) n 0 , where x 1 ; x n are distinct variables. 2 Definition 3.2 A regular unary logic program (RUL) is a finite set of regular unary clauses, in which no two ....
[Article contains additional citation context not shown here]
J. Gallagher and D.A. de Waal. Regular Approximations of Logic Programs and Their Uses. Technical Report CSTR-92-06, Department of Computer Science, University of Bristol, 1992.
....ffl the theory of regular sets of terms [DZ92, YS91, GS97] For the specifications defining regular sets the verification conditions are decidable. Thus the clauses violating the conditions can be found automatically. ffl the methods for computing regular approximations of logic programs, GdW92, GdW94] We adopt them for working with constraints. The inferred regular approximations satisfy the verification conditions. ffl the abstract diagnosis method [CLMV98] In that approach one has to define an abstract domain that provides a class of considered specifications and a technique for ....
....be used in such rules. For every predicate t a RULC program P specifies a set t P of constrained terms. There is a library of type definitions which may be augmented by the user. The diagnoser uses the type analyzer of CHIP programs described in [DP98] The analyzer extends the techniques of [GdW92, GdW94] to infer call types and success types of a given CLP program. They are presented to the user either in the form of type terms referring to the stored type definitions or in the form of grammatical rules if an appropriate type definition does not exist. A program P to be analyzed with a ....
J. Gallagher and D. A. de Waal. Regular approximations of logic programs and their uses. Technical Report CSTR-92-06, Department of Computer Science, University of Bristol, 1992.
....in [42] Here an abstract interpretation is performed where the concrete domain is the set of possible variable bindings and the abstract domain is the depth k abstraction of the terms in these bindings. More recently, new methods for obtaining approximations to success sets have been developed [15, 21] and applied to both logic programs and to automated theorem provers. As the success set for a solution determinate goal has at most one element, an approximation to the success set may be useful in the determinacy analysis. Work needs to be done to investigate this and the application of ....
J.P. Gallagher and D.A. de Waal. Regular approximations of logic programs and their uses. Technical Report CSTR-92-06, Department of Computer Science, University of Bristol, 1993.
....domain as the interpretation domain for the translated Toupie program. We only give here an informal presentation of the method. For a detailed discussion see [12, 13] This approach can be related to works on abstract compilation e.g. 14] but here we abstract the syntax of the programs as in [11, 15]. Abstract Domains: A typical example of abstract domains is the domain Prop (see for instance [16, 17, 18] This domain uses two constants g (for ground) and ng (for nonground) The intuition behind this is that a substitution is abstracted by a function f such that f(x i ) g if and only if ....
J.P. Gallagher and D.A. de Waal. Regular Approximations of Logic Programs and their uses. Technical Report CSTR-92-06, Computer Science Department of Bristol University, March 1992.
....by Cartesian approximation) the set valued abstraction (obtained by replacing membership constraints with set inclusions) and path closure. These properties, that we collect in Section 2, are of general interest; in particular, the abstraction by path closure keeps reappearing (see, e.g. [23, 22, 27, 17, 18]) Furthermore, we establish that the directional types of a program P are exactly the models of an associated logic program P InOut . In fact, P InOut is a kind of magic set transformation (see, e.g. 18] of P. We obtain our results (and the soundness and completeness results in [1] by ....
....particular, the abstraction by path closure keeps reappearing (see, e.g. 23, 22, 27, 17, 18] Furthermore, we establish that the directional types of a program P are exactly the models of an associated logic program P InOut . In fact, P InOut is a kind of magic set transformation (see, e.g. [18]) of P. We obtain our results (and the soundness and completeness results in [1] by combining the model theoretic characterization of directional types with the properties of abstractions established in Section 2. In fact, by having factored out general properties of abstractions from the aspects ....
J. Gallagher and D. A. de Waal. Regular approximations of logic programs and their uses. Technical Report CSTR-92-06, Department of Computer Science, University of Bristol, 1992.
....this latter. One of the most important properties of a program is its computational semantics which is known not to be computable. Thus, for decidability and efficiency reasons, only an approximation of the semantics could be computed. Different kinds of approximation have been considered [XW88] [GdW92] giving methods with various accuracies. An elegant method for semantics approximation is the set based analysis [Hei92b] It has been introduced for different programming paradigms such as imperative [Hei92b] functional [Hei94] and logic [HJ90] programming. The main feature of this analysis is ....
....vs Top down One should notice that the least set based model corresponds with the bottom up approximate semantics described in [Hei92b] In the reference, a top down (i:e: goal directed) approximate semantics is also described. However, the idea of this method is rather close to one developed in [GdW92] and [GdW94] This latter is based on a program transformation, called Magic set Transformation. This technics aims to simulate with a bottom up algorithm the top down behavior of a (goal directed) resolution. Therefore, performing a top down approximate computation for a program and a goal is ....
J. Gallagher and D.A. de Waal. Regular approximations of logic programs and their uses. Technical Report CSTR-92-06, University of Bristol, mar 1992.
....the calls and successes (Such approach is often called magic transformation ) For this purpose we introduce a generalization for CLP of c semantics [FLMP89] This results in more precise descriptions than using the standard D model semantics. We adopt then the technique of Gallagher and de Wall [GdW92, GdW94] of bottom up abstract interpretation to synthesize approximations of the call success semantics of a given program. As a side effect we obtain a tool to approximate the declarative semantics of CLP programs. We deal with partial correctness, the approximations are supersets of the actual ....
....a basis of a few programming languages (e.g. TypedProlog [LR91] Godel [HL94] Mercury [SHC96] In contrast to prescriptive typing, our approach is applicable to any (C)LP language. We implemented a type inference tool which is a major modification of the LP analyzer of Gallagher and de Waal [GdW92, GdW94] Our first prototype has been implemented in CHIP for analysis of CHIP programs. Subsequently it has been ported in cooperation with UPM Madrid and with COSYTEC to other platforms (SICSTUS, Ciao) for off line analysis of CHIP programs. It is possible to modify it for analysis of other CLP ....
[Article contains additional citation context not shown here]
J. Gallagher and D. A. de Waal. Regular Approximations of Logic Programs and Their Uses. Technical Report CSTR-92-06, Department of Computer Science, University of Bristol, 1992.
....and successes. Such approach is often called magic transformation ) For this purpose we introduce a generalization for CLP of c semantics [Cla79,FLMP89] this results in more precise descriptions than using the standard D model semantics. We adapt then the technique of Gallagher and de Waal [GdW92,GdW94] of bottom up abstract interpretation to synthesize an approximation of the csemantics of Q; it also is an approximation of the call success semantics of P . As a side effect we obtain a tool to approximate the declarative semantics of CLP programs. We are particularly interested in CLP over ....
....a tool to approximate the declarative semantics of CLP programs. We are particularly interested in CLP over finite domains (CLP(FD) Hen89] especially the language CHIP [Cos96] We have implemented a prototype type analysis system for CHIP. It is a major modification of the system described in [GdW92,GdW94]. A preliminary version of our work was presented in [DP98b] The use of types, as in our work, to approximate the semantics of programs in an untyped language is usually called descriptive typing. Another approach is prescriptive typing. In that approach the type information, provided by the ....
[Article contains additional citation context not shown here]
J. Gallagher and D. A. de Waal. Regular Approximations of Logic Programs and Their Uses. Technical Report CSTR-92-06, Department of Computer Science, University of Bristol, 1992.
....3.9 normalised RUL program A normalised program R is one in which there are no two predicates t and s such that D(t; s) holds. A normalised program can be obtained from R by performing a finite number of applications of N to R, i.e. computing N n (R) for some finite n. This is proved in [14]. Definition 3.10 Let R be an RUL program. Then norm(R) N n (R) such that N n (R) is normalised. The main justification for normalisation is to limit the number of RUL programs (see Lemma 3.12) and thus ensure termination of our approximation procedure. We have found no serious lack of ....
.... true; t 1 (f(x) t 2 (x) t 2 (a) trueg Other kinds of normalisation are possible. In [5] a normalisation on type graphs is used, that has some relation to our operation (but ours loses less precision) Other possible normalisations are discussed in Section 7. The next lemma (proved in [14]) states that normalisation increases the size of the success set of any predicate that occurs in both R and N (R) Lemma 3.11 Let R be an RUL program containing a predicate t such that t occurs both in R and N (R) Then success R (t) success N(R) t) Let UF be some Herbrand universe, ....
[Article contains additional citation context not shown here]
J. Gallagher and D.A. de Waal. Regular Approximations of Logic Programs and Their Uses. Technical Report CSTR-92-06, University of Bristol, March 1992.
....clauses in which no two clause heads have a common instance. It is decidable whether a given goal succeeds in an RUL program. A goal does not succeed if and only if it fails finitely. A detailed description of a method for computing a regular approximation of a given normal program can be found in [7], and the method is also summarised in [8] Briefly, the method is based on abstract interpretation of the standard fixpoint semantics of a definite program P , given by its T P operator. An abstract version of the T P operator is defined, more specifically, a monotonic operator that maps one RUL ....
J. Gallagher and D.A. de Waal. Regular approximations of logic programs and their uses. Technical Report CSTR-92-06, University of Bristol, March 1992.
....4.3.11 shortened RUL program A shortened program R is one in which there are no two predicates t and s such that D(s; t) holds. A shortened program can be obtained from R by performing a finite number of applications of Sh to R, i.e. computing Sh n (R) for some finite n. This is proved in [40]. Definition 4.3.12 short(R) Let R be an RUL program. Then short(R) Sh n (R) such that Sh n (R) is shortened. Shortening is used to limit the number of RUL programs and thus ensure termination of our approximation procedure. A shortened RUL program corresponds to an automaton in which no ....
....is unrestricted, since calls from within clause bodies may be instantiated. The oddly named magic set and Alexander transformations on which this transformation is based were introduced as recursive query evaluation techniques [4, 92] but have since been adapted for use in program analysis [19, 28, 55, 95, 40]. We prefer the name reverse( reverse( X jXs] Y s) reverse(Xs; Zs) append(Zs; X ] Y s) append( Y s; Y s) append( X jXs] Y s; X jZs] append(Xs; Y s; Zs) Program 4.3: Naive Reverse reverse(X1; X2) t38(X1) any(X2) t38( t38( X1jX2] any(X1) t38(X2) ....
[Article contains additional citation context not shown here]
J. Gallagher and D.A. de Waal. Regular approximations of logic programs and their uses. Technical Report CSTR-92-06, University of Bristol, March 1992.
....computation. We quote the frameworks described in [25] and [2] as examples of appropriate methods. Space does not permit a detailed description of the analysis method that we used for the results reported in this paper, but we outline the main ideas. Detailed descriptions can be found in [9] and [10]. The central notion is that of a safe approximation of a program. Definition 5.1 safe approximation Let P and P 0 be normal programs. Then P 0 is a safe approximation of P if for all definite goals G, ffl if P 0 [f Gg has a finitely failed SLDNF tree then P[f Gg has no ....
J. Gallagher and D.A. de Waal. Regular Approximations of Logic Programs and Their Uses. Technical Report CSTR-92-06, University of Bristol, March 1992.
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