1 / 16

Amorphous Program Slicing through Partial Evaluation

Amorphous Program Slicing through Partial Evaluation. David Binkley & Kyle Sluder Loyola College in Maryland 4501 N. Charles St. Baltimore, MD 21210. Agenda. Background Fundamentals Method Results Conclusions & Future Work. Traditional slicing Projection of program given criterion

Download Presentation

Amorphous Program Slicing through Partial Evaluation

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. Amorphous Program Slicing through Partial Evaluation David Binkley & Kyle Sluder Loyola College in Maryland4501 N. Charles St.Baltimore, MD 21210

  2. Agenda • Background • Fundamentals • Method • Results • Conclusions & Future Work

  3. Traditional slicing Projection of program given criterion Criterion: (line #, {variables}) Preserves syntax int foo() { int x, y, z; x = 20; y = x + 10; z = 30; return x + y + z; } Background Criterion: (6, {z})

  4. Background • Traditional slicing domains • Static • Not concerned with program’s input • Dynamic • Modifies slice based on input

  5. Amorphous slicing Not syntax-preserving (biggest advantage) No distinction between static and dynamic int foo() { int x, y, z; x = 20; y = x + 10; z = 30; return x + y + z; } Background • int foo() • { • int z = 30; • return z; • }

  6. Background Specialized for input All 1 Traditional static slicing Traditional dynamic slicing Yes Syntax Preservation Amorphous slicing (N/A) No

  7. Background • Applications of Slicing • Debugging: original use • Program proving • Refactoring • Program/algorithm analysis

  8. Background • What is partial evaluation? • Applications • Optimization • Program (pre)compilation • Refactoring • Program proving/analysis

  9. Fundamentals • Based on similarity of partial evaluation and amorphous slicing • Foundation (Harman et al.) • Application (Silva and Vidal) • Applied to C • No longer in the realm of functional programming • A lot harder to do successfully

  10. Pre-processing Use TXL to extract variables to global scope Partially evaluate Prepare configuration file (provide criterion) Run Tempo Slice Use CodeSurfer Post-process Use TXL for cleanup Method

  11. Computation example Program needs to compute statistics on array of integers Program exhibits bug in average Results

  12. Results

  13. Results • Traditional slice not helpful • Syntactic-preservation constraint inhibits efficacy • Only shows what is already known: biggest is not involved in computation of average • Amorphous slice helpful • Shows that average is not built correctly: does not rely on sum, despite its presence in original program • Sum must therefore not be receiving the right value

  14. Results • Safety slicing • Array bounds safety • Artificially insert assignments to variable “safe” before array access • Assert safe = T at end

  15. Results

  16. Conclusions and Future Work • Amorphous slicing is possible for C • Partial evaluation is very viable method for achieving that goal • Need more examples of efficacy • Explore relationship between conditioned slicing and “static” variables from P.E. perspective This work is supported by National Science Founda- tion grant CCR0305330. Kyle Sluder is supported by the Loyola College in Maryland Hauber Fellowship.

More Related