Implementation of a compiler from Pluscal to TLA+ with Tom

Size: px
Start display at page:

Download "Implementation of a compiler from Pluscal to TLA+ with Tom"

Transcription

1 Implementation of a compiler from Pluscal to TLA+ with Tom Marc PINHEDE ESIAL-Telecom Nancy 1 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

2 Contents I Pluscal2.0 TLA+ Tools II Personal work Grammars Tree rewriting Code Generation III Situation after the internship Tests Todo 2 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

3 Introduction Location: Loria Team: AlGorille Supervisor: Martin Quinson Task: Rework on a thesis compiler Subject: Compiler form Pluscal2.0 to TLA+ 3 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

4 Introduction Situation: TLA+, a language used to specify a system : Very mathematical specification Permit to use a model-checker But not an easy language to learn, for program designers. Leslie Lamport introduced Pluscal. But it was still not really easy to use. 4 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

5 Pluscal2.0 Syntax close to standard algorithms Procedures can be used Non typed variables Accept processes and hierarchical processes Atomicity for some part of code accepted Embedded TLA+ code 5 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

6 Pluscal2.0 code algorithm Peterson extends Naturals constants numpeers (* Number of processes *) variables lockreq = [id \in Node -> FALSE], turn = 1, (* tie-break variable *) count = 0 (* number of processes holding the lock *) fair process Node[numPeers] definition other == CHOOSE id \in Node : id # self 6 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

7 Pluscal2.0 code begin ncs: try: cs: loop skip; lockreq[self] := TRUE; turn := other; when ~lockreq[other] \/ turn = self; count := count + 1; leave: count := count - 1; lockreq[self] := FALSE; end loop; 7 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

8 Pluscal2.0 code end process; (*No Main process*) (* Assert: at most one process have the lock *) invariant count <= 1 (* Liveness: each requested lock is eventually granted *) temporal \A p \in Node: [] (<> lockreq[p]) (* Instantiating the model for 2 processes *) constants numpeers = 2 8 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

9 TLA+ Set of Actions Action : Guard conditions Variable modifications List of unchanged variables Special actions that ensure liveness properties 9 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

10 Vrai == hr # 13 Faux == hr # 7 10 / 21 ====================================================== Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom TLA+ code MODULE HourClock EXTENDS Naturals VARIABLE hr HCini == hr \in (1..12) HCnxt == hr = IF hr # 12 THEN hr+1 ELSE 1 HC == HCini /\ [][HCnxt]_hr THEOREM HC => []HCini

11 Outils Main tools: Tom: Language extension. Permit easy tree manipulations. Antlr: Automatic Parser/Lexer generator. Others: Text editor, TlaToolbox,Tlc / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

12 Grammars Grammars are divided in two set: one for Pluscal2.0, the other for TLA+ For each set, two grammars. The antlr version and the Tom version. Four files: Antlr grammar for Pluscal2.0 Antlr grammar for TLA+ Gom signature for Pluscal2.0 Gom signature for TLA+ 12 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

13 Tree rewriting Tree rewriting are executed by tom. Two tools: match: Applied on a piece of the tree. strategy: Applied on the whole tree. Exemple: visit LabeledStatement{ /* Add label to any loop statement.*/ Labellisation(EmptyLabel(),Loop(labeledStatementList))-> { } return Labellisation(GivenLabel(OptionString("loop", ConcOption())),Loop(labeledStatementList)); } 13 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

14 Rewriting steps 14 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

15 Code generation Use of a pretty printer Recursive walk of the tree Two output files (.tla et.cfg) Completed step for the actual TLA+ signature 15 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

16 Tests Approach close to the TDD (Test-Driven Development) used. Set of tests, divided in subset, available Tests identify working instructions. Scripted tests with recorded answers. 16 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

17 Test of the whole compiler Implementation of a simple test requiring every steps of the compiler Test accepeted by the model-checker Verification of trivial properties validated 17 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

18 Unfinished parts Semantic control Normalization for some instructions Potential add of a separate step to manage the PC value or Translator completion. Add of new features to the compiler 18 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

19 Conclusion For the compiler: Use of traditional tools and separation of the work in steps to make sources more accessible Completed main process Some steps need to be completed or extended. As a personnal experience: Rewarding intership and good approach of the research world New tools and new way to program discovered Management and teamwork pleasant 19 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

20 Sources Vérification Formelle d Algorithmes Distribués en PlusCal-2 - Sabina AKHTAR Specifying Systems - Leslie Lamport A Pluscal User s Manual - Leslie Lamport 20 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

21 Thanks Thanks to: Martin QUINSON, my intership supervisor, for his presence and control, but also for the good atmosphere he was able to create in the team. Stephan MERTZ, for helping me to understand the potential of this project. Jean-Christophe BACH, for his help and patience with Tom. 21 / 21 Marc PINHEDE Implementation of a compiler from Pluscal to TLA+ with Tom

