Bereich: |
Info III,
Wahlpflichtvorlesung: 4 Std.
(+2Ü), oder Info I, vertiefend zu Übersetzerbau (4 Std.) |
DHP: |
Der Übungsschein
kann als Praktikumsschein
im Bereich Theoretische Informatik in die DHP eingebracht werden.
(Prüfungsordnung) |
Zeit und Ort: |
Montag 8:30 - 10:00 MI HS 2, Mittwoch 12:15 - 13:45 MW 0350
|
Beginn: |
Montag, 24. April
|
Zentralübung: |
Dienstag 16:15 - 17:45 MI 00.07.011.
|
Übungsleitung: |
Clemens
Ballarin |
Hörerkreis: |
Studenten/-innen der
Informatik und Mathematik |
Voraussetzungen: |
Vordiplom |
Hinweis: |
Die Vorlesung wird auf
Englisch gehalten. |
Empfehlenswert für:
Für eine spätere theoretische Beschäftigung mit
Programmiersprachen
ist diese Vorlesung unabdingbar. Es bestehen ausserdem starke
Querbezüge
zu den Gebieten Logik, Programmverifikation und Lambda-Kalkül.
Lernziele:
-
Das Verstehen der grundlegenden mathematischen Technik der operationalen
Semantik um eine Programmiersprache präzise zu definieren.
-
Das Anwenden dieser Techniken auf Probleme wie Äquivalenz
verschiedener
Sprachbeschreibungen, Korrektheit von Übersetzern, Sicherheit von
Typsystemen, Korrektheit von Programmanalysen etc.
Contents:
Starting with a simple programming language with only while-loops,
we progress to a small but realistic object-oriented language, its
virtual
machine, and a simple compiler.
-
Introduction
The syntax of WHILE. Concrete vs abstract syntax. Evaluation of
arithmetic
and boolean expressions.(Isabelle [pdf][ps.gz])
-
Operational Semantics
-
Big-step semantics
The rules. Derivation trees. Lemma while b do s is equivalent
to if b do s;while b do s else skip.(Isabelle[pdf][ps.gz])
- Rule induction
Inductively defined sets and the principle of rule induction. Examples:
natural numbers and transitive reflexive closure, together with proofs
of various closure properties. Rule induction for big-step semantics of
WHILE. Theorem: WHILE is deterministic (Isabelle[pdf][ps.gz])
- Small-step semantics
The rules [pdf][ps.gz].
Derivation sequences. Theorem: Agreement of big-step and small-step
semantics.(Isabelle[pdf][ps.gz])
- Extensions of WHILE
-
Nondeterminism. Big-step semantics hides nontermination. Small-step
semantics
more appropriate.
-
Parallelism. Big-step semantics not possible. Interleaving small-step
semantics.
-
Procedures. Static and dynamic scope for variables and procedures. Big-step
semantics for a) dynamic scope for variables and procedures, b) dynamic
scope for variables and static scope for procedures, c) static scope of
variable and procedures. (See Nielson & Nielson)
-
Application: a compiler for WHILE
A 3-instruction machine. Its operational single-step semantics. The
compiler. Detailed proof of the equivalence of running the source
program
and running the compiled program.(Isabelle [pdf][ps.gz])
-
Semantics of Inductive Definitions
A set theoretic treatment of rules. Definition: The set IR
defined by a set of rules R is the least R-closed set.
-
The derivation of rule induction.
-
Theorem: IR is the least fixpoint of the consequence
operator induced by R. If R is finitary, IR
is the union of all finite iterations of R starting from the
empty
set.
-
Jinja - A Java-like Programming Language
Roughly speaking, Jinja is a subset of Java that demonstrates the key
features of object-oriented programming: objects, classes, inheritance,
method overriding, and dynamic method dispatch. Slides
-
Hoare Logic
-
From Floyd to Hoare. Partial and total correctness. The rules of Hoare
logic.
-
Syntax of assertions: first-order arithmetic.
-
Semantics of assertions and Hoare triples: validity w.r.t. a state and
an interpretation of the logical variables.
-
Soundness of Hoare logic: proof by rule induction.
-
Completeness of Hoare logic: impossible for effective proof systems.
Relative
completeness: use semantics (|=) rather than proof system (|-) of the
assertion
language. Prove relative completeness via weakest liberal precondition
and expressiveness, i.e. the ability to express the wlp in the
assertion
language.
-
Verification conditions. Extraction of (weakest) preconditions and
verification
conditions in the presence of loop invariants. Proof of soundness and
completeness
of this approach.
-
Total correctness.
-
Extensions of WHILE
-
Nondeterminism
-
Arrays
-
Procedures: The problem. An adaption rule. A complete system based on a
generalized consequence rule. Completeness proof.
-
CoreC++ - Multiple Inheritance in C++
Disclaimer: The focus on Java does not mean
that we consider
Java the best programming language in the world.
Übungsschein:
Einen Schein erhält, wer mindestens 40% der Punkte aus den
Hausaufgaben
und Programmieraufgaben erreicht und erfolgreich an der
Semestralprüfung
teilnimmt.
Literatur:
Die Vorlesung orientiert sich zu Beginn stark an den ersten beiden
der folgenden Bücher:
Literatur zu
Jinja |