1,318 research outputs found

    Composing least-change lenses

    Get PDF
    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.(undefined

    Lens put-put laws: monotonic and mixed

    Get PDF
    Many authors have argued, for good reasons, that in a range of applications the lens put-put law is too strong.  On the other hand, the present authors have shown that very well behaved lenses, which do satisfy the put-put law by definition, are algebras for a certain monad, and that this viewpoint admits fruitful generalisations of the lens concept to a variety of base categories. In the algebra approach to lenses, the put-put law corresponds to the associativity axiom, and so is fundamentally important. Thus we have a dilemma. The put-put law seems inappropriate for many applications, but is fundamental to the mathematical development that can support an extended range of applications. In this paper we resolve this dilemma. We outline monotonic put-put laws and introduce a new mixed put-put law that appears to be immune to many of the objections to the classical put-put law, and still supports a very satisfactory mathematical foundation.
    corecore