## Type Dependencies for Logic Programs using ACI-unification (1996)

### Cached

### Download Links

- [ftp.cs.bgu.ac.il]
- [www.cs.bgu.ac.il]
- [ftp.cs.bgu.ac.il]
- DBLP

### Other Repositories/Bibliography

Venue: | In Proceedings of the 1996 Israeli Symposium on Theory of Computing and Systems |

Citations: | 43 - 8 self |

### BibTeX

@INPROCEEDINGS{Codish96typedependencies,

author = {Michael Codish and Vitaly Lagoon},

title = {Type Dependencies for Logic Programs using ACI-unification},

booktitle = {In Proceedings of the 1996 Israeli Symposium on Theory of Computing and Systems},

year = {1996},

pages = {136--145},

publisher = {IEEE Press}

}

### OpenURL

### Abstract

This paper presents a new notion of typing for logic programs which generalizes the notion of directional types. The generation of type dependencies for a logic program is fully automatic with respect to a given domain of types. The analysis method is based on a novel combination of program abstraction and ACI-unification which is shown to be correct and optimal. Type dependencies are obtained by abstracting programs, replacing concrete terms by their types, and evaluating the meaning of the abstract programs using a standard semantics for logic programs enhanced by ACI-unification. This approach is generic and can be used with any standard semantics. The method is both theoretically clean and easy to implement using general purpose tools. The proposed domain of types is condensing which means that analyses can be carried out in both top-down or bottom-up frameworks with no loss of precision for goal-independent analyses. The proposed method has been fully implemented within a bottom-up approach and the experimental results are promising.

### Citations

2078 |
Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints
- Cousot, Cousot
- 1977
(Show Context)
Citation Context ...lists of types). At the end of the paper (in Example 15) we come back to this example and illustrate how we propose to express type dependencies of this sort. The framework of abstract interpretation =-=[20]-=- provides the basis for a semantic approach to dataflow analysis. A program analysis is viewed as a nonstandard, abstract semantics defined over a domain of data descriptions. An abstract semantics is... |

1949 |
Foundations of Logic Programming
- Lloyd
- 1987
(Show Context)
Citation Context ...hich was inspired by the earlier work presented in [14]. 2 Preliminaries Syntax: In the following we assume a familiarity with the standard definitions and notation for logic programs as described in =-=[35, 2]-=-. For any set of function symbols \Sigma and variables V, we let T (\Sigma; V) denote the set of terms constructed using symbols from \Sigma and variables from V. Substitutions are mappings from V to ... |

