Polymorphism Dynamic Typing Favonia | Nick Benton | Bob Harper 1
Polymorphism T C E R R O C Dynamic Typing Favonia | Nick Benton | Bob Harper 1
Is this the shortest PLunch? Bob and I wanted to make homework 2
Is this the shortest PLunch? Bob and I wanted to make homework and so we had a JFP Theoretical Pearl. 2
System F to PCF source type var. “top” type TARGET 3
System F to PCF source type var. “top” type TARGET 3
System F to PCF source type var. But keep other types! “top” type TARGET 3
System F to PCF System F source 4
System F to PCF System F source PCF with dyn TARGET 4
System F to PCF System F source PCF with dyn TARGET 4
System F to PCF Keep everything except variables 5
System F to PCF Keep everything except variables 5
Type Application type app 6
Type Application type app 6
Type Application type app ? 6
Type Application type app ? 6
Type Application type app ? 7
Type Application type app ? 7
Embed and Project 8
Type Application type app 9
Type Application type app Idea: lift the projection to handle arbitrary type operators. 9
Type Application type app Idea: lift the projection to handle arbitrary type operators. 9
Type Application type app Idea: lift the projection to handle arbitrary type operators. 9 *Mayer-Wand style
Embed and Project 2.0 Find all the t! 10
Embed and Project 2.0 11
Problem Statement 12
Problem Statement (Intended) homework assignment: no run-time errors 12
Problem Statement (Intended) homework assignment: no run-time errors Igarashi, Pierce and Wadler [2001] showed correctness in a minimal core calculus for Java with generics, relying on the class table. 12
Problem Statement (Intended) homework assignment: no run-time errors Igarashi, Pierce and Wadler [2001] showed correctness in a minimal core calculus for Java with generics, relying on the class table. Our di ffi culty: composition of types 12
System F relations for type variables types that respect obs. equiv. System F PCF terms terms 13
System F relations for type variables types that respect obs. equiv. System F PCF terms terms no J here! 13
Logical Relation Recipe weakening and exchange STEP 1 the relation itself respects obs. equiv. STEP 2 (and the properties you care) composition of types/relations STEP 3 fundamental lemma! STEP 4 14
Logical Relation Recipe weakening and exchange STEP 1 the relation itself respects obs. equiv. STEP 2 (and the properties you care) ? composition of types/relations STEP 3 fundamental lemma! STEP 4 14
Compositionality 15
Compositionality 15
Compositionality not so clear if it's “i ff .” 15
FAILED ATTEMPT Compositionality implies(?) 16
FAILED ATTEMPT Compositionality implies(?) Assume We want 16
FAILED ATTEMPT Compositionality implies(?) Assume We want We have 16
FAILED ATTEMPT Compositionality implies(?) Assume We want We have 16
FAILED ATTEMPT Compositionality implies(?) Assume We want We have 16
Logical Relation Recipe weakening and exchange STEP 1 the relation itself respects obs. equiv. STEP 2 (and the properties you care) quasi-composition of types/relations STEP 3 fundamental lemma! STEP 4 Thus, compiled programs give the same numbers! (no run-time errors) 17
Concluding Notes 18
Concluding Notes A nice trick to deal with embedding/projection! 18
Concluding Notes A nice trick to deal with embedding/projection! We used re fi nements to make but rejected by POPL. :-( 18
Concluding Notes A nice trick to deal with embedding/projection! We used re fi nements to make but rejected by POPL. :-( We have 3 di ff erent proofs with di ff erent setups. 18
Concluding Notes A nice trick to deal with embedding/projection! We used re fi nements to make but rejected by POPL. :-( We have 3 di ff erent proofs with di ff erent setups. Thunks to preserve values: 18
Concluding Notes A nice trick to deal with embedding/projection! We used re fi nements to make but rejected by POPL. :-( We have 3 di ff erent proofs with di ff erent setups. Thunks to preserve values: You can fi nd open problems by TAing! 18
Recommend
More recommend