Comparing Semantic and Syntactic Methods in Mechanized Proof Frameworks C.J. Bell, Robert Dockins, Aquinas Hobor, Andrew W. Appel, David Walker 1.

Slides:



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

A Translation from Typed Assembly Language to Certified Assembly Programming Zhong Shao Yale University Joint work with Zhaozhong Ni Paper URL:
Security of Multithreaded Programs by Compilation Tamara Rezk INDES Project, INRIA Sophia Antipolis Mediterranee Joint work with Gilles Barthe, Alejandro.
Static and User-Extensible Proof Checking Antonis StampoulisZhong Shao Yale University POPL 2012.
Certified Typechecking in Foundational Certified Code Systems Susmit Sarkar Carnegie Mellon University.
Foundational Certified Code in a Metalogical Framework Karl Crary and Susmit Sarkar Carnegie Mellon University.
David Evans CS655: Programming Languages University of Virginia Computer Science Lecture 20: Total Correctness; Proof-
March 4, 2005Susmit Sarkar 1 A Cost-Effective Foundational Certified Code System Susmit Sarkar Thesis Proposal.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Nicholas Moore Bianca Curutan Pooya Samizadeh McMaster University March 30, 2012.
David Evans CS655: Programming Languages University of Virginia Computer Science Lecture 19: Minding Ps & Qs: Axiomatic.
Time Bounds for General Function Pointers Robert Dockins and Aquinas Hobor (Princeton University) (NUS) TexPoint fonts used in EMF. Read the TexPoint manual.
ISBN Chapter 3 Describing Syntax and Semantics.
An Introduction to Proof-Carrying Code David Walker Princeton University (slides kindly donated by George Necula; modified by David Walker)
The Design and Implementation of a Certifying Compiler [Necula, Lee] A Certifying Compiler for Java [Necula, Lee et al] David W. Hill CSCI
Code-Carrying Proofs Aytekin Vargun Rensselaer Polytechnic Institute.
CLF: A Concurrent Logical Framework David Walker Princeton (with I. Cervesato, F. Pfenning, K. Watkins)
Extensible Verification of Untrusted Code Bor-Yuh Evan Chang, Adam Chlipala, Kun Gao, George Necula, and Robert Schneck May 14, 2004 OSQ Retreat Santa.
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.
CS 536 Spring Global Optimizations Lecture 23.
Twelf: The Quintessential Proof Assistant for Language Metatheory Karl Crary Carnegie Mellon University Joint work with Robert Harper and Michael Ashley-Rollman.
The lambda calculus David Walker CS 441. the lambda calculus Originally, the lambda calculus was developed as a logic by Alonzo Church in 1932 –Church.
/191 Typed Compilation of Objects Andrew McCreight and Zhong Shao FLINT Project Yale University.
Modular Verification of Assembly Code with Stack-Based Control Abstractions Xinyu Feng Yale University Joint work with Zhong Shao, Alexander Vaynberg,
Prof. Fateman CS 164 Lecture 221 Global Optimization Lecture 22.
CprE 458/558: Real-Time Systems
Describing Syntax and Semantics
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
Mechanized Metatheory for User- Defined Type Extensions Dan Marino, Brian Chin, Todd Millstein UCLA Gang Tan Boston College Robert J. Simmons, David Walker.
Extensible Untrusted Code Verification Robert Schneck with George Necula and Bor-Yuh Evan Chang May 14, 2003 OSQ Retreat.
Composing Dataflow Analyses and Transformations Sorin Lerner (University of Washington) David Grove (IBM T.J. Watson) Craig Chambers (University of Washington)
Extensible Code Verification Kun Gao (Senior EECS) with Professor George Necula, Evan Chang, Robert Schneck, Adam Chlipala An individual receives code.
Prof. Bodik CS 164 Lecture 16, Fall Global Optimization Lecture 16.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
Fault-tolerant Typed Assembly Language Frances Perry, Lester Mackey, George A. Reis, Jay Ligatti, David I. August, and David Walker Princeton University.
Secure Compiler Seminar 11/7 Survey: Modular Development of Certified Program Verifiers with a Proof Assistant Toshihiro YOSHINO (D1, Yonezawa Lab.)
Chapter 10: Compilers and Language Translation Invitation to Computer Science, Java Version, Third Edition.
Aquinas Hobor and Cristian Gherghina (National University of Singapore) TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.:
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 4 (Part 3): Mathematical Reasoning, Induction.
Proof Carrying Code Zhiwei Lin. Outline Proof-Carrying Code The Design and Implementation of a Certifying Compiler A Proof – Carrying Code Architecture.
1 COMP 3438 – Part II-Lecture 1: Overview of Compiler Design Dr. Zili Shao Department of Computing The Hong Kong Polytechnic Univ.
Framework for the Development and Testing of Dependable and Safety-Critical Systems IKTA 065/ Supported by the Information and Communication.
Proof-Carrying Code & Proof-Carrying Authentication Stuart Pickard CSCI 297 June 2, 2005.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
An overview of Coq Xinyu Feng USTC Erasmus Mundus NordSecMob Scholar at DTU.
Towards Automatic Verification of Safety Architectures Carsten Schürmann Carnegie Mellon University April 2000.
Introduction to Data Structures and Algorithms CS 110: Data Structures and Algorithms First Semester,
Introduction to Compilers. Related Area Programming languages Machine architecture Language theory Algorithms Data structures Operating systems Software.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Secure Compiler Seminar 4/11 Visions toward a Secure Compiler Toshihiro YOSHINO (D1, Yonezawa Lab.)
Lecture 5 1 CSP tools for verification of Sec Prot Overview of the lecture The Casper interface Refinement checking and FDR Model checking Theorem proving.
Chapter 1 Introduction Visual Basic.NET. Copyright (c) 2003 by Prentice Hall Provided By: Qasim Al-ajmi 2 Objectives Explain what Visual Basic is Contrast.
SAFE KERNEL EXTENSIONS WITHOUT RUN-TIME CHECKING George C. Necula Peter Lee Carnegie Mellon U.
Duminda WijesekeraSWSE 623: Introduction1 Introduction to Formal and Semi- formal Methods Based on A Specifier's Introduction to Formal Methods (J. Wing)
1 Overview of Programming Principles of Computers.
CSE 60641: Operating Systems George C. Necula and Peter Lee, Safe Kernel Extensions Without Run-Time Checking, OSDI ‘96 –SIGOPS Hall of fame citation:
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Chapter 4 (Part 3): Mathematical Reasoning, Induction & Recursion
Topic: Programming Languages and their Evolution + Intro to Scratch
CSE-321 Programming Languages Simply Typed -Calculus
Proof Carrying Code and Proof Preserving Program Transformations
(One-Path) Reachability Logic
State your reasons or how to keep proofs while optimizing code
An overview of Coq Xinyu Feng USTC.
A Trustworthy Proof Checker
Language-based Security
Types and Type Checking (What is it good for?)
Chapter 10: Compilers and Language Translation
Programming Languages and Compilers (CS 421)
An overview of Coq.
Presentation transcript:

