Faster Algorithms for Weighted Recursive State Machines Krishnendu - - PowerPoint PPT Presentation

β–Ά
faster algorithms for
SMART_READER_LITE
LIVE PREVIEW

Faster Algorithms for Weighted Recursive State Machines Krishnendu - - PowerPoint PPT Presentation

Faster Algorithms for Weighted Recursive State Machines Krishnendu Chatterjee Bernhard Kragl Samarth Mishra Andreas Pavlogiannis Recursive State Machines (RSMs) 1 Formal model of recursive computation B Linearly equivalent to pushdown


slide-1
SLIDE 1

Faster Algorithms for Weighted Recursive State Machines

Krishnendu Chatterjee Bernhard Kragl Samarth Mishra Andreas Pavlogiannis

slide-2
SLIDE 2

Recursive State Machines (RSMs)

Formal model of recursive computation Linearly equivalent to pushdown systems (PDSs) Advantages:

  • Natural modeling
  • Many parameters

– Number of modules 𝑔 – Entry bound πœ„π‘“ = max

𝑗

πΉπ‘œπ‘— – Exit bound πœ„π‘¦ = max

𝑗

|𝐹𝑦𝑗| – πœ„ = max

𝑗

min( πΉπ‘œπ‘— , |𝐹𝑦𝑗|) – …

2

A B C 𝑐1: β„³2 D F G 𝑐2: β„³

1

E β„³

1

β„³2 𝐡, 𝜁 β‡’ 𝐹, 𝑐1 β‡’ 𝐡, 𝑐2𝑐1 β‡’ 𝐢, 𝑐2𝑐1 β‡’ 𝑐2, 𝐷 , 𝑐1 β‡’ 〈 𝑐1, 𝐻 , 𝜁βŒͺ

slide-3
SLIDE 3

RSMs over Semirings

Label RSM transitions with weights from idempotent semiring βŒ©π‘‹,βŠ•,βŠ—, 0,1βŒͺ weight of computation: βŠ— weight of computation set: βŠ•

3

𝑿 βŠ• βŠ— 1 Reachability 𝔺 ∨ ∧ βŠ₯ ⊀ Shortest path ℝ+ βˆͺ {∞} min + ∞ Most probable path [0,1] max β‹… 1 IFDS 2𝐸

𝑒 2𝐸

βŠ“ ∘ πœ‡π‘¦. ⊀ πœ‡π‘¦. 𝑦

Canonical partial order 𝑏 ≀ 𝑐 ⇔ 𝑏 βŠ• 𝑐 = 𝑏 Monotonicity 𝑏 ≀ 𝑐 β‡’ 𝑏 βŠ— 𝑑 ≀ 𝑐 βŠ— 𝑑 Finite-height: 𝐼 ∈ β„• longest descending chain in ≀

slide-4
SLIDE 4

Distance Problems

Given a set of initial configurations 𝑇

  • Configuration distance

𝑒 𝑇, 𝑣, 𝑐1 β‹― bπ‘œ

  • Superconfiguration distance

𝑒 𝑇, 𝑣, β„³

1 β‹― β„³π‘œ

  • Node distance

𝑒 𝑇, 𝑣

4

slide-5
SLIDE 5

Our Solution

  • 1. Configuration automata

Representation structures for sets of RSM configurations [BEM’97] Initial automaton 𝐷, s.t. β„’ 𝐷 = 𝑇

  • 2. Dynamic programming algorithm

Compute π·βˆ—, representing reachable configurations and distances Key: Entry-to-Exit summaries [ABEGRY’05]

  • 3. Distance extraction algorithms

Query configuration/superconfiguration/node distances from π·βˆ—

5

slide-6
SLIDE 6

Configuration Automata

6

𝑣 𝑓 𝜁|𝑀1 β‹― 𝑣′ 𝜁|𝑀4 𝑓′ 𝑐|𝑀2 π‘Ÿ states correspond to RSM nodes run assembles a stack

βŒ©π‘£, 𝑐 β‹― βŒͺ is an accepted configuration Weight of configuration is ⨁ over all accepting runs

slide-7
SLIDE 7

Relaxation Steps

7

𝑣 𝑓 𝜁|𝑀1 Internal transition: 𝑣

𝑀2 𝑣′

𝑣′ 𝜁| … ⨁(𝑀1βŠ— v2) 𝑣 𝑓 𝜁|𝑀1 Call transition: 𝑣

𝑀2 𝑐, 𝑓′

