12,100 research outputs found
A categorical foundation for structured reversible flowchart languages: Soundness and adequacy
Structured reversible flowchart languages is a class of imperative reversible
programming languages allowing for a simple diagrammatic representation of
control flow built from a limited set of control flow structures. This class
includes the reversible programming language Janus (without recursion), as well
as more recently developed reversible programming languages such as R-CORE and
R-WHILE.
In the present paper, we develop a categorical foundation for this class of
languages based on inverse categories with joins. We generalize the notion of
extensivity of restriction categories to one that may be accommodated by
inverse categories, and use the resulting decisions to give a reversible
representation of predicates and assertions. This leads to a categorical
semantics for structured reversible flowcharts, which we show to be
computationally sound and adequate, as well as equationally fully abstract with
respect to the operational semantics under certain conditions
String Diagrams for -calculi and Functional Computation
This tutorial gives an advanced introduction to string diagrams and graph
languages for higher-order computation. The subject matter develops in a
principled way, starting from the two dimensional syntax of key categorical
concepts such as functors, adjunctions, and strictification, and leading up to
Cartesian Closed Categories, the core mathematical model of the lambda calculus
and of functional programming languages. This methodology inverts the usual
approach of proceeding from syntax to a categorical interpretation, by
rationally reconstructing a syntax from the categorical model. The result is a
graph syntax -- more precisely, a hierarchical hypergraph syntax -- which in
many ways is shown to be an improvement over the conventional linear term
syntax. The rest of the tutorial focuses on applications of interest to
programming languages: operational semantics, general frameworks for type
inference, and complex whole-program transformations such as closure conversion
and automatic differentiation
Modularity and implementation of mathematical operational semantics
Structural operational semantics is a popular technique for specifying the meaning of programs by means of inductive clauses. One seeks syntactic restrictions on those clauses so that the resulting operational semantics is well-behaved. This approach is simple and concrete but it has some drawbacks. Turi pioneered a more abstract categorical treatment based upon the idea that operational semantics is essentially a distribution of syntax over behaviour. In this article we take Turi's approach in two new directions. Firstly, we show how to write operational semantics as modular components and how to combine such components to specify complete languages. Secondly, we show how the categorical nature of Turi's operational semantics makes it ideal for implementation in a functional programming language such as Haskell
CHAD for Expressive Total Languages
We show how to apply forward and reverse mode Combinatory Homomorphic
Automatic Differentiation (CHAD) to total functional programming languages with
expressive type systems featuring the combination of - tuple types; - sum
types; - inductive types; - coinductive types; - function types. We achieve
this by analysing the categorical semantics of such types in -types
(Grothendieck constructions) of suitable categories. Using a novel categorical
logical relations technique for such expressive type systems, we give a
correctness proof of CHAD in this setting by showing that it computes the usual
mathematical derivative of the function that the original program implements.
The result is a principled, purely functional and provably correct method for
performing forward and reverse mode automatic differentiation (AD) on total
functional programming languages with expressive type systems.Comment: Under review at MSC
- …