Comparing Semantic and Syntactic Methods in Mechanized Proof Frameworks C.J. Bell, Robert Dockins, Aquinas Hobor, Andrew W. Appel, David Walker 1

In the last decade, dozens of researchers have been investigating proof-carrying code (PCC) These researchers have split into two camps: – those using syntactic proof methods – those using semantic proof methods 2

We want to be able to investigate different proof methodologies, such as syntactic and semantic type systems The list-machine benchmark is – assembly language – operational semantics – type system specification – two implementaions of a type system This benchmark is – simple, so that it is easy to understand – modular, so that it is flexible – publically available at 3 List-Machine Benchmark

Changes to the List-Machine Benchmark for 2.0 Implemented only in Coq Added a semantic type system Reorganized the framework 4

Outline Introduction Organization of the List-Machine framework Extend the List Machine with fault tolerance Semantic and syntactic methods in large systems 5

Machine Specification 6

Modules 7

8 Typechecking Algorithm Typechecker Soundness Proof Type System Type System Specification Typechecking Algorithm check(Π,Ψ) = true Typechecker Soundness Proof check(Π,Ψ) = true → Π  ⊢ blocks Ψ Type System Proves: Π⊢ blocks Ψ → safe Ψ Type System Specification type operators definitions of typing rules statement of safety Π⊢ blocks Ψ → safe Ψ

9 Typechecking Algorithm check(Π,Ψ) = true Typechecker Soundness Proof check(Π,Ψ) = true → Π  ⊢ blocks Ψ Type System Proves: Π⊢ blocks Ψ → safe Ψ Type System Specification type operators definitions of typing rules statement of safety Π⊢ blocks Ψ → safe Ψ

Syntactic Type System Type operators defined inductively Typing rules defined inductively The type system is proven sound using metatheorems (progress & preservation) using induction over definitions. 10 Type System Specification Syntactic Soundness Proof Π⊢ blocks Ψ → safe Ψ

Semantic Type System 11 reusable Type System Specification Semantic Soundness Proof Π⊢ blocks Ψ → safe Ψ List Machine Hoare Logic Π⊢ blocks Ψ Π;Ψ⊢ block ι:P Π;Ψ⊢ instr P{ι}Q Modal Specification Logic Modal Model Library

Outline Introduction Organization of the List-Machine framework Extend the List Machine with fault tolerance Semantic and syntactic methods in large systems 12

