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: Mo 8:30 - 10:00, HS 3 und Mi 12:15 - 13:45, MW 0350
Beginn: Die Vorlesung beginnt am Montag, den 11. April.
Zentralübung: Fr  14:00 - 15:30, HS 3 (MI 00.06.011), erstmals am 15. April.
Ü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.
  1. Introduction
  2. The syntax of WHILE. Concrete vs abstract syntax. Evaluation of arithmetic and boolean expressions.(Isabelle [pdf][ps.gz])
  3. Operational Semantics

    1. Big-step semantics

    2. 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])
    3. Rule induction

    4. 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])
    5. Small-step semantics

    6. The rules [pdf][ps.gz]. Derivation sequences. Theorem: Agreement of big-step and small-step semantics.(Isabelle[pdf][ps.gz])
    7. Extensions of WHILE
      1. Nondeterminism. Big-step semantics hides nontermination. Small-step semantics more appropriate.
      2. Parallelism. Big-step semantics not possible. Interleaving small-step semantics.
    8. Application: a compiler for WHILE

    9. 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])
  4. Semantics of Inductive Definitions


  5. A set theoretic treatment of rules. Definition: The set IR defined by a set of rules R is the least R-closed set.
    1. The derivation of rule induction.
    2. 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.
    3. The Knaster-Tarski Fixed Point Theorem
  6. Jinja - A Java-like Programming Language


  7. 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.
    1. Formal preliminaries
    2. Syntax
    3. Big step semantics
    4. Small step semantics
    5. Exceptions
    6. Equivalence of big and small step semantics
    7. Type system
    8. Well-formedness
    9. Type safety Well-typed programs do not go wrong.
  8. Hoare Logic

    1. From Floyd to Hoare. Partial and total correctness. The rules of Hoare logic.
    2. Syntax of assertions: first-order arithmetic.
    3. Semantics of assertions and Hoare triples: validity w.r.t. a state and an interpretation of the logical variables.
    4. Soundness of Hoare logic: proof by rule induction.
    5. 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.
    6. Verification conditions. Extraction of (weakest) preconditions and verification conditions in the presence of loop invariants. Proof of soundness and completeness of this approach.
    7. Total correctness.
    8. Extensions of WHILE
      1. Nondeterminism
      2. Arrays
      3. Procedures: The problem. An adaption rule. A complete system based on a generalized consequence rule. Completeness proof.
  9. C+ - Multiple Inheritance in C++

Disclaimer: The concentration 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