slides4 - Principles of Program Analysis: Abstract...

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: Principles of Program Analysis: Abstract Interpretation Transparencies based on Chapter 4 of the book: Flemming Nielson, Hanne Riis Nielson and Chris Hankin: Principles of Program Analysis . Springer Verlag 2005. c Flemming Nielson & Hanne Riis Nielson & Chris Hankin. PPA Chapter 4 c F.Nielson & H.Riis Nielson & C.Hankin (Dec. 2004) 1 A Mundane Approach to Semantic Correctness Semantics: p ` v 1 ; v 2 where v 1 ,v 2 V . Note: ; might be deterministic. Program analysis: p ` l 1 l 2 where l 1 ,l 2 L . Note: should be deterministic: f p ( l 1 ) = l 2 . What is the relationship between the semantics and the analysis? Restrict attention to analyses where properties directly describe sets of values i.e. first-order analyses (rather than second-order analyses ). PPA Section 4.1 c F.Nielson & H.Riis Nielson & C.Hankin (Dec. 2004) 2 Example: Data Flow Analysis Structural Operational Semantics: Values: V = State Transitions: S ? ` 1 ; 2 iff h S ? , 1 i * 2 Constant Propagation Analysis: Properties: L = d State CP = ( Var ? Z > ) Transitions: S ? ` b 1 b 2 iff b 1 = b 2 = F { CP ( ` ) | ` final ( S ? ) } (CP , CP ) | = CP = ( S ? ) PPA Section 4.1 c F.Nielson & H.Riis Nielson & C.Hankin (Dec. 2004) 3 Example: Control Flow Analysis Structural Operational Semantics: Values: V = Val Transitions: e ? ` v 1 ; v 2 iff [ ] ` ( e ? v ` 1 1 ) ` 2 * v ` 2 2 Pure 0-CFA Analysis: Properties: L = d Env d Val Transitions: e ? ` ( b 1 , b v 1 ) ( b 2 , b v 2 ) iff b C ( ` 1 ) = b v 1 b C ( ` 2 ) = b v 2 b 1 = b 2 = b ( b C , b ) | = ( e ? c ` 1 ) ` 2 for some place holder constant c PPA Section 4.1 c F.Nielson & H.Riis Nielson & C.Hankin (Dec. 2004) 4 Correctness Relations R : V L { true , false } Idea: v R l means that the value v is described by the property l . Correctness criterion: R is preserved under computation: p ` v 1 ; v 2 . . . . . . R R . . . . . . p ` l 1 l 2 logical relation: ( p ` ; ) ( R R ) ( p ` ) PPA Section 4.1 c F.Nielson & H.Riis Nielson & C.Hankin (Dec. 2004) 5 Admissible Correctness Relations v R l 1 l 1 v l 2 v R l 2 ( l L L : v R l ) v R ( L ) ( { l | v R l } is a Moore family) Two consequences: v R > v R l 1 v R l 2 v R ( l 1 u l 2 ) Assumption: ( L, v ) is a complete lattice. PPA Section 4.1 c F.Nielson & H.Riis Nielson & C.Hankin (Dec. 2004) 6 Example: Data Flow Analysis Correctness relation R CP : State d State CP { true , false } is defined by R CP b iff x FV ( S ? ) : ( b ( x ) = > ( x ) = b ( x )) PPA Section 4.1 c F.Nielson & H.Riis Nielson & C.Hankin (Dec. 2004) 7 Example: Control Flow Analysis Correctness relation R CFA : Val ( d Env d Val ) { true , false } is defined by v R CFA ( b , b v ) iff v V ( b , b v ) where V is given by: v V ( b , b v ) iff true if v = c t b v x dom ( ) : ( x ) V ( b , b...
View Full Document

This note was uploaded on 02/07/2012 for the course CSCI 5513 taught by Professor Gopalan during the Spring '10 term at Minnesota.

Page1 / 99

slides4 - Principles of Program Analysis: Abstract...

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

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