Higher-order Aspects of Logic Programming Uday S. Reddy Department of Computer Science University of Illinois at Urbana-Chaznpalgn Urbana, IL 61801 Net: reddy~cs.uiuc.edu Abstract. Are higher-order extensions to logic programming needed? We suggest a negative answer by showing that higher-order features are already available in pure logic programming. It is demonstrated that higher-order lambda ca]cttlus-based languages can be compositionally embedded in logic programming languages preserving their semantics and abstraction facilities. Further, we show that such higher-order tech- niques correspond to programming techniques often practiced in logic programming. Keywords: Higher-order features, functional programming, lambda cal- culus, logic variables, concurrent logic programming, types, semantics. 1 Introduction In an early paper [War82], Warren raised the question whether higher-order extensions to Prolog were necessary. He suggested that they were not necessary by modelling higher-order concepts in logic programs. His proposal modelled functions and relations intensionaily by their names. As is well-known in Lisp community, such an encoding does not obtain the full power of higher-order programming. In particular, lambda abstraction and "upward" function values are absent. An entirely different approach to the issue was pursued by Miller et. al. in Lambda Prolog [MN86]. The objective here seems to be not higher-order logic programming, but logic programming over higher-order terms. While this approach has many interesting applications, particularly in meta-logical frame- works, it still leaves open the question of whether higher-order programming is possible in a standard logic programming setting. A similar comment applies to other higher-order languages like HiLog [CKW89]. In this paper, we return to Warren's question and suggest another negative answer. Using new insights obtained from the connection between linear logic and logic programming [Laf87, Abr91, Abr93, Red93b], we contend that ideal- ized logic programming is "already higher-order" in its concept, even though one might wish to add some syntactic sugar to obtain convenience. A similar answer is also suggested by Saraswat's work [Sar92] showing that concurrent logic programming is higher-order in a categorical sense. We argue that idealized logic programming is higher-order by presenting two forms of evidence: