716 research outputs found
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
Proof Relevant Corecursive Resolution
Resolution lies at the foundation of both logic programming and type class
context reduction in functional languages. Terminating derivations by
resolution have well-defined inductive meaning, whereas some non-terminating
derivations can be understood coinductively. Cycle detection is a popular
method to capture a small subset of such derivations. We show that in fact
cycle detection is a restricted form of coinductive proof, in which the atomic
formula forming the cycle plays the role of coinductive hypothesis.
This paper introduces a heuristic method for obtaining richer coinductive
hypotheses in the form of Horn formulas. Our approach subsumes cycle detection
and gives coinductive meaning to a larger class of derivations. For this
purpose we extend resolution with Horn formula resolvents and corecursive
evidence generation. We illustrate our method on non-terminating type class
resolution problems.Comment: 23 pages, with appendices in FLOPS 201
Coinductive subtyping for abstract compilation of object-oriented languages into Horn formulas
In recent work we have shown how it is possible to define very precise type
systems for object-oriented languages by abstractly compiling a program into a
Horn formula f. Then type inference amounts to resolving a certain goal w.r.t.
the coinductive (that is, the greatest) Herbrand model of f.
Type systems defined in this way are idealized, since in the most interesting
instantiations both the terms of the coinductive Herbrand universe and goal
derivations cannot be finitely represented. However, sound and quite expressive
approximations can be implemented by considering only regular terms and
derivations. In doing so, it is essential to introduce a proper subtyping
relation formalizing the notion of approximation between types.
In this paper we study a subtyping relation on coinductive terms built on
union and object type constructors. We define an interpretation of types as set
of values induced by a quite intuitive relation of membership of values to
types, and prove that the definition of subtyping is sound w.r.t. subset
inclusion between type interpretations. The proof of soundness has allowed us
to simplify the notion of contractive derivation and to discover that the
previously given definition of subtyping did not cover all possible
representations of the empty type
Call-by-Value and Call-by-Name Dual Calculi with Inductive and Coinductive Types
This paper extends the dual calculus with inductive types and coinductive
types. The paper first introduces a non-deterministic dual calculus with
inductive and coinductive types. Besides the same duality of the original dual
calculus, it has the duality of inductive and coinductive types, that is, the
duality of terms and coterms for inductive and coinductive types, and the
duality of their reduction rules. Its strong normalization is also proved,
which is shown by translating it into a second-order dual calculus. The strong
normalization of the second-order dual calculus is proved by translating it
into the second-order symmetric lambda calculus. This paper then introduces a
call-by-value system and a call-by-name system of the dual calculus with
inductive and coinductive types, and shows the duality of call-by-value and
call-by-name, their Church-Rosser properties, and their strong normalization.
Their strong normalization is proved by translating them into the
non-deterministic dual calculus with inductive and coinductive types.Comment: The conference version of this paper has appeared in RTA 200
Mendler-style Iso-(Co)inductive predicates: a strongly normalizing approach
We present an extension of the second-order logic AF2 with iso-style
inductive and coinductive definitions specifically designed to extract programs
from proofs a la Krivine-Parigot by means of primitive (co)recursion
principles. Our logic includes primitive constructors of least and greatest
fixed points of predicate transformers, but contrary to the common approach, we
do not restrict ourselves to positive operators to ensure monotonicity, instead
we use the Mendler-style, motivated here by the concept of monotonization of an
arbitrary operator on a complete lattice. We prove an adequacy theorem with
respect to a realizability semantics based on saturated sets and
saturated-valued functions and as a consequence we obtain the strong
normalization property for the proof-term reduction, an important feature which
is absent in previous related work.Comment: In Proceedings LSFA 2011, arXiv:1203.542
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
Exploiting parallelism in coalgebraic logic programming
We present a parallel implementation of Coalgebraic Logic Programming (CoALP)
in the programming language Go. CoALP was initially introduced to reflect
coalgebraic semantics of logic programming, with coalgebraic derivation
algorithm featuring both corecursion and parallelism. Here, we discuss how the
coalgebraic semantics influenced our parallel implementation of logic
programming
Operational Semantics of Resolution and Productivity in Horn Clause Logic
This paper presents a study of operational and type-theoretic properties of
different resolution strategies in Horn clause logic. We distinguish four
different kinds of resolution: resolution by unification (SLD-resolution),
resolution by term-matching, the recently introduced structural resolution, and
partial (or lazy) resolution. We express them all uniformly as abstract
reduction systems, which allows us to undertake a thorough comparative analysis
of their properties. To match this small-step semantics, we propose to take
Howard's System H as a type-theoretic semantic counterpart. Using System H, we
interpret Horn formulas as types, and a derivation for a given formula as the
proof term inhabiting the type given by the formula. We prove soundness of
these abstract reduction systems relative to System H, and we show completeness
of SLD-resolution and structural resolution relative to System H. We identify
conditions under which structural resolution is operationally equivalent to
SLD-resolution. We show correspondence between term-matching resolution for
Horn clause programs without existential variables and term rewriting.Comment: Journal Formal Aspect of Computing, 201
- …