51 research outputs found
On the Relation of Interaction Semantics to Continuations and Defunctionalization
In game semantics and related approaches to programming language semantics,
programs are modelled by interaction dialogues. Such models have recently been
used in the design of new compilation methods, e.g. for hardware synthesis or
for programming with sublinear space. This paper relates such semantically
motivated non-standard compilation methods to more standard techniques in the
compilation of functional programming languages, namely continuation passing
and defunctionalization. We first show for the linear {\lambda}-calculus that
interpretation in a model of computation by interaction can be described as a
call-by-name CPS-translation followed by a defunctionalization procedure that
takes into account control-flow information. We then establish a relation
between these two compilation methods for the simply-typed {\lambda}-calculus
and end by considering recursion
An Analytical Approach to Programs as Data Objects
This essay accompanies a selection of 32 articles (referred to in bold face in the text and marginally marked in the bibliographic references) submitted to Aarhus University towards a Doctor Scientiarum degree in Computer Science.The author's previous academic degree, beyond a doctoral degree in June 1986, is an "Habilitation à diriger les recherches" from the Université Pierre et Marie Curie (Paris VI) in France; the corresponding material was submitted in September 1992 and the degree was obtained in January 1993.The present 32 articles have all been written since 1993 and while at DAIMI.Except for one other PhD student, all co-authors are or have been the author's students here in Aarhus
Handle with Care and Confidence – Extending Cameleer with Algebraic Effects and Effect Handlers. An analysis of algebraic effects and techniques to deductively verify them
The new major release of the OCaml compiler is set to be an important landmark in the
history and ecosystem of the language. The 5.0 version introduces Multicore OCaml, a
multi-threaded implementation of the OCaml runtime. Two new important paradigms
shall arise in the language: parallelism via domains and direct-style concurrency via
algebraic effects and handlers. In this work, we focus precisely on the latter and try to
answer the following research question: "what tools and principles must be developed
in order to apply automated deductive proofs to OCaml programs featuring effects and
handlers?".
Algebraic effects and handlers are a powerful abstraction to build non-local control-flow
mechanisms such as resumable exceptions, lightweight threads, co-routines, generators,
and asynchronous I/O. All of such features have very evolved semantics, hence they pose
very interesting challenges to deductive verification techniques. In fact, there are very
few proposed techniques to deductively verify programs featuring these constructs, even
fewer when it comes to automated proofs. In this report, we outline some of the currently
available techniques for the verification of programs with algebraic effects. We then build
off them to create a mostly automated verification framework by extending Cameleer, a
tool which verifies OCaml code using GOSPEL and Why3. This framework embeds the
behavior of effects and handlers using exceptions and defunctionalized functions.A próxima iteração do compilador OCaml será histórica no que diz respeito ao ecosistema
da linguagem. A versão 5.0 introduzirá Multicore OCaml, uma implementação multi-
threaded do runtime OCaml. Nesta versão, dois paradigmas serão adicionados: paralelismo
utilizando domains e concorrência em estilo direto na forma de efeitos algébricos e handlers.
Neste relatório, focar-nos-emos no segundo ponto, tentado responder à seguinte questão:
"que ferramentas e princípios deveremos desenvolver de modo a applicar provas dedutivas
automáticas a programas com efeitos e handlers?".
Efeitos algébricos e handlers são uma abstrações poderosas que nos permite construir
mecanismos para controlar o curso de um programa como, por exemplo, exceções que
nos permitem recomeçar a computação, threads lightwheight, corotinas, geradores e I/O
asíncrono. Todos estes paradigmas são um grande desafio no contexto de verificação
dedutiva pois têm semanticas bastante complexas. Neste relatório iremos abordar algumas
das técnicas existentes para provar programas com efeitos algébricos. Ademais, propomos
uma estratégia de verificação para provar automáticamente programas com handlers. Para
este efeito, extendemos a ferramenta Cameleer, um verificador de código OCaml que utiliza
a linguagem de especificação GOSPEL e o prover Why3. Esta extensão visa aproximar o
comportamento de handlers utilizando exceções e funções desfuncionalizadas
Exact Recursive Probabilistic Programming
Recursive calls over recursive data are widely useful for generating
probability distributions, and probabilistic programming allows computations
over these distributions to be expressed in a modular and intuitive way. Exact
inference is also useful, but unfortunately, existing probabilistic programming
languages do not perform exact inference on recursive calls over recursive
data, forcing programmers to code many applications manually. We introduce a
probabilistic language in which a wide variety of recursion can be expressed
naturally, and inference carried out exactly. For instance, probabilistic
pushdown automata and their generalizations are easy to express, and
polynomial-time parsing algorithms for them are derived automatically. We
eliminate recursive data types using program transformations related to
defunctionalization and refunctionalization. These transformations are assured
correct by a linear type system, and a successful choice of transformations, if
there is one, is guaranteed to be found by a greedy algorithm
Dynamic matching and weaving semantics for executable UML models
To develop more secure software, security concerns should be considered as an essential part of all phases of software development lifecycle. It has been observed that incorporation of security concerns after the completion of software development may result in conflicts between functional and security requirements and leads to severe
security vulnerabilities. On the other hand, security is a crosscutting concern and consequently the integration of security solutions at the software design phase may
result in scattering and tangling of security features throughout the entire design. Therefore, in the case of large scale software (e.g., hundreds of UML classes), the
resulting UML design models may become more complex and difficult to understand. Moreover, adding security manually is tedious and may lead to additional security flaws.
Aspect-Oriented Modeling is an appropriate approach to systematically integrate security at the design phase as it allows the separation of crosscutting concerns from the core functionality. In this research work, we provide formal semantics for aspect matching and weaving on executable UML models, particularly for activity diagrams. The semantics is based on a defunctionalized continuation-passing style since it provides a concise and elegant description of aspect-oriented mechanisms. In addition, we have extended our framework and provided semantics for control and data flow pointcuts as these pointcuts are beneficial from a security perspective and are used to detect vulnerabilities related to information flow
A Dualities-Consolidating Framework to Support Systematic Programming Language Design
In the theory of programming languages, duality is increasingly recognized
as being important for improving economy, offering the theoretical development
for one of two dual concepts "for free".
Two prevalent dualities are the extensibility duality, related to the Expression Problem,
and the De Morgan duality, related to evaluation strategies and control flow;
for instance, a language which is symmetric with respect to the extensibility duality
has both a facility which allows for easy extension with new variants,
similar to how classes implement an interface in certain object-oriented languages,
and a dual facility which allows for easy extension with new operations,
as in functional programming with algebraic data types.
However, this theoretical knowledge arguably has yet to be made more accessible to the practician.
In particular, the design of programming languages does not yet really
benefit from it in a systematic way.
As a step to improve this situation, building on these prior results, the present work presents a prototype of
a, in the conceptual sense rather economical, foundational system, in which the extensibility duality and the De Morgan duality are consolidated.
In particular, the system is inherently highly symmetric with respect to both dualities
and their consolidation quite naturally allows to carve out the essence
of the extensibility duality, thereby further optimizing the meta-level economy.
As will be demonstrated, this system can serve as a framework in which various language features known from
practical programming languages can be recovered (by local syntactic abstractions,
a.k.a. macros) and systematically compared,
including algebraic data types and function types as known from functional programming,
classes and objects, and exception handling, in combination
with the evaluation strategies employed by the respective languages.
This is intended to facilitate a systematic analysis
of programming language concepts which may aid in the design of parsimonious languages
which are symmetric with respect to one or both of the mentioned dualities.
For the more short-term perspective, the system may also serve as a cornerstone
for the systematic development of tools which automatically semantically compare (and convert between)
programs in different languages by means of analyzing the results of embedding them into the framework.In der theoretischen Betrachtung von Programmiersprachen wird Dualität
als zunehmend wichtig für die Verbesserung der Ökonomie betrachtet,
da diese ermöglicht, die Theorie-Entwicklung für eines von zwei dualen Konzepten
"umsonst" zu erhalten.
Zwei vorherrschende Dualitäten sind die Extensibilitäts-Dualität,
die im Zusammenhang mit dem Expression Problem steht,
und die De Morgan-Dualität, die im Zusammenhang mit Auswertungsstrategien
und Kontrollfluss steht;
zum Beispiel bietet eine Sprache, die symmetrisch in Bezug auf die Extensibilitäts-Dualität ist,
sowohl ein Konstrukt, das die einfache Hinzufügung von neuen Varianten ermöglicht,
ähnlich dazu wie in gewissen Objekt-Orientierten Sprachen Klassen ein Interface implementieren,
als auch ein duales Konstrukt, das die einfache Hinzufügung von neuen Operationen ermöglicht,
wie in der Funktionalen Programmierung mit algebraischen Datentypen.
Dieses theoretische Wissen muss wohl allerdings dem Praktiker noch besser zugänglich gemacht werden.
Insbesondere profitiert die Entwicklung von Programmiersprachen noch nicht
wirklich auf eine systematische Weise davon.
Als Schritt auf dem Weg dahin, diese Situation zu verbessern, präsentiert diese Arbeit,
auf diesen bisherigen Resultaten aufbauend, ein grundlegendes, im konzeptuellen Sinne recht ökonomisches System, in dem
die Extensibilitäts-Dualität und die De Morgan-Dualität miteinander vereinigt sind.
Insbesondere ist dieses System inhärent höchst symmetrisch in Bezug auf beide Dualitäten
und deren Vereinigung ermöglicht auf recht natürliche Weise die Essenz der
Extensibilitäts-Dualität herauszuarbeiten, was die Ökonomie auf der Meta-Ebene
weiter verbessert.
Wie dargestellt werden wird, kann dieses System als Framework dienen, in dem
sich verschiedene Sprach-Features aus in der Praxis relevanten Programmiersprachen
darstellen lassen (durch lokale syntaktische Abstraktionen, auch bekannt als Macros)
und in dem man diese vergleichen kann,
wie etwa algebraische Datentypen und Funktionstypen, wie man sie aus der Funktionalen
Programmierung kennt, Klassen und Objekte, sowie Exception-Handling,
in Verbindung mit den Auswertungsstrategien die von den jeweiligen Sprachen
verwendet werden.
Dies soll dem Zweck dienen, eine systematische Analyse von Programmiersprachen-Konzepten
zu ermöglichen, welche bei der Entwicklung von kompakten Sprachen helfen kann,
die symmetrisch in Bezug auf eine oder beide der erwähnten Dualitäten sind.
Für die kurzfristigere Perspektive bietet es das System auch als Grundstein für
die systematische Entwicklung von Tools an, welche automatisch Programme in verschiedenen Sprache
semantisch vergleichen (und ineinander umwandeln), indem sie die Ergebnisse von deren Einbettung in das Framework analysieren
- …