Probabilistic Verification of Discrete Event Systems

54
Probabilistic Verification of Discrete Event Systems Håkan L. S. Younes

description

Probabilistic Verification of Discrete Event Systems. Håkan L. S. Younes. Introduction. Verify properties of discrete event systems Probabilistic and real-time properties Properties expressed using CSL Acceptance sampling Guaranteed error bounds. “The Hungry Stork”. “The Hungry Stork”. - PowerPoint PPT Presentation

Transcript of Probabilistic Verification of Discrete Event Systems

Page 1: Probabilistic Verification of Discrete Event Systems

Probabilistic Verification of Discrete Event Systems

Håkan L. S. Younes

Page 2: Probabilistic Verification of Discrete Event Systems

Introduction Verify properties of discrete event

systems Probabilistic and real-time

properties Properties expressed using CSL Acceptance sampling Guaranteed error bounds

Page 3: Probabilistic Verification of Discrete Event Systems

“The Hungry Stork”

Page 4: Probabilistic Verification of Discrete Event Systems

“The Hungry Stork”

System

“The probability is at least 0.7 that the stork satisfies its hunger within 180 seconds”

Page 5: Probabilistic Verification of Discrete Event Systems

Systems A stork hunting for frogs The CMU post office The Swedish telephone system The solar system

Page 6: Probabilistic Verification of Discrete Event Systems

Discrete Event Systems Discrete state changes at the

occurrence of events A stork hunting for frogs The CMU post office The Swedish telephone system The solar system

Page 7: Probabilistic Verification of Discrete Event Systems

“The Hungry Stork” as aDiscrete Event System

hungry

Page 8: Probabilistic Verification of Discrete Event Systems

“The Hungry Stork” as aDiscrete Event System

hungry,hunting

hungry

40 sec

stork sees frog

Page 9: Probabilistic Verification of Discrete Event Systems

“The Hungry Stork” as aDiscrete Event System

hungry,hunting,

seen

hungry,hunting

hungry

40 sec 19 sec

stork sees frog

frog sees stork

Page 10: Probabilistic Verification of Discrete Event Systems

“The Hungry Stork” as aDiscrete Event System

hungry,hunting,

seennot hungry

hungry,hunting

hungry

40 sec 19 sec 1 sec

stork sees frog

frog sees stork

stork eats frog

Page 11: Probabilistic Verification of Discrete Event Systems

Sample Execution Paths

hungry,hunting,

seennot hungry

hungry,hunting

hungry

40 sec 19 sec 1 sec

stork sees frog

frog sees stork

stork eats frog

Page 12: Probabilistic Verification of Discrete Event Systems

Properties of Interest Probabilistic real-time properties

“The probability is at least 0.7 that the stork satisfies its hunger within 180 seconds”

Page 13: Probabilistic Verification of Discrete Event Systems

Properties of Interest Probabilistic real-time properties

“The probability is at least 0.7 that the stork satisfies its hunger within 180 seconds”

Page 14: Probabilistic Verification of Discrete Event Systems

Verifying Real-time Properties “The stork satisfies its hunger

within 180 seconds”

True!

hungry,hunting,

seennot hungry

hungry,hunting

hungry

40 sec 19 sec 1 sec

stork sees frog

frog sees stork

stork eats frog

+ + ≤ 180 sec

Page 15: Probabilistic Verification of Discrete Event Systems

Verifying Real-time Properties “The stork satisfies its hunger

within 180 seconds”

False!

not hungryhungry,hunting

hungry

165 sec 30 sec

stork sees frog

Stork eats frog

+ > 180 sec

Page 16: Probabilistic Verification of Discrete Event Systems

Verifying Probabilistic Properties “The probability is at least 0.7 that X”

Symbolic Methods Pro: Exact solution Con: Works for a restricted class of systems

Sampling Pro: Works for all systems that can be

simulated Con: Uncertainty in correctness of solution

Page 17: Probabilistic Verification of Discrete Event Systems

Our Approach Use simulation to generate sample

execution paths Use sequential acceptance

sampling to verify probabilistic properties

Page 18: Probabilistic Verification of Discrete Event Systems

Error Bounds Probability of false negative: ≤

We say that P is false when it is true Probability of false positive: ≤

We say that P is true when it is false

Page 19: Probabilistic Verification of Discrete Event Systems

Acceptance Sampling Hypothesis: “The probability is at

least that X”

Page 20: Probabilistic Verification of Discrete Event Systems

Acceptance Sampling Hypothesis: Pr≥(X)

Page 21: Probabilistic Verification of Discrete Event Systems

