1 Simulator-Model Checker for Reactive Real-Time Abstract State Machines Anatol Slissenko University Paris 12 Pavel Vasilyev University Paris 12 University.

Slides:



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

CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
Intermediate Code Generation
Models of Concurrency Manna, Pnueli.
Satisfiability Modulo Theories (An introduction)
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Vered Gafni – Formal Development of Real Time Systems 1 Statecharts Semantics.
An Introduction to the Model Verifier verds Wenhui Zhang September 15 th, 2010.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
1 Compiler Construction Intermediate Code Generation.
Hybrid Systems Presented by: Arnab De Anand S. An Intuitive Introduction to Hybrid Systems Discrete program with an analog environment. What does it mean?
Timed Automata.
Programming Languages Marjan Sirjani 2 2. Language Design Issues Design to Run efficiently : early languages Easy to write correctly : new languages.
Compiler Construction
Faculty Of Computer Science Simon Fraser University Cmpt 880 presentation An Abstract Communication Model Uwe Glasser, Yuri Gurevich and Margus Veanes.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
A Semantic Characterization of Unbounded-Nondeterministic Abstract State Machines Andreas Glausch and Wolfgang Reisig 1.
Synthesis of Embedded Software Using Free-Choice Petri Nets.
1 Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications.
CSCE 121, Sec 200, 507, 508 Fall 2010 Prof. Jennifer L. Welch.
FunState – An Internal Design Representation for Codesign A model that enables representations of different types of system components. Mixture of functional.
SEQUENTIAL ABSTRACT STATE MACHINES CAPTURE SEQUENTIAL ALGORITHMS.
CSE S. Tanimoto Syntax and Types 1 Representation, Syntax, Paradigms, Types Representation Formal Syntax Paradigms Data Types Type Inference.
Operational Semantics Semantics with Applications Chapter 2 H. Nielson and F. Nielson
CS 267: Automated Verification Lecture 13: Bounded Model Checking Instructor: Tevfik Bultan.
Chapter 7Louden, Programming Languages1 Chapter 7 - Control I: Expressions and Statements "Control" is the general study of the semantics of execution.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
CSC 8310 Programming Languages Meeting 2 September 2/3, 2014.
Fundamentals of Python: From First Programs Through Data Structures
Fundamentals of Python: First Programs
Timed UML State Machines Ognyana Hristova Tutor: Priv.-Doz. Dr. Thomas Noll June, 2007.
Introduction to ASMs Dumitru Roman Digital Enterprise Research Institute
Math 002 College Algebra Final Exam Review.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
Unit III : Introduction To Data Structures and Analysis Of Algorithm 10/8/ Objective : 1.To understand primitive storage structures and types 2.To.
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
DECIDABILITY OF PRESBURGER ARITHMETIC USING FINITE AUTOMATA Presented by : Shubha Jain Reference : Paper by Alexandre Boudet and Hubert Comon.
1 Automatic Refinement and Vacuity Detection for Symbolic Trajectory Evaluation Orna Grumberg Technion Haifa, Israel Joint work with Rachel Tzoref.
1 Conditions Logical Expressions Selection Control Structures Chapter 5.
CS6133 Software Specification and Verification
Interpretation Environments and Evaluation. CS 354 Spring Translation Stages Lexical analysis (scanning) Parsing –Recognizing –Building parse tree.
Mr. Dave Clausen1 La Cañada High School Chapter 6: Repetition Statements.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
Unit-1 Introduction Prepared by: Prof. Harish I Rathod
Chapter 2: General Problem Solving Concepts
Chapter 7 Selection Dept of Computer Engineering Khon Kaen University.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 3, Lecture 1.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
1 Turing’s Thesis. 2 Turing’s thesis: Any computation carried out by mechanical means can be performed by a Turing Machine (1930)
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
This Week Lecture on relational semantics Exercises on logic and relations Labs on using Isabelle to do proofs.
Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications Chapter.
Tutorial 11 1 JavaScript Operators and Expressions.
Operational Semantics Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Overview of Compilation Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 2.
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
1 An SDL Tutorial Two primary elements: –Structure –Identifies the various components of the system, and the communication paths among them. –Components:
CS5270 Lecture 41 Timed Automata I CS 5270 Lecture 4.
LECTURE 10 Semantic Analysis. REVIEW So far, we’ve covered the following: Compilation methods: compilation vs. interpretation. The overall compilation.
CSE202: Introduction to Formal Languages and Automata Theory
From Classical Proof Theory to P vs. NP
Representation, Syntax, Paradigms, Types
CSCE Fall 2013 Prof. Jennifer L. Welch.
Lecture 15 (Notes by P. N. Hilfinger and R. Bodik)
Decidable Languages Costas Busch - LSU.
Representation, Syntax, Paradigms, Types
Representation, Syntax, Paradigms, Types
Defining A Formal Semantics For The Rosetta Specification Language
CSCE Fall 2012 Prof. Jennifer L. Welch.
Representation, Syntax, Paradigms, Types
Presentation transcript:

