skip to main content
research-article

A semantic model for graphical user interfaces

Published:19 September 2011Publication History
Skip Abstract Section

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.

Skip Supplemental Material Section

Supplemental Material

_talk5.mp4

References

  1. N. Benton. A mixed linear and non-linear logic: Proofs, terms and models. In Computer Science Logic, volume 933 of LNCS, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. P. N. Benton and P. Wadler. Linear logic, monads and the lambda calculus. In LICS, pages 420--431, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. L. Birkedal, J. Schwinghammer, and K. Støvring. A metric model of guarded recursion. In FICS, 2010.Google ScholarGoogle Scholar
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. P. Caspi and M. Pouzet. A co-iterative characterization of synchronous stream functions. Electr. Notes Theor. Comput. Sci., 11, 1998.Google ScholarGoogle Scholar
  6. P. Caspi, D. Pilaud, N. Halbwachs, and J. Plaice. LUSTRE: A declarative language for real-time programming. In POPL, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. G. Cooper. Integrating dataflow evaluation into a practical higher-order call-by-value language. PhD thesis, Brown University, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. G. Cooper and S. Krishnamurthi. Embedding dynamic dataflow in a call-by-value language. Programming Languages and Systems, pages 294--308, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J. W. de Bakker and J. N. Kok. Towards a uniform topological treatment of streams and functions on streams. In ICALP, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J. W. de Bakker and J. I. Zucker. Denotational semantics of concurrency. In STOC, pages 153--158. ACM, 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. Elliott and P. Hudak. Functional reactive animation. In ICFP, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. M. Escardó. A metric model of PCF. In Workshop on Realizability Semantics and Applications, 1999.Google ScholarGoogle Scholar
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  16. A. Kock. Closed categories generated by commutative monads. Journal of the Australian Mathematical Society, 12, 1971.Google ScholarGoogle Scholar
  17. N. Krishnaswami and N. Benton. Ultrametric semantics of reactive programs. In LICS. IEEE, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. H. Liu, E. Cheng, and P. Hudak. Causal commutative arrows and their optimization. In ACM International Conference on Functional Programming, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. H. Nakano. A modality for recursion. In LICS, pages 255--266, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. H. Nilsson, A. Courtney, and J. Peterson. Functional reactive programming, continued. In ACM Haskell Workshop, page 64. ACM, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. M. Pouzet. Lucid Synchrone, version 3. Tutorial and reference manual. Université Paris-Sud, LRI, 2006.Google ScholarGoogle Scholar
  22. J. J. M. M. Rutten. Elements of generalized ultrametric domain theory. Theor. Comput. Sci., 170 (1-2): 349--381, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. N. Sculthorpe and H. Nilsson. Safe functional reactive programming through dependent types. In ICFP, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. T. Uustalu and V. Vene. The essence of dataflow programming. In Central European Functional Programming School, volume 4164 of LNCS, 2006.Google ScholarGoogle ScholarCross RefCross Ref
  25. S. Vickers. Localic completion of generalized metric spaces II: Powerlocales. Theory and Applications of Categories, 14 (15): 328--356, 2005. ISSN 1201-561X.Google ScholarGoogle Scholar
  26. Z. Wan and P. Hudak. Functional reactive programming from first principles. In PLDI, pages 242--252, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle Scholar

Index Terms

  1. A semantic model for graphical user interfaces

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader
    About Cookies On This Site

    We use cookies to ensure that we give you the best experience on our website.

    Learn more

    Got it!