Mechanized Metatheory for User- Defined Type Extensions Dan Marino, Brian Chin, Todd Millstein UCLA Gang Tan Boston College Robert J. Simmons, David Walker.

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

Comparing Semantic and Syntactic Methods in Mechanized Proof Frameworks C.J. Bell, Robert Dockins, Aquinas Hobor, Andrew W. Appel, David Walker 1.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Verification of Multithreaded Object- Oriented Programs with Invariants Bart Jacobs, K. Rustan M. Leino, Wolfram Schulte.
1 Dependent Types for Termination Verification Hongwei Xi University of Cincinnati.
Ensuring Operating System Kernel Integrity with OSck By Owen S. Hofmann Alan M. Dunn Sangman Kim Indrajit Roy Emmett Witchel Kent State University College.
Chapter 5: Elementary Data Types Properties of types and objects –Data objects, variables and constants –Data types –Declarations –Type checking –Assignment.
Using Programmer-Written Compiler Extensions to Catch Security Holes Authors: Ken Ashcraft and Dawson Engler Presented by : Hong Chen CS590F 2/7/2007.
Code-Carrying Proofs Aytekin Vargun Rensselaer Polytechnic Institute.
An Integration of Program Analysis and Automated Theorem Proving Bill J. Ellis & Andrew Ireland School of Mathematical & Computer Sciences Heriot-Watt.
CS 326 Programming Languages, Concepts and Implementation Instructor: Mircea Nicolescu Lecture 18.
Page 1 Building Reliable Component-based Systems Chapter 16 - Component based embedded systems Chapter 16 Component based embedded systems.
Bilkent University Department of Computer Engineering
C. FlanaganSAS’04: Type Inference Against Races1 Type Inference Against Races Cormac Flanagan UC Santa Cruz Stephen N. Freund Williams College.
Under the Hood of the Open Verifier Bor-Yuh Evan Chang, Adam Chlipala, Kun Gao, George Necula, and Robert Schneck October 21, 2003 OSQ Group Meeting.
VIDE Integrated Environment for Development and Verification of Programs.
Knowledge and Systems Research Group, University of Huddersfield B vs OCL: Comparing Specification Languages for Planning Domains Diane Kitchin, Lee McCluskey,
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 14: Protection.
Twelf: The Quintessential Proof Assistant for Language Metatheory Karl Crary Carnegie Mellon University Joint work with Robert Harper and Michael Ashley-Rollman.
Typed Memory Management in a Calculus of Capabilities David Walker (with Karl Crary and Greg Morrisett)
Programmability with Proof-Carrying Code George C. Necula University of California Berkeley Peter Lee Carnegie Mellon University.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Java for High Performance Computing Jordi Garcia Almiñana 14 de Octubre de 1998 de la era post-internet.
Misc. Announcements Assignment available end of the day today –Due back in 11/03 (after break) Will also update slides on website –Today Midterm next week.
On the Relationship Between Concurrent Separation Logic and Assume-Guarantee Reasoning Xinyu Feng Yale University Joint work with Rodrigo Ferreira and.
Software Reliability Methods Sorin Lerner. Software reliability methods: issues What are the issues?
MinML: an idealized programming language CS 510 David Walker.
A Type System for Expressive Security Policies David Walker Cornell University.
From last time S1: l := new Cons p := l S2: t := new Cons *p := t p := t l p S1 l p tS2 l p S1 t S2 l t S1 p S2 l t S1 p S2 l t S1 p L2 l t S1 p S2 l t.
Run-Time Error Handling Wes Weimer, George Necula.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
© 2006 Pearson Addison-Wesley. All rights reserved4-1 Chapter 4 Data Abstraction: The Walls.
Data Abstraction and Object- Oriented Programming CS351 – Programming Paradigms.
Semantics for MinML COS 441 Princeton University Fall 2004.
Extensible Untrusted Code Verification Robert Schneck with George Necula and Bor-Yuh Evan Chang May 14, 2003 OSQ Retreat.
Automatic Implementation of provable cryptography for confidentiality and integrity Presented by Tamara Rezk – INDES project - INRIA Joint work with: Cédric.
1 Exception and Event Handling (Based on:Concepts of Programming Languages, 8 th edition, by Robert W. Sebesta, 2007)
Exceptions and Mistakes CSE788 John Eisenlohr. Big Question How can we improve the quality of concurrent software?
Computer Science 340 Software Design & Testing Design By Contract.
C++ Code Analysis: an Open Architecture for the Verification of Coding Rules Paolo Tonella ITC-irst, Centro per la Ricerca Scientifica e Tecnologica
CSC3315 (Spring 2009)1 CSC 3315 Programming Languages Hamid Harroud School of Science and Engineering, Akhawayn University
Proof Carrying Code Zhiwei Lin. Outline Proof-Carrying Code The Design and Implementation of a Certifying Compiler A Proof – Carrying Code Architecture.
 2006 Pearson Education, Inc. All rights reserved Classes: A Deeper Look, Part 2.
