Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Upcoming SlideShare
×

# TaPL名古屋 Chap2

1,360 views

Published on

http://bit.ly/wkAn4l で使った資料

Published in: Education, Technology
• Full Name
Comment goes here.

Are you sure you want to Yes No
Your message goes here
• Be the first to comment

### TaPL名古屋 Chap2

1. 1. TaPL #2 2012 2 18() TaPL #2 2012 2 18 1 / 34
2. 2. .. . Mathematical Preliminaries 1 Sets, Relations, and Functions Orderd Sets Sequences Induction () TaPL #2 2012 2 18 2 / 34
3. 3. () TaPL #2 2012 2 18 3 / 34
4. 4. () TaPL #2 2012 2 18 4 / 34
5. 5. () TaPL #2 2012 2 18 5 / 34
6. 6. () TaPL #2 2012 2 18 6 / 34
7. 7. 2.1.1 Notation of Sets.{. . . } .... . ..{ x ∈ S | ... } .... . ..φ .... . ..ST { x | x∈S∧x ∈T } .... . ..|S| S .... . ..P(S) S powerset S .... . . ex. S = {1, 2}, P(S) = {φ, {1}, {2}, {1, 2}} () TaPL #2 2012 2 18 7 / 34
8. 8. 2.1.2 Natural Number . ..natural number . N : {0, 1, 2, 3, . . . } .. . . . . ..countable . N 1 1 countable .. . . . N ex. etc. () TaPL #2 2012 2 18 8 / 34
9. 9. 2.1.3 n-Place Relation . n-place relation ... S1 , . . . , Sn R S1 × · · · × Sn n-place relation .. . . . ex. S1 = {1, 3}, S2 = {2, 4}, R = {(1, 2), (1, 4), (3, 4)} R < = (1, 2) R () TaPL #2 2012 2 18 9 / 34
10. 10. 2.1.4 Predicate . ..Predicate . .. S one-place relation P S predicate . . . s∈S s∈P P s λs.P (s) S () TaPL #2 2012 2 18 10 / 34
11. 11. 2.1.5 Binary Relation . Binary relation ... binary relation .. two-place relation . . . (s, t) ∈ R sRt U U binary relation U binary relation R () TaPL #2 2012 2 18 11 / 34
12. 12. 2.1.6 more notation 9 3 ex. Γ s:T Γ, s, T typing relation () TaPL #2 2012 2 18 12 / 34
13. 13. 2.1.7 Domain, Range S T R . ..domain . dom(R) = { s ∈ S | (s, t) ∈ R } .. . . . .range (codomain) ... range(R) = { t ∈ T | (s, t) ∈ R } .. . . . () TaPL #2 2012 2 18 13 / 34
14. 14. 2.1.8 Partial Function, TotalFunction . partial function ... s ∈ S, t1 ∈ T, t2 ∈ T, (s, t1 ) ∈ R, (s, t2 ) ∈ R t1 = t2 R S T partial function .. . . . . ..total function . partial function dom(R) = S R S .. T total function function . . . () TaPL #2 2012 2 18 14 / 34
15. 15. 2.1.9 Deﬁned, Undeﬁned . ..deﬁned . S T partial function R s∈S s∈R R s deﬁned deﬁned undeﬁnedf (χ) ↑ f (χ) =↑ f χ undeﬁned.. (χ) ↓f. deﬁned . . ( ) exception from S to T ∪ {f ail} () TaPL #2 2012 2 18 15 / 34
16. 16. 2.1.10 Preserved . preserved ... binary relation R S predicate P sRs P (s) P (s ) P R .. preserved . . . () TaPL #2 2012 2 18 16 / 34
17. 17. 2.2.1 Property of Binary Relation S binary relation R . ..reﬂexive . ∀s∈S . sRs .. . . . . symmetric ... ∀ s, t ∈ S . s R t → t R s .. . . . . ..transitive . ∀ .. s, t, u ∈ S . s R t ∧ t R u → s R u . . . . antisymmetric ... ∀ s, t ∈ S . s R t ∧ t R s → s = t .. . . . () TaPL #2 2012 2 18 17 / 34
18. 18. 2.2.2 Preorder, Partial Order, TotalOrder . preorder ... preorder R reﬂexive transitive preorder R ≤ preorderd set S S preorder R .. . . . < s≤t∧s=t () TaPL #2 2012 2 18 18 / 34
19. 19. 2.2.2 Preorder, Partial Order, TotalOrder . partial order ... partial order .. preorder antisymmetric . . . . ..total order . total order .. partial order ∀ s, t ∈ S . s ≤ t ∨ t ≤ s . . . () TaPL #2 2012 2 18 19 / 34
20. 20. 2.2.3 Join, Meet ≤ S partial order s∈S t∈S . join least upper bound ... j∈S s t join ... 1 s≤j∧t≤j .. .. 2. ∀ k ∈S . s≤k∧t≤k∧j ≤k . . . . meet greatest lower bound ... m∈S s t meet ... 1 m≤s∧m≤t .. ... . 2 ∀ n∈S . n≤s∧n≤t∧n≤m . . () TaPL #2 2012 2 18 20 / 34
21. 21. 2.2.4 Equivalence . equivalence ... S R equivalence R reﬂexive transitive symmetric .. . . . () TaPL #2 2012 2 18 21 / 34
22. 22. 2.2.5 . ..reﬂexive closure . R .. reﬂexive R . . . . ..transitive closure . R .. transitive R R+ . . . . ..reﬂexive and transitive closure . R .. reﬂexive transitive R∗ . . . R∈R R ∀ Ri ∈ R . R ⊆ Ri () TaPL #2 2012 2 18 22 / 34
23. 23. 2.2.6 Exercise 2.2.6 S R R R = R ∪ { (s, s) | s ∈ S }R R reﬂexive closure () TaPL #2 2012 2 18 23 / 34
24. 24. 2.2.7 Exercise 2.2.7 -moreconstructive deﬁnition of transitiveclosure-RiR0 = RRi+1 = Ri ∪ { (s, u) | ∃t ∈ R.(s, t) ∈ Ri ∧ (t, u) ∈ Ri } R+ = Ri i () TaPL #2 2012 2 18 24 / 34
25. 25. 2.2.8 Exercise 2.2.8S binary relation R R preserved S predicate P P R∗ preserved () TaPL #2 2012 2 18 25 / 34
26. 26. 2.2.9 Decreasing Chain.S preorder ≤ .si ∈ S ∀ i ∈ N . si+1 < sis1 , s2 , s3 , . . ... ≤ decreasing chain. . . ex. ”5, 4, 3, 2, 1” () TaPL #2 2012 2 18 26 / 34
27. 27. 2.2.10 Well Founded.S preorder ≤ .leq decresing chain ≤ wellfounded... . . ex.N < well founded (0 < 1 < 2 < . . . ) ex.R not well founded (· · · < −1 < 0 < 1 < . . . ) () TaPL #2 2012 2 18 27 / 34
28. 28. 2.3.1 Sequences.sequence “,” . “,” Cons Append... . ..1..n 1 n sequence .... . ..|a| sequence a .... . ..• sequence .... . . () TaPL #2 2012 2 18 28 / 34
29. 29. 2.4.1 AXIOM: Ordinary Inductionon N P (0) ∀i ∈ N. P (i) → P (i + 1) ∀n ∈ N. P (n) () TaPL #2 2012 2 18 29 / 34
30. 30. 2.4.2 AXIOM: Complete Inductionon N (∀i ∈ N, i < n. P (i)) → P (n) ∀n ∈ N. P (n) () TaPL #2 2012 2 18 30 / 34
31. 31. 2.4.3 Lexicographic Order(Dictionary Order)(m, n) ≤ (m , n ) ⇔ m < m or (m = m and n ≤ n ) () TaPL #2 2012 2 18 31 / 34
32. 32. 2.4.4 AXIOM: LexicographicInduction (∀m , n ∈ N, (m , n ) < (m, n). P (m , n )) → P (m, n) ∀m, n ∈ N. P (m, n) () TaPL #2 2012 2 18 32 / 34
33. 33. 2.4.4 Lexicographic Induction Lexicographic Induction nested induction ”by an inner induction” 3 4 3 4 Chapter3 Theorem 3.3.4 structural induction term Chapter 21 1 () TaPL #2 2012 2 18 33 / 34
34. 34. () TaPL #2 2012 2 18 34 / 34