finding code that explodes under symbolic evalua on
play

Finding Code That Explodes Under Symbolic Evalua<on James - PowerPoint PPT Presentation

Finding Code That Explodes Under Symbolic Evalua<on James Bornholt Emina Torlak University of Washington unsat.org Automated reasoning tools help us solve hard programming problems Automated reasoning tools help us solve hard programming


  1. Finding Code That Explodes Under Symbolic Evalua<on James Bornholt Emina Torlak University of Washington unsat.org

  2. Automated reasoning tools help us solve hard programming problems

  3. Automated reasoning tools help us solve hard programming problems Does my program s8ll 👸 Verifica8on work a:er the file system crashes? [ASPLOS’16]

  4. Automated reasoning tools help us solve hard programming problems Does my program s8ll 👸 Verifica8on work a:er the file system crashes? [ASPLOS’16] How do I compile code 
 architecture? [PLDI’14]  Synthesis for this weird new

  5. Automated reasoning tools help us solve hard programming problems Does my program s8ll 👸 Verifica8on work a:er the file system crashes? [ASPLOS’16] How do I compile code 
 architecture? [PLDI’14]  Synthesis for this weird new How do I teach kids 
  “Programs” the rules of algebra effec8vely? [VMCAI’18]

  6. Symbolic evaluators Does my program s8ll How do I compile code 
 👸 architecture? [PLDI’14]  work a:er the file system for this weird new crashes? [ASPLOS’16]

  7. Symbolic evaluators Does my program s8ll How do I compile code 
 👸 architecture? [PLDI’14]  work a:er the file system for this weird new crashes? [ASPLOS’16] Interpreter for file system Interpreter for new architecture opera8ons instruc8ons

  8. Symbolic evaluators Does my program s8ll How do I compile code 
 👸 architecture? [PLDI’14]  work a:er the file system for this weird new crashes? [ASPLOS’16] Interpreter for file system Interpreter for new architecture opera8ons instruc8ons Symbolic evaluator Sketch, RoseWe, …

  9. Symbolic evaluators Does my program s8ll How do I compile code 
 👸 architecture? [PLDI’14]  work a:er the file system for this weird new crashes? [ASPLOS’16] Interpreter for file system Interpreter for new architecture opera8ons instruc8ons Symbolic evaluator Sketch, RoseWe, … Angelic Verifica8on Synthesis for free! Execu8on

  10. Symbolic evaluators: no free lunch Does my program s8ll 👸 work a:er the file system crashes? [ASPLOS’16] Interpreter for file system opera8ons Symbolic evaluator Sketch, RoseWe, … Angelic Verifica8on Synthesis for free! Execu8on

  11. Symbolic evaluators: no free lunch Does my program s8ll 👸 How do you make work a:er the file system these tools scale? crashes? [ASPLOS’16] Interpreter for file system opera8ons Symbolic evaluator Sketch, RoseWe, … Angelic Verifica8on Synthesis for free! Execu8on

  12. Symbolic evaluators: no free lunch Does my program s8ll 👸 How do you make work a:er the file system these tools scale? crashes? [ASPLOS’16] Searching all paths Searching all paths Interpreter for file system through the interpreter through the interpreter opera8ons Symbolic evaluator Sketch, RoseWe, … Angelic Verifica8on Synthesis for free! Execu8on

  13. Symbolic profiling iden<fies performance issues in symbolic evalua<on

  14. Symbolic profiling iden<fies performance issues in symbolic evalua<on Symbolic profiling Data structures and analyses

  15. Symbolic profiling iden<fies performance issues in symbolic evalua<on Symbolic profiling Data structures and analyses 20 Symbolic evalua8on an8-paWerns 10 Common issues and source-level repairs 0 0 1500

  16. Symbolic profiling iden<fies performance issues in symbolic evalua<on Symbolic profiling Data structures and analyses 20 Symbolic evalua8on an8-paWerns 10 Common issues and source-level repairs 0 0 1500 Empirical results 300× speedup on real-world tools

  17. Symbolic profiling iden<fies performance issues in symbolic evalua<on if (…) { … } Symbolic evalua8on All-paths execu8on of programs ∀ x. φ(…, x) Symbolic profiling Data structures and analyses 20 Symbolic evalua8on an8-paWerns 10 Common issues and source-level repairs 0 0 1500 Empirical results 300× speedup on real-world tools

  18. Symbolic evalua<on All-paths execu8on of programs

  19. Symbolic evalua<on executes all paths through a program #lang rosette ( define (first-k-even lst k) ( define xs ( filter even? lst)) ( take xs k))

  20. Symbolic evalua<on executes all paths through a program Inputs are unknown #lang rosette (trying to find values that violate spec) ( define (first-k-even lst k) ( define xs ( filter even? lst)) ( take xs k))

  21. Symbolic evalua<on executes all paths through a program Inputs are unknown #lang rosette (trying to find values that violate spec) ( define (first-k-even lst k) ( define xs ( filter even? lst)) ( take xs k)) (filter even? ‘(x 0 x 1 ))

  22. Symbolic evalua<on executes all paths through a program Inputs are unknown #lang rosette (trying to find values that violate spec) ( define (first-k-even lst k) ( define xs ( filter even? lst)) ( take xs k)) (filter even? ‘(x 0 x 1 )) ¬(even? x 0 ) (even? x 0 ) ‘() ‘(x 0 )

  23. Symbolic evalua<on executes all paths through a program Inputs are unknown #lang rosette (trying to find values that violate spec) ( define (first-k-even lst k) ( define xs ( filter even? lst)) ( take xs k)) (filter even? ‘(x 0 x 1 )) ¬(even? x 0 ) (even? x 0 ) ‘() ‘(x 0 ) ¬(even? x 1 ) (even? x 1 ) ¬(even? x 1 ) (even? x 1 ) ‘() ‘(x 1 ) ‘(x 0 ) ‘(x 0 x 1 )

  24. Symbolic evalua<on executes all paths through a program Inputs are unknown #lang rosette (trying to find values that violate spec) ( define (first-k-even lst k) ( define xs ( filter even? lst)) ( take xs k)) (filter even? ‘(x 0 x 1 )) ¬(even? x 0 ) (even? x 0 ) ‘() ‘(x 0 ) ¬(even? x 1 ) (even? x 1 ) ¬(even? x 1 ) (even? x 1 ) ‘() ‘(x 1 ) ‘(x 0 ) ‘(x 0 x 1 )

  25. Symbolic evalua<on executes all paths through a program Inputs are unknown #lang rosette (trying to find values that violate spec) ( define (first-k-even lst k) ( define xs ( filter even? lst)) ( take xs k)) (filter even? ‘(x 0 x 1 )) ¬(even? x 0 ) (even? x 0 ) ‘() ‘(x 0 ) ¬(even? x 1 ) (even? x 1 ) ¬(even? x 1 ) (even? x 1 ) ‘() ‘(x 1 ) ‘(x 0 ) ‘(x 0 x 1 ) k=0 k=0 k=1 k=0 k=1 k=0 k=2 k=1 ‘() ‘() ‘(x 1 ) ‘() ‘(x 0 ) ‘() ‘(x 0 ) ‘(x 0 x 1 )

  26. Symbolic evalua<on executes all paths through a program Inputs are unknown #lang rosette (trying to find values that violate spec) ( define (first-k-even lst k) ( define xs ( filter even? lst)) ( take xs k)) (filter even? ‘(x 0 x 1 )) ¬(even? x 0 ) (even? x 0 ) ‘() ‘(x 0 ) ¬(even? x 1 ) (even? x 1 ) ¬(even? x 1 ) (even? x 1 ) take runs 2 2 8mes ‘() ‘(x 1 ) ‘(x 0 ) ‘(x 0 x 1 ) k=0 k=0 k=1 k=0 k=1 k=0 k=2 k=1 ‘() ‘() ‘(x 1 ) ‘() ‘(x 0 ) ‘() ‘(x 0 ) ‘(x 0 x 1 )

  27. Symbolic evalua<on executes all paths through a program Inputs are unknown #lang rosette (trying to find values that violate spec) ( define (first-k-even lst k) ( define xs ( filter even? lst)) ( take xs k)) because filter ran (filter even? ‘(x 0 x 1 )) on a list of size 2 ¬(even? x 0 ) (even? x 0 ) ‘() ‘(x 0 ) ¬(even? x 1 ) (even? x 1 ) ¬(even? x 1 ) (even? x 1 ) take runs 2 2 8mes ‘() ‘(x 1 ) ‘(x 0 ) ‘(x 0 x 1 ) k=0 k=0 k=1 k=0 k=1 k=0 k=2 k=1 ‘() ‘() ‘(x 1 ) ‘() ‘(x 0 ) ‘() ‘(x 0 ) ‘(x 0 x 1 )

  28. Blaming filter even though it’s not the slowest

  29. Symbolic profiling Data structures and metrics

  30. Two data structures to summarize symbolic evalua<on ‘() ∧ ∧ ∧ ∧ ¬(even? x 0 ) (even? x 0 ) ‘() ‘(x 0 ) ¬ ¬ ¬(even? x 1 ) (even? x 1 ) ¬(even? x 1 ) (even? x 1 ) (even? x 0 ) (even? x 1 ) ‘() ‘(x 1 ) ‘(x 0 ) ‘(x 0 x 1 ) Symbolic evalua<on graph Symbolic heap Reflects the evaluator’s strategy 
 Shape of all symbolic values 
 for all-paths execu8on of the program created by the program Any symbolic evalua<on technique can be summarized by these two data structures

  31. The symbolic evalua4on graph summarizes branching and merging (filter even? ‘(x 0 x 1 )) Symbolic evalua<on graph ¬(even? x 0 ) (even? x 0 ) • Nodes are program states • Edges are transi8ons ‘() ‘(x 0 ) ¬(even? x 1 ) (even? x 1 ) ¬(even? x 1 ) (even? x 1 ) between states ‘() ‘(x 1 ) ‘(x 0 ) ‘(x 0 x 1 ) k=0 k=0 k=1 k=0 k=1 k=0 k=2 k=1 ‘() ‘() ‘(x 1 ) ‘() ‘(x 0 x 1 ) ‘(x 0 ) ‘() ‘(x 0 )

  32. The symbolic evalua4on graph summarizes branching and merging (filter even? ‘(x 0 x 1 )) ¬(even? x 0 ) (even? x 0 ) ‘() ‘(x 0 ) ¬(even? x 1 ) (even? x 1 ) ¬(even? x 1 ) (even? x 1 ) ‘() ‘(x 1 ) ‘(x 0 ) ‘(x 0 x 1 )

  33. The symbolic evalua4on graph summarizes branching and merging Symbolic execu8on (filter even? ‘(x 0 x 1 )) ¬(even? x 0 ) (even? x 0 ) ‘() ‘(x 0 ) ¬(even? x 1 ) (even? x 1 ) ¬(even? x 1 ) (even? x 1 ) ‘() ‘(x 1 ) ‘(x 0 ) ‘(x 0 x 1 )

  34. The symbolic evalua4on graph summarizes branching and merging Symbolic execu8on Bounded model checking (filter even? ‘(x 0 x 1 )) (filter even? ‘(x 0 x 1 )) ¬(even? x 0 ) (even? x 0 ) ¬(even? x 0 ) (even? x 0 ) ‘() ‘(x 0 ) ‘() ‘(x 0 ) ¬(even? x 1 ) (even? x 1 ) ¬(even? x 1 ) (even? x 1 ) ‘() ‘(x 1 ) ‘(x 0 ) ‘(x 0 x 1 )

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend