## A Semantic Model for Graphical User Interfaces (2011)

### Cached

### Download Links

Citations: | 8 - 1 self |

### BibTeX

@MISC{Krishnaswami11asemantic,

author = {Neelakantan R. Krishnaswami and Nick Benton},

title = { A Semantic Model for Graphical User Interfaces},

year = {2011}

}

### OpenURL

### Abstract

We give a denotational model for graphical user interface (GUI) programming in terms of the cartesian closed category of ultrametric spaces. The metric structure allows us to capture natural restrictions on reactive systems, such as causality, while still allowing recursively defined values. We capture the arbitrariness of user input (e.g., a user gets to decide the stream of clicks she sends to a program) by making use of the fact that the closed subsets of a metric space themselves form a metric space under the Hausdorff metric, allowing us to interpret nondeterminism with a “powerspace ” monad on ultrametric spaces. The powerspace monad is commutative, and hence gives rise to a model of linear logic. We exploit this fact by constructing a mixed linear/nonlinear domain-specific language for GUI programming. The linear sublanguage naturally captures the usage constraints on the various linear objects in GUIs, such as the elements of a DOM or scene graph. We have implemented this DSL as an extension to OCaml, and give examples demonstrating that programs in this style can be short and readable.

### Citations

6036 |
Design Patterns: Elements of Reusable Object-Oriented Software
- Gamma, Helm, et al.
- 1995
(Show Context)
Citation Context ..., which makes practical comparisons difficult. Nevertheless, it is still possible to draw distinctions at the architectural level. Traditional GUI toolkits (based on the model-view-controller pattern =-=[15]-=-) are logically structured as a collection of asynchronous event processors. Each GUI widget listens to events generated by some other widgets (and the main application/event loop), and generates even... |

220 | Functional reactive animation
- Elliott, Hudak
- 1997
(Show Context)
Citation Context ..., difficult to extend, and understanding the behavior of client code requires deep familiarity with the internal implementation of the toolkit. Since its introduction, functional reactive programming =-=[12]-=- has held great promise for simplifying the specification and interface to graphical user interface libraries. However, a persistent difficulty with modeling user interface toolkits with functional re... |

102 | A mixed linear and non-linear logic: proofs, terms and models
- Benton
- 1994
(Show Context)
Citation Context ...imple semantics for the arbitrariness of user interaction. 2. We give a type theory for this semantics, which integrates our recent work on type systems for guarded recursion with an adjoint calculus =-=[1, 2]-=- for mixed linear/nonlinear logic. Despite the presence of a fixed point operator fix x : A. e, this type theory has excellent proof-theoretic properties, including a simple normalization proof. 3. We... |

88 | Processes and the denotational semantics of concurrency - Bakker, Zucker - 1982 |

80 | A Concurrent Logical Framework I: Judgments and Properties
- Watkins, Cervesato, et al.
- 2002
(Show Context)
Citation Context ...n the cons expression.Now, we can show that every term has a normal form (i.e., a weak normalization result) in the following manner. Given two nnormal terms, we can define a hereditary substitution =-=[27]-=- which combines substitution and computing a normal form. For our type system, an appropriate functions are given in Figures 10, 11, and 12. In each of these figures, we define two of six mutually rec... |

61 | Functional reactive programming from first principles
- Wan, Hudak
- 2000
(Show Context)
Citation Context ...A distinctive feature of the original FRP work is its focus on continuous time. Though it does not yet do so, we hope our proof framework can extend to proving a sampling theorem, as in Wan and Hudak =-=[26]-=-. On the semantic side, we can easily model continuous behaviors as functions of type R → A, but relating it to an implementation delivering time deltas (instead of ticks, as presently) seems much mor... |

56 |
Functional reactive programming, continued
- Nilsson, Courtney, et al.
(Show Context)
Citation Context ...e are common stream functions which are not causal; the simplest example of which is tail xs, whose n-th value is the n + 1-st value of xs. There have been several attempts to resolve this difficulty =-=[18, 20]-=-, all of which build on the basic idea of using data abstraction to restrict the definable functions to the causal ones. In recent work [17], we have described a new solution to this problem which sti... |

48 |
Lustre: a declarative language for real-time programming
- CASPI, PILAUD, et al.
- 1987
(Show Context)
Citation Context ...ivery depends on the specific order in which callbacks were registered with a widget object.) In contrast, our system is based on a synchronous model of time, such as used in languages such as Lustre =-=[6]-=- and Lucid Synchrone [21]. There is a global clock, which is respected by every event stream in the program — every stream generates one event each tick. Our primary motivation was that with a simpler... |

