42 research outputs found
Higher-Order Horn Clauses
A generalization of Horn clauses to a higher-order logic is described and examined as a basis for logic programming. In qualitative terms, these higher-order Horn clauses are obtained from the first-order ones by replacing first-order terms with simply typed 位-terms and by permitting quantification over all occurrences of function symbols and some occurrences of predicate symbols. Several proof-theoretic results concerning these extended clauses are presented. One result shows that although the substitutions for predicate variables can be quite complex in general, the substitutions necessary in the context of higher-order Horn clauses are tightly constrained. This observation is used to show that these higher-order formulas can specify computations in a fashion similar to first-order Horn clauses. A complete theorem proving procedure is also described for the extension. This procedure is obtained by interweaving higher-order unification with backchaining and goal reductions, and constitutes a higher-order generalization of SLD-resolution. These results have a practical realization in the higher-order logic programming language called 位Prolog
Abstractions in Logic Programs
Most logic programming languages have the first-order, classical theory of Horn clauses as their logical foundation. Purely proof-theoretical considerations show that Horn clauses are not rich enough to naturally provide the abstraction mechanisms that are common in most modern, general purpose programming languages. For example, Horn clauses do not incorporate the important software abstraction mechanisms of modules, data type abstractions, and higher-order programming.
As a result of this lack, implementers of logic programming languages based on Horn clauses generally add several nonlogical primitives on top of Horn clauses to provide these missing abstraction mechanisms. Although the missing features are often captured in this fashion, formal semantics of the resulting languages are often lacking or are very complex. Another approach to providing these missing features is to enrich the underlying logical foundation of logic programming. This latter approach to providing logic programs with these missing abstraction mechanisms is taken in this paper. The enrichments we will consider have simple and direct operational and proof theoretical semantics
Use of Higher-Order Unification for Implementing Program Transformers
Source-to-source program transformers belong to the class of meta-programs that manipulate programs as objects. It has previously been argued that a higher-order extension of Prolog, such as 位Prolog, makes a suitable implementation language for such meta-programs. In this paper, we consider this claim in more detail. In 位Prolog, object-level programs and program schemata can be represented using simply typed 位-terms and higher-order (functional) variables. Unification of these 位-terms, called higher-order unification, can elegantly describe several important meta-level operations on programs. We detail some properties of higher-order unification that make it suitable for analyzing program structures. We then present (in 位Prolog) the specification of several simple program transformers together with a more involved partial evaluator. With the depth-first control strategy of 位Prolog for both clause selection and unifier selection all the above mentioned specifications can be and have been executed and tested
Logic Programming Based on Higher-Order Hereditary Harrop Formulas
Hereditary Harrop formulas are an extension to Horn clauses in which the body of clauses can contain implications and universal quantifiers. These formulas can further be extended by embedding them in a higher-order logic; that is, by permitting quantification over function symbol occurrences and some predicate symbol occurrences, and by replacing first-order terms with simply typed 位-terms. Our justification for considering this rich extension of Horn clause theory as a satisfactory logic programming language is provided by a proof-theoretic notion we call uniform proofs . This notion will be defined and motivated. This extended language can provide very natural and direct implementations of various kinds of abstraction mechanisms. For example, higher-order hereditary Harrop formulas (hohh) can be used to support aspects of modular programming, abstract data types, and higher-order programming.
We have designed and built a logic programming system which implements hohh in much the same way Prolog implements first-order Horn clauses. This language and its interpreter, collectively called 位Prolog, will be described. We will present several example programs where 位Prolog provides a much more immediate and satisfactory implementation language than first-order Prologs. These examples are taken from theorem proving and program transformation. Finally, we will describe some aspects of our implementation of 位Prolog
An Overview of Lambda-Prolog
位-Prolog is a logic programming language that extends Prolog by incorporating notions of higher-order functions, 位-terms, higher-order unification, polymorphic types, and mechanisms for building modules and secure abstract data types. These new features are provided in a principled fashion by extending the classical first-order theory of Horn clauses to the intuitionistic higher-order theory of hereditary Harrop formulas. The justification for considering this extension a satisfactory logic programming language is provided through the proof-theoretic notion of a uniform proof. The correspondence between each extension to Prolog and the new features in the stronger logical theory is discussed. Also discussed are various aspects of an experimental implementation of 位-Prolog
Neural-Symbolic Recommendation with Graph-Enhanced Information
The recommendation system is not only a problem of inductive statistics from
data but also a cognitive task that requires reasoning ability. The most
advanced graph neural networks have been widely used in recommendation systems
because they can capture implicit structured information from graph-structured
data. However, like most neural network algorithms, they only learn matching
patterns from a perception perspective. Some researchers use user behavior for
logic reasoning to achieve recommendation prediction from the perspective of
cognitive reasoning, but this kind of reasoning is a local one and ignores
implicit information on a global scale. In this work, we combine the advantages
of graph neural networks and propositional logic operations to construct a
neuro-symbolic recommendation model with both global implicit reasoning ability
and local explicit logic reasoning ability. We first build an item-item graph
based on the principle of adjacent interaction and use graph neural networks to
capture implicit information in global data. Then we transform user behavior
into propositional logic expressions to achieve recommendations from the
perspective of cognitive reasoning. Extensive experiments on five public
datasets show that our proposed model outperforms several state-of-the-art
methods, source code is avaliable at [https://github.com/hanzo2020/GNNLR].Comment: 12 pages, 2 figures, conferenc
Knowledge Refactoring for Inductive Program Synthesis
Humans constantly restructure knowledge to use it more efficiently. Our goal
is to give a machine learning system similar abilities so that it can learn
more efficiently. We introduce the \textit{knowledge refactoring} problem,
where the goal is to restructure a learner's knowledge base to reduce its size
and to minimise redundancy in it. We focus on inductive logic programming,
where the knowledge base is a logic program. We introduce Knorf, a system which
solves the refactoring problem using constraint optimisation. We evaluate our
approach on two program induction domains: real-world string transformations
and building Lego structures. Our experiments show that learning from
refactored knowledge can improve predictive accuracies fourfold and reduce
learning times by half.Comment: 7 pages, 6 figure