Dynamic Analysis of Multithreaded Java Programs Dr. Abhik Roychoudhury National University of Singapore.
Proof-Carrying Code & Proof-Carrying Authentication Stuart Pickard CSCI 297 June 2, 2005.
Next-generation databases Active databases: when a particular event occurs and given conditions are satisfied then some actions are executed. An active.
Verification and Validation in the Context of Domain-Specific Modelling Janne Merilinna.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Information Security - City College1 Access Control in Collaborative Systems Authors: Emis Simo David Naco.
Semantics In Text: Chapter 3.
ASPfun: A Distributed Object Calculus and its Formalization in Isabelle Work realized in collaboration with Florian Kammüller and Henry Sudhof (Technische.
© Andrew IrelandDependable Systems Group Proof Automation for the SPARK Approach to High Integrity Ada Andrew Ireland Computing & Electrical Engineering.
Modeling Speech Acts and Joint Intentions in Modal Markov Logic Henry Kautz University of Washington.
Demeter Aspects We study techniques for the emerging area of Aspect-Oriented Software Development and focus on the following areas:  Aspectual Collaborations.
Implementing a Dependently Typed λ -Calculus Ali Assaf Abbie Desrosiers Alexandre Tomberg.
Modularly Typesafe Interface Dispatch in JPred Christopher Frost and Todd Millstein University of California, Los Angeles
Formal Specification: a Roadmap Axel van Lamsweerde published on ICSE (International Conference on Software Engineering) Jing Ai 10/28/2003.
SAFE KERNEL EXTENSIONS WITHOUT RUN-TIME CHECKING George C. Necula Peter Lee Carnegie Mellon U.
PROGRAMMING PRE- AND POSTCONDITIONS, INVARIANTS AND METHOD CONTRACTS B MODULE 2: SOFTWARE SYSTEMS 13 NOVEMBER 2013.
COMP 412, FALL Type Systems II C OMP 412 Rice University Houston, Texas Fall 2000 Copyright 2000, Robert Cartwright, all rights reserved. Students.
CS5205Semantics1 CS5205: Foundation in Programming Languages Semantics Static Semantics Dynamic Semantics Operational Semantics Big-step Small-Step Denotational.
ACCESS MATRIX IMPLEMENTATION AND COMPARISON By: Rushabh Dharwadkar Roll no: TE COMP.
Model Checking Early Requirements Specifications in Tropos Presented by Chin-Yi Tsai.
Talk Outline Motivation and Background. Policy Contexts.
Chapter 14: System Protection
(One-Path) Reachability Logic
Designing with Java Exception Handling
Designing with Java Exception Handling
Semantic Type Qualifiers
Computer Science 340 Software Design & Testing
Presentation transcript:

Mechanized Metatheory for User- Defined Type Extensions Dan Marino, Brian Chin, Todd Millstein UCLA Gang Tan Boston College Robert J. Simmons, David Walker Princeton University

2 Motivation statically proving program properties is useful traditional type systems check (prove) a limited set of properties language users may want to check additional properties in specific applications how do we do this?

3 One Approach: Fancy Types allow new properties to be encoded directly as types + very expressive + no undue restriction on programming style – increased expressivity  increased annotation (i.e. proofs) – complex type checking harder to understand

4 Our Approach: User-Defined Type Systems allow type system extension via definition of new annotations and associated static checking rules + separation of roles type system extender (TSE) programmers + domain-specific coding disciplines – less expressive – restricted programming style

5 Natural Application for Mechanized Metatheory new static checking rules  extended soundness proof TSE has burden of convincing proof assistant that extension is sound TSE is rewarded with a guaranteed- sound, extended type system which can be used in any future application

6 New Extension Definition and Soundness Proof TWELF Metatheory Soundness Checker Extended Type Checker Error Interpreter Source Code using TSE-defined Annotations Compiler Error Interpreter Error reported to TSE e.g. Proof obligation not satisfied Error reported to Programmer e.g. Annotation discipline not obeyed T S E Programmers Extension Independent Theory and Metatheory Us

7 Designing an Extension Framework goal: facilitate adding an extension our approach 1. identify a useful class of extensions 2. extract the commonalities within the class 3. provide specialized interface to TSE

8 Two Extension Frameworks  user-defined type qualifiers e.g. positive, tainted, unaliased simple annotations on expressions qualifier soundness establishes invariants about values and closely mirrors type soundness user-defined type-and-effect systems e.g. checked exceptions, synchronization, region-based memory management specify how effects are generated and when allowed soundness establishes correspondence between static rules and instrumented, effect-generating operational semantics

9 Example: User-Defined Qualifiers goal: allow TSE to define discipline that enforces an invariant about values e.g. “I want a discipline that programmers can use to statically verify that certain values will always be even numbers.”

10 ,  ├ E1 : iseven ,  ├ E2 : iseven ,  ├ E2 : iseven ,  ├ E1 : iseven Ex: User-Defined Qualifiers define qualifier typing rules ,  ├ C : iseven ,  ├ E1 + E2 : iseven ,  ├ E1 * E2 : iseven ,  ├ E + E : iseven C is an even constant

11 define value invariant e.g. satisfies (v, iseven)   n : v = 2 * n prove soundness ,  ├ V : Q  satisfies (V, Q) Ex: User-Defined Qualifiers ,  ├ E : Q  E  E’  ,  ├ E’ : Q Preservation Value Invariant Satisfaction

12 Two Extension Frameworks user-defined type qualifiers e.g. positive, tainted, unaliased simple annotations on expressions qualifier soundness establishes invariants about values and closely mirrors type soundness  user-defined type-and-effect systems e.g. checked exceptions, synchronization, region-based memory management specify how effects are generated and when allowed

13 Effect Checking as Privileges effect checking can be viewed as granting, revoking, and checking privileges or capabilities Grant Check Revoke Grant Check Revoke Grant Check Race Condition CheckingRegion-based Memory Management acquire lock release lock protected access allocate region free region access memory Checked Exceptions try / catch block throw exception

14 Type-and-Effect Framework framework provides generic rules with hooks for TSE-defined privilege operations TSE defines static and dynamic privilege ops During static checking of which expressions do we grant, revoke, check privileges? Which steps of evaluation cause privilege ops? TSE proof obligations are limited to lemmas about newly defined privilege operations

15 Simple Effect Example : Impure TSE says “I want programmers to indicate explicitly any code that might change memory” define new privilege “impure” source language provides generic form for annotating expressions e.g. grant P in E

16 Simple Effect Example : Impure specify evaluation steps that require privilege ,  ├ E1 : Ref T , ,  ├ E2 : T impure   ,  ├ E1 := E2 : Unit  ’ =  [loc  V] impure   , , loc := V  ,  ’, unit indicate static checking rules that check privilege context

17 Current Status complete formalization of Fun in Twelf qualifier / type-and-effect frameworks versions of the extension-independent theory/metatheory complete experimenting with example extensions to gauge expressiveness

18 Summary defining statically-checkable programming disciplines has been limited to the realm of language designers mechanized metatheory clears the way to allow a wider group to take advantage of this technique separating the roles of TSE and Programmer maintains language ease-of-use while allowing for powerful static guarantees