TLA+ TLC. Rui Fan Stanislav Funiac Mandana Vaziri. Presented by Spring 2001

TLA+ TLC. Rui Fan Stanislav Funiac Mandana Vaziri. Presented by Spring 2001 TLA+ TLC Presented by Rui Fan Stanislav Funiac Mandana Vaziri 6.897 Spring 2001 Outline Overview of TLA/TLA+ Subset of TLA+ supported by TLC Alternating Bit Protocol example Model checking Demo L. Lamport,

More information

Specifying Concurrent Systems with TLA +

Specifying Concurrent Systems with TLA + Specifying Concurrent Systems with TLA + Leslie Lamport 9 Feb 2000 c 1999 by Leslie Lamport Preliminary Draft Be sure to read the description of this document on page 3 of the Introduction. Contents Introduction.................................

More information

Specifying Concurrent Systems with TLA +

Specifying Concurrent Systems with TLA + Specifying Concurrent Systems with TLA + Leslie Lamport 18 Oct 1999 c 1999 by Leslie Lamport Incomplete Preliminary Draft Be sure to read the description of this document on page 3 of the Introduction.

More information

Proving the Correctness of Distributed Algorithms using TLA

Proving the Correctness of Distributed Algorithms using TLA Proving the Correctness of Distributed Algorithms using TLA Khushboo Kanjani, khush@cs.tamu.edu, Texas A & M University 11 May 2007 Abstract This work is a summary of the Temporal Logic of Actions(TLA)

More information

TLA + Proofs. 1 Introduction. Denis Cousineau 1, Damien Doligez 2, Leslie Lamport 3, Stephan Merz 4, Daniel Ricketts 5, and Hernán Vanzetto 4

TLA + Proofs. 1 Introduction. Denis Cousineau 1, Damien Doligez 2, Leslie Lamport 3, Stephan Merz 4, Daniel Ricketts 5, and Hernán Vanzetto 4 TLA + Proofs Denis Cousineau 1, Damien Doligez 2, Leslie Lamport 3, Stephan Merz 4, Daniel Ricketts 5, and Hernán Vanzetto 4 1 Inria - Université Paris Sud, Orsay, France. 2 Inria, Paris, France 3 Microsoft

More information

Specifying Concurrent Systems with TLA +

Specifying Concurrent Systems with TLA + Specifying Concurrent Systems with TLA + Leslie Lamport Compaq 23 April 1999 To appear in Calculational System Design. M. Broy and R. Steinbrüggen, editors. IOS Press, Amsterdam, 1999. Contents 1 Introduction

More information

Leslie Lamport: The Specification Language TLA +

Leslie Lamport: The Specification Language TLA + Leslie Lamport: The Specification Language TLA + This is an addendum to a chapter by Stephan Merz in the book Logics of Specification Languages by Dines Bjørner and Martin C. Henson (Springer, 2008). It

More information

GUI for model checkers

GUI for model checkers GUI for model checkers by Bo Wang THESIS MASTER OF SCIENCE Department of Computer Science Faculty of EEMCS Delft University of Technology June, 2006 Colophon Author: Bo Wang Student id: 1235931 E-mail:

More information

Proofs and Proof Certification in the TLA + Proof System

Proofs and Proof Certification in the TLA + Proof System Proofs and Proof Certification in the TLA + Proof System Stephan Merz Inria Nancy Grand-Est & LORIA, Villers-lès-Nancy, France Abstract TLA + is a specification language originally designed for specifying

More information

Specifying Systems. Leslie Lamport. 27 Feb Preliminary Draft

Specifying Systems. Leslie Lamport. 27 Feb Preliminary Draft Specifying Systems Leslie Lamport 27 Feb 2002 Preliminary Draft Copyright c 2001 by Leslie Lamport. You may download an electronic version of this book and print one copy for your own use only. You may

More information

Correctness of specifications. Correctness. Correctness of specifications (2) Example of a Correctness Proof. Testing versus Correctness Proofs

