faster algorithms for
play

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


  1. Faster Algorithms for Weighted Recursive State Machines Krishnendu Chatterjee Bernhard Kragl Samarth Mishra Andreas Pavlogiannis

  2. Recursive State Machines (RSMs) β„³ 1 Formal model of recursive computation B Linearly equivalent to pushdown A C systems (PDSs) 𝑐 1 : β„³ 2 Advantages: β„³ 2 β€’ Natural modeling D F β€’ Many parameters G – Number of modules 𝑔 𝑐 2 : β„³ E 1 – Entry bound πœ„ 𝑓 = max πΉπ‘œ 𝑗 𝑗 – Exit bound πœ„ 𝑦 = max |𝐹𝑦 𝑗 | 𝑗 𝐡, 𝜁 β‡’ 𝐹, 𝑐 1 β‡’ 𝐡, 𝑐 2 𝑐 1 – πœ„ = max min( πΉπ‘œ 𝑗 , |𝐹𝑦 𝑗 |) β‡’ 𝐢, 𝑐 2 𝑐 1 β‡’ 𝑐 2 , 𝐷 , 𝑐 1 𝑗 – … β‡’ 〈 𝑐 1 , 𝐻 , 𝜁βŒͺ 2

  3. RSMs over Semirings Label RSM transitions with weights from idempotent semiring βŒ©π‘‹,βŠ•,βŠ—, 0,1βŒͺ weight of computation: βŠ— weight of computation set: βŠ• 𝑿 βŠ• βŠ— 0 1 𝔺 ∨ ∧ βŠ₯ ⊀ Reachability ℝ + βˆͺ {∞} + ∞ Shortest path min 0 [0,1] β‹… Most probable path max 0 1 𝑒 2 𝐸 βŠ“ ∘ πœ‡π‘¦. ⊀ πœ‡π‘¦. 𝑦 2 𝐸 IFDS Canonical partial order Monotonicity 𝑏 ≀ 𝑐 ⇔ 𝑏 βŠ• 𝑐 = 𝑏 𝑏 ≀ 𝑐 β‡’ 𝑏 βŠ— 𝑑 ≀ 𝑐 βŠ— 𝑑 Finite-height: 𝐼 ∈ β„• longest descending chain in ≀ 3

  4. Distance Problems Given a set of initial configurations 𝑇 β€’ Configuration distance 𝑒 𝑇, 𝑣, 𝑐 1 β‹― b π‘œ β€’ Superconfiguration distance 𝑒 𝑇, 𝑣, β„³ 1 β‹― β„³ π‘œ β€’ Node distance 𝑒 𝑇, 𝑣 4

  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

  6. Configuration Automata run assembles states correspond a stack to RSM nodes 𝑣 𝜁|𝑀 1 β‹― 𝑐|𝑀 2 𝑓 𝑓′ π‘Ÿ 𝜁|𝑀 4 𝑣′ βŒ©π‘£, 𝑐 β‹― βŒͺ is an accepted configuration Weight of configuration is ⨁ over all accepting runs 6

  7. Relaxation Steps 𝑀 2 𝑣′ Exit transition: 𝑣 𝑦 Internal transition: 𝑣 𝜁|𝑀 1 𝜁|𝑀 𝑐|𝑀 2 𝑣 𝑓 𝑣 𝑓 𝑓′ 𝜁| … ⨁(𝑀 1 βŠ— v 2 ) 𝜁 … βŠ• (𝑀 2 βŠ— 𝑑𝑣𝑛 𝑓, 𝑦 𝑑𝑣𝑛 𝑓, 𝑦 𝑣′ βŒ©π‘, 𝑦βŒͺ : = β‹― βŠ• 𝑀 𝑀 2 𝑐, 𝑓 β€² Using summary: 𝑑𝑣𝑛 𝑓 β€² , 𝑦 Call transition: 𝑣 𝜁|𝑀 1 𝑐|𝑀 𝑣 𝑓 𝑓′ 𝑓 𝜁| … βŠ• 𝑀 βŠ— 𝑑𝑣𝑛 𝑓 β€² , 𝑦 𝑐| … βŠ• (𝑀 1 βŠ— 𝑀 2 ) 𝑓′ βŒ©π‘, 𝑦βŒͺ 7

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

  9. Correctness and Complexity For every configuration 𝑑 : 𝑒 β„’ 𝐷 , 𝑑 = 𝐷 βˆ— (𝑑) 𝐷 βˆ— is constructed in time 𝒫 𝐼 β‹… β„› β‹… πœ„ 𝑓 + πœ„ 𝑓 β‹… πœ„ 𝑦 β‹… π·π‘π‘šπ‘š Compared to PDS algorithm 𝒫 𝐼 β‹… β„› β‹… πœ„ 𝑓 β‹… πœ„ 𝑦 β‹… 𝑔 β„› ⋅𝑔 Factor πœ„π‘¦ + π·π‘π‘šπ‘š improvement |β„›| 9

  10. Empirical Evaluation RSM-based algorithm vs. PDS-based algorithm Our tool jMoped 1. Scaling on artificial examples 2. Interprocedural program analysis problems 10

  11. A Family of Dense RSMs β„› 3 πœ„ 𝑦 + π·π‘π‘šπ‘š = π‘œ 2 β‹… 1 β„› β‹… 𝑔 = 𝒐 |β„›| π‘œ 2 π‘œ +π‘œ 11

  12. Boolean Programs from SLAM/SDV Absolute runtime (seconds) Relative speedup 12

  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

  14. Distance Extraction β€’ Configuration distance for βŒ©π‘£, 𝑐 1 β‹― 𝑐 π‘œ βŒͺ 𝑓 0 𝑑 𝑓 1 𝑑 𝑓 π‘œ 𝑑 𝑐 π‘œ 𝜁 𝑐 1 β‹― u 2 Dynamic programming: 𝒫 π‘œ β‹… πœ„ 𝑓 β€’ Superconfiguration distance for βŒ©π‘£, β„³ 1 β‹― β„³ π‘œ βŒͺ 𝑐 𝑓′ with 𝑓 β„³ 𝑓′ where β„³ is module of 𝑓′ Replace 𝑓 β€’ Node distance Traditional single-source distance problem 14

  15. Distances over Small Semirings 𝑋 πœ„ 𝑓 vector 𝑋 πœ„ 𝑓 Γ—πœ„ 𝑓 matrix 𝜁 𝑓 𝐷 βˆ— transitions labeled 𝑐 𝑗 𝐷 βˆ— transitions 𝑣 π‘ˆ 1 πœ„ 𝑓 β‹… 𝐡 𝑣 β‹… 𝐡 𝑐 1 β‹― 𝐡 𝑐 π‘œ β‹… 1 πœ„ 𝑓 β€’ Constant size semiring (Mailman’s speedup) 2 πœ„ 𝑓 𝒫 π‘œ β‹… log πœ„ 𝑓 Size 𝑋 semiring (William’s speedup) β€’ 2 πœ„π‘“ for 𝜁 > 0 , 𝒫 π‘œ β‹… (some preprocessing) 𝜁2log2 πœ„π‘“ β€’ Binary semiring (Four-Russians speedup) π‘œ 𝒫 β„› β‹… πœ„ 𝑓 β‹… log π‘œ 15

  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

  17. 17

  18. 18

Recommend


More recommend