Mul$SE: Mul$-Path Symbolic Execu$on using Value Summaries - - PowerPoint PPT Presentation

mul se mul path symbolic execu on using value summaries
SMART_READER_LITE
LIVE PREVIEW

Mul$SE: Mul$-Path Symbolic Execu$on using Value Summaries - - PowerPoint PPT Presentation

Mul$SE: Mul$-Path Symbolic Execu$on using Value Summaries Koushik Sen University of California, Berkeley Joint work with George Necula, Liang Gong,


slide-1
SLIDE 1

Mul$SE: ¡Mul$-­‑Path ¡Symbolic ¡ Execu$on ¡using ¡Value ¡Summaries ¡ ¡

Koushik ¡Sen ¡

University ¡of ¡California, ¡Berkeley ¡ Joint ¡work ¡with ¡ ¡

George ¡Necula, ¡Liang ¡Gong, ¡Wontae ¡Choi ¡ ¡

Work ¡started ¡at ¡Samsung ¡Research ¡America, ¡ ¡ ¡ ¡ San ¡Jose ¡in ¡Summer ¡2013 ¡

¡

slide-2
SLIDE 2

2 ¡

Concolic ¡Tes$ng ¡or ¡DART ¡

  • Combine ¡random ¡tes$ng ¡(concrete ¡execu$on) ¡and ¡

symbolic ¡tes$ng ¡(symbolic ¡execu$on) ¡ ¡ ¡

¡ ¡ ¡ ¡

¡

Concrete ¡+ ¡Symbolic ¡= ¡Concolic ¡

slide-3
SLIDE 3

3 ¡

Goal ¡

  • Automated ¡test ¡genera$on ¡for ¡real-­‑world ¡

programs ¡

– Generate ¡test ¡inputs ¡ – Execute ¡unit ¡under ¡test ¡on ¡generated ¡test ¡inputs ¡

  • so ¡that ¡all ¡reachable ¡statements ¡are ¡executed ¡

– Any ¡asser$on ¡viola$on ¡gets ¡caught ¡ ¡

slide-4
SLIDE 4

4 ¡

Goal ¡

  • Automated ¡test ¡genera$on ¡for ¡real-­‑world ¡

programs ¡

– Generate ¡test ¡inputs ¡ – Execute ¡unit ¡under ¡test ¡on ¡generated ¡test ¡inputs ¡

  • so ¡that ¡all ¡reachable ¡statements ¡are ¡executed ¡

– Any ¡asser$on ¡viola$on ¡gets ¡caught ¡

  • Our ¡Approach: ¡

– Explore ¡all ¡execu$on ¡paths ¡of ¡a ¡program ¡for ¡all ¡ possible ¡inputs ¡

  • Exploring ¡all ¡execu$on ¡paths ¡ensure ¡that ¡all ¡reachable ¡

statements ¡are ¡executed ¡

slide-5
SLIDE 5

5 ¡

Execu$on ¡Paths ¡of ¡a ¡Program ¡

  • Can ¡be ¡seen ¡as ¡a ¡binary ¡tree ¡

with ¡possibly ¡infinite ¡depth ¡

– Computa$on ¡tree ¡

  • Each ¡node ¡represents ¡the ¡

execu$on ¡of ¡a ¡“if ¡then ¡else” ¡ statement ¡

  • Each ¡edge ¡represents ¡the ¡

execu$on ¡of ¡a ¡sequence ¡of ¡ non-­‑condi$onal ¡statements ¡

  • Each ¡path ¡in ¡the ¡tree ¡

represents ¡an ¡equivalence ¡ class ¡of ¡inputs ¡

1 1 1 1 1 1 1

slide-6
SLIDE 6

Concolic ¡Tes$ng ¡(Dynamic ¡Symbolic ¡Execu$on) ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

slide-7
SLIDE 7

Concolic ¡Tes$ng ¡(Dynamic ¡Symbolic ¡Execu$on) ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ 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 ?

  • 1. var x = readInput
  • 2. var z = readInput

1 1 1

slide-10
SLIDE 10

Concolic ¡Tes$ng ¡(Dynamic ¡Symbolic ¡Execu$on) ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=true ¡ 4 ¡ x0 ¡ z0 ¡ r0 ¡

  • 1. var x = readInput
  • 2. var z = readInput
  • 3. var r = readInput

1 1 1

slide-11
SLIDE 11

Concolic ¡Tes$ng ¡(Dynamic ¡Symbolic ¡Execu$on) ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=true ¡ 5 ¡ 2x0 ¡ z0 ¡ r0 ¡

  • 1. var x = readInput
  • 2. var z = readInput
  • 3. var r = readInput
  • 4. x = 2*x

1 1 1

slide-12
SLIDE 12

