Well-Typed Programs Can't Be Blamed

We introduce the blame calculus , which adds the notion of blame from Findler and Felleisen's contracts to a system similar to Siek and Taha's gradual types and Flanagan's hybrid types . We characterise where positive and negative blame can arise by decomposing the usual notion of subtype into positive and negative subtypes, and show that these recombine to yield naive subtypes. Naive subtypes previously appeared in type systems that are unsound, but we believe this is the first time naive subtypes play a role in establishing type soundness.

[1]  Jeremy G. Siek Gradual Typing for Functional Languages , 2006 .

[2]  Frank Pfenning,et al.  Refinement types for ML , 1991, PLDI '91.

[3]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[4]  David Walker,et al.  Dynamic Typing with Dependent Types , 2004, IFIP TCS.

[5]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[6]  Cormac Flanagan,et al.  Unifying Hybrid Types and Contracts , 2007, Trends in Functional Programming.

[7]  Frank Pfenning,et al.  Dependent types in practical programming , 1999, POPL '99.

[8]  Robert Bruce Findler,et al.  Operational semantics for multi-language programs , 2009 .

[9]  Walid Taha,et al.  Exploring the Design Space of Higher-Order Casts , 2009, ESOP.

[10]  Fritz Henglein,et al.  Dynamic Typing: Syntax and Proof Theory , 1994, Sci. Comput. Program..

[11]  Matthias Felleisen,et al.  Modular set-based analysis from contracts , 2006, POPL '06.

[12]  Matthias Felleisen,et al.  Contracts for higher-order functions , 2002, ICFP '02.

[13]  Robert Bruce Findler,et al.  Operational semantics for multi-language programs , 2007, POPL '07.

[14]  Bengt Nordström,et al.  Types and Specifications , 1983, IFIP Congress.

[15]  Cormac Flanagan,et al.  Space-efficient gradual typing , 2010, High. Order Symb. Comput..

[16]  David A. McAllester,et al.  Sound and complete models of contracts , 2006, Journal of Functional Programming.

[17]  Kenneth Knowles,et al.  Type Reconstruction for General Refinement Types , 2007, ESOP.

[18]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[19]  Satish R. Thatte,et al.  Type Inference with Partial Types , 1988, Theor. Comput. Sci..

[20]  Stephen N. Freund,et al.  Sage: Hybrid Checking for Flexible Specifications , 2006 .

[21]  Chung-chieh Shan,et al.  Lightweight Static Capabilities , 2007, PLPV@IJCAR.

[22]  Robert Bruce Findler,et al.  Relationally-parametric polymorphic contracts , 2007, DLS '07.

[23]  簡聰富,et al.  物件導向軟體之架構(Object-Oriented Software Construction)探討 , 1989 .

[24]  Sam Tobin-Hochstadt,et al.  Interlanguage migration: from scripts to programs , 2006, OOPSLA '06.

[25]  Cormac Flanagan,et al.  Hybrid type checking , 2006, POPL '06.

[26]  Fritz Henglein,et al.  Safe polymorphic type inference for a dynamically typed language: translating Scheme to ML , 1995, FPCA '95.

[27]  Robert Bruce Findler,et al.  Fine-grained interoperability through contracts and mirrors , 2005 .

[28]  Robert Bruce Findler,et al.  Fine-grained interoperability through mirrors and contracts , 2005, OOPSLA '05.

[29]  Walid Taha,et al.  Gradual Typing for Objects , 2007, ECOOP.

[30]  Robert Bruce Findler,et al.  Contracts as Pairs of Projections , 2006, FLOPS.

[31]  Gilad Bracha Pluggable Type Systems , 2004 .

[32]  Anne Salvesen,et al.  The strength of the subset type in Martin-Lof's type theory , 1988, [1988] Proceedings. Third Annual Information Symposium on Logic in Computer Science.

[33]  Cormac Flanagan,et al.  Status report: specifying javascript with ML , 2007, ML '07.

[34]  Sam Tobin-Hochstadt,et al.  The design and implementation of typed scheme , 2008, POPL '08.

[35]  David Lorge Parnas,et al.  A technique for software module specification with examples , 1972, CACM.

[36]  Martín Abadi,et al.  Dynamic typing in a statically-typed language , 1989, POPL '89.