Smalltalk Metaprogramming supports Probabilistic Program Analysis


Published on

Smalltalk Metaprogramming supports Probabilistic Program Analysis by Dave Mason. ESUG09, Brest, France

Published in: Technology, Education
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Smalltalk Metaprogramming supports Probabilistic Program Analysis

  1. 1. Smalltalk Metaprogramming supports Probabilistic Program Analysis Dave Mason Ryerson University Monday, 2009 August 31 1
  2. 2. Why Path Discovery? Testing/coverage Program Comprehension/Visualization Software Reliability Monday, 2009 August 31 2
  3. 3. Domain/Path Discovery Depth-first Breadth-first Heuristic Probabilistic Monday, 2009 August 31 3
  4. 4. Operational Profile probability of each point in the input domain histogram or continuous probabilistic density function derived from real world / “expert” we will use to drive program analysis Monday, 2009 August 31 4
  5. 5. Continuation-Based all parameters are variables of the PDF at any decision point (loop/if) involving those parameters take a snapshot snapshot placed twice in priority queue true case false case Monday, 2009 August 31 5
  6. 6. Continuation-Based (cont) take first from priority queue to proceed when any path completes, take first from q q ordered by integral of domain over PDF many paths may be in partial execution by construction, paths complete in frequency order Monday, 2009 August 31 6
  7. 7. Monte Carlo generate a random point in the input space check that not in a domain already found execute, when loop/if add to path, returning with correct true/false Monday, 2009 August 31 7
  8. 8. Metaprogramming Smalltalk supports 4 key technologies: Dynamic types First-class booleans Continuation capture Dynamic code generation Monday, 2009 August 31 8
  9. 9. Dynamic Types because there are no “native” types can pass parameter types in place of e.g. numbers no change whatsoever required to source can trace deeply into library classes/methods Monday, 2009 August 31 9
  10. 10. First-class Booleans conceptually true/false are not special, they are simply objects Maybe can extend Boolean so that use in loop/if can capture information in practice, use sends #mustBeBoolean which can capture information Monday, 2009 August 31 10
  11. 11. Continuation Capture continuation is the information necessary to execute the rest of the program derived from Seaside continuation capture walks stack saving local variables first-class Monday, 2009 August 31 11
  12. 12. Dynamic Code Generation need to check complex predicates for inclusion could interpret the predicates not essential, but generating code for the check can speed up the implementation Monday, 2009 August 31 12
  13. 13. Conclusion Smalltalk provides the metaprogramming necessary to implement this analysis seamlessly may be the only one with all these features questions? Monday, 2009 August 31 13