SequentialAcceptance Sampling

True, false,or anothersample?

Hypothesis: Pr≥(X)

Page 22: Probabilistic Verification of Discrete Event Systems

Performance of Test

Actual probability of X holding

Pro

bab

ility

of

acc

ep

tin

gPr ≥

(X

) as

tru

e

1 –

Page 23: Probabilistic Verification of Discrete Event Systems

Ideal Performance

Actual probability of X holding

Pro

bab

ility

of

acc

ep

tin

gPr ≥

(X

) as

tru

e

1 –

False negatives

False positives

Page 24: Probabilistic Verification of Discrete Event Systems

Actual Performance

– +

Indifference region

Actual probability of X holding

Pro

bab

ility

of

acc

ep

tin

gPr ≥

(X

) as

tru

e

1 –

False negatives

False positives

Page 25: Probabilistic Verification of Discrete Event Systems

Graphical Representation of Sequential Test

Number of samples

Nu

mb

er

of

posi

tive s

am

ple

s

Page 26: Probabilistic Verification of Discrete Event Systems

Graphical Representation of Sequential Test

We can find an acceptance line and a rejection line given , , , and

Reject

Accept

Continue sampling

Number of samples

Nu

mb

er

of

posi

tive s

am

ple

s

Page 27: Probabilistic Verification of Discrete Event Systems

Graphical Representation of Sequential Test

Reject hypothesis

Reject

Accept

Continue sampling

Number of samples

Nu

mb

er

of

posi

tive s

am

ple

s

Page 28: Probabilistic Verification of Discrete Event Systems

Graphical Representation of Sequential Test

Accept hypothesis

Reject

Accept

Continue sampling

Number of samples

Nu

mb

er

of

posi

tive s

am

ple

s

Page 29: Probabilistic Verification of Discrete Event Systems

Continuous Stochastic Logic (CSL)

State formulas Truth value is determined in a single

state Path formulas

Truth value is determined over an execution path

Page 30: Probabilistic Verification of Discrete Event Systems

State Formulas Standard logic operators: ¬, 1

2 … Probabilistic operator: Pr≥()

True iff probability is at least that holds

Pr≥0.7(“The stork satisfies its hunger within 180 seconds”)

Page 31: Probabilistic Verification of Discrete Event Systems

Path Formulas Until: 1 U≤t 2

Holds iff 2 becomes true in some state along the execution path before time t, and 1 is true in all prior states

“The stork satisfies its hunger within 180 seconds”: true U≤180 ¬hungry

Page 32: Probabilistic Verification of Discrete Event Systems

Expressing Properties in CSL “The probability is at least 0.7 that

the stork satisfies its hunger within 180 seconds” Pr≥0.7(true U≤180 ¬hungry)

“The probability is at least 0.9 that the customer is served within 60 seconds and remains happy while waiting” Pr≥0.9(happy U≤60 served)

Page 33: Probabilistic Verification of Discrete Event Systems

Semantics of Until true U≤180 ¬hungry

True!

hungry,hunting,

seen¬hungry

hungry,hunting

hungry

40 sec 19 sec 1 sec+ + ≤ 180 sec

Page 34: Probabilistic Verification of Discrete Event Systems

Semantics of Until true U≤180 ¬hungry

False!

¬hungryhungry,hunting

hungry

165 sec 30 sec+ > 180 sec

Page 35: Probabilistic Verification of Discrete Event Systems

Semantics of Until happy U≤60 served

False!

happy,¬served

served¬happy,¬served

happy,¬served

17 sec 13 sec 5 sec+ + ≤ 60 sec

Page 36: Probabilistic Verification of Discrete Event Systems

Verifying Probabilistic Statements

Verify Pr≥() with error bounds and Generate sample execution paths using

simulation Verify over each sample execution path

If is true, then we have a positive sample If is false, then we have a negative sample

Use sequential acceptance sampling to test the hypothesis Pr≥()

Page 37: Probabilistic Verification of Discrete Event Systems

Verification of Nested Probabilistic Statements

Suppose , in Pr≥(), contains probabilistic statements Pr≥0.8(true U≤60 Pr≥0.9(true U≤30

¬hungry)) Error bounds ’ and ’ when verifying

Page 38: Probabilistic Verification of Discrete Event Systems

Verification of Nested Probabilistic Statements

Suppose , in Pr≥(), contains probabilistic statements

True, false,or anothersample?

Page 39: Probabilistic Verification of Discrete Event Systems

Modified Test Find an acceptance line and a

rejection line given , , , , ’, and ’:

Reject

Accept

Continue sampling

