874 research outputs found
Enriched Lawvere Theories for Operational Semantics
Enriched Lawvere theories are a generalization of Lawvere theories that allow
us to describe the operational semantics of formal systems. For example, a
graph enriched Lawvere theory describes structures that have a graph of
operations of each arity, where the vertices are operations and the edges are
rewrites between operations. Enriched theories can be used to equip systems
with operational semantics, and maps between enriching categories can serve to
translate between different forms of operational and denotational semantics.
The Grothendieck construction lets us study all models of all enriched theories
in all contexts in a single category. We illustrate these ideas with the
SKI-combinator calculus, a variable-free version of the lambda calculus.Comment: In Proceedings ACT 2019, arXiv:2009.0633
Initial Semantics for Reduction Rules
We give an algebraic characterization of the syntax and operational semantics
of a class of simply-typed languages, such as the language PCF: we characterize
simply-typed syntax with variable binding and equipped with reduction rules via
a universal property, namely as the initial object of some category of models.
For this purpose, we employ techniques developed in two previous works: in the
first work we model syntactic translations between languages over different
sets of types as initial morphisms in a category of models. In the second work
we characterize untyped syntax with reduction rules as initial object in a
category of models. In the present work, we combine the techniques used earlier
in order to characterize simply-typed syntax with reduction rules as initial
object in a category. The universal property yields an operator which allows to
specify translations---that are semantically faithful by construction---between
languages over possibly different sets of types.
As an example, we upgrade a translation from PCF to the untyped lambda
calculus, given in previous work, to account for reduction in the source and
target. Specifically, we specify a reduction semantics in the source and target
language through suitable rules. By equipping the untyped lambda calculus with
the structure of a model of PCF, initiality yields a translation from PCF to
the lambda calculus, that is faithful with respect to the reduction semantics
specified by the rules.
This paper is an extended version of an article published in the proceedings
of WoLLIC 2012.Comment: Extended version of arXiv:1206.4547, proves a variant of a result of
PhD thesis arXiv:1206.455
Scope ambiguities, monads and strengths
In this paper, we will discuss three semantically distinct scope assignment
strategies: traditional movement strategy, polyadic approach, and
continuation-based approach. As a generalized quantifier on a set X is an
element of C(X), the value of continuation monad C on X, in all three
approaches QPs are interpreted as C-computations. The main goal of this paper
is to relate the three strategies to the computational machinery connected to
the monad C (strength and derived operations). As will be shown, both the
polyadic approach and the continuation-based approach make heavy use of monad
constructs. In the traditional movement strategy, monad constructs are not used
but we still need them to explain how the three strategies are related and what
can be expected of them wrt handling scopal ambiguities in simple sentences.Comment: 47 pages, small correction
Programming errors in traversal programs over structured data
Traversal strategies \'a la Stratego (also \'a la Strafunski and 'Scrap Your
Boilerplate') provide an exceptionally versatile and uniform means of querying
and transforming deeply nested and heterogeneously structured data including
terms in functional programming and rewriting, objects in OO programming, and
XML documents in XML programming. However, the resulting traversal programs are
prone to programming errors. We are specifically concerned with errors that go
beyond conservative type errors; examples we examine include divergent
traversals, prematurely terminated traversals, and traversals with dead code.
Based on an inventory of possible programming errors we explore options of
static typing and static analysis so that some categories of errors can be
avoided. This exploration generates suggestions for improvements to strategy
libraries as well as their underlying programming languages. Haskell is used
for illustrations and specifications with sufficient explanations to make the
presentation comprehensible to the non-specialist. The overall ideas are
language-agnostic and they are summarized accordingly
Generating reversible circuits from higher-order functional programs
Boolean reversible circuits are boolean circuits made of reversible
elementary gates. Despite their constrained form, they can simulate any boolean
function. The synthesis and validation of a reversible circuit simulating a
given function is a difficult problem. In 1973, Bennett proposed to generate
reversible circuits from traces of execution of Turing machines. In this paper,
we propose a novel presentation of this approach, adapted to higher-order
programs. Starting with a PCF-like language, we use a monadic representation of
the trace of execution to turn a regular boolean program into a
circuit-generating code. We show that a circuit traced out of a program
computes the same boolean function as the original program. This technique has
been successfully applied to generate large oracles with the quantum
programming language Quipper.Comment: 21 pages. A shorter preprint has been accepted for publication in the
Proceedings of Reversible Computation 2016. The final publication is
available at http://link.springer.co
- …