{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

08 Constraint-based Analysis

# 08 Constraint-based Analysis - Course Outline Introduction...

This preview shows pages 1–9. Sign up to view the full content.

Course Outline Introduction Control-flow analysis Dataflow analysis and abstract interpretation Sparse analysis Adding indirection (pointers) Adding functions Type- and constraint-based analysis Ben Hardekopf () CS 290C Program Analysis Fall 2011 1 / 37

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

View Full Document
Section Outline Type- and Constraint-Based Analysis Constraint-based Analysis I Andersen-style Flow-Insensitive Pointer Analysis Type-based Analysis Relation to Datafow Analysis Ben Hardekopf () CS 290C Program Analysis Fall 2011 2 / 37
Constraint-Based Analysis The foundation of a constraint-based analysis is a constraint language that defines what kind of constraints we can specify. The decidability, complexity, and precision of a constraint-based analysis depend largely on what language we choose. Ben Hardekopf () CS 290C Program Analysis Fall 2011 3 / 37

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

View Full Document
Constraint-Based Analysis The foundation of a constraint-based analysis is a constraint language that defines what kind of constraints we can specify. The decidability, complexity, and precision of a constraint-based analysis depend largely on what language we choose. We will look specifically at set constraints : Definition (Set Constraint Language) x V ariable c Constructor 0 = empty set 1 = universal set E Expr ::= x | 0 | 1 | ¬ E | E 1 E 2 | E 1 E 2 | c ( E 1 , . . . , E a ( c ) ) S Stmt ::= E 1 E 2 | S 1 S 2 Ben Hardekopf () CS 290C Program Analysis Fall 2011 3 / 37
Example Example (Set Constraint Statement) { c 1 } ⊆ x { c 1 , c 2 , c 3 } ⊆ y x x y ⊆ { c 2 } z ⊆ ¬ ( x y ) c 1 , c 2 , c 3 are nullary constructors—constructors that don’t take any arguments. Nullary constructors act as constants and are usually written without (). Ben Hardekopf () CS 290C Program Analysis Fall 2011 4 / 37

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

View Full Document
What is a Constructor? Constructors are uninterpreted functions—the analysis doesn’t care what they mean, it’s up to us to give them a useful interpretation. A good example of constructors are type constructors : I Nullary constructors: Int , String , . . . I Unary constructors: Int[] , . . . I Binary constructors: Int String , . . . Ben Hardekopf () CS 290C Program Analysis Fall 2011 5 / 37
What is a Constructor? Constructors are uninterpreted functions—the analysis doesn’t care what they mean, it’s up to us to give them a useful interpretation. A good example of constructors are type constructors : I Nullary constructors: Int , String , . . . I Unary constructors: Int[] , . . . I Binary constructors: Int String , . . . Characteristics of constructors: Every constructor has an arity : the number of arguments it takes Every parameter position of a constructor is either covariant or contravariant I Covariant if the constructor is monotone w.r.t. that position I Contravariant if it is anti-monotone w.r.t. that position. I We’ll indicate contravariance by a line over the parameter position Ben Hardekopf () CS 290C Program Analysis Fall 2011 5 / 37

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

View Full Document
Covariance and Contravariance This is easiest to explain by example. Suppose we have a function type constructor lam( X,Y) : the type of a function from type X to type Y.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 66

08 Constraint-based Analysis - Course Outline Introduction...

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

View Full Document
Ask a homework question - tutors are online