1 Simulator-Model Checker for Reactive Real-Time Abstract State Machines Anatol Slissenko University Paris 12 Pavel Vasilyev University Paris 12 University of St Petersburg, Russia

2 Contents Motivation Example Timed ASM. Two semantics. Non-determinism, properties Timed ASM syntax and semantics Simulation First Order Timed Logic Verification Conclusion

3 Motivation No simulators for real-time ASM Two different time semantics First Order Timed Logic (FOTL) to specify properties; `On-the-fly’ verification of FOTL-properties (Decidable classes are labor consuming)

4 Example. Token Passing. T is time (by default, non negative reals) P is a set of N processes Pass :  (P  {undef}) (input) Token : P  Bool function to control (output) A part of environment specification:  Pass is defined in isolated points;  the time distance between two consecutive signals lies in an interval [  0,  1 ], where 0 <  0 <  1 are abstract real constants;  two consecutive signals Pass have different values.

5 Requirements on functioning (Safety) At any time there are no two processes with a token. (Liveness1) At any time at least one process has a token. (Liveness2) The token changes its location within a duration that lies in a given interval (  0,  1 ). [More arithmetically complicated requirement: the average of the last 3 waiting times is in (  0,  1 ).

6 Initial values (at time instant 0): Pass = undef, Token(p 0 ) = true, forall q in P(q ≠ p 0  Token(q) = false), Last = 0, CT = 0 F= (d 0 ≤ (CT − a ∙ Last) ≤ d 1 ). forall p in P in parallel do if Pass ≠ undef and Token(p) then [Token(Pass) := F, Token(p) := ¬F, Last := CT] Token Passing Algorithm

7 Semantics of instantaneous actions 1 2 3

Semantics of delayed actions

9 Problems of simulation/verification: ● Continuous time (computing update instants) ● Verification of quantified formulas with arithmetics ● Resolving non-determinism ● Generation of inputs ● Representation of results

10 Example: ASM specification type Proc = Integer -> Boolean; var Token: Proc; var Last = 0: Time; var Pass: Integer; // external function var a, d1, d2: Float; // external functions Main() { while ( CT <= 10 ) do [ if ( Token(1) and (Pass != 1) ) then [ if ( a*Last+d1 <= CT <= a*Last+d2 ) then [ Token(Pass):=True; Token(1):=False; ] Last := CT; ] if ( Token(2) and (Pass != 2) ) then [ if ( a*Last+d1 <= CT <= a*Last+d2 ) then [ Token(Pass):=True; Token(2):=False; ] Last := CT; ] if ( Token(3) and (Pass != 3) ) then [ if ( a*Last+d1 <= CT <= a*Last+d2 ) then [ Token(Pass):=True; Token(3):=False; ] Last := CT; ] ] }

11 Example: external functions, Pass // Textual definition of the Pass function // It defines the next process in the queue Pass := (0, 0; 1, 4; 2, 1; 3, 2; 4, 3)

12 Instantaneous updates The Token function changes after the Pass input function.

13 Example: external functions, coefficient // Textual definition of the coefficient a := (0, 0.8; 2, 1.5; 4, 1.8)

14 Example: external functions, delay interval // Textual definition of the delay intervals (d1, d2) d1 := (0, 0.3; 1, 0.7; 2, 0.2; 3, 0.4; 4, 0.5) d2 := (0, 1.2; 1, 1.3; 2, 1.5; 3, 1.4; 4, 1.7)

15 Timed ASM ASM = basic Gurevich abstract state machine; Timed ASM = (Vocabulary, InitialState, Program) Vocabulary consists of Sorts, Functions, Predicates. R, Z, N, Boolean, Undef, Time=R + sorts are predefined. InitialState defines the initial state of the ASM. Program specifies the updates i.e. the transitions between the states.

16 Functions Functions can be divided into internal and external or static and dynamic. A special function CT is predefined and is nullary function that returns the current time. Dynamic & external functions (i.e. inputs) are defined separately from the program.

17 Delays The updates in ASM are designed as instantaneous; We add a bounded delay which is defined in a special configuration file; We consider two semantics: there are no delays, there are finite delays.

18 Example: the delay between Pass & Token This example shows the delay between the values of the external function Pass and the internal function Token. Here we show a case where one of the values of Pass function is missed due to a big delay.

19 Non-determinisms The first (last) element of a tuple; The minimal (max) element (if order is defined); A random element; An element which was not used in the previous non-determinism resolution. Non-determinisms occur if we use the choose statement. It can be resolved in different ways.

20 Timed ASM Syntax Sequential block: { P 1 P 2 … P n }; Parallel block: [ P 1 P 2 … P n ]; foreach u in U where b(u) do S; choose u in U where b(u) do S; forall x in X holds F(x); exists y in Y where H(y);

21 Timed ASM Semantics Sequential execution: All updates executed in the orders of appearance. Time is incremented by the corresponding delay. Block of parallel operations: Some conflicts may appear. Inconsistency is checked. The greatest of the delays is chosen. Looped parallel block: Each cycle is like a block of parallel operations. Time jumps are possible to avoid an infinite loop.

22 Timed ASM Semantics: no delays In this example the machine enters two parallel branches with values x=2, y=0. Each branch contains two sequential updates. After the instantaneous execution of each branch we get two sets of updated values. For the left branch we get x=7, y=7. For the right branch we get x=3, y=3. These sets are inconsistent, so the run is undefined. x := 3; x := y;y := x; y := 7; x=2 y=0 INCONSISTENCY

23 Timed ASM Semantics: no delays In this case the run is formally defined, but one shouldn’t write such programs. In each branch a product of x and y is calculated. But it gives different results. However, there is no contradiction. x := 3; x := x*y;y := y*x; y := 2; x=2 y=0 x=0 y=4 BAD STYLE

24 Timed ASM Semantics: nonzero delays The result of parallel execution of updates can be different as we can read the updated values in a parallel branch. In this example if we get t 1 t 2 then we get x=6, y=12. If t 1 = t 2 then we get x=6, y=6. x=6 y=6 or x=18 y=6 or x=6 y=12 BAD STYLE x:=3; x:=x*y; y:=y*x; y:=2; x=2 y=0 t t t t t

25 Timed ASM Semantics: nonzero delays This example can be interpreted correctly when there are nonzero delays. But it contains two potentially simultaneous updates in different parallel branches which can be contradictory. Therefore, this example is also considered as inconsistent by the simulator. x=7 y=3 or x=7 y=7 or x=3 y=3 x := 3; x := y;y := x; y := 7; x=2 y=0 INCONSISTENCY

26 Simulation Start from the Main() method as a top-level entry point; Calculation of the next time point in which at least one guard is true; State update, which is represented by one or more statement blocks; Evaluation of constraints before and after the state update.

27 This part is implemented. Demonstration will follow the presentation.

28 Example: properties in FOTL Safety property in textual syntax: forall t in Time holds forall p, q in Integer holds ( p != q & Token`(t, p) ==> !Token`(t, q) ) Liveness property in textual syntax: forall t in Time holds exists p in Integer where ( Token`(t, p) ) Safety: Liveness:

29 First Order Timed Logic The FOTL is based on the theory of mixed real/integer addition with rational constants and unary multiplications by rational numbers. This theory is known to be decidable. FOTL itself is clearly undecidable. Among discrete (non negative integers) and continuous (non negative reals) time we choose the case of continuous time.

30 FOTL Syntax The vocabulary of FOTL consists of finite sets of sorts, function symbols and predicate symbols. Some of them have a fixed interpretation (pre-interpreted): - Sorts: integers (Z), reals (R), the time sort T, etc. - Functions: +, -, * for real numbers. - Predicates: =, ≤, < over real numbers. The vocabulary of FOTL contains equality for all types of objects and a CT° function to work the time. Abstract functions: T × X  Y Abstract predicates: T × X  Bool

31 Verification

32 Implemented features Lexical and syntactical analysis with building a parse tree; Loading definitions of external functions and the simulation parameters from a file; Simulation of most constructs and operations of Timed ASM Language; Simulation results output with the history of all state changes.

33 Future Work Finish the verification feature (abstract functions elimination, quantifier elimination, simplification); Add non-deterministic bounded delays; Languages for generation of inputs and resolution of non-determinisms; Enrich ASM syntax (e.g. multi-agent ASM).

34 Thank you