Hybrid Type Checking An implementation of λ H David Waern Rickard Nilsson.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming
Advertisements

Static Contract Checking for Haskell Dana N. Xu University of Cambridge Ph.D. Supervisor: Simon Peyton Jones Microsoft Research Cambridge.
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
Type Checking, Inference, & Elaboration CS153: Compilers Greg Morrisett.
Masahiro Fujita Yoshihisa Kojima University of Tokyo May 2, 2008
Computing Fundamentals 2 Introduction to CafeOBJ Lecturer: Patrick Browne Lecture Room: K408 Lab Room: A308 Based on work by: Nakamura Masaki, João Pascoal.
ICE1341 Programming Languages Spring 2005 Lecture #6 Lecture #6 In-Young Ko iko.AT. icu.ac.kr iko.AT. icu.ac.kr Information and Communications University.
Abstraction and Modular Reasoning for the Verification of Software Corina Pasareanu NASA Ames Research Center.
Giving a formal meaning to “Specialization” In these note we try to give a formal meaning to specifications, implementations, their comparisons. We define.
1 Mooly Sagiv and Greta Yorsh School of Computer Science Tel-Aviv University Modern Compiler Design.
Type checking © Marcelo d’Amorim 2010.
August Moscow meeting1August Moscow meeting1August Moscow meeting11 Deductive tools in insertion modeling verification A.Letichevsky.
1 Space-Efficient Gradual Typing David Herman Northeastern University Aaron Tomb, Cormac Flanagan University of California, Santa Cruz.
Type Checking.
Catriel Beeri Pls/Winter 2004/5 last 55 Two comments on let polymorphism I. What is the (time, space) complexity of type reconstruction? In practice –
What is a Parser? A parser is a program that analyses a piece of text to determine its syntactic structure  3 means 23+4.
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
Generic Haskell Where to start from. Issues Touched Language Ideas Tools Pitfalls.
Houdini: An Annotation Assistant for ESC/Java Cormac Flanagan and K. Rustan M. Leino Compaq Systems Research Center.
Compilation 2007 Scopes and Environments Michael I. Schwartzbach BRICS, University of Aarhus.
Objects and Classes David Walker CS 320. Advanced Languages advanced programming features –ML data types, exceptions, modules, objects, concurrency,...
Cormac Flanagan University of California, Santa Cruz Hybrid Type Checking.
16 - Generics. 2 NOEA2009Java-kursus – Generics ”Generic” Programming in C#/Java (as it was until Summer 2005) All classes inherit from Object So we can.
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
1 Testing, Abstraction, Theorem Proving: Better Together! Greta Yorsh joint work with Thomas Ball and Mooly Sagiv.
Generics in.NET and C# Generics. ”Generic” Programming in C#/Java (as it was until Summer 2005) All classes inherit from Object So we can apply polymorphism.
Extended Static Checking for Java  ESC/Java finds common errors in Java programs: null dereferences, array index bounds errors, type cast errors, race.
Applications of extended static checking K. Rustan M. Leino Compaq SRC K. Rustan M. Leino Compaq SRC Systems Research Center Invited talk, SAS’01, Paris,
Sound Haskell Dana N. Xu University of Cambridge Joint work with Simon Peyton Jones Microsoft Research Cambridge Koen Claessen Chalmers University of Technology.
QuickCheck: A Lightweight Tool for Random Testing of Haskell Programs By Koen Claessen, Juhn Hughes ME: Mike Izbicki.
Syntax and Semantics CIS 331 Syntax: the form or structure of the expressions, statements, and program units. Semantics: the meaning of the expressions,
Bayu Priyambadha, S.Kom. * Poly = Many, Morph = form * Polymorphism refers to a principle in biology in which an organism or species can have many different.
Extended Static Checking for Java Cormac Flanagan Joint work with: Rustan Leino, Mark Lillibridge, Greg Nelson, Jim Saxe, and Raymie Stata.
Model Checking for Simple Java Programs Taehoon Lee, Gihwon Kwon Department of Computer Science Kyonggi University, Korea IWFST, Shanghai, China,
Objects First With Java A Practical Introduction Using BlueJ Casting Week
1 Static Contract Checking for Haskell Dana N. Xu University of Cambridge Joint work with Simon Peyton Jones Microsoft Research Cambridge Koen Claessen.
Extended Static Checking for Java Cormac Flanagan Joint work with: Rustan Leino, Mark Lillibridge, Greg Nelson, Jim Saxe, and Raymie Stata Compaq Systems.
Shifting the Blame A blame calculus with delimited control Taro Sekiyama* Atsushi Igarashi Soichiro Ueda Kyoto University Gradual typing.
1 Space-Efficient Gradual Typing David Herman Northeastern University Aaron Tomb, Cormac Flanagan University of California, Santa Cruz.
FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University.
URL: by Wishnu Prasetya Course on Program Verification 2015/2016.
Chapter 6.6, 11, 16 Stacks 1CSCI 3333 Data Structures.
Lecture 11: Proof by Reflection
Extended Static Checking for Java
What is a Parser? A parser is a program that analyses a piece of text to determine its syntactic structure  3 means 23+4.
Undergraduate PL Class
Semantic Analysis Type Checking
CS 3304 Comparative Languages
PROGRAMMING IN HASKELL
Course on Program Verification 2017/2018
Data Types.
Stateful Manifest Contracts
Subtyping Rules David Evans cs205: engineering software BlackBear
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Preparing for MUPL! Justin Harjanto
IS 2935: Developing Secure Systems
PROGRAMMING IN HASKELL
Space-Efficient Gradual Typing
Verified Subtyping with Traits and Mixins
Implementation of a Functional Programming Language
Adapted from slides by Nicholas Shahan and Dan Grossman
PROGRAMMING IN HASKELL
Adapted from slides by Nicholas Shahan, Dan Grossman, and Tam Dang
Nicholas Shahan Spring 2016
Subtype Substitution Principle
Gradual Verification Seamlessly and flexibly combine static and dynamic verification by drawing on the general principles from abstract interpretation.
PROGRAMMING IN HASKELL
Object Slicing & Dynamic Casts
Types and Related Issues
Static Contract Checking for Haskell
Presentation transcript:

Hybrid Type Checking An implementation of λ H David Waern Rickard Nilsson

Hybrid Type Checking Cormac Flanagan POPL 2006 A combination of Static and Dynamic checking If a specification can't be checked statically, it will be checked dynamically Dynamic Type Casts Casts are inserted when static checking fails to prove or disprove

Hybrid Type Checking Precise specifications are supported Advanced specifications and static analyses can be tried out Selectable trade-off between compilation speed and coverage

λHλH Typed λ -calculus Refinement types Natural = {x:Int | x > 0} Dependent function types f :: m:Int -> n:Natural -> {x: Int | x = m + n} Undecidable type checking

Implementatio n Follows Flanagan's description closely Haskell

Parse r Parsec parser combinator library Tested with QuickCheck

Type checker / Compiler Basic structural static type checking Actual checking done in subtyping function Casts injected if sub typer fails

Subtyping Simple rejections Accepts types with structurally equal predicates Refinement predicate evaluation for applications of constants Easily extendable Possible to plugin a theorem prover

Interprete r Evaluates inserted casts, which may fail

Demonstratio n