2 results
12 - Towards a theory of document structure
-
- By Bengt Nordström, Chalmers University of Technology and the University of Göteborg
- Edited by Yves Bertot, Gérard Huet, Institut National de Recherche en Informatique et en Automatique (INRIA), Rocquencourt, Jean-Jacques Lévy, Institut National de Recherche en Informatique et en Automatique (INRIA), Rocquencourt, Gordon Plotkin, University of Edinburgh
-
- Book:
- From Semantics to Computer Science
- Published online:
- 06 August 2010
- Print publication:
- 24 September 2009, pp 265-280
-
- Chapter
- Export citation
-
Summary
Abstract
The structure of documents of various degree of formality, from scientific papers with layout information and programs with their documentation to completely formal proofs can be expressed by assigning a type to the abstract syntax tree of the document. By using dependent types – an idea from type theory – it is possible to express very strong syntactic criterion on wellformedness of documents. This structure can be used to automatically generate parsers, type checkers and structure-oriented editors.
Introduction
We are interested to find a general framework for describing the structure of many kinds of documents, such as
books and articles
“live” documents (like a web document with parts to be filled in)
programs
formal proofs.
Are there any good reasons why we use different programs to edit and print articles, programs and formal proofs? A unified view on these kinds of documents would make it possible to use only one structure-oriented editor to build all of them, and it would be easier to combine documents of different kinds, for instance scientific papers, programs with their documentation, informal and formal proofs and simple web forms.
Such a view requires that we have a good framework to express syntactic wellformedness (from things like the absence of a title in a footnote to correctness of a formal proof) and to express how the document should be edited and presented.
6 - A simple type-theoretic language: Mini-TT
-
- By Thierry Coquand, Chalmers University of Technology and Göteborg University, Yoshiki Kinoshita, National Institute of Advanced Industrial Science and Technology (AIST), Japan, Bengt Nordström, Chalmers University of Technology and Göteborg University, Makoto Takeyama, National Institute of Advanced Industrial Science and Technology (AIST), Japan
- Edited by Yves Bertot, Gérard Huet, Institut National de Recherche en Informatique et en Automatique (INRIA), Rocquencourt, Jean-Jacques Lévy, Institut National de Recherche en Informatique et en Automatique (INRIA), Rocquencourt, Gordon Plotkin, University of Edinburgh
-
- Book:
- From Semantics to Computer Science
- Published online:
- 06 August 2010
- Print publication:
- 24 September 2009, pp 139-164
-
- Chapter
- Export citation
-
Summary
Abstract
This paper presents a formal description of a small functional language with dependent types. The language contains data types, mutual recursive/inductive definitions and a universe of small types. The syntax, semantics and type system is specified in such a way that the implementation of a parser, interpreter and type checker is straight-forward. The main difficulty is to design the conversion algorithm in such a way that it works for open expressions. The paper ends with a complete implementation in Haskell (around 400 lines of code).
Introduction
We are going to describe a small language with dependent types, its syntax, operational semantics and type system. This is in the spirit of the paper “A simple applicative language: Mini-ML” by Clément, Despeyroux, and Kahn, where they explain a small functional language. From them we have borrowed the idea of using patterns instead of variables in abstractions and let-bindings. It gives an elegant way to express mutually recursive definitions. We also share with them the view that a programming language should not only be formally specified, but it should also be possible to reason about the correctness of its implementation. There should be a small step from the formal operational semantics to an interpreter and also between the specification of the type system to a type checker.