𝑓′ 𝑐| … βŠ• (𝑀1 βŠ— 𝑀2) 𝑣 𝑓′ 𝜁|𝑀 Exit transition: 𝑣 𝑦 βŒ©π‘, 𝑦βŒͺ 𝜁 … βŠ• (𝑀2βŠ— 𝑑𝑣𝑛 𝑓, 𝑦 𝑓 𝑐|𝑀2 𝑑𝑣𝑛 𝑓, 𝑦 : = β‹― βŠ• 𝑀 𝑓′ 𝑓 𝑐|𝑀 Using summary: 𝑑𝑣𝑛 𝑓′, 𝑦 βŒ©π‘, 𝑦βŒͺ 𝜁| … βŠ• 𝑀 βŠ— 𝑑𝑣𝑛 𝑓′, 𝑦

slide-8
SLIDE 8

Reachability Example

8

A B C 𝑐1: β„³2 D F G 𝑐2: β„³

1

E β„³

1

β„³2 A B 𝜁 D E 𝑐1 𝑐1 Summaries: 𝐡 ⇝ 𝐷 F 𝜁 𝑐2 βŒ©π‘2, 𝐷βŒͺ 𝜁 𝐹 ⇝ 𝐻 βŒ©π‘1, 𝐻βŒͺ 𝜁 𝐸 ⇝ 𝐻

slide-9
SLIDE 9

Correctness and Complexity

9

For every configuration 𝑑: 𝑒 β„’ 𝐷 , 𝑑 = π·βˆ—(𝑑) π·βˆ— is constructed in time 𝒫 𝐼 β‹… β„› β‹… πœ„π‘“ + πœ„π‘“ β‹… πœ„π‘¦ β‹… π·π‘π‘šπ‘š Compared to PDS algorithm 𝒫 𝐼 β‹… β„› β‹… πœ„π‘“ β‹… πœ„π‘¦ β‹… 𝑔 Factor

β„› ⋅𝑔

|β„›| πœ„π‘¦+ π·π‘π‘šπ‘š improvement

slide-10
SLIDE 10

Empirical Evaluation

RSM-based algorithm vs. PDS-based algorithm Our tool jMoped

  • 1. Scaling on artificial examples
  • 2. Interprocedural program analysis problems

10

slide-11
SLIDE 11

A Family of Dense RSMs

β„›3

11

β„› β‹… 𝑔

|β„›| πœ„π‘¦ + π·π‘π‘šπ‘š = π‘œ2 β‹… 1 π‘œ2 π‘œ +π‘œ

= 𝒐

slide-12
SLIDE 12

Boolean Programs from SLAM/SDV

Absolute runtime (seconds) Relative speedup

12

slide-13
SLIDE 13

Our Solution

  • 1. Configuration automata

Representation structures for sets of RSM configurations [BEM’97] Initial automaton 𝐷, s.t. β„’ 𝐷 = 𝑇

  • 2. Dynamic programming algorithm

Compute π·βˆ—, representing reachable configurations and distances Key: Entry-to-Exit summaries [ABEGRY’05]

  • 3. Distance extraction algorithms

Query configuration/superconfiguration/node distances from π·βˆ—

13

slide-14
SLIDE 14

Distance Extraction

  • Configuration distance for βŒ©π‘£, 𝑐1 β‹― π‘π‘œβŒͺ

Dynamic programming: 𝒫 π‘œ β‹… πœ„π‘“

2

  • Superconfiguration distance for βŒ©π‘£, β„³

1 β‹― β„³π‘œβŒͺ

Replace 𝑓

𝑐 𝑓′ with 𝑓 β„³ 𝑓′ where β„³ is module of 𝑓′

  • Node distance

Traditional single-source distance problem

14

u 𝑓0𝑑 𝑓1𝑑 π‘“π‘œπ‘‘ β‹― 𝑐1 π‘π‘œ 𝜁

slide-15
SLIDE 15

Distances over Small Semirings

15

1πœ„π‘“ β‹… 𝐡𝑣 β‹… 𝐡𝑐1 β‹― π΅π‘π‘œ β‹… 1πœ„π‘“

π‘ˆ

π‘‹πœ„π‘“Γ—πœ„π‘“ matrix π·βˆ— transitions labeled 𝑐𝑗 π‘‹πœ„π‘“ vector π·βˆ— transitions 𝑣

𝜁 𝑓

  • Constant size semiring (Mailman’s speedup)

𝒫 π‘œ β‹…

πœ„π‘“

2

log πœ„π‘“

  • Size 𝑋 semiring (William’s speedup)

for 𝜁 > 0, 𝒫 π‘œ β‹…

πœ„π‘“ 2 𝜁2log2 πœ„π‘“

(some preprocessing)

  • Binary semiring (Four-Russians speedup)

𝒫 β„› β‹… πœ„π‘“ β‹…

π‘œ log π‘œ

slide-16
SLIDE 16

Summary

  • Faster interprocedural analysis (RSM > PDS)
  • Configuration automata

οƒ  Saturation algorithm (summaries) οƒ  Distance extraction

  • More in the paper

– Further distance extraction speedups – Implications for context-bounded analysis (concurrency)

16

slide-17
SLIDE 17

17

slide-18
SLIDE 18

18