11,117 research outputs found

    Our LIPS are sealed: interfacing logic and functional programming systems

    Get PDF
    technical reportWe report on a technique for interfacing an untyped logic language to a statically poly morphically typed functional language Our key insight is that polymorphic types can be interpreted as "need to know" specifications on function arguments. This leads to a criterion for liberally yet safely invoking the functional language to reduce application terms as required during unification in the logic language. This method called P unification enriches the capabilities of each language while retaining the integrity of their individual semantics and implementation technologies An experimental test has been successfully performed whereby a Horn clause logic programming (HCLP) interpreter written in Common Lisp was interfaced to the Standard ML of New Jersey system. The latter implementation was employed (i) on untyped or dynamically typed data, even though it is statically typed (ii) lazily, even though it is strict and (iii) on alien HCLP terms such as unbound variables - without the slightest modification

    Higher-Order Horn Clauses

    Get PDF
    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

    Logic Programming Based on Higher-Order Hereditary Harrop Formulas

    Get PDF
    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

    A Type-Theoretic Approach to Structural Resolution

    Full text link
    Structural resolution (or S-resolution) is a newly proposed alternative to SLD-resolution that allows a systematic separation of derivations into term-matching and unification steps. Productive logic programs are those for which term-matching reduction on any query must terminate. For productive programs with coinductive meaning, finite term-rewriting reductions can be seen as measures of observation in an infinite derivation. Ability of handling corecursion in a productive way is an attractive computational feature of S-resolution. In this paper, we make first steps towards a better conceptual understanding of operational properties of S-resolution as compared to SLD-resolution. To this aim, we propose a type system for the analysis of both SLD-resolution and S-resolution. We formulate S-resolution and SLD-resolution as reduction systems, and show their soundness relative to the type system. One of the central methods of this paper is realizability transformation, which makes logic programs productive and non-overlapping. We show that S-resolution and SLD-resolution are only equivalent for programs with these two properties.Comment: LOPSTR 201

    Proof Theory, Transformations, and Logic Programming for Debugging Security Protocols

    Get PDF
    We define a sequent calculus to formally specify, simulate, debug and verify security protocols. In our sequents we distinguish between the current knowledge of principals and the current global state of the session. Hereby, we can describe the operational semantics of principals and of an intruder in a simple and modular way. Furthermore, using proof theoretic tools like the analysis of permutability of rules, we are able to find efficient proof strategies that we prove complete for special classes of security protocols including Needham-Schroeder. Based on the results of this preliminary analysis, we have implemented a Prolog meta-interpreter which allows for rapid prototyping and for checking safety properties of security protocols, and we have applied it for finding error traces and proving correctness of practical examples

    Gradual Liquid Type Inference

    Full text link
    Liquid typing provides a decidable refinement inference mechanism that is convenient but subject to two major issues: (1) inference is global and requires top-level annotations, making it unsuitable for inference of modular code components and prohibiting its applicability to library code, and (2) inference failure results in obscure error messages. These difficulties seriously hamper the migration of existing code to use refinements. This paper shows that gradual liquid type inference---a novel combination of liquid inference and gradual refinement types---addresses both issues. Gradual refinement types, which support imprecise predicates that are optimistically interpreted, can be used in argument positions to constrain liquid inference so that the global inference process e effectively infers modular specifications usable for library components. Dually, when gradual refinements appear as the result of inference, they signal an inconsistency in the use of static refinements. Because liquid refinements are drawn from a nite set of predicates, in gradual liquid type inference we can enumerate the safe concretizations of each imprecise refinement, i.e. the static refinements that justify why a program is gradually well-typed. This enumeration is useful for static liquid type error explanation, since the safe concretizations exhibit all the potential inconsistencies that lead to static type errors. We develop the theory of gradual liquid type inference and explore its pragmatics in the setting of Liquid Haskell.Comment: To appear at OOPSLA 201

    Learning to Understand by Evolving Theories

    Full text link
    In this paper, we describe an approach that enables an autonomous system to infer the semantics of a command (i.e. a symbol sequence representing an action) in terms of the relations between changes in the observations and the action instances. We present a method of how to induce a theory (i.e. a semantic description) of the meaning of a command in terms of a minimal set of background knowledge. The only thing we have is a sequence of observations from which we extract what kinds of effects were caused by performing the command. This way, we yield a description of the semantics of the action and, hence, a definition.Comment: KRR Workshop at ICLP 201

    The Synthesis of Logic Programs from Inductive Proofs

    Get PDF
    corecore