Concolic ¡Tes$ng ¡(Dynamic ¡Symb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 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡· ¡100 ¡Æ ¡r0 ¡> ¡1 ¡ 9 ¡ 2x0 ¡ z0 ¡ r0 ¡

  • 1. var x = readInput
  • 2. var z = readInput
  • 3. var r = readInput
  • 4. x = 2*x
  • 5. if(x > 100)
  • 8. if(r > 1)

halt

1 2 3 1 2 3

slide-14
SLIDE 14

Concolic ¡Tes$ng ¡(Dynamic ¡Symbolic ¡Execu$on) ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

1 path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡ 6 ¡ 2x0 ¡ z0 ¡ ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡· ¡100 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡

  • 1. var x = readInput
  • 2. var z = readInput
  • 3. var r = readInput
  • 4. x = 2*x
  • 5. if(x > 100)
  • 8. if(r > 1)
  • 9. z = r - 1

halt halt

1 2 3 2 3 1 2 3

slide-15
SLIDE 15

Concolic ¡Tes$ng ¡(Dynamic ¡Symbolic ¡Execu$on) ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡read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100 ¡Æ ¡z0 ¡= ¡1 ¡ 10 ¡ 2x0 ¡ 0.3 ¡ 1.3 ¡ Á5=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡

  • 1. var x = readInput
  • 2. var z = readInput
  • 3. var r = readInput
  • 4. x = 2*x
  • 5. if(x > 100)
  • 6. if(z == 1)
  • 7. r = 1.3
  • 8. if(r > 1)
  • 9. z = r - 1

halt

  • 8. if(r > 1)

halt

  • 8. if(r > 1)
  • 9. z = r - 1

halt halt

1 2 3 4 5 4 2 3 5 1

slide-19
SLIDE 19

Concolic ¡Tes$ng ¡(Dynamic ¡Symbolic ¡Execu$on) ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

4 1 2 3 5 path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡· ¡100 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á4=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 10 ¡ 2x0 ¡ 0.3 ¡ 1.3 ¡ Á5=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ 1 2 3 4 5

  • 1. var x = readInput
  • 2. var z = readInput
  • 3. var r = readInput
  • 4. x = 2*x
  • 5. if(x > 100)
  • 6. if(z == 1)
  • 7. r = 1.3
  • 8. if(r > 1)
  • 9. z = r - 1

halt

  • 8. if(r > 1)
  • 9. z = r - 1

halt halt

  • 8. if(r > 1)
  • 9. z = r - 1

halt halt

4 2 3 5 1

slide-20
SLIDE 20

Concolic ¡Tes$ng ¡(Dynamic ¡Symbolic ¡Execu$on) ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

4 1 2 3 5 path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡> ¡1 ¡ 51 ¡ 0 ¡ 2 ¡ Á2=2x0 ¡· ¡100 ¡Æ ¡r0 ¡· ¡1 ¡ 0 ¡ 1 ¡ 0 ¡ Á3=2x0 ¡· ¡100 ¡Æ ¡r0 ¡> ¡1 ¡ 0 ¡ 2 ¡ 0 ¡ Á4=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 51 ¡ 1 ¡ 0 ¡ Á5=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡· ¡1 ¡ 51 ¡ 0 ¡ 0 ¡ 1 2 3 4 5

  • 1. var x = readInput
  • 2. var z = readInput
  • 3. var r = readInput
  • 4. x = 2*x
  • 5. if(x > 100)
  • 6. if(z == 1)
  • 7. r = 1.3
  • 8. if(r > 1)
  • 9. z = r - 1

halt

  • 8. if(r > 1)
  • 9. z = r - 1

halt halt

  • 8. if(r > 1)
  • 9. z = r - 1

halt halt

4 2 3 5 1 Solve ¡ Test ¡Inputs ¡

slide-21
SLIDE 21

21 ¡

Path ¡Explosion ¡Problem ¡

  • Path ¡Space ¡of ¡a ¡Large ¡Program ¡is ¡Huge ¡

– Path ¡Explosion ¡Problem ¡

Entire Computation Tree

slide-22
SLIDE 22

22 ¡

Path ¡Explosion ¡Problem ¡

  • Path ¡Space ¡of ¡a ¡Large ¡Program ¡is ¡Huge ¡

– Path ¡Explosion ¡Problem ¡

Explored by Concolic Testing Entire Computation Tree

slide-23
SLIDE 23

Revisit ¡Symbolic ¡Execu$on ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

1 2 3 path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡ 8 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡ 8 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 8 ¡ 2x0 ¡ z0 ¡ 1.3 ¡ 1 2 3

  • 1. var x = readInput
  • 2. var z = readInput
  • 3. var r = readInput
  • 4. x = 2*x
  • 5. if(x > 100)
  • 6. if(z == 1)
  • 7. r = 1.3
  • 8. if(r > 1)
  • 8. if(r > 1)
  • 8. if(r > 1)

2 3 1

slide-24
SLIDE 24

Conven$onal ¡State ¡Merging ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

1 2 3 path ¡ Á pc ¡ x ¡ z ¡ r ¡ (2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r1 ¡= ¡r0) ¡ ¡ Ç ¡(2x0 ¡· ¡100 ¡Æ ¡r1 ¡= ¡r0) ¡ ¡ Ç ¡(2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡Æ ¡r1 ¡= ¡1.3) ¡ 8 ¡ 2x0 ¡ z0 ¡ r1 ¡ 1 2 3

  • 1. var x = readInput
  • 2. var z = readInput
  • 3. var r = readInput
  • 4. x = 2*x
  • 5. if(x > 100)
  • 6. if(z == 1)
  • 7. r = 1.3
  • 8. if(r > 1)
  • 8. if(r > 1)
  • 8. if(r > 1)

2 3 1

slide-25
SLIDE 25

Conven$onal ¡State ¡Merging ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

1 2 3 path ¡ Á pc ¡ x ¡ z ¡ r ¡ (2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r1 ¡= ¡r0) ¡ ¡ Ç ¡(2x0 ¡· ¡100 ¡Æ ¡r1 ¡= ¡r0) ¡ ¡ Ç ¡(2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡Æ ¡r1 ¡= ¡1.3) ¡ 8 ¡ 2x0 ¡ z0 ¡ r1 ¡ 1 2 3

  • 1. var x = readInput
  • 2. var z = readInput
  • 3. var r = readInput
  • 4. x = 2*x
  • 5. if(x > 100)
  • 6. if(z == 1)
  • 7. r = 1.3
  • 8. if(r > 1)
  • 8. if(r > 1)
  • 8. if(r > 1)

2 3 1 Illegal ¡formula ¡if ¡ solver ¡does ¡not ¡ support ¡floa$ng ¡point ¡

slide-26
SLIDE 26

Key ¡Observa$on ¡in ¡Mul$SE ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡· ¡100 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á4=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 10 ¡ 2x0 ¡ 0.3 ¡ 1.3 ¡ Á5=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ 1 2 3 4 5

More ¡Compact ¡representa$on: ¡ If ¡we ¡organize ¡symbolic ¡state ¡ by ¡variables ¡instead ¡of ¡

  • rganizing ¡by ¡paths. ¡
slide-27
SLIDE 27

Key ¡Observa$on ¡in ¡Mul$SE ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡· ¡100 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á4=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 10 ¡ 2x0 ¡ 0.3 ¡ 1.3 ¡ Á5=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ 1 2 3 4 5

Alternate ¡Compact ¡State ¡Representa$on: ¡ pc ¡ ¡10 ¡

slide-28
SLIDE 28

Key ¡Observa$on ¡in ¡Mul$SE ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡· ¡100 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á4=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 10 ¡ 2x0 ¡ 0.3 ¡ 1.3 ¡ Á5=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ 1 2 3 4 5

Alternate ¡Compact ¡State ¡Representa$on: ¡ pc ¡ ¡10 ¡ x ¡ ¡2x0 ¡

¡

slide-29
SLIDE 29

Key ¡Observa$on ¡in ¡Mul$SE ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡· ¡100 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á4=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 10 ¡ 2x0 ¡ 0.3 ¡ 1.3 ¡ Á5=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡· ¡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¡ ¡z0, ¡ ¡ ¡0.3 ¡

¡

slide-31
SLIDE 31

Key ¡Observa$on ¡in ¡Mul$SE ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡· ¡100 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á4=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 10 ¡ 2x0 ¡ 0.3 ¡ 1.3 ¡ Á5=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ 1 2 3 4 5

Alternate ¡Compact ¡State ¡Representa$on: ¡ pc ¡ ¡10 ¡ x ¡ ¡2x0 ¡ z ¡ ¡{(Á1 ¡Ç ¡Á3, ¡r0-­‑1), ¡(Á2 ¡Ç ¡Á5, ¡z0), ¡(Á4, ¡0.3)} ¡

¡

slide-32
SLIDE 32

Key ¡Observa$on ¡in ¡Mul$SE ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡· ¡100 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á4=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 10 ¡ 2x0 ¡ 0.3 ¡ 1.3 ¡ Á5=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ 1 2 3 4 5

Alternate ¡Compact ¡State ¡Representa$on: ¡ pc ¡ ¡10 ¡ x ¡ ¡2x0 ¡ z ¡ ¡{(Á1 ¡Ç ¡Á3, ¡r0-­‑1), ¡(Á2 ¡Ç ¡Á5, ¡z0), ¡(Á4, ¡0.3)} ¡ r ¡ ¡{(Á1 ¡Ç ¡Á2 ¡Ç ¡Á3 ¡Ç ¡Á5, ¡r0), ¡(Á4, ¡1.3)} ¡

¡

slide-33
SLIDE 33

Key ¡Observa$on ¡in ¡Mul$SE ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡· ¡100 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á4=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 10 ¡ 2x0 ¡ 0.3 ¡ 1.3 ¡ Á5=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ 1 2 3 4 5

Alternate ¡Compact ¡State ¡Representa$on: ¡ pc ¡ ¡{(true, ¡10)} ¡ x ¡ ¡{(true, ¡2x0)} ¡ z ¡ ¡{(Á1 ¡Ç ¡Á3, ¡r0-­‑1), ¡(Á2 ¡Ç ¡Á5, ¡z0), ¡(Á4, ¡0.3)} ¡ r ¡ ¡{(Á1 ¡Ç ¡Á2 ¡Ç ¡Á3 ¡Ç ¡Á5, ¡r0), ¡(Á4, ¡1.3)} ¡

¡

slide-34
SLIDE 34

Key ¡Observa$on ¡in ¡Mul$SE ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡· ¡100 ¡Æ ¡r0 ¡> ¡1 ¡ 10 ¡ 2x0 ¡ r0 ¡-­‑ ¡1 ¡ r0 ¡ Á4=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 10 ¡ 2x0 ¡ 0.3 ¡ 1.3 ¡ Á5=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r0 ¡· ¡1 ¡ 10 ¡ 2x0 ¡ z0 ¡ r0 ¡ 1 2 3 4 5

Alternate ¡Compact ¡State ¡Representa$on: ¡ pc ¡ ¡{(true, ¡10)} ¡ x ¡ ¡{(true, ¡2x0)} ¡ z ¡ ¡{(Á1 ¡Ç ¡Á3, ¡r0-­‑1), ¡(Á2 ¡Ç ¡Á5, ¡z0), ¡(Á4, ¡0.3)} ¡ r ¡ ¡{(Á1 ¡Ç ¡Á2 ¡Ç ¡Á3 ¡Ç ¡Á5, ¡r0), ¡(Á4, ¡1.3)} ¡

¡

Value ¡Summary ¡

slide-35
SLIDE 35

Revisit ¡Symbolic ¡Execu$on ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

1 2 3 path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡ 8 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡ 8 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 8 ¡ 2x0 ¡ z0 ¡ 1.3 ¡ 1 2 3

  • 1. var x = readInput
  • 2. var z = readInput
  • 3. var r = readInput
  • 4. x = 2*x
  • 5. if(x > 100)
  • 6. if(z == 1)
  • 7. r = 1.3
  • 8. if(r > 1)
  • 8. if(r > 1)
  • 8. if(r > 1)

2 3 1

slide-36
SLIDE 36

Revisit ¡Symbolic ¡Execu$on ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡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¡Ç ¡Á2, ¡r0> ¡1), ¡(Á3, ¡true)} ¡ ¡ ¡ ¡ ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

