CSE341: Programming Languages��Section 9
Double Dispatch, Visitor Pattern
Autumn 2021
1
Reminders
CSE 341: Programming Languages
2
Dispatch Overview
Dispatch is the runtime procedure for looking up which function to call based on the parameters given:
Emulating Double Dispatch
Double Dispatch Example: RPS
Final Quiz Review
Subtyping
Question 9 from Spring 19 practice final
Mixins
Question 7 from Spring 19 practice final
Soundness and Completeness
Soundness and Completeness
Programs for which there is >= 1 input that makes the program do bad thing X
All possible programs
(in syntax of some language)
Programs for which there is no input that makes the program do bad thing X
Type system accepting these programs is sound but incomplete (common goal)
Soundness and Completeness
Programs for which there is >= 1 input that makes the program do bad thing X
All possible programs
(in syntax of some language)
Programs for which there is no input that makes the program do bad thing X
Type system accepting these programs is unsound and incomplete
Soundness and Completeness
Programs for which there is >= 1 input that makes the program do bad thing X
All possible programs
(in syntax of some language)
Programs for which there is no input that makes the program do bad thing X
Type system accepting these programs is unsound and is complete
Soundness and Completeness
Programs for which there is >= 1 input that makes the program do bad thing X
All possible programs
(in syntax of some language)
Programs for which there is no input that makes the program do bad thing X
Type system accepting these programs is sound and complete (impossible if type-checker always terminates)
Question 6 from Autumn 17 practice final