14 research outputs found

    Logic + control: An example

    Get PDF
    We present a Prolog program - the SAT solver of Howe and King - as a (pure) logic program with added control. The control consists of a selection rule (delays of Prolog) and pruning the search space. We construct the logic program together with proofs of its correctness and completeness, with respect to a formal specification. Correctness and termination of the logic program are inherited by the Prolog program; the change of selection rule preserves completeness. We prove that completeness is also preserved by one case of pruning; for the other an informal justification is presented. For proving correctness we use a method, which should be well known but is often neglected. For proving program completeness we employ a new, simpler variant of a method published previously. We point out usefulness of approximate specifications. We argue that the proof methods correspond to natural declarative thinking about programs, and that they can be used, formally or informally, in every-day programming

    A simple correctness proof for magic transformation

    No full text
    The paper presents a simple and concise proof of correctness of the magic transformation. We believe that it may provide a useful example of formal reasoning about logic programs. The correctness property concerns the declarative semantics. The proof, however, refers to the operational semantics (LD-resolution) of the source programs. Its conciseness is due to applying a suitable proof method

    A Floyd-Hoare Method for Prolog

    No full text
    We present an inductive assertion method for proving run-time properties of logic programs. The method could be seen as a logic programming counterpart of the well-known approach of Floyd and Hoare for imperative programs.   The method concerns assertions assigned to program points and makes it possible to prove that whenever the control reaches a program point the corresponding assertion is satisfied.   We also show a way of augmenting the method to prove termination. An assertion (assigned to a point in a program clause) describes a set of substitutions (for the variables of the clause).   Assertions may be not monotonic (i.e. not closed under substitutions).Presented at Workshop on Verication and Analysis of Logic, Programs at Joint International Conference and Symposium onLogic Programming, JICSLP Bonn, Germany September 1996</p

    On Correctness and Completeness of an n Queens Program

    No full text
    Thom Fruhwirth presented a short, elegant, and efficient Prolog program for the n queens problem. However, the program may be seen as rather tricky and one may not be convinced about its correctness. This paper explains the program in a declarative way and provides proofs of its correctness and completeness. The specification and the proofs are declarative, that is they abstract from any operational semantics. The specification is approximate, it is unnecessary to describe the programs semantics exactly. Despite the program works on non-ground terms, this work employs the standard semantics, based on logical consequence and Herbrand interpretations. Another purpose of the paper is to present an example of precise declarative reasoning about the semantics of a logic program

    Completeness Of SLDNF-Resolution For Non-Floundering Queries

    No full text
    this paper we show that SLDNF-resolution is complete for non-floundering goals under some natural conditions concerning fairness. The novelty of our approach is that we relate the completeness directly to non-floundering and we deal with arbitrary normal programs and goals. The paper is organized as follows. The next section contains the outline of the paper. Section 3 presents the concepts necessary for our work. Among others we need a constraint representation of resolution where instead of applying mgu&apos;s the corresponding equations are added to the goals. That section also presents SLDFA-resolution [Dra95] which is a generalization of SLDNF-resolution for constructive negation. A completeness result for SLDFA-resolution [Dra95] is a starting point for our work. The next two sections introduce SLDNF1-resolution and discuss floundering. SLDNF1-resolution can be seen as an alternative definition of SLDNF-resolution. We introduce it in order to be able to deal with fairness. Section 6 presents our completeness results for SLDNF1-resolution and for SLDNFresolution. The last section shows how 3-valued completion semantics can be represented in a standard 2-valued logic. We assume that the reader is familiar with basics of logic programming, SLDNFresolution [Llo87] and the Kunen semantics [Kun87].

    It Is Declarative - On Reasoning About LOGIC PROGRAMS

    No full text
    We advocate using the declarative reading in proving partial correctness of logic programs, when the properties of interest are declarative. Some recently published work presents unnecessarily complicated methods for proving such properties. These approaches refer to the operational semantics, as they consider calls and successes of the predicates of the program during LD-resolution. We show that this is an unnecessary complication and that a straightforward proof method is simpler and more general. Our approach is based solely on the property that &quot;whatever is computed is a logical consequence of the program &quot;. This approach is not new and can be traced back to the work of Clark in 1979. However it seems that it has been - to a certain extent - forgotten. The paper deals with partial correctness, we complement it with an outline of a method for proving completeness. In this paper we recall a simple and straightforward method of proving partial correctness properties of definite claus..

    Inductive Assertion Method For Logic Programs

    No full text
    Certain properties of logic programs are inexpressible in terms of their declarative semantics. One example of such properties would be the actual form of procedure calls and successes which occur during computations of a program. They are often used by programmers in their informal reasoning. In this paper, the inductive assertion method for proving partial correctness of logic programs is introduced and proved sound. The method makes it possible to formulate and prove properties which are inexpressible in terms of the declarative semantics. An execution mechanism using the Prolog computation rule and arbitrary search strategy (eg. OR-parallelism or Prolog backtracking) is assumed. The method may be also used to specify the semantics of some extra-logical built-in procedures for which the declarative semantics is not applicable. 1. INTRODUCTION One of the most attractive features of logic programs is their declarative semantics [Apt, van Emden][Lloyd]. It describes program meaning in ..

    Inferring call and success types for CLP programs

    No full text
    This paper proposes a tool to support reasoning about (partial) correctness of constraint logic programs. The tool infers a specification that approximates the semantics of a given program. The main intended application is program debugging. We deal with a &quot;callsuccess &quot; semantics of CLP. We consider a restricted class of specifications, which are regular types of constrained atoms. The call-success semantics of a CLP program is characterized by the declarative semantics of another CLP program (&quot;magic transformation&quot;). Then bottom-up abstract interpretation is used to approximate the latter. We study the theoretical background of this approach. We are mainly interested in applying it to CLP over finite domains. Our prototype program analyzer works for the programming language CHIP. 1 Introduction and motivation The work reported addresses the problem of correctness of CLP programs. Intuitively, a program is correct if it behaves as expected by the user. But user expectations are seldo..

    Automatic Diagnosis of VLSI Digital Circuits Using Algorithmic Debugging

    No full text
    . This paper discusses application of the technique of algorithmic debugging, originating from logic programming, to automatic diagnosis of VLSI digital circuits. In particular, the main aim of the presented work is to provide a method for smooth combination of different diagnosis techniques, where the use of logic specifications and algorithmic debugging plays an essential role. Examples of the application of the proposed method to combinational and to sequential circuits are presented. Keywords: Digital Circuits Diagnosis, Logic Programming, Algorithmic Debugging of Logic Programs, Design Automation 1 Introduction This paper shows how the concept of algorithmic debugging, originating from logic programming [Sha 82], can be used for diagnosis of digital circuits. The general aim of our work is to create a framework for smooth combination of different diagnosis techniques where the use of logic specifications and algorithmic debugging play an essential role. Digital circuits are built..
    corecore