Correctness of specifications. Correctness. Correctness of specifications (2) Example of a Correctness Proof. Testing versus Correctness Proofs CS 390 Lecture 17 Correctness A product is correct if it satisfies its output specifications when operated under permitted conditions Correctness of specifications Incorrect specification for a sort (Figure

More information

UNIT I INTRODUCTION TO COMPILER 1. What is a Complier? A Complier is a program that reads a program written in one language-the source language-and translates it in to an equivalent program in another

More information

arxiv: v1 [cs.lo] 11 Nov 2010

arxiv: v1 [cs.lo] 11 Nov 2010 Verifying Safety Properties With the TLA + Proof System Kaustuv Chaudhuri 1, Damien Doligez 2, Leslie Lamport 3, and Stephan Merz 4 arxiv:1011.2560v1 [cs.lo] 11 Nov 2010 1 Overview 1 INRIA Saclay, France,kaustuv.chaudhuri@inria.fr

More information

The PlusCal Algorithm Language. Leslie Lamport Microsoft Research

The PlusCal Algorithm Language. Leslie Lamport Microsoft Research The PlusCal Algorithm Language Leslie Lamport Microsoft Research 2 January 2009 minor corrections 13 April 2011 and 23 October 2017 Abstract Algorithms are different from programs and should not be described

More information

IFM TLAPS tutorial. Peterson algorithm

IFM TLAPS tutorial. Peterson algorithm IFM 2010 - TLAPS tutorial Peterson algorithm In this tutorial, we shall prove that Peterson s algorithm satisfies the mutual exclusion property, using the TLA Proof System and the Toolbox IDE. 1 Toolbox

More information

Lectures 20, 21: Axiomatic Semantics

Lectures 20, 21: Axiomatic Semantics Lectures 20, 21: Axiomatic Semantics Polyvios Pratikakis Computer Science Department, University of Crete Type Systems and Static Analysis Based on slides by George Necula Pratikakis (CSD) Axiomatic Semantics

More information

Formal Verification. Lecture 10

Formal Verification. Lecture 10 Formal Verification Lecture 10 Formal Verification Formal verification relies on Descriptions of the properties or requirements of interest Descriptions of systems to be analyzed, and rely on underlying

More information

The SPIN Model Checker

The SPIN Model Checker The SPIN Model Checker Metodi di Verifica del Software Andrea Corradini Lezione 1 2013 Slides liberamente adattate da Logic Model Checking, per gentile concessione di Gerard J. Holzmann http://spinroot.com/spin/doc/course/

More information

axiomatic semantics involving logical rules for deriving relations between preconditions and postconditions.

axiomatic semantics involving logical rules for deriving relations between preconditions and postconditions. CS 6110 S18 Lecture 18 Denotational Semantics 1 What is Denotational Semantics? So far we have looked at operational semantics involving rules for state transitions, definitional semantics involving translations

More information

Tool demonstration: Spin

Tool demonstration: Spin Tool demonstration: Spin 1 Spin Spin is a model checker which implements the LTL model-checking procedure described previously (and much more besides). Developed by Gerard Holzmann of Bell Labs Has won

More information

LL(k) Parsing. Predictive Parsers. LL(k) Parser Structure. Sample Parse Table. LL(1) Parsing Algorithm. Push RHS in Reverse Order 10/17/2012

LL(k) Parsing. Predictive Parsers. LL(k) Parser Structure. Sample Parse Table. LL(1) Parsing Algorithm. Push RHS in Reverse Order 10/17/2012 Predictive Parsers LL(k) Parsing Can we avoid backtracking? es, if for a given input symbol and given nonterminal, we can choose the alternative appropriately. his is possible if the first terminal of

More information

Current Versions of the TLA + Tools

Current Versions of the TLA + Tools Current Versions of the TLA + Tools Leslie Lamport 15 June 2015 This document describes differences between the descriptions of the TLA + tools in the book Specifying Concurrent Systems and the currently

More information

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

Theorem proving. PVS theorem prover. Hoare style verification PVS. More on embeddings. What if. Abhik Roychoudhury CS 6214 Theorem proving PVS theorem prover Abhik Roychoudhury National University of Singapore Both specification and implementation can be formalized in a suitable logic. Proof rules for proving statements in

More information

Copyright 2008 CS655 System Modeling and Analysis. Korea Advanced Institute of Science and Technology

Copyright 2008 CS655 System Modeling and Analysis. Korea Advanced Institute of Science and Technology The Spin Model Checker : Part I Copyright 2008 CS655 System Korea Advanced Institute of Science and Technology System Spec. In Promela Req. Spec. In LTL Overview of the Spin Architecture Spin Model pan.c

More information

Temporal Logic of Actions (TLA) (a brief introduction) Shmuel Katz Computer Science Department The Technion

Temporal Logic of Actions (TLA) (a brief introduction) Shmuel Katz Computer Science Department The Technion Temporal Logic of Actions (TLA) (a brief introduction) Shmuel Katz Computer Science Department The Technion CS236368 Formal Specifications Lecture-- TLA 1 Basic Idea Combine transitions with temporal logic

More information

tempo2hsal: Converting Tempo Models into HybridSal Tool Description

tempo2hsal: Converting Tempo Models into HybridSal Tool Description tempo2hsal: Converting Tempo Models into HybridSal Tool Description Ashish Tiwari Bruno Dutertre Computer Science Laboratory SRI International Menlo Park CA 94025 USA Report submitted under Honeywell subcontract

More information

Program Syntax; Operational Semantics

Program Syntax; Operational Semantics 9/5 Solved Program Syntax; Operational Semantics CS 536: Science of Programming, Fall 2018 A. Why Our simple programming language is a model for the kind of constructs seen in actual languages. Step-by-step

More information

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILING

PRINCIPLES OF COMPILER DESIGN UNIT I INTRODUCTION TO COMPILING PRINCIPLES OF COMPILER DESIGN 2 MARKS UNIT I INTRODUCTION TO COMPILING 1. Define compiler? A compiler is a program that reads a program written in one language (source language) and translates it into

More information

Genie. Distributed Systems Synthesis and Verification. Marc Rosen. EN : Advanced Distributed Systems and Networks May 1, 2017

Genie. Distributed Systems Synthesis and Verification. Marc Rosen. EN : Advanced Distributed Systems and Networks May 1, 2017 Genie Distributed Systems Synthesis and Verification Marc Rosen EN.600.667: Advanced Distributed Systems and Networks May 1, 2017 1 / 35 Outline Introduction Problem Statement Prior Art Demo How does it

More information

Transforming Programs into Recursive Functions

Transforming Programs into Recursive Functions SBMF 2008 Transforming Programs into Recursive Functions Magnus O. Myreen, Michael J. C. Gordon 1 Computer Laboratory, University of Cambridge 15 JJ Thomson Avenue, Cambridge, UK Abstract This paper presents

More information

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

Outline. Introduction SDV Motivation Model vs Real Implementation SLIC SDVRP SLAM-2 Comparisons Conclusions Outline Introduction SDV Motivation Model vs Real Implementation SIC SDVRP SAM-2 Comparisons Conclusions SDV Research Platform Academic release of SDV (Static Driver Verifier), based on the code that ships

More information

Introduction to Compilers and Language Design

Introduction to Compilers and Language Design Introduction to Compilers and Language Design Copyright 2018 Douglas Thain. Hardcover ISBN: 978-0-359-13804-3 Paperback ISBN: 978-0-359-14283-5 First edition. Anyone is free to download and print the PDF

More information

Propositional Logic Formal Syntax and Semantics. Computability and Logic

Propositional Logic Formal Syntax and Semantics. Computability and Logic Propositional Logic Formal Syntax and Semantics Computability and Logic Syntax and Semantics Syntax: The study of how expressions are structured (think: grammar) Semantics: The study of the relationship

More information

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions)

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions) By the end of this course, students should CIS 1.5 Course Objectives a. Understand the concept of a program (i.e., a computer following a series of instructions) b. Understand the concept of a variable

