Abstract
We present an algorithm for automatic type checking of logic programs with respect to directional types that describe both the structure of terms and the directionality of predicates. The type checking problem is reduced to a decision problem on systems of inclusion constraints over set expressions. The solution to this decision problem provides an effective type checking procedure. We discuss some properties of the reduction algorithm, and present a proof of correctness. We present lower bound complexity results for the general type checking problem where types are given as arbitrary set expressions, as well as for the restrictive class of discriminative directional types. For discriminative directional types the type checking procedure is shown to be sound and complete.
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
Preview
Unable to display preview. Download preview PDF.
References
K. R. Apt and Sandro Etalle. On the Unification-free Prolog Programs. In Proceedings of the 1993 Conference on Mathematical Foundations of Computer Science, June 1993.
A. Aiken, D. Kozen, and E. Wimmers. Decidability of systems of set constraints with negative constraints. Technical Report 93-1362, Cornell University, June 1993.
K. R. Apt. Declarative Programming in Prolog. In D. Miller, editor, Proceedings of the International Logic Programming Symposium. MIT Press, November 1993.
K. R. Apt. Program Verification and Prolog. Technical report, CWI Amsterdam, January 1994.
A. Aiken and E. Wimmers. Solving Systems of Set Constraints. In Symposium on Logic in Computer Science, pages 329–340, June 1992.
A. Bossi and N. Cocco. Verifying Correctness of Logic Programs. In Proceedings of TAPSOFT 89, pages 96–110. LNCS 352, Springer Lecture Notes in Computer Science, 1989.
L. Bachmair, H. Ganzinger, and U. Waldmann. Set constraints are the monadic class. In Symposium on Logic in Computer Science, pages 75–83, June 1993.
F. Bronsard, T. K. Lakshman, and U. S. Reddy. A Directional Type System for Prolog: Unifying notions of Types and Directionality. Technical report UIUC-DCS, University of Illinois at Urbana-Champaign, December 1992.
F. Bronsard, T. K. Lakshman, and U. S. Reddy. A framework of directionality for proving termination of logic programs. In K. R. Apt, editor, Logic Programming: Proceedings of the 1992 Joint International Conference and Symposium, pages 321–335, November 1992.
M. Codish and B. Demoen. Deriving Type Dependencies for Logic Programs using Multiple Incarnations of PROP. In Proceedings of the Ist International Static Analysis Symposium. Springer Lecture Notes in Computer Science, September 1994. To appear.
P. De Boeck and B. Le Charlier. Mechanical Transformation of Logic Definitions augmented with Type Information into Prolog Procedures: Some Experiments. In Proceedings of (LOPSTR'93), July 1993.
S. K. Debray. Static inference of modes and data dependencies in logic programs. ACM Transactions on Programming Languages and Systems, 11(3):418–450, July 1989.
Y. Deville. Logic Programming: Systematic Program Development. Addison Wesley, 1990.
P. De Boeck, and B. Le Charlier. Static type analysis of Prolog procedures for ensuring correctness. In Proceedings of Programming Language Implementation and Logic Programming (PLILP'90), volume 456 of Lecture Notes in Computer Science, pages 222–237, Linköping, Sweden, August 1990.
S. K. Debray, and P. Mishra. Denotational and operational semantics for Prolog. Journal of Logic Programming, 5(1):61–91, 1988.
W. Drabent, and M. Małusziński. Inductive assertion method for logic programs. Theoretical Computer Science, 59:207–230, 1988.
P. W. Dart, and J. Zobel. A Regular Type Language for Logic Programs, chapter in Types in Logic Programming, Frank Pfenning, editor, pages 157–187. MIT Press, Cambridge, MA, 1992.
T. Früwirth, E. Shapiro, M. Vardi, and E. Yardeni. Logic programs as types for logic programs. In Symposium on Logic in Computer Science, pages 300–309, July 1991.
S. Gregory. Parallel Logic Programming in PARLOG. Addison-Wesley, 1987.
R. Gilleron, S. Tison, and M. Tommasi. Solving Systems of Set Constraints with Negated Subset Relationships. In Foundations of Computer Science, pages 372–380, November 1993.
N. Heintze. Practical Aspects of Set Based Analysis. In K. R. Apt, editor, Logic Programming: Proceedings of the 1992 Joint International Conference and Symposium, pages 765–782. MIT Press, November 1992.
N. Heintze. Set Based Program Analysis. PhD thesis, Carnegie Mellon University, 1992.
Nevin Heintze. Set Constraints in Program Analysis. In Workshop on Global Compilation, Vancouver, CA, October 1993. Proceedings of the International Logic Programming Symposium.
N. Heintze and J. Jaffar. A Finite Presentation Theorem for approximating logic programs. In Proceedings of the Annual ACM Symposium on Principles of Programming Languages, pages 197–209, January 1990.
N. Heintze and J. Jaffar. A decision procedure for a class of set constraints. In Symposium on Logic in Computer Science, pages 42–51, June 1990.
N. Heintze, and J. Jaffar. Semantic Types for Logic Programs, chapter in Types in Logic Programming, Frank Pfenning, editor, pages 141–155. MIT Press, Cambridge, MA, 1992.
J. Henrard and B. Le Charlier. FOLON: An environment for Declarative Construction of Logic Programs. In M. Bruynooghe and M. Wirsing, editors, Proceedings of the Fourth International Workshop on Programming Language Implementation and Logic Programming (PLILP'92), volume 631 of Lecture Notes in Computer Science. Springer-Verlag, August 1992.
M. Hermenegiklo, R. Warren, and S. K. Debray. Global flow analysis as a practical compilation tool. Journal of Logic Programming, 13:349–366, 1992.
D. Jacobs. A Pragmatic View of Types for Logic Programs, chapter in Types in Logic Programming, Frank Pfenning, editor, pages 217–228. MIT Press, Cambridge, MA, 1992.
G. Janssens, and M. Bruynooghe. Deriving descriptions of possible values of program variables by means of abstract interpretation. Journal of Logic Programming, 13(2):205–258, July 1992.
D. Kozen. Lower bounds for natural proof systems. In IEEE Symposium on the Foundations of Computer Science, pages 254–266. IEEE Computer Society, 1977.
P. Mishra. Towards a theory of types in PROLOG. In Proceedings of the First IEEE Symposium in Logic Programming, pages 289–298, 1984.
P. Mishra and U. S. Reddy. Declaration-free type checking. In Proceedings of the Annual ACM Symposium on Principles of Programming Languages, pages 7–21, January 1985.
Lee Naish. Negation and control in Prolog. Lecture Notes in Computer Science 238. Springer-Verlag, 1986.
D. Pedreschi. A Proof Method for Run-time Properties of Prolog Programs. In Proceedings of the International Conference on Logic Programming, MIT Press, June 1994. To appear.
Yann Rouzaud and Lan Nguyen-Phoung. Integrating Modes and Subtypes into a Prolog Type-Checker. In K. R. Apt, editor, Logic Programming: Proceedings of the 1992 Joint International Conference and Symposium, pages 85–97. MIT Press, November 1992.
H. Seidl. Deciding equivalence of finite tree automata. SIAM Journal of Computing, 19(3):424–437, June 1990.
E. Shapiro. The family of concurrent logic programming languages. ACM Computing Surveys, 21(3):412–510, May 1989.
Z. Somogyi. A system of precise modes for logic programs. In Proceedings of the International Conference on Logic Programming, pages 769–787, June 1987.
J. L. Zachary, and K. Yelick. Moded Type Systems to Support Abstraction, chapter in Types in Logic Programming, Frank Pfenning, editor, pages 217–228. MIT Press, Cambridge, MA, 1992.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1994 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Aiken, A., Lakshman, T.K. (1994). Directional type checking of logic programs. In: Le Charlier, B. (eds) Static Analysis. SAS 1994. Lecture Notes in Computer Science, vol 864. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-58485-4_32
Download citation
DOI: https://doi.org/10.1007/3-540-58485-4_32
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-58485-8
Online ISBN: 978-3-540-49005-0
eBook Packages: Springer Book Archive