Sage: Hybrid Checking for Flexible Specifications

Software systems typically contain large APIs that are informally specified and hence easily misused. This paper presents the Sage programming language, which is designed to enforce precise interface specifications in a flexible manner. The Sage type system uses a synthesis of the type Dynamic, first-class types, and arbitrary refinement types. Since type checking for this expressive language is not statically decidable, Sage uses hybrid type checking, which extends static type checking with dynamic contract checking, automatic theorem proving, and a database of refuted subtype judgments.

[1]  Gary T. Leavens,et al.  Design by Contract with JML , 2006 .

[2]  Robert Cartwright,et al.  Soft typing , 2004, SIGP.

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

[4]  Jong-Deok Choi,et al.  Hybrid dynamic data race detection , 2003, PPoPP '03.

[5]  Matthias Felleisen,et al.  Catching bugs in the web of program invariants , 1996, PLDI '96.

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

[7]  Alexander Aiken,et al.  Soft typing with conditional types , 1994, POPL '94.

[8]  Michael Kölling,et al.  Blue - Language Specification, Version 1.0 , 1997 .

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

[10]  Pierre Castéran,et al.  Interactive Theorem Proving and Program Development , 2004, Texts in Theoretical Computer Science An EATCS Series.

[11]  Robert Cartwright,et al.  Soft typing , 1991, PLDI '91.

[12]  Natarajan Shankar,et al.  PVS: A Prototype Verification System , 1992, CADE.

[13]  Luca Cardelli A Polymorphic Lambda Calculus with Type:Type , 1986 .

[14]  Chiyan Chen,et al.  Combining programming with theorem proving , 2005, ICFP '05.

[15]  Hendrik Pieter Barendregt,et al.  Introduction to generalized type systems , 1991, Journal of Functional Programming.

[16]  K. Rustan M. Leino,et al.  The Spec# Programming System: An Overview , 2004, CASSIS.

[17]  David Lorge Parnas A technique for software module specification with examples , 1983, CACM.

[18]  Thomas R. Gross,et al.  Object race detection , 2001, OOPSLA '01.

[19]  David Walker,et al.  An effective theory of type refinements , 2003, ACM SIGPLAN Notices.

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

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

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

[23]  Mark Lillibridge,et al.  Extended static checking for Java , 2002, PLDI '02.

[24]  David Detlefs,et al.  Simplify: a theorem prover for program checking , 2005, JACM.

[25]  Hongwei Xi,et al.  Imperative programming with dependent types , 2000, Proceedings Fifteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.99CB36332).

[26]  George C. Necula,et al.  CCured: type-safe retrofitting of legacy code , 2002, POPL '02.

[27]  Xavier Leroy The objective caml system release 3 , 2001 .

[28]  Gerald Jay Sussman,et al.  An Interpreter for Extended Lambda Calculus , 1975 .

[29]  David A. McAllester,et al.  A sound (and complete) model of contracts , 2004, ICFP '04.

[30]  Satish R. Thatte Quasi-static typing , 1989, POPL '90.

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

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

[33]  Koushik Sen,et al.  DART: directed automated random testing , 2005, PLDI '05.

[34]  David Luckham,et al.  Programming with Specifications , 1990, Texts and Monographs in Computer Science.

[35]  Rahul Agarwal,et al.  Type Inference for Parameterized Race-Free Java , 2004, VMCAI.

[36]  Lennart Augustsson,et al.  Cayenne—a language with dependent types , 1998, ICFP '98.

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

[38]  Simon L. Peyton Jones,et al.  Report on the programming language Haskell: a non-strict, purely functional language version 1.2 , 1992, SIGP.

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

[40]  Richard C. Holt,et al.  The Turing programming language , 1988, CACM.