Overview of the KeY System

Similar documents
From OCL to Propositional and First-order Logic: Part I

The KeY System 1.0 (Deduction Component)

From OCL to Typed First-order Logic

Seminar: Specification and Verification of Object-oriented Software. The KeY Tool

The University of Iowa. 22c181: Formal Methods in Software Engineering. Spring Course Overview

Typed First-order Logic

Verifying Object-Oriented Programs with KeY: A Tutorial

Verifying Java Programs Verifying Java Programs with KeY

JML tool-supported specification for Java Erik Poll Radboud University Nijmegen

Static program checking and verification

Towards Combined Static and Runtime Verification of Distributed Software

Formal Specification and Verification

Verifying Java Programs Verifying Java Programs with KeY

Verifying Java Programs with KeY

KeY Quicktour. 1 Introduction/Prerequisites Version Information Logical Foundations The KeY-Prover... 2

Fundamentals of Software Engineering

Fundamentals of Software Engineering

Handling Integer Arithmetic in the Verification of Java Programs

A Short Introduction to First-Order Theorem Proving with KeY

Cover Page. The handle holds various files of this Leiden University dissertation

Formal Verification. Lecture 10

Java Modelling Language (JML) References

Verifying Safety Property of Lustre Programs: Temporal Induction

Towards a GUI for Program Verification with KeY. Master of Science Thesis in the Programme Software Engineering and Technology

Fundamentals of Software Engineering

Proof Carrying Code(PCC)

Theorem proving. PVS theorem prover. Hoare style verification PVS. More on embeddings. What if. Abhik Roychoudhury CS 6214

Fundamentals of Software Engineering

Chapter 1 Quo Vadis Formal Verification?

Part II. Hoare Logic and Program Verification. Why specify programs? Specification and Verification. Code Verification. Why verify programs?

Specification and Analysis of Contracts Tutorial

The rcos Modeler. ICTAC Summer School 2013 ECNU, Shanghai, China. Volker Stolz, Zhiming Liu. Friday, August 30, 13

Program Verification (6EC version only)

Specifying JAVACARD API in OCL

22c:181 / 55:181 Formal Methods in Software Engineering

Advances in Programming Languages

The University of Iowa Fall CS:5810 Formal Methods in Software Engineering. Introduction

Specification of a transacted memory for smart cards in Java and JML

Introduction to JML David Cok, Joe Kiniry, and Erik Poll Eastman Kodak Company, University College Dublin, and Radboud University Nijmegen

A Pratical Application of the Object Constraint Language OCL

Lecture 11 Lecture 11 Nov 5, 2014

Software Engineering using Formal Methods

Advances in Programming Languages

A Solution Based on Modeling and Code Generation for Embedded Control System

KeY Quicktour for JML

Distributed Systems Programming (F21DS1) Formal Verification

Model driven Engineering & Model driven Architecture

Front-end Technologies for Formal-Methods Tools

Advances in Programming Languages

Verifying Java Programs. Verifying Java Programs. The Krakatoa/Why Tool Suite

Verifying Java Programs

OCL parsing / type checking in the context of GF and KeY. Kristofer Johannisson

Static analysis and testing of executable DSL specification

Language engineering and Domain Specific Languages

15-819M: Data, Code, Decisions

22c:111 Programming Language Concepts. Fall Syntax III

FreePascal changes: user documentation

CSC Advanced Object Oriented Programming, Spring Specification

From Hoare Logic to Matching Logic Reachability. Grigore Rosu and Andrei Stefanescu University of Illinois, USA

Plan. Language engineering and Domain Specific Languages. Language designer defines syntax. How to define language

COP4020 Programming Languages. Compilers and Interpreters Robert van Engelen & Chris Lacher

A Formalism for Automated Verification of Model Transformations

Reasoning About Loops Using Vampire

ESC/Java 2. Checker for Java 2. Extended. Static. B y K ats man Andrey S oftware E ngineering S em inar

Advances in Programming Languages

Testing, Debugging, Program Verification

In Our Last Exciting Episode

Transforming UML Collaborating Statecharts for Verification and Simulation

An Approach to the Generation of High-Assurance Java Card Applets

FAKULTÄT FÜR INFORMATIK

Grammars. Prof. Andreas Prinz. Introduction, Compilers. Examples Meta-models vs. Grammars Summary

Lecture 09. Ada to Software Engineering. Mr. Mubashir Ali Lecturer (Dept. of Computer Science)

Specification-based Testing of Embedded Systems H. Schlingloff, SEFM 2008

The Eclipse Modeling Framework and MDA Status and Opportunities

