arXiv ScienceSearch

arXiv subjects

Ryan Kavanagh

Publications and source records attributed to Ryan Kavanagh.

11 recordsLinked to original sources

Staged Hybrid Quantum-Classical Programming

Hybrid quantum-classical computing systems consist of a classical control system that sends quantum circuits and receives measurement results from a quantum co-processor. Such systems allow us to model algorithms that require the classical control system to generate quantum circuits on the fly, potentially based on prior measurement results. This is challenging, as the classical control system must generate quantum circuits that manipulate live quantum states. In this setting, the classical control system is generating further quantum circuits while the quantum co-processor is internally maintaining the state of the live qubits; this is not ideal, since this not only is costly but also introduces additional sources of noise to the live qubits. Thus, we want to minimize the latency between receiving measurement results and sending the next quantum circuit to be executed by pre-computing quantum circuits. We introduce HyQ (pronounced haiku), a multi-modal language based on adjoint logic that pre-generates quantum circuits before executing a hybrid quantum-classical program. We achieve this by separating our semantics into two distinct stages: 1) compile-time generation of quantum circuits and classical runtime code and 2) execution of the classical runtime code that instruments the quantum co-processor. This separation between stages allows us to formally guarantee that all circuit-generation logic occurs before the instrumentation logic, i.e., the actual runtime, and minimizes the idling of the quantum co-processor at runtime. We give a type system, a circuit-normalization semantics for the compile-time stage, which eagerly performs all circuit-generation logic, and a runtime semantics for HyQ that corresponds to the second stage. We prove type preservation and progress for both semantics.

cs.PL

Deconstructed Proto-Quipper: A Rational Reconstruction

The Proto-Quipper family of programming languages aims to provide a formal foundation for the Quipper quantum programming language. Unfortunately, Proto-Quipper languages have complex operational semantics: they are inherently effectful, and they rely on set-theoretic operations and fresh name generation to manipulate quantum circuits. This makes them difficult to reason about using standard programming language techniques and, ultimately, to mechanize. We introduce Proto-Quipper-A, a rational reconstruction of Proto-Quipper languages for static circuit generation. It uses a linear $\lambda$-calculus to describe quantum circuits with normal forms that closely correspond to box-and-wire circuit diagrams. Adjoint-logical foundations integrate this circuit language with a linear/non-linear functional language and let us reconstruct Proto-Quipper's circuit programming abstractions using more primitive adjoint-logical operations. Proto-Quipper-A enjoys a simple call-by-value reduction semantics, and to illustrate its tractability as a foundation for Proto-Quipper languages, we show that it is normalizing. We show how to use standard logical relations to prove normalization of linear and substructural systems, thereby avoiding the inherent complexity of existing linear logical relations.

cs.PL

Message-Observing Sessions

We present Most, a process language with message-observing session types. Message-observing session types extend binary session types with type-level computation to specify communication protocols that vary based on messages observed on other channels. Hence, Most allows us to express global invariants about processes, rather than just local invariants, in a bottom-up, compositional way. We give Most a semantic foundation using traces with binding, a semantic approach for compositionally reasoning about traces in the presence of name generation. We use this semantics to prove type soundness and compositionality for Most processes. We see this as a significant step towards capturing message-dependencies and providing more precise guarantees about processes.

cs.PL

Mechanizing Session-Types using a Structural View: Enforcing Linearity without Linearity

Session types employ a linear type system that ensures that communication channels cannot be implicitly copied or discarded. As a result, many mechanizations of these systems require modeling channel contexts and carefully ensuring that they treat channels linearly. We demonstrate a technique that localizes linearity conditions as additional predicates embedded within type judgments, which allows us to use structural typing contexts instead of linear ones. This technique is especially relevant when leveraging (weak) higher-order abstract syntax to handle channel mobility and the intricate binding structures that arise in session-typed systems. Following this approach, we mechanize a session-typed system based on classical linear logic and its type preservation proof in the proof assistant Beluga, which uses the logical framework LF as its encoding language. We also prove adequacy for our encoding. This shows the tractability and effectiveness of our approach in modelling substructural systems such as session-typed languages.

cs.PL

Fairness and Communication-Based Semantics for Session-Typed Languages

