Papers
Topics
Authors
Recent
Search
2000 character limit reached

Partial-State Lenses in Bidirectional Transformations

Updated 15 January 2026
  • Partial-State Lenses are a generalized framework for bidirectional transformations that capture partial state specifications via i-posets.
  • They enable compositional, mergeable semantics for user updates by formalizing ps-consistency, ps-acceptability, and ps-stability.
  • Applications include collaborative editing and distributed systems where concurrent view modifications are synchronized while preserving update intentions.

Partial-state lenses (ps-lenses) generalize classical bidirectional transformation frameworks by introducing domains of partially-specified states—i-posets—that capture user update intentions and provide compositional and mergeable semantics for concurrent view updates. Unlike traditional lenses that operate on fully specified sources and views presuming exact correspondence, ps-lenses encode the degree and direction of specification, enabling robust synchronization even in the presence of multiple, overlapping, or concurrent view modifications (Matsuda et al., 8 Jan 2026).

1. I-posets and Partial Specification

The semantic domain of ps-lenses is the i-poset P=(S,,I)P = (S, \le, I), where SS is a set of "states," \le is a partial order capturing informational refinement, and II \subseteq \le is a reflexive subrelation denoting "identical updates." The key intuition is that sss' \le s indicates ss' is at least as informative as ss, while (s,s)I(s', s) \in I further asserts that ss' brings no new update relative to ss. This structure allows for encoding both traditional discrete states (SS with equality, I={(s,s)}I = \{(s, s)\}), powerset structures ((2X,,)(2^X, \supseteq, \supseteq)), and edit-oriented update pairs (S×US \times U, with UU a poset of edits).

This abstraction supports domains where states or edits may be partially specified—crucial for expressing and merging user intentions across multiple views and updates.

2. Formalization of Partial-State Lenses

A partial-state lens :PQ\ell: P \Leftrightarrow Q between i-posets consists of two partial functions: .get:SV\ell.\mathrm{get}: S \to V and .put:S×VS\ell.\mathrm{put}: S \times V \rightharpoonup S, generalizing the "get" and "put" operations of ordinary asymmetric lenses. The essential innovation is that partial specification percolates into both source and view, such that updates can be encoded as partial states themselves (Matsuda et al., 8 Jan 2026).

Well-behavedness for a ps-lens is captured by three generalized laws:

  • ps-consistency (Generalizing PutGet): If putting a view vv' into a source ss yields a result no more informative than ss', then ss''s view must be at least as informative as vv'.
  • ps-acceptability (Generalizing GetPut): Inserting a view identical (in the sense of II) to .s\ell.s back into ss must yield a state identical to ss.
  • ps-stability (Replacing PutPut): Round-tripping via "upgrade" and composite views generates a state that refines the original, closing under composition.

These laws permit compositional reasoning and express incremental update preservation using partial orders and identical update relations, rather than exactness.

3. Update Preservation, Intention Merging, and Synchronization

Key functionality of ps-lenses is representing and merging user update intentions. Each view update is a partial specification that can be compared and merged using the poset's ordering and a merge operator \oplus (sound for join, total on identical updates). Given two views v1,v2v_1, v_2 and respective intentions w1,w2w_1, w_2, their merge wmerged=w1w2w_{\mathrm{merged}} = w_1 \oplus w_2 concisely aggregates update intentions.

Synchronization is structured such that each intention wiw_i is preserved (in the sense of \le) in the resulting, merged view after propagation through the lens. This distributive, intention-preserving merge is critical for distributed and collaborative scenarios, resembling, but strictly generalizing, CRDT-style concurrency semantics.

4. Compositionality and Lens Construction

The partial-state lens framework extends the compositional structure of ordinary lenses to the partially-specified domain. Two fundamental combinators are formalized:

  • Sequential composition: If 1:PQ\ell_1: P \Leftrightarrow Q and 2:QR\ell_2: Q \Leftrightarrow R are well-behaved, so is their composite $\ell_1 \fatsemi \ell_2: P \Leftrightarrow R$, preserving all three ps-laws.
  • Parallel (product) composition: If 1:P1Q1\ell_1: P_1 \Leftrightarrow Q_1 and 2:P2Q2\ell_2: P_2 \Leftrightarrow Q_2, then the product lens 1×2:P1×P2Q1×Q2\ell_1 \times \ell_2: P_1 \times P_2 \Leftrightarrow Q_1 \times Q_2 is well-behaved, operating point-wise.

A significant result is that the laws of ps-lenses—ps-consistency, ps-acceptability, and ps-stability—are preserved under these composition operations, enabling modular construction of complex, intention-preserving bidirectional transformations.

5. Fundamental Theorems and Properties

Several meta-theoretical properties underpin the robustness of ps-lenses:

Theorem Statement (condensed) Conditions
Get-monotonicity ss    .get(s).get(s)s \le s' \implies \ell.\mathrm{get}(s) \le \ell.\mathrm{get}(s') Weak well-behavedness (ps-consistency, ps-acceptability)
View-stability .get(.put(s,.get(s)))=.get(s)\ell.\mathrm{get}(\ell.\mathrm{put}(s, \ell.\mathrm{get}(s))) = \ell.\mathrm{get}(s) Weak well-behavedness
Put-determines-Get .get(s)=max{vs0,s.  .put(s0,v)=ss}\ell.\mathrm{get}(s) = \max\{v \mid \exists s_0, s'.\; \ell.\mathrm{put}(s_0, v) = s' \le s\} Weak well-behavedness
Stability implication Well-behaved ps-lenses satisfy .put(s,.get(s))=s\ell.\mathrm{put}(s, \ell.\mathrm{get}(s)) = s Well-behavedness (all three laws)
Composition preserves Compositions of well-behaved ps-lenses are well-behaved See sequential and product composition, above

These theorems establish both the soundness and the expressiveness of the partial-state lens model, justifying the ability to reason about update propagation, merge, and synchronization in a partially-specified context (Matsuda et al., 8 Jan 2026).

6. Representative Examples

Partial-state lenses instantiate naturally in diverse scenarios:

  • Duplication lens: $\DUP: P \Leftrightarrow P \times P$ duplicates a source; "put" merges two partial specifications using \oplus.
  • Ps-Initiator: init:SP\mathit{init}: S \Leftrightarrow P applies partial updates (e.g., edits); "get" simply embeds, "put" applies edits in ww to ss.
  • Filter lens: Extracts a subset of data (e.g., "ongoing tasks") and propagates user modifications in the filtered view as partial specifications to the original domain. This enables concurrent edits from multiple views (e.g., "today's tasks" and "ongoing tasks") to be merged and faithfully reflected in the shared underlying source, with preservation guarantees.

In a composed scenario, such as two task-management views ("ongoing" and "today"), the overall lens

$\ell_\mathrm{task} = \DUP \fatsemi (\mathit{filter}_\mathrm{ongoing} \times \mathit{filter}_\mathrm{today}) \fatsemi \mathit{init}$

ensures that edits performed on either view—represented as partial specifications—are merged, yielding consistent synchronized states for all views and preserving every original update intention.

7. Significance and Scope

Partial-state lenses advance the bidirectional programming landscape by integrating compositionality, mergeability, and partial order semantics into the core framework. Their ability to encode and preserve user update intentions amidst concurrent and partially overlapping view updates enables fine-grained, consistent synchronization in collaborative and distributed systems. The formalization with i-posets and ps-laws demonstrates both modular expressiveness and precise control over update propagation, supporting both theoretical analysis and practical deployment in scenarios demanding robust multi-view consistency (Matsuda et al., 8 Jan 2026).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Partial-State Lenses.