# A modal analysis of staged computation

@article{Davies2001AMA, title={A modal analysis of staged computation}, author={Rowan Davies and F. Pfenning}, journal={J. ACM}, year={2001}, volume={48}, pages={555-604} }

We show that a type system based on the intuitionistic modal logic S4 provides an expressive framework for specifying and analyzing computation stages in the context of typed λ-calculi and functional languages. We directly demonstrate the sense in which our <inline-equation> <f> <g>l</g><sup>→□</sup><inf>e</inf></f> </inline-equation>-calculus captures staging, and also give a conservative embeddng of Nielson and Nielson's two-level functional language in our functional language Mini-ML<inline… Expand

#### Topics from this paper

#### 224 Citations

Understanding the Expressive Power of Unhygienic Substitution in Metaprogramming via Combinatory Logic

- Mathematics, Computer Science
- ArXiv
- 2019

It is concluded that there is quantitative evidence to support the claim that metaprogramming with unhygienic substitution is more powerful than metapprogramming with hygiening substitution. Expand

Practical Aspects of Declarative Languages

- Computer Science
- Lecture Notes in Computer Science
- 2016

Interpretation over Non-deterministic Finite Tree Automata for Set-Based Analysis of Logic Programs and Debugging Scheme for Declarative Equation Based Modeling Languages. Expand

Formal Aspects of Component Software

- Computer Science
- Lecture Notes in Computer Science
- 2011

The OnPlan framework is proposed, a mathematical specification of requirements for autonomous systems operating in domains with large probabilistic state spaces and high branching factors, and its ability to provide system autonomy is illustrated empirically on a robotic rescue example. Expand

Program Logics for Homogeneous Meta-programming

- Computer Science
- LPAR
- 2010

This paper provides the first program logics for homogeneous meta- programming - using a variant of MiniMLe by Davies and Pfenning as underlying meta-programming language and demonstrates that the logics are relatively complete in the sense of Cook, enable the inductive derivation of characteristic formulae, and exactly capture the observational properties induced by the operational semantics. Expand

Relating Staged Computation to the Record Calculus

- Computer Science
- 2010

This work fine-tune the previously shown relation between the two operational semantics, and obtain more precise results that provide an important step towards reusing already-existing record calculus static analyses to reason about staged expressions. Expand

A Logical Foundation for Environment Classifiers

- Computer Science
- TLCA
- 2009

This paper investigates the Curry-Howard isomorphism for environment classifiers by developing a typed *** -calculus *** *** and proves that *** *** enjoys basic properties including subject reduction, confluence, and strong normalization and that the execution of a well-typed *** *** program is properly staged. Expand

Classical Natural Deduction for S4 Modal Logic

- Computer Science
- APLAS
- 2009

A natural deduction system CNDS4 for classical S4 modal logic with necessity and possibility modalities is proposed and the computational interpretation of the modal ***μ -calculus, especially the computational meaning of themodal possibility operator, is discussed. Expand

A modal type system for multi-level generating extensions with persistent code

- Computer Science
- PPDP '06
- 2006

A typed λ calculus λ circle square is proposed, based on linear-time temporal logic, as a basis of programming languages for multi-level generating extensions with persistent code, and its key property of time-ordered normalization that a well-typed program can never go back to a previous stage in a "time-ordered" execution is proved. Expand

A polymorphic modal type system for lisp-like multi-staged languages

- Computer Science
- POPL '06
- 2006

This article presents a polymorphic modal type system and its principal type inference algorithm that conservatively extend ML by all of Lisp's staging constructs (the quasi-quotation system). The… Expand

The role of type equality in meta-programming

- Computer Science
- 2004

This thesis studies a class of meta-language features that are used to write meta-programs that are statically guaranteed to maintain semantic invariants of object-language programs, such as typing and scoping, and designs a meta- language with dependent types and a built-in equality proofs. Expand

#### References

SHOWING 1-10 OF 42 REFERENCES

Two-level functional languages

- Computer Science
- Cambridge tracts in theoretical computer science
- 1992

1. Introduction 2. Types made explicit 3. Binding-time made explicit 4. Combinators made explicit 5. Parametrized semantics 6. Code generation 7. Abstract interpretation 8. Conclusions Bibliography… Expand

A Partial Evaluator for the Untyped lambda-Calculus

- Computer Science
- J. Funct. Program.
- 1991

A simple applicative language: mini-ML

- Computer Science
- LFP '86
- 1986

This work restricts ML to a central part christened Mini-ML, a simple typed ~-calculus with constants, products, conditionals, and recursive function definitions, and gives complementary rules to deal with products and lztre~. Expand

Multi-Stage Programming with Explicit Annotations

- Computer Science
- PEPM
- 1997

A thesis of this paper is that multi-stage languages are useful as programming languages in their own right, and should support features that make it possible for programmers to write staged computations without significantly changing their normal programming style. Expand

On the Unity of Logic

- Mathematics, Computer Science
- Ann. Pure Appl. Log.
- 1993

Cette approche est radicalement differente de l'approche habituelle qui consiste tout bonnementachanger the regle du jeu quand on veut changer de logique, c'estadire de style de sequent. Expand

Efficient Algebraic Operations on Programs

- Computer Science
- AMAST
- 1991

A new notation is introduced to describe thetypes of symbolic operations, one that makes an explicit distinction between the types of program texts and the values they denote, which leads to natural definitions of what it means for an interpreter or compiler to be type correct—a tricky problem in a multilanguage context. Expand

Compilers and staging transformations

- Computer Science
- POPL '86
- 1986

The aim is to demonstrate how perspicuous accounts of precomputation and frequency reduction can be given for a wide range of applications using a small number of relatively straightforward techniques. Expand

A judgmental reconstruction of modal logic

- Mathematics, Computer Science
- Mathematical Structures in Computer Science
- 2001

This work reconsiders the foundations of modal logic, following Martin-Löf's methodology of distinguishing judgments from propositions, and gives a new presentation of lax logic, finding that the lax modality is already expressible using possibility and necessity. Expand

Run-time code generation and modal-ML

- Computer Science
- PLDI 1998
- 1998

An overview of the language, called ML', is presented, with several examples of programs that illustrate key concepts and programming techniques, and the results of some experiments are shown, to demonstrate the benefits of this style of run-time code generation for some applications. Expand

A modal analysis of staged computation

- Computer Science
- POPL '96
- 1996

The main technical result is a conservative embedding of Nielson & Nielson's two-level functional language in the language Mini-ML, thus proving that binding-time correctness is equivalent to modal correctness on this fragment. Expand