152 research outputs found

    Flexible Coinduction in Agda

    Get PDF
    We provide an Agda library for inference systems, also supporting their recent generalization allowing flexible coinduction, that is, interpretations which are neither inductive, nor purely coinductive. A specific inference system can be obtained as an instance by writing a set of meta-rules, in an Agda format which closely resembles the usual one. In this way, the user gets for free the related properties, notably the inductive and coinductive intepretation and the corresponding proof principles. Moreover, a significant modularity is achieved. Indeed, rather than being defined from scratch and with a built-in interpretation, an inference system can also be obtained by composition operators, such as union and restriction to a smaller universe, and its semantics can be modularly chosen as well. In particular, flexible coinduction is obtained by composing in a certain way the interpretations of two inference systems. We illustrate the use of the library by several examples. The most significant one is a big-step semantics for the ?-calculus, where flexible coinduction allows to obtain a special result (?) for all and only the diverging computations, and the proof of equivalence with small-step semantics is carried out by relying on the proof principles offered by the library

    Sound Regular Corecursion in coFJ

    Get PDF
    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

    Infinitary λ\lambda-Calculi from a Linear Perspective (Long Version)

    Get PDF
    We introduce a linear infinitary λ\lambda-calculus, called ℓΛ∞\ell\Lambda_{\infty}, in which two exponential modalities are available, the first one being the usual, finitary one, the other being the only construct interpreted coinductively. The obtained calculus embeds the infinitary applicative λ\lambda-calculus and is universal for computations over infinite strings. What is particularly interesting about ℓΛ∞\ell\Lambda_{\infty}, is that the refinement induced by linear logic allows to restrict both modalities so as to get calculi which are terminating inductively and productive coinductively. We exemplify this idea by analysing a fragment of ℓΛ\ell\Lambda built around the principles of SLL\mathsf{SLL} and 4LL\mathsf{4LL}. Interestingly, it enjoys confluence, contrarily to what happens in ordinary infinitary λ\lambda-calculi

    Coinductive counting with weighted automata

    Get PDF
    A general methodology is developed to compute the solution of a wide variety of basic counting problems in a uniform way: (1) the objects to be counted are enumerated by means of an infinite weighted automaton; (2) the automaton is reduced by means of the quantitative notion of stream bisimulation; (3) the reduced automaton is used to compute

    Corecursive featherweight Java revisited

    Get PDF
    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

    Enhancing Regular Corecursion

    Get PDF
    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

    Enhancing Expressivity of Checked Corecursive Streams

    Get PDF
    We propose a novel approach to stream definition and manipulation. Our solution is based on two key ideas. Regular corecursion, which avoids non termination by detecting cyclic calls, is enhanced, by allowing in equations defining streams other operators besides the stream constructor. In this way, some non-regular streams are definable. Furthermore, execution includes a runtime check to ensure that the stream generated by a function call is well-defined, in the sense that access to an arbitrary index always succeeds. We extend the technique beyond the simple stream operators considered in previous work, notably by adding an interleaving combinator which has a non-trivial recursion scheme
    • 

    corecore