meeting -*- Outline -*- * product types (4.4) (we skipped this in class, seems pretty clear from the text.) functions with more than one argument can be curried or can take (nested) pairs as arguments ------------------------------------------ ASCII NOTATION ``x'' means product (latex's \times) ------------------------------------------ ------------------------------------------ PAIRS Pair Types: S1 x S2 Associativity and precedence: S1 x S2 x S3 means S1 x (S2 x S3) S1 x S2 -> S3 means (S1 x S2) -> S3 S1 -> S2 x S3 means S1 -> (S2 x S3) Constants: pair: S -> T -> S x T fst: S x T -> S snd: S x T -> T we write pair.t.t' as (t,t') (t1,t2,t3) means (t1,(t2,t3)) Postulates: |- (fst.x, snd.x) == x (pairing) |- fst(x,y) == x (projection 1) |- snd(x,y) == y (projection 2) |- (x,y) == (x',y') (congruence) <==> x == x' /\ y == y' Abbreviation: ^ (\ u:S, v:T . t) == (paired abstraction) (\ w:S x T . t[u,v := fst.w, snd.w]) ------------------------------------------ Q: Do we need to worry about the associativity of product types and pairing? not usually... Q: How would you generalize the alpha, beta, and eta rules to paired abstractions? (see p. 82) Q: How would you simplify (\ x, y . x + y).(3,4) ?