The Intricacies of Three-Valued Extensional Semantics for Higher-Order Logic Programs∗

The Intricacies of Three-Valued Extensional Semantics for Higher-Order Logic Programs∗

Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence (IJCAI-18) The Intricacies of Three-Valued Extensional Semantics for Higher-Order Logic Programs∗ Panos Rondogiannis, Ioanna Symeonidou National and Kapodistrian University of Athens [email protected], [email protected] Abstract nique of Bezem with the infinite-valued semantics of Rondo- giannis and Wadge [2005], we obtain an extensional seman- In this paper we examine the problem of provid- tics for higher-order logic programs with negation. At the ing a purely extensional three-valued semantics for same time, a negative result was also established: by com- higher-order logic programs with negation. We bining the technique of Bezem with the stable model seman- demonstrate that a technique that was proposed by tics [Gelfond and Lifschitz, 1988], we get a semantics that is M. Bezem for providing extensional semantics to not necessarily extensional! It remained as an open problem positive higher-order logic programs, fails when of Rondogiannis and Symeonidou [2018] whether the combi- applied to higher-order logic programs with nega- nation of the technique of Bezem with the well-founded ap- tion. On the positive side, we demonstrate that for proach [Gelder et al., 1991] leads to an extensional seman- stratified higher-order logic programs, extensional- tics. It is exactly this problem that we undertake to solve ity is indeed achieved by the technique. We ana- in the present paper, the main contributions of which can be lyze the reasons of the failure of extensionality in summarized as follows: the general case, arguing that a three-valued setting can not distinguish between certain predicates that • We demonstrate that the well-founded adaptation of appear to have a different behaviour inside a pro- Bezem’s technique, does not in general lead to an exten- gram context, but which happen to be identical as sional model. This indicates that the addition of negation three-valued relations. to higher-order logic programming is not such a straight- forward task as it was possibly initially anticipated. • Despite the above negative result, we prove that the well- 1 Introduction founded adaptation of Bezem’s technique gives an ex- Recent research [Wadge, 1991; Bezem, 1999; 2001; Char- tensional two-valued model in the case of stratified pro- alambidis et al., 2013; 2017; 2018; Rondogiannis and Syme- grams. This result affirms the importance and the well- onidou, 2018] has investigated the possibility of provid- behaved nature of stratified programs, which was, until ing extensional semantics to higher-order logic programming now, only known for the first-order case. (HOLP). Extensionality facilitates the use of standard set the- • We study the more general question of the possible exis- ory in order to reason about programs, at the price of a rela- tence of an alternative extensional three-valued seman- tively restricted syntax. tics for higher-order logic programs with negation. We There exist two research directions for providing exten- indicate that in order to achieve such a semantics, one sional semantics to higher-order logic programs. The first has to make some strong assumptions regarding the be- one [Wadge, 1991; Charalambidis et al., 2013; 2014; 2018] haviour of negation in higher-order logic programs. has been developed using domain-theoretic tools. The sec- The next two sections motivate in an intuitive way the pro- ond approach [Bezem, 1999; 2001; Rondogiannis and Syme- posed approach. The remaining sections develop the material onidou, 2018] is based on processing the ground instantiation in a formal way. The proofs of all results can be found in the of the program. The two research directions are not unre- original paper [Rondogiannis and Symeonidou, 2017]. lated: it has been shown by Charalambidis et al. [2017] that for a broad class of positive programs, the two approaches 2 Extensional HOLP coincide. [ ] In this paper we focus on the second approach, initially W. W. Wadge 1991 suggested that if we appropriately proposed by Bezem [1999; 2001] for positive higher-order restrict the syntax of HOLP, then we can obtain a deno- logic programs. Recently, it was demonstrated by Rondo- tational semantics in which predicates denote sets, much giannis and Symeonidou [2018] that by combining the tech- like the traditional semantics of higher-order functional pro- gramming. The most crucial syntactic restriction imposed ∗This paper is an abridged version of a paper with the same tile, by Wadge (and later independently by M. Bezem [1999; that won a best-paper award at the ICLP-2017 conference. 2001]), is the following: 5344 Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence (IJCAI-18) The extensionality syntactic restriction: In the head of ev- with a ground term that has the same type as the variable un- ery rule in a program, each argument of predicate type must der consideration (the formal definition of this procedure will be a variable, and all such variables must be distinct. be given in Definition 9): Example 1 The following is a legitimate program that de- q(a). fines the union of two relations P, Q (for the moment we use q(b). ad-hoc Prolog-like syntax): p(q):-q(a). id(q)(a):-q(a). union(P,Q)(X):-P(X). id(q)(b):-q(b). union(P,Q)(X):-Q(X). p(id(q)):-id(q)(a). However, each of these clauses violates Wadge’s restriction: ··· r(q):-q(a). One can now treat the new program as an infinite proposi- p(Q,Q):-Q(a). tional one (i.e., each ground atom can be seen as a proposi- tional variable). This implies that we can use the standard Under the extensional approach, predicates can be understood least fixed-point construction of classical logic programming declaratively in terms of extensional notions. For example, in order to compute the set of atoms that should be taken as the program: “true”. Bezem demonstrated that the least fixed-point semantics of map(R,[],[]). the ground instantiation of every positive higher-order logic map(R,[H1|T1],[H2|T2]):- R(H1,H2), program of the language considered in [Bezem, 1999; 2001], map(R,T1,T2). is extensional in a sense that can be explained as follows. In our example, q and id(q) are equal since they are both true can be understood in a similar way as the well-known map of exactly the constants a and b. Therefore, we expect that function of Haskell. Moreover, since under the extensional if p(q) is true then p(id(q)) is also true, because q and approach predicates denote sets, two predicates that are id(q) should be considered as indistinguishable. true of the same arguments, are considered indistinguish- We use the same idea with programs that include nega- able. So, for example, if we define two sorting predicates tion: the ground instantiation of such a program can be seen merge sort and quick sort it is guaranteed that any as a (possibly infinite) propositional program with negation. higher-order predicate will have the same behaviour whether Therefore, we can compute its semantics in any standard way it is given merge sort or quick sort as an argument. that exists for obtaining the meaning of such programs and As mentioned by Wadge [1991] “extensionality means ex- then proceed to examine whether the chosen model is exten- actly that predicates are used as black boxes - and the “black sional in the sense of Bezem [1999; 2001]. As we are going box” concept is central to all kinds of engineering”. to see in the subsequent sections, when the ground instan- Another important advantage of this declarative approach tiation of the program is interpreted under the well-founded to higher-order logic programming is that many techniques semantics, the semantics we obtain is not always extensional. and ideas that have been successfully developed in the func- tional programming world (such as program transformations, 4 The Syntax of H optimizations, techniques for proving program correctness, and so on), could be transferred to the higher-order logic pro- In this section we define the syntax of our language H. H gramming domain, opening in this way promising new re- uses a simple type system with two base types: o, the boolean search directions for logic programming as a whole. domain, and ι, the domain of data objects. The composite types are partitioned into three classes: functional (assigned to function symbols), predicate (assigned to predicate sym- 3 An Intuitive Introduction bols) and argument (assigned to parameters of predicates). In this section we give an intuitive description of the semantic Definition 1 A type can either be functional, predicate, or technique for positive higher-order logic programs proposed argument, denoted by σ, π and ρ respectively and defined as: by Bezem [1999; 2001] and we outline how we use it when negation is added to programs. Given a positive program, the σ := ι j (ι ! σ) starting idea behind Bezem’s approach is to take its “ground π := o j (ρ ! π) instantiation”, in which we replace variables with well-typed ρ := ι j π terms constructed from syntactic entities that appear in the program. For example, consider the higher-order program: We will use τ to denote an arbitrary type. The binary op- erator ! is right-associative. It can be easily seen that every q(a). predicate type π can be written in the form ρ1 !···! q(b). ρ ! o, n ≥ 0 (for n = 0 we assume that π = o). p(Q):-Q(a). n id(R)(X):-R(X). Definition 2 The alphabet of H consists of the following: predicate variables of every predicate type π (denoted by cap- In order to obtain the ground instantiation of this program, we ital letters such as Q; R; S;:::); individual variables of type consider each clause and replace each variable of the clause ι (denoted by capital letters such as X; Y; Z;:::); predicate 5345 Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence (IJCAI-18) constants of every predicate type π (denoted by lowercase Definition 9 Let P be a program.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    5 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us