Tweak slides.

This commit is contained in:
Justin Hsu 2018-11-21 15:39:18 -06:00
parent f27ef83f20
commit d3bf5b92fa
1 changed files with 10 additions and 10 deletions

View File

@ -46,7 +46,7 @@ date: November 21, 2018
- Model "essence" of real languages - Model "essence" of real languages
## 2. Formalize what programs "do" ## 2. Formalize what programs "do"
- Usually: run it on a machine and find out! - Run it on a machine and find out?
- Not very useful for proofs... - Not very useful for proofs...
- Formalize behavior mathematically, on paper - Formalize behavior mathematically, on paper
- Discard "unimportant" details - Discard "unimportant" details
@ -115,7 +115,7 @@ date: November 21, 2018
# Operational Semantics # Operational Semantics
## Programs execute by "stepping" ## Execute by "stepping"
- Start with program - Start with program
- Imperative: plus variable setting - Imperative: plus variable setting
- In each step, perform update: - In each step, perform update:
@ -137,8 +137,8 @@ date: November 21, 2018
- A type $\tau$ describes a class of programs - A type $\tau$ describes a class of programs
- Usually: well-behaved in some way - Usually: well-behaved in some way
- Can automatically check if program has type $\tau$ - Can automatically check if program has type $\tau$
- Type of program depends on types of its pieces - Type of program depends on types of components
- Scales to large programs - Analysis scales to large programs
## Example ## Example
@ -146,18 +146,18 @@ date: November 21, 2018
- Lightweight - Lightweight
- Checking types is simple, automatic - Checking types is simple, automatic
- Don't need to run program - Don't need to run program
- Intuitive meaning - Natural and intuitive
- Can't add a String to a Boolean - Can't add a String to a Boolean
- Programmers often think in terms of types - Programmers often think in terms of types
- Identify correct programs - Identify correct programs
## Weaknesses ## Weaknesses
- Programmer may need to add some type hints - Programmer may need to add annotations
- Extra annotations in program - Extra hints for compiler
- Common for more complex types - Common for more complex types
- Compiler sometimes rejects correct programs - Compiler sometimes rejects correct programs
- Figuring out why can be very frustrating - Figuring out why can be very frustrating
- May need to write program in more awkward form - May need to write program in less natural form
## Types can be complex ## Types can be complex
- Simpler types - Simpler types
@ -170,9 +170,9 @@ date: November 21, 2018
- ... - ...
## Prove: soundness ## Prove: soundness
- "Soundness theorem"
- Relate type system to operational behavior
- If program has a type, it should be well-behaved - If program has a type, it should be well-behaved
- Relate type system to operational behavior
- "Soundness theorem"
- Many possible notions of "well-behaved" - Many possible notions of "well-behaved"
- Don't add Strings to Bools - Don't add Strings to Bools
- Don't mix public and private data - Don't mix public and private data