Performance Analysis of ARQ Protocols using a Theorem Prover

Similar documents
Formalization of Normal Random Variables

COEN6551: Formal Hardware Verification

Formal Verification of Tail Distribution Bounds in the HOL Theorem Prover

Formal Reliability Analysis of Combinational Circuits using Theorem Proving

Modeling and Simulation NETW 707

An Informal introduction to Formal Verification

Accurate Reliability Analysis of Combinational Circuits using Theorem Proving

Reliability Block Diagrams based Analysis: A Survey

Discrete Random Variables

Formalization of Continuous Probability Distributions

arxiv: v1 [cs.lo] 7 Dec Department of Electrical and Computer Engineering,

CSE 123: Computer Networks

Verifying Probabilistic Programs using the HOL Theorem Prover Joe Hurd p.1/32

Lecture 4: Sampling, Tail Inequalities

Formal Reasoning about Systems Biology using Theorem Proving

CMPSCI 240: Reasoning Under Uncertainty

Lecture 3. Discrete Random Variables

Bernoulli and Binomial

Formal Verification Techniques. Riccardo Sisto, Politecnico di Torino

1 Random Variable: Topics

Randomized Algorithms

Formal Reliability Analysis using Higher-Order Logic Theorem Proving

ELEG 3143 Probability & Stochastic Process Ch. 2 Discrete Random Variables

EE 505 Introduction. What do we mean by random with respect to variables and signals?

[POLS 8500] Review of Linear Algebra, Probability and Information Theory

Discrete Random Variables

Mathematical Statistics 1 Math A 6330

Alan Bundy. Automated Reasoning LTL Model Checking

Lecture Notes 17. Randomness: The verifier can toss coins and is allowed to err with some (small) probability if it is unlucky in its coin tosses.

Random Variable. Pr(X = a) = Pr(s)

Bounded Retransmission in Event-B CSP: a Case Study

Probabilistic Model Checking Michaelmas Term Dr. Dave Parker. Department of Computer Science University of Oxford

Chapter 6 Randomization Algorithm Theory WS 2012/13 Fabian Kuhn

Digital Systems. Validation, verification. R. Pacalet January 4, 2018

Formal Verification of Mathematical Algorithms

Lecture 4 Event Systems

Chapter 1 Statistical Reasoning Why statistics? Section 1.1 Basics of Probability Theory

Abstractions and Decision Procedures for Effective Software Model Checking

Mechanizing Elliptic Curve Associativity

Lecture Notes: Axiomatic Semantics and Hoare-style Verification

The Underlying Semantics of Transition Systems

Chapter Learning Objectives. Random Experiments Dfiii Definition: Dfiii Definition:

Informal Statement Calculus

First-Order Theorem Proving and Vampire. Laura Kovács (Chalmers University of Technology) Andrei Voronkov (The University of Manchester)

Fault-Tolerant Computer System Design ECE 60872/CS 590. Topic 2: Discrete Distributions

Chapter 2: Random Variables

Introduction to Information Theory

a zoo of (discrete) random variables

EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits)

University of Surrey. Bounded Retransmission in Event-B CSP: A Case Study. Steve Schneider, Helen Treharne and Heike Wehrheim