computes ¡(r ¡> ¡1) ¡two ¡$mes ¡

slide-39
SLIDE 39

Mul$SE ¡with ¡Value ¡Summary: ¡Branching ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

1 2 3 path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡ 8 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡ 8 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 8 ¡ 2x0 ¡ z0 ¡ 1.3 ¡ 1 2 3

Value ¡Summary ¡ pc ¡ ¡{(???, ¡9), ¡(???, ¡10)} ¡ x ¡ ¡{(true, ¡2x0)} ¡ z ¡ ¡{(true, ¡z0)} ¡ r ¡ ¡{(Á1 ¡Ç ¡Á2, ¡r0), ¡(Á3, ¡1.3)} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡> ¡1 ¡evaluates ¡to ¡ ¡{(Á1 ¡Ç ¡Á2, ¡r0>1), ¡(Á3, ¡true)} ¡ ¡ ¡ ¡ ¡ ¡ ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

need ¡to ¡fork ¡and ¡update ¡pc ¡

slide-40
SLIDE 40

Mul$SE ¡with ¡Value ¡Summary: ¡Branching ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

1 2 3 path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡ 8 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡ 8 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 8 ¡ 2x0 ¡ z0 ¡ 1.3 ¡ 1 2 3

Value ¡Summary ¡ pc ¡ ¡{(???, ¡9), ¡(???, ¡10)} ¡ x ¡ ¡{(true, ¡2x0)} ¡ z ¡ ¡{(true, ¡z0)} ¡ r ¡ ¡{(Á1 ¡Ç ¡Á2, ¡r0), ¡(Á3, ¡1.3)} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡> ¡1 ¡evaluates ¡to ¡ ¡{(Á1 ¡Ç ¡Á2, ¡r0>1), ¡(Á3, ¡true)} ¡ ¡ ¡ ¡ ¡ ¡ ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