40 | Embedding Dynamic Dataflow in a Call-by-Value Language
- Cooper, Krishnamurthi
- 2006
(Show Context)
Citation Context ...del continuous behaviors as functions of type R → A, but relating it to an implementation delivering time deltas (instead of ticks, as presently) seems much more challenging. Cooper and Krishnamurthi =-=[7, 8]-=-, describe FrTime, an embedding of functional reactive programming into the PLT Scheme (now Racket) implementation. They integrate a language with full (i.e., non-commutative) effects, which rules out... |

37 |
Elements of generalized ultrametric domain theory
- Rutten
- 1996
(Show Context)
Citation Context ... use functional composition f ◦ g when composing maps in Ult, and diagrammatic order f; g when composing maps in Ult P .) Because PC is a commutative strong monad, Ult has equalizers and coequalizers =-=[22]-=-, and Ult P has coequalizers of reflexive pairs (since PC preserves coequalizers of reflexive pairs), Ult P is symmetric monoidal closed [2, 14, 16]. The tensor product is defined using a coequalizer ... |

35 | Linear logic, monads and the lambda calculus
- Benton, Wadler
- 1996
(Show Context)
Citation Context ...imple semantics for the arbitrariness of user interaction. 2. We give a type theory for this semantics, which integrates our recent work on type systems for guarded recursion with an adjoint calculus =-=[1, 2]-=- for mixed linear/nonlinear logic. Despite the presence of a fixed point operator fix x : A. e, this type theory has excellent proof-theoretic properties, including a simple normalization proof. 3. We... |

27 | A modality for recursion
- Nakano
- 2000
(Show Context)
Citation Context ...rder stream programs over integers and wrote “We think there are no problems when we allow functions of higher order[. . . ]”. Birkedal et al. [3] have recently given an ultrametric model of Nakano’s =-=[19]-=- calculus for guarded recursion. Nakano’s types are very similar to ours (though he supports full recursive types), making use of a delay type to guard recursive definition. However, his system includ... |

23 | A Coiterative Characterization of Synchronous Stream Functions
- Caspi, Pouzet
(Show Context)
Citation Context ...tions involving powerspaces rather difficult, and so the possibility of working with ordinary powersets (albeit in a slightly different mathematical universe) seems quite attractive. Pouzet and Caspi =-=[5]-=- extended synchronous dataflow programming to higher order with their co-iterative semantics. They illustrated how that this generated a Cartesian closed category (of size-preserving functions), which... |

21 |
Lucid Synchrone, version 3. Tutorial and reference manual
- Pouzet
- 2006
(Show Context)
Citation Context ...cific order in which callbacks were registered with a widget object.) In contrast, our system is based on a synchronous model of time, such as used in languages such as Lustre [6] and Lucid Synchrone =-=[21]-=-. There is a global clock, which is respected by every event stream in the program — every stream generates one event each tick. Our primary motivation was that with a simpler deterministic semantics,... |

19 | The essence of dataflow programming
- Uustalu, Vene
- 2005
(Show Context)
Citation Context ... order with their co-iterative semantics. They illustrated how that this generated a Cartesian closed category (of size-preserving functions), which they used to interpret functions. Uustalu and Vene =-=[24]-=- subsequently observed that size-preserving functions could be understood more abstractly as the co-Kleisli category of streams. However, in both of these works, feedback was handled in a somewhat ad ... |

18 | Closed categories generated by commutative monads
- Kock
- 1971
(Show Context)
Citation Context ...mutative strong monad, Ult has equalizers and coequalizers [22], and Ult P has coequalizers of reflexive pairs (since PC preserves coequalizers of reflexive pairs), Ult P is symmetric monoidal closed =-=[2, 14, 16]-=-. The tensor product is defined using a coequalizer and the exponential by an equalizer. We can lift the distribution of the next modality through tensor products and zip ˆ • : •A⊗•B ≃ •(A⊗B) the mono... |

17 | An extension of models of axiomatic domain theory to models of synthetic domain theory
- Fiore, Plotkin
- 1996
(Show Context)
Citation Context ...mutative strong monad, Ult has equalizers and coequalizers [22], and Ult P has coequalizers of reflexive pairs (since PC preserves coequalizers of reflexive pairs), Ult P is symmetric monoidal closed =-=[2, 14, 16]-=-. The tensor product is defined using a coequalizer and the exponential by an equalizer. We can lift the distribution of the next modality through tensor products and zip ˆ • : •A⊗•B ≃ •(A⊗B) the mono... |