K and Matching Logic

Teaching and Training Formal Methods for Safety Critical Systems

SIMULATION : TRANSACTIONS OF THE MODELING AND SIMULATION SOCIETY, VOL. XX, NO. Y, MONTH

Proofs and Proof Certification in the TLA + Proof System

PragmaDev. change request. Emmanuel Gaudin. PragmaDev ITU-T SG17 change request Grimstad June 24,

Improving the Definition of UML

Self-Controlling Architecture Structured Agents

Compositional Model Based Software Development

A Logic of Proofs for Differential Dynamic Logic

Outline. Introduction SDV Motivation Model vs Real Implementation SLIC SDVRP SLAM-2 Comparisons Conclusions

Lectures 20, 21: Axiomatic Semantics

Formally Certified Satisfiability Solving

Overview of SRI s. Lee Pike. June 3, 2005 Overview of SRI s. Symbolic Analysis Laboratory (SAL) Lee Pike

Java Bytecode Specification and Verification

Formal Methods for Java

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

Reading part: Design-Space Exploration with Alloy

Chapter 3 (part 3) Describing Syntax and Semantics

Research Paper on Implementation of OCL Constraints in JAVA

Runtime Checking for Program Verification Systems

What if current foundations of mathematics are inconsistent? Vladimir Voevodsky September 25, 2010

Model-Driven QoS Provisioning Techniques for CCM DRE Systems

Verification and Validation

Verification and Validation