r ¡> ¡1 ¡is ¡true ¡if ¡((Á1 ¡Ç ¡Á2) ¡Æ ¡r0 ¡> ¡1) ¡Ç ¡(Á3 ¡Æ ¡true) ¡holds ¡

slide-41
SLIDE 41

Mul$SE ¡with ¡Value ¡Summary: ¡Branching ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

1 2 3 path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡ 8 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡ 8 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 8 ¡ 2x0 ¡ z0 ¡ 1.3 ¡ 1 2 3

Value ¡Summary ¡ pc ¡ ¡{(Á ¡6,9), ¡(¬Á6, ¡10)} ¡ x ¡ ¡{(true, ¡2x0)} ¡ z ¡ ¡{(true, ¡z0)} ¡ r ¡ ¡{(Á1 ¡Ç ¡Á2, ¡r0), ¡(Á3, ¡1.3)} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡> ¡1 ¡evaluates ¡to ¡ ¡{(Á1 ¡Ç ¡Á2, ¡r0>1), ¡(Á3, ¡true)} ¡ ¡ ¡ ¡ ¡ ¡ ¡

¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

r ¡> ¡1 ¡is ¡true ¡if ¡Á6 ¡= ¡((Á1 ¡Ç ¡Á2) ¡Æ ¡r0 ¡> ¡1) ¡Ç ¡(Á3 ¡Æ ¡true) ¡holds ¡

slide-42
SLIDE 42

Mul$SE ¡with ¡Value ¡Summary: ¡Assignment ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡ Value ¡Summary ¡ pc ¡ ¡{(Á ¡6,9), ¡(¬Á6, ¡10)}, ¡ ¡ ¡where ¡Á6 ¡= ¡((Á1 ¡Ç ¡Á2) ¡Æ ¡r0 ¡> ¡1) ¡Ç ¡Á3 ¡ x ¡ ¡{(true, ¡2x0)} ¡ z ¡ ¡{(true, ¡z0)} ¡ r ¡ ¡{(Á1 ¡Ç ¡Á2, ¡r0), ¡(Á3, ¡1.3)} ¡

what ¡do ¡we ¡execute ¡next? ¡

slide-43
SLIDE 43

Mul$SE ¡with ¡Value ¡Summary: ¡Assignment ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡ Value ¡Summary ¡ pc ¡ ¡{(Á ¡6,9), ¡(¬Á6, ¡10)}, ¡ ¡ ¡where ¡Á6 ¡= ¡((Á1 ¡Ç ¡Á2) ¡Æ ¡r0 ¡> ¡1) ¡Ç ¡Á3 ¡ x ¡ ¡{(true, ¡2x0)} ¡ z ¡ ¡{(true, ¡z0)} ¡ r ¡ ¡{(Á1 ¡Ç ¡Á2, ¡r0), ¡(Á3, ¡1.3)} ¡

pick ¡(Á6, ¡9), ¡i.e. ¡execute ¡line ¡9 ¡ with ¡path ¡constraint ¡Á6 ¡

slide-44
SLIDE 44

Mul$SE ¡with ¡Value ¡Summary: ¡Assignment ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡ Value ¡Summary ¡ pc ¡ ¡{(Á6,9), ¡(¬Á6, ¡10)}, ¡ ¡ ¡where ¡Á6 ¡= ¡((Á1 ¡Ç ¡Á2) ¡Æ ¡r0 ¡> ¡1) ¡Ç ¡Á3 ¡ x ¡ ¡{(true, ¡2x0)} ¡ z ¡ ¡{(true, ¡z0)} ¡ r ¡ ¡{(Á1 ¡Ç ¡Á2, ¡r0), ¡(Á3, ¡1.3)} ¡ ¡ ¡ ¡ r-­‑1 ¡evaluates ¡to ¡{(Á1 ¡Ç ¡Á2, ¡r0-­‑1), ¡(Á3, ¡0.3)} ¡ ¡

pick ¡(Á6, ¡9), ¡i.e. ¡execute ¡line ¡9 ¡ with ¡path ¡constraint ¡Á6 ¡ How ¡do ¡we ¡update ¡z? ¡

