1 / 9

Randomized Analysis with Repeated Conditionals for Affine Equalities

Randomized Analysis with Repeated Conditionals for Affine Equalities. Bor-Yuh Evan Chang CS263 Final Project December 4, 2002. Using Randomization. Goal: Use randomized approaches to: obtain more complete analyses ( i.e. discover more properties of programs) more efficient algorithms

gittel
Download Presentation

Randomized Analysis with Repeated Conditionals for Affine Equalities

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Randomized Analysis with Repeated Conditionals for Affine Equalities Bor-Yuh Evan Chang CS263 Final Project December 4, 2002

  2. Using Randomization • Goal: • Use randomized approaches to: • obtain more complete analyses (i.e. discover more properties of programs) • more efficient algorithms • simpler to implement or understand • Maintain soundness with very high probability • My Contribution: • Build on existing techniques for discovering affine equalities [Gulwani and Necula ’03] • Obtain a more complete analysis with respect to repeated conditionals.

  3. Arbitrary conditionals c = 1 p, d – a  5 p Equivalent conditionals c = 1 p, d – a = 5 X c = 1 X, d – a = 5 X Same weights for equivalent conditionals c = 1 X, d – a = 5 p Problem c1 a := 0 b := 1 a := 1 b := 2 a := 1 b := 5 w1 = 4 a = -3, b = -2 a = -3, b = -11 c1 c := b - a d := 5 c := 1 d := 6 w1 = 4 w2 = -2 c = 1, d = 6 c = -8, d = 5 c = 1, d = 5 c = 19, d = 8 c = 1, d = 8 c = -35, d = 2 c = 1? d – a = 5?

  4. Intuition: If w1 is selected from {0, 1}, then we’re evaluating a specific path. w12 = w1 w1(1 – w1) = 0 (1 – w1)2 = (1 – w1) Naïve Solution: Don’t combine if “defined under” a “repeated” conditional. Problem c1 a := 0 b := 1 a := 1 b := 5 a = w1¢ 0 + (1 – w1) ¢ 1, b = w1¢ 1 + (1 – w1) ¢ 5 c1 c := b - a c := 1 c = 1 c = w1¢ 1 + (1 – w1) ¢ 4 c = w1¢ (w1¢ 1 + (1 – w1) ¢ 4) + (1 – w1) ¢ 1 c = w12¢ 1 + w1(1 – w1) ¢ 4 + (1 – w1) ¢ 1 c = 1?

  5. Fork-Join Programs • Affine equations and fork-join programs • “noise” terms occur from “defined with some conditional c” and then “used under some conditional c”

  6. Randomized Interpreter where K = dom(V) and sample S is a collection of states

  7. Example p a – b – y = 0? weight(c1) = 2, weight(c2) = 4

  8. Summary • Avoids always performing an exponential analysis • Should be sound with high probability as before • Can be used incrementally • Consider no conditionals repeated • Add some conditionals that may be considered repeated

  9. Future Work • Implement and test on some examples • Extend to non-fork-join programs • Dependence between conditionals beyond equivalent conditionals • Non-abstract conditionals • Apply to handling memory operations???

More Related