From Qualitative to Quantitative Theories of Software Tom Henzinger IST Austria
Qualitative Software Theories Property Program Analysis Yes/No
Qualitative Software Theories Kripke Program Property ( R ) } G) Structure Analysis Yes/No
Qualitative Software Theories Quantitative Quantitative Timed ( R ) } · 5 G) Program Property Automaton Analysis Yes/No
Qualitative Software Theories Quantitative Quantitative Markov 8 (R ) Pr(} Program Property Process G) ¸ 0.5) Analysis Yes/No
Quantitative Software Theories Quantitative Quantitative Program Property Analysis R -measure of “ fit ” between program and property -could involve cost, quality, performance, etc.
Quantitative Software Theories Quantitative Quantitative (R ) } G) Program Property Analysis The less time between R R and G, the better. -measure of “ fit ” between program and property -could involve cost, quality, performance, etc.
Quantitative Software Theories Quantitative Quantitative (R ) } G) Program Property Analysis The fewer R “ unnecessary ” grants G, -measure of “ fit ” between program and property the better. -could involve cost, quality, performance, etc.
Qualitative Software Theories P 3 P 2 P 1 S 1 S ’ 1 S 2 S ’’ 2 S ’ 2
Qualitative Software Theories P 3 P 2 P 1 S 1 S ’ 1 S 2 S ’’ 2 S ’ 2
Quantitative Software Theories P 3 P 2 P 1 0.5 0.9 0.8 0.7 S 1 S ’ 1 S 2 S ’’ 2 S ’ 2
Quantitative Software Theories P 3 P 2 P 1 0.5 0.9 0.8 0.7 S 1 S ’ 1 S 2 S ’’ 2 S ’ 2 0.2
Quantitative Software Models Q1 Assign values to program behaviors Boolean case: correct vs. incorrect behaviors Q2 Assign values to programs/properties Boolean case: sets of behaviors (nondeterminism) Q3 Assign values to pairs of programs/properties Boolean case: preorders (refinement)
Q1 Assign Values To Program Behaviors a. Probabilities
Q1 Assign Values To Program Behaviors a. Probabilities b. Resource use worst case (sup) vs. average case (limavg) vs. accumulative (sum) (e.g., response time, power consumption)
Q1 Assign Values To Program Behaviors a. Probabilities b. Resource use worst case (sup) vs. average case (limavg) vs. accumulative (sum) (e.g., response time, power consumption) c. Quality measures discounting vs. long-run averaging
Q1 Example: Reliability Values a: ok b: fail Discounted value (0 < d < 1): a aaaaaaaaaa... 1 aaaaaaaab... 1 - d 8 aaab... 1 - d 3 b... 0
Q1 Example: Reliability Values a: ok b: fail Discounted value (0 < d < 1): a aaaaaaaaaa... 1 aaaaaaaab... 1 - d 8 aaab... 1 - d 3 b... 0 Long-run average value: limavg a aaaaaaaaaa... 1 abaabaaab... 1 aaabaaabaaab... 3/4 babbabbba... 0 aaaaaabbb... 0
Q2 Assign Values To Programs sup or limavg sup or exp relative to input distribution
Q3 Assign Distances To Programs a b b a a
Q3 Example: Correctness Distance a b b a a 0 a
Q3 Example: Correctness Distance a b b a a 0 1 a b
Q3 Example: Correctness Distance a b b a a 1/3 b
Q3 Example: Correctness Distance a b b a a 1/3 1/4 b b b b a
Q3 Example: Robustness Distance a b b a a 2/3 a
Q3 Example: Robustness Distance a b b a a 2/3 1/3 a a b a
References 1 Simulation and bisimulation distances [CONCUR 2010 Cerny et al.] 2 Quantitative languages [CSL 2008, LICS 2009, CSL 2011 Boker et al.] 3 Quantitative synthesis [CAV 2009, CAV 2010, CAV 2011 Cerny et al.]
Qualitative Software Theories Program Property Analysis Yes/No
Qualitative Software Theories Property Synthesis Correct Program
Qualitative Software Theories ω - Regular Automaton Graph Game with ω - Regular Objective Correct Program = Winning Strategy
Quantitative Synthesis Quantitative Property Synthesis Optimal Program
Quantitative Synthesis Weighted Automaton Graph Game with worst case Quantitative Objective Optimal Program = Optimal Strategy
Quantitative Synthesis Weighted Automaton Stochastic Graph Game avg case with Quantitative Objective Optimal Program = Optimal Strategy
Games for Quantitative Synthesis 1 Optimizing Resource Use / Performance -costs refer to resource use (e.g., power consumption, context switch) -optimize peak or accumulative or average resource use -formalized using sup or sum or limavg objectives -synthesize schedules, routes, lock placement
Fine grained vs. coarse grained locks: -fine grained locks allow more interleavings, and therefore cause less waiting of threads -coarse grained locks cause fewer context switches, which are expensive Process 1: Process 2: loop loop access x; access x; access y access y end. end.
Fine grained vs. coarse grained locks: -fine grained locks allow more interleavings, and therefore cause less waiting of threads -coarse grained locks cause fewer context switches, which are expensive Process 1: Process 2: loop loop access x; access x; access y access y end. end.
Fine grained vs. coarse grained locks: -fine grained locks allow more interleavings, and therefore cause less waiting of threads -coarse grained locks cause fewer context switches, which are expensive Process 1: Process 2: loop loop access x; access x; access y access y end. end.
Games for Quantitative Synthesis 1 Optimizing Resource Use / Performance 2 Preference between Different Programs -qualitative property, but some programs preferred over others -can be formalized using lexicographic objectives h f, g 1 , ... g n i qualitative specification quantitative objectives
Request-Grant Buchi Automaton RG rg Rg rG rg Rg RG rG Every request is followed by a grant.
Request-Grant limavg Automaton 1 RG: 0 rg: 0 Rg: 1 rG: 0 rg: 1 Rg: 1 RG: 0 rG: 0 Following a request, all steps until the next grant are penalized.
Request-Grant limavg Automaton 2 RG: 0 rg: 0 Rg: 0 rG: 1 rg: 0 Rg: 0 RG: 0 rG: 0 All unnecessary grants are penalized.
Conclusions - We need to move from boolean program correctness criteria to quantitative program preference metrics.
Conclusions - We need to move from boolean program correctness criteria to quantitative program preference metrics. - “ Quantitative ” is more than “ timed ” and “ probabilistic. ”
Conclusions - We need to move from boolean program correctness criteria to quantitative program preference metrics. - “ Quantitative ” is more than “ timed ” and “ probabilistic. ” - Weighted automata over infinite words offer a quantitative specification language: Limit average Sum/ energy Discounting
Conclusions - We need to move from boolean program correctness criteria to quantitative program preference metrics. - “ Quantitative ” is more than “ timed ” and “ probabilistic. ” - Weighted automata over infinite words offer a quantitative specification language: Limit average Sum/ energy Discounting - Games with quantitative objectives offer algorithmic solutions: Quantitative synthesis Simulation distances
Recommend
More recommend