Composing Least-change Lenses

Authors

  • Nuno Macedo HASLab, INESC TEC & Universidade do Minho
  • Hugo Pacheco HASLab, INESC TEC & Universidade do Minho
  • Alcino Cunha HASLab, INESC TEC & Universidade do Minho
  • José Oliveira HASLab, INESC TEC & Universidade do Minho

DOI:

https://doi.org/10.14279/tuj.eceasst.57.868

Abstract

Non-trivial bidirectional transformations (BXs) are inherently ambiguous, as there are in general many different ways to consistently translate an update from one side to the other. Existing BX languages and frameworks typically satisfy fundamental first principles which ensure acceptable and stable (well-behaved) translation. Unfortunately, these give little insight about how a particular update translation is chosen among the myriad possible. From the user perspective, such unpredictability may hinder the adoption of BX frameworks.

The problem can be remedied by imposing a “principle of least change” which, in a state-based framework, amounts to translating each update in a way such that its result is as close as possible to the original state, according to some distance measure.

Starting by formalizing such BXs focusing on the particular framework of lenses, this paper discusses whether such least-change lenses can be defined by composition, an essential construct of BX frameworks. For sequential composition, two (dual) update translation alternatives are presented: a classical deterministic one and a nondeterministic. A key ingredient of the approach is the elegant formalization of the main concepts in relation algebra, which exposes several similarities and dualities.

Downloads

Published

2013-09-16

How to Cite

[1]
N. Macedo, H. Pacheco, A. Cunha, and J. Oliveira, “Composing Least-change Lenses”, eceasst, vol. 57, Sep. 2013.