Abstract
We follow the set-based approach to directional types proposed by Aiken and Lakshman [1]. Their type checking algorithm works via set constraint solving and is sound and complete for given discriminative types. We characterize directional types in model-theoretic terms. We present an algorithm for inferring directional types. The directional type that we derive from a logic program P is uniformly at least as precise as any discriminative directional type of P, i.e., any directional type out of the class for which the type checking algorithm of Aiken and Lakshman is sound and complete. We improve their algorithm as well as their lower bound and thereby settle the complexity (Dexptime-complete) of the corresponding problem.
On leave from University of Wrocław, Poland. Partially supported by Polish KBN grant 8T11C02913.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
A. Aiken and T. K. Lakshman. Directional type checking of logic programs. In B. L. Charlier, editor, 1st International Symposium on Static Analysis, volume 864 of Lecture Notes in Computer Science, pages 43–60, Namur, Belgium, Sept. 1994. Springer Verlag.
K. R. Apt. Declarative programming in Prolog. In D. Miller, editor, Logic Programming-Proceedings of the 1993 International Symposium, pages 12–35, Vancouver, Canada, 1993. The MIT Press.
K. R. Apt. Program verification and Prolog. In E. Börger, editor, Specification and Validation methods for Programming languages and systems, pages 55–95. Oxford University Press, 1995.
K. R. Apt and S. Etalle. On the unification free Prolog programs. In A. M. Borzyszkowski and S. Sokolowski, editors, Mathematical Foundations of Computer Science 1993, 18th International Symposium, volume 711 of LNCS, pages 1–19, Gdansk, Poland, 30 Aug.–3 Sept. 1993. Springer.
J. Boye. Directional Types in Logic Programming. PhD thesis, Department of Computer and Information Science, Linköping University, 1996.
J. Boye and J. Maluszynski. Two aspects of directional types. In L. Sterling, editor, Proceedings of the 12th International Conference on Logic Programming, pages 747–764, Cambridge, June13–18 1995. MIT Press.
J. Boye and J. Maluszynski. Directional types and the annotation method. Journal of Logic Programming, 33(3):179–220, Dec. 1997.
F. Bronsard, T. K. Lakshman, and U. S. Reddy. A framework of directionality for proving termination of logic programs. In K. Apt, editor, Proceedings of the Joint International Conference and Symposium on Logic Programming, pages 321–335, Washington, USA, 1992. The MIT Press.
M. Bruynooghe, H. Vandecasteele, A. de Waal, and M. Denecker. Detecting unsolvable queries for definite logic programs. In Proceedings of the Symposium on Programming Language Implementation and Logic Programming (PLILP’98), LNCS. Springer-Verlag, 1998. to appear.
W. Charatonik, D. McAllester, D. Niwiński, A. Podelski, and I. Walukiewicz. The Horn mu-calculus. To appear in Vaughan Pratt, editor, Proceedings of the 13th IEEE Annual Symposium on Logic in Computer Science.
W. Charatonik, D. McAllester, and A. Podelski. Computing the least and the greatest model of the set-based abstraction of logic programs. Presented at the Dagstuhl Workshop on Tree Automata, October 1997.
W. Charatonik and L. Pacholski. Negative set constraints with equality. In Ninth Annual IEEE Symposium on Logic in Computer Science, pages 128–136, 1994.
W. Charatonik and A. Podelski. Set constraints for greatest models. Technical Report MPI-I-97-2-004, Max-Planck-Institut für Informatik, April 1997. www.mpi-sb.mpg.de/~podelski/papers/greatest.html.
M. Codish and B. Demoen. Deriving polymorphic type dependencies for logic programs using multiple incarnations of prop. In B. L. Charlier, editor, Proceedings of the First International Static Analysis Symposium, Lecture Notes in Computer Science 864, pages 281–296. Springer Verlag, 1994.
M. Comini, G. Levi, M. C. Meo, and G. Vitiello. Proving properties of logic programs by abstract diagnosis. In M. Dam, editor, Analysis and Verification of Multiple-Agent Languages, volume 1192 of LNCS, pages 22–50. Springer-Verlag, June 1996.
P. Cousot and R. Cousot. Inductive definitions, semantics and abstract interpretation. In Proc. POPL’ 92, pages 83–94. ACM Press, 1992.
P. Cousot and R. Cousot. Formal language, grammar and set-constraint-based program analysis by abstract interpretation. In Record of FPCA’ 95-Conference on Functional Programming and Computer Architecture, pages 170–181, La Jolla, California, USA, 25–28 June 1995. SIGPLAN/SIGARCH/WG2.8, ACM Press, New York, USA.
P. Devienne, J.-M. Talbot, and S. Tison. Set-based analysis for logic programming and tree automata. In Proceedings of the Static Analysis Symposium, SAS’97, volume 1302 of LNCS, pages 127–140. Springer-Verlag, 1997.
T. Frühwirth, E. Shapiro, M. Vardi, and E. Yardeni. Logic programs as types for logic programs. In Sixth Annual IEEE Symposium on Logic in Computer Science, pages 300–309, July 1991.
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.
J. Gallagher and D. A. de Waal. Fast and precise regular approximations of logic programs. In P. V. Hentenryck, editor, Proceedings of the Eleventh International Conference on Logic Programming, pages 599–613, Santa Margherita Ligure, Italy, 1994. The MIT Press.
F. Gécseg and M. Steinby. Tree Automata. Akademiai Kiado, 1984.
N. Heintze. Practical aspects of set based analysis. In K. Apt, editor, Proceedings of the Joint International Conference and Symposium on Logic Programming, pages 765–779, Washington, USA, 1992. The MIT Press.
N. Heintze and J. Jaffar. A finite presentation theorem for approximating logic programs. In Seventeenth Annual ACM Symposium on Principles of Programming Languages, pages 197–209, January 1990.
N. Heintze and J. Jaffar. Set constraints and set-based analysis. In Proceedings of the Workshop on Principles and Practice of Constraint Programming, LNCS 874, pages 281–298. Springer-Verlag, 1994.
G. Janssens and M. Bruynooghe. Deriving descriptions of possible values of program variables. Journal of Logic Programming, 13(2–3):205–258, 1992.
P. Mishra. Towards a theory of types in Prolog. In IEEE International Symposium on Logic Programming, pages 289–298, 1984.
Y. Rouzaud and L. Nguyen-Phuong. Integrating modes and subtypes into a Prolog type-checker. In K. Apt, editor, Proceedings of the Joint International Conference and Symposium on Logic Programming, pages 85–97, Washington, USA, 1992. The MIT Press.
H. Seidl. Haskell overloading is DEXPTIME-complete. Information Processing Letters, 52:57–60, 1994.
C. Weidenbach. Spass version 0.49. Journal of Automated Reasoning, 18(2):247–252, 1997.
E. Yardeni and E. Shapiro. A type system for logic programs. In E. Shapiro, editor, Concurrent Prolog, volume 2, chapter 28, pages 211–244. The MIT Press, 1987.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 1998 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Charatonik, W., Podelski, A. (1998). Directional Type Inference for Logic Programs. In: Levi, G. (eds) Static Analysis. SAS 1998. Lecture Notes in Computer Science, vol 1503. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-49727-7_17
Download citation
DOI: https://doi.org/10.1007/3-540-49727-7_17
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-65014-0
Online ISBN: 978-3-540-49727-1
eBook Packages: Springer Book Archive