Download presentation
Presentation is loading. Please wait.
Published byBarrie Norris Modified over 9 years ago
1
CSE-321 Programming Languages Inductive Definitions POSTECH March 15, 2006 박성우
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 Inductive definitions of judgments 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 Outline Inductive definitions of syntactic categories V Inductive definitions of judgments Derivable rules and admissible rules Inductive proofs
10
10 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." –"succ succ zero belongs to the syntactic category nat." –...
11
11 Inference Rules
12
12 Examples of Inference Rules
13
13 Examples of Axioms
14
14 Remember: Judgments make sense only if there are inference rules for proving or refuting them. Example: –Without arithmetic rules, what is the meaning of: "1 - 1 is equal to 0"?
15
15 Natural Numbers using Judgments Judgment Inference rules
16
16 Metavariables is called a metavariable. –It is just a placeholder for a sequence of zero and succ. –We are not talking about " nat." –We are talking about " succ succ zero nat."
17
17 Derivation Tree
18
18 Even and Odd Numbers
19
19 Regular Binary Trees
20
20 Full Regular Binary Trees
21
21 A Full Regular Binary Tree
22
22 Proof
23
23 Outline Inductive definitions of syntactic categories V Inductive definitions of judgments V Derivable rules and admissible rules Inductive proofs
24
24 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?
25
25 Inference rules A derivation tree May I use the following rule? From a Derivation Tree
26
26 Derivable Rule There is a derivation tree from the premises to the conclusion. May be used as if it were an original inference rule.
27
27 Is this rule derivable? No! –because the premise is always smaller than the conclusion in the inference rules:
28
28 But does this rule make sense? Yes! –because the only way to prove the premise is by first proving the conclusion:
29
29 Admissible Rules There is a proof that the premise implies the conclusion. May be used as if it were an original inference rule if the system does not change.
30
30 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
31
31 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
32
32 Homework 1 Good News –Everyone did a great job! –Solution and statistics will be uploaded today. Bad News –Everyone did such a wonderful job that Assignment 2 will be out tonight. –Assignment 2 will be due next Monday. Good or Bad News –Assignment 2 will be as much fun. –Many problems require a bit/lot of thinking: tail recursion structures and signatures functional objects
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.