On the semantics of exceptions for high level and low level languages
On the semantics of exceptions for high level and low level languages
diploma thesis (DEFENDED)
View/ Open
Permanent link
http://hdl.handle.net/20.500.11956/40801Identifiers
Study Information System: 120878
CU Caralogue: 990014983630106986
Collections
- Kvalifikační práce [11981]
Author
Advisor
Referee
Kučera, Petr
Faculty / Institute
Faculty of Mathematics and Physics
Discipline
Theoretical Computer Science
Department
Department of Theoretical Computer Science and Mathematical Logic
Date of defense
3. 9. 2012
Publisher
Univerzita Karlova, Matematicko-fyzikální fakultaLanguage
English
Grade
Excellent
Keywords (Czech)
závisle typované programování, výjimky, certifikovaný kompilátor, korektnostKeywords (English)
dependently-typed programming, exceptions, certified compiler, correctnessV práci se zabýváme korektností kompilátoru jazyka s výjimkami. Předkládáme formální sémantiku; jak denotační sémantiku vysokoúrovňového jazyka, tak operační sémantiku jazyka instrukcí pro zásobníkový stroj. Studujeme metodu odvíjení zásobníku a poté, iterativně ve více krocích, předkládáme modifikovanou metodu. Tato je strukturálně rekurzivní a tudíž vhodná pro implementaci v totálních závisle typovaných jazycích. Nakonec předkládáme implementaci kompilátoru v závisle typovaném jazyce Agda, spolu se strojově ověřitelným důkazem, že předložená implementace kompilátoru při překladu zachovává sémantiku programu.
The thesis deals with correctness of a compiler of a simple language featuring exceptions. We present formal semantics, both denotational semantics of a~high-level language and operational semantics of a low-level language for a~simple stack machine. We study the method of stack unwinding and then iteratively, improving upon a naive solution, we present a different method that is structurally recursive and thus suitable for implementation in total dependently typed languages. Finally, we provide an implementation of the compiler in the dependently typed functional programming language Agda, along with a mechanically verifiable proof of adherence of the implementation to the semantics.
