1. Introduction
- PL a tool (hammer vs screwdriver)
- "when you have a hammer"

NB: Parser = lex + syntax; Semantic analysis and code generator may modify or optimize intermediate form ... Examples: C++, Eiffel, Pascal, Perl, Smalltalk

3. Functional Programming

With Haskell, fib 10 is evaluated in 218 reductions, as opposed to 49 for fib 10. 

Tail recursive fibonacci
trFib i (fib (j+1)) (fib j) == fib (i+j)
	fib'' (n+1)			= trFib n 1 1
	trFib 0 _ j			= j
	trFib (n+1) k j		= trFib n (k+j) k


5. Hufmann encoding

- The mac version of Hugs does not support tracing :-(

8. Semantics
 NB: syntax definitions are tuned in this way to produce fast parsers. Typically a language will be prototyped before pragmatics are considered.

----------------------------------------------------------------------


Be sure to point out:
    f x y = e
is the same as
    f x = \y -> e
useful to understand HO fns and currying
explain map and plus


Should this be refactored?
(lines subset ... not of findBad could be used in Closure(A->B, FDS)?

findBad(A->B, [FD|FDS], AllFDS, RS) :-
    FD = A->B0,
    subset(A,RS), % A->B holds on RS
    diff(B0,A,B1), % A^B should be empty
    inter(B1,RS,B), % A->B holds on RS
    not(subset(B,A)),
    % writeln([A->B, ' is not trivial']),
    not(iskey(A, RS, AllFDS)).
    % writeln([A, ' not a key for ', RS]).
findBad(FD, [OK|FDS], AllFDS, RS) :-
    findBad(FD, FDS, AllFDS, RS).
