dynamic_inference_abstract_types_slides

dynamic_inference_abstract_types_slides - Dynamic Inference...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Dynamic Inference of Abstract Types
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Abstract Types Even declared types only capture a portion of programmer intent for use of variable values Want finer-grained types – these will be the abstract types Find them by noticing what values interact with each other (by parameterizable definitions of interact). If they interact, they have the same abstract type
Background image of page 2
To be clear… Value: a concrete instance of an entity that a program operates on Variable: a container for a value, may hold different values over its lifetime. Paper introduces a method to find abstract types dynamically using values, rather than statically using variables
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Example 1. int totalCost(int a, int b, int c, int d) { 2. 3. if ((a > 1000) && (d > 2000)) { 4. int e = 10; 5. return b + c + e; 6. } else { 7. return a + b; 8. } 9. }
Background image of page 4
One dynamic solution… totalCost(3000, 50, 3, 2006) 1. a: 3000 b:50 c:3 d:2006 3. a:3000 1000 b:50 c:3 d:2006 2000 4. a:3000 1000 e:10 b:50 c:3 d:2006 2000 5. a:3000 1000
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/24/2012 for the course CSE 503 taught by Professor Davidnotikin during the Winter '11 term at University of Washington.

Page1 / 10

dynamic_inference_abstract_types_slides - Dynamic Inference...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online