Combinators for Bi-Directional Tree Transformations: A Linguistic Approach to the View Update Problem

Loading...
Thumbnail Image
Penn collection
Departmental Papers (CIS)
Degree type
Discipline
Subject
Bi-directional programming
Harmony
XML
lenses
view update problem
Funder
Grant number
License
Copyright date
Distributor
Related resources
Author
Foster, J. Nathan
Greenwald, Michael B.
Moore, Jonathan T
Schmitt, Alan
Contributor
Abstract

We propose a novel approach to the well-known view update problem for the case of tree-structured data: a domain-specific programming language in which all expressions denote bi-directional transformations on trees. In one direction, these transformations—dubbed lenses—map a "concrete" tree into a simplified "abstract view"; in the other, they map a modified abstract view, together with the original concrete tree, to a correspondingly modified concrete tree. Our design emphasizes both robustness and ease of use, guaranteeing strong well-behavedness and totality properties for well-typed lenses. We identify a natural space of well-behaved bi-directional transformations over arbitrary structures, study definedness and continuity in this setting, and state a precise connection with the classical theory of "update translation under a constant complement" from databases. We then instantiate this semantic framework in the form of a collection of lens combinators that can be assembled to describe transformations on trees. These combinators include familiar constructs from functional programming (composition, mapping, projection, conditionals, recursion) together with some novel primitives for manipulating trees (splitting, pruning, merging, etc.). We illustrate the expressiveness of these combinators by developing a number of bi-directional list-processing transformations as derived forms.

Advisor
Date of presentation
2005-01-12
Conference name
Departmental Papers (CIS)
Conference dates
2023-05-16T22:29:41.000
Conference location
Date Range for Data Collection (Start Date)
Date Range for Data Collection (End Date)
Digital Object Identifier
Series name and number
Volume number
Issue number
Publisher
Publisher DOI
Journal Issue
Comments
Postprint version. Copyright ACM, 2005. This is the author's version of the work. It is posted here by permission of ACM for your personal use. Not for redistribution. The definitive version was published in Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 233-246. Publisher URL: http://doi.acm.org/10.1145/1040305.1040325
Postprint version. Copyright ACM, 2005. This is the author's version of the work. It is posted here by permission of ACM for your personal use. Not for redistribution. The definitive version was published in Proceedings of the 32nd ACM SIGPLAN-SIGACT sumposium on Principles of programming languages, pages 233-246. Publisher URL: http://doi.acm.org/10.1145/1040305.1040325
Recommended citation
Collection