12 | Safe functional reactive programming through dependent types
- Sculthorpe, Nilsson
- 2009
(Show Context)
Citation Context ...give combinators restricting the definable stream transformers to the causal ones. The restriction to arrows is roughly equivalent to first-order functional programming, though Sculthorpe and Nilsson =-=[23]-=- introduced additional combinators to recover higher-order and dynamic behavior while using dependent types to retain causality. In contrast, Liu, Cheng and Hudak [18] showed how to exploit this first... |

12 | Localic completion of generalized metric spaces II: Powerlocales. draft available on web at http://www.cs.bham.ac.uk/~sjv
- Vickers
- 2003
(Show Context)
Citation Context ...pplies f pointwise to the elements of its argument, and takes the metric closure of that image. Explicitly, PC(f) = λX. cl({f(x) | x ∈ X}). The functor PC(−) gives rise to a strong, commutative monad =-=[25]-=-. We will write ηX : X → PC(X) and µX : P 2 C(X) → PC(X) for its unit and multiplication, and σX : X × PC(Y ) → PC(X × Y ) for its strength. Explicitly, the definition of the unit is η(x) = {x}, and t... |

11 |
Integrating Dataflow Evaluation into a Practical HigherOrder Call-by-Value Language
- Cooper
- 2008
(Show Context)
Citation Context ...del continuous behaviors as functions of type R → A, but relating it to an implementation delivering time deltas (instead of ticks, as presently) seems much more challenging. Cooper and Krishnamurthi =-=[7, 8]-=-, describe FrTime, an embedding of functional reactive programming into the PLT Scheme (now Racket) implementation. They integrate a language with full (i.e., non-commutative) effects, which rules out... |

10 | Enriching an effect calculus with linear types - Egger, Møgelberg, et al. - 2009 |

10 | Causal commutative arrows and their optimization
- Liu, Cheng, et al.
- 2009
(Show Context)
Citation Context ...g, though Sculthorpe and Nilsson [23] introduced additional combinators to recover higher-order and dynamic behavior while using dependent types to retain causality. In contrast, Liu, Cheng and Hudak =-=[18]-=- showed how to exploit this first-order structure to develop a very efficient compilation scheme (reminiscent of the Bohm-Jacopini theorem) from arrow programs to single-loop code. A distinctive featu... |

9 | Ultrametric semantics of reactive programs
- Krishnaswami, Benton
- 2011
(Show Context)
Citation Context ... world to generate a potentially arbitrary stream of clicks – indeed, this is the essence of the abstraction – it is difficult to explain it as a pure value. In this paper, we extend our earlier work =-=[17]-=- on the semantics of functional reactive programming to account for this phenomenon. In that work, we used the category of ultrametric spaces to interpret higher-order functional reactive programs, an... |

9 | Localic Completion of Generalized Metric Spaces I, Theory and - Vickers - 2005 |

8 | First steps in synthetic guarded domain theory: step-indexing in the topos of trees
- Birkedal, Møgelberg, et al.
- 2012
(Show Context)
Citation Context ...de interactive programs, this suggests a direction of investigation for learning how to support these operations without disturbing the reasoning principles of the language. Recently, Birkedal et al. =-=[4]-=- have given an alternative model of guarded recursion, based on the topos of trees. Their construction forms a topos, and so many of the semantic constructions we performed with metric spaces can be r... |

6 |
Towards a uniform topological treatment of streams and functions on streams
- Bakker, Kok
- 1985
(Show Context)
Citation Context ...arly 1980s, to simplify the denotational semantics of concurrency [10]. The applications to stream programming were recognized early, but not followed up on: in a surprisingly little-cited 1985 paper =-=[9]-=-, de Bakker and Kok proposed an ultrametric semantics for a language of first-order stream programs over integers and wrote “We think there are no problems when we allow functions of higher order[. . ... |

6 | A metric model of PCF
- Escardó
(Show Context)
Citation Context ...rsion operator fix x : X. e using only ordinary induction — as the proof of Banach’s theorem hints we ought, since it only uses induction up to ω to find fixed points. A suggestive paper of Escardo’s =-=[13]-=- gives a metric model to PCF. He noticed that ultrametric spaces support a version of the lift monad from domain theory, and that the extra structure of metrics relative to domains means that the lift... |

4 |
A metric model of guarded recursion
- Birkedal, Schwinghammer, et al.
- 2010
(Show Context)
Citation Context ...oposed an ultrametric semantics for a language of first-order stream programs over integers and wrote “We think there are no problems when we allow functions of higher order[. . . ]”. Birkedal et al. =-=[3]-=- have recently given an ultrametric model of Nakano’s [19] calculus for guarded recursion. Nakano’s types are very similar to ours (though he supports full recursive types), making use of a delay type... |