Theorem 1.7 [Bayes' Law]: Assume that,,, are mutually disjoint events in the sample space s.t.. Then Pr( )

ECE-517: Reinforcement Learning in Artificial Intelligence. Lecture 4: Discrete-Time Markov Chains

MA/ST 810 Mathematical-Statistical Modeling and Analysis of Complex Systems

2. Variance and Covariance: We will now derive some classic properties of variance and covariance. Assume real-valued random variables X and Y.

Outline. EECS150 - Digital Design Lecture 4 - Boolean Algebra I (Representations of Combinational Logic Circuits) Combinational Logic (CL) Defined

Statistical Preliminaries. Stony Brook University CSE545, Fall 2016

Quick Tour of Basic Probability Theory and Linear Algebra

Recitation 2: Probability

EE 178 Lecture Notes 0 Course Introduction. About EE178. About Probability. Course Goals. Course Topics. Lecture Notes EE 178

Origins of Probability Theory

Lecture Notes 1 Basic Probability. Elements of Probability. Conditional probability. Sequential Calculation of Probability

Essentials on the Analysis of Randomized Algorithms

Guidelines for Solving Probability Problems

Formalization of Birth-Death and IID Processes in Higher-order Logic

Statistics for scientists and engineers

Introduction to Stochastic Processes

Basic concepts of probability theory

Computing and Communications 2. Information Theory -Entropy

1 Proof techniques. CS 224W Linear Algebra, Probability, and Proof Techniques

Random variables. DS GA 1002 Probability and Statistics for Data Science.

Model Checking I. What are LTL and CTL? dack. and. dreq. and. q0bar

Machine Learning using Bayesian Approaches

Overview. Discrete Event Systems Verification of Finite Automata. What can finite automata be used for? What can finite automata be used for?

Lecture Notes 7 Random Processes. Markov Processes Markov Chains. Random Processes

Probability Review. Yutian Li. January 18, Stanford University. Yutian Li (Stanford University) Probability Review January 18, / 27

Probability Theory for Machine Learning. Chris Cremer September 2015

02 Propositional Logic

Introduction to Wireless & Mobile Systems. Chapter 4. Channel Coding and Error Control Cengage Learning Engineering. All Rights Reserved.

Random Variables. Definition: A random variable (r.v.) X on the probability space (Ω, F, P) is a mapping

STAT 516: Basic Probability and its Applications

Towards a Mechanised Denotational Semantics for Modelica

Why study probability? Set theory. ECE 6010 Lecture 1 Introduction; Review of Random Variables

1 INFO Sep 05

Logic. Combinational. inputs. outputs. the result. system can

Continuing discussion of CRC s, especially looking at two-bit errors

Probabilistic Guarded Commands Mechanized in HOL

An-Najah National University Faculty of Engineering Industrial Engineering Department. Course : Quantitative Methods (65211)

Continuous Probability Spaces

Sample Spaces, Random Variables

Discrete Random Variable

CS 237: Probability in Computing

Theorem Proving beyond Deduction

CS151 Complexity Theory. Lecture 13 May 15, 2017

A POMDP Framework for Cognitive MAC Based on Primary Feedback Exploitation

Introduction to Machine Learning

Eleventh Problem Assignment

How many rounds can Random Selection handle?

SFM-11:CONNECT Summer School, Bertinoro, June 2011

Chapter 2. Reductions and NP. 2.1 Reductions Continued The Satisfiability Problem (SAT) SAT 3SAT. CS 573: Algorithms, Fall 2013 August 29, 2013

Methodology for Computer Science Research Lecture 4: Mathematical Modeling

Transcription:

Performance Analysis of ARQ Protocols using a Theorem Prover Osman Hasan Sofiene Tahar Hardware Verification Group Concordia University Montreal, Canada ISPASS 2008

Objectives n Probabilistic Theorem Proving A robust and precise probabilistic analysis technique n What is it? n Why do we need it? n How can we apply it for the performance analysis of ARQ Protocols? O. Hasan Performance Analysis of ARQ Protocols using Theorem Proving 2

3 Outline n Introduction n Theorem Proving based Performance Analysis n Performance Analysis of ARQ Protocols n Conclusions

4 Motivation Probabilistic Choice Noise Aging Phenomena Environmental Conditions Unpredictable Inputs n Performance Analysis n Simulation n State-of-the-art n Inaccurate results n Theorem Proving n Proposed Solution

5 Performance Analysis Random Components R andom Variables (Dis crete/ C ontinuous) Hardware Software System Model Probabilistic and Statistical Properties Computer Based Analysis Framework Property Satisfied?

6 Probabilistic Analysis Approaches Random Components Analysis Accuracy Expressiveness No CPU Time Issue Automation Simulation Simulation Approximate Probabilistic random State Machine variable functions good Observing some test cases û ü û ü Model Checking Probabilistic State Machine Exhaustive Verification ü û û ü Formal Methods Theorem Proving Precise random variable functions Mathematical Reasoning ü ü ü û

7 Theorem Prover n A notation (syntax) n A small set of fundamental axioms (facts) n A Boolean variable can be True or False: a.(a = T) (a =F) n A small set of inference (deduction) rules n Equality is transitive: a b c. (a = b) (b = c) (a = c) n Soundness n Every new theorem must be created from n Basic axioms and primitive inference rules n Already proved theorems or inference rules n Theory (collection of verified theorems in a file) n Can be reloaded in theorem provers n Facilitates the instant utilization of already verified theorems

8 Theorem Proving Example n Check if y>x for the given system (x is a natural number) x 2 ( x +1) y 1 y>x Problem statement 2 (x+1) 2 >x Implementation 3 (x+1).(x+1)>x Definition of Square 4 (x+1).x+(x+1).1>x Distributivity 5 x.x+1.x+x.1+1.1>x Distributivity 6 x.x+x+x+1>x Multiplicative Identity 7 x.x+x+1+x>x Additive Commutivity 8 x.x+x+1>0 Addition Cancellation 9 True Natural numbers > 0

9 Outline n Introduction n Theorem Proving based Performance Analysis n Performance Analysis of ARQ Protocols n Conclusions

HOL Theorem Prover n Higher-order logic theorem prover n University of Cambridge, UK n 5 axioms n 8 primitive inference rules n Numerous proof assistants are available n Inbuilt mathematical theories of Boolean, list, set, integers, real analysis, measure, and probability theory O. Hasan Performance Analysis of ARQ Protocols using Theorem Proving 10

11 Theorem Proving Based Performance Analysis System Properties (Discrete Random Variables) Discrete Random Variables Probabilistic Properties Statistical Properties System Description System Properties Random Components System Model Probabilistic Analysis Theorems Theorem Prover Formal Proofs of Properties Continuous Random Variables Probabilistic Properties Statistical Properties System Properties (Continuous Random Variables)

12 Formal Verification of Random Variables n Measure Theory n Probability space of Infinite Boolean sequence (B ) B : positive integers Boolean 0 1 2 3 4 5 6 7 T/F T/F T/F T/F T/F T/F T/F T/F n A random variable that n n Accepts : α Returns: β can be modeled in HOL as a function f : α B (β x B )

13 Random Variables in HOL Example n Coin Flip (Head, Tail) B (flip_outcome x B ) n Algorithm flip s = (if (top element of s) then Head else Tail, remaining portion of s) n Probabilistic Properties P {s flip s = Head} = ½

14 Discrete Random Variables in HOL Theorems: Discrete Random Variables Random variable Uniform(m) Bernoulli(p) Geometric(p) HOL Funtions unif_rv bern_rv geom_rv PMF (Pr (X = n)) 1 m p p ( 1 p) n

15 Continuous Random Variables in HOL Theorems: Continuous Random Variables Random Variable HOL Functions CDF (Pr (X x) Exponential(l) Uniform(a,b) Rayleigh(l) exp_rv uniform_rv rayleigh_rv 0, x 0 -lx 1- exp, 0 < x 0, x a x - a, a < x b b - a 1, b < x 0, 1- exp -x 2 2 2l x 0, 0 < x

16 Verification of Statistical Properties Definition: Expectation for Discrete Random Variables Ex[ X ] = i= 1 i Pr( X = i) Theorem: Expectation Properties Ex [ c] = c Ex n i= 1 X i = n i= 1 Ex [ X ] i

Verification of Statistical Properties Theorems: Discrete Random Variables Random variable HOL Function Expectation Variance Uniform(m) unif_rv m 2 ( m + 1) 12 2 1 Bernoulli(p) bern_rv p p( 1 p) Geometric(p) geom_rv 1 p 1 p 2 p O. Hasan Performance Analysis of ARQ Protocols using Theorem Proving 17

Probabilistic Theorem Proving Case Studies n Very few examples n Roundoff error analysis of a Digital Processer n Verification of a couple of probabilistic properties n Probabilistic Analysis of Algorithms n Miller Rabin Test n Coupon-Collector s Problem O. Hasan Performance Analysis of ARQ Protocols using Theorem Proving 18

19 Outline n Introduction n Theorem Proving based Performance Analysis n Performance Analysis of ARQ Protocols n Conclusions

Automatic Repeat Request (ARQ) n Reliable communication between computers n Transmitter n Repeats transmission of a data frame until it receives an ACK n Receiver n Discards erroneous data frames n Sends Acknowledgment (ACK) for Error-free data frames n Applications n Transmission Control Protocol (TCP) n High-level Data Link Control (HDLC) Standard O. Hasan Performance Analysis of ARQ Protocols using Theorem Proving 20

21 ARQ Protocols n Implementation variants of ARQ principle n Stop-and-Wait n Go-Back-N n Selective Repeat n Performance Analysis Metric n Message Delay n Both simulation and state-based formal techniques fail to produce reasonable results n A subtle interaction of a number of distributed components

22 Stop-and-Wait Protocol n Delay (Unsuccessful Transmission Trial) T = t + t n Delay (Successful Transmission Trial) T s = t f + ta + 2( t prop + t proc ) u f out

23 Go-Back-N Protocol n Delay (Unsuccessful Transmission Trial) T = t + t n Delay (Successful Transmission Trial) T = t u s f f out

24 Selective Repeat Protocol n Delay (Unsuccessful Transmission Trial) T = t n Delay (Successful Transmission Trial) T = t u s f f

25 Average Message Delay of ARQ Protocols n p: Bit-error probability of the channel n Average (Message Delay) =? n Step 1: Message Delay (T u,t s,p) n Geometric Random Variable Delay = (G-1)T u + T s n Step 2: Average of the above random variable

Step 1: Message Delay in HOL n Geometric random variable function (geom_rv) n Success probability =? n Error behaviour of single bit: bern_rv(p) Definition: Frame Error n p. f_err 0 p = false f_err (n + 1) p = bern_rv(p) (f_err n p) Definition: Probability of Successful Transmission nf na p. suc_p_arq nf na p = P { (f_err nf p) (f_err na p) = false } O. Hasan Performance Analysis of ARQ Protocols using Theorem Proving 26

Step 1: Message Delay in HOL Theorem: Probability of Successful Transmission nf na p. 0 p p 1 suc_p_arq nf na p = (1-p) (nf + na) n Proof n Boolean Logic, Positive Integers, Real Numbers, Set, Probability Definition: ARQ Message Delay nf na p Tu Ts. arq_del = Tu (geom_rv ((1-p) (nf + na) ) 1) + Ts O. Hasan Performance Analysis of ARQ Protocols using Theorem Proving 27

28 Step 2: Average Message Delay Theorem: Linearity of Expectation Ex [ ax + b] = ae[ X ] + b n Proof n Already verified Expectation properties Ex [ c] = c Ex n i= 1 X i = n i= 1 Ex [ X ] i n Boolean Logic, Positive Integers, Real Numbers, Set, Probability

29 Average Message Delay in HOL Stop-and-Wait Protocol n Proof: n Definition: Stop-and-Wait Message Delay nf na p tout tprop tproc tf ta. sw_del nf na p tout tprop tproc tf ta = (tf + tout) (geom_rv ((1-p) (nf + na) ) 1) + tf + ta + 2(tproc + tprop) Theorem: Average Stop-and-Wait Message Delay nf na p tout tprop tproc tf ta. (0 p) (p < 1) expec (sw_del nf na p tout tprop tproc tf ta) = (tf + tout) (1 - (1-p) (nf + na) )/((1-p) (nf + na) ) + tf + ta + 2(tproc + tprop) Ex [ ax + b] = ae[ X ] + b n Expectation of Geometric random variable

30 Average Message Delay in HOL Go-Back-N Protocol n Proof: n Definition: Go-Back-N Message Delay nf na p tout tf. gbn_del nf na p tout tf = (tf + tout) (geom_rv ((1-p) (nf + na) ) 1) + tf Theorem: Average Go-Back-N Message Delay nf na p tout tf. (0 p) (p < 1) expec (gbn_del nf na p tout tf) = (tf + tout) (1 - (1-p) (nf + na) )/((1-p) (nf + na) ) +tf Ex [ ax + b] = ae[ X ] + b n Expectation of Geometric random variable

31 Average Message Delay in HOL Selective Repeat Protocol Definition: Stop-and-Wait Message Delay nf na p tf. sr_del nf na p tf = (tf) (geom_rv ((1-p) (nf + na) ) 1) + tf Theorem: Average Stop-and-Wait Message Delay nf na p tf. (0 p) (p < 1) expec (sr_del nf na p tf) = (tf)/((1-p) (nf + na) ) n Proof: n Ex [ ax + b] = ae[ X ] + b n Expectation of Geometric random variable

32 Outline n Introduction n Theorem Proving based Performance Analysis n Performance Analysis of ARQ Protocols n Conclusions

33 Conclusions n Probabilistic Theorem Proving n Model randomness in systems with higher-order-logic random variables n Verify probabilistic and statistical properties in a theorem prover n Exact Answers n Useful for the analysis of Safety critical application n Performance Analysis of ARQ Protocols n Delay Characteristic Higher-order-logic random variable n Verification of Linearity of Expectation Property in HOL n Results exactly match the paper-and-pencil based analysis methods 100% precise

34 Conclusions n Probabilistic Theorem Proving is not a golden solution to all performance analysis problems n Interactive and tedious nature n Less critical sections of the system n Simulation n Critical sections of the system that can be expressed as a Markov Chain n Model Checking n Critical sections of the system that cannot be handled by Model Checking n Thereom Proving

Thank you For more information: http://hvg.ece.concordia.ca Contact: o_hasan@ece.concordia.ca O. Hasan Performance Analysis of ARQ Protocols using Theorem Proving 35

Additional Slides O. Hasan Performance Analysis of ARQ Protocols using Theorem Proving 36

Performance Analysis Basics Random Variables n Discrete Random Variables n Attain a countable number of values n Examples n n Uniform (countable values in an interval [a,b]) Bernoulli (True, False) n Continuous Random Variables n Attain an uncountable (infinite) number of values n Examples n n Uniform (all real values in an interval [a,b]) Exponential (The time between independent events) O. Hasan Performance Analysis of ARQ Protocols using Theorem Proving 37

Performance Analysis Basics Properties of Random Variables n Used to characterize system s behaviour n Probabilistic properties n Probability (Multiplier delay = x) n Statistical properties n Average message delay of a telecommunication protocol n Major decision making criteria in performance analysis O. Hasan Performance Analysis of ARQ Protocols using Theorem Proving 38