A theory of typed coercions and its applications

A number of important program rewriting scenarios can be recast as type-directed coercion insertion. These range from more theoretical applications such as coercive subtyping and supporting overloading in type theories, to more practical applications such as integrating static and dynamically typed code using gradual typing, and inlining code to enforce security policies such as access control and provenance tracking. In this paper we give a general theory of type-directed coercion insertion. We specifically explore the inherent tradeoff between expressiveness and ambiguity--the more powerful the strategy for generating coercions, the greater the possibility of several, semantically distinct rewritings for a given program. We consider increasingly powerful coercion generation strategies, work out example applications supported by the increased power (including those mentioned above), and identify the inherent ambiguity problems of each setting, along with various techniques to tame the ambiguities.

[1]  Yong Luo,et al.  Transitivity in coercive subtyping , 2005, Inf. Comput..

[2]  Philip Wadler,et al.  Idioms are Oblivious, Arrows are Meticulous, Monads are Promiscuous , 2011, Electron. Notes Theor. Comput. Sci..

[3]  James Cheney,et al.  Provenance as Dependency Analysis , 2007, DBPL.

[4]  LindleySam,et al.  Idioms are Oblivious, Arrows are Meticulous, Monads are Promiscuous , 2011 .

[5]  Zhaohui Luo Coercions in a polymorphic type system , 2008, Math. Struct. Comput. Sci..

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

[7]  Gilles Barthe,et al.  Implicit Coercions in Type Systems , 1995, TYPES.

[8]  Simon L. Peyton Jones,et al.  System F with type equality coercions , 2007, TLDI '07.

[9]  Andrew C. Myers,et al.  Language-based information-flow security , 2003, IEEE J. Sel. Areas Commun..

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

[11]  Zhaohui Luo,et al.  Coercive Subtyping , 1995 .

[12]  Somesh Jha,et al.  Retrofitting legacy code for authorization policy enforcement , 2006, 2006 IEEE Symposium on Security and Privacy (S&P'06).

[13]  Michael Hicks,et al.  Fable: A Language for Enforcing User-defined Security Policies , 2008, 2008 IEEE Symposium on Security and Privacy (sp 2008).

[14]  Polyvios Pratikakis,et al.  Transparent proxies for java futures , 2004, OOPSLA.

[15]  Thierry Coquand,et al.  Inheritance as Implicit Coercion , 1991, Inf. Comput..

[16]  Philip Wadler,et al.  Well-Typed Programs Can't Be Blamed , 2009, ESOP.

[17]  Michael Hicks,et al.  Mutatis Mutandis : Safe and predictable dynamic software updating , 2007 .

[18]  Amokrane Saïbi Typing algorithm in type theory with inheritance , 1997, POPL '97.

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

[20]  Zhaohui Luo,et al.  Coercive Subtyping in Type Theory , 1996, CSL.

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

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

[23]  Zhaohui Luo,et al.  Coercions in Hindley-Milner Systems , 2003, TYPES.