Lecture Notes

The notes are rather sparse and only include definitions and the like (and maybe some worked, tedious exercises). They are a good summary for later reference but are by no means a substitute for the actual lectures and/or textbook.

  1. Introduction (handout and overhead presentation) and Alphabets, strings, and languages (handout and overhead presentation). Beside an overall introduction to the course these notes cover Chapter 7 of the textbook.

  2. State transition diagrams aka finite automata (handout and overhead presentation). The relevant textbook material is Chapter 8 except Section 8.5 (we will discuss this kind of specification and verification later in a slightly more general context).

  3. Regular languages (handout and overhead presentation), or regular expressions and state transition diagrams put together, plus generat properties of regular languages. The relevant textbook material is you guessed it, Chapter 9.

    As an example of using regular languages in practice the file scanner.l describes a complete lexical analyzer (or scanner) for a Java-like programming language. This is the input of Flex which generates C code that implements one big finite automaton (which in turn implements the actual lexical analysis). You will notice that the regular expressions that define the lexical structure of a programming language are not overly complicated, but on the other hand there are lots of them; the resulting finite automaton (that is used for the actual lexical analysis) is therefore quite large (several tens of states).

  4. Context-free languages (handout and overhead presentation). This section covers Chapter 10 from the textbook.

  5. Parsing (handout and overhead presentation). This section covers Chapter 11 from the textbook plus bottom-up parsing (the latter presented in too simplified a manner to be worth a reference). Here is a realistic sample grammar together with its transformation into a grammar suitable for recursive descent parsing (handout and overhead presentation).

    As an example of practical application of context-free languages, the file parser.y describes a complete parser for a Java-like language. This is the input of Yacc or its successor Bison which generate C/C++ code that implements the actual parsing.

  6. Algorithm specification (handout and overhead presentation), covering Chapter 1 from the textbook. While we will be spending much more time verifying rather than specifying properties, it is still important to be familiar with the various components of a specification and also able to write good specifications.

  7. Algorithm verification (handout and overhead presentation). This section covers Chapters 2 and 4 of the textbook. Further examples are discussed in Chapter 3 (and we will cover some of them in class as well). A summary of the introduction of ranges explained in class is also available (handout and overhead presentation). Finally, here are a couple more examples (handout and overhead presentation).

    Here are the proofs done in class: Lecture 17 (11 March), Lecture 18 (13 March), Lecture 19 (18 March), and Lecture 20 (20 March). To save time I took the liberty to prepare in advance the tedious proof of the in-place exchange of two array indices (handout and overhead presentation).

  8. Introduction to formal methods (handout and overhead presentation). This introduction is based on Schneider’s text (see below) and to some degree on Section 8.5. Note however that reading Schneider (to say nothing about the rest of the references mentioned below!) is definitely overkill for this course.

    Here are some additional readings for the reader interested in formal methods: Comprehensive presentations of CSP include The Theory and Practice of Concurrency by A. W. Roscoe and Concurrent and Real Time Systems: The CSP Approach by S. A. Schneider. A different approach to the same problem is model checking. A good introduction to this matter is Model Checking by E. M. Clarke, O. Grumberg and D. Peled (available in the Bishop’s library). Yet another approach is model-based testing. An introduction to this subject is Model-Based Testing of Reactive Systems (also available in the library).

  9. Introduction to the computability theory (handout and overhead presentation). This section covers Chapter 12 of the textbook.

Lecture Recording

Lectures are recorded as follows:

Note: Lecture 14 was the mid-term examination.