Skip to main content Accessibility help

In Praise of Impredicativity: A Contribution to the Formalization of Meta-Programming


Processing programs as data is one of the successes of functional and logic programming. Higher-order functions, as program-processing programs are called in functional programming, and meta-programs, as they are called in logic programming, are widespread declarative programming techniques. In logic programming, there is a gap between the meta-programming practice and its theory: The formalizations of meta-programming do not explicitly address its impredicativity and are not fully adequate. This article aims at overcoming this unsatisfactory situation by discussing the relevance of impredicativity to meta-programming, by revisiting former formalizations of meta-programming, and by defining Reflective Predicate Logic, a conservative extension of first-order logic, which provides a simple formalization of meta-programming.

Hide All

The author is thankful to Norbert Eisinger, Bob Kowalski, and Antonius Weinzierl for fruitful discussions on the subject of this article. The author acknowledges useful hints from the journal area editor Michael J. Maher, from the anonymous reviewers, and from the audience of the 21st International Conference on Applications of Declarative Programming and Knowledge Management (INAP 2017) during which part of the work reported about in this article has been presented in a talk without associated publication. The author is thankful to Norbert Eisinger and Elke Kroiß for their help in correcting typos and stylistic lapses in drafts of this article.

Hide All
Aczel, P. 1977. An introduction to inductive definitions. In Handbook of Mathematical Logic, Barwise, Jon, Ed. North-Holland, 739782.
Aiello, L. C., Cecchi, C. and Sartini, D. 1986. Representation and use of meta-knowledge. Proceedings of the IEEE 74, 10, 13041321.
Apt, K. R. and Ben-Eliyahu, R. 1996. Meta-variables in logic programming, or in praise of ambivalent syntax. Fundamenta Informaticae 28, 1, 2336.
Apt, K. R. and van Emden, M. 1982. Contributions to the theory of logic programming. Journal of the Association for Computating Machinery 29, 841862.
Backus, J. W. 1959. The syntax and semantics of the proposed international algebraic language of Zürich ACM-GAMM conference. In Proc. of the International Conference on Information Processing, Jun. 1959, Veronese, V., Ed. Paris, France, UNESCO (Paris, France), R. Oldenbourg (München, Germany) and Butterworths (London, Great Britain), 125132.
Barendregt, H. 1993. Lambda Calculi with types. In Handbook of Logic in Computer Science. Vol. 2, Background: Computational Structures. Oxford University Press, 117309.
Barklund, J. 1989. What is a meta-variable in Prolog? In Meta-Programming in Logic Programming, Abramson, Harvey and Rogers, M. H., Eds. MIT Press, 383398.
Barklund, J. 1995. Metaprogramming in logic. Encyclopedia of Computer Science and Technology 33, 205227. Supplement 18: Case-Based Reasoning to User Interface Software Tools.
Barklund, J., Costantini, S., Dell’Acqua, P. and Lanzarone, G. A. 1994. SLD-resolution with reflection. In Logic Programming, Proceedings of the 1994 International Symposium, Bruynooghe, M., Ed. Melbourne, Australia, 554568.
Barklund, J., Costantini, S., Dell’Acqua, P. and Lanzarone, G. A. 1995a. Semantical properties of encodings in logic programming. In Logic Programming – The 1995 International Symposium, Lloyd, J. W., Ed. MIT Press, Portland, Oregon, USA, 288302.
Barklund, J., Dell’Acqua, P., Costantini, S. and Lanzarone, G. A. 1995b. Semantical properties of SLD-resolution with reflection. In Logic Programming, Proceedings of the Twelfth International Conference on Logic Programming, Sterling, L., Ed. MIT Press, Tokyo, Japan, 830.
Barklund, J., Dell’Acqua, P., Costantini, S. and Lanzarone, G. A. 2000. Reflection principles in computational logic. Journal of Logic and Computation 10, 743786.
Benjamin, P. 1990. A meta level manifesto. In Machine Learning, Meta-reasoning and Logics, Brazdil, P. B. and Konolige, K., Eds. Kluwer Academic Publishers, 317.
Bezem, M. 1999. Extensionality of simply typed logic programs. In Proc. of the 16th International Conference on Logic Programming (ICLP), de , D.Schreye, Ed. MIT Press, 395410.
Bezem, M. 2001. An improved extensionality criterion for higher-order logic programs. In Computer Science Logic, 15th International Workshop, CSL. Vol. 2142, LNCS. Fribourg, L., Ed. Springer-Verlag, Paris, France, 203216.
Böhm, C. and Jacopini, G. 1966. Flow diagrams, Turing machines and languages with only two formation rules. Communications of the ACM, 9, 5, 366371.
Boole, G. 1854. An Investigation of the Laws of Thought on Which are Founded the Mathematical Theories of Logic and Probabilities. Macmillan. Reprinted by Dover Publications, New York, 1958, and by Cambridge University Press, 2009.
Bowen, K. and Kowalski, R. 1982. Amalgamating language and metalanguage in logic programming. In Logic Programming, Clark, K. and Tärnlund, S. A., Eds. Academic Press, 153173.
Bowen, K. A. 1985. Meta-level programming and knowledge representation. New Generation Computing 3, 359383.
Bowen, K. A. and Weinberg, T. 1985. A meta-level extension of Prolog. In Proc. of the IEEE Symposium on Logic Programming, Cohen, J. and Conery, J., Eds. IEEE, Boston, Massachusetts, USA, 669675.
Burgess, J. P. 2005. Fixing Frege. Princeton University Press, Princeton, NJ, USA.
Cardelli, L. 2004. Type systems. In CRC Handbook of Computer Science and Engineering, Tucker, A. B., Ed. CRC Press, 22082236.
Cardelli, L. and Wegner, P. 1985. On understanding types, data abstraction, and polymorphism. ACM Computing Surveys 17, 4 (December), 471522.
Cervesato, I. and Rossi, G. 1992. Logic meta-programming facilities in ‘LOG. Research Showcase @ CMU 6-1992, Carnegie Mellon University, School of Computer Science, Computer Science Department.
Chang, C.-L. and Lee, R. C.-T. 1997. Symbolic Logic and Mechanical Theorem Proving. Academic Press.
Charalambidis, A., Handjopoulos, K., Rondogiannis, P. and Wadge, william L.. 2013. Extensional higher-order logic programming. ACM Transactions on Computational Logic 14, 3, 91103.
Chen, W. 1987. A theory of modules based on second-order logic. In Proc. IEEE Symposium on Logic Programming, IEEE Computer Society, San Francisco, California, USA, 2433.
Chen, W., Kifer, M. and Warren, D. S. 1993. HiLog: A foundation for higher-order logic programming. Journal of Logic Programming 15, 3, 187230.
Church, A. 1932. A set of postulates for the foundation of logic. Annals of Mathematics – Series 233, 2, 346366.
Church, A. 1940. A formulation of the simple theory of types. Journal of Symbolic Logic 5, 5668.
Chwistek, L. 1921. Antynomje logikiformalnej. Przeglad Filozoficzny 24, 164171. In Polish, English translation: Chwistek (1967).
Chwistek, L. 1967. Antinomies of formal logic. In Polish Logic: 1920–1939, McCall, S., Ed. Clarendon Press, 338345. English translation by Z. Jordan of Chwistek (1921).
Clocksin, W. F. and Mellish, C. S. 1981. Programming in Prolog. Springer-Verlag.
Costantini, S. 2002. Meta-Reasoning: A survey. In Computational Logic: Logic Programming and Beyond (Festschrift in honour of Robert Kowalski), Kakas, A. C. and Sadri, F., Eds. Vol. 2408, LNCS. Springer-Verlag, 254288.
Costantini, S. and Lanzarone, G. A. 1989. A metalogic programming language. In Proc. of the International Conference on Logic Programming, Jun. 1989, Levi, G. and Martelli, M., Ed. Lisbon, Portugal, 218233.
Costantini, S. and Lanzarone, G. A. 1994. A metalogic programming approach: Language, semantics and applications. Journal of Experimental & Theoretical Artificial Intelligence 6, 3, 239287.
Damas, L. 1985. Type Assignment in Programming Languages. Ph.D. thesis, Report No. CST-33-85, University of Edinburgh.
Damas, L. and Milner, R. 1982. Principal type-schemes for functional programs. In Proc. of the 9th Symposium on Principles of Programming Languages (POPL), DeMillo, R., Ed. ACM, Albuquerque, New Mexico, USA, 207212.
De Schreye, D. and Martens, B. 1992. A sensible least Herbrand semantics for untyped vanilla meta-programming and its extension to a limited form of amalgamation. In Meta-Programming in Logic, Proc. of the 3rd International Workshop on Meta-Programming (META), Jun. 1992, Peterossi, A., Ed. LNCS. Springer-Verlag, Uppsala, Sweden, 192204.
Dijkstra, E. W. 1968. Letters to the editor: Go to statement considered harmful. Communications of the ACM 11, 3, 147148.
Eshghi, K. 1986. Meta-language in Logic Programming. Ph.D. thesis, Department of Computing, Imperial College of Science and Technnology, University of London, UK.
Feferman, S. 2005. Predicativity. In The Oxford Handbook of Philosophy of Mathematics and Logic, Shapiro, S., Ed. Oxford University Press, 590624.
Frege, G. 1879. Begriffsschrift – Eine der arithmetischen nachgebildete Formelsprache des reinen Denkens. Verlag von Louis Nebert, Halle an der Saale. In German, English translation: Frege (1967, 2002).
Frege, G. 1893. Grundgesetze der Arithmetik, Band I. Verlag Herman Pohle, Jena. In German, partial English translation: Frege (1964).
Frege, G. 1903. Grundgesetze der Arithmetik, Band II. Verlag Herman Pohle, Jena. In German, partial English translation: Frege (1964).
Frege, G. 1964. The Basic Laws of Arithmetic. University of California Press, Berkeley, CA, USA. Partial English translation of Frege (1893, 1903) by Montgomery Furth.
Frege, G. 1967, 2002. A concept notation: A formula language of pure thought, modelled upon that of arithmetic. In From Frege to Gödel: A Sourcebook in Mathematical Logic, 1879-1931, van Heijenoort, J., Ed. Harvard University Press, 1–82, English translation of Frege (1879).
Gelfond, M. and Lifschitz, V. 1988. The stable model semantics for logic programming. In Proc. of the Fifth International Conference on Logic Programming (ICLP), Aug. 1988, Bowen, K. A. and Kowalski, R. A., Eds. MIT Press, Seattle, Washington, 10701080.
Gentzen, G. 1934. Untersuchungen über das logische Schließen I. Mathematische Zeitschrift 39, 2, 176210. In German. English translations: Gentzen (1964), Gentzen (1969).
Gentzen, G. 1964. Investigations into logical deduction. American Philosophical Quarterly 1, 4 (October), 288306. English translation of Gentzen (1934).
Gentzen, G. 1969. Investigations into logical deduction. In The Collected Works of Gerhard Gentzen, Szabo, M. E., Ed. Studies in logic and the foundations of mathematics. North-Holland, 68131. English translation of Gentzen (1934).
Giordano, L., Martelli, A. and Rossi, G. 1994. Structured Prolog: A language for structured logic programming. Software-Concepts and Tools 15, 125145.
Giordano, L. and Olivetti, N. 1994. Combining negation as failure and embedded implications in logic programs. Journal of Logic Programming 19, 20, 1679.
Gödel, K. 1930. Über die Vollständigkeit des Logikkalküls. Doctoral thesis, University of Vienna, Austria. In German, English translation: Gödel (2002).
Gödel, K. 1931. Über formal unentscheidbare Sätze der Principia Mathematica und verwandter Systeme I. Monatsheft für Mathematik und Physik 38, 173198. In German, English translation: Gödel (1986).
Gödel, K. 1944. Russell’s mathematical logic. In The Philosophy of Bertrand Russell, Schilpp, P. A., Ed. Northwestern University, Chicago, IL, USA, 123153.
Gödel, K. 1967, 2002. The completeness of the Axioms of the functional calculus of logic. In From Frege to Gödel: A Sourcebook in Mathematical Logic, 1879-1931. van Heijenoort, J., Ed. Harvard University Press, 582591.
Gödel, K. 1986. On Formally Undecidable Propositions of Principia Mathematica and Related Systems I. Vol. I Publications 19291936. Oxford University Press. English translation of Gödel (1930).
Graf, P. 1996. Term Indexing. Vol. 1053, LNCS. Springer-Verlag. Doctoral thesis, Saarland University, Germany, 1995.
Haemmerlé, R. and Fages, F. 2006. Modules for Prolog revisited. In Logic Programming – International Conference on Logic Programming (ICLP), Etalle, S. and Truszczynski, M., Ed. Springer-Verlag, Seattle, Washington, USA. 4155.
Halpern, J. Y. and Moses, Y. 1985. A guide to the modal logics of knowledge and belief. In Proc. 9th International Joint Conference on Artificial Intelligence (IJCAI), Joshi, A., Ed. Vol. 1, Morgan Kaufmann, Los Angeles, California, USA, 480490.
Harper, R., Honsell, F. and Plotkin, G. 1993. A framework for defining logics. Journal of the ACM (JACM) 40, 1, 143184.
Higgins, C. P. 1996. On the declarative and procedural semantics of definite metalogic programs. Journal of Logic and Computation 6, 3, 363407.
Hill, P. and Lloyd, J. W. 1994. The Gödel Programming Language. MIT Press.
Hill, P. M. and Lloyd, J. W. 1988. Analysis of meta-programs. In Meta-Programming in Logic Programming, Workshop on Meta-Programming in Logic (META-88), Jun. 1988, Abramson, H. and Rogers, M. H., Eds. MIT Press, Bristol, Great Britain, 2351.
Hindley, R. J. 1969. The principal type-scheme of an object in combinatory logic. Transactions of the American Mathematical Society 146, Bristol, Great Britain, 2960.
Hintikka, J. 1964. Knowledge and Belief – An Introduction to the Logic of the Two Notions, 2nd ed. Cornell University Press.
Huet, G. P. 1976. Résolution d’équations dans des langages d’ordre 1, 2, …, ω. Doctoral thesis, Mathématiques, Université Paris VII.
Jiang, Y. 1994. Ambivalent Logic as the semantic basis of logic programming. In Proc. International Conference on Logic Programming, Hentenryck, P. V., Ed. MIT Press, Santa Marherita Ligure, Italy, 387401.
Kalsbeek, M. B. 1993. The Vanilla Metainterpreter for Definite Logic Programs and Ambivalent Syntax. Tech. Rep. CT 93-01, Institute for Logic Language and Computation, University of Amsterdam.
Kalsbeek, M. B. and Jiang, Y. 1995. A vademecum of ambivalent logic. In Meta-Logics and Logic Programming, Apt, K. R. and Turini, F., Ed. MIT Press, 2756.
Kowalski, R. 1973. Predicate logic as a programming language. Memo 70, Department of Artificial Intelligence, Edinburgh University. Also in: Proc. IFIP Congress, Stockholm, North Holland, 1974, 569–574.
Kowalski, R. 1979. Logic For Problem Solving. North Holland.
Kowalski, R. and Kim, J.-S. 1991. A metalogic approach to multi-agent knowledge and belief. In Artificial and Mathematical Theory of Computation: Papers in Honor of John McCarthy, Lipschitz, V., Ed. Academic Press, 231246.
Levi, G. and Ramundo, D. 1993. A formalization of meta-programming for real. In Proc. of the 10th International Conference on Logic Programming, Jun. 1993, Warren, D. S., Ed. MIT Press, Budapest, Hungary, 354373.
Levy, J. and Veanes, M. 2000. On the undecidability of second-order unification. Information and Computation 159, 1–2, 125150.
Link, G., Ed. 2004. One Hundred Years of Russell’s Paradox: Mathematics, Logic, Philosophy. de Gruyter.
Liskov, B. and Zilles, S. 1974. Programming with abstract data types. ACM SIGPLAN Notices 9, 4, 5059.
Lismont, L. and Mongin, P. 1994. On the logic of common belief and common knowledge. Theory and Decision 37, 75106.
Lloyd, J. W. 1987. Foundation of Logic Programming, 2nd ed. Springer-Verlag.
Martelli, A. and Rossi, G. 1988. Enhancing Prolog to support Prolog programming environments. In ESOP’88: 2nd European Symposium on Programming, Mar. 1988, Vol. 300, LNCS. Ganzinger, H., Ed. Springer-Verlag, Nancy, France, 317327.
McCarthy, J. and Levin, M. I. 1965. Lisp 1.5 Programmer’s Manual. Tech. Rep., Computation Center, Massachusetts Institute of Technology, USA.
McCarthy, J., Sato, M., Hayashi, T. and Igrashi, S. 1978. On the Model Theory of Knowledge. Tech. Rep., AIM-312, Stanford University.
Miller, D. 1989. A logical analysis of modules in logic programming. Journal of Logic Programming 6, 1–2, 79108.
Miller, D. and Nadathur, G. 1988. An overview of Lambda-Prolog. In Proc. Fifth International Conference and Symposium on Logic Programming, Kowalski, R. A. and Bowen, K. A., Eds. MIT Press, Seattle, Washington, USA, 810827.
Miller, D. and Nadathur, G. 2012. Programming with Higher-Order Logic. Cambridge University Press.
Milner, R. 1978. A theory of type polymorphism in programming. Journal of Computer and System Science 17, 348374.
Moschovakis, J. 1999, 2015. Intuitionistic Logic. The Metaphysics Research Lab, Center for the Study of Language and Information, Stanford University, Stanford, CA 94305-4115.
O’Keefe, R. 1990. The Craft of Prolog. MIT Press.
Perlis, A. J. and Samelson, K. 1958. Preliminary report: International algebraic language. Communications of the ACM 1, 12, 822.
Perlis, D. 1985. Languages with self-reference i: Foundations. Artificial Intelligence 25, 3, 307322.
Perlis, D. 1988a. Languages with self-reference ii: Knowledge, belief, and modality. Artificial Intelligence 34, 2, 179212.
Perlis, D. 1988b. Meta in logic. In Meta-level Architectures and Reflection, Maes, P. and Nardi, D., Ed. North-Holland, 3749.
Pfenning, F. 1991. Logic Programming in the LF Logical Framework. Research Rep., School of Computer Science, Carnegie Mellon University.
Pfenning, F. and Schürmann, C. 1999. System description: Twelf – A meta-logical framework for deductive systems. In Proc. of the 16th International Conference on Automated Deduction (CADE). Vol. 1632, LNAI. Ganzinger, H., Ed. Springer-Verlag, Trento, Italy, 202206.
Pierce, B. C. 2002. Types and Programming Languages. MIT Press.
Ramsey, F. P. 1926. The foundations of mathematics. Proceedings of the London Mathematical Society, Series 225, 338384.
Robinson, A. and Voronkov, A., Eds. 2001. Handbook of Automated Reasoning. Vol. 1. ScienceDirect.
Robinson, G. and Wos, L. 1968. Completeness of paramodulation. In Proc. of the Spring 1968 Meeting of the Association for Symbolic Logic, Journal of Symbolic Logic, Vol. 34, (1969), 102–103.
Robinson, G. and Wos, L. 1969. Paramodulation and theorem proving in first order theories with equality. In Machine Intelligence 4. Edinburgh University Press, 135150. Proc. of the Fourth Annual Machine Intelligence Workshop. Edinburgh, 1968. Reprinted in Siekmann and Wrightson (1983, pp. 98–3134).
Rossi, G. 1989. Meta-programming facilities in an extended Prolog. In Proc. of the Fifth International Conference on Artificial Intelligence and Information-Control Systems of Robots – 89, Plander, I., Ed. World Scientific, distributed by North Holland, Štrbské Pleso, Czechoslovakia
Rossi, G. 1992. Programs as data in an extended Prolog. The Computer Journal 36, 3, 217226.
Russell, B. 1907. On some difficulties in the theory of transfinite numbers and order types. Proceedings of the London Mathematical Society s2–4, 1, 2953.
Russell, B. 1908. Mathematical logic as based on the theory of types. American Journal of Mathematics 30, 222262.
Russell, B. 1986. The Collected Papers of Bertrand Russell. Vol. 6, Logical and Philosophical Papers 1909–13. George Allen & Unwin.
Siekmann, J. H. and Wrightson, G., Eds. 1983. Automation of Reasoning. Symbolic Computation (Artificial Intelligence). Vol. 1, Classical Papers on Computational Logic 19571966. Springer-Verlag.
Siklóssy, L. 1976. Let’s Talk Lisp. Prentice-Hall.
Sterling, L. S. and Shapiro, E. Y. 1994. The Art of Prolog, 2nd ed. MIT Press.
Sugano, H. 1989. Reflective Computation in Logic Language and Its Semantics. Tech. Rep., International Institute for Advanced Study of Social and Information Science, Fujitsu Limited.
Sugano, H. 1990. Meta and reflective computation in logic programming and its semantics. In Proc. of the 2nd Workshop on Meta-Programming in Logic Programming (META), Bruynooghe, M., Ed. Springer-Verlag, Leuven, Belgium, 1934.
Tarski, A. 1935. Der Wahrheitsbegriff in den formalisierten Sprachen. Studia Philosophica: commentarii Societatis Philosophicae Polonorum 146, 261405. In German, English translation: Tarski (1935).
Tarski, A. 1935. The concept of truth in formalized languages. In Logic, Semantics, Metamathematics, Papers from 1923 to 1938, 2nd ed. Corcoran, J., Eds. Hackett Publishing Company, Inc., 152278.
Trump, D. 2017. “Why would Kim Jong-un insult me by calling me ‘old’, when I would NEVER call him ‘short and fat’? Oh well, I try so hard to be his friend – And maybe someday that will happen!”. Twitter Web Client
van Ditmarsch, H., Halpern, J. Y., van der Hoek, W. and Kooi, B., Eds. 2015. Handbook of Epistemic Logic. College Publications.
van Emden, M. and Kowalski, R. 1976. The semantics of predicate logic as a programming language. Journal of the Association for Computating Machinery 23, 733742.
van Harmelen, F. 1989. A classification of metalevel architectures. In Logic-based Knowledge Representation, Jackson, P. M., Reichgelt, J., and van Harmelen, F., Eds. MIT Press, 135.
van Harmelen, F. 1992. Definable naming relations in meta-level systems. In Proc. of the Third Workshop on Meta-Programming in Logic (META), Uppsala, Sweden, Vol. 649, LNCS, Pettorossi, A., Ed. Springer-Verlag, 89104.
von Kutschera, F. 1989. Gottlob Frege: Eine Einführung in sein Werk, de Gruyter, Berlin. In German.
Wadge, W. W. 1991. Higher-order horn-logic programming. In Logic Programming: Proceedings of the 1991 International Symposium, Saraswat, V. A. and Ueda, K., Eds. MIT Press, 289303.
Weyhrauch, R. W. 1980. Prolegomena to a theory of mechanized formal reasoning. Artificial Intelligence 13, 1–2, 133170.
Whitehead, A. N. and Russell, B. 1910, 1912, 1913. Principia Mathematica. Vols. 1–3. Cambridge University Press.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Theory and Practice of Logic Programming
  • ISSN: 1471-0684
  • EISSN: 1475-3081
  • URL: /core/journals/theory-and-practice-of-logic-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *



Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed