Skip to main content Accessibility help
  • Print publication year: 2009
  • Online publication date: August 2010

12 - Towards a theory of document structure



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.


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)


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.

Related content

Powered by UNSILO
[1],Agda homepage.
[2]A., Asperti, G., Bancerek and A., Trybulec (eds). Mathematical Knowledge Management, Third International Conference, MKM 2004, Bialowieza, Poland, September 19-21, 2004, Proceedings, volume 3119, Lecture Notes in Computer Science. Springer, 2004.
[3]R., Bornat and B., Sufrin. Animating formal proof at the surface: The Jape proof calculator. Computer Journal, 42(3):177–192, 1999.
[4]P., Borras, D., Clement, Th., Despeyrouz, J., Incerpi, G., Kahn, B., Lang, and V., Pascual. CENTAUR: The system. In Proceedings of the ACM SIGSOFT/SIGPLAN Software Engineering Symposium on Practical Software Development Environments (PSDE), volume 24, pp. 14–24, New York, NY, 1989. ACM Press.
[5],Coq homepage., 1999.
[6]H. B., Curry. Some logical aspects of grammatical structure. In R. O., Jakobson (ed.) Structure of Language in its Mathematical Aspects. Proceedings of the 12th Symposium in Applied Mathematics, pp. 56–68, 1961.
[7]V., Donzeau-Gouge, G., Huet, G., Kahn and B., Lang. Programming environments based on structured editors: The MENTOR experience, 1984.
[8],Eclipse homepage.
[9]T., Hallgren. Alfa homepage.∼hallgren/Alfa/, 1996–2000.
[10]J., Harrison. The HOL light theorem prover.∼jrh13/hol–light/, 2006.
[11]G., Huet and G., Plotkin (eds) Logical Frameworks: First International Workshop on Logical Frameworks, Antibes, May, 1990. Cambridge University Press, 1991.
[12]G., Huet and G., Plotkin (eds) Logical Environments: Second International Workshop on Logical Frameworks, Edinburgh, May, 1991. Cambridge University Press, 1993.
[13],Isabelle Homepage., 2003.
[14]D. E., Knuth. Literate Programming. CSLI, 1992.
[15]L., Magnusson and B., Nordström. The ALF proof editor and its proof engine. In Types for Proofs and Programs, volume 806, Lecture Notes in Computer Science, pp. 213–237, Nijmegen, 1994. Springer-Verlag.
[16]P., Martin-Löf. Intuitionistic Type Theory. Bibliopolis, Napoli, 1984.
[17]B., Nordström, K., Petersson and J. M., Smith. Martin-Löf's Type Theory, chapter 1, pp. 1–33. Oxford University Press, 2001.
[18]L., Padovani and R., Solmi. An investigation on the dynamics of direct-manipulation editors for mathematics. In Asperti et al. [2], pp. 302–316.
[19]R., Pollack. The LEGO proof assistant., 1997.
[20]A., Ranta. Grammatical Framework Homepage.∼aarne/GF/, 1999–2005.
[21]A., Ranta. Grammatical Framework: A Type-Theoretical Grammar Formalism. Journal of Functional Programming, 14(2):145–189, 2004.
[22],The Types Project Homepage.
[23]L., Théry, Y., Bertot and G., Kahn. Real theorem provers deserve real user-interfaces. In Proceedings of the Fifth ACM SIGSOFT Symposium on Software Development Environments, pp. 120–129, 1992.