DeepAI
Log In Sign Up

Composing bidirectional programs monadically (with appendices)

02/19/2019
by   Li-yao Xia, et al.
0

Software frequently converts data from one representation to another and vice versa. Naively specifying both conversion directions separately is error prone and introduces conceptual duplication. Instead, bidirectional programming techniques allow programs to be written which can be interpreted in both directions. However, these techniques often employ unfamiliar programming idioms via restricted, specialised combinator libraries. Instead, we introduce a framework for composing bidirectional programs monadically, enabling bidirectional programming with familiar abstractions in functional languages such as Haskell. We demonstrate the generality of our approach applied to parsers/printers, lenses, and generators/predicates. We show how to leverage compositionality and equational reasoning for the verification of round-tripping properties for such monadic bidirectional programs.

READ FULL TEXT
08/31/2021

Synbit: Synthesizing Bidirectional Programs using Unidirectional Sketches

We propose a technique for synthesizing bidirectional programs from the ...
05/13/2022

From Logic to Functional Logic Programs

Logic programming is a flexible programming paradigm due to the use of p...
08/17/2021

Higher-Order Concurrency for Microcontrollers

Programming microcontrollers involves low-level interfacing with hardwar...
12/12/2018

Bidirectional Type Checking for Relational Properties

Relational type systems have been designed for several applications incl...
05/19/2020

Choreographies as Objects

We present Choral, the first framework for programming choreographies (m...
08/02/2020

Concolic Testing in CLP

Concolic testing is a popular software verification technique based on a...