## A monadic formalization of ML5 (2010)

### Cached

### Download Links

Venue: | In Pre-preceedings of Workshop on Logical Frameworks and Metalanguages: Theory and Practice |

Citations: | 3 - 2 self |

### BibTeX

@INPROCEEDINGS{Licata10amonadic,

author = {Daniel R. Licata and Robert Harper},

title = {A monadic formalization of ML5},

booktitle = {In Pre-preceedings of Workshop on Logical Frameworks and Metalanguages: Theory and Practice},

year = {2010}

}

### OpenURL

### Abstract

ML5 is a programming language for spatially distributed computing, based on a Curry-Howard correspondence with the modal logic S5. However, the ML5 programming language differs from the logic in several ways. In this paper, we give a semantic embedding of ML5 into the dependently typed programming language Agda, which both explains these discrepancies between ML5 and S5 and suggests some simplifications and generalizations of the language. Our embedding translates ML5 into a slightly different logic: intuitionistic S5 extended with a lax modality that encapsulates effectful computations in a monad. Rather than formalizing lax S5 as a proof theory, we embed it as a universe within the the dependently typed host language, with the universe elimination given by implementing the modal logic’s Kripke semantics. 1

### Citations

732 | Notions of computation and monads
- Moggi
- 1991
(Show Context)
Citation Context ... clarifies the role of the world in a value judgement. We translate ML5 into the intuitionistic logic S5 extended with a lax modality, written ○ A, that encapsulates effectful computations in a monad =-=[10, 15, 21]-=-. This monadic distinction between pure terms and effectful computations is already tacit in ML5’s distinction between values and expressions—and in intermediate languages used in the ML5 compiler (e.... |

697 | A Framework for Defining Logics
- Harper, Honsell, et al.
- 1992
(Show Context)
Citation Context ... to meta-language types. This shows how to achieve similar convenience of notation, without requiring separate display-form facilities. Avron et al. [8] consider representations of modal logics in LF =-=[18]-=-, some of which use worldindexed judgements to track scoping. We also use a world-indexed type familyA < w >, but this relation is defined semantically (by interpretation into Agda) rather than syntac... |

313 | System description: Twelf - a metalogical framework for deductive systems
- Pfenning, Schürmann
- 1999
(Show Context)
Citation Context ...ides a worked example of this phenomenon, investigating the ML5 programming language for spatially distributed computing [23]. ML5 has previously been formalized [23] using syntactic methods in Twelf =-=[26]-=-. However, we wished to give a semantic interpretation of ML5 into a dependently typed programming language, as a first step towards extending work on embeddings of security typed-languages [22] to ac... |

221 | A core calculus of dependency
- Abadi, Banerjee, et al.
- 1999
(Show Context)
Citation Context ... core, our interpretation reduces ML5 to L5, a language with an indexed monad IO w A of computations at a place. Indexed monads have been studied in a variety of previous work, including Abadi et al. =-=[1]-=-, Atkey [6], Nanevski et al. [24], Russo et al. [27]. However, to interpret ML5, we require the programming language to provide quantification over the indices to the monad, which DCC [1], for example... |

171 | Towards a practical programming language based on dependent type theory
- Norell
- 2007
(Show Context)
Citation Context ...an be eliminated in favor of ∀ and at, given the standard pure elim rules for these types. Rather than formalizing lax S5 as a proof theory, we embed it inside a dependently typed host language, Agda =-=[25]-=-. First, we define a lax logic for distributed programming, L5, which is embedded in Agda using an indexed monad of computations at a place. Next, we define a universe of hybrid modal types, HL5, and ... |

101 | Hybrid logics: characterization, interpolation and complexity
- Areces, Blackburn, et al.
(Show Context)
Citation Context ...different□-like modalities with the same introduction rule. The first is written A, while the second, ∀w.A at w, is a composition of the connective ∀ (quantification over worlds) and the hybrid logic =-=[5]-=- at modality, which internalizes the judgement A[w] as a connective. (Hybrid logic is between modal logic (truth is relativised to worlds) and first-order logic (propositions may mention worlds)). The... |

100 | The Proof Theory and Semantics of Intuitionistic Modal Logic
- Simpson
- 1994
(Show Context)
Citation Context ...lly, ML5 employs a type system based on a Curry-Howard correspondence with the modal logic S5 to catch these errors statically. ML5 is defined as an intuitionistic modal logic in the style of Simpson =-=[28]-=-, where hypotheses and conclusions are considered relative to worlds, which represent places on a network. The ML5 typing judgement has the form x1 : A1[w1],...,xn : An[wn]⊢e: C[w], where Ai and C are... |

64 | Polymorphism and separation in Hoare Type Theory
- Nanevski, Morrisett, et al.
- 2006
(Show Context)
Citation Context ...s ML5 to L5, a language with an indexed monad IO w A of computations at a place. Indexed monads have been studied in a variety of previous work, including Abadi et al. [1], Atkey [6], Nanevski et al. =-=[24]-=-, Russo et al. [27]. However, to interpret ML5, we require the programming language to provide quantification over the indices to the monad, which DCC [1], for example, does not provide. It would be i... |

54 | Computational types from a logical perspective
- Benton, Bierman, et al.
- 1998
(Show Context)
Citation Context ... clarifies the role of the world in a value judgement. We translate ML5 into the intuitionistic logic S5 extended with a lax modality, written ○ A, that encapsulates effectful computations in a monad =-=[10, 15, 21]-=-. This monadic distinction between pure terms and effectful computations is already tacit in ML5’s distinction between values and expressions—and in intermediate languages used in the ML5 compiler (e.... |

52 | Generic programming within dependently typed programming
- Altenkirch, McBride
- 2003
(Show Context)
Citation Context ...ectives are derivable using the new ones. 7 Related Work Murphy [23] describes ML5 and related languages, such as work by Jia and Walker [19].82 A Monadic Formalization of ML5 Altenkirch and McBride =-=[3]-=-, Benke et al. [9], Chlipala [12], Crary [14] describe other uses of universes and semantic embeddings in type theory, though they do not consider embedding a modal type system. We have used the same ... |

43 | Indexed induction-recursion
- Dybjer, Setzer
- 2006
(Show Context)
Citation Context ... like to embed proof-based access control following PCML5 [7], which will require a modal universe with dependent types. Dependently typed universes are easiest to represent using induction-recursion =-=[17]-=-, which Agda supports but Coq does not. In future work, we also plan to complete a proof that the operational semantics of ML5 are sound for the denotational semantics. We have formalized the operatio... |

42 | Universes for generic programs and proofs in dependent type theory
- Benke, Dybjer, et al.
- 2003
(Show Context)
Citation Context ...ble using the new ones. 7 Related Work Murphy [23] describes ML5 and related languages, such as work by Jia and Walker [19].82 A Monadic Formalization of ML5 Altenkirch and McBride [3], Benke et al. =-=[9]-=-, Chlipala [12], Crary [14] describe other uses of universes and semantic embeddings in type theory, though they do not consider embedding a modal type system. We have used the same technique for embe... |

40 | Higher-order abstract syntax in Coq
- Despeyroux, Felty, et al.
- 1995
(Show Context)
Citation Context ...ules for ∀5 (λ w → A at w). We represent types with free world variables as Agda functions from worlds to types. This is permissible because World is defined prior to type (i.e. we are using Weak HOAS=-=[11, 16]-=-). If World is chosen to be a base type in Agda, then it adequately represents ML5 types as in Murphy [23]. If instead World is chosen to be an inductive type, this representation yields a language wi... |

38 | Parameterised notions of computation
- ATKEY
(Show Context)
Citation Context ...interpretation reduces ML5 to L5, a language with an indexed monad IO w A of computations at a place. Indexed monads have been studied in a variety of previous work, including Abadi et al. [1], Atkey =-=[6]-=-, Nanevski et al. [24], Russo et al. [27]. However, to interpret ML5, we require the programming language to provide quantification over the indices to the monad, which DCC [1], for example, does not ... |

23 | W.: Observational equality, now
- Altenkirch, McBride, et al.
- 2007
(Show Context)
Citation Context ...Here EqSet is an Agda relation expressing that the two Sets are equal classifiers (in fact, we need a notion of equality that compares the bodies of Π and Σ on all arguments, which we borrow from OTT =-=[4]-=-); it is equipped with an operation coerce : ∀ {A B} → EqSet A B → A → B. It is simple to prove that A at w is constant, and that the connectives ∨ ⊃ ∀5 ∃5 preserve constantness. Neither ref nor ○ is ... |

23 | Type-Theoretic Methodology for Practical Programming Languages
- Crary
- 1998
(Show Context)
Citation Context ...Related Work Murphy [23] describes ML5 and related languages, such as work by Jia and Walker [19].82 A Monadic Formalization of ML5 Altenkirch and McBride [3], Benke et al. [9], Chlipala [12], Crary =-=[14]-=- describe other uses of universes and semantic embeddings in type theory, though they do not consider embedding a modal type system. We have used the same technique for embedding a hybrid type system ... |

23 | A library for light-weight information-flow security in Haskell
- Russo, Claessen, et al.
- 2008
(Show Context)
Citation Context ...uage with an indexed monad IO w A of computations at a place. Indexed monads have been studied in a variety of previous work, including Abadi et al. [1], Atkey [6], Nanevski et al. [24], Russo et al. =-=[27]-=-. However, to interpret ML5, we require the programming language to provide quantification over the indices to the monad, which DCC [1], for example, does not provide. It would be interesting to adapt... |

20 | Modal Types for Mobile Code
- Murphy
- 2008
(Show Context)
Citation Context ... used, can lead to new insights about the system being studied. This paper provides a worked example of this phenomenon, investigating the ML5 programming language for spatially distributed computing =-=[23]-=-. ML5 has previously been formalized [23] using syntactic methods in Twelf [26]. However, we wished to give a semantic interpretation of ML5 into a dependently typed programming language, as a first s... |

19 | Distributed programming with distributed authorization, 2009. Available at http://www.cs.cmu.edu/˜kavijit/papers/pcml5-full.pdf. Lujo
- Avijit, Datta, et al.
(Show Context)
Citation Context ...typed programming language, as a first step towards extending work on embeddings of security typed-languages [22] to account for spatially distributed access control, as in the PCML5 extension of ML5 =-=[7]-=-. Our semantic formalization of ML5 provides insight into several discrepancies between ML5 and the logic upon which it is based, and suggests some simplifications and generalizations of the language,... |

19 |
The elimination theorem when modality is present
- Curry
- 1952
(Show Context)
Citation Context ... clarifies the role of the world in a value judgement. We translate ML5 into the intuitionistic logic S5 extended with a lax modality, written ○ A, that encapsulates effectful computations in a monad =-=[10, 15, 21]-=-. This monadic distinction between pure terms and effectful computations is already tacit in ML5’s distinction between values and expressions—and in intermediate languages used in the ML5 compiler (e.... |

18 | Modal proofs as distributed programs
- Jia, Walker
- 2003
(Show Context)
Citation Context ...e remaining derivabilities show that the old rules for the connectives are derivable using the new ones. 7 Related Work Murphy [23] describes ML5 and related languages, such as work by Jia and Walker =-=[19]-=-.82 A Monadic Formalization of ML5 Altenkirch and McBride [3], Benke et al. [9], Chlipala [12], Crary [14] describe other uses of universes and semantic embeddings in type theory, though they do not ... |

17 | A universe of binding and computation
- Licata, Harper
- 2009
(Show Context)
Citation Context ...: A1,...,xn : An ⊢ e : C as a universe, it requires a bit of thought to adapt these techniques to languages with modal type systems, such as HL5. In previous work on programming with variable binding =-=[20]-=-, we employed a technique for embedding such modal type systems: intuitionistic modal logics can be given a Kripke semantics in first-order intuitionistic logic [28], and we can formalize this semanti... |

14 | Encoding modal logics in logical frameworks
- Avron, Honsell, et al.
- 1998
(Show Context)
Citation Context ...e modal types are data, equipped with a translation to meta-language types. This shows how to achieve similar convenience of notation, without requiring separate display-form facilities. Avron et al. =-=[8]-=- consider representations of modal logics in LF [18], some of which use worldindexed judgements to track scoping. We also use a world-indexed type familyA < w >, but this relation is defined semantica... |

13 | Security-typed programming within dependently typed programming
- Morgenstern, Licata
- 2010
(Show Context)
Citation Context ...Twelf [26]. However, we wished to give a semantic interpretation of ML5 into a dependently typed programming language, as a first step towards extending work on embeddings of security typed-languages =-=[22]-=- to account for spatially distributed access control, as in the PCML5 extension of ML5 [7]. Our semantic formalization of ML5 provides insight into several discrepancies between ML5 and the logic upon... |

12 | Consistency of the theory of contexts
- Bucalo, Hofmann, et al.
- 2006
(Show Context)
Citation Context ...ules for ∀5 (λ w → A at w). We represent types with free world variables as Agda functions from worlds to types. This is permissible because World is defined prior to type (i.e. we are using Weak HOAS=-=[11, 16]-=-). If World is chosen to be a base type in Agda, then it adequately represents ML5 types as in Murphy [23]. If instead World is chosen to be an inductive type, this representation yields a language wi... |

5 | From dy/dx to []P: A matter of notation
- Allen
- 1998
(Show Context)
Citation Context ...h they do not consider embedding a modal type system. We have used the same technique for embedding a hybrid type system in Agda in previous work [20]. Our technique is quite similar to that of Allen =-=[2]-=-, who defines modal types as display forms for NuPRL types. The technical difference is that Allen considers the modal types simply as notation, whereas in our approach the modal types are data, equip... |

2 |
A certified type-preserving compiler from λ-calculus to assembly language
- Chlipala
- 2007
(Show Context)
Citation Context ...new ones. 7 Related Work Murphy [23] describes ML5 and related languages, such as work by Jia and Walker [19].82 A Monadic Formalization of ML5 Altenkirch and McBride [3], Benke et al. [9], Chlipala =-=[12]-=-, Crary [14] describe other uses of universes and semantic embeddings in type theory, though they do not consider embedding a modal type system. We have used the same technique for embedding a hybrid ... |