More information

Object-Oriented and Classical Software Engineering

Object-Oriented and Classical Software Engineering Slide 6.1 Object-Oriented and Classical Software Engineering Seventh Edition, WCB/McGraw-Hill, 2007 Stephen R. Schach srs@vuse.vanderbilt.edu CHAPTER 6 Slide 6.2 TESTING 1 Overview Slide 6.3 Quality issues

More information

Object-Oriented and Classical Software Engineering

Object-Oriented and Classical Software Engineering Slide 6.1 Object-Oriented and Classical Software Engineering Seventh Edition, WCB/McGraw-Hill, 2007 Stephen R. Schach srs@vuse.vanderbilt.edu CHAPTER 6 Slide 6.2 TESTING Overview Slide 6.3 Quality issues

More information

Towards certification of TLA + proof obligations with SMT solvers

Towards certification of TLA + proof obligations with SMT solvers Towards certification of TLA + proof obligations with SMT solvers Stephan Merz and Hernán Vanzetto INRIA Nancy Grand-Est & LORIA Nancy, France Abstract TLA + is a formal specification language that is

More information

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

Cover Page. The handle   holds various files of this Leiden University dissertation Cover Page The handle http://hdl.handle.net/1887/22891 holds various files of this Leiden University dissertation Author: Gouw, Stijn de Title: Combining monitoring with run-time assertion checking Issue

More information

MPLc Documentation. Tomi Karlstedt & Jari-Matti Mäkelä

MPLc Documentation. Tomi Karlstedt & Jari-Matti Mäkelä MPLc Documentation Tomi Karlstedt & Jari-Matti Mäkelä July 11, 2008 Contents 1 Introduction 1 2 Implementation 3 3 Structure 5 3.1 Class MPLc............................ 7 3.2 Class AspectJPrinter.......................

More information

Model Checking Revision: Model Checking for Infinite Systems Revision: Traffic Light Controller (TLC) Revision: 1.12

Model Checking Revision: Model Checking for Infinite Systems Revision: Traffic Light Controller (TLC) Revision: 1.12 Model Checking mc Revision:.2 Model Checking for Infinite Systems mc 2 Revision:.2 check algorithmically temporal / sequential properties fixpoint algorithms with symbolic representations: systems are

More information

AADL Graphical Editor Design

