| J. Boye and J. Maluszynski. Directional types and the annotation method. JLP, 33(3):179--220, 1997. |
.... analysis systems that do likewise work with much simpler domains (for example, Ground Prolog [9] recognizes only two instantiation states, free and ground) Other related work has been on mode checking for concurrent logic programming languages and for logic programming languages with coroutining [1, 5, 7]: there the emphasis has been on detecting communication patterns and possible deadlocks. The only other constraint based mode analysis we are aware of is that of Moded Flat GHC [4] Moded Flat GHC relies on position in the clause (in the head or guard versus in the body) to determine if a ....
....implied by pm. In practice, the compiler generates code for a mode only if it is declared or it is a principal mode, and synthesizes the other modes in the caller by renaming variables and inserting extra unifications. This synthesis does the superhomogeneous form equivalent of replacing append([1], 2] 3] with append( 1] 2] X) X = 3] Each solution also implicitly assign modes to the primitive goals in the body, by specifying where each variable is produced. For example, the solution that assigns true to the constraint variables C# , C d 1 , C d 1 .c 2 , C d 2 , AH d 2 .c 1 , AT d ....
[Article contains additional citation context not shown here]
J. Boye and J. Maluszynski. Directional types and the annotation method. JLP, 33(3):179--220, 1997.
....programming language [13] This system, however, lacked exibility and precision (some improvements have been proposed for example in [11] As a practical consequence many program errors were not detected. Another approach due to Aiken and Lakshman is based on the notion of a directional type [5, 1, 4, 3, 18] which distinguished input and output types of a predicate. This system is much more precise, it captures both procedural and declarative properties of logic programs, provides a good facility to describing data ow in a program but its usefulness is limited by the lack of polymorphism. Moreover, ....
....inference in the Aiken Lakshman system was studied by Charatonik and Podelski [7] who gave an algorithm for the inferring directional types. Charatonik [6] showed that directional type checking is EXPTIME complete. Types in the Aiken Lakshman system are not polymorphic. J. Boye and J. Mauszyski in [3, 4] designed a system where directional types are merged with polymorphic types of terms. In our type system input and output types are not regular sets. To describe them we follow the notion of a polymorphic type taken from [16] and [14] Types of terms are constructed from variables and type ....
J. Boye and J. Mauszyski. Directional types and the annotation method. Journal of Logic Programming, 33(3):179220, 1997.
....is not (in general) a superset of M P . Instead it is a superset of M P pre. We may say that a declarative speci cation speci es M P (or M P [ pre) while the postcondition of a call success speci cation speci es M P pre. Dra99] shows an example (similar examples can be found e.g. in [BM97] where a rather natural declarative speci cation is of the form spec = T i pre i post i . The natural method works, as spec j= P . A corresponding precondition pre (so that M P pre is the well typed part of M P ) is constructed out of interpretations pre i by means of [ But under ....
....termination and is equipped with a tool to mechanically verify the proofs. It is however bound to Prolog selection rule and does not seem to support separation of correctness, completeness and termination. An approach related to ours is the annotation method of Deransart [Der93, Section 4] BM97, Section 4] for proving de nite program correctness. It can be seen as a re nement of the natural method of Section 3.1, decomposing the implications to be proved into smaller ones. An important work on constructing correct logic programs is [Dev90] Our approach to speci cations is related to ....
J. Boye and J. Ma luszynski. Directional types and the annotation method. Journal of Logic Programming, 33(3):179-220, 1997.
....are optional in Laptob. In glueing together modules to assemble language processors, one can disable type checking within certain modules if necessary. 2.5 Modes Many sorted or even polymorphic types provide just one dimension of typing in logic programming. We also employ modes or directions [6] for parameter positions of predicates. As for Laptob, two basic modes are relevant, namely and for input or output positions, respectively. In Figure 7, the modes for the predicates involved in the various phases of our running example are shown. We use again goal clauses based on ....
J. Boye and J. Maluszynski. Directional Types and the Annotation Method. Journal of Logic Programming, 33(3):179--220, December 1997.
.... integer arguments . So we have to discover which arguments are integer arguments. In simple programs this is immediate, but there may be more complicated cases. The inference of integer arguments is done in two phases bottom up and top down. Bottom up inference is similar to type analysis (cf. [8,5]) using the abstract domain fint; not intg and the observation that an argument may became int only if it is obtained from is 2 or is bound to an integer expression of arguments already found to be int (i.e. the abstraction of int int is int) Top down inference is query driven and is similar ....
Johan Boye and Jan Ma/luszy'nski. Directional types and the annotation method. Journal of Logic Programming, 33(3):179--220, 1997.
....the subsequent sections is based on the size relationships between numerical arguments . These are arguments that are numerical for all subqueries generated from the initial query. The inference is done in two phases bottom up and top down. Bottom up inference is similar to type analysis (cf. [7, 11]) using the abstract domain fint; not intg and the observation that an argument may became int only if it is obtained from is 2 or is bound to an integer expression of arguments already found to be int (i.e. the abstraction of int int is int) Topdown inference is query driven and is similar to ....
J. Boye and J. Ma/luszy'nski. Directional types and the annotation method. Journal of Logic Programming, 33(3):179--220, 1997.
.... is a simple type dependency analysis for logic programs based on set based (ACI ) uni cation [2, 36] which is described in [18] This domain characterizes the dependencies between the types of the terms that can be bound to a program s variables and generalizes the notion of directional types [1, 7]. The analysis is performed in two stages. First, a given program P is abstracted to a corresponding set logic program P in which each of the concrete terms from P is replaced by a (possibly non ground) type expression. A type expression is a at set (where nested sets are viewed as ....
J. Boye and J. Ma luszynski. Directional Types and the Annotation Method. Journal of Logic Programming, 33(3):179-220, Dec. 1997.
.... con satisfied con var customer var var product var var price var con pay con var customer var var merchant var var price var 6 FL Programming Exempli ed by Binary Tree Relabeling Generalizing the maxtree problem solved purely relationally in [BM97] we consider a relabeling transformation for labeled binary trees speci ed thus (note partial data structure) Let al..l void (sub)trees have the user provided binding Mixvoid and the value void. For a non void (sub)tree with some Label assume that the bindings of its Left and Right subtrees ....
....of the whole tree via its duplicate top level use. R2) While the de nition itself appears (ground )deterministic, its Terfun parameter can import a non deterministic function, causing overall non determinism (see second sample call below) For example, simulating the maxtree relation in [BM97] we can employ a (built in) maximum function as a parameter of the mixtree function, as in the call mixtree[max,0] tree[2, tree[5, tree[3,void,void] tree[4,tree[7,void,void] tree[1,void,void] tree[1,tree[4,void,void] tree[8,void,void] returning the following max relabeled tree (for ....
Johan Boye and Jan Maluszynski. Directional types and the annotation method. Journal of Logic Programming, 33(3):179-220, December 1997.
....strictly stronger than the declarative specification. Often a desired property is conveniently expressed by a declarative specification pre post (or by intersection 7 of some such specifications) but the selected atoms are not in pre. In such a case the operational method is inapplicable (conf. [BM97]) We illustrate this by an example, where under any selection rule the precondition does not hold. Let us consider the following program P . p(X,Y) q(X,W,Z,Y) q(Z, W, q(X,Y,X,Y) This program is artificial, however it is an abstraction of two pass programs and of certain usages of ....
....the precondition does not hold. Let us consider the following program P . p(X,Y) q(X,W,Z,Y) q(Z, W, q(X,Y,X,Y) This program is artificial, however it is an abstraction of two pass programs and of certain usages of difference lists. Some examples of such programs can be found e.g. in [BM97]) Let (t) stands for t is a list , for a possibly non ground term t. Let pre p = f p(t ; s) j (t) g post p = f p(t; s) j (s) g pre q = f q(t; s; u; v) j (t) g post q = f q(t; s; u; v) j (u) g pre 0 q = f q(t; s; u; v) j (s) g post 0 q = f q(t; s; u; v) j (v) g pre = pre p [ pre q pre ....
[Article contains additional citation context not shown here]
J. Boye and J. Ma/luszy'nski. Directional types and the annotation method. Journal of Logic Programming, 33(3):179--220, 1997.
....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 types form a type system for logic programs which is based on the view of a predicate as a directional procedure which, when applied to a tuple of input terms, generates a tuple of output terms. They rst occurred in [50] as predicate pro les and in [9] as mode ....
....to compute query and answer predicates for each predicate in the given program, which is essentially the same as our type program. Then they approximate the success set of the new predicates with ground, regular and tupledistributive sets, which they do not call types. Boye in [6] see also [7, 8]) presents a procedure that infers directional types for logic programs. The procedure is not 5 fully automatic (sometimes it requires an interaction with the user) it requires the set of possible types to be nite, and no complexity analysis is given. In our approach, any regular set of terms ....
J. Boye and J. Maluszynski. Directional types and the annotation method. Journal of Logic Programming, 33(3):179-220, Dec. 1997.
....by the meta programming framework in the sense that welltypedness is enforced. For untyped languages like Prolog, still a kind of conceptual well typedness in the sense of 1. should be enforced. The notion of typing we use corresponds, essentially, to many sorted (like in Godel [9] directional [4] types. Note however, that the framework is not restricted to typed logic programs as explained above. Technically, a type of a program or some fragment is just a collection of profiles for the symbols in the program as modelled by Sigma: Sigma = P (Operator Theta (Selector Theta Mode Theta ....
J. Boye and J. Maluszynski. Directional Types and the Annotation Method. Journal of Logic Programming, 33(3):179--220, Dec. 1997.
....question of how large is the class of intrinsically logical programs. Without pretending to be able to characterize extensively this limit, it is interesting to notice that programs which are plain and consistent and which either admit a Layered Mode [EG96] or are S well typed programs [BM97] are safely translatable into Haskell (modulo the possibility of backtracking, which is discussed in the sequel) As argued in [EG96] we believe that these programs actually encompass the majority of actual programs which use logical variables in a non elementary way. We think that a classi ....
.... output to start with) so in order to implement such an intelligent selection strategy, one would need some sophisticated analysis tools which might either be based on abstract interpretation (with tools similar to the ones of [CDG93] or on re ned versions of modes such as the ones described in [BM97, EG96]. Other works related to this subjects are [LK92, EvR98] 17 We have also discussed the fact that logic programs allow backtracking. We have seen that strictly speaking backtracking computations can be easily mimicked by the functional language by an appropriate use of the guards; what ....
J. Boye and J. Ma luszynski. Directional types and the annotation method. Journal of Logic Programming, 33:179-220, 1997.
....to compute query and answer predicates for each predicate in the given program, which is essentially the same as our type program. Then they approximate the success set of the new predicates with ground, regular and tupledistributive sets, which they do not call types. Boye in [5] see also [6, 7]) presents a procedure that infers directional types for logic programs. The procedure is not fully automatic (sometimes it requires an interaction with the user) it requires the set of possible types to be finite, and no complexity analysis is given. In our approach, any regular set of terms is ....
J. Boye and J. Maluszynski. Directional types and the annotation method. Journal of Logic Programming, 33(3):179--220, Dec. 1997.
....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 system for logic programs which is based on the view of a predicate as a directional procedure which, when applied to a tuple of input terms, generates a tuple of output terms. They rst occurred in [32] as predicate pro les and in [8] as mode dependencies. Our use ....
J. Boye and J. Maluszynski. Directional types and the annotation method. Journal of Logic Programming, 33(3):179-220, Dec. 1997. 13
....the subsequent sections is based on the size relationships between numerical arguments . These are arguments that are numerical for all subqueries generated from the initial query. The inference is done in two phases bottom up and top down. Bottom up inference is similar to type analysis (cf. [10, 7]) using the abstract domain fint; not intg and the observation that an argument may became int only if it is obtained from is 2 or is bound to an integer expression of arguments already found to be int (i.e. the abstraction of int int is int) Topdown inference is query driven and is similar to ....
J. Boye and J. Ma/luszy'nski. Directional Types and the Annotation Method. Journal of Logic Programming, 33(3):179--220, 1997.
....We assume programs are annotated with: 1 ffl Type declarations: polymorphic types [15] ffl Mode declarations: one mode for each predicate which declares how the arguments are instantiated upon calling the predicate and upon exiting the predicate. They are called directional types in [1, 2, 17]. ffl Determinism declarations: whether a call to a predicate selects at most one clause (deterministic selection) and whether upon exiting the predicate, choice points are left (deterministic solution) Finally, we assume clauses are normalised, i.e. of the form q(X 1 ; X n ) Gamma ....
J. Boye and J. Ma/luszy'nski. Directional types and the annotation method. J. of Logic Programming, to appear.
....specification, it preserves however the correctness w.r.t. a declarative specification. Often a desired property is conveniently expressed by a declarative specification pre post but the selected atoms are not in pre. In such a case the approaches of [Apt97, PR97] are inapplicable (conf. [BM97]) To illustrate this by an example, let us consider the following program P . p(X,Y) q(X,W,Z,Y) q(Z, W, q(X,Y,X,Y) This program is artificial, however it is an abstraction of two pass programs and of certain usages of difference lists. Some examples of such programs could be found ....
....illustrate this by an example, let us consider the following program P . p(X,Y) q(X,W,Z,Y) q(Z, W, q(X,Y,X,Y) This program is artificial, however it is an abstraction of two pass programs and of certain usages of difference lists. Some examples of such programs could be found e.g. in [BM97]) Let (t) stands for t is a list , for a possibly non ground term t. Let pre p = f p(t ; s) j (t) g post p = f p(t; s) j (s) g pre q = f q(t; s; u; v) j (t) g post q = f q(t; s; u; v) j (u) g pre 0 q = f q(t; s; u; v) j (s) g post 0 q = f q(t; s; u; v) j (v) g pre = pre p [ pre q pre ....
[Article contains additional citation context not shown here]
J. Boye and J. Ma/luszy'nski. Directional Types and the Annotation Method. Journal of Logic Programming, 1997, to appear.
....trade off between expressibility and decidability. In fact they are strictly more expressive than regular languages, but strictly contained in contextfree languages (which have an undecidable subset relation) Our main references are the papers of Dart and Zobel [10, 11] and Boye and Maluszynski [3, 2]. A regular term grammar is a tuple G = Sigma; V; T;R) where Sigma is a set of function symbols, V is an infinite denumerable set of variables, T is a finite set of type symbols, including var and any , and R is a finite set of rules l r where l 2 (T=fvar; anyg) r 2 Terms( Sigma; ....
....fact in [18] it is proposed a proof procedure to decide the validity of formulas 9( 1 Delta Delta Delta n ) where each atom i is an atom var (t) ground(t) share(t 1 ; t n ) or its negation. It is also known that the implication between regular types is decidable. In fact in [3, 2] a procedure is proposed to decide the validity of implications like 8(p T1 (t 1 ) Delta Delta Delta pTn (t n ) pT (t) It is not clear whether putting them together and considering the full first order theory, such as in L, the language is still decidable. In this section we will show that ....
J. Boye and J. Maluszynski. Directional Types and the Annotation Method. Journal of Logic Programming, 33(3):179--220, 1997.
....is strictly stronger than the declarative specification. Often a desired property is conveniently expressed by a declarative specification pre post (or by intersection of some such specifications) but the selected atoms are not in pre. In such a case the operational method is inapplicable (conf. [BM97]) We illustrate this by an example, where under any selection rule the precondition does not hold Let us consider the following program P . p(X,Y) q(X,W,Z,Y) q(Z, W, q(X,Y,X,Y) This program is artificial, however it is an abstraction of two pass programs and of certain usages of ....
....the precondition does not hold Let us consider the following program P . p(X,Y) q(X,W,Z,Y) q(Z, W, q(X,Y,X,Y) This program is artificial, however it is an abstraction of two pass programs and of certain usages of difference lists. Some examples of such programs could be found e.g. in [BM97]) Let (t) stands for t is a list , for a possibly non ground term t. Let pre p = f p(t ; s) j (t) g post p = f p(t; s) j (s) g pre q = f q(t; s; u; v) j (t) g post q = f q(t; s; u; v) j (u) g pre 0 q = f q(t; s; u; v) j (s) g post 0 q = f q(t; s; u; v) j (v) g pre = pre p [ pre q ....
[Article contains additional citation context not shown here]
J. Boye and J. Ma/luszy'nski. Directional types and the annotation method. Journal of Logic Programming, 33(3):179--220, 1997.
....and linked to the correctness framework discussed in this paper. Our type specifications are similar to directional types for logic programs (see e.g. 3] In the traditional approach the directional types are only linked with the operational semantics of logic programs. A more recent work of [5] shows a variant of directional types for LP linked with the least model semantics. Different notions of type correctness introduced in this paper make our type specifications applicable both to operational semantics and to the least D model semantics of CLP. We want to reconstruct type ....
....straihtforward sufficient condition for the computational type correctness. If satisfied, it also guarantees the declarative type correctness. The presented method is an adaptation to CLP of the proof techniques proposed for logic programming in [15, 12] Similar techniques has been also used in [3, 1, 2, 4, 5] for dealing with directional types in logic programming. The method consists in checking for each clause of the program a finite number of verification conditions obtained from a given type specification. We then discuss the requirements for automatic checking of the conditions and for using them ....
[Article contains additional citation context not shown here]
J. Boye and J. Maluszynski. Directional types and the annotation method. Journal of Logic Programming, 19(3):133-181, 1997.
....papers [19, 21] contain examples where they compute for each predicate p a pair of sets Call p and Ret p , which can be viewed as (ground) directional type Call p Ret p . We are not aware, however, of a general, formal treatment of directional types inference in their work. Boye in [5] see also [6, 7]) presents a procedure that infers directional types for logic programs. The procedure is not fully automatic (sometimes it requires an interaction with the user) it requires the set of possible types to be finite, and no complexity analysis 1 For regular sets of ground terms, all four notions: ....
J. Boye and J. Maluszynski. Directional types and the annotation method. Journal of Logic Programming, 33(3):179--220, Dec. 1997.
....Such a specification associates with every predicate a pair of sets that characterize, respectively, expected calls and successes of the predicate. Checking correctness of a logic program wrt directional types has been discussed by several authors (see e.g. Aiken Lakshman, 1994; Boye, 1996; Boye Ma luszy nski, 1997; Charatonik Podelski, 1998) and references therein) Their proposals can be seen as special cases of general verification methods of (Drabent Ma luszy nski, 1988; Bossi Cocco, 1989; Deransart, 1993) Technically, directional type checking consists in proving that the sets specified by given ....
....and on abstract interpretation. It extends some of the techniques proposed in these fields to handle parametric polymorphism and constraint domains. Partial correctness. From (Bronsard et al. 1992; Apt, 1993; Bossi Cocco, 1989) and our own previous work (Drabent Ma luszy nski, 1988; Boye Ma luszy nski, 1997) we extend to CLP a directional view of logic programs in the sense that each predicate is considered a procedure which, when applied to a suitable tuple of call arguments returns upon a success a tuple of computed values. This is formalized by the notion of call success semantics. We rely on the ....
Boye, J., & Ma/luszy'nski, J. (1997). Directional types and the annotation method. Journal of Logic Programming, 33(3), 179--220.
....of a predicate is a priori determined as input or as output with type information. In this case type checking reduces to verification of a few conditions for each program clause. The starting point for development of a tool based on this approach may be the previous work done for logic programs [BM97] and for a subset of Prolog III [Vet94] 5.5 Analysers An analyser infers properties of programs. With the use of abstract interpretation techniques the properties inferred are restricted to those defined by the underlying abstract domain. A very important task for achieving flexibility is thus ....
J. Boye and J. Ma/luszy'nski. Directional types and the annotation method. Journal of Logic Programming, 1997. (in print).
....some well known concepts and techniques which are adapted to the needs of constraint programming. In particular some most relevant related work includes ffl the methods for proving run time properties of logic programs of [DM88, Dra88, BC89] and their specialisations to directional types [AM94, BM97] We adapt them to the case of a call success semantics suitable for CLP. We formulate sufficient conditions for partial correctness. For a given program and a given specification we obtain a (finite) number of verification conditions. Each of them is linked to a clause. If the program is not ....
....future work. Another case where the left to right call success semantics may not be the best suitable concerns the use of logical variable. The user may not be interested in the actual calls but rather in the successes related to initial calls. We illustrate this by the example originating from [BM97] Example 6.3 The following CHIP program analyzes a binary tree T with nodes labeled by integers and constructs a binary tree NT of the same shape with all nodes labeled by the maximal label of T . The program includes a type declaration acceptable by our diagnoser. typedef tree(A) void; ....
[Article contains additional citation context not shown here]
J. Boye and J. Ma/luszy'nski. Directional types and the annotation method. Journal of Logic Programming, 33(3):179--220, 1997.
No context found.
J. Boye and J. Ma/luszy'nski. Directional types and the annotation method. Journal of Logic Programming, 33(3):179--220, 1997.
First 50 documents
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