650 |
The Art of Prolog
- Sterling, Shapiro
- 1986
(Show Context)
Citation Context ...(tree(X ; L; R); Xs) / postorder(L; Ls); postorder(R; Rs); append(Rs; [X ]; Rs1); append(Ls; Rs1; Xs): postorder(void ; [ ]): which performs the post-order traversal of a binary tree (Program 3.27 in =-=[30]-=-) and its corresponding abstraction as obtained using Equation (10): postorder(tree \Phi L \Phi R; Xs) / postorder(L; Ls); postorder(R; Rs); append(Rs; list ; Rs1); append(Ls; Rs1; Xs): postorder(tree... |

613 |
A lattice-theoretical fixpoint theorem and its application
- Tarski
- 1955
(Show Context)
Citation Context ...t I = max \Phi I 1 ; : : : ; In \Psi . Then h ff 2 TP (I) and TP (I)sS TP (K). 2 Corollary 5.2 The least fixpoint of TP exists and lfp(T P ) = [ n2! (T P ) n (;): Proof. By the Knaster-Tarski theorem =-=[42]-=-. 2 We prove that least fixed point of TP correctly approximates the atoms contained in the least fixed point of TP . 18 Theorem 5.3 (safety) 8I 2 (BV ) : TP (ff(I)) / TP (I): Proof. Assume there is a... |

438 |
Introduction to logic programming
- Apt
- 1990
(Show Context)
Citation Context ...hich was inspired by the earlier work presented in [14]. 2 Preliminaries Syntax: In the following we assume a familiarity with the standard definitions and notation for logic programs as described in =-=[35, 2]-=-. For any set of function symbols \Sigma and variables V, we let T (\Sigma; V) denote the set of terms constructed using symbols from \Sigma and variables from V. Substitutions are mappings from V to ... |

320 |
Magic sets and other strange ways to implement logic programs
- Bancilhon, Maier, et al.
- 1986
(Show Context)
Citation Context ... of a given program and that this information can be used to approximate the answers for arbitrary initial goals. It is straightforward to obtain also information about call patterns using Magic Sets =-=[6]-=- as described for example in [14, 15]. Symbolic types are condensing: Jacobs and Langen [29] prove that topdown and bottom-up (as well as goal-dependent and goal-independent) analyses are guaranteed t... |

243 | Hope theory
- Snyder
- 2002
(Show Context)
Citation Context ...action which replaces concrete program terms by their types. The meaning of programs involving type expressions is formalized by enhancing a standard semantics for logic programs with ACI-unification =-=[4]-=-. As a consequence, type inference is reduced to evaluating the meaning of an abstract program. No additional proof theory, no special inference rules and no special inference procedures are required.... |

161 | Semantic domains
- Gunter, Scott
- 1990
(Show Context)
Citation Context ...The abstract domain for type analysis is formalized as a domain of sets of abstract atoms with a suitable notion of ordering and equivalence. We consider the lower power domain (or Hoare power domain =-=[27]-=-) with the ordering defined as I 1sI 2 , 8 1 2 I 1 9 2 2 I 2 :s1s2 : (7) The corresponding equivalence relation: I 1sI 2 , (I 1sI 2 )s(I 2sI 1 ) (8) induces a partial order on [(B ff V )]s. The elemen... |

120 | The s-semantics approach: theory and applications
- Bossi, Gabbrielli, et al.
- 1994
(Show Context)
Citation Context ...c and independent of any particular (e.g. top-down or bottom-up) concrete semantic definition. Examples will be given within a bottom-up approach based on abstractions of the s-semantics described in =-=[21, 22, 8]-=- which is a nonground version of the standard minimal model semantics for logic programs. The s-semantics of a program P is a set of possibly non-ground atoms which characterizes both declarative as w... |

116 |
Declarative Modeling of the Operational Behavior of Logic Languages
- Falaschi, Levi, et al.
- 1989
(Show Context)
Citation Context ...c and independent of any particular (e.g. top-down or bottom-up) concrete semantic definition. Examples will be given within a bottom-up approach based on abstractions of the s-semantics described in =-=[21, 22, 8]-=- which is a nonground version of the standard minimal model semantics for logic programs. The s-semantics of a program P is a set of possibly non-ground atoms which characterizes both declarative as w... |

103 | Fast and Precise Regular Approximations of Logic Programs
- Gallagher, Waal
- 1994
(Show Context)
Citation Context ...t using general purpose tools. The idea of obtaining static analyses by program abstraction is derived from ideas presented in [28, 19, 26, 15, 14] and has been applied in a variety of contexts, e.g. =-=[44, 23, 7, 25, 24]-=-. Unique to our approach is the combination of a simple syntax directed program abstraction and a standard equality theory for type expressions. We pay special attention to the role of variables in ab... |

100 |
Logic programs as types for logic programs
- Frühwirth, Shapiro, et al.
- 1991
(Show Context)
Citation Context ...t using general purpose tools. The idea of obtaining static analyses by program abstraction is derived from ideas presented in [28, 19, 26, 15, 14] and has been applied in a variety of contexts, e.g. =-=[44, 23, 7, 25, 24]-=-. Unique to our approach is the combination of a simple syntax directed program abstraction and a standard equality theory for type expressions. We pay special attention to the role of variables in ab... |

92 |
Static Analysis of Logic Programs for Independent And-Parallelism
- Jacobs, Langen
- 1992
(Show Context)
Citation Context ...bitrary initial goals. It is straightforward to obtain also information about call patterns using Magic Sets [6] as described for example in [14, 15]. Symbolic types are condensing: Jacobs and Langen =-=[29]-=- prove that topdown and bottom-up (as well as goal-dependent and goal-independent) analyses are guaranteed to be equally precise when they involve an abstract unification algorithm which is idempotent... |

82 |
A uni algorithm for associative-commutative functions
- Stickel
- 1981
(Show Context)
Citation Context ...ifies tuples of ACI-terms, e.g. h 1 ; : : : ;sn i with h 0 1 ; : : : ;s0 n i thus solving systems of ACI-equations. This algorithm as well as all other published algorithms of general ACI-unification =-=[41]-=- computes a complete but not necessary minimal set of unifiers. Of course a minimal complete set of unifiers can be obtained in a second phase by choosing the most general unifiers from the computed s... |

79 | Global Flow Analysis as a Practical Compilation Tool
- Hermenegildo, Warren, et al.
- 1992
(Show Context)
Citation Context ...romising technique which is both theoretically clean and easy to implement using general purpose tools. The idea of obtaining static analyses by program abstraction is derived from ideas presented in =-=[28, 19, 26, 15, 14]-=- and has been applied in a variety of contexts, e.g. [44, 23, 7, 25, 24]. Unique to our approach is the combination of a simple syntax directed program abstraction and a standard equality theory for t... |

69 |
A Model-theoretic Reconstruction of the Operational Semantics of Logic Programs
- Falaschi, Levi, et al.
- 1993
(Show Context)
Citation Context ...c and independent of any particular (e.g. top-down or bottom-up) concrete semantic definition. Examples will be given within a bottom-up approach based on abstractions of the s-semantics described in =-=[21, 22, 8]-=- which is a nonground version of the standard minimal model semantics for logic programs. The s-semantics of a program P is a set of possibly non-ground atoms which characterizes both declarative as w... |

58 | Bottom-up Abstract Interpretation of Logic Programs
- Codish, Dams, et al.
- 1990
(Show Context)
Citation Context ...n 2 P; ha1 ; : : : ; ani !!C I; ` = mgu(hb1 ; : : : ; bni; ha1 ; : : : ; an i) ) (1) As a basis for designing program analyses, the s-semantics has proven particularly useful (see for example [5] and =-=[13]-=-). This is due to the fact that on the one hand, it captures both declarative as well as operational properties, and on the other hand because of the mathematical simplicity of its definition. An impo... |

57 | H.: Precise and efficient groundness analysis for logic programs
- Marriott, Søndergaard
- 1993
(Show Context)
Citation Context ... notion of directional types. The key idea is to express the dependencies between the types of a predicates arguments similar to the way groundness dependencies are expressed in the P os domain (e.g. =-=[15, 36]-=-). Type dependencies are first mentioned in [31] and are reminiscent of the implication types of [39]. As a typical example, consider the following directed type for the well-known append relation whi... |

55 | A framework of directionality for proving termination of logic programs
- Bronsard, Lakshman, et al.
(Show Context)
Citation Context ...cle (see for example [38]). Recently there has been a growing interest in the notion of directional types for logic programs which combine types and modes. Directional types, originally considered in =-=[40, 11]-=- and more recently in [1, 3, 37, 10, 9], have proven useful in applications such as proving termination of programs and controlling execution of programs through a delay mechanism. Directional types h... |

44 | Directional type checking of logic programs
- Aiken, Lakshman
- 1994
(Show Context)
Citation Context ...cently there has been a growing interest in the notion of directional types for logic programs which combine types and modes. Directional types, originally considered in [40, 11] and more recently in =-=[1, 3, 37, 10, 9]-=-, have proven useful in applications such as proving termination of programs and controlling execution of programs through a delay mechanism. Directional types have a declarative aspect as well as an ... |

39 | Deriving polymorphic type dependencies for logic programs using multiple incarnations of prop
- Codish, Demoen
- 1994
(Show Context)
Citation Context ...romising technique which is both theoretically clean and easy to implement using general purpose tools. The idea of obtaining static analyses by program abstraction is derived from ideas presented in =-=[28, 19, 26, 15, 14]-=- and has been applied in a variety of contexts, e.g. [44, 23, 7, 25, 24]. Unique to our approach is the combination of a simple syntax directed program abstraction and a standard equality theory for t... |

39 |
Analysing logic programs using "Prop"-ositional logic programs and a magic wand, in
- Codish, Demoen
- 1993
(Show Context)
Citation Context ...romising technique which is both theoretically clean and easy to implement using general purpose tools. The idea of obtaining static analyses by program abstraction is derived from ideas presented in =-=[18, 12, 17, 11, 10]-=- and has been applied in a variety of applications [32, 14, 16, 15]. Unique to our approach is the combination of a simple syntax directed program abstraction for types and a standard equality theory ... |

33 | A Generalized Semantics for Constraint Logic Programs
- Giacobazzi, Debray, et al.
- 1992
(Show Context)
Citation Context ...romising technique which is both theoretically clean and easy to implement using general purpose tools. The idea of obtaining static analyses by program abstraction is derived from ideas presented in =-=[28, 19, 26, 15, 14]-=- and has been applied in a variety of contexts, e.g. [44, 23, 7, 25, 24]. Unique to our approach is the combination of a simple syntax directed program abstraction and a standard equality theory for t... |

26 |
Complexity of unification problems with associative-commutative operators
- Kapur, Narendran
- 1992
(Show Context)
Citation Context ...set always exists and has cardinalitys1. For ACI-unification, a minimal 5 complete set always exists and is finitary [4]. The underlying decision problem of ACI-unification is in general, NP-complete =-=[30]-=-. The algorithms for ACIunification which are described in the literature compute a complete set of ACIunifiers which is in general not minimal. For efficiency in applications which use these unifiers... |

24 |
A type inference system for Prolog
- Xu, Warren
- 1988
(Show Context)
Citation Context ...t using general purpose tools. The idea of obtaining static analyses by program abstraction is derived from ideas presented in [28, 19, 26, 15, 14] and has been applied in a variety of contexts, e.g. =-=[44, 23, 7, 25, 24]-=-. Unique to our approach is the combination of a simple syntax directed program abstraction and a standard equality theory for type expressions. We pay special attention to the role of variables in ab... |

23 | Two aspects of directional types
- Boye, Maluszynski
- 1995
(Show Context)
Citation Context ...cently there has been a growing interest in the notion of directional types for logic programs which combine types and modes. Directional types, originally considered in [40, 11] and more recently in =-=[1, 3, 37, 10, 9]-=-, have proven useful in applications such as proving termination of programs and controlling execution of programs through a delay mechanism. Directional types have a declarative aspect as well as an ... |

22 | Declarative Programming in Prolog
- Apt
- 1993
(Show Context)
Citation Context ...cently there has been a growing interest in the notion of directional types for logic programs which combine types and modes. Directional types, originally considered in [40, 11] and more recently in =-=[1, 3, 37, 10, 9]-=-, have proven useful in applications such as proving termination of programs and controlling execution of programs through a delay mechanism. Directional types have a declarative aspect as well as an ... |

22 | EÆcient Goal Directed Bottom-up Evaluation of Logic Programs
- Codish
- 1999
(Show Context)
Citation Context ...Prolog interpreter described in Appendix B. Several additional optimizations have been introduced to the actual prototype: We have based the analysis on a semi-naive interpreter which is described in =-=[12]-=-. For goal-dependent analysis, we used the interpreter for induced Magic Sets described in [12] as an alternative to applying the Magic Sets transformation. The implementation is small, consisting of ... |

22 |
Abstract Interpretation of Logic Programs: an Abstract Domain for Groundness, Sharing, Freeness and Compoundness Analysis
- Cortesi, Filè
- 1991
(Show Context)
Citation Context |

22 | Adventures in Associative-Commutative Unification
- Lincoln, Christian
- 1989
(Show Context)
Citation Context ... and by Theorem 4.6 contains no other elements. 2 ACI-unification algorithm: The algorithm of ACI-unification used in our implementation is a simplification of the more general algorithm described in =-=[34]-=-. The advantage of this algorithm is that it allows lazy generation of solutions and is easily implemented in declarative languages such as Prolog taking advantage of built-in backtracking. The algori... |

21 | An Algebraic Approach to Sharing Analysis of Logic Programs - Codish, Lagoon, et al. |

20 |
Types and the intended meaning of logic programs
- NAISH
- 1992
(Show Context)
Citation Context ...= list \Phi list \Phi type([ ]) = list \Phi list \Phi list = list : A well-known but often overlooked particularity of logic programs is that their formal semantics often include "unintended"=-=; objects [25]-=-. Consider again the append relation of Example 1 which is intended to describe a relation on lists. We should not forget that the minimal model of this program contains also atoms of the form append(... |

19 |
A bottom-up polymorphic type inference in logic programming
- Barbuti, Giacobazzi
- 1992
(Show Context)
Citation Context |

18 |
Integrating modes and subtypes into a prolog type-checker
- Rouzaud, Nguyen-Phuong
- 1992
(Show Context)
Citation Context ...cle (see for example [38]). Recently there has been a growing interest in the notion of directional types for logic programs which combine types and modes. Directional types, originally considered in =-=[40, 11]-=- and more recently in [1, 3, 37, 10, 9], have proven useful in applications such as proving termination of programs and controlling execution of programs through a delay mechanism. Directional types h... |

17 |
Directional types in logic programming
- Boye
- 1996
(Show Context)
Citation Context |

16 |
Inference of Polymorphic Types for Logic Programs
- Pyo, Reddy
- 1989
(Show Context)
Citation Context ...es arguments similar to the way groundness dependencies are expressed in the P os domain (e.g. [15, 36]). Type dependencies are first mentioned in [31] and are reminiscent of the implication types of =-=[39]-=-. As a typical example, consider the following directed type for the well-known append relation which specifies that the result of concatenating two lists of elements of typesis a list of elements of ... |

13 | Analyzing logic programs using "prop"-ositional logic programs and a magic wand - Codish, Demoen - 1995 |

12 | A First-order Theory of Types and Polymorphism in Logic Programming
- Wu
- 1992
(Show Context)
Citation Context ...ress the dependencies between the types of a predicates arguments similar to the way groundness dependencies are expressed in the P os domain (e.g. [15, 36]). Type dependencies are first mentioned in =-=[31]-=- and are reminiscent of the implication types of [39]. As a typical example, consider the following directed type for the well-known append relation which specifies that the result of concatenating tw... |

11 | An Application of Constraint Propagation to Data-flow Analysis
- Bagnara, Giacobazzi, et al.
- 1993
(Show Context)
Citation Context ... : : ; bn 2 P; ha1 ; : : : ; ani !!C I; ` = mgu(hb1 ; : : : ; bni; ha1 ; : : : ; an i) ) (1) As a basis for designing program analyses, the s-semantics has proven particularly useful (see for example =-=[5]-=- and [13]). This is due to the fact that on the one hand, it captures both declarative as well as operational properties, and on the other hand because of the mathematical simplicity of its definition... |

8 |
Type inference by program transformation and partial evaluation
- Frühwirth
- 1988
(Show Context)
Citation Context |

4 |
A proof method for run-time properties of Prolog programs
- Pedreschi
- 1994
(Show Context)
Citation Context |

3 |
A directional type system for Prolog: Unifying notions of types and directionality
- Lakshman, Reddy, et al.
- 1994
(Show Context)
Citation Context ...srael Collaboration Activity ISC-IL-90. terest in the notion of directional types for logic programs which combine types and modes. Directional types, originally proposed in [29] and more recently in =-=[1, 22, 8, 3, 26, 7]-=-, have proven useful in applications such as proving termination of programs and controlling execution of programs through a delay mechanism. Directional types have a declarative aspect as well as an ... |

2 |
General purpose semantic based analysis using XSB
- Codish, Demoen, et al.
- 1997
(Show Context)
Citation Context ...onsisting of some 200 lines of Prolog code. 23 In addition to the Prolog implementation we have experimented with an implementation based on tabled resolution implemented in XSB which is described in =-=[16]-=-. The experimental evaluation of the technique indicates that in spite of the fact that the basic underlying unification algorithm is NP-complete analyses are usually quite fast. It appears that the a... |

2 |
Logic program analysis using set logic programs
- Lagoon
- 1998
(Show Context)
Citation Context ...sis. A similar approach based on ACI1-unification has recently been applied for sharing analysis of logic programs [18]. A complete description of both types and sharing analyses can be found also in =-=[32]-=-. Acknowledgment This paper has benefited from the discussions and comments of several colleagues: Bart Demoen collaborated on an earlier paper which influenced this one and later helped get the bench... |