24 research outputs found
Inversion, Iteration, and the Art of Dual Wielding
The humble ("dagger") is used to denote two different operations in
category theory: Taking the adjoint of a morphism (in dagger categories) and
finding the least fixed point of a functional (in categories enriched in
domains). While these two operations are usually considered separately from one
another, the emergence of reversible notions of computation shows the need to
consider how the two ought to interact. In the present paper, we wield both of
these daggers at once and consider dagger categories enriched in domains. We
develop a notion of a monotone dagger structure as a dagger structure that is
well behaved with respect to the enrichment, and show that such a structure
leads to pleasant inversion properties of the fixed points that arise as a
result. Notably, such a structure guarantees the existence of fixed point
adjoints, which we show are intimately related to the conjugates arising from a
canonical involutive monoidal structure in the enrichment. Finally, we relate
the results to applications in the design and semantics of reversible
programming languages.Comment: Accepted for RC 201
Condition/Decision Duality and the Internal Logic of Extensive Restriction Categories
In flowchart languages, predicates play an interesting double role. In the
textual representation, they are often presented as conditions, i.e.,
expressions which are easily combined with other conditions (often via Boolean
combinators) to form new conditions, though they only play a supporting role in
aiding branching statements choose a branch to follow. On the other hand, in
the graphical representation they are typically presented as decisions,
intrinsically capable of directing control flow yet mostly oblivious to Boolean
combination. While categorical treatments of flowchart languages are abundant,
none of them provide a treatment of this dual nature of predicates. In the
present paper, we argue that extensive restriction categories are precisely
categories that capture such a condition/decision duality, by means of
morphisms which, coincidentally, are also called decisions. Further, we show
that having these categorical decisions amounts to having an internal logic:
Analogous to how subobjects of an object in a topos form a Heyting algebra, we
show that decisions on an object in an extensive restriction category form a De
Morgan quasilattice, the algebraic structure associated with the (three-valued)
weak Kleene logic . Full classical propositional logic can be
recovered by restricting to total decisions, yielding extensive categories in
the usual sense, and confirming (from a different direction) a result from
effectus theory that predicates on objects in extensive categories form Boolean
algebras. As an application, since (categorical) decisions are partial
isomorphisms, this approach provides naturally reversible models of classical
propositional logic and weak Kleene logic.Comment: 19 pages, including 6 page appendix of proofs. Accepted for MFPS XXX
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
Graph Traversals as Universal Constructions
We exploit a decomposition of graph traversals to give a novel characterization of depth-first and breadth-first traversals by means of universal constructions. Specifically, we introduce functors from two different categories of edge-ordered directed graphs into two different categories of transitively closed edge-ordered graphs; one defines the lexicographic depth-first traversal and the other the lexicographic breadth-first traversal. We show that each functor factors as a composition of universal constructions, and that the usual presentation of traversals as linear orders on vertices can be recovered with the addition of an inclusion functor. Finally, we raise the question of to what extent we can recover search algorithms from the categorical description of the traversal they compute
Quantum Information Effects
We study the two dual quantum information effects to manipulate the amount of
information in quantum computation: hiding and allocation. The resulting
type-and-effect system is fully expressive for irreversible quantum computing,
including measurement. We provide universal categorical constructions that
semantically interpret this arrow metalanguage with choice, starting with any
rig groupoid interpreting the reversible base language. Several properties of
quantum measurement follow in general, and we translate quantum flow charts
into our language. The semantic constructions turn the category of unitaries
between Hilbert spaces into the category of completely positive
trace-preserving maps, and they turn the category of bijections between finite
sets into the category of functions with chosen garbage. Thus they capture the
fundamental theorems of classical and quantum reversible computing of Toffoli
and Stinespring.Comment: 32 pages, including 10 page appendi
Bennett and Stinespring, Together at Last
We present a universal construction that relates reversible dynamics on open
systems to arbitrary dynamics on closed systems: the well-pointed restriction
affine completion of a monoidal restriction category. This categorical
completion encompasses both quantum channels, via Stinespring dilation, and
classical computing, via Bennett's method. Moreover, in these two cases, we
show how our construction can be 'undone' by a further universal construction.
This shows how both mixed quantum theory and classical computation rest on
entirely reversible foundations.Comment: 15 pages, additional proofs in appendi
Reversible Effects as Inverse Arrows
Reversible computing models settings in which all processes can be reversed.
Applications include low-power computing, quantum computing, and robotics. It
is unclear how to represent side-effects in this setting, because conventional
methods need not respect reversibility. We model reversible effects by adapting
Hughes' arrows to dagger arrows and inverse arrows. This captures several
fundamental reversible effects, including serialization and mutable store
computations. Whereas arrows are monoids in the category of profunctors, dagger
arrows are involutive monoids in the category of profunctors, and inverse
arrows satisfy certain additional properties. These semantics inform the design
of functional reversible programs supporting side-effects.Comment: 15 pages; corrected Example 3.
Tail recursion transformation for invertible functions
Tail recursive functions allow for a wider range of optimisations than
general recursive functions. For this reason, much research has gone into the
transformation and optimisation of this family of functions, in particular
those written in continuation passing style (CPS).
Though the CPS transformation, capable of transforming any recursive function
to an equivalent tail recursive one, is deeply problematic in the context of
reversible programming (as it relies on troublesome features such as
higher-order functions), we argue that relaxing (local) reversibility to
(global) invertibility drastically improves the situation. On this basis, we
present an algorithm for tail recursion conversion specifically for invertible
functions. The key insight is that functions introduced by program
transformations that preserve invertibility, need only be invertible in the
context in which the functions subject of transformation calls them. We show
how a bespoke data type, corresponding to such a context, can be used to
transform invertible recursive functions into a pair of tail recursive function
acting on this context, in a way where calls are highlighted, and from which a
tail recursive inverse can be straightforwardly extracted.Comment: Submitted to 15th Conference on Reversible Computation, 202
Branching execution symmetry in Jeopardy by available implicit arguments analysis
When the inverse of an algorithm is well-defined – that is, when its output can be deterministically transformed into the input pro- ducing it – we say that the algorithm is invertible. While one can describe an invertible algorithm using a general-purpose programming language, it is generally not possible to guarantee that its inverse is well-defined without additional argument. Reversible languages enforce determinis- tic inverse interpretation at the cost of expressibility, by restricting the building blocks from which an algorithm may be constructed.
Jeopardy is a functional programming language designed for writing in- vertible algorithms without the syntactic restrictions of reversible pro- gramming. In particular, Jeopardy allows the limited use of locally non- invertible operations, provided that they are used in a way that can be statically determined to be globally invertible. However, guaranteeing invertibility in Jeopardy is not obvious.
One of the central problems in guaranteeing invertibility is that of de- ciding whether a program is symmetric in the face of branching control flow. In this paper, we show how Jeopardy can solve this problem, us- ing a program analysis called available implicit arguments analysis, to approximate branching symmetries