AADL Graphical Editor Design AADL Graphical Editor Design Peter Feiler Software Engineering Institute phf@sei.cmu.edu Introduction An AADL specification is a set of component type and implementation declarations. They are organized

More information

Cyber Physical System Verification with SAL

Cyber Physical System Verification with SAL Cyber Physical System Verification with July 22, 2013 Cyber Physical System Verification with Outline 1 2 3 4 5 Cyber Physical System Verification with Table of Contents 1 2 3 4 5 Cyber Physical System

More information

Formalizing Dijkstra

Formalizing Dijkstra Formalizing Dijkstra 1 Formalizing Dijkstra John Harrison Intel Corporation A Discipline of Programming Mechanizing programming logics Relational semantics Weakest preconditions Guarded commands Theorems

More information

JavaFX on javac: A Case Study

JavaFX on javac: A Case Study JavaFX on javac: A Case Study September 25, 2008 JVM Language Summit Tom Ball Google Overview JavaFX Script Compiler Requirements Why Use javac? javafxc Design Lessons Learned JavaFX Script Compiler Requirements

More information

Strategic Programming in Java

Strategic Programming in Java 1 Strategic Programming in Java Pierre-Etienne Moreau Antoine Reilles Software Transformation Systems Workshop October, 22 nd, 2006 2 Motivations Rule Based Programming is a nice idea! We interested in

More information

Clock-directed Modular Code-generation for Synchronous Data-flow Languages

Clock-directed Modular Code-generation for Synchronous Data-flow Languages 1 Clock-directed Modular Code-generation for Synchronous Data-flow Languages Dariusz Biernacki Univ. of Worclaw (Poland) Jean-Louis Colaço Prover Technologies (France) Grégoire Hamon The MathWorks (USA)

More information

Process Modelling. Fault Tolerant Systems Research Group. Budapest University of Technology and Economics

Process Modelling. Fault Tolerant Systems Research Group. Budapest University of Technology and Economics Process Modelling Budapest University of Technology and Economics Fault Tolerant Systems Research Group Budapest University of Technology and Economics Department of Measurement and Information Systems

More information

CS 4110 Programming Languages & Logics. Lecture 17 Programming in the λ-calculus

CS 4110 Programming Languages & Logics. Lecture 17 Programming in the λ-calculus CS 4110 Programming Languages & Logics Lecture 17 Programming in the λ-calculus 10 October 2014 Announcements 2 Foster Office Hours 11-12 Enjoy fall break! Review: Church Booleans 3 We can encode TRUE,

More information

Safety and liveness for critical sections

Safety and liveness for critical sections Safety and liveness for critical sections! At most k threads are concurrently in the critical section A. Safety B. Liveness C. Both! A thread that wants to enter the critical section will eventually succeed

More information

Handout 9: Imperative Programs and State

Handout 9: Imperative Programs and State 06-02552 Princ. of Progr. Languages (and Extended ) The University of Birmingham Spring Semester 2016-17 School of Computer Science c Uday Reddy2016-17 Handout 9: Imperative Programs and State Imperative

More information

In Our Last Exciting Episode

In Our Last Exciting Episode In Our Last Exciting Episode #1 Lessons From Model Checking To find bugs, we need specifications What are some good specifications? To convert a program into a model, we need predicates/invariants and

More information

Parametricity. Types Are Documentation. Tony Morris

Parametricity. Types Are Documentation. Tony Morris Parametricity Types Are Documentation Tony Morris The Journey Fast and loose reasoning is morally correct Danielsson, Hughes, Jansson & Gibbons [DHJG06] tell us: Functional programmers often reason about

More information

Interim Report: Build Your Efficient Programming Language Quickly

Interim Report: Build Your Efficient Programming Language Quickly Interim Report: Build Your Efficient Programming Language Quickly Final Year Project Department of Computer Science University of Hong Kong Xiang Ji Supervisor: Prof. Bruno c.d.s. Oliveira January 24,

More information

SPIN, PETERSON AND BAKERY LOCKS

SPIN, PETERSON AND BAKERY LOCKS Concurrent Programs reasoning about their execution proving correctness start by considering execution sequences CS4021/4521 2018 jones@scss.tcd.ie School of Computer Science and Statistics, Trinity College

More information

Process Modelling. Fault Tolerant Systems Research Group. Budapest University of Technology and Economics

Process Modelling. Fault Tolerant Systems Research Group. Budapest University of Technology and Economics Process Modelling Budapest University of Technology and Economics Fault Tolerant Systems Research Group Budapest University of Technology and Economics Department of Measurement and Information Systems

More information

CMSC 330: Organization of Programming Languages. OCaml Expressions and Functions

CMSC 330: Organization of Programming Languages. OCaml Expressions and Functions CMSC 330: Organization of Programming Languages OCaml Expressions and Functions CMSC330 Spring 2018 1 Lecture Presentation Style Our focus: semantics and idioms for OCaml Semantics is what the language

