Results 1 - 10
of
13
Quotient lenses
, 2008
"... There are now a number of bidirectional programming languages, where every program can be read both as a forward transformation mapping one data structure to another and as a reverse transformation mapping an edited output back to a correspondingly edited input. Besides parsimony—the two related tra ..."
Abstract
-
Cited by 11 (4 self)
- Add to MetaCart
There are now a number of bidirectional programming languages, where every program can be read both as a forward transformation mapping one data structure to another and as a reverse transformation mapping an edited output back to a correspondingly edited input. Besides parsimony—the two related transformations are described by just one expression—such languages are attractive because they promise strong behavioral laws about how the two transformations fit together—e.g., their composition is the identity function. It has repeatedly been observed, however, that such laws are actually a bit too strong: in practice, we do not want them “on the nose, ” but only up to some equivalence, allowing inessential details, such as whitespace, to be modified after a round trip. Some bidirectional languages loosen their laws in this way, but only for specific, baked-in equivalences. In this work, we propose a general theory of quotient lenses— bidirectional transformations that are well behaved modulo equivalence relations controlled by the programmer. Semantically, quotient lenses are a natural refinement of lenses, which we have studied in previous work. At the level of syntax, we present a rich set of constructs for programming with canonizers and for quotienting lenses by canonizers. We track equivalences explicitly, with the type of every quotient lens specifying the equivalences it respects. We have implemented quotient lenses as a refinement of the bidirectional string processing language Boomerang. We present a number of useful primitive canonizers for strings, and give a simple extension of Boomerang’s regular-expression-based type system to statically typecheck quotient lenses. The resulting language is an expressive tool for transforming real-world, ad-hoc data formats. We demonstrate the power of our notation by developing an extended example based on the UniProt genome database format and illustrate the generality of our approach by showing how uses of quotienting in other bidirectional languages can be translated into our notation.
Bidirectionalizing Graph Transformations
- SUBMITTED TO ICFP
, 2010
"... Bidirectional transformations provide a novel mechanism for synchronizing and maintaining the consistency of information between input and output. Despite many promising results on bidirectional transformations, they are limited to the context of relational or XML (tree-like) databases. In this pape ..."
Abstract
-
Cited by 9 (6 self)
- Add to MetaCart
Bidirectional transformations provide a novel mechanism for synchronizing and maintaining the consistency of information between input and output. Despite many promising results on bidirectional transformations, they are limited to the context of relational or XML (tree-like) databases. In this paper, we challenge the problem of bidirectional transformations in the context of graphs, by proposing a formal definition of a well-behaved bidirectional semantics for UnCAL, a graph algebra for the known UnQL graph query language. The key to our successful formalization is full utilization of both recursive and bulk semantics of the structural recursion on graphs. We carefully refine the existing forward evaluation of structural recursion so that it can produce sufficient trace information for later backward evaluation. For the backward evaluation, we use the trace information to reflect in-place update and deletion on the view to the source, and adopt the universal resolving algorithm for inverse computation and the narrowing technique to tackle the difficult insertion problem. We prove the well-behavedness of our bidirectional evaluation. Our current implementation, being available online, confirms usefulness of our approach with nontrivial applications.
Bidirectional Mappings for Data and Update Exchange
, 2008
"... A key challenge in supporting information interchange is not only supporting queries over integrated data, but also updates. Previous work on update exchange has enabled update propagation over schema mappings in a unidirectional way — conceptually similar to view maintenance, in that a derived inst ..."
Abstract
-
Cited by 5 (3 self)
- Add to MetaCart
A key challenge in supporting information interchange is not only supporting queries over integrated data, but also updates. Previous work on update exchange has enabled update propagation over schema mappings in a unidirectional way — conceptually similar to view maintenance, in that a derived instance gets updated based on changes to a source instance. In this paper, we consider how to support data and update propagation across bidirectional mappings that enable different sites to mirror each other’s data. We describe how data and update exchange can be extended to support bidirectional updates, implement an algorithm to perform side effect-free update propagation in this model, and show preliminary results suggesting our approach is feasible.
Combining Syntactic and Semantic Bidirectionalization
- SUBMITTED TO ICFP’10
, 2010
"... Matsuda et al. (2007, ICFP) and Voigtländer (2009, POPL) introduced two techniques that given a source-to-view function provide an update propagation function mapping an original source and an updated view back to an updated source, subject to standard consistency conditions. Being fundamentally dif ..."
Abstract
-
Cited by 4 (4 self)
- Add to MetaCart
Matsuda et al. (2007, ICFP) and Voigtländer (2009, POPL) introduced two techniques that given a source-to-view function provide an update propagation function mapping an original source and an updated view back to an updated source, subject to standard consistency conditions. Being fundamentally different in approach, both techniques have their respective strengths and weaknesses. Here we develop a synthesis of the two techniques to good effect. On the intersection of their applicability domains we achieve more than what a simple union of applying the techniques side by side delivers.
Generic point-free lenses
- In International Conference on Mathematics of Program Construction (MPC), Québec City, QC
, 2010
"... Abstract. Lenses are one the most popular approaches to define bidirectional transformations between data models. A bidirectional transformation with view-update, denoted a lens, encompasses the definition of a forward transformation projecting concrete models into abstract views, together with a ba ..."
Abstract
-
Cited by 3 (0 self)
- Add to MetaCart
Abstract. Lenses are one the most popular approaches to define bidirectional transformations between data models. A bidirectional transformation with view-update, denoted a lens, encompasses the definition of a forward transformation projecting concrete models into abstract views, together with a backward transformation instructing how to translate an abstract view to an update over concrete models. In this paper we show that most of the standard point-free combinators can be lifted to lenses with suitable backward semantics, allowing us to use the point-free style to define powerful bidirectional transformations by composition. We also demonstrate how to define generic lenses over arbitrary inductive data types by lifting standard recursion patterns, like folds or unfolds. To exemplify the power of this approach, we “lensify ” some standard functions over naturals and lists, which are tricky to define directly “by-hand ” using explicit recursion.
Bidirectionalization for free! (Perl)
, 2009
"... A bidirectional transformation consists of a function get that takes a source (document or value) to a view and a function put that takes an updated view and the original source back to an updated source, governed by certain consistency conditions relating the two functions. Both the database and pr ..."
Abstract
- Add to MetaCart
A bidirectional transformation consists of a function get that takes a source (document or value) to a view and a function put that takes an updated view and the original source back to an updated source, governed by certain consistency conditions relating the two functions. Both the database and programming language communities have studied techniques that essentially allow a user to specify only one of get and put and have the other inferred automatically. All approaches so far to this bidirectionalization task have been syntactic in nature, either proposing a domain-specific language with limited expressiveness but built-in (and composable) backward components, or restricting get to a simple syntactic form from which some algorithm can synthesize an appropriate definition for put. Here we present a semantic approach instead. The idea is to take a general-purpose language, Haskell, and write a higher-order function that takes (polymorphic) get-functions as arguments and returns appropriate put-functions. All this on the level of semantic values, without being willing, or even able, to inspect the definition of get, and thus liberated from syntactic restraints. Our solution is inspired by relational parametricity and uses free theorems for proving the consistency conditions. It works beautifully.
Languages
"... It is often convenient to write a function and apply it to a specific input. However, a program developed in this way may be inefficient to evaluate and difficult to analyze due to its generality. In this paper, we propose a technique of new specialization for a class of XML transformations, in whic ..."
Abstract
- Add to MetaCart
It is often convenient to write a function and apply it to a specific input. However, a program developed in this way may be inefficient to evaluate and difficult to analyze due to its generality. In this paper, we propose a technique of new specialization for a class of XML transformations, in which no output of a function can be decomposed or traversed. Our specialization is type-based in the sense that it uses the structures of input types; types are described by regular hedge grammars and subtyping is defined settheoretically. The specialization always terminates, resulting in a program where every function is fully specialized and only accepts its rigid input. We present several interesting applications of our new specialization, especially for injectivity analysis.
Type-Based Specialization . . .
, 2009
"... It is often convenient to write a function and apply it to a specific input. However, a program developed in this way may be inefficient to evaluate and difficult to analyze due to its generality. In this paper, we propose a technique of new specialization for a class of XML transformations, in whic ..."
Abstract
- Add to MetaCart
It is often convenient to write a function and apply it to a specific input. However, a program developed in this way may be inefficient to evaluate and difficult to analyze due to its generality. In this paper, we propose a technique of new specialization for a class of XML transformations, in which no output of a function can be decomposed or traversed. Our specialization is type-based in the sense that it uses the structures of input types; types are described by regular hedge grammars and subtyping is defined settheoretically. The specialization always terminates, resulting in a program where every function is fully specialized and only accepts its rigid input. We present several interesting applications of our new specialization, especially for injectivity analysis.

