Top Banner
From Boolean to Quantitative System Specifications Tom Henzinger EPFL
78

From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

From Boolean to Quantitative System Specifications

Tom Henzinger EPFL

Page 2: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Outline

1 The Quantitative Agenda

2 Some Basic Open Problems

3 Some Promising Directions

Page 3: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

The Boolean Agenda

Property/ Specification

Yes/No

Analysis

Program/ System

Page 4: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

The Boolean Agenda

Property/ Specification

Yes/No-perhaps a proof -perhaps some counterexamples -perhaps even a proposed fix

Analysis

Program/ System

Page 5: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

The Boolean Agenda

Satisfaction Relation

Property/ Specification

Yes/No-perhaps a proof -perhaps some counterexamples -perhaps even a proposed fix

Structure FormulaProgram/ System

Page 6: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

The Boolean Agenda

Program/ System

Property/ Specification

Yes/No-perhaps a proof -perhaps some counterexamples -perhaps even a proposed fix

Analysis

Every request is followed by a grant.

Transition system.

Page 7: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

The Boolean Agenda

Quantitative Program/ System

Quantitative Property/

Specification

Yes/No-perhaps a proof -perhaps some counterexamples -perhaps even a proposed fix

Analysis

Every request is followed by a grant within 5 time units.

Timed automaton.

Page 8: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

The Boolean Agenda

Quantitative Program/ System

Quantitative Property/

Specification

Yes/No-perhaps a proof -perhaps some counterexamples -perhaps even a proposed fix

Analysis

Every request is followed by a grant within probability 1/2.

Markov process.

Page 9: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

The Boolean Agenda

Quantitative Program/ System

Quantitative Property/

Specification

B-perhaps a proof -perhaps some counterexamples -perhaps even a proposed fix

Analysis

Every request is followed by a grant within probability 1/2.

Markov process.

Page 10: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

The Quantitative Agenda

Quantitative Program/ System

Quantitative Property/

Specification

R-measure of “fit” between system and spec -could be cost, quality, etc.

Analysis

Page 11: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

The Quantitative Agenda

Quantitative Program/ System

Quantitative Property/

Specification

R-measure of “fit” between system and spec -could be cost, quality, etc.

Analysis

Every request is followed by a grant.

The less time between requests and grants, the better.

Page 12: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

The Quantitative Agenda

Quantitative Program/ System

Quantitative Property/

Specification

R-measure of “fit” between system and spec -could be cost, quality, etc.

Analysis

Every request is followed by a grant.

The fewer unnecessary grants, the better.

Page 13: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

The Quantitative Agenda

Q1 Assigning values to behaviors

Boolean case: correct vs. incorrect behaviors

Q2 Assigning values to systems/properties

Boolean case: sets of behaviors (nondeterminism)

Q3 Assigning values to pairs of systems

Boolean case: preorders on systems

Page 14: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Q1 Assigning Values To Behaviors

a. Probabilities

b. Resource use

-worst case vs. average case (e.g. response time, QoS) -peak vs. accumulative (e.g. power consumption)

c. Quality measures

-discounting vs. long-run averaging (e.g. reliability)

Page 15: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Q1 Assigning Values To Behaviors

a: ok b: fail

Discounted value (0 < d < 1):

aaaaaaaaaa... 1 aaaaaaab... 1 - d8 aab... 1 - d3 b... 0

Long-run average value:

aaaaaaaaaa... 1 aaabaaabaaab... 1 – ¼

abaabaaab... 1babbabbba... 0

Page 16: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Q2, Q3 Assigning Values To Systems

x: behaviors w: observations A,B: systems

A(w) = supx { val(x) : obs(x) = w } B(w) = expx { val(x) : obs(x) = w }

Page 17: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Q2, Q3 Assigning Values To Systems

x: behaviors w: observations A,B: systems

A(w) = supx { val(x) : obs(x) = w } B(w) = expx { val(x) : obs(x) = w }

diff(A,B) = supw { |A(w) – B(w)| } ? Compositionality: diff(A||B,A’||B) · f(diff(A,A’)) [AFHMS].

Page 18: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Is there a Quantitative Framework with

-an appealing mathematical formulation, -useful expressive power, and -good algorithmic properties?

(Like the boolean theory of -regularity.)

Page 19: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Outline

1 The Quantitative Agenda

2 Some Basic Open Problems

3 Some Promising Directions

Page 20: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Alphabet: = {a,b,c}

