Introduction to ASMs Dumitru Roman Digital Enterprise Research Institute

Slides:



Advertisements
Similar presentations
Abstract State Machines, and lessons of an ASM-based project at Microsoft Yuri Gurevich ( Erdos #2 ) Microsoft Research.
Advertisements

Semantics Static semantics Dynamic semantics attribute grammars
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Timed Automata.
1 Introducing ASML ASML version 2, “Steps and Updates ” Lecture 9 Software Engineering COMP201.
August Moscow meeting1August Moscow meeting1August Moscow meeting11 Deductive tools in insertion modeling verification A.Letichevsky.
ISBN Chapter 3 Describing Syntax and Semantics.
CS 355 – Programming Languages
1 Simulator-Model Checker for Reactive Real-Time Abstract State Machines Anatol Slissenko University Paris 12 Pavel Vasilyev University Paris 12 University.
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.
Comp 205: Comparative Programming Languages Semantics of Imperative Programming Languages denotational semantics operational semantics logical semantics.
Formal Specification - Techniques for the unambiguous specification of software Objectives: To explain why formal specification techniques help discover.
A Semantic Characterization of Unbounded-Nondeterministic Abstract State Machines Andreas Glausch and Wolfgang Reisig 1.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 4 – Introducing Algorithms, Pseudocode and.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
Chapter 2: Algorithm Discovery and Design
Program Design and Development
SEQUENTIAL ABSTRACT STATE MACHINES CAPTURE SEQUENTIAL ALGORITHMS.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
Describing Syntax and Semantics
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
Chapter 1 Program Design
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
Chapter 2: Algorithm Discovery and Design
Chapter 2: Algorithm Discovery and Design
11 Chapter 4 LOOPS AND FILES. 22 THE INCREMENT AND DECREMENT OPERATORS To increment a variable means to increase its value by one. To decrement a variable.
Fundamentals of Python: From First Programs Through Data Structures
Abstract State Machines and Computationally Complete Query Languages Andreas Blass,U Michigan Yuri Gurevich,Microsoft Research & U Michigan Jan Van den.
Fundamentals of Python: First Programs
Chapter 2: Algorithm Discovery and Design Invitation to Computer Science, C++ Version, Third Edition.
Invitation to Computer Science, Java Version, Second Edition.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 CST 221 OBJECT ORIENTED PROGRAMMING(OOP) ( 2 CREDITS.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 4: Control Structures I (Selection)
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 4: Control Structures I (Selection)
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
1 Generating FSMs from Abstract State Machines Wolfgang Grieskamp Yuri Gurevich Wolfram Schulte Margus Veanes Foundations of Software Engineering Microsoft.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 4: Control Structures I (Selection)
Semantics. Semantics is a precise definition of the meaning of a syntactically and type-wise correct program. Ideas of meaning: –Operational Semantics.
Muhammad Idrees Lecturer University of Lahore 1. Outline Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax Attribute.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
Algorithm Design.
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
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.
Data Structures and Algorithms Dr. Tehseen Zia Assistant Professor Dept. Computer Science and IT University of Sargodha Lecture 1.
Semantics (1).
Ukrprog Formal requirement language and its applications A.Letichevsky Glushkov Institute of Cybernetics.
Finite State Machines (FSM) OR Finite State Automation (FSA) - are models of the behaviors of a system or a complex object, with a limited number of defined.
Programming Languages Programming languages are a compromise between spoken language and formal math. They allow humans to communicate with computers at.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Chapter 2 Scanning. Dr.Manal AbdulazizCS463 Ch22 The Scanning Process Lexical analysis or scanning has the task of reading the source program as a file.
Operational Semantics Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Chapter 2: Algorithm Discovery and Design Invitation to Computer Science.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
| MSC 8102:PROGRAMMING CONCEPTS By Vincent Omwenga, PhD. 1.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 8 Semantic Interpretation To understand a.
1 Sections 3.1 – 3.2a Basic Syntax and Semantics Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Fundamentals of Programming I Overview of Programming
Describing Syntax and Semantics
Chapter 4: Control Structures I (Selection)
Formal Specifications
Chapter 7 Expressions and Assignment Statements.
Copyright © Cengage Learning. All rights reserved.
Presentation transcript:

Introduction to ASMs Dumitru Roman Digital Enterprise Research Institute

2 Outline ASMs Characteristics ASMs Definition –Abstract States –Abstract Instructions for Changing States AsmL: an ASM engine –An example DASMs for formalizing BPEL4WS

ASMs overview A practical method for rigorous system development which has been used successfully under industrial constraints for design and analysis of complex hardware/software systems. Formalism for modelling/formalising algorithms Previously known as Evolving algebras An attempt to bridge the gap between formal models of computation and practical specification methods. ASM Model Informal specification of the hardware/software system Implementation of the system (C, Java, etc) Modeling What System are you building? Validation Are you building the right system? Refinement Verification Are you building the system right?

ASM methodology characteristics Precision: ASMs use classical mathematical structures that are well-understood Faithfulness: ASMs require a minimal amount of notational coding Understandability: ASMs use an extremely simple syntax, which can be read as a form of pseudo-code Executablity: ASMs can be tested by executing them Scalability: ASMs can describe a system/algorithm on different levels of abstraction Generality: ASMs have been shown to be useful in many different application domains

Abstract States (1) States can be viewed as (first-order) structures of mathematical logic Structures - syntax –A vocabulary contains: A finite collection of function names, each of a fixed arity The equality sign, and nullary names true, false, undef, and unary name Boole, and the names of the usual Boolean operations –Terms - defined by the usual induction: A nullary function name is a term. If f is a function name of positive arity j and if t 1,…,t j are terms, then f(t 1,…,t j ) is a term.

Abstract States (2) Structures – semantics –A structure X of vocabulary T is a nonempty set S together with interpretations of the function names in T over S –A j-ary function name is interpreted as a function from S j to S –A nullary function is identified with its value. –The interpretation of a j-ary relation R is a function from S j to {true; false} –The equality sign is interpreted as the identity relation S

Abstract Instructions for Changing States The most general structure transforming machine instructions (called ASM rules) are guarded assignments to functions at given arguments expressable in the following form if Cond then Updates Cond is an arbitrary condition statement formulated in the given vocabulary Updates consists of finitely many function updates f(t 1,…,t n ):= t which are executed simultaneously

ASMs Definition Egon Börger, "High Level System Design and Analysis using Abstract State Machines". Current Trends in Applied Formal Methods (FM-Trends 98). Springer LNCS 1641, Egon Börger An ASM M is a finite set of rules for guarded multiple function updates Applying one step of M to a state (algebra) A produces as next state another algebra A’ of the same signature obtained as follows: –First evaluate in A using the standard interpretation of classical logic all the guards of all the rules of M –Compute in A for each of the rules of M whose guard evaluates to true all the arguments and all the values appearing in the updates of this rule –Replace simultaneously for each rule and for all the locations in question the previous A-function value by the newly computed value –The algebra A’ thus obtained differs from A by the new values for those functions at those arguments where the values are updated by a rule of M which could fire in A

ASMs thesis “Sequential Abstract State Machines Capture Sequential Algorithms”, by Yuri Gurevich; ACM Transactions on Computational Logic, July 2000 “Abstract State Machines Capture Parallel Algorithms”, by Andreas Blass and Yuri Gurevich; ACM Transactions on Computational Logic (TOCL), October 2003 The methodology is not proved yet for distributed algorithms

ASM engines A practical specification language is needed to write and execute ASM models => ASM engines: –ASM Workbench ( U Paderborn, Siemens ) –XASM ( TU Berlin, Kestrel ) –ASM Gofer ( U Ulm, Siemens ) –AsmL = ASM Language ( Microsoft )

AsmL An AsmL model (or program) - defined using a fixed vocabulary of symbols of our choosing. –The names of its state variables –A fixed set of operations Values - simple elements like numbers and strings State - a particular association of variable names to values: {(name1, val1), (name2, val2), … } A run of the machine - a series of states connected by state transitions Each state transition, or step, occurs when the machine's control logic (the set of operations) is applied to an input state and produces an output state. A program consists of statements; a typical statement is the conditional update “if condition then update.“ - each update is in the form "a := b" The program never alters the input state. An inconsistent update error occurs if the update set contains conflicting information (e.g. the program cannot update a variable to two different values in a single step)

AsmL – an example: reading a file (1) Main() initially F as File? = null initially FContents = "" initially Mode = "Initial" step until fixpoint if Mode = "Initial" then F := new Open("MyFile.txt") Mode := "Reading" if Mode = "Reading“ and Length(FContents) = 0 then FContents := Read(F, 1) if Mode = "Reading" and Length(FContents) = 1 then FContents := FContents + Read(F, 1) if Mode = "Reading" and Length(FContents) > 1 then WriteLine(FContents) Mode := "Finished" State Variables declaration and initialization Precedes the block of statements that will be repeatedly run until no state changes result A typical statement

AsmL – an example: reading a file (2) How this approach is different from finite state machines, or other kinds of “automata”? –Our machines may have state variables with very large (even infinite) ranges as well as complex structure (such as a graph of interconnected nodes –The operations corresponding to the state transitions may interact with the external environment in a flexible way ASMs - more general than other kinds of machines and automata It is possible for state variables to have complex nested data structures as their values, or come from infinite sets like real numbers.

DASMs for formalizing BPEL4WS (1) A DASM M has a finite set AGENT of autonomously operating agents. –The set of agents changes dynamically over runs of M –The behavior of an agent a in a given state S of M is defined by its program program S (a) –To introduce a new agent a in state S, a valid program has to be assigned to program S (a); to terminate a, program S (a) is reset to the distinguished value undef –In any state S reachable from an initial state of M, the set of agents is well defined as AGENT S ≡ {x € S : program S (x) ≠ undef}. –The collection of all the programs that agents of M potentially can execute forms the distributed program PM.

DASMs for formalizing BPEL4WS (2) Three layers of abstraction: High-level structure of BPEL Abstract Machine: –Inbox manager, outbox manager, process instances: different types of DASM agents –Activity agents - created dynamically by process agents for executing BPEL structured activities

Introduction to ASMs Q & A