9 research outputs found
Structural Resolution with Co-inductive Loop Detection
A way to combine co-SLD style loop detection with structural resolution was
found and is introduced in this work, to extend structural resolution with
co-induction. In particular, we present the operational semantics, called
co-inductive structural resolution, of this novel combination and prove its
soundness with respect to the greatest complete Herbrand model.Comment: In Proceedings CoALP-Ty'16, arXiv:1709.0419
Structural resolution for abstract compilation of object-oriented languages
We propose abstract compilation for precise static type analysis of
object-oriented languages based on coinductive logic programming. Source code
is translated to a logic program, then type-checking and inference problems
amount to queries to be solved with respect to the resulting logic program. We
exploit a coinductive semantics to deal with infinite terms and proofs produced
by recursive types and methods. Thanks to the recent notion of structural
resolution for coinductive logic programming, we are able to infer very precise
type information, including a class of irrational recursive types causing
non-termination for previously considered coinductive semantics. We also show
how to transform logic programs to make them satisfy the preconditions for the
operational semantics of structural resolution, and we prove this step does not
affect the semantics of the logic program.Comment: In Proceedings CoALP-Ty'16, arXiv:1709.0419
Corecursive featherweight Java revisited
We describe a Java-like calculus which supports cyclic data structures, and offers a mechanism of flexible regular corecursion for their manipulation. The calculus enhances an earlier proposal by a more sophisticated reduction semantics, which filters out, by an additional check, some spurious results which were obtained in the previous model
Productive Corecursion in Logic Programming
Logic Programming is a Turing complete language. As a consequence, designing
algorithms that decide termination and non-termination of programs or decide
inductive/coinductive soundness of formulae is a challenging task. For example,
the existing state-of-the-art algorithms can only semi-decide coinductive
soundness of queries in logic programming for regular formulae. Another, less
famous, but equally fundamental and important undecidable property is
productivity. If a derivation is infinite and coinductively sound, we may ask
whether the computed answer it determines actually computes an infinite
formula. If it does, the infinite computation is productive. This intuition was
first expressed under the name of computations at infinity in the 80s. In
modern days of the Internet and stream processing, its importance lies in
connection to infinite data structure processing.
Recently, an algorithm was presented that semi-decides a weaker property --
of productivity of logic programs. A logic program is productive if it can give
rise to productive derivations. In this paper we strengthen these recent
results. We propose a method that semi-decides productivity of individual
derivations for regular formulae. Thus we at last give an algorithmic
counterpart to the notion of productivity of derivations in logic programming.
This is the first algorithmic solution to the problem since it was raised more
than 30 years ago. We also present an implementation of this algorithm.Comment: Paper presented at the 33nd International Conference on Logic
Programming (ICLP 2017), Melbourne, Australia, August 28 to September 1, 2017
16 pages, LaTeX, no figure
Sound Regular Corecursion in coFJ
The aim of the paper is to provide solid foundations for a programming paradigm natively supporting the creation and manipulation of cyclic data structures. To this end, we describe coFJ, a Java-like calculus where objects can be infinite and methods are equipped with a codefinition (an alternative body). We provide an abstract semantics of the calculus based on the framework of inference systems with corules. In coFJ with this semantics, FJ recursive methods on finite objects can be extended to infinite objects as well, and behave as desired by the programmer, by specifying a codefinition. We also describe an operational semantics which can be directly implemented in a programming language, and prove the soundness of such semantics with respect to the abstract one
Flexible Coinduction
openRecursive definitions of predicates by means of inference rules are ubiquitous in computer science. They are usually interpreted inductively or coinductively, however there are situations where none of these two options provides the expected meaning. In the thesis we propose a flexible form of coinductive interpretation, based on the notion of corules, able to deal with such situations.
In the first part, we define such flexible coinductive interpretation as a fixed point of the standard inference operator lying between the least and the greatest one, and we provide several equivalent proof-theoretic semantics, combining well-founded and non-well-founded derivations. This flexible interpretation nicely subsumes standard inductive and coinductive ones and is naturally associated with a proof principle, which smoothly extends the usual coinduction principle.
In the second part, we focus on the problem of modelling infinite behaviour by a big-step operational semantics, which is a paradigmatic example where neither induction nor coinduction provide the desired interpretation. In order to be independent from specific examples, we provide a general, but simple, definition of what a big-step semantics is. Then, we extend it to include also observations, describing the interaction with the environment, thus providing a richer description of the behaviour of programs. In both settings, we show how corules can be successfully adopted to model infinite behaviour, by providing a construction extending a big-step semantics, which as usual only describes finite computations, to a richer one including infinite computations as well. Finally, relying on these constructions, we provide a proof technique to show soundness of a predicate with respect to a big-step semantics.
In the third part, we ez face eez the problem of providing an algorithmic support to corules. To this end, we consider the restriction of the flexible coinductive interpretation to regular derivations, analysing again both proof-theoretic and fixed point semantics and developing proof techniques. Furthermore, we show that this flexible regular interpretation can be equivalently characterised inductively by a cycle detection mechanism, thus obtaining a sound and complete (abstract) (semi-)algorithm to check whether a judgement is derivable. Finally, we apply such results to extend logic programming by coclauses, the analogous of corules, defining declarative and operational semantics and proving ez that eez the latter is sound and complete with respect to the regular declarative model, thus obtaining a concrete support to flexible coinduction.openXXXIII CICLO - INFORMATICA E INGEGNERIA DEI SISTEMI/ COMPUTER SCIENCE AND SYSTEMS ENGINEERING - Informatica/computer scienceDagnino, Francesc
Enhancing Regular Corecursion
Nowadays, data structures which are conceptually infinite, such as streams or infinite trees, are very common in computer science. When it comes to their manipulation, one major problem to face is how to finitely represent and deal with them without incurring in non-terminating behaviours. Regular corecursion is a solution relying on finite representation of regular data structures, and detection of cyclic calls. The topics in the thesis revolve around two enhancements of regular corecursion in different directions. In the first part, we present Corecursive Featherweight Java (coFJ), an object-oriented calculus which supports flexible regular corecursion, that is, allows the programmer to specify the behaviour when a cyclic call is found. In the second part, instead, we extend regular corecursion beyond regular terms, focusing on the significant case of stream definitions
Categorical Modelling of Logic Programming: Coalgebra, Functorial Semantics, String Diagrams
Logic programming (LP) is driven by the idea that logic subsumes computation. Over the
past 50 years, along with the emergence of numerous logic systems, LP has also grown into a
large family, the members of which are designed to deal with various computation scenarios.
Among them, we focus on two of the most influential quantitative variants are probabilistic
logic programming (PLP) and weighted logic programming (WLP).
In this thesis, we investigate a uniform understanding of logic programming and its quan-
titative variants from the perspective of category theory. In particular, we explore both a
coalgebraic and an algebraic understanding of LP, PLP and WLP.
On the coalgebraic side, we propose a goal-directed strategy for calculating the probabilities
and weights of atoms in PLP and WLP programs, respectively. We then develop a coalgebraic
semantics for PLP and WLP, built on existing coalgebraic semantics for LP. By choosing
the appropriate functors representing probabilistic and weighted computation, such coalgeraic
semantics characterise exactly the goal-directed behaviour of PLP and WLP programs.
On the algebraic side, we define a functorial semantics of LP, PLP, and WLP, such that they
three share the same syntactic categories of string diagrams, and differ regarding to the semantic
categories according to their data/computation type. This allows for a uniform diagrammatic
expression for certain semantic constructs. Moreover, based on similar approaches to Bayesian
networks, this provides a framework to formalise the connection between PLP and Bayesian
networks. Furthermore, we prove a sound and complete aximatization of the semantic category
for LP, in terms of string diagrams. Together with the diagrammatic presentation of the
fixed point semantics, one obtain a decidable calculus for proving the equivalence between
propositional definite logic programs
Integration of the Process Algebra CSP in Dependent Type Theory - Formalisation and Verification
We introduce a library called CSP-Agda for representing processes in the dependently typed theorem prover and interactive programming language Agda. We will enhance processes by a monad structure. The monad struc-ture facilitates combining processes in a modular way, and allows to define recursion as a direct operation on processes. Processes are defined coinduc-tively as non-well-founded trees. The nodes of the tree are formed by a an atomic one step relation, which determines for a process the external, internal choices, and termination events it can choose, and whether the process has terminated. The data type of processes is inspired by Setzer and Hancock’s notion of interactive programs in dependent type theory. The operators of CSP will be defined rather than atomic operations, and compute new ele-ments of the data type of processes from existing ones.The approach will make use of advanced type theoretic features: the use of inductive-recursively defined universes; the definition of coinductive types by their observations, which has similarities to the notion of an object in object-oriented programming; the use of sized types for coinductive types, which allow coinductive definitions in a modular way; the handling of fini-tary information (names of processes) in a coinductive settings; the use of named types for automatic inference of arguments similar to its use in tem-plate Meta-programming in C++; and the use of interactive programs in dependent type theory.We introduce a simulator as an interactive program in Agda. The simula-tor allows to observe the evolving of processes following external or internal choices. Our aim is to use this in order to simulate railway interlocking system and write programs in Agda which directly use CSP processes.Then we extend the trace semantics of CSP to the monadic setting. We implement this semantics, together with the corresponding refinement and equality relation, formally in CSP-Agda. In order to demonstrate the proof capabilities of CSP-Agda, we prove in CSP-Agda selected algebraic laws of CSP based on the trace semantics. Because of the monadic settings, some adjustments need to be made to these laws.Next we implement the more advanced semantics of CSP, the stable fail-ures semantics and the failures divergences infinite traces semantics (FDI), in CSP-Agda, and define the corresponding refinement and equality relations. Direct proofs in these semantics are cumbersome, and we develop a tech-nique of showing algebraic laws in those semantics in an indirect way, which is much easier. We introduce divergence-respecting weak bisimilarity and strong bisimilarity in CSP-Agda, and show that both imply equivalence with respect to stable failures and FDI semantics. Now we show certain algebraic laws with respect to one of these two bisimilarity relations. As a case study, we model and verify a possible scenario for railways in CSP-Agda and in standard CSP tools