(read bottom up)
(some big ideas that are still to come: free algebras, higher-order functions, type inference, polymorphism, co-induction, bisimulation, non-deterministic computation, shared memory, message-passing, synchronous vs asynchronous, ...)
We will see many instances of this. For now, read again the lecture on synatx and semantics.
... comes Wednesday ...
We have seen an example of a recursive program that is a proof by induction in the lecture on Idris.
We discussed in some detail that the set of natural numbers, the transitive closure of a relation, the set of programming languages given by a context-free grammar and the set of true equations derivable from given axioms are all examples of inductively defined sets.
- The task to show that a given element
e
is in a given inductively defined setS
amounts to finding a derivation that constructs the elemente
from the rules definingS
. - From this point of view, parsing and theorem proving is essentially the same activity.
-
Computing with equations is circular, because equations are symmetric, that is, can be applied from left to right and from right to left. For example, 1/2=2/4=1/2=2/4=...
-
Therefore it is good to have conditions under which any computation results in a unique result. (Local) confluence and termination are often not too hard to establish, see the lectures on abstract reduction systems.
- Of course, we do not want to manipulate infinite sets of terms such as 1/2, 2/4, 3/6, ... directly. Therefore we set up rewrite rules that allow us to compute with normal forms such as 1/2 instead.
- ...
- The meaning of a fraction such as 3/6 is the set of all fractions that are equivalent such as 1/2, 2/4, 3/6, ...
- The meaning of arithmetic expressions has been discussed in detail in the second lecture on syntax and semantics.
- I could explain the semantics (meaning) of German to you by translating German to English. This translation is a function that preserves the structure of the languages, for example, by mapping nouns to nouns and verbs to verbs, etc.
- The meaning of arithmetic expressions has been discussed in detail in the lecture on syntax and semantics.
- MWE: Cancelling fractions rewrites them to normal form.
- Arithemtic expressions have been discussed in detail in Lecture 1.2 and following.
- Programming languages will be discussed later.