slide-45
SLIDE 45

Mul$SE ¡with ¡Value ¡Summary: ¡Assignment ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡ Value ¡Summary ¡ pc ¡ ¡{(Á6,9), ¡(¬Á6, ¡10)}, ¡ ¡ ¡where ¡Á6 ¡= ¡((Á1 ¡Ç ¡Á2) ¡Æ ¡r0 ¡> ¡1) ¡Ç ¡Á3 ¡ x ¡ ¡{(true, ¡2x0)} ¡ z ¡ ¡{(¬ ¡Á6, ¡z0), ¡(Á6 ¡Æ ¡(Á1 ¡Ç ¡Á2), ¡r0-­‑1), ¡(Á6 ¡Æ ¡Á3, ¡0.3)} ¡ r ¡ ¡{(Á1 ¡Ç ¡Á2, ¡r0), ¡(Á3, ¡1.3)} ¡ ¡ ¡ ¡ r-­‑1 ¡evaluates ¡to ¡{(Á1 ¡Ç ¡Á2, ¡r0-­‑1), ¡(Á3, ¡0.3)} ¡ ¡ ¡

Idea: ¡z ¡ ¡union ¡of ¡old-­‑value ¡summary ¡of ¡z ¡ and ¡value ¡summary ¡of ¡r ¡-­‑ ¡1 ¡ pick ¡(Á6, ¡9), ¡i.e. ¡execute ¡line ¡9 ¡ with ¡path ¡constraint ¡Á6 ¡ How ¡do ¡we ¡update ¡z? ¡

slide-46
SLIDE 46

