Effectful Programming in Declarative Languages with an Emphasis on Non-Determinism: Applications and Formal Reasoning

06/02/2020
by   Sandra Dylus, et al.
0

This thesis investigates effectful declarative programming with an emphasis on non-determinism as an effect. On the one hand, we are interested in developing applications using non-determinism as underlying implementation idea. We discuss two applications using the functional logic programming language Curry. The key idea of these implementations is to exploit the interplay of non-determinism and non-strictness that Curry employs. The first application investigates sorting algorithms parametrised over a comparison function. By applying a non-deterministic predicate to these sorting functions, we gain a permutation enumeration function. We compare the implementation in Curry with an implementation in Haskell that uses a monadic interface to model non-determinism. The other application that we discuss in this work is a library for probabilistic programming. Instead of modelling distributions as list of event and probability pairs, we model distributions using Curry's built-in non-determinism. In both cases we observe that the combination of non-determinism and non-strictness has advantages over an implementation using lists to model non-determinism. On the other hand, we present an idea to apply formal reasoning on effectful declarative programming languages. In order to start with simple effects, we focus on modelling a functional subset first. That is, the effects of interest are totality and partiality. We then observe that the general scheme to model these two effects can be generalised to capture a wide range of effects. Obviously, the next step is to apply the idea to model non-determinism. More precisely, we implement a model for the non-determinism of Curry: non-strict non-determinism with call-time choice. Therefore, we finally discuss why the current representation models call-by-name rather than Curry's call-by-need semantics and give an outlook on ideas to tackle this problem.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
05/17/2019

Implementing a Library for Probabilistic Programming using Non-strict Non-determinism

This paper presents PFLP, a library for probabilistic programming in the...
research
09/22/2020

Research Summary on Implementing Functional Patterns by Synthesizing Inverse Functions

In this research summary we present our recent work on implementing func...
research
11/20/2020

A Comparison of Big-step Semantics Definition Styles

Formal semantics provides rigorous, mathematically precise definitions o...
research
05/16/2019

Effects Without Monads: Non-determinism – Back to the Meta Language

We reflect on programming with complicated effects, recalling an undeser...
research
01/20/2019

A tensorized logic programming language for large-scale data

We introduce a new logic programming language T-PRISM based on tensor em...
research
08/22/2018

Synthesizing Set Functions

Set functions are a feature of functional logic programming to encapsula...
research
05/01/2020

Combining predicate transformer semantics for effects: a case study in parsing regular languages

This paper describes how to verify a parser for regular expressions in a...

Please sign up or login with your details

Forgot password? Click here to reset