152 research outputs found
Propositional Encoding of Constraints over Tree-Shaped Data
We present a functional programming language for specifying constraints over
tree-shaped data. The language allows for Haskell-like algebraic data types and
pattern matching. Our constraint compiler CO4 translates these programs into
satisfiability problems in propositional logic. We present an application from
the area of automated analysis of (non-)termination of rewrite systems
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
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
Supporting formal reasoning about functional programs
It is often claimed that functional programming languages, and in particular pure functional
languages are suitable for formal reasoning. This claim is supported by the fact
that many people in the functional programming community do reason about languages
and programs in a formal or semi-formal way. Different reasoning principles such as
equational reasoning, induction and co-induction, are used, depending on the nature of
the problem.
Using a computer program to check the application of rules and to mechanise the
tedious bookkeeping involved can simplify proofs and provide more confidence in their
correctness. When reasoning about programs, this can also allow experiments with
new rules and reasoning styles, where a user may not be confident about structuring a
proof on paper. Checking the applicability of a rule can eliminate the risk of mistakes
caused by misunderstanding the theory being used. Just as there are different ways in
which formal or informal reasoning can be applied in functional programming, there are
different ways in which tools can be provided to support this reasoning.
This thesis describes an investigation of how to develop a mechanised reasoning
system to allow reasoning about algorithms as a functional programmer would write
them, not an encoding of the algorithm into a significantly different form. In addition,
this work aims to develop a system to support a user who is not a theorem proving
expert or an expert in the theoretical foundations of functional programming. The work is aimed towards a system that could be used by a functional programmer developing
real programs and wishing to prove some or all of the programs correct or to prove that
two programs are equivalent
Programmiersprachen und Rechenkonzepte
Seit 1984 veranstaltet die GI--Fachgruppe "Programmiersprachen und Rechenkonzepte" regelmäßig im Frühjahr einen Workshop im Physikzentrum Bad Honnef. Das Treffen dient in erster Linie dem gegenseitigen Kennenlernen, dem Erfahrungsaustausch, der Diskussion und der Vertiefung gegenseitiger Kontakte
Correct synthesis and integration of compiler-generated function units
PhD ThesisComputer architectures can use custom logic in addition to general pur-
pose processors to improve performance for a variety of applications. The
use of custom logic allows greater parallelism for some algorithms. While
conventional CPUs typically operate on words, ne-grained custom logic
can improve e ciency for many bit level operations. The commodi ca-
tion of eld programmable devices, particularly FPGAs, has improved
the viability of using custom logic in an architecture.
This thesis introduces an approach to reasoning about the correctness of
compilers that generate custom logic that can be synthesized to provide
hardware acceleration for a given application. Compiler intermediate
representations (IRs) and transformations that are relevant to genera-
tion of custom logic are presented. Architectures may vary in the way
that custom logic is incorporated, and suitable abstractions are used in
order that the results apply to compilation for a variety of the design
parameters that are introduced by the use of custom logic
- …