introduction to semantics
play

Introduction to Semantics Dr. Mattox Beckman University of Illinois - PowerPoint PPT Presentation

Objectives Judgments Proof Trees References Introduction to Semantics Dr. Mattox Beckman University of Illinois at Urbana-Champaign Department of Computer Science Objectives Judgments Proof Trees References Objectives Defjne judgment


  1. Objectives Judgments Proof Trees References Introduction to Semantics Dr. Mattox Beckman University of Illinois at Urbana-Champaign Department of Computer Science

  2. Objectives Judgments Proof Trees References Objectives ◮ Defjne judgment and explain its purpose in programming languages. ◮ Use proof rules to defjne judgments inductively. ◮ Use proof trees to prove properties about complex syntactic objects. This presentation draws from Robert Harper’s fjrst chapters in [Har12].

  3. 3 is odd Bool Objectives Judgments Proof Trees References Judgments ◮ A judgment is an assertion about a syntactic object. ◮ Examples:

  4. Bool Objectives Judgments Proof Trees References Judgments ◮ A judgment is an assertion about a syntactic object. ◮ Examples: ◮ 3 is odd

  5. Bool Objectives Judgments Proof Trees References Judgments ◮ A judgment is an assertion about a syntactic object. ◮ Examples: ◮ 3 is odd ◮ 2 + 3 ⇓ 5

  6. Objectives Judgments Proof Trees References Judgments ◮ A judgment is an assertion about a syntactic object. ◮ Examples: ◮ 3 is odd ◮ 2 + 3 ⇓ 5 ◮ ⊢ 2 . 4 > 3 . 5 : Bool

  7. The J J n are called assumptions or premises . J is called a conclusion . Objectives Judgments Proof Trees References The Parts of a Rule ◮ We can also defjne judgments inductively. ◮ Let J , J 1 , J 2 , . . . J n be a set of judgments. ◮ Then we can have a rule as follows: J 1 J 2 J n Label · · · J

  8. Objectives Judgments Proof Trees References The Parts of a Rule ◮ We can also defjne judgments inductively. ◮ Let J , J 1 , J 2 , . . . J n be a set of judgments. ◮ Then we can have a rule as follows: J 1 J 2 J n Label · · · J ◮ The J 1 . . . J n are called assumptions or premises . ◮ J is called a conclusion .

  9. Objectives Judgments Proof Trees References Axioms ◮ It’s possible for there to be no assumptions! ◮ Such a rule is called an axiom . Label J

  10. Objectives Judgments Proof Trees References Side Conditions ◮ If a premise is not a judgment, we sometimes write it as a side condition . Mod0 , x mod 2 = 0 x is even

  11. Objectives Judgments Proof Trees References Example: Even and Odd Numbers with Addition Mod0 , x mod 2 = 0 Mod1 , x mod 2 = 1 x is even x is odd x is even y is even Even+Even x is odd y is odd Odd+Odd x + y is even x + y is even x is even y is odd Even+Odd x is odd y is even Odd+Even x + y is odd x + y is odd

  12. Objectives Judgments Proof Trees References Example: Even and Odd Numbers with Multiplication x is even y is even Even × Even x is odd y is odd Odd × Odd x × y is even x × y is odd x is even y is odd Even × Odd x is odd y is even Odd × Even x × y is even x × y is even

  13. Objectives Judgments Proof Trees References Building Proof Trees ◮ We can use these rules to prove judgments about objects inductively. Mod0 , 4 mod 2 = 0 Mod1 , 7 mod 2 = 1 4 is even 7 is odd Even+Odd 4 + 7 is odd ◮ There are two ways you can use proof trees. ◮ Prove a property you already know. ◮ Infer a property you don’t already know.

  14. Decide which rule applies. Recursively prove fjrst subexpression. Recursively prove second subexpression. Objectives Judgments Proof Trees References Using Proof Trees to Prove How to use it: ◮ Start with the judgment you want to prove. 4 + 7 is odd

  15. Recursively prove fjrst subexpression. Recursively prove second subexpression. Objectives Judgments Proof Trees References Using Proof Trees to Prove How to use it: ◮ Start with the judgment you want to prove. ◮ Decide which rule applies. Even+Odd 4 + 7 is odd

  16. Recursively prove second subexpression. Objectives Judgments Proof Trees References Using Proof Trees to Prove How to use it: ◮ Start with the judgment you want to prove. ◮ Decide which rule applies. ◮ Recursively prove fjrst subexpression. Mod0 , 4 mod 2 = 0 4 is even Even+Odd 4 + 7 is odd

  17. Objectives Judgments Proof Trees References Using Proof Trees to Prove How to use it: ◮ Start with the judgment you want to prove. ◮ Decide which rule applies. ◮ Recursively prove fjrst subexpression. ◮ Recursively prove second subexpression. Mod0 , 4 mod 2 = 0 Mod1 , 7 mod 2 = 1 4 is even 7 is odd Even+Odd 4 + 7 is odd

  18. Objectives Judgments Proof Trees References References [Har12] Robert Harper. Practical Foundations for Programming Languages . 2012, p. 496. DOI: 10.1017/CBO9781139342131 .

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend