Abstract
We give a denotational model for graphical user interface (GUI) programming using the Cartesian closed category of ultrametric spaces. The ultrametric structure enforces causality restrictions on reactive systems and allows well-founded recursive definitions by a generalization of guardedness. 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 an ultrametric space themselves form an ultrametric space, allowing us to interpret nondeterminism with a "powerspace" monad.
Algebras for the powerspace monad yield a model of intuitionistic linear logic, which we exploit in the definition of a mixed linear/non-linear domain-specific language for writing GUI programs. The non-linear part of the language is used for writing reactive stream-processing functions whilst the linear sublanguage naturally captures the generativity and 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.
Supplemental Material
- N. Benton. A mixed linear and non-linear logic: Proofs, terms and models. In Computer Science Logic, volume 933 of LNCS, 1995. Google Scholar
Digital Library
- P. N. Benton and P. Wadler. Linear logic, monads and the lambda calculus. In LICS, pages 420--431, 1996. Google Scholar
Digital Library
- L. Birkedal, J. Schwinghammer, and K. Støvring. A metric model of guarded recursion. In FICS, 2010.Google Scholar
- L. Birkedal, R. E. Møgelberg, J. Schwinghammer, and K. Støvring. First steps in synthetic guarded domain theory: step-indexing in the topos of trees. In LICS, 2011. Google Scholar
Digital Library
- P. Caspi and M. Pouzet. A co-iterative characterization of synchronous stream functions. Electr. Notes Theor. Comput. Sci., 11, 1998.Google Scholar
- P. Caspi, D. Pilaud, N. Halbwachs, and J. Plaice. LUSTRE: A declarative language for real-time programming. In POPL, 1987. Google Scholar
Digital Library
- G. Cooper. Integrating dataflow evaluation into a practical higher-order call-by-value language. PhD thesis, Brown University, 2008. Google Scholar
Digital Library
- G. Cooper and S. Krishnamurthi. Embedding dynamic dataflow in a call-by-value language. Programming Languages and Systems, pages 294--308, 2006. Google Scholar
Digital Library
- J. W. de Bakker and J. N. Kok. Towards a uniform topological treatment of streams and functions on streams. In ICALP, 1985. Google Scholar
Digital Library
- J. W. de Bakker and J. I. Zucker. Denotational semantics of concurrency. In STOC, pages 153--158. ACM, 1982. Google Scholar
Digital Library
- J. Egger, R. E. Møgelberg, and A. Simpson. Enriching an effect calculus with linear types. In E. Grädel and R. Kahle, editors, CSL, volume 5771 of Lecture Notes in Computer Science, pages 240--254. Springer, 2009. ISBN 978-3-642-04026-9. Google Scholar
Digital Library
- C. Elliott and P. Hudak. Functional reactive animation. In ICFP, 1997. Google Scholar
Digital Library
- M. Escardó. A metric model of PCF. In Workshop on Realizability Semantics and Applications, 1999.Google Scholar
- M. P. Fiore and G. D. Plotkin. An extension of models of axiomatic domain theory to models of synthetic domain theory. In Proceedings of Computer Science Logic (CSL), volume 1258 of Lecture Notes in Computer Science. Springer, 1996. Google Scholar
Digital Library
- E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design patterns: elements of reusable object-oriented software. Addison-Wesley Longman Publishing Co., Inc. Boston, MA, USA, 1995. Google Scholar
Digital Library
- A. Kock. Closed categories generated by commutative monads. Journal of the Australian Mathematical Society, 12, 1971.Google Scholar
- N. Krishnaswami and N. Benton. Ultrametric semantics of reactive programs. In LICS. IEEE, 2011. Google Scholar
Digital Library
- H. Liu, E. Cheng, and P. Hudak. Causal commutative arrows and their optimization. In ACM International Conference on Functional Programming, 2009. Google Scholar
Digital Library
- H. Nakano. A modality for recursion. In LICS, pages 255--266, 2000. Google Scholar
Digital Library
- H. Nilsson, A. Courtney, and J. Peterson. Functional reactive programming, continued. In ACM Haskell Workshop, page 64. ACM, 2002. Google Scholar
Digital Library
- M. Pouzet. Lucid Synchrone, version 3. Tutorial and reference manual. Université Paris-Sud, LRI, 2006.Google Scholar
- J. J. M. M. Rutten. Elements of generalized ultrametric domain theory. Theor. Comput. Sci., 170 (1-2): 349--381, 1996. Google Scholar
Digital Library
- N. Sculthorpe and H. Nilsson. Safe functional reactive programming through dependent types. In ICFP, 2009. Google Scholar
Digital Library
- T. Uustalu and V. Vene. The essence of dataflow programming. In Central European Functional Programming School, volume 4164 of LNCS, 2006.Google Scholar
Cross Ref
- S. Vickers. Localic completion of generalized metric spaces II: Powerlocales. Theory and Applications of Categories, 14 (15): 328--356, 2005. ISSN 1201-561X.Google Scholar
- Z. Wan and P. Hudak. Functional reactive programming from first principles. In PLDI, pages 242--252, 2000. Google Scholar
Digital Library
- K. Watkins, I. Cervesato, F. Pfenning, , and D. Walker. A concurrent logical framework i: Judgments and properties. Technical Report Carnegie Mellon University-CS-02-101, Carnegie Mellon University, 2002.Google Scholar
Index Terms
A semantic model for graphical user interfaces
Recommendations
A semantic model for graphical user interfaces
ICFP '11: Proceedings of the 16th ACM SIGPLAN international conference on Functional programmingWe give a denotational model for graphical user interface (GUI) programming using the Cartesian closed category of ultrametric spaces. The ultrametric structure enforces causality restrictions on reactive systems and allows well-founded recursive ...
Semantics for graphical user interfaces
TLDI '12: Proceedings of the 8th ACM SIGPLAN workshop on Types in language design and implementationGraphical user interface (GUI) libraries are one of the most widely-encountered higher-order interfaces. Even in languages (such as Java and C++) where programmers customarily avoid higher-order abstractions, the GUI toolkit interface is invariably ...
Exponentials with infinite multiplicities
CSL'10/EACSL'10: Proceedings of the 24th international conference/19th annual conference on Computer science logicGiven a semi-ring with unit which satisfies some algebraic conditions, we define an exponential functor on the category of sets and relations which allows to define a denotational model of differential linear logic and of the lambda-calculus with ...







Comments