Language: L µ L = (a+b)+(a[c[ (a+b)

abaabaaabccccc... 2 Labcabc... L

Property = Language

Page 21: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Alphabet: = {a,b,c}

Language: L µ L = (a+b)+(a[c[ (a+b)

abaabaaabccccc... 2 Labcabc... L

L: ! B

Boolean Language

Page 22: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Q states : Q ! labeling q0 2 Q initial state

choices : Q Q transition function

Specification = Automaton

a cb

0

1

0

1

0,1

= {0,1}

A:

Page 23: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Q states : Q ! labeling q0 2 Q initial state

choices : Q Q transition function

Specification = Automaton

a cb

0

1

0

1

0,1

= {0,1} L(A) = (a+b)+(a[c[ (a+b)

A:

Page 24: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Q states : Q ! labeling q0 2 Q initial state

choices : Q Q transition function

Specification = Automaton

a cb

0

1

0

1

0,1

0101111... ! aababccc...

A:

“scheduler” “outcome”

Page 25: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Q states : Q ! labeling q0 2 Q initial state

choices : Q Q transition function

Specification = Automaton

Scheduler: x: Q+ ! S ... set of schedulers

Outcome: f(x) = q0q1q2 ... where 8 i : qi+1 = (qi, x(q0...qi))

Language: L = { (f(x)) : x 2 S }

Page 26: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Satisfaction = Language Inclusion

Given two automata A and B, is L(A) µ L(B)?

i.e. 8 w 2 : L(A)(w) · L(B)(w)

Page 27: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Satisfaction = Language Inclusion

Given two automata A and B, is L(A) µ L(B)?

i.e. 8 w 2 : L(A)(w) · L(B)(w)

For finite automata, PSPACE-complete.

Page 28: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Word: element of Probabilistic Word: probability space on Probabilistic Language: set of probabilistic words

Probabilistic Language

w: ab ! 1/2 aab ! 1/4 aaab ! 1/8

...

Page 29: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Q states : Q ! labeling q0 2 Q initial state

choices : Q D(Q) transition function

Markov Decision Process

a cb

0: 0.5

0: 0.5 1: 1

0: 0.5

0,1A:

0: 0.5 1: 1

Page 30: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Q states : Q ! labeling q0 2 Q initial state

choices : Q D(Q) transition function

Markov Decision Process

a cb

0: 0.5

0: 0.5 1: 1

0: 0.5

0,1A:

0: 0.5 1: 1

0101111... ! abccc... ! 1/2aabccc... ! 1/4 ...

Page 31: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Q states : Q ! labeling q0 2 Q initial state

choices : Q D(Q) transition function

Markov Decision Process

Pure scheduler: x: Q+ ! Probabilistic scheduler: x: Q+ ! D()

Page 32: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Q states : Q ! labeling q0 2 Q initial state

choices : Q D(Q) transition function

Markov Decision Process

a cb

0: 0.5

0: 0.5 1: 1

0: 0.5

0,1A:

0: 0.5 1: 1

{0: 0.5, 1: 0.5} ! abccc... ! 9/16 aabccc... ! 9/64

...

Page 33: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Probabilistic Language Inclusion

Given two MDPs A and B, is L(A) µ L(B)?

Page 34: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Probabilistic Language Inclusion

Given two MDPs A and B, is L(A) µ L(B)?

?

Page 35: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Probabilistic Language Inclusion

Given two MDPs A and B, is L(A) µ L(B)?

?Open even if specification B is deterministic (i.e. || = 1) and implementation scheduler required to be pure. If both sides are deterministic, then it can be solved in polynomial time (equivalence of Rabin’s probabilistic automata) [Tzeng, DHR].

Page 36: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Language: L: ! B

Quantitative Language: L: ! R

Quantitative Language

L(ab) = 1/2 L(aab) = 1/4 L(aaab) = 1/8 ...

Page 37: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Q states : Q ! labeling q0 2 Q initial state

choices : Q R £ Q transition function

Weighted Automaton

a cb

0; 4

1; 2

0; 0

0,1; 0A:

1; 1

Page 38: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Q states : Q ! labeling q0 2 Q initial state

choices : Q R £ Q transition function

Weighted Automaton

a cb

0; 4

1; 2

0; 0

0,1; 0A:

1; 1

0101111... ! aababccc...; 4 1111111... ! abccc...; 2

Max value:

Page 39: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Q states : Q ! labeling q0 2 Q initial state

choices : Q R £ Q transition function

Weighted Automaton

Outcome: f(x) = q0v1q1v2q2... where 8 i : (vi+1,qi+1) = (qi, x(q0...qi))

Max value: val(q0v1q1v2q2...) = sup{ vi : i ¸ 1 }

Page 40: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Q states : Q ! labeling q0 2 Q initial state

choices : Q R £ Q transition function

Weighted Automaton

Outcome: f(x) = q0v1q1v2q2... where 8 i : (vi+1,qi+1) = (qi, x(q0...qi))

Max value: val(q0v1q1v2q2...) = sup{ vi : i ¸ 1 }

q-Language: L(w) = sup{ val(f(x)) : x 2 S s.t. (f(x)) = w }

Page 41: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Different Value Functions

Max value: val(q0v1q1v2q2...) = sup{ vi : i ¸ 1 } (only 0 and 1 costs: finite automaton)

Limsup value: val = limn!1 sup{ vi : i ¸ n } (only 0 and 1 costs: Buechi automaton)

Page 42: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Different Value Functions

Max value: val(q0v1q1v2q2...) = sup{ vi : i ¸ 1 } (only 0 and 1 costs: finite automaton)

Limsup value: val = limn!1 sup{ vi : i ¸ n } (only 0 and 1 costs: Buechi automaton)

Limavg value: val = limn!1 1/n ¢ 1·i·n vi

Page 43: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Different Value Functions

Max value: val(q0v1q1v2q2...) = sup{ vi : i ¸ 1 } (only 0 and 1 costs: finite automaton)

Limsup value: val = limn!1 sup{ vi : i ¸ n } (only 0 and 1 costs: Buechi automaton)

Limavg value: val = limn!1 1/n ¢ 1·i·n vi

Discounted: val = i¸ 1 di ¢ vi for some 0<d<1

Page 44: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Weighted Automaton

a cb

0; 4

1; 2

0; 0

0,1; 0A:

1; 1

01010101... ! aabababab...; 2 11111111... ! abccc...; 0

Limsup value:

01010101... ! aabababab...; 1 11111111... ! abccc...; 0

Limavg value:

01010101... ! aabababab...; 2.66... 11111111... ! abccc...; 1.25

Discounted: (d = 0.5)

Page 45: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Quantitative Language Inclusion

Given two weighted automata A and B, is 8 w 2 : L(A)(w) · L(B)(w) ?

Page 46: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Quantitative Language Inclusion

Given two weighted automata A and B, is 8 w 2 : L(A)(w) · L(B)(w) ?

For max and limsup values: PSPACE. For limavg and discounted values: Open.

Page 47: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Quantitative Language Inclusion

Given two weighted automata A and B, is 8 w 2 : L(A)(w) · L(B)(w) ?

For max and limsup values: PSPACE. For limavg and discounted values: Open.

If specification B is deterministic, then it can be solved in polynomial time [CDH].

Page 48: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Quantitative Simulation

a

1

b1

1

1

b

2

a2

0

0

b

0

a0

2

2

a

2

0

·

A not simulated by B.

Simulation game solvable in P for max, and in NP Å coNP for limsup, limavg, discounted [CDH].

A: B:

Page 49: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Quantitative Emptiness and Universality

Emptiness: Given a weighted automaton A, is L(A)(w) ¸ 1 for some word w 2 ?

In P for max, limsup, limavg, and discounted automata. Solvable by finding a path with maximal value [CDH].

Page 50: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Quantitative Emptiness and Universality

Emptiness: Given a weighted automaton A, is L(A)(w) ¸ 1 for some word w 2 ?

In P for max, limsup, limavg, and discounted automata. Solvable by finding a path with maximal value [CDH].

Universality: Given a weighted automaton A, is L(A)(w) ¸ 1 for all words w 2 ?

As hard as language inclusion.

Page 51: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Quantitative Expressiveness

[CDH CSL08, LICS09]

Page 52: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Quantitative Expressiveness

ba,b

0 1

E.g. limavg automata not determinizable:

*b expressible by a nondeterministic limavg automaton.

*b not expressible by a deterministic limavg automaton.

Every b-cycle would need weight 1.Consider wn = (abn).Then val(wn)=1 for sufficiently large n, but wn*b.

Page 53: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Quantitative Closure Properties

Page 54: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Quantitative Closure Properties

a

0

b0

1

1

a

1

b1

0

0

E.g. limavg automata not closed under min:

min(L1,L2) not expressible by a limavg automaton.

Consider wn = (anbn) for large n.Some a-cycle or b-cycle would need average positive weight.Then some word ua or ub would have a positive value.

L1: L2:

Page 55: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Outline

1 The Quantitative Agenda

2 Some Basic Open Problems

3 Some Promising Directions

Page 56: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

The Boolean Agenda

Specification

Yes/No

Analysis

System

Page 57: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

The Boolean Agenda

Specification

Correct System

Synthesis

Page 58: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

The Boolean Agenda

Regular Automaton

Correct System = Winning Strategy

Graph Game with Regular Objective

Page 59: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

3.1 Quantitative Synthesis

Optimal System

Synthesis

Quantitative Specification

Page 60: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

3.1 Quantitative Synthesis

Optimal System = Optimal Strategy

Weighted Automaton

Graph Game with Quantitative Objective

Page 61: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

3.1 Quantitative Synthesis

Graph Game with Quantitative Objective

Weighted Automaton

Optimal System = Optimal Strategy

-positional vs. finite-memory vs. unrestricted strategies

-optimal vs. -optimal strategies

Page 62: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Games for Quantitative Synthesis

1 Constrained Resources

-every weight is a resource cost (e.g. power consumption) -optimize peak resource use: max objective -optimize accumulative resource use: sum objective [Chakrabarti et al.]

Page 63: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Games for Quantitative Synthesis

1 Constrained Resources

2 Preference between Different Implementations

-boolean spec, but certain implementations preferred-formalized using lexicographic objectives

[Jobstmann et al.]

h f, g1, ... gn i

boolean objective quantitative objectives

Page 64: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Request-Grant Limavg Automaton 1

r g

1

1

11

Following a request, all steps until the next grant are penalized.

Page 65: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Request-Grant Limavg Automaton 2

r g

1

1

Following a request, all repeated grants are penalized.

Page 66: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

3.2 Robust Systems

1 Robustness as Mathematical Continuity:

-small input changes should cause small output changes -only possible in a quantitative framework

8 >0. 9 >0. input-change · ) output-change ·

Page 67: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

In general programs are not continuous. But they can less continuous:

read sensor value x; if x · c then y = f1(x)

else y = f2(x);

f1

f2

c

Page 68: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

In general programs are not continuous. But they can less continuous:

read sensor value x; if x · c then y = f1(x)

else y = f2(x);

Or more continuous:

if x · c - then y = f1(x); if x ¸ c + then y = f2(x)

else y = (f2(c+)-f1(c-))(x-c+)/2 + f1(c-);

[Majumdar et at., Gulwani et al.]

f1

f2

c

Page 69: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

3.2 Robust Systems

1 Robustness as Mathematical Continuity:

-small input changes should cause small output changes -only possible in a quantitative framework

8 >0. 9 >0. input-change · ) output-change ·

Example of a Robustness Theorem [AHM]:

If discountedBisimilarity(A,B) > 1 - , then 8w : |A(w) – B(w)| < f().

Page 70: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

3.2 Robust Systems

1 Robustness as Mathematical Continuity:

-small input changes should cause small output changes -only possible in a quantitative framework

2 Robustness w.r.t. Faulty Assumptions:

-environment may violate assumptions -few environment mistakes should cause few system

mistakes -ratio of system to environment mistakes as

quantitative quality measure

[Greimel et al.]

Page 71: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

3.3 Resource Interfaces

-Component interfaces expose resource requirements (e.g. time, memory, power).

-Interfaces are compatible if their combined requirements do not exceed the available resources.

-If the requirements are dynamic, then compatibility can be solved as a graph game with quantitative objectives.

[Chakrabarti et al.]

Page 72: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

2

99

5

9 5

15 19

59

A

B

C

D

E F

G H

node limit = 20

Max Constraint

minimizer maximizer

Page 73: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

2

99

5

9 5

15 19

59

A

B

C

D

E F

G H

node limit = 20

Max Constraint

minimizer maximizer

Page 74: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

-10

99

5

9 -9

15 19

59

A

B

C

D

E F

G H

path limit = 10

Sum Constraint

minimizer maximizer

Page 75: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

-10

99

5

9 -9

15 19

59

A

B

C

D

E F

G H

path limit = 10

Sum Constraint

minimizer maximizer

Page 76: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

3.4 System Reliability

-assuming x% of periodic input values are valid, y% of periodic output values should be valid

-hardware faulty, but can be replicated

-compiler ensures specified reliability through replication

[Ghosal et al.]

Page 77: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

3.4 System Reliability

a: ok b: fail

Limit-average value:

aaaaaaaaaa... 1 aaabaaabaaab... 3/4 ababbabbb... 0

Want reliabitity of 1 – 10-x.

Page 78: From Boolean to Quantitative System Specifications Tom Henzinger EPFL.

Conclusions

-“Quantitative” is more than “timed” and “probabilistic.”

-We need to move from boolean correctness criteria to quantitative system preference metrics.

-We have interesting point solutions, but no convincing overall framework.