279 research outputs found
Elements of computability, decidability, and complexity (Third edition)
These lecture notes are intended to introduce the reader to the
basic notions of computability theory, decidability, and complexity. More
information on these subjects can be found in classical books such as [Cut80,Dav58,Her69,HoU79,Rog67].
The results reported in these notes are taken from those books and in various
parts we closely follow their style of presentation. The reader is encouraged
to look at those books for improving his/her knowledge on these topics. Some
parts of the chapter on complexity are taken from the lecture notes of a
beautiful course given by Prof. Leslie Valiant at Edinburgh University,
Scotland, in 1979. It was, indeed, a very stimulating and enjoyable course.
For the notions of Predicate Calculus we have used in this book the reader
may refer to [Men87].
I would like to thank Dr. Maurizio Proietti at IASI-CNR (Roma, Italy),
my colleagues, and my students at the University of Roma Tor Vergata and,
in particular, Michele Martone. They have been for me a source of continuous
inspiration and enthusiasm.
Finally, I would like to thank Dr. Gioacchino Onorati and Lorenzo Costantini
of the Aracne Publishing Company for their helpful cooperation
Transforming Normal Programs by Replacement
The replacement transformation operation, already defined in [28], is studied wrt normal programs. We give applicability conditions able to ensure the correctness of the operation wrt Fitting's and Kunen's semantics. We show how replacement can mimic other transformation operations such as thinning, fattening and folding, thus producing applicability conditions for them too. Furthermore we characterize a transformation sequence for which the preservation of Fitting's and Kunen's semantics is ensured
Totally correct logic program transformations via well-founded annotations
We address the problem of proving the total correctness of transformations of definite logic programs. We consider a general transformation rule, called clause replacement,
which consists in transforming a program P into a new program Q by replacing a set Γ1 of
clauses occurring in P by a new set Γ2 of clauses, provided that Γ1 and Γ2 are equivalent in the least Herbrand model M(P) of the program P.
We propose a general method for proving that transformations based on clause replacement are totally correct, that is, M(P) = M(Q). Our method consists in showing that the
transformation of P into Q can be performed by: (i) adding extra arguments to predicates,
thereby deriving from the given program P an annotated program P, (ii) applying a variant
of the clause replacement rule and transforming the annotated program P into a terminating
annotated program Q, and (iii) erasing the annotations from Q, thereby getting Q.
Our method does not require that either P or Q are terminating and it is parametric with
respect to the annotations. By providing different annotations we can easily prove the total correctness of program transformations based on various versions of the popular unfolding, folding, and goal replacement rules, which can all be viewed as particular cases of our clause replacement rule
Transformations of Logic Programs on Infinite Lists
We consider an extension of logic programs, called \omega-programs, that can
be used to define predicates over infinite lists. \omega-programs allow us to
specify properties of the infinite behavior of reactive systems and, in
general, properties of infinite sequences of events. The semantics of
\omega-programs is an extension of the perfect model semantics. We present
variants of the familiar unfold/fold rules which can be used for transforming
\omega-programs. We show that these new rules are correct, that is, their
application preserves the perfect model semantics. Then we outline a general
methodology based on program transformation for verifying properties of
\omega-programs. We demonstrate the power of our transformation-based
verification methodology by proving some properties of Buechi automata and
\omega-regular languages.Comment: 37 pages, including the appendix with proofs. This is an extended
version of a paper published in Theory and Practice of Logic Programming, see
belo
Techniques for searching, parsing, and matching (fourth edition)
These lecture notes present some basic techniques for: (i) exploring search spaces, (ii) parsing context-free languages, and (iii) matching patterns in strings. These techniques are taught in a course on Automata, Languages, and Translators at the University of Roma "Tor Vergata''. We assume that the reader is familiar with the basic notions of Automata Theory and Formal Languages. These notions can be found in many books such as [Har78,HoU79,Pet13a].
Some of the algorithms we have presented in these notes are written in Java 1.5 and some others in Prolog. For the Java language the reader may refer to the Java Tutorial at http://java.sun.com/docs/books/tutorial/} .
(Recall that this Java version allows the use of parameterized types, also called generics.) All Java programs have been compiled using the Java compiler 1.5.0-13 running under Mac OS X 10.4.11 Darwin 8.11.1.
For the Prolog language the reader may refer to [ClM84]. The Prolog language incorporates a backtracking mechanism which is useful for exploring search spaces and solving parsing and matching problems
Combining Syntactic and Semantic Bidirectionalization
Matsuda et al. [2007, ICFP] and Voigtlander [2009, POPL] introduced two techniques that given a source-to-view function provide an update propagation function mapping an original source and an updated view back to an updated source, subject to standard consistency conditions. Being fundamentally different in approach, both
techniques have their respective strengths and weaknesses. Here we develop a synthesis of the two techniques to good effect. On the intersection of their applicability domains we achieve more than what a simple union of applying the techniques side by side deliver
On Uniquely Closable and Uniquely Typable Skeletons of Lambda Terms
Uniquely closable skeletons of lambda terms are Motzkin-trees that
predetermine the unique closed lambda term that can be obtained by labeling
their leaves with de Bruijn indices. Likewise, uniquely typable skeletons of
closed lambda terms predetermine the unique simply-typed lambda term that can
be obtained by labeling their leaves with de Bruijn indices.
We derive, through a sequence of logic program transformations, efficient
code for their combinatorial generation and study their statistical properties.
As a result, we obtain context-free grammars describing closable and uniquely
closable skeletons of lambda terms, opening the door for their in-depth study
with tools from analytic combinatorics.
Our empirical study of the more difficult case of (uniquely) typable terms
reveals some interesting open problems about their density and asymptotic
behavior.
As a connection between the two classes of terms, we also show that uniquely
typable closed lambda term skeletons of size are in a bijection with
binary trees of size .Comment: Pre-proceedings paper presented at the 27th International Symposium
on Logic-Based Program Synthesis and Transformation (LOPSTR 2017), Namur,
Belgium, 10-12 October 2017 (arXiv:1708.07854
Improving Prolog Programs: Refactoring for Prolog
Refactoring is an established technique from the OO-community to restructure
code: it aims at improving software readability, maintainability and
extensibility. Although refactoring is not tied to the OO-paradigm in
particular, its ideas have not been applied to Logic Programming until now.
This paper applies the ideas of refactoring to Prolog programs. A catalogue
is presented listing refactorings classified according to scope. Some of the
refactorings have been adapted from the OO-paradigm, while others have been
specifically designed for Prolog. Also the discrepancy between intended and
operational semantics in Prolog is addressed by some of the refactorings.
In addition, ViPReSS, a semi-automatic refactoring browser, is discussed and
the experience with applying \vipress to a large Prolog legacy system is
reported. Our main conclusion is that refactoring is not only a viable
technique in Prolog but also a rather desirable one.Comment: To appear in ICLP 200
On completeness of logic programs
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
- …