32 research outputs found

    Correctness and completeness of logic programs

    Full text link
    We discuss proving correctness and completeness of definite clause logic programs. We propose a method for proving completeness, while for proving correctness we employ a method which should be well known but is often neglected. Also, we show how to prove completeness and correctness in the presence of SLD-tree pruning, and point out that approximate specifications simplify specifications and proofs. We compare the proof methods to declarative diagnosis (algorithmic debugging), showing that approximate specifications eliminate a major drawback of the latter. We argue that our proof methods reflect natural declarative thinking about programs, and that they can be used, formally or informally, in every-day programming.Comment: 29 pages, 2 figures; with editorial modifications, small corrections and extensions. arXiv admin note: text overlap with arXiv:1411.3015. Overlaps explained in "Related Work" (p. 21

    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

    On completeness of logic programs

    Full text link
    Program correctness (in imperative and functional programming) splits in logic programming into correctness and completeness. Completeness means that a program produces all the answers required by its specification. Little work has been devoted to reasoning about completeness. This paper presents a few sufficient conditions for completeness of definite programs. We also study preserving completeness under some cases of pruning of SLD-trees (e.g. due to using the cut). We treat logic programming as a declarative paradigm, abstracting from any operational semantics as far as possible. We argue that the proposed methods are simple enough to be applied, possibly at an informal level, in practical Prolog programming. We point out importance of approximate specifications.Comment: 20 page

    An assertion language for constraint logic programs

    Full text link
    In an advanced program development environment, such as that discussed in the introduction of this book, several tools may coexist which handle both the program and information on the program in different ways. Also, these tools may interact among themselves and with the user. Thus, the different tools and the user need some way to communicate. It is our design principie that such communication be performed in terms of assertions. Assertions are syntactic objects which allow expressing properties of programs. Several assertion languages have been used in the past in different contexts, mainly related to program debugging. In this chapter we propose a general language of assertions which is used in different tools for validation and debugging of constraint logic programs in the context of the DiSCiPl project. The assertion language proposed is parametric w.r.t. the particular constraint domain and properties of interest being used in each different tool. The language proposed is quite general in that it poses few restrictions on the kind of properties which may be expressed. We believe the assertion language we propose is of practical relevance and appropriate for the different uses required in the tools considered

    Coherent Integration of Databases by Abductive Logic Programming

    Full text link
    We introduce an abductive method for a coherent integration of independent data-sources. The idea is to compute a list of data-facts that should be inserted to the amalgamated database or retracted from it in order to restore its consistency. This method is implemented by an abductive solver, called Asystem, that applies SLDNFA-resolution on a meta-theory that relates different, possibly contradicting, input databases. We also give a pure model-theoretic analysis of the possible ways to `recover' consistent data from an inconsistent database in terms of those models of the database that exhibit as minimal inconsistent information as reasonably possible. This allows us to characterize the `recovered databases' in terms of the `preferred' (i.e., most consistent) models of the theory. The outcome is an abductive-based application that is sound and complete with respect to a corresponding model-based, preferential semantics, and -- to the best of our knowledge -- is more expressive (thus more general) than any other implementation of coherent integration of databases

    The CIFF Proof Procedure for Abductive Logic Programming with Constraints: Definition, Implementation and a Web Application

    Get PDF
    Abduction has found broad application as a powerful tool for hypothetical reasoning with incomplete knowledge, which can be handled by labeling some pieces of information as abducibles, i.e. as possible hypotheses that can be assumed to hold, provided that they are consistent with the given knowledge base. Attempts to make the abductive reasoning an effective computational tool gave rise to Abductive Logic Programming (ALP) which combines abduction with standard logic programming. A number of so-called proof procedures for ALP have been proposed in the literature, e.g. the IFF procedure, the Kakas and Mancarella procedure and the SLDNFA procedure, which rely upon extensions of different semantics for logic programming. ALP has also been integrated with Constraint Logic Programming (CLP), in order to combine abductive reasoning with an arithmetic tool for constraint solving. In recent years, many proof procedures for abductive logic programming with constraints have been proposed, including ACLP and the A-System which have been applied to many fields, e.g. multi-agent systems, scheduling, integration of information. This dissertation describes the development of a new abductive proof procedure with constraints, namely the CIFF proof procedure. The description is both at the theoretical level, giving a formal definition and a soundness result with respect to the three-valued completion semantics, and at the implementative level with the implemented CIFF System 4.0 as a Prolog meta-interpreter. The main contributions of the CIFF proof procedure are the advances in the expressiveness of the framework with respect to other frameworks for abductive logic programming with constraints, and the overall computational performances of the implemented system. The second part of the dissertation presents a novel application of the CIFF proof procedure as the computational engine of a tool, the CIFFWEB system, for checking and (possibly) repairing faulty web sites. Indeed, the exponential growth of the WWW raises the question of maintaining and automatically repairing web sites, in particular when the designers of these sites require them to exhibit certain properties at both structural and data level. The capability of maintaining and repairing web sites is also important to ensure the success of the Semantic Web vision. As the Semantic Web relies upon the definition and the maintenance of consistent data schemas (XML/XMLSchema, RDF/RDFSchema, OWL and so on), tools for reasoning over such schemas (and possibly extending the reasoning to multiple web pages) show great promise. The CIFFWEB system is such a tool which allows to verify and to repair XML web sites instances, against sets of requirements which have to be fulfilled, through abductive reasoning. We define an expressive characterization of rules for checking and repairing web sites' errors and we do a formal mapping of a fragment of a well known XML query language, namely Xcerpt, to abductive logic programs suitable to fed as input to the CIFF proof procedure. Finally, the CIFF proof procedure detects the errors and possibly suggests modifications to the XML instances to repair them. The soundness of this process is directly inherited from the soundness of CIFF

    Introduction to logic programming

    Get PDF
    corecore