More information

TESTING. Overview Slide 6.2. Testing (contd) Slide 6.4. Testing Slide 6.3. Quality issues Non-execution-based testing

TESTING. Overview Slide 6.2. Testing (contd) Slide 6.4. Testing Slide 6.3. Quality issues Non-execution-based testing Slide 6.1 Overview Slide 6.2 Quality issues Non-execution-based testing TESTING Execution-based testing What should be tested? Testing versus correctness proofs Who should perform execution-based testing?

More information

Formal Semantics of Programming Languages

Formal Semantics of Programming Languages Formal Semantics of Programming Languages Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson http://www.daimi.au.dk/~bra8130/wiley_book/wiley.html Benefits of formal

More information

Thread Synchronization: Too Much Milk

Thread Synchronization: Too Much Milk Thread Synchronization: Too Much Milk 1 Implementing Critical Sections in Software Hard The following example will demonstrate the difficulty of providing mutual exclusion with memory reads and writes

More information

SPIN s Promela to Java Compiler, with help from Stratego

SPIN s Promela to Java Compiler, with help from Stratego SPIN s Promela to Java Compiler, with help from Stratego Master s Thesis Edwin Vielvoije SPIN s Promela to Java Compiler, with help from Stratego THESIS submitted in partial fulfillment of the requirements

More information

Grammars and Parsing, second week

Grammars and Parsing, second week Grammars and Parsing, second week Hayo Thielecke 17-18 October 2005 This is the material from the slides in a more printer-friendly layout. Contents 1 Overview 1 2 Recursive methods from grammar rules

More information

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION

SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION Alessandro Artale UniBZ - http://www.inf.unibz.it/ artale/ SECTION 5.5 Application: Correctness of Algorithms Copyright Cengage Learning. All

More information

Local Verification of Global Invariants in

Local Verification of Global Invariants in Local Verification of Global Invariants in 1 Local Verification of Global Invariants in Concurrent Programs Ernie Cohen 1, Michal Moskal 2, Wolfram Schulte 2, Stephan Tobies 1 1 European Microsoft Innovation

More information

Generating a CTL model checker using an attribute grammar

Generating a CTL model checker using an attribute grammar Fourth International Conference Modelling and Development of Intelligent Systems October 28 - November 1, 2015 Lucian Blaga University Sibiu - Romania Generating a CTL model checker using an attribute

More information

Formal Semantics of Programming Languages

Formal Semantics of Programming Languages Formal Semantics of Programming Languages Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson http://www.daimi.au.dk/~bra8130/wiley_book/wiley.html Benefits of formal

More information

The Spin Model Checker : Part I/II

The Spin Model Checker : Part I/II The Spin Model Checker : Part I/II Moonzoo Kim CS Dept. KAIST Korea Advanced Institute of Science and Technology Motivation: Tragic Accidents Caused by SW Bugs 2 Cost of Software Errors June 2002 Software

More information

Parametricity. Types Are Documentation. Tony Morris

Parametricity. Types Are Documentation. Tony Morris Parametricity Types Are Documentation Tony Morris The Journey Fast and loose reasoning is morally correct Danielsson, Hughes, Jansson & Gibbons [DHJG06] tell us: Functional programmers often reason about

More information

Temporal Refinement Using SMT and Model Checking with an Application to Physical-Layer Protocols

Temporal Refinement Using SMT and Model Checking with an Application to Physical-Layer Protocols Temporal Refinement Using SMT and Model Checking with an Application to Physical-Layer Protocols Lee Pike (Presenting), Galois, Inc. leepike@galois.com Geoffrey M. Brown, Indiana University geobrown@cs.indiana.edu

More information

User-defined Functions. Conditional Expressions in Scheme