We give communication-based semantics and reasoning techniques for Polarized SILL, a rich session-typed programming language with general recursion. Its features include channel and code transmission, synchronous and asynchronous communication, and functional programming. Our contributions are distinguished by their faithfulness to the process abstraction, i.e., to the premise that communication is the only observable phenomenon of processes. We give the first observed communication semantics that supports general recursion and code transmission. Observed communication semantics define the meaning of processes in terms of their observed communications. We use this observational semantics to define experiments on processes, and we give a communication-based testing equivalences framework for defining observational simulations and equivalences on processes. This framework captures several natural equivalences, and we show that one of these coincides with barbed congruence, the canonical notion of process equivalence. Polarized SILL is defined using a substructural operational semantics based on multiset rewriting. To ensure that our contributions are well-defined in the presence of non-termination, we introduce fairness for multiset rewriting systems. We construct a fair scheduler, we give sufficient conditions for traces to be fair, and we study the effects of permutation on fair traces.

cs.PL

Substructural Observed Communication Semantics

Session-types specify communication protocols for communicating processes, and session-typed languages are often specified using substructural operational semantics given by multiset rewriting systems. We give an observed communication semantics for a session-typed language with recursion, where a process's observation is given by its external communications. To do so, we introduce fair executions for multiset rewriting systems, and extract observed communications from fair process executions. This semantics induces an intuitively reasonable notion of observational equivalence that we conjecture coincides with semantic equivalences induced by denotational semantics, bisimulations, and barbed congruences for these languages.

cs.PL

Parametrized Fixed Points on O-Categories and Applications to Session Types

O-categories generalize categories of domains to provide just the structure required to compute fixed points of locally continuous functors. Parametrized fixed points are of particular interest to denotational semantics and are often given by "dagger operations". We generalize existing techniques to define a functorial dagger operation on locally continuous functors between O-categories. We show that this dagger operation satisfies the Conway identities, a collection of identities used to axiomatize iteration theories. We study the behaviour of this dagger operation on natural transformations and consider applications to semantics of session-typed languages.

math.CT

A Domain Semantics for Higher-Order Recursive Processes

The polarized SILL programming language uniformly integrates functional programming and session-typed message-passing concurrency. It supports general recursion, asynchronous and synchronous communication, and higher-order programs that communicate channels and processes. We give polarized SILL a domain-theoretic semantics---the first denotational semantics for a language with this combination of features. Session types in polarized SILL denote pairs of domains of unidirectional communications. Processes denote continuous functions between these domains, and process composition is interpreted by a trace operator. We illustrate our semantics by validating expected program equivalences.

cs.PL

A denotational account of C11-style memory

We introduce a denotational semantic framework for shared-memory concurrent programs in a C11-style memory model. This denotational approach is an alternative to techniques based on "execution graphs" and axiomatizations, and it allows for compositional reasoning. Our semantics generalizes from traces (sequences of actions) to pomsets (partial orders of actions): instead of traces and interleaving, we embrace "true" concurrency. We build on techniques from our prior work that gives a denotational semantics to SPARC TSO. We add support for C11's wider range of memory orderings, e.g., acquire-release and relaxed, and support for local variables and various synchronization primitives, while eliminating significant amounts of technical bookkeeping. Our approach features two main components. We first give programs a syntax-directed denotation in terms of sets of pomsets of memory actions. We then give a race-detecting executional interpretation of pomsets using footprints and a local view of state.

cs.PL

A Denotational Semantics for SPARC TSO

The SPARC TSO weak memory model is defined axiomatically, with a non-compositional formulation that makes modular reasoning about programs difficult. Our denotational approach uses pomsets to provide a compositional semantics capturing exactly the behaviours permitted by SPARC TSO. It uses buffered states and an inductive definition of execution to assign an input-output meaning to pomsets. We show that our denotational account is sound and complete relative to the axiomatic account, that is, that it captures exactly the behaviours permitted by the axiomatic account. Our compositional approach facilitates the study of SPARC TSO and supports modular analysis of program behaviour.

cs.PL

On Coupled Logical Bisimulation for the Lambda-Calculus

We study coupled logical bisimulation (CLB) to reason about contextual equivalence in the lambda-calculus. CLB originates in a work by Dal Lago, Sangiorgi and Alberti, as a tool to reason about a lambda-calculus with probabilistic constructs. We adapt the original definition to the pure lambda-calculus. We develop the metatheory of CLB in call-by-name and in call-by-value, and draw comparisons with applicative bisimulation (due to Abramsky) and logical bisimulation (due to Sangiorgi, Kobayashi and Sumii). We also study enhancements of the bisimulation method for CLB by developing a theory of up-to techniques for cases where the functional corresponding to bisimulation is not necessarily monotone.

cs.LO