CSE-321 Programming Languages Inductive Definitions - PowerPoint PPT Presentation

About This Presentation
Title:

CSE-321 Programming Languages Inductive Definitions

Description:

infinite in number. We need a mechanism by which a finite description of SML produces infinitely ... What is the meaning of '1 - 1 is equal to 0' without ... – PowerPoint PPT presentation

Number of Views:20
Avg rating:3.0/5.0
Slides: 32
Provided by: sungwo8
Category:

less

Transcript and Presenter's Notes

Title: CSE-321 Programming Languages Inductive Definitions


1
CSE-321 Programming LanguagesInductive
Definitions
???
  • POSTECH
  • March 14, 2007

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
Outline
  • Inductive definitions of syntactic categories
  • Judgments and inference rules
  • Derivable rules and admissible rules
  • Inductive proofs

4
Natural Numbers
5
Natural Numbers - Examples
6
Regular Binary Trees
7
Mutual Induction
8
Strings of Parentheses
9
Strings of Matched Parentheses
10
Strings of Matched Parentheses
11
Strings of Parentheses
12
Outline
  • Inductive definitions of syntactic categories
  • Judgments and inference rules
  • Derivable rules and admissible rules
  • Inductive proofs

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
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
Inference Rules
16
Examples of Inference Rules
17
Examples of Axioms
18
Natural Numbers using Judgments
  • Judgment
  • Inference rules

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
Derivation Tree
21
Even and Odd Numbers
22
Regular Binary Trees
23
Full Regular Binary Trees
24
A Full Regular Binary Tree
25
Outline
  • Inductive definitions of syntactic categories
  • Judgments and inference rules
  • Derivable rules and admissible rules
  • Inductive proofs

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
From a Derivation Tree
  • Inference rules
  • A derivation tree
  • May I use the following rule?

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
Is this rule derivable?
  • No!
  • no derivation tree like

30
But does this rule make sense?
  • Yes!

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
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
Derivable Rules vs. Admissible Rules
  • 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?

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.
Write a Comment
User Comments (0)
About PowerShow.com