User-defined Functions. Conditional Expressions in Scheme User-defined Functions The list (lambda (args (body s to a function with (args as its argument list and (body as the function body. No quotes are needed for (args or (body. (lambda (x (+ x 1 s to the increment

More information

Using TLC to Check Inductive Invariance

Using TLC to Check Inductive Invariance Using TLC to Check Inductive Invariance Leslie Lamport 23 August 2018 1 Inductive Invariance Suppose we have a specification with initial predicate Init and next-state predicate Next, so its specification

More information

A CRASH COURSE IN SEMANTICS

A CRASH COURSE IN SEMANTICS LAST TIME Recdef More induction NICTA Advanced Course Well founded orders Slide 1 Theorem Proving Principles, Techniques, Applications Slide 3 Well founded recursion Calculations: also/finally {P}... {Q}

More information

Matching Logic A New Program Verification Approach

Matching Logic A New Program Verification Approach Matching Logic A New Program Verification Approach Grigore Rosu and Andrei Stefanescu University of Illinois at Urbana-Champaign (work started in 2009 with Wolfram Schulte at MSR) Usable Verification Relatively

More information

Chapter 1. Introduction

Chapter 1. Introduction 1 Chapter 1 Introduction An exciting development of the 21st century is that the 20th-century vision of mechanized program verification is finally becoming practical, thanks to 30 years of advances in

More information

Static analysis and testing of executable DSL specification

Static analysis and testing of executable DSL specification Static analysis and testing of executable DSL specification Qinan Lai 1, Andy Carpenter 1 1 School of Computer Science, the University of Manchester, Manchester, UK {laiq,afc}@cs.man.ac.uk Keywords: Abstract:

More information

Formal specification of semantics of UML 2.0 activity diagrams by using Graph Transformation Systems

Formal specification of semantics of UML 2.0 activity diagrams by using Graph Transformation Systems Formal specification of semantics of UML 2.0 activity diagrams by using Graph Transformation Systems Somayeh Azizi 1, Vahid Panahi 2 Computer science department, Sama Technical and vocational, Training

More information

Programming Languages Third Edition

Programming Languages Third Edition Programming Languages Third Edition Chapter 12 Formal Semantics Objectives Become familiar with a sample small language for the purpose of semantic specification Understand operational semantics Understand

More information

CS164: Midterm I. Fall 2003

CS164: Midterm I. Fall 2003 CS164: Midterm I Fall 2003 Please read all instructions (including these) carefully. Write your name, login, and circle the time of your section. Read each question carefully and think about what s being

More information

Evaluation Strategies for Functional Logic Programming

Evaluation Strategies for Functional Logic Programming Evaluation Strategies for Functional Logic Programming WRS 01, Utrecht, May 26 Sergio Antoy antoy@cs.pdx.edu Portland State University 1 Outline Whats, hows and whys of Functional Logic Programming. Constructor-based

More information

Software Development & Education Center C Programming

Software Development & Education Center C Programming Software Development & Education Center C Programming Detailed Curriculum History of C Features of C Requirement from C development Turbo C 3 Turbo C 45 Borland C++ 502 Rules for C Programming Writing

More information

Outline. Introduction. 2 Proof of Correctness. 3 Final Notes. Precondition P 1 : Inputs include

Outline. Introduction. 2 Proof of Correctness. 3 Final Notes. Precondition P 1 : Inputs include Outline Computer Science 331 Correctness of Algorithms Mike Jacobson Department of Computer Science University of Calgary Lectures #2-4 1 What is a? Applications 2 Recursive Algorithms 3 Final Notes Additional

More information

Closures. Mooly Sagiv. Michael Clarkson, Cornell CS 3110 Data Structures and Functional Programming

Closures. Mooly Sagiv. Michael Clarkson, Cornell CS 3110 Data Structures and Functional Programming Closures Mooly Sagiv Michael Clarkson, Cornell CS 3110 Data Structures and Functional Programming t ::= x x. t t t Call-by-value big-step Operational Semantics terms variable v ::= values abstraction x.

More information

A UNITY-based Formalism for Dynamic Distributed Systems

A UNITY-based Formalism for Dynamic Distributed Systems A UNITY-based Formalism for Dynamic Distributed Systems Daniel M. Zimmerman Computer Science 256-80 California Institute of Technology Pasadena, California 91125 USA dmz@cs.caltech.edu Abstract We describe

More information

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic 3.4 Deduction and Evaluation: Tools 3.4.1 Conditional-Equational Logic The general definition of a formal specification from above was based on the existence of a precisely defined semantics for the syntax

More information

nfn2dlp: A Normal Form Nested Programs Compiler

nfn2dlp: A Normal Form Nested Programs Compiler nfn2dlp: A Normal Form Nested Programs Compiler Annamaria Bria, Wolfgang Faber, and Nicola Leone Department of Mathematics, University of Calabria, 87036 Rende (CS), Italy {a.bria,faber,leone}@mat.unical.it

More information

Finding and Fixing Bugs in Liquid Haskell. Anish Tondwalkar

Finding and Fixing Bugs in Liquid Haskell. Anish Tondwalkar Finding and Fixing Bugs in Liquid Haskell Anish Tondwalkar Overview Motivation Liquid Haskell Fault Localization Fault Localization Evaluation Predicate Discovery Predicate Discovery Evaluation Conclusion

More information

Programming Languages

Programming Languages Programming Languages As difficult to discuss rationally as religion or politics. Prone to extreme statements devoid of data. Examples: "It is practically impossible to teach good programming to students

More information

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 7

Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 7 CS 70 Discrete Mathematics and Probability Theory Fall 2013 Vazirani Note 7 An Introduction to Graphs A few centuries ago, residents of the city of Königsberg, Prussia were interested in a certain problem.

More information

C++ Programming: From Problem Analysis to Program Design, Third Edition

C++ Programming: From Problem Analysis to Program Design, Third Edition C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 5: Control Structures II (Repetition) Why Is Repetition Needed? Repetition allows you to efficiently use variables Can input,

More information

Software Construction

Software Construction Lecture 1: Introduction Software Construction in Java for HSE Moscow Tom Verhoeff Eindhoven University of Technology Department of Mathematics & Computer Science Software Engineering & Technology Group

More information

Applications of Formal Verification

Applications of Formal Verification Applications of Formal Verification Model Checking: Introduction to PROMELA Bernhard Beckert Mattias Ulbrich SS 2017 KIT INSTITUT FÜR THEORETISCHE INFORMATIK KIT University of the State of Baden-Württemberg

More information

CS2112 Fall Assignment 4 Parsing and Fault Injection. Due: March 18, 2014 Overview draft due: March 14, 2014

CS2112 Fall Assignment 4 Parsing and Fault Injection. Due: March 18, 2014 Overview draft due: March 14, 2014 CS2112 Fall 2014 Assignment 4 Parsing and Fault Injection Due: March 18, 2014 Overview draft due: March 14, 2014 Compilers and bug-finding systems operate on source code to produce compiled code and lists

More information

Making it Easy to Deploy the UVM by Dr. Christoph Sühnel, frobas GmbH

Making it Easy to Deploy the UVM by Dr. Christoph Sühnel, frobas GmbH Making it Easy to Deploy the UVM by Dr. Christoph Sühnel, frobas GmbH Abstract The Universal Verification Methodology (UVM) is becoming the dominant approach for the verification of large digital designs.

More information

LOGIC AND DISCRETE MATHEMATICS

LOGIC AND DISCRETE MATHEMATICS LOGIC AND DISCRETE MATHEMATICS A Computer Science Perspective WINFRIED KARL GRASSMANN Department of Computer Science University of Saskatchewan JEAN-PAUL TREMBLAY Department of Computer Science University

More information

Applications of Formal Verification

Applications of Formal Verification Applications of Formal Verification Model Checking: Introduction to PROMELA Prof. Dr. Bernhard Beckert Dr. Vladimir Klebanov SS 2010 KIT INSTITUT FÜR THEORETISCHE INFORMATIK KIT University of the State

More information

Introduction to Denotational Semantics. Class Likes/Dislikes Survey. Dueling Semantics. Denotational Semantics Learning Goals. You re On Jeopardy!

Introduction to Denotational Semantics. Class Likes/Dislikes Survey. Dueling Semantics. Denotational Semantics Learning Goals. You re On Jeopardy! Introduction to Denotational Semantics Class Likes/Dislikes Survey would change [the bijection question] to be one that still tested students' recollection of set theory but that didn't take as much time

More information

Software Testing. Software Testing

Software Testing. Software Testing Software Testing Software Testing Error: mistake made by the programmer/ developer Fault: a incorrect piece of code/document (i.e., bug) Failure: result of a fault Goal of software testing: Cause failures

More information

Optimizing Compilers. Vineeth Kashyap Department of Computer Science, UCSB. SIAM Algorithms Seminar, 2014

Optimizing Compilers. Vineeth Kashyap Department of Computer Science, UCSB. SIAM Algorithms Seminar, 2014 Optimizing Compilers Vineeth Kashyap Department of Computer Science, UCSB SIAM Algorithms Seminar, 2014 Warning!! Optimizing compiler is a misnomer My Background Worked on a compiler team for 2 years at

More information

Overview. Probabilistic Programming. Dijkstra s guarded command language: Syntax. Elementary pgcl ingredients. Lecture #4: Probabilistic GCL

Overview. Probabilistic Programming. Dijkstra s guarded command language: Syntax. Elementary pgcl ingredients. Lecture #4: Probabilistic GCL Overview Lecture #4: Probabilistic GCL 1 Joost-Pieter Katoen 2 3 Recursion RWTH Lecture Series on 2018 Joost-Pieter Katoen 1/31 Joost-Pieter Katoen 2/31 Dijkstra s guarded command language: Syntax Elementary

More information

Mutual Exclusion. 1 Formal problem definitions. Time notion CSE /17/2015. Outline of this lecture:

Mutual Exclusion. 1 Formal problem definitions. Time notion CSE /17/2015. Outline of this lecture: CSE 539 03/17/2015 Mutual Exclusion Lecture 15 Scribe: Son Dinh Outline of this lecture: 1. Formal problem definitions 2. Solution for 2 threads 3. Solution for n threads 4. Inherent costs of mutual exclusion

More information

CS558 Programming Languages

CS558 Programming Languages CS558 Programming Languages Fall 2016 Lecture 7a Andrew Tolmach Portland State University 1994-2016 Values and Types We divide the universe of values according to types A type is a set of values and a

More information