Mul$SE ¡with ¡Value ¡Summary: ¡Assignment ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡ Value ¡Summary ¡ pc ¡ ¡{(Á6,10), ¡(¬Á6, ¡10)}, ¡ ¡ ¡where ¡Á6 ¡= ¡((Á1 ¡Ç ¡Á2) ¡Æ ¡r0 ¡> ¡1) ¡Ç ¡Á3 ¡ x ¡ ¡{(true, ¡2x0)} ¡ z ¡ ¡{((¬ ¡Á6, ¡z0), ¡(Á6 ¡Æ ¡(Á1 ¡Ç ¡Á2), ¡r0-­‑1), ¡(Á6 ¡Æ ¡Á3, ¡0.3)} ¡ r ¡ ¡{(Á1 ¡Ç ¡Á2, ¡r0), ¡(Á3, ¡1.3)} ¡ ¡ ¡ ¡ r-­‑1 ¡evaluates ¡to ¡{(Á1 ¡Ç ¡Á2, ¡r0-­‑1), ¡(Á3, ¡0.3)} ¡ ¡ ¡

Idea: ¡z ¡ ¡union ¡of ¡old-­‑value ¡summary ¡of ¡z ¡ and ¡value ¡summary ¡of ¡r ¡-­‑ ¡1 ¡ pick ¡(Á6, ¡9), ¡i.e. ¡execute ¡line ¡9 ¡ with ¡path ¡constraint ¡Á6 ¡ How ¡do ¡we ¡update ¡z? ¡

slide-47
SLIDE 47

Mul$SE ¡with ¡Value ¡Summary: ¡Assignment ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡ Value ¡Summary ¡ pc ¡ ¡{(true,10)}, ¡ ¡ ¡where ¡Á6 ¡= ¡((Á1 ¡Ç ¡Á2) ¡Æ ¡r0 ¡> ¡1) ¡Ç ¡Á3 ¡ x ¡ ¡{(true, ¡2x0)} ¡ z ¡ ¡{((¬ ¡Á6, ¡z0), ¡(Á6 ¡Æ ¡(Á1 ¡Ç ¡Á2), ¡r0-­‑1), ¡(Á6 ¡Æ ¡Á3, ¡0.3)} ¡ r ¡ ¡{(Á1 ¡Ç ¡Á2, ¡r0), ¡(Á3, ¡1.3)} ¡ ¡ ¡ ¡ r-­‑1 ¡evaluates ¡to ¡{(Á1 ¡Ç ¡Á2, ¡r0-­‑1), ¡(Á3, ¡0.3)} ¡ ¡ ¡

Idea: ¡z ¡ ¡union ¡of ¡old-­‑value ¡summary ¡of ¡z ¡ and ¡value ¡summary ¡of ¡r ¡-­‑ ¡1 ¡ pick ¡(Á6, ¡9), ¡i.e. ¡execute ¡line ¡9 ¡ with ¡path ¡constraint ¡Á6 ¡ How ¡do ¡we ¡update ¡z? ¡

slide-48
SLIDE 48

Mul$SE ¡with ¡Value ¡Summary: ¡Final ¡State ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡ Value ¡Summary ¡ pc ¡ ¡{(true, ¡10)} ¡ x ¡ ¡{(true, ¡2x0)} ¡ z ¡ ¡{(Á1 ¡Ç ¡Á3, ¡r0-­‑1), ¡(Á2 ¡Ç ¡Á5, ¡z0), ¡(Á4, ¡0.3)} ¡ r ¡ ¡{(Á1 ¡Ç ¡Á2 ¡Ç ¡Á3 ¡Ç ¡Á5, ¡r0), ¡(Á4, ¡1.3)} ¡

¡

slide-49
SLIDE 49

Advantages ¡of ¡Mul$SE ¡(1/3) ¡

  • Value ¡Summary ¡

– enables ¡sharing ¡of ¡states ¡among ¡different ¡paths ¡ – avoids ¡redundant ¡execu$on ¡ – the ¡ra$o ¡of ¡the ¡number ¡of ¡paths ¡to ¡the ¡number ¡of ¡ dis$nct ¡symbolic ¡expressions ¡in ¡value ¡summaries ¡ for ¡each ¡variable, ¡ranges ¡from ¡3 ¡to ¡45 ¡in ¡our ¡ experiments ¡

slide-50
SLIDE 50

Avoid ¡Redundant ¡Execu$on ¡with ¡Value ¡Summaries ¡ ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

1 2 3 path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡ 8 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡ 8 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 8 ¡ 2x0 ¡ z0 ¡ 1.3 ¡ 1 2 3

  • 1. var x = readInput
  • 2. var z = readInput
  • 3. var r = readInput
  • 4. x = 2*x
  • 5. if(x > 100)
  • 6. if(z == 1)
  • 7. r = 1.3
  • 8. if(r > 1)
  • 8. if(r > 1)
  • 8. if(r > 1)

2 3 1

computes ¡(r ¡> ¡1) ¡three ¡$mes ¡

slide-51
SLIDE 51

Avoid ¡Redundant ¡Execu$on ¡with ¡Value ¡Summaries ¡ ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

1 2 3 path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡ 8 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡ 8 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 8 ¡ 2x0 ¡ z0 ¡ 1.3 ¡ 1 2 3

Value ¡Summary ¡ pc ¡ ¡{(true, ¡8)} ¡ x ¡ ¡{(true, ¡2x0)} ¡ z ¡ ¡{(true, ¡z0)} ¡ r ¡ ¡{(Á1 ¡Ç ¡Á2, ¡r0), ¡(Á3, ¡1.3)} ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡

computes ¡(r ¡> ¡1) ¡two ¡$mes ¡

slide-52
SLIDE 52

Advantages ¡of ¡Mul$SE ¡(2/3) ¡

  • Incremental ¡State ¡Merging ¡

– Conven$onal ¡state ¡merging ¡iterates ¡over ¡the ¡ modified ¡symbolic ¡state ¡and ¡merges ¡at ¡join ¡points ¡ – ¡Implementa$on ¡challenges ¡

  • Iden$fying ¡the ¡join ¡points ¡
  • keeping ¡track ¡of ¡the ¡modified ¡part ¡of ¡the ¡state ¡ ¡
  • merging ¡the ¡modified ¡state ¡

– Mul$SE ¡performs ¡incremental ¡state ¡merging ¡at ¡ every ¡assignment ¡statement ¡ ¡

  • even ¡if ¡the ¡join ¡points ¡are ¡unknown ¡sta$cally ¡
slide-53
SLIDE 53

Advantages ¡of ¡Mul$SE ¡(3/3) ¡

  • No ¡Auxiliary ¡Variables ¡in ¡Mul$SE: ¡ ¡

– Execu$on ¡can ¡proceed ¡even ¡if ¡certain ¡theories ¡are ¡ not ¡supported ¡by ¡the ¡constraint ¡solver ¡

slide-54
SLIDE 54

Auxiliary ¡Variables ¡in ¡Conven$onal ¡State ¡Merging ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

1 2 3 path ¡ Á pc ¡ x ¡ z ¡ r ¡ Á1=2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡ 8 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á2=2x0 ¡· ¡100 ¡ 8 ¡ 2x0 ¡ z0 ¡ r0 ¡ Á3=2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡ 8 ¡ 2x0 ¡ z0 ¡ 1.3 ¡ 1 2 3

  • 1. var x = readInput
  • 2. var z = readInput
  • 3. var r = readInput
  • 4. x = 2*x
  • 5. if(x > 100)
  • 6. if(z == 1)
  • 7. r = 1.3
  • 8. if(r > 1)
  • 8. if(r > 1)
  • 8. if(r > 1)

2 3 1

slide-55
SLIDE 55

Auxiliary ¡Variables ¡in ¡Conven$onal ¡State ¡Merging ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡z ¡= ¡readInput; ¡ 3: ¡var ¡r ¡= ¡readInput; ¡ 4: ¡x ¡= ¡2*x; ¡ 5: ¡if ¡(x ¡> ¡100) ¡ ¡ 6: ¡ ¡ ¡ ¡if ¡(z ¡== ¡1) ¡ ¡ 7: ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡r ¡= ¡1.3; ¡ 8: ¡if ¡(r ¡> ¡1) ¡ ¡ 9: ¡ ¡ ¡ ¡z ¡= ¡r ¡– ¡1; ¡ 10: ¡halt ¡ ¡

1 2 3 path ¡ Á pc ¡ x ¡ z ¡ r ¡ (2x0 ¡> ¡100 ¡Æ ¡z0 ¡≠ ¡1 ¡Æ ¡r1 ¡= ¡r0) ¡ ¡ Ç ¡(2x0 ¡· ¡100 ¡Æ ¡r1 ¡= ¡r0) ¡ ¡ Ç ¡(2x0 ¡> ¡100 ¡Æ ¡z0 ¡= ¡1 ¡Æ ¡r1 ¡= ¡1.3) ¡ 8 ¡ 2x0 ¡ z0 ¡ r1 ¡ 1 2 3

  • 1. var x = readInput
  • 2. var z = readInput
  • 3. var r = readInput
  • 4. x = 2*x
  • 5. if(x > 100)
  • 6. if(z == 1)
  • 7. r = 1.3
  • 8. if(r > 1)
  • 8. if(r > 1)
  • 8. if(r > 1)

2 3 1 Illegal ¡formula ¡if ¡ solver ¡does ¡not ¡ support ¡floa$ng ¡point ¡

slide-56
SLIDE 56

Advantages ¡of ¡Mul$SE ¡(3/3) ¡

  • No ¡Auxiliary ¡Variables ¡in ¡Mul$SE: ¡ ¡

– Execu$on ¡can ¡proceed ¡even ¡if ¡certain ¡theories ¡are ¡ not ¡supported ¡by ¡the ¡constraint ¡solver ¡ – no ¡need ¡for ¡expensive ¡constraint ¡solver ¡calls ¡ where ¡conven$onal ¡state ¡merging ¡introduces ¡ auxiliary ¡symbolic ¡values ¡for ¡func$ons ¡ ¡

slide-57
SLIDE 57

Mul$SE ¡avoids ¡constraint ¡solver ¡calls ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡f, ¡r ¡= ¡0; ¡ 3: ¡if ¡(x ¡> ¡0) ¡ ¡ 4: ¡ ¡ ¡ ¡ ¡ ¡ ¡f ¡= ¡func$on ¡f1() ¡{ ¡return ¡1;} ¡ 5: ¡else ¡ 6: ¡ ¡ ¡ ¡ ¡ ¡ ¡f ¡= ¡func$on ¡f2() ¡{ ¡return ¡-­‑1;} ¡ 7: ¡r ¡= ¡f(); ¡ ¡

slide-58
SLIDE 58

Mul$SE ¡avoids ¡constraint ¡solver ¡calls ¡

1: ¡var ¡x ¡= ¡readInput; ¡ 2: ¡var ¡f, ¡r ¡= ¡0; ¡ 3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¡(x ¡> ¡0) ¡ ¡ 4: ¡ ¡ ¡ ¡ ¡ ¡ ¡f ¡= ¡func$on ¡f1() ¡{ ¡return ¡1;} ¡ 5: ¡else ¡ 6: ¡ ¡ ¡ ¡ ¡ ¡ ¡f ¡= ¡func$on ¡f2() ¡{ ¡return ¡-­‑1;} ¡ 7: ¡r ¡= ¡f(); ¡ ¡

Á pc ¡ x ¡ f ¡ r ¡ x0 ¡> ¡0 ¡ 7 ¡ x0 ¡ f1 ¡ 0 ¡ x0 ¡· ¡0 ¡ 7 ¡ x0 ¡ f2 ¡ 0 ¡ Á pc ¡ x ¡ f ¡ r ¡ ((x0 ¡> ¡0 ¡Æ ¡f0 ¡= ¡f1) ¡Ç ¡(x0 ¡· ¡0 ¡Æ ¡f0 ¡= ¡f2) ¡ 7 ¡ x0 ¡ f0 ¡ 0 ¡

Value ¡Summary ¡at ¡7: ¡ pc ¡ ¡{(true, ¡7)} ¡ r ¡ ¡{(true, ¡0)} ¡ x ¡ ¡{(true, ¡x0)} ¡ f ¡ ¡{(x0>0, ¡f1), ¡(x0 ¡· ¡0, ¡f2)} ¡

Symbolic ¡Execu$on ¡State ¡ Conven$onal ¡State ¡Merging ¡ Mul$SE ¡

slide-61
SLIDE 61

Advantages ¡of ¡Mul$SE ¡(3/3) ¡

  • No ¡Auxiliary ¡Variables ¡in ¡Mul$SE: ¡ ¡

– Execu$on ¡can ¡proceed ¡even ¡if ¡certain ¡theories ¡are ¡ not ¡supported ¡by ¡the ¡constraint ¡solver ¡ – no ¡need ¡for ¡expensive ¡constraint ¡solver ¡calls ¡ where ¡conven$onal ¡state ¡merging ¡introduces ¡ auxiliary ¡symbolic ¡values ¡for ¡func$ons ¡ ¡ – Execu$on ¡can ¡carry ¡out ¡most ¡opera$ons ¡ concretely ¡

slide-62
SLIDE 62

Mul$SE ¡allows ¡more ¡concrete ¡execu$on ¡

1: ¡var ¡r ¡= ¡[2]; ¡ ¡// ¡array ¡with ¡1 ¡element ¡ 2: ¡var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¡ 8: ¡t[0] ¡= ¡4; ¡ ¡ Value ¡Summary ¡at ¡8: ¡ pc ¡ ¡8, ¡x ¡ ¡x0, ¡ ¡ r ¡ ¡a0, ¡s ¡ ¡a1, ¡ ¡ a0 ¡ ¡2, ¡a1 ¡ ¡3, ¡ t ¡ ¡{(x0>0, ¡a0), ¡(x0 ¡· ¡0, ¡a1)} ¡

Mul$SE ¡

Value ¡Summary ¡aoer ¡8: ¡ pc ¡ ¡8, ¡x ¡ ¡x0, ¡ ¡ r ¡ ¡a0, ¡s ¡ ¡a1, ¡ ¡ t ¡ ¡{(x0>0, ¡a0), ¡(x0 ¡· ¡0, ¡a1)} ¡ a0 ¡ ¡{(x0 ¡> ¡0, ¡4), ¡(x0 ¡· ¡0, ¡2)}, ¡ ¡ a1 ¡ ¡{(x0 ¡· ¡0, ¡4), ¡(x0 ¡> ¡0, ¡3)} ¡ ¡

Mul$SE ¡

slide-65
SLIDE 65

Implementa$on ¡

  • Binary ¡Decision ¡Diagrams ¡(BDDs) ¡are ¡used ¡to ¡

compactly ¡represent ¡guards ¡

  • Value ¡Summaries ¡are ¡compacted ¡

– if ¡s ¡contains ¡(Á,v) ¡and ¡(Á’, ¡v’) ¡

v ¡= ¡v’ ¡

¡ ¡ ¡ ¡ ¡replace ¡(Á,v) ¡and ¡(Á’, ¡v’) ¡with ¡(Á ¡Ç ¡Á’, ¡v) ¡in ¡s ¡ – if ¡(false, ¡v) ¡is ¡in ¡s, ¡we ¡can ¡remove ¡it ¡

slide-66
SLIDE 66

Implementa$on ¡for ¡JavaScript ¡

  • Implemented ¡in ¡the ¡Jalangi ¡framework ¡for ¡

JavaScript ¡

  • CVC3 ¡for ¡constraint ¡solving ¡
  • handles ¡theory ¡of ¡linear ¡arithme$c ¡and ¡subset ¡
  • f ¡strings ¡
slide-67
SLIDE 67

Results ¡

Test LOC MultiSE DSE/ MultiSE Total time (s) BDD time (%) Solver time (%) Avg. value summ. size Avg. value summ. share factor Variable merges saved Time ratio (× speedup) # Op. ratio Find Max 32 5.0 1.2 97.9 1.9 23.0 10.0 28.7 Kadane Subarray 38 6.5 1.0 98.4 2.4 3.2 2.7 6.9 Array Index 56 11.7 5.3 93.4 9.1 9.1 3.7 3.3 Calc Parser 66 35.5 8.9 90.2 20.4 9.8 1.6 2.8 Stack 81 0.6 6.2 89.0 2.4 7.7 44 (41.5%) 26.2 9.1 Queue 85 0.3 93.1 1.0 5.4 6.7 4.2 Heap Sort 87 4.0 1.5 96.7 1.7 5.6 2.5 8.5 Quick Sort 93 15.1 4.6 94.6 3.6 7.1 2.6 3.7 PL/0 Parser 135 246.4 18.7 80.4 29.3 45.8 1.3 2.7 Linked List 148 2.5 3.6 95.1 2.8 5.3 124 (56.8%) 11.1 5.1 Priority Queue 190 0.9 3.2 92.3 1.2 31.5 10 (10%) 87.7 47.5 Binary Search Tree 386 6.5 2.4 96.6 2.4 9.4 188 (78.3%) 7.3 5.6 Symbolic Arithmetic 475 1.5 9.1 82.3 1.8 39.3 168 (28.3%) 49.3 34.0 BDD 623 6.2 68.2 19.6 2.5 6.4 15838 (59.2%) 7.5 5.4 Red Black 1061 37.1 11.3 88.0 3.5 43.6 1088 (57.9%) 6.5 8.8

Table 1. Statistics of MultiSE

slide-68
SLIDE 68

Related ¡Work ¡

  • Dynamic ¡state ¡merging ¡[V. ¡Kuznetsov, ¡J. ¡Kinder, ¡S. ¡Bucur, ¡and ¡
  • G. ¡Candea, ¡PLDI ¡12] ¡
  • VeriTes$ng[T. ¡Avgerinos, ¡A. ¡Rebert, ¡S. ¡K. ¡Cha, ¡and ¡D. ¡Brumley, ¡

ICSE ¡2014] ¡

  • Rosese ¡[E. ¡Torlak ¡and ¡R. ¡Bodik, ¡PLDI ¡2014] ¡
  • SMART ¡[P. ¡Godefroid, ¡POPL ¡2007], ¡Demand-­‑driven ¡

composi$onal ¡state ¡merging ¡[S. ¡Anand, ¡P. ¡Godefroid, ¡and ¡N. ¡ Tillmann, ¡TACAS ¡2008] ¡

  • SMASH ¡[P. ¡Godefroid, ¡A. ¡V. ¡Nori, ¡S. ¡K. ¡Rajamani, ¡and ¡S. ¡D. ¡

Tetali, ¡POPL ¡2010] ¡ ¡

slide-69
SLIDE 69

Summary ¡

  • Available ¡as ¡a ¡tech. ¡report ¡from ¡my ¡website ¡

– hsp://www.eecs.berkeley.edu/Pubs/TechRpts/ 2014/EECS-­‑2014-­‑173.html ¡

  • A ¡prototype ¡implementa$on ¡for ¡JavaScript ¡
  • Separates ¡program ¡values ¡from ¡path ¡

constraints ¡as ¡in ¡symbolic ¡execu$on ¡

– does ¡not ¡mix-­‑up ¡program ¡values ¡with ¡formulas ¡as ¡ in ¡conven$onal ¡state ¡merging ¡

  • No ¡need ¡for ¡explicit ¡state ¡merging ¡at ¡join ¡

points ¡

slide-70
SLIDE 70

My ¡Background ¡in ¡Tes$ng ¡

  • Automated ¡tes$ng ¡of ¡

concurrent ¡programs ¡

– CalFuzzer ¡for ¡Java: ¡finds ¡ and ¡confirms ¡real ¡data ¡ races ¡[PLDI ¡08], ¡atomicity ¡ viola$ons ¡[FSE ¡08], ¡ deadlocks ¡[PLDI ¡09] ¡ – Thrille ¡for ¡C/C++ ¡[FSE ¡10] ¡ – UPC-­‑Thrille ¡for ¡HPC ¡ programs ¡[SC ¡11, ¡ICS ¡13] ¡ – Concurrit: ¡a ¡xUnit ¡tes$ng ¡ framework ¡for ¡threaded ¡C/ C++ ¡programs ¡[PLDI ¡13] ¡

70 ¡

  • Automated ¡tes$ng ¡of ¡cloud ¡

systems ¡

– FATE ¡and ¡DESTINI ¡for ¡systema$c ¡ fault ¡injec$on ¡[NSDI ¡11] ¡ – PREFAIL: ¡programmable ¡tes$ng ¡

  • f ¡cloud ¡systems ¡[OOPSLA ¡11] ¡
  • Automated ¡GUI ¡Tes$ng ¡for ¡

Android ¡ ¡

– approximate ¡automata ¡learning ¡ ¡ [OOPSLA ¡13] ¡

  • Automated ¡Performance ¡

Tes$ng ¡for ¡Web ¡apps ¡ ¡

  • [OOPSLA ¡14] ¡ ¡