Composing Bidirectional Programs Monadically

被引:5
|
作者
Xia, Li-yao [1 ]
Orchard, Dominic [2 ]
Wang, Meng [3 ]
机构
[1] Univ Penn, Philadelphia, PA 19104 USA
[2] Univ Kent, Canterbury, Kent, England
[3] Univ Bristol, Bristol, Avon, England
基金
英国工程与自然科学研究理事会;
关键词
D O I
10.1007/978-3-030-17184-1_6
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页码:147 / 175
页数:29
相关论文
共 50 条
  • [1] An approach to composing parallel programs
    Thorelli, LE
    Vlassov, V
    PARALLEL COMPUTING TECHNOLOGIES, 2001, 2127 : 371 - 378
  • [2] Composing open logic programs
    Brogi, A.
    Lamma, E.
    Mello, P.
    Journal of Logic and Computation, 1993, 3 (04)
  • [3] Composing model programs for analysis
    Veanes, Margus
    Jacky, Jonathan
    JOURNAL OF LOGIC AND ALGEBRAIC PROGRAMMING, 2010, 79 (07): : 467 - 482
  • [4] On composing problems and parallel programs
    Horvath, Z
    Kozsik, T
    Venczel, T
    1ST AUSTRIAN-HUNGARIAN WORKSHOP ON DISTRIBUTED AND PARALLEL SYSTEMS, PROCEEDINGS, 1996, 1996 (09): : 225 - 226
  • [5] Composing general logic programs
    Brogi, A
    Contiero, S
    Turini, F
    LOGIC PROGRAMMING AND NONMONOTONIC REASONING, 1997, 1265 : 273 - 288
  • [6] Composing Modal Properties of Programs with Procedures
    Huisman, Marieke
    Gurov, Dilian
    ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2009, 203 (07) : 87 - 101
  • [7] The use of renaming in composing general programs
    Brogi, A
    Contiero, S
    Turini, F
    LOGIC-BASED PROGRAM SYNTHESIS AND TRANSFORMATION, 1999, 1559 : 124 - 142
  • [8] Composing Normal Programs with Function Symbols
    Baselice, Sabrina
    Bonatti, Piero A.
    LOGIC PROGRAMMING, PROCEEDINGS, 2008, 5366 : 425 - 439
  • [9] Indiscernibles and Flatness in Monadically Stable and Monadically NIP Classes
    Dreier, Jan
    Mählmann, Nikolas
    Siebertz, Sebastian
    Toruńczyk, Szymon
    Leibniz International Proceedings in Informatics, LIPIcs, 2023, 261
  • [10] COMPOSING RECURSIVE LOGIC PROGRAMS WITH CLAUSAL JOIN
    LAKHOTIA, A
    STERLING, L
    NEW GENERATION COMPUTING, 1988, 6 (2-3) : 211 - 225