10.6.2008 Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.

Slides:



Advertisements
Similar presentations
Formal Methods of Systems Specification Logical Specification of Hard- and Software Dr. Armin Wolf Fraunhofer Institut für Rechnerarchitektur.
Advertisements

Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer Institut.
Semantics Static semantics Dynamic semantics attribute grammars
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.
August Moscow meeting1August Moscow meeting1August Moscow meeting11 Deductive tools in insertion modeling verification A.Letichevsky.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
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.
Copyright © 2006 Addison-Wesley. All rights reserved. 3.5 Dynamic Semantics Meanings of expressions, statements, and program units Static semantics – type.
Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer Institut.
Fall Semantics Juan Carlos Guzmán CS 3123 Programming Languages Concepts Southern Polytechnic State University.
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.
Weakest pre-conditions and towards machine consistency Saima Zareen.
CS 355 – Programming Languages
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
Knowledge and Systems Research Group, University of Huddersfield B vs OCL: Comparing Specification Languages for Planning Domains Diane Kitchin, Lee McCluskey,
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Fundamentals (Chapter 4) Axiomatic Semantics ICS 535.
Describing Syntax and Semantics
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
Software Verification 2 Automated Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität and Fraunhofer Institut für.
Chapter 25 Formal Methods Formal methods Specify program using math Develop program using math Prove program matches specification using.
Low-Level Detailed Design SAD (Soft Arch Design) Mid-level Detailed Design Low-Level Detailed Design Design Finalization Design Document.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
CS 363 Comparative Programming Languages Semantics.
Formal Verification Lecture 9. Formal Verification Formal verification relies on Descriptions of the properties or requirements Descriptions of systems.
1 OCL The Role of OCL in UML. 2 רשימת הנושאים  מבוא  מרכיבי השפה  דוגמאות  מקורות.
Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer Institut.
Verification of behavioural elements of UML models using B Truong, Ninh-Thuan and Souquieres, Jeanine In Proceedings of the 2005 ACM Symposium on.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Chapter 5: Sequences, Mathematical Induction, and Recursion 5.5 Application: Correctness of Algorithms 1 [P]rogramming reliability – must be an activity.
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.
Software Verification 2 Automated Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität and Fraunhofer Institut für.
COP4020 Programming Languages Introduction to Axiomatic Semantics Prof. Robert van Engelen.
Software Engineering 2 -Prakash Shrestha.
Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer Institut.
ANU COMP2110 Software Design in 2003 Lecture 10Slide 1 COMP2110 Software Design in 2004 Lecture 12 Documenting Detailed Design How to write down detailed.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
Andrey Karaulov, Alexander Strabykin Institute for System Programming Russian Academy of Sciences SYRCoSE: Spring Young Researchers Colloquium on Software.
Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer Institut.
Software Verification 2 Automated Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität and Fraunhofer Institut für.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
C HAPTER 3 Describing Syntax and Semantics. D YNAMIC S EMANTICS Describing syntax is relatively simple There is no single widely acceptable notation or.
Interpreting the Object Constraint Presented by: Ed Kausmeyer.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
A UML-Based Pattern Specification Technique Presented by Chin-Yi Tsai IEEE TRANSACTION ON SOFTWARE ENGINEERING, VOL. 30, NO. 3, MARCH 2004 Robert B. France,
Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer Institut.
Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer.
© Bertrand Meyer and Yishai Feldman Notice Some of the material is taken from Object-Oriented Software Construction, 2nd edition, by Bertrand Meyer (Prentice.
SS 2017 Software Verification Bounded Model Checking, Outlook
B (The language of B-Method )
SS 2018 Software Verification ML, state machines
Software Verification 2 Automated Verification
Programming Languages 2nd edition Tucker and Noonan
Software Verification 2 Automated Verification
Semantics In Text: Chapter 3.
Programming Languages and Compilers (CS 421)
Programming Languages 2nd edition Tucker and Noonan
COP4020 Programming Languages
Presentation transcript:

Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität and Fraunhofer Institut für Rechnerarchitektur und Softwaretechnik

Slide 2 H. Schlingloff, Logical Specification B-method Aiming at program development and proof  refinement, implementation, code generation  generalized substitution Substitution is written in prefix notation  [x:=t]  instead of  [x:=t]  [x:=2](x  5) is (2  5), a true statement Program specification  admissible starting states specified by formula , desired final states specified by formula   a program is a generalized substitution  such that (  [  ]  )

Slide 3 H. Schlingloff, Logical Specification Basic Structure of an Abstract Machine MACHINE Name (Parameters) VARIABLES list of variables INVARIANT invariant predicate  INITIALISATION initialization substitution  init OPERATIONS outputs  name(inputs) ≙ substitution  END Proof obligations  The machine shall initiate in a valid state: [  init ]   The operations shall preserve the invariant - (     [  ]  ), where  is the pre-condition of the operation, and  is the substitution of the operation

Slide 4 H. Schlingloff, Logical Specification Generalized Substitutions [  1 ;  2 ]  is [  2 ][  1 ]  [  1 ||  2 ]  is [  1 ][  2 ]  (disjoint sets of variables) [x,y:=s,t]  is [tmp:=t][x:=s][y:=tmp]  [IF  THEN  1 ELSE  2 END]  is ((  [  1 ]  )  (¬  [  2 ]  )) [SELECT  1 THEN  1 WHEN  2 THEN  2 END]  is ((  1  [  1 ]  )  (  2  [  2 ]  )) [SKIP]  is  [ANY x WHERE  THEN  END]  is  x (  [  ]  ) [CHOICE  1 OR  2 END]  is ([  1 ]   [  2 ]  ) [PRE  THEN  END]  is (   [  ]  ) …

Slide 5 H. Schlingloff, Logical Specification Modularization An abstract B machine can  USE  SEE  INCLUDE  PROMOTE  EXTEND other abstract machines That way, it is possible to build complex libraries of abstract machines Rich libraries are available for most basic types

Slide 6 H. Schlingloff, Logical Specification Refinement Program transformation  A step from specification to implementation  Elimination of nondeterminism  Making a design decision  Concretizing data types and operations  Preserving interfaces, transparent to the outside Two kinds of refinement  Data refinement  Operation refinement

Slide 7 H. Schlingloff, Logical Specification Refinement Relation Mapping between concrete and abstract variables (keyword REFINES)  same signature of operations (name, params, result)  additional variables possible Compatibility constraints  initialization and operations must be compatible  weaker pre-condition, stronger post-condition: - the concrete operations shall be possible whenever the corresponding specification is possible - the values established by the concrete initialization and operations shall be mapped, by the refinement relation, to a subset of those established in the specification

Slide 8 H. Schlingloff, Logical Specification Example 1

Slide 9 H. Schlingloff, Logical Specification Example 2

Slide 10 H. Schlingloff, Logical Specification Refinement proof pattern  being a substitution,  a predicate:  [  ]  states that all executions of  establish   ¬[  ]¬  states that there exists an execution of  establishing . (     [  ]  ) Let  be the refinement relation,  M a substitution on the abstract state,  R a substitution on the concrete state, the formula [  R ]¬[  M ]¬  states that all executions of the concrete substitution  R establish that there exists an execution of the abstract substitution  M establishing  Proof obligation: The abstract and concrete invariant imply this condition

Slide 11 H. Schlingloff, Logical Specification Implementation in B Implementation is a special case of refinement An implementation is a deterministic specification which can be translated into some programming language Implementation uses sequencing, loops, and other special substitutions Implementation uses library machines for basic data types (boolean, real, set, array, …)

Slide 12 H. Schlingloff, Logical Specification Loops Syntax WHILE T : formula DO B : substitution VARIANT V : expression INVARIANT I : formula END The loop variant states the maximum number of times that the body will be executed (used to prove loop termination) The loop invariant is a formula that shall be valid each time the control condition is evaluated (used to prove termination and post-condition)

Slide 13 H. Schlingloff, Logical Specification Semantics of Loops Denotational: least fixpoint of predicate transformer Operational: by proof obligations

Slide 14 H. Schlingloff, Logical Specification Example proof

Slide 15 H. Schlingloff, Logical Specification Tool support for B Basic features  syntax checker  type checker  interactive and semi-automated proof  code synthesis Advanced features  graphical interaction  project management Atelier B, B-Toolkit, ProB animator, StudioB, B4free / Click‘n‘Prove, Brama

Slide 16 H. Schlingloff, Logical Specification OCL Object constraint language Part of UML Specifies constraints on model elements  „A constraint is a restriction on one or more values of (part of) an object-oriented model or system“ Different kinds of constraints  invariant - a constraint that must always be met by all instances of a class  precondition of an operation - a constraint that must always be true before the execution of the operation  postcondition of an operation - a constraint that must always be true after the execution of the operation  guard of a transition – a constraint that must be met before a state transition fires

Slide 17 H. Schlingloff, Logical Specification Semantics of UML 2 13 diagram types Common meta-model Instances (objects) can occur in several diagrams, different views onto the same thing A structure diagram, e.g. a class, defines a collection of objects with similar properties, attributes and methods  signature A behavioural diagram, e.g. a statechart, defines a collection of behaviours of objects  change of model in time