Towards a Unified Theory of Operational and Axiomatic Semantics

Slides:



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

Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 12.
An Abstract Interpretation Framework for Refactoring P. Cousot, NYU, ENS, CNRS, INRIA R. Cousot, ENS, CNRS, INRIA F. Logozzo, M. Barnett, Microsoft Research.
Semantics Static semantics Dynamic semantics attribute grammars
PZ03D Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ03D - Program verification Programming Language Design.
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.
Hoare’s Correctness Triplets Dijkstra’s Predicate Transformers
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Formal Semantics of Programming Languages 虞慧群 Topic 5: Axiomatic Semantics.
VIDE als voortzetting van Cocktail SET Seminar 11 september 2008 Dr. ir. Michael Franssen.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
ISBN Chapter 3 Describing Syntax and Semantics.
CS 330 Programming Languages 09 / 19 / 2006 Instructor: Michael Eckmann.
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
1/22 Programs : Semantics and Verification Charngki PSWLAB Programs: Semantics and Verification Mordechai Ben-Ari Mathematical Logic for Computer.
CS 355 – Programming Languages
Programming Language Semantics Axiomatic Semantics Chapter 6.
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
Programming Language Semantics Mooly SagivEran Yahav Schrirber 317Open space html://
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
PSUCS322 HM 1 Languages and Compiler Design II Formal Semantics Material provided by Prof. Jingke Li Stolen with pride and modified by Herb Mayer PSU Spring.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Software Verification Bertrand Meyer Chair of Software Engineering Lecture 2: Axiomatic semantics.
Describing Syntax and Semantics
Proving Program Correctness The Axiomatic Approach.
Matching Logic Grigore Rosu University of Illinois at Urbana-Champaign, USA 1.
Software Models (Cont.) 9/22/2015ICS 413 – Software Engineering1 -Component-based software engineering -Formal Development Model.
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
Overview of Formal Methods. Topics Introduction and terminology FM and Software Engineering Applications of FM Propositional and Predicate Logic Program.
Chapter 25 Formal Methods Formal methods Specify program using math Develop program using math Prove program matches specification using.
Checking Reachability using Matching Logic Grigore Rosu and Andrei Stefanescu University of Illinois, USA.
Formal Semantics of Programming Languages 虞慧群 Topic 1: Introduction.
Program Analysis and Verification Spring 2014 Program Analysis and Verification Lecture 4: Axiomatic Semantics I Roman Manevich Ben-Gurion University.
ISBN Chapter 3 Describing Semantics.
Chapter 3 Part II Describing Syntax and Semantics.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Semantics In Text: Chapter 3.
From Hoare Logic to Matching Logic Reachability Grigore Rosu and Andrei Stefanescu University of Illinois, USA.
Just Enough Type Theory or, Featherweight Java A Simple Formal Model of Objects Jonathan Aldrich
All-Path Reachability Logic Andrei Stefanescu 1, Stefan Ciobaca 2, Radu Mereuta 1,2, Brandon Moore 1, Traian Serbanuta 3, Grigore Rosu 1 1 University of.
Specify and Verify Your Language using K Grigore Rosu University of Illinois at Urbana-Champaign Joint project between the FSL group at UIUC (USA) and.
Duminda WijesekeraSWSE 623: Introduction1 Introduction to Formal and Semi- formal Methods Based on A Specifier's Introduction to Formal Methods (J. Wing)
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
K Framework Grigore Rosu University of Illinois at Urbana-Champaign, USA Traian-Florin Serbanuta Alexandru Ioan-Cuza University, Iasi, Romania Joint work.
Certifying and Synthesizing Membership Equational Proofs Patrick Lincoln (SRI) joint work with Steven Eker (SRI), Jose Meseguer (Urbana) and Grigore Rosu.
Spring 2017 Program Analysis and Verification
Matching Logic An Alternative to Hoare/Floyd Logic
Towards trustworthy refactoring in Erlang
(One-Path) Reachability Logic
Formal Methods in Software Engineering 1
Jared Davis The University of Texas at Austin April 6, 2006
Syntax Questions 6. Define a left recursive grammar rule.
Chapter 10: Mathematical proofs
Matching Logic - A New Program Verification Approach -
Logical architecture refinement
Lecture 5 Floyd-Hoare Style Verification
IS 2935: Developing Secure Systems
Programming Languages 2nd edition Tucker and Noonan
Generating Optimal Linear Temporal Logic Monitors by Coinduction
Semantics In Text: Chapter 3.
How science works (adapted from Coombs, 1983)
MA/CSSE 474 More Math Review Theory of Computation
Finite-Trace Linear Temporal Logic: Coinductive Completeness
Statistics and Linear Algebra
Language-Independent Verification Framework
Program correctness Axiomatic semantics
Lecture 2: Axiomatic semantics
Programming Languages and Compilers (CS 421)
Programming Languages 2nd edition Tucker and Noonan
Presentation transcript:

Towards a Unified Theory of Operational and Axiomatic Semantics Grigore Rosu and Andrei Stefanescu University of Illinois, USA

Operational Semantics

Operational Semantics Easy to define and understand Can be regarded as formal “implementations” Require little mathematical knowledge Great introductory topics in PL courses Scale up well C (>1000 rules), Java, Scheme, Verilog, …, defined Executable, so testable C semantics tested against real benchmarks

Operational Semantics of IMP - Sample Rules -

Operational Semantics of IMP - Sample Rules - May need to be completed “all the way to top”, into rules between configurations:

Operational Semantics - Bottom Line (well-known) - We can operationally define any programming languages only with rewrite rules of the form where l,r are “top-level” configuration terms, and b is a Boolean side condition

Unfortunately … Operational semantics considered inappropriate for program reasoning Proofs based on operational semantics are low-level and tedious Have to formalize and work with transition system Induction on structure, number of steps, etc.

Axiomatic Semantics (Hoare Logic)

Axiomatic Semantics Focused on reasoning Programming language captured as a formal proof system that allows to derive triples Precondition Postcondition

Axiomatic Semantics Not easy to define and understand, error-prone Not executable, hard to test; require program transformations which may lose behaviors, etc.

State-of-the-art in Certifiable Verification Define an operational semantics, which acts as trusted reference model of the language Define an axiomatic semantics, for reasoning Prove the axiomatic semantics sound for the operational semantics Now we have trusted verification … … but the above needs to be done for each language individually; at best uneconomical

Unified Theory of Programming - (Hoare and Jifeng) - Framework where various semantics of the same language coexist, with systematic relationships (e.g., soundness) proved Then use one semantics or another … This still requires two or more semantics for the same language (C semantics took >2years) Uneconomical, people will not do it

Unified Theory of Programming - Our Approach - Underlying belief A language should have only one semantics, which should be easy, executable, and good for program reasoning. One semantics to rule them all. Approach Devise language-independent proof system that takes operational semantics “as is” and derives any reachability property (including Hoare triples).

Matching Logic (AMAST’10, ICSE’11, ICALP’12, FM’12, OOPSLA’12) Logic for reasoning about structure Matching logic: extend FOL with patterns Special predicates which are open configuration terms, whose meaning is “can you match me?” Examples of patterns: SUM

Reachability Rule Pair of patterns, with meaning “reachability” Reachability rules generalize both operational semantics rules and Hoare triples

Operational Semantics Rules are Reachability Rules Operational semantics rule is syntactic sugar for reachability rule We can associate a transition system to any set of reachability rules, and define validity; see paper

Hoare Triples are Reachability Rules Hoare triple is syntactic sugar for reachability rule … but there are better ways to specify program properties; see the paper

Reasoning about Reachability Having generalized the elements of both operational and axiomatic semantics, we now want a proof system for deriving reachability rules from reachability rules:

Reachability Proof System - 9 language-independent rules -

Rule 1 Reflexivity

Rule 2 Axiom

Rule 3 Substitution

Rule 4 Transitivity

Rule 5 Case Analysis

Rule 6 Logic Framing

Rule 7 Consequence

Rule 8 Abstraction

Rule 9 Circularity

Main Result Soundness Theorem: If derivable with the nine-rule proof system, then

Conclusion Proof system for reachability Works with any operational semantics, as is Requires no other semantics of the language Unlike Hoare logics, which are language-specific, our proof system is Language-independent (takes language as axioms) Proved sound only once, for all languages Has been implemented in MatchC and works Can change the way we do program verification