Download presentation
Presentation is loading. Please wait.
Published byPatricia Hunt Modified over 8 years ago
1
CSE-321 Programming Languages Inductive Definitions POSTECH March 14, 2007 박성우
2
2 Why Inductive Definitions? Definition of SML –finite in size SML programs –infinite in number We need a mechanism by which a finite description of SML produces infinitely many SML programs. –We need inductive definitions.
3
3 Outline Inductive definitions of syntactic categories Judgments and inference rules Derivable rules and admissible rules Inductive proofs
4
4 Natural Numbers
5
5 Natural Numbers - Examples
6
6 Regular Binary Trees
7
7 Mutual Induction
8
8 Strings of Parentheses
9
9 Strings of Matched Parentheses
10
10 Strings of Matched Parentheses
11
11 Strings of Parentheses
12
12 Outline Inductive definitions of syntactic categories Judgments and inference rules Derivable rules and admissible rules Inductive proofs
13
13 Judgments An object of knowledge that may or may not be provable. Examples –"1 - 1 is equal to 0." –"1 + 1 is equal to 0." –"It is raining." –"S S O belongs to the syntactic category nat." –...
14
14 Question "1 - 1 is equal to 0" is a judgment. What is the meaning of "1 - 1 is equal to 0" without arithmetic rules? Judgments make sense only if there are inference rules for proving or refuting them.
15
15 Inference Rules
16
16 Examples of Inference Rules
17
17 Examples of Axioms
18
18 Natural Numbers using Judgments Judgment Inference rules
19
19 Metavariables is called a metavariable. –It is just a placeholder for a sequence of O and S. –We are not talking about " nat." –We are talking about "S S O nat."
20
20 Derivation Tree
21
21 Even and Odd Numbers
22
22 Regular Binary Trees
23
23 Full Regular Binary Trees
24
24 A Full Regular Binary Tree
25
25 Outline Inductive definitions of syntactic categories Judgments and inference rules Derivable rules and admissible rules Inductive proofs
26
26 Question We know arithmetic rules. But do we use arithmetic rules to calculate 4 * 9? –Why not just use 4 * 9 = 36 from the multiplication table?
27
27 Inference rules A derivation tree May I use the following rule? From a Derivation Tree
28
28 Derivable Rule There is a derivation tree from the premises to the conclusion. May be used as if it was an original inference rule.
29
29 Is this rule derivable? No! –no derivation tree like
30
30 But does this rule make sense? Yes!
31
31 Admissible Rules There is a proof that the premise implies the conclusion. May be used as if it was an original inference rule if the system does not change.
32
32 Derivable Rules vs. Admissible Rules Which is stronger? –A derivable rule is an admissible rule? Yes No –An admissible rule is a derivable rule? Yes No
33
33 A derivable rule remains valid no matter what. An admissible rule may be invalidated when a new inference rule is introduced. Now is the rule below still admissible? Derivable Rules vs. Admissible Rules
34
34 Announcement Assignment 2 is out. –Due at 1am, March 21 (next Wednesday) –tail-recursive functions, structures,... Course notes –Sections 2.1 - 2.3 cover today's lecture. –Sections 2.4 and 2.5 might be expanded a bit this weekend.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.