Fault Tolerance Extend the List-Machine framework to provide fault tolerance – Requires non-trivial modifications to the framework – Demonstrates the flexibility of the framework 13

Simple List-Machine Example (without faults) 14

Fault Model Single Event Upset – assume a fault will occur at most once A fault may change just one register’s value to any other value.

Simple List-Machine Example (with faults) 16

Fault-Tolerant Modified Machine Specification 17

Fault-Tolerant Example 18

Incorrect Fault-Tolerant Example 19

Is the modified code fault-tolerant? Fault tolerance becomes part of the safety property Type system ensures proper use of colors Model possible occurrences of faults 20

Modify the Operational Semantics 21

Modify the Operational Semantics Branch instructions require green and blue computations to agree 22

FT Summary 23 Semantic Syntactic Machine syntax Operational semantics Typechecker Type systems Definition of “safe” to include fault states Safety (colors, no faults) Model faults Safety in the presence of faults

Outline Introduction Organization of the List-Machine framework Extend the List Machine with fault tolerance Semantic and syntactic methods in large systems 24

How Semantic and Syntactic Methods Scale Princeton Foundational Proof-Carrying Code (FPCC) Vs. Carnegie Mellon ConCert project FPCC :: SemanticConCert :: Syntactic 25

Common Traits Include a TAL for ML compiled to machine code Goal: guarantee a memory property for untrusted code Written in Twelf Industrial-strength TALs Large systems 26

Composition Trusted Computing Base T + L + M << P 27 M achine – SPARC or x86 definitions L ogic – example: definition of modular arithmatic T heorems – statement of the safety property P roof Checker – theorem checker for FPCC and a metatheorem checker for ConCert

Token count of TCB components 28

Token count of TCB components The TCBs are equivalent in size except for the Checker 29

Interface Safety Requires updating the policy moving the type system from P roof to T heorem – now part of the TCB Should the type system be semantic or syntactic? 30

Scaling Law Semantic: new definition per type constructor Syntactic: new definition per expression constructor Toy systems have few expression constructors… 31

Real systems have more expression constructors than type constructors.  semantic methods require fewer definitions Is the average type definition larger than the average typing rule? 32

In toy systems, typing rules are simple... |- stmt_prim_lbladd_ADD_imm: judge_stmt (e_prim A (p_lbladd V1 (val_diff L0 Lab I2))) Prog L CCEnv AENV KL Ps Phi L' CCEnv AENV KL Ps' Phi' <- regbind A At Prog <- targetreg At Ar <- regbind_val Prog V1 Vt <- realreg Vt Vr <- diff_value Prog (val_diff L0 Lab I2) Vc <- imm13 Vc (c Vimm13) <- valueTy Prog KL Phi V1 (offset I1 (int pi= (addr Lab))) <- valueTy Prog KL Phi (val_diff L0 Lab I2) (offset I2 (diff L0 Lab)) <- check_lbladd_offset I1 I2 <- num_add I1 I2 I1+I2 <- venv_add\ Prog A (offset I1+I2 (int pi= (addr L0))) Phi Phi' <- decode_list L L' Ps Ps' (instr_ADD Vr (inject_imode Vimm13) Ar) =... 33

How does this balance in FPCC & ConCert? 34 FPCC’s semantic definitions are half the size of syntactic definitions for FPCC This will become even more pronounced according to the scaling law if the compiler wishes to generate more instructions.

Conclusion Introduction Organization of the List-Machine framework Extend the List Machine with fault tolerance Semantic and syntactic methods in large systems 35

Appendix 36

Modified Typing Rules 37

Modified Operational Semantics w = (n,ρ,a) 38 w = (n,ρ,a,ρ’,κ) ρ’ – FT register store κ – color store (and equivalent for the syntactic system)

39 Modified Semantic Type System 39

List-Machine Benchmark 2.0 Easily extended Facilitates small scale comparisons between many proof methods (semantic and syntactic). 40

Compare how type systems scale between semantic and syntactic proof methods 41 Princeton’s Foundational Proof Carrying Code (FPCC) vs Carnegie Mellon’s ConCert

Modules 42

43 Type System Specification Typechecking Algorithm Typechecker Soundness Proof Type System Typechecking Algorithm check(Π,Ψ) = true Typechecker Soundness Proof check(Π,Ψ) = true → Π  ⊢ blocks Ψ Type System Π⊢ blocks Ψ → safe Ψ Type System Specification

44 Typechecking Algorithm check(Π,Ψ) = true Typechecker Soundness Proof check(Π,Ψ) = true → Π  ⊢ blocks Ψ Type System Proves: Π⊢ blocks Ψ → safe Ψ Type System Specification type operators definitions of typing rules statement of safety Π⊢ blocks Ψ → safe Ψ

Modules 45