Compilers. Lecture 2 Overview. (original slides by Sam

Logik für Informatiker Logic for computer scientists

Transcription:

22c181: Formal Methods in Software Engineering The University of Iowa Spring 2008 Overview of the KeY System Copyright 2007-8 Reiner Hähnle and Cesare Tinelli. Notes originally developed by Reiner Hähnle at Chalmers University and modified by Cesare Tinelli at the University of Iowa. These notes are copyrighted materials and may not be used in other course settings outside of the University of Iowa in their current form or modified form without the express written permission of one of the copyright holders. 22c181: Formal Methods in Software Engineering p.1

Contents of Second Part of Course Overview of KeY UML and its semantics Introduction to OCL Specifying requirements with OCL Modelling of Systems with Formal Semantics Propositional & First-order logic, sequent calculus OCL to Logic, horizontal proof obligations, using KeY Dynamic logic, proving program correctness Java Card DL Vertical proof obligations, using KeY Wrap-up, trends 22c181: Formal Methods in Software Engineering p.2

Philosophy of KeY Tool Formal Methods must and can be integrated into commercial processes, tools and languages for software development 22c181: Formal Methods in Software Engineering p.3

Philosophy of KeY Tool Formal Methods must and can be integrated into commercial processes, tools and languages for software development Integrated tool for Modeling Development Formal specification Formal verification of object oriented programs 22c181: Formal Methods in Software Engineering p.3

Technologies Used in this Course Standard language for Modeling of Software Unified Modeling Language UML (Borland Together) Visual language for OO Modeling Standard of Object Management Group (OMG) Object Constraint Language OCL Formal textual language for requirements specification UML sub-standard Modern industrial programming language Logic, Automated Deduction First-order logic, Dynamic Logic, Theorem proving 22c181: Formal Methods in Software Engineering p.4

Other Interfaces KeY plugin for Eclipse IDE Java Modeling Language JML Formal Interface Specification Language for Java Wide-spread in academic projects Automatic Translation from OCL into English To come soon: Visual symbolic debugger based on symbolic program execution 22c181: Formal Methods in Software Engineering p.5

The KeY System Lightweight Usage of Formal Methods FM expert Logic xpgwizard g English OCL/UML gjml g Logic gtaclets g Borland Together CC Eclipse IDE OCL/NL Tool KeY Plugin KeY Plugin JML Browser OCL/FOL Translation JML/FOL Translation Synthesis of Proof Obligations Rule Base KeY Prover a 22c181: Formal Methods in Software Engineering p.6

The KeY System UML Design, Java Coding Lightweight Usage of Formal Methods FM expert Logic xpgwizard g English OCL/UML gjml g Logic gtaclets g Borland Together CC Eclipse IDE OCL/NL Tool KeY Plugin KeY Plugin JML Browser OCL/FOL Translation JML/FOL Translation Synthesis of Proof Obligations Rule Base KeY Prover a 22c181: Formal Methods in Software Engineering p.6

Target Language: Java Card 22c181: Formal Methods in Software Engineering p.7

Target Language: Java Card Java Card Sun s Java dialect for smart cards and embedded systems 22c181: Formal Methods in Software Engineering p.7

Target Language: Java Card Java Card Sun s Java dialect for smart cards and embedded systems Java Card is relevant target language for verification: Restrictions admit complete coverage (more later) Applications smallish Feasability 22c181: Formal Methods in Software Engineering p.7

Target Language: Java Card Java Card Sun s Java dialect for smart cards and embedded systems Java Card is relevant target language for verification: Restrictions admit complete coverage (more later) Applications smallish Applications safety & security critical Often impossible to update smart cards/embedded systems Feasability Significance 22c181: Formal Methods in Software Engineering p.7

How Works 22c181: Formal Methods in Software Engineering p.8

Conventional CASE-Based Development UML Model 22c181: Formal Methods in Software Engineering p.8

Conventional CASE-Based Development UML Model CASE Tool (partial implementation) 22c181: Formal Methods in Software Engineering p.8

Conventional CASE-Based Development UML Model CASE Tool (partial implementation) 22c181: Formal Methods in Software Engineering p.8

The KeY System Lightweight Usage of Formal Methods FM expert Logic xpgwizard g English OCL/UML gjml g Logic gtaclets g Borland Together CC Eclipse IDE OCL/NL Tool KeY Plugin KeY Plugin JML Browser OCL/FOL Translation JML/FOL Translation Synthesis of Proof Obligations Rule Base KeY Prover a 22c181: Formal Methods in Software Engineering p.9

The KeY System Formal Specification Lightweight Usage of Formal Methods FM expert Logic xpgwizard g English OCL/UML gjml g Logic gtaclets g Borland Together CC Eclipse IDE OCL/NL Tool KeY Plugin KeY Plugin JML Browser OCL/FOL Translation JML/FOL Translation Synthesis of Proof Obligations Rule Base KeY Prover a 22c181: Formal Methods in Software Engineering p.9

Specification Language: OCL UML has textual specification language as sub-standard: Object Constraint Language (OCL) OOP-like syntax, ASCII designed for easy navigation within UML class diagrams, etc. strongly typed formal semantics: translation to typed FOL OCL expressions reduce legal instances of underlying UML diagram Class invariants Pre-/postconditions of operations and methods Permits formal specification of functional requirements Other specification languages: Alloy, JML, RSL,... 22c181: Formal Methods in Software Engineering p.10

Formal Specification in OCL UML Model CASE Tool (partial implementation) OCL 22c181: Formal Methods in Software Engineering p.11

Parsing OCL UML Model CASE Tool (partial implementation) AST OCL OCL Parser Univ Dresden 22c181: Formal Methods in Software Engineering p.11

Parsing OCL UML Model CASE Tool (partial implementation) XML API AST OCL OCL Parser Univ Dresden 22c181: Formal Methods in Software Engineering p.11

Where to Take Formal Specification from? UML Model CASE Tool (partial implementation)? XML API AST OCL OCL Parser Univ Dresden 22c181: Formal Methods in Software Engineering p.11

(Library of Patterns and Idioms) UML Model Patterns/Idioms CASE Tool (partial implementation) XML API AST OCL OCL Parser Univ Dresden 22c181: Formal Methods in Software Engineering p.12

( OCL Library) UML Model Patterns/Idioms CASE Tool (partial implementation) OCL (partial specification) XML API AST OCL OCL Parser Univ Dresden 22c181: Formal Methods in Software Engineering p.12

The KeY System Lightweight Usage of Formal Methods FM expert Logic xpgwizard g English OCL/UML gjml g Logic gtaclets g Borland Together CC Eclipse IDE OCL/NL Tool KeY Plugin KeY Plugin JML Browser OCL/FOL Translation JML/FOL Translation Synthesis of Proof Obligations Rule Base KeY Prover a 22c181: Formal Methods in Software Engineering p.13

The KeY System Verification Lightweight Usage of Formal Methods FM expert Logic xpgwizard g English OCL/UML gjml g Logic gtaclets g Borland Together CC Eclipse IDE OCL/NL Tool KeY Plugin KeY Plugin JML Browser OCL/FOL Translation JML/FOL Translation Synthesis of Proof Obligations Rule Base KeY Prover a 22c181: Formal Methods in Software Engineering p.13

Tasks of Verification Component 22c181: Formal Methods in Software Engineering p.14

Tasks of Verification Component Translation OCL logic Need to simplify resulting formulas 22c181: Formal Methods in Software Engineering p.14

Tasks of Verification Component Translation OCL logic Synthesize FOL formulas from horizontal verification tasks Eg, structural subtyping 22c181: Formal Methods in Software Engineering p.14

Tasks of Verification Component Translation OCL logic Synthesize FOL formulas from horizontal verification tasks Synthesize Java Card DL formulas from vertical verification tasks Eg, method invariants, total correctness 22c181: Formal Methods in Software Engineering p.14

Tasks of Verification Component Translation OCL logic Synthesize FOL formulas from horizontal verification tasks Synthesize Java Card DL formulas from vertical verification tasks Driving the deduction component 22c181: Formal Methods in Software Engineering p.14

Tasks of Verification Component Translation OCL logic Synthesize FOL formulas from horizontal verification tasks Synthesize Java Card DL formulas from vertical verification tasks Driving the deduction component Correctness management 22c181: Formal Methods in Software Engineering p.14

Translation, Horizontal Verification UML Model Patterns/Idioms CASE Tool (partial implementation) OCL (partial specification) XML API First order logic AST OCL OCL Parser Univ Dresden Translation formula synthesis (horiz. verif.) 22c181: Formal Methods in Software Engineering p.15

Parsing Java UML Model Patterns/Idioms CASE Tool (partial implementation) OCL (partial specification) RecodeR Univ Karlsruhe AST XML API First order logic AST OCL OCL Parser Univ Dresden Translation formula synthesis (horiz. verif.) 22c181: Formal Methods in Software Engineering p.15

Translation, Vertical Verification UML Model Patterns/Idioms CASE Tool (partial implementation) OCL (partial specification) RecodeR Univ Karlsruhe AST XML API Java Card DL AST OCL OCL Parser Univ Dresden Translation formula synthesis (vert. verif.) 22c181: Formal Methods in Software Engineering p.15

Deductive Verification UML Model Patterns/Idioms CASE Tool (partial implementation) OCL (partial specification) RecodeR Univ Karlsruhe AST XML API Java Card DL AST OCL OCL Parser Univ Dresden Translation formula synthesis (vert. verif.) Formal proof Interactive/Automated Theorem Prover 22c181: Formal Methods in Software Engineering p.15

The KeY System Lightweight Usage of Formal Methods FM expert Logic xpgwizard g English OCL/UML gjml g Logic gtaclets g Borland Together CC Eclipse IDE OCL/NL Tool KeY Plugin KeY Plugin JML Browser OCL/FOL Translation JML/FOL Translation Synthesis of Proof Obligations Rule Base KeY Prover a 22c181: Formal Methods in Software Engineering p.16

The KeY System Proving Lightweight Usage of Formal Methods FM expert Logic xpgwizard g English OCL/UML gjml g Logic gtaclets g Borland Together CC Eclipse IDE OCL/NL Tool KeY Plugin KeY Plugin JML Browser OCL/FOL Translation JML/FOL Translation Synthesis of Proof Obligations Rule Base KeY Prover a 22c181: Formal Methods in Software Engineering p.16

The Program Logic: Dynamic Logic Syntax Modal operators [p] and p for each program p Statements about final state of p 22c181: Formal Methods in Software Engineering p.17

The Program Logic: Dynamic Logic Syntax Modal operators [p] and p for each program p Statements about final state of p Semantics [p] F : If p terminates normally, then F holds in the final state (partial correctness) p F: p terminates normally and F holds in the final state (total correctness) 22c181: Formal Methods in Software Engineering p.17

Java vs. Java Card Java features that are not present in Java Card 22c181: Formal Methods in Software Engineering p.18

Java vs. Java Card Java features that are not present in Java Card Threads unrestricted concurrency 22c181: Formal Methods in Software Engineering p.18

Java vs. Java Card Java features that are not present in Java Card Threads unrestricted concurrency Floating point arithmetic IEEE standard 754 is huge... 22c181: Formal Methods in Software Engineering p.18

Java vs. Java Card Java features that are not present in Java Card Threads unrestricted concurrency Floating point arithmetic IEEE standard 754 is huge... Dynamic class loading Implementation must be known before verification 22c181: Formal Methods in Software Engineering p.18

Java vs. Java Card Java features that are not present in Java Card Threads unrestricted concurrency Floating point arithmetic IEEE standard 754 is huge... Dynamic class loading Implementation must be known before verification Graphical/buffered I/O formal specification Swing classes? 22c181: Formal Methods in Software Engineering p.18

Java vs. Java Card Java features that are not present in Java Card Threads unrestricted concurrency Floating point arithmetic IEEE standard 754 is huge... Dynamic class loading Implementation must be known before verification Graphical/buffered I/O formal specification Swing classes? 22c181: Formal Methods in Software Engineering p.18