Compositional theories for embedded languages

06/18/2020
by   Davide Trotta, et al.
0

Embedded programming style allows to split the syntax in two parts, representing respectively a host language H and a core language C embedded in H. This formally models several situations in which a user writes code in a main language and delegates some tasks to an ad hoc domain specific language. Moreover, as showed in recent years, a particular case of the host-core approach allows a flexible management of data linearity, which is particularly useful in non-classical computational paradigms such as quantum computing. The definition of a systematised type theory to capture and standardize common properties of embedded languages is unexplored. The aim of this paper is to present a flexible fragment of such a type theory, together with its categorical semantics in terms of enriched categories, following previous investigations. We present the calculus HC0 and we use the notion of internal language of a category to relate the language to the class of its models, showing the equivalence between the category of models and the one of theories. This provides a stronger result w.r.t. standard soundness and completeness since it involves not only the models but also morphisms between models. We observe that the definition of the morphisms between models highlights further advantages of the embedded languages and we discuss some concrete instances, extensions and specializations of the syntax and the semantics.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
11/14/2017

Classical Control, Quantum Circuits and Linear Logic in Enriched Category Theory

We describe categorical models of a circuit-based (quantum) functional p...
research
11/12/2020

Functorial Semantics for Partial Theories

We provide a Lawvere-style definition for partial theories, extending th...
research
01/13/2022

The Combinatorics of Salva Veritate Principles

Various concepts of grammatical compositionality arise in many theories ...
research
05/18/2020

Sham: A DSL for Fast DSLs

Domain-specific languages (DSLs) are touted as both easy to embed in pro...
research
12/01/2020

Customizing Host IDE for Non-programming Users of Pure Embedded DSLs: A Case Study

Pure embedding as an implementation strategy of domain-specific language...
research
04/08/2019

A HoTT Quantum Equational Theory (Extended Version)

This paper presents an equational theory for the QRAM model of quantum c...
research
08/30/2021

Embedded Pattern Matching

Haskell is a popular choice for hosting deeply embedded languages. A rec...

Please sign up or login with your details

Forgot password? Click here to reset