Abstract
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. It is known that directional-type checking wrt. arbitrary types is undecidable; several authors proved decidability of the problem wrt. discriminative regular types. In this paper, using techniques based on tree automata, we show that directional-type checking for logic programs wrt. general regular types is Dexptime-complete and fixed-parameter linear. The latter result shows that despite the exponential lower bound, the type system might be usable in practice.
Chapter 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, June 13–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.
A. Caron, J. Coquidé, and M. Dauchet. Encompassment properties and automata with constraints. In C. Kirchner, editor, 5th international conference on Rewriting Techniques and Applications, LNCS 690, pages 328–342, Montréal, 1993.
W. Charatonik. Automata on DAG representations of finite trees. Technical Report MPI-I-1999-2-001, Max-Planck-Institut für Informatik, Mar. 1999. www.mpisb.mpg.de/~witold/papers/dag.ps.
W. Charatonik, F. Jacquemard, and A. Podelski. Directional type checking for logic programs is decidable, 1998. Unpublished note.
W. Charatonik and A. Podelski. Directional type inference for logic programs. In G. Levi, editor, Proceedings of the Fifth International Static Analysis Symposium (SAS), LNCS 1503, pages 278–294, Pisa, Italy, 1998. Springer-Verlag.
W. Charatonik and A. Podelski. Set-based analysis of reactive infinite-state systems. In B. Steffen, editor, Fourth International Conference on Tools and Algorithms for the Construction and Analysis of Systems, LNCS 1384, pages 358–375, Lisbon, Portugal, March–April 1998. Springer-Verlag.
W. Charatonik, A. Podelski, and J.-M. Talbot. Paths vs. trees in set-based program analysis. In 27th Annual ACM Symposium on Principles of Programming Languages, Jan. 2000.
H. Comon, M. Dauchet, R. Gilleron, F. Jacquemard, D. Lugiez, S. Tison, and M. Tommasi. Tree automata techniques and applications. www.grappa.univlille3.fr/tata.
P. Dart and J. Zobel. A regular type language for logic programs. In F. Pfenning, editor, Types in Logic Programming, pages 157–189. MIT Press, 1992.
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.
R. G. Downey and M. Fellows. Parameterized complexity. Monographs in computer science. Springer, New York, 1999.
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.
G. Gottlob, E. Grädel, and H. Veith. Datalog LITE: Temporal versus deductive reasoning in verification. Technical Report DBAI-TR-98-22, Institut für Informationssysteme, Technische Universität Wien, December 1998.
N. Heintze. Set based program analysis. PhD thesis, School of Computer Science, Carnegie Mellon University, 1992.
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. Semantic types for logic programs. In F. Pfenning, editor, Types in Logic Programming, pages 141–156. MIT Press, 1992.
F. Henglein. Type inference with polymorphic recursion. Transactions on Programming Languages and Systems, 15(2):253–289, 1993.
P. V. Hentenryck, A. Cortesi, and B. L. Charlier. Type analysis of Prolog using type graphs. Journal of Logic Programming, 22(3):179–209, Mar. 1995.
G. Janssens and M. Bruynooghe. Deriving descriptions of possible values of program variables by means of abstract interpretation. Journal of Logic Programming, 13(2–3):205–258, July 1992.
P. Mishra. Towards a theory of types in Prolog. In IEEE International Symposium on Logic Programming, pages 289–298, 1984.
A. Mycroft and R. A. O’Keefe. A polymorphic type system for Prolog. Artificial Intelligence, 23:295–307, 1984.
L. Naish. A declarative view of modes. In Proceedings of the 1996 Joint International Conference and Symposium on Logic Programming, pages 185–199. MIT Press, September 1996.
F. Pfenning, editor. Types in Logic Programming. MIT Press, 1992.
Y. Ramakrishna, C. Ramakrishnan, I. Ramakrishnan, S. Smolka, T. Swift, and D. Warren. Efficient model checking using tabled resolution. In Computer Aided Verification (CAV’97), LNCS 1254. Springer-Verlag, June 1997.
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.
P. Rychlikowski and T. Truderung. Polymorphic directional types for logic programming. http://www.tcs.uni.wroc.pl/~tomek/dirtypes/, 2000.
H. Seidl. Haskell overloading is DEXPTIME-complete. Information Processing Letters, 52:57–60, 1994.
W. Thomas. Handbook of Theoretical Computer Science, volume B, chapter Automata on Infinite Objects, pages 134–191. Elsevier, 1990.
E. Yardeni and E. Shapiro. A type system for logic programs. Journal of Logic Programming, 10:125–153, 1991.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2000 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Charatonik, W. (2000). Directional Type Checking for Logic Programs: Beyond Discriminative Types. In: Smolka, G. (eds) Programming Languages and Systems. ESOP 2000. Lecture Notes in Computer Science, vol 1782. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46425-5_5
Download citation
DOI: https://doi.org/10.1007/3-540-46425-5_5
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-67262-3
Online ISBN: 978-3-540-46425-9
eBook Packages: Springer Book Archive