With ’ and ’ = 0

Number of samples

Nu

mb

er

of

posi

tive s

am

ple

s

Page 40: Probabilistic Verification of Discrete Event Systems

Modified Test Find an acceptance line and a

rejection line given , , , , ’, and ’:

With ’ and ’ > 0

Reject

Accept

Continue sampling

Number of samples

Nu

mb

er

of

posi

tive s

am

ple

s

Page 41: Probabilistic Verification of Discrete Event Systems

Verification of Negation To verify ¬ with error bounds

and Verify with error bounds and

Page 42: Probabilistic Verification of Discrete Event Systems

Verification of Conjunction Verify 1 2 … n with error

bounds and Accept if all conjuncts are true Reject if some conjunct is false

Page 43: Probabilistic Verification of Discrete Event Systems

Acceptance of Conjunction Accept if all conjuncts are true

Accept all i with bounds i and i

Probability at most i that i is false Therefore: Probability at most 1 + … + n

that conjunction is false For example, choose i = /n Note: i unconstrained

Page 44: Probabilistic Verification of Discrete Event Systems

Rejection of Conjunction Reject if some conjunct is false

Reject some i with bounds i and i

Probability at most i that i is true Therefore: Probability at most i that

conjunction is true Choose i = Note: i unconstrained

Page 45: Probabilistic Verification of Discrete Event Systems

Putting it Together To verify 1 2 … n with error

bounds and 1. Verify each i with error bounds and ’

2. Return false as soon as any i is verified to be false

3. If all i are verified to be true, verify each i again with error bounds and /n

4. Return true iff all i are verified to be true

“Fast reject”

Page 46: Probabilistic Verification of Discrete Event Systems

Putting it Together To verify 1 2 … n with error

bounds and 1. Verify each i with error bounds and ’

2. Return false as soon as any i is verified to be false

3. If all i are verified to be true, verify each i again with error bounds and /n

4. Return true iff all i are verified to be true

“Rigorous accept”

Page 47: Probabilistic Verification of Discrete Event Systems

Verification of Path Formulas To verify 1 U≤t 2 with error bounds

and Convert to disjunction

1 U≤t 2 holds if 2 holds in the first state, or if 2 holds in the second state and 1 holds in all prior states, or …

Page 48: Probabilistic Verification of Discrete Event Systems

More on Verifying Until Given 1 U≤t 2, let n be the index of

the first state more than t time units away from the current state

Disjunction of n conjunctions c1 through cn, each of size i

Simplifies if 1 or 2, or both, do not contain any probabilistic statements

Page 49: Probabilistic Verification of Discrete Event Systems

Example Verify Pr≥0.7(true U≤180 ¬hungry) in

with = = 0.1 and = 0.1

hungry

Simulator105 15

10

5

15

Number of samples

Posi

tive s

am

ple

s

Page 50: Probabilistic Verification of Discrete Event Systems

Example Verify Pr≥0.7(true U≤180 ¬hungry) in

with = = 0.1 and = 0.1

hungry

hungry,hunting,

seen

hungry,hunting

hungry

¬hungry

40

19

Total time: 0 sec Total time: 40 sec

1

storksees frog

frogsees stork

storkeats frog

Total time: 59 secTotal time: 60 sec

105 15

10

5

15

Number of samples

Posi

tive s

am

ple

s

Page 51: Probabilistic Verification of Discrete Event Systems

Example Verify Pr≥0.7(true U≤180 ¬hungry) in

with = = 0.1 and = 0.1

hungry,hunting,

seen

hungry,hunting

hungry

hungry,tired

hungry

63

25

2

93

storksees frog

frogsees stork

frogjumps

hungry

storkrested

105 15

10

5

15

Number of samples

Posi

tive s

am

ple

s

Total time: 0 sec Total time: 63 secTotal time: 88 secTotal time: 90 secTotal time: 183 sec

Page 52: Probabilistic Verification of Discrete Event Systems

Example Verify Pr≥0.7(true U≤180 ¬hungry) in

with = = 0.1 and = 0.1

hungry

105 15

10

5

15

Number of samples

Posi

tive s

am

ple

s

Property holds!

Page 53: Probabilistic Verification of Discrete Event Systems

Summary Algorithm for probabilistic

verification of discrete event systems

Sample execution paths generated using simulation

Probabilistic properties verified using sequential acceptance sampling

Page 54: Probabilistic Verification of Discrete Event Systems

Future Work Apply to hybrid dynamic systems Develop heuristics for formula

ordering and parameter selection Use verification to aid policy

generation for real-time stochastic domains