A Functional Perspective

Size: px
Start display at page:

Download "A Functional Perspective"

Transcription

1 A Functional Perspective on SSA Optimization Algorithms Patryk Zadarnowski jotly with Manuel M. T. Chakravarty Gabriele Keller 19 April 2004 University of New South Wales Sydney

2 THE PLAN ➀ Motivation an overview of the status quo ➁ Translatg the static sgle assignment (SSA) form to the admistrative normal form (ANF) of lambda calculus ➂ Applyg the technique to the sparse conditional constant propagation (SCC) algorithm THE PLAN 1

3 MOTIVATION We need a verified optimizg compiler Optimization algorithms are: X complex X adequately specified People tried and failed the past (IBM Vienna project) Functional programmers eat and breathe formal methods! MOTIVATION 2

4 THE APPROACH ➀ Fix the problem, not the tools: If compilers are hard to verify, change them to make it easier! ➁ Fix data structures before fixg algorithms: In every FORTRAN program hides a functional program tryg to break free! THE APPROACH 3

5 CONTRIBUTIONS ➀ Formalize the correspondance between the Static Sgle Assignment form and a direct-style lambda calculus ➁ Redefe Wegman-Zadeck s Sparse Conditional Constant Propagation usg our termediate representation ➂ Formally establish soundness of the new algorithm Also: ➃ Formal operational semantics for the SSA form. ➄ A new flexible data-flow framework. ➅ Solves the multiple-φ problem of the SSA form (Robert Morgan.) ➆ Received very enthusiastic response from both imperative and functional compiler communities. CONTRIBUTIONS 4

6 THE PLAN ➀ Start with the Static Sgle Assignment (SSA) Form Appel showed formally that SSA is fact a variant of lambda calculus Kelsey demonstrated correspondence between SSA and the contuation-passg style (CPS) of lambda calculus However, Flanagan et al. showed that CPS is bad for data flow analysis. ➁ Design an algorithm for translatg SSA programs to the Admistrative Normal Form (ANF) of lambda calculus. ➂ Use the correspondence troduced by the translation function to implement some traditional data-flow algorithms on ANF. ➃ Use formal semantics of ANF to prove properties about those algorithm. THE PLAN 5

7 CONTROL FLOW GRAPHS x put r 1 r r x x x 1 no Summary: Low-level representation Informal semantics Emphasis on control flow x = 0? yes return r CONTROL FLOW GRAPHS 6

8 CONTROL FLOW GRAPHS x put r 1 r r x x x 1 x = 0? yes return r no Summary: Low-level representation Informal semantics Emphasis on control flow However, many (most?) optimizations require data flow formation: Expensive to compute Reusable CONTROL FLOW GRAPHS 6-A

9 CONTROL FLOW GRAPHS & DATAFLOW INFORMATION x put r 1 r r x x x 1 x = 0? yes return r no Summary: Def-Use chas: defs refer to uses and uses refer to defs Analyses need a dense mappg of variables to abstract values X Expensive to represent and update! CONTROL FLOW GRAPHS & DATAFLOW INFORMATION 7

10 STATIC SINGLE ASSIGNMENT FORM x 0 put r 0 1 x 1 φ(x 0, x 2 ) r 1 φ(r 0, r 2 ) r 2 r 1 x 1 x 2 x 1 1 x 2 = 0? no Overview: Each variable has exactly one defg occurence Values from different control flows merged via φ functions φ functions placed by computg the domator tree of the procedure yes return r 2 STATIC SINGLE ASSIGNMENT FORM 8

11 STATIC SINGLE ASSIGNMENT FORM DETAILS p ::= proc x( x) {b} p e procedures Syntax: STATIC SINGLE ASSIGNMENT FORM DETAILS 9

12 STATIC SINGLE ASSIGNMENT FORM DETAILS p ::= proc x( x) {b} p e b ::= e b; x:e b 1 ; x:{b 2 } procedures Syntax: basic blocks STATIC SINGLE ASSIGNMENT FORM DETAILS 9-A

13 STATIC SINGLE ASSIGNMENT FORM DETAILS p ::= proc x( x) {b} p e b ::= e b; x:e b 1 ; x:{b 2 } e ::= x v; e Syntax: procedures basic blocks copy STATIC SINGLE ASSIGNMENT FORM DETAILS 9-B

14 STATIC SINGLE ASSIGNMENT FORM DETAILS p ::= proc x( x) {b} p e b ::= e b; x:e b 1 ; x:{b 2 } e ::= x v; e x v( v); e Syntax: procedures basic blocks copy calls STATIC SINGLE ASSIGNMENT FORM DETAILS 9-C

15 STATIC SINGLE ASSIGNMENT FORM DETAILS p ::= proc x( x) {b} p e b ::= e b; x:e b 1 ; x:{b 2 } e ::= x v; e x v( v); e goto x; Syntax: procedures basic blocks copy calls jumps STATIC SINGLE ASSIGNMENT FORM DETAILS 9-D

16 STATIC SINGLE ASSIGNMENT FORM DETAILS p ::= proc x( x) {b} p e b ::= e b; x:e b 1 ; x:{b 2 } e ::= x v; e x v( v); e goto x; ret v; ret v( v); Syntax: procedures basic blocks copy calls jumps returns STATIC SINGLE ASSIGNMENT FORM DETAILS 9-E

17 STATIC SINGLE ASSIGNMENT FORM DETAILS p ::= proc x( x) {b} p e b ::= e b; x:e b 1 ; x:{b 2 } e ::= x v; e x v( v); e goto x; ret v; ret v( v); if v then e 1 else e 2 Syntax: procedures basic blocks copy calls jumps returns branches STATIC SINGLE ASSIGNMENT FORM DETAILS 9-F

18 STATIC SINGLE ASSIGNMENT FORM DETAILS p ::= proc x( x) {b} p e b ::= e b; x:e b 1 ; x:{b 2 } e ::= x v; e x v( v); e goto x; ret v; ret v( v); if v then e 1 else e 2 x φ(ḡ); e g ::= l:v l ::= x start Syntax: procedures basic blocks copy calls jumps returns branches phi nodes STATIC SINGLE ASSIGNMENT FORM DETAILS 9-G

19 STRUCTURED SSA FORM proc fac(x) { goto L 1 L 1 : { r 0 φ(start:1, L 1 :r 1 ) x 0 φ(start:x, L 1 :x 1 ) if x 0 then goto L 1 else ret r 0 L 2 : r 1 mul(r 0, x 0 ) x 1 sub(x 0, 1) }... } goto L 1 STRUCTURED SSA FORM 10

20 STATIC SINGLE ASSIGNMENT FORM x 0 put r 0 1 x 1 φ(x 0, x 2 ) r 1 φ(r 0, r 2 ) r 2 r 1 x 1 x 2 x 1 1 x 2 = 0? yes return r 2 no Evaluation I: V Sparse representation V Split variables improve the accuracy of analyses V Significantly reduces complexity of optimizations, such as: constant propagation partial redundancy elimation value numberg... STATIC SINGLE ASSIGNMENT FORM 11

21 STATIC SINGLE ASSIGNMENT FORM x 0 put r 0 1 x 1 φ(x 0, x 2 ) r 1 φ(r 0, r 2 ) r 2 r 1 x 1 x 2 x 1 1 no Evaluation II: X Still no scopg X Still only formal semantics X Difficult to add a type system: x 2 = 0? yes return r 2 STATIC SINGLE ASSIGNMENT FORM 12

22 STATIC SINGLE ASSIGNMENT FORM x 0 put r 0 1 x 1 φ(x 0, x 2 ) r 1 φ(r 0, r 2 ) r 2 r 1 x 1 x 2 x 1 1 x 2 = 0? yes no Evaluation II: X Still no scopg X Still only formal semantics X Difficult to add a type system: φ parameters out of context Analysis requires a large environment V However, there are improved versions, such as Gated SSA return r 2 STATIC SINGLE ASSIGNMENT FORM 12-A

23 ADMINISTRATIVE NORMAL FORM Restricted direct-style lambda calculus: no nested let s no nested function applications no anonymous lambda expressions ADMINISTRATIVE NORMAL FORM 13

24 ADMINISTRATIVE NORMAL FORM e ::= Syntax: ADMINISTRATIVE NORMAL FORM 14

25 ADMINISTRATIVE NORMAL FORM e ::= let x = v e copy Syntax: ADMINISTRATIVE NORMAL FORM 14-A

26 ADMINISTRATIVE NORMAL FORM Syntax: e ::= let x = v e let x = v( v) e copy calls ADMINISTRATIVE NORMAL FORM 14-B

27 ADMINISTRATIVE NORMAL FORM Syntax: e ::= let x = v e let x = v( v) e v copy calls returns ADMINISTRATIVE NORMAL FORM 14-C

28 ADMINISTRATIVE NORMAL FORM Syntax: e ::= let x = v e let x = v( v) e v v( v) copy calls returns jumps ADMINISTRATIVE NORMAL FORM 14-D

29 ADMINISTRATIVE NORMAL FORM Syntax: e ::= let x = v e let x = v( v) e v v( v) if v then e 1 else e 2 copy calls returns jumps branches ADMINISTRATIVE NORMAL FORM 14-E

30 ADMINISTRATIVE NORMAL FORM Syntax: e ::= let x = v e let x = v( v) e v v( v) if v then e 1 else e 2 letrec f e f ::= x( x) = e copy calls returns jumps branches code labels ADMINISTRATIVE NORMAL FORM 14-F

31 ADMINISTRATIVE NORMAL FORM EXAMPLE letrec fac(x) = letrec fac (x 0, r 0 ) = letrec fac () = let r 1 = mul(r 0, x 0 ) let x 1 = sub(x 0, 1) fac (r 1, x 1 )... if x 0 fac () else r 0 fac (x, 1) ADMINISTRATIVE NORMAL FORM EXAMPLE 15

32 ADMINISTRATIVE NORMAL FORM e ::= let x = v e let x = v( v) e v v( v) if v then e 1 else e 2 letrec f e f ::= x( x) = e Evaluation: V Natural scopg V Clean operational semantics V Easily type-checked V Yet still close to assembly language! ADMINISTRATIVE NORMAL FORM 16

33 ADMINISTRATIVE NORMAL FORM So where do I get some? ADMINISTRATIVE NORMAL FORM 17

34 ADMINISTRATIVE NORMAL FORM So where do I get some? Translate an SSA program! Semi-formal correspondence between programs SSA form and CPS [Kelsey, 1995] Semi-formal translation from SSA form to lambda calculus [Appel, 1998] We present a formal translation from SSA form to ANF (based on domator trees) ADMINISTRATIVE NORMAL FORM 17-A

35 TRANSLATING STRUCTURED SSA TO ANF proc fac(x) { letrec fac(x) = } TRANSLATING STRUCTURED SSA TO ANF 18

36 TRANSLATING STRUCTURED SSA TO ANF proc fac(x) { L 1 :{ letrec fac(x) = letrec fac ( ) = letrec fac () = L 2 : }... }... TRANSLATING STRUCTURED SSA TO ANF 18-A

37 TRANSLATING STRUCTURED SSA TO ANF proc fac(x) { L 1 :{ if x 0 else ret r 0 L 2 :r 1 mul(r 0, x 0 ) x 1 sub(x 0, 1) letrec fac(x) = letrec fac ( ) = letrec fac () = let r 1 = mul(r 0, x 0 ) let x 1 = sub(x 0, 1) if x 0 else r 0 }... }... TRANSLATING STRUCTURED SSA TO ANF 18-B

38 TRANSLATING STRUCTURED SSA TO ANF proc fac(x) { goto L 1 L 1 :{ if x 0 goto L 1 else ret r 0 L 2 :r 1 mul(r 0, x 0 ) x 1 sub(x 0, 1) goto L 1 } }... letrec fac(x) = letrec fac ( ) = letrec fac () = let r 1 = mul(r 0, x 0 ) let x 1 = sub(x 0, 1) fac ( ) if x 0 fac () else r 0 fac ( )... TRANSLATING STRUCTURED SSA TO ANF 18-C

39 TRANSLATING STRUCTURED SSA TO ANF proc fac(x) { goto L 1 L 1 :{ r 0 φ( ) x 0 φ( ) if x 0 goto L 1 else ret r 0 L 2 :r 1 mul(r 0, x 0 ) x 1 sub(x 0, 1) goto L 1 } }... letrec fac(x) = letrec fac (x 0, r 0 ) = letrec fac () = let r 1 = mul(r 0, x 0 ) let x 1 = sub(x 0, 1) fac ( ) if x 0 fac () else r 0 fac ( )... TRANSLATING STRUCTURED SSA TO ANF 18-D

40 TRANSLATING STRUCTURED SSA TO ANF proc fac(x) { goto L 1 L 1 :{ r 0 φ(start:1, L 1 :r 1 ) x 0 φ(start:x, L 1 :x 1 ) if x 0 goto L 1 else ret r 0 L 2 :r 1 mul(r 0, x 0 ) x 1 sub(x 0, 1) goto L 1 } }... letrec fac(x) = letrec fac (x 0, r 0 ) = letrec fac () = let r 1 = mul(r 0, x 0 ) let x 1 = sub(x 0, 1) fac (r 1, x 1 ) if x 0 fac () else r 0 fac (x, 1)... TRANSLATING STRUCTURED SSA TO ANF 18-E

41 WHAT HAVE WE GAINED? A way of trickg hackers to writg functional programs A way of thkg about functional programs as SSA programs applyg SSA algorithms to functional programs A way of thkg about SSA programs as functional programs applyg formal techniques to SSA programs So, let s have a look at a concrete algorithm... WHAT HAVE WE GAINED? 19

42 SPARSE CONDITIONAL CONSTANT PROPAGATION proc seven(x) { goto L 1 L 1 :x 0 φ(start:1, L 1 :x 1 ) } x 1 sub(x 0, 1) if x 1 then goto L 1 else ret 7 proc seven(x) { } ret 7 The origal SSA algorithm (Wegman & Zadeck, 1991) rather formally presented... SPARSE CONDITIONAL CONSTANT PROPAGATION 20

43 SPARSE CONDITIONAL CONSTANT PROPAGATION 21

44 A FRAGMENT OF SCC ANF A v Γ Ω = Γv, Γ, Ω A f (v 1,...,vn ) Γ Ω f Prim = E f (Γv Abs 1,...,Γvn ) otherwise = Γ f, Γ,if changed then Ω {f } else Ω where f is defed as f(x 1,...,xn) = e Γ = Γ [f, x 1 Γv 1,..., xn Γvn] changed = i.γx i Γv i -- dicates whether Γ changed A letrec f 1,..., fn e Γ Ω = let a, Γ, Ω = A e Γ{} Γ, Ω = A fix f 1,..., fn Γ (Ω Ω ) if Γ == Γ then a, Γ, Ω else A letrec f 1,..., fn e Γ Ω A fix fun 1,...,funn ΓΩ i.f i Ω = Γ, Ω otherwise = let a, Γ, Ω = A e Γ{} Γ = Γ [f i a] Ω = Ω Ω \ {f i } A fix fun 1,..., funn Γ (if Γf i Γa then Ω (Occ f i Dom Γ) else Ω ) where (f i (x 1,...,xm )=e) = fun i A FRAGMENT OF SCC ANF 22

45 AN OVERVIEW OF SCC ANF Denoted T E X-ised Haskell Operates on programs ANF Split to analysis and simplification stages Operates over the standard lattice N for constant propagation: (not a constant) n (no formation available) AN OVERVIEW OF SCC ANF 23

46 SO, HOW DOES IT WORK? Analysis proceeds by abstract terpretation under an environment Γ mappg variables to lattice values Matas a work list Ω of functions to visit by spectg call sites and trackg free variables for changes to abstract variables Functions added to the work list whenever any of its free variables is refed the environment letrec s are processed recursively until the work list is emptied The resultg abstract environment contas all formation obtaed about any constants Simplification phase replaces variables by constant values and elimates redundant branches SO, HOW DOES IT WORK? 24

47 letrec f(x) = let x = sub(x, x) if x then f(x ) else x f(7) SO, HOW DOES IT WORK? 25

48 letrec f(x) = let x = sub(x, x) if x then f(x ) else x f(7) Γ = {f,x 7},Ω = {f} SO, HOW DOES IT WORK? 25-A

49 letrec f(x) = Γ = {f,x 7},Ω = {} let x = sub(x, x) if x then f(x ) else x f(7) Γ = {f,x 7},Ω = {f} SO, HOW DOES IT WORK? 25-B

50 letrec f(x) = Γ = {f,x 7},Ω = {} let x = sub(x, x) Γ = {f, x 7,x 0},Ω = {} if x then f(x ) else x f(7) Γ = {f,x 7},Ω = {f} SO, HOW DOES IT WORK? 25-C

51 letrec f(x) = Γ = {f,x 7},Ω = {} let x = sub(x, x) Γ = {f, x 7,x 0},Ω = {} if x then f(x ) else x Γ = {f 7, x 7,x 0},Ω = {f} f(7) Γ = {f,x 7},Ω = {f} SO, HOW DOES IT WORK? 25-D

52 letrec f(x) = Γ = {f,x 7},Ω = {} let x = sub(x, x) Γ = {f, x 7,x 0},Ω = {} if x then f(x ) else x Γ = {f 7, x 7,x 0},Ω = {f} f(7) Γ = {f,x 7},Ω = {f} Γ = {f 7, x 7,x 0},Ω = {f} SO, HOW DOES IT WORK? 25-E

53 letrec f(x) = let x = sub(x, x) if x then f(x ) else x f(7) Γ = {f,x 7},Ω = {} Γ = {f 7,x 7,x 0},Ω = {} Γ = {f, x 7,x 0},Ω = {} Γ = {f 7,x 7,x 0},Ω = {} Γ = {f 7, x 7,x 0},Ω = {f} Γ = {f 7,x 7,x 0},Ω = {} Γ = {f,x 7},Ω = {f} Γ = {f 7, x 7,x 0},Ω = {f} SO, HOW DOES IT WORK? 25-F

54 letrec f(x) = let x = sub(x, 1) if x then f(x ) else x f(7) SO, HOW DOES IT WORK? 26

55 letrec f(x) = Γ = {f,x 7},Ω = {} let x = sub(x, 1) if x then f(x ) else x f(7) SO, HOW DOES IT WORK? 26-A

56 letrec f(x) = Γ = {f,x 7},Ω = {} let x = sub(x, 1) Γ = {f, x 7,x 6},Ω = {} if x then f(x ) else x f(7) SO, HOW DOES IT WORK? 26-B

57 letrec f(x) = Γ = {f,x 7},Ω = {} let x = sub(x, 1) Γ = {f, x 7,x 6},Ω = {} if x then f(x ) Γ = {f, x, x 6},Ω = {f} else x f(7) SO, HOW DOES IT WORK? 26-C

58 letrec f(x) = let x = sub(x, 1) Γ = {f,x 7},Ω = {} Γ = {f, x, x 6},Ω = {} Γ = {f, x 7,x 6},Ω = {} if x then f(x ) Γ = {f, x, x 6},Ω = {f} else x f(7) SO, HOW DOES IT WORK? 26-D

59 letrec f(x) = let x = sub(x, 1) if x then f(x ) Γ = {f,x 7},Ω = {} Γ = {f, x, x 6},Ω = {} Γ = {f, x 7,x 6},Ω = {} Γ = {f, x, x },Ω = {} Γ = {f, x, x 6},Ω = {f} else x f(7) SO, HOW DOES IT WORK? 26-E

60 letrec f(x) = let x = sub(x, 1) if x then f(x ) else x f(7) Γ = {f,x 7},Ω = {} Γ = {f, x, x 6},Ω = {} Γ = {f, x 7,x 6},Ω = {} Γ = {f, x, x },Ω = {} Γ = {f, x, x 6},Ω = {f} Γ = {f, x, x },Ω = {} Γ = {f,x, x },Ω = {f} SO, HOW DOES IT WORK? 26-F

61 WORK COMPLEXITY ➀ Each variable updated at most three times (same as SCC SSA ) ➁ Each function processed once for each change to its free variables ( SCC SSA, processed once for each comg SSA edge) ➂ Number of free variables corresponds directly to number of SSA edges ➃ Therefore, SCC ANF has the same work comlexity as SCC SSA. WORK COMPLEXITY 27

62 OBSERVATIONS ➀ SCC ANF performs ter-procedural analysis transparently, although alias analysis and performance still a problem ➁ Vanilla SCC ANF cannot handle higher-order functions ➂ The algorithm does not preserve non-termation ➃ Optimistic algorithms are difficult to analyze: environment valid until fixpot reached very complex variants OBSERVATIONS 28

63 CONCLUSIONS Benefits of ANF: Simplifies the operational semantics, the environment and therefore static analysis and formal reasong Allows us to view imperative programs as encodgs of functional programs Allows us to adopt SSA algorithms for compilation of functional programs Integrates tra- and ter-procedural analysis Straight forward extension to higher-order functions CONCLUSIONS 29

64 THE PAPER patrykz/papers/ssa-lambda/ THE PAPER 30

65 THE ANALYSIS FUNCTION: VALUES A v Γ Ω = Γ v, Γ, Ω THE ANALYSIS FUNCTION: VALUES 31

66 THE ANALYSIS FUNCTION: VALUES & APPLICATIONS A v Γ Ω = Γ v, Γ, Ω A f (v 1,...,v n ) Γ Ω f Prim = E Abs f (Γ v 1,..., Γ v n ) otherwise = Γ f, Γ, if changed then Ω {f } else Ω where f is defed as f(x 1,...,x n ) = e Γ = Γ [f, x 1 Γ v 1,..., x n Γ v n ] changed = i. Γ x i Γ v i -- dicates whether Γ changed THE ANALYSIS FUNCTION: VALUES & APPLICATIONS 31-A

67 THE ANALYSIS FUNCTION: let A let x=e 1 e 2 Γ Ω = let a, Γ, Ω = A e 1 Γ Ω Γ = Γ [x a] changed = Γ x Γ a affected = Occ x DomΓ -- DomΓ removes not yet used func A e 2 Γ (if changed then Ω affected else Ω) THE ANALYSIS FUNCTION: let 32

68 THE ANALYSIS FUNCTION: if-then A if v then e 1 else e 2 Γ Ω Γ v == =, Γ, Ω Γ v == True = A e 1 Γ Ω Γ v == False = A e 2 Γ Ω Γ v == = let a 1, Γ 1, Ω 1 = A e 1 Γ Ω a 2, Γ 2, Ω 2 = A e 2 Γ 1 Ω 1 a 1 a 2, Γ 2, Ω 2 THE ANALYSIS FUNCTION: if-then 33

69 THE ANALYSIS FUNCTION: letrec A fix fun 1,..., fun n Γ (if Γ f i Γ a then Ω (Occ f i DomΓ) else Ω A letrec f 1,...,f n e Γ Ω = let a, Γ, Ω = A e Γ {} Γ, Ω = A fix f 1,..., f n Γ (Ω Ω ) if Γ == Γ then a, Γ, Ω else A letrec f 1,..., f n e Γ Ω A fix fun 1,..., fun n Γ Ω i.f i Ω = Γ, Ω otherwise = let a, Γ, Ω = A e Γ {} Γ = Γ [f i a] Ω = Ω Ω \ {f i } THE ANALYSIS FUNCTION: letrec 34

70 where (f i (x 1,..., x m ) = e) = fun i THE ANALYSIS FUNCTION: letrec 35

Value Range Propagation

Value Range Propagation Value Range Propagation LLVM Adam Wiggs Patryk Zadarnowski {awiggs,patrykz}@cse.unsw.edu.au 17 June 2003 University of New South Wales Sydney MOTIVATION The Problem: X Layout of basic blocks LLVM is bra-dead.

More information

COSE312: Compilers. Lecture 17 Intermediate Representation (2)

COSE312: Compilers. Lecture 17 Intermediate Representation (2) COSE312: Compilers Lecture 17 Intermediate Representation (2) Hakjoo Oh 2017 Spring Hakjoo Oh COSE312 2017 Spring, Lecture 17 May 31, 2017 1 / 19 Common Intermediate Representations Three-address code

More information

What is SSA? each assignment to a variable is given a unique name all of the uses reached by that assignment are renamed

What is SSA? each assignment to a variable is given a unique name all of the uses reached by that assignment are renamed Another Form of Data-Flow Analysis Propagation of values for a variable reference, where is the value produced? for a variable definition, where is the value consumed? Possible answers reaching definitions,

More information

Static Program Analysis

Static Program Analysis Static Program Analysis Xiangyu Zhang The slides are compiled from Alex Aiken s Michael D. Ernst s Sorin Lerner s A Scary Outline Type-based analysis Data-flow analysis Abstract interpretation Theorem

More information

Computing Static Single Assignment (SSA) Form

Computing Static Single Assignment (SSA) Form Computing Static Single Assignment (SSA) Form Overview What is SSA? Advantages of SSA over use-def chains Flavors of SSA Dominance frontiers revisited Inserting φ-nodes Renaming the variables Translating

More information

Topic-I-C Dataflow Analysis

Topic-I-C Dataflow Analysis Topic-I-C Dataflow Analysis 2012/3/2 \course\cpeg421-08s\topic4-a.ppt 1 Global Dataflow Analysis Motivation We need to know variable def and use information between basic blocks for: constant folding dead-code

More information

Quantum Functional Programming Language & Its Denotational Semantics

Quantum Functional Programming Language & Its Denotational Semantics Quantum Functional Programming Language & Its Denotational Semantics Ichiro Hasuo Dept. Computer Science University of Tokyo Naohiko Hoshino Research Inst. for Math. Sci. Kyoto University Talk based on:

More information

Flow grammars a flow analysis methodology

Flow grammars a flow analysis methodology Flow grammars a flow analysis methodology James S. Uhl and R. Nigel Horspool Dept. of Computer Science, University of Victoria P.O. Box 3055, Victoria, BC, Canada V8W 3P6 E-mail: juhl@csr.uvic.ca, nigelh@csr.uvic.ca

More information

Static Program Analysis

Static Program Analysis Static Program Analysis Thomas Noll Software Modeling and Verification Group RWTH Aachen University https://moves.rwth-aachen.de/teaching/ss-18/spa/ Recap: Interprocedural Dataflow Analysis Outline of

More information

Equalities and Uninterpreted Functions. Chapter 3. Decision Procedures. An Algorithmic Point of View. Revision 1.0

Equalities and Uninterpreted Functions. Chapter 3. Decision Procedures. An Algorithmic Point of View. Revision 1.0 Equalities and Uninterpreted Functions Chapter 3 Decision Procedures An Algorithmic Point of View D.Kroening O.Strichman Revision 1.0 Outline Decision Procedures Equalities and Uninterpreted Functions

More information

Principles of Program Analysis: Control Flow Analysis

Principles of Program Analysis: Control Flow Analysis Principles of Program Analysis: Control Flow Analysis Transparencies based on Chapter 3 of the book: Flemming Nielson, Hanne Riis Nielson and Chris Hankin: Principles of Program Analysis. Springer Verlag

More information

This is the published version of a paper presented at Programmiersprachen und Grundlagen der Programmierung KPS 2015.

This is the published version of a paper presented at Programmiersprachen und Grundlagen der Programmierung KPS 2015. http://www.diva-portal.org This is the published version of a paper presented at Programmiersprachen und Grundlagen der Programmierung KPS 2015. Citation for the original published paper: Hedenborg, M.,

More information

EDA045F: Program Analysis LECTURE 10: TYPES 1. Christoph Reichenbach

EDA045F: Program Analysis LECTURE 10: TYPES 1. Christoph Reichenbach EDA045F: Program Analysis LECTURE 10: TYPES 1 Christoph Reichenbach In the last lecture... Performance Counters Challenges in Dynamic Performance Analysis Taint Analysis Binary Instrumentation 2 / 44 Types

More information

Review. Principles of Programming Languages. Equality. The Diamond Property. The Church-Rosser Theorem. Corollaries. CSE 230: Winter 2007

Review. Principles of Programming Languages. Equality. The Diamond Property. The Church-Rosser Theorem. Corollaries. CSE 230: Winter 2007 CSE 230: Winter 2007 Principles of Programming Languages Lecture 12: The λ-calculus Ranjit Jhala UC San Diego Review The lambda calculus is a calculus of functions: e := x λx. e e 1 e 2 Several evaluation

More information

Typing λ-terms. Types. Typed λ-terms. Base Types. The Typing Relation. Advanced Formal Methods. Lecture 3: Simply Typed Lambda calculus

Typing λ-terms. Types. Typed λ-terms. Base Types. The Typing Relation. Advanced Formal Methods. Lecture 3: Simply Typed Lambda calculus Course 2D1453, 200607 Advanced Formal Methods Lecture 3: Simply Typed Lambda calculus Mads Dam KTH/CSC Some material from B. Pierce: TAPL + some from G. Klein, NICTA Typing λterms The uptyped λcalculus

More information

Propositional Logic: Part II - Syntax & Proofs 0-0

Propositional Logic: Part II - Syntax & Proofs 0-0 Propositional Logic: Part II - Syntax & Proofs 0-0 Outline Syntax of Propositional Formulas Motivating Proofs Syntactic Entailment and Proofs Proof Rules for Natural Deduction Axioms, theories and theorems

More information

CSC D70: Compiler Optimization Dataflow-2 and Loops

CSC D70: Compiler Optimization Dataflow-2 and Loops CSC D70: Compiler Optimization Dataflow-2 and Loops Prof. Gennady Pekhimenko University of Toronto Winter 2018 The content of this lecture is adapted from the lectures of Todd Mowry and Phillip Gibbons

More information

Lecture Notes on The Curry-Howard Isomorphism

Lecture Notes on The Curry-Howard Isomorphism Lecture Notes on The Curry-Howard Isomorphism 15-312: Foundations of Programming Languages Frank Pfenning Lecture 27 ecember 4, 2003 In this lecture we explore an interesting connection between logic and

More information

Foundations of Artificial Intelligence

Foundations of Artificial Intelligence Foundations of Artificial Intelligence 31. Propositional Logic: DPLL Algorithm Malte Helmert and Gabriele Röger University of Basel April 24, 2017 Propositional Logic: Overview Chapter overview: propositional

More information

Programming Language Concepts, CS2104 Lecture 3

Programming Language Concepts, CS2104 Lecture 3 Programming Language Concepts, CS2104 Lecture 3 Statements, Kernel Language, Abstract Machine 31 Aug 2007 CS2104, Lecture 3 1 Reminder of last lecture Programming language definition: syntax, semantics

More information

Lecture Overview SSA Maximal SSA Semipruned SSA o Placing -functions o Renaming Translation out of SSA Using SSA: Sparse Simple Constant Propagation

Lecture Overview SSA Maximal SSA Semipruned SSA o Placing -functions o Renaming Translation out of SSA Using SSA: Sparse Simple Constant Propagation 1 Lecture Overview SSA Maximal SSA Semipruned SSA o Placing -functions o Renaming Translation out of SSA Using SSA: Sparse Simple Constant Propagation [Chapter 9] 2 SSA Revisited It is desirable to use

More information

Chapter 11: Automated Proof Systems (1)

Chapter 11: Automated Proof Systems (1) Chapter 11: Automated Proof Systems (1) SYSTEM RS OVERVIEW Hilbert style systems are easy to define and admit a simple proof of the Completeness Theorem but they are difficult to use. Automated systems

More information

Mechanics of Static Analysis

Mechanics of Static Analysis Escuela 03 III / 1 Mechanics of Static Analysis David Schmidt Kansas State University www.cis.ksu.edu/~schmidt Escuela 03 III / 2 Outline 1. Small-step semantics: trace generation 2. State generation and

More information

CHAPTER 10. Gentzen Style Proof Systems for Classical Logic

CHAPTER 10. Gentzen Style Proof Systems for Classical Logic CHAPTER 10 Gentzen Style Proof Systems for Classical Logic Hilbert style systems are easy to define and admit a simple proof of the Completeness Theorem but they are difficult to use. By humans, not mentioning

More information

Space-aware data flow analysis

Space-aware data flow analysis Space-aware data flow analysis C. Bernardeschi, G. Lettieri, L. Martini, P. Masci Dip. di Ingegneria dell Informazione, Università di Pisa, Via Diotisalvi 2, 56126 Pisa, Italy {cinzia,g.lettieri,luca.martini,paolo.masci}@iet.unipi.it

More information

Programming Languages

Programming Languages CSE 230: Winter 2010 Principles of Programming Languages Lecture 10: Programming in λ-calculusc l l Ranjit Jhala UC San Diego Review The lambda calculus is a calculus of functions: e := x λx. e e 1 e 2

More information

Hoare Logic: Reasoning About Imperative Programs

Hoare Logic: Reasoning About Imperative Programs Hoare Logic: Reasoning About Imperative Programs COMP1600 / COMP6260 Dirk Pattinson Australian National University Semester 2, 2018 Programming Paradigms Functional. (Haskell, SML, OCaml,... ) main paradigm:

More information

Extending the Lambda Calculus: An Eager Functional Language

Extending the Lambda Calculus: An Eager Functional Language Syntax of the basic constructs: Extending the Lambda Calculus: An Eager Functional Language canonical forms z cfm ::= intcfm boolcfm funcfm tuplecfm altcfm intcfm ::= 0 1-1... boolcfm ::= boolconst funcfm

More information

Simply Typed Lambda Calculus

Simply Typed Lambda Calculus Simply Typed Lambda Calculus Language (ver1) Lambda calculus with boolean values t ::= x variable x : T.t abstraction tt application true false boolean values if ttt conditional expression Values v ::=

More information

Computation Tree Logic (CTL) & Basic Model Checking Algorithms

Computation Tree Logic (CTL) & Basic Model Checking Algorithms Computation Tree Logic (CTL) & Basic Model Checking Algorithms Martin Fränzle Carl von Ossietzky Universität Dpt. of Computing Science Res. Grp. Hybride Systeme Oldenburg, Germany 02917: CTL & Model Checking

More information

Rough Sets Used in the Measurement of Similarity of Mixed Mode Data

Rough Sets Used in the Measurement of Similarity of Mixed Mode Data Rough Sets Used the Measurement of Similarity of Mixed Mode Data Sarah Coppock Lawrence Mazlack Applied Artificial Intelligence Laboratory ECECS Department University of Ccnati Ccnati Ohio 45220 {coppocsmazlack}@ucedu

More information

Dataflow Analysis. A sample program int fib10(void) { int n = 10; int older = 0; int old = 1; Simple Constant Propagation

Dataflow Analysis. A sample program int fib10(void) { int n = 10; int older = 0; int old = 1; Simple Constant Propagation -74 Lecture 2 Dataflow Analysis Basic Blocks Related Optimizations SSA Copyright Seth Copen Goldstein 200-8 Dataflow Analysis Last time we looked at code transformations Constant propagation Copy propagation

More information

Data flow analysis. DataFlow analysis

Data flow analysis. DataFlow analysis Data flow analysis DataFlow analysis compile time reasoning about the runtime flow of values in the program represent facts about runtime behavior represent effect of executing each basic block propagate

More information

CSC D70: Compiler Optimization Static Single Assignment (SSA)

CSC D70: Compiler Optimization Static Single Assignment (SSA) CSC D70: Compiler Optimization Static Single Assignment (SSA) Prof. Gennady Pekhimenko University of Toronto Winter 08 The content of this lecture is adapted from the lectures of Todd Mowry and Phillip

More information

The Expressivity of Universal Timed CCP: Undecidability of Monadic FLTL and Closure Operators for Security

The Expressivity of Universal Timed CCP: Undecidability of Monadic FLTL and Closure Operators for Security The Expressivity of Universal Timed CCP: Undecidability of Monadic FLTL and Closure Operators for Security Carlos Olarte and Frank D. Valencia INRIA /CNRS and LIX, Ecole Polytechnique Motivation Concurrent

More information

Automatic Verification of Parameterized Data Structures

Automatic Verification of Parameterized Data Structures Automatic Verification of Parameterized Data Structures Jyotirmoy V. Deshmukh, E. Allen Emerson and Prateek Gupta The University of Texas at Austin The University of Texas at Austin 1 Outline Motivation

More information

MIT Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology

MIT Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology MIT 6.035 Foundations of Dataflow Analysis Martin Rinard Laboratory for Computer Science Massachusetts Institute of Technology Dataflow Analysis Compile-Time Reasoning About Run-Time Values of Variables

More information

Generalizing Data-flow Analysis

Generalizing Data-flow Analysis Generalizing Data-flow Analysis Announcements PA1 grades have been posted Today Other types of data-flow analysis Reaching definitions, available expressions, reaching constants Abstracting data-flow analysis

More information

2.4 Parsing. Computer Science 332. Compiler Construction. Chapter 2: A Simple One-Pass Compiler : Parsing. Top-Down Parsing

2.4 Parsing. Computer Science 332. Compiler Construction. Chapter 2: A Simple One-Pass Compiler : Parsing. Top-Down Parsing Computer Science 332 Compiler Construction Chapter 2: A Simple One-Pass Compiler 2.4-2.5: Parsg 2.4 Parsg Parsg : the process of determg whether a strg S is generated by a grammar G Short answer is yes/no

More information

Chapter 11: Automated Proof Systems

Chapter 11: Automated Proof Systems Chapter 11: Automated Proof Systems SYSTEM RS OVERVIEW Hilbert style systems are easy to define and admit a simple proof of the Completeness Theorem but they are difficult to use. Automated systems are

More information

Abstract Interpretation from a Topological Perspective

Abstract Interpretation from a Topological Perspective (-: / 1 Abstract Interpretation from a Topological Perspective David Schmidt Kansas State University www.cis.ksu.edu/ schmidt Motivation and overview of results (-: / 2 (-: / 3 Topology studies convergent

More information

Liveness based Garbage Collection

Liveness based Garbage Collection CS738: Advanced Compiler Optimizations Liveness based Garbage Collection Amey Karkare karkare@cse.iitk.ac.in http://www.cse.iitk.ac.in/~karkare/cs738 Department of CSE, IIT Kanpur Ideal Garbage Collection...

More information

Propositional Logic: Methods of Proof (Part II)

Propositional Logic: Methods of Proof (Part II) Propositional Logic: Methods of Proof (Part II) You will be expected to know Basic definitions Inference, derive, sound, complete Conjunctive Normal Form (CNF) Convert a Boolean formula to CNF Do a short

More information

ECE 5775 (Fall 17) High-Level Digital Design Automation. Control Flow Graph

ECE 5775 (Fall 17) High-Level Digital Design Automation. Control Flow Graph ECE 5775 (Fall 17) High-Level Digital Design Automation Control Flow Graph Announcements ECE colloquium on Monday 9/11 from 4:30pm, PHL 233 Smart Healthcare by Prof. Niraj Jha of Princeton Lab 1 is due

More information

A Fixed Point Representation of References

A Fixed Point Representation of References A Fixed Point Representation of References Susumu Yamasaki Department of Computer Science, Okayama University, Okayama, Japan yamasaki@momo.cs.okayama-u.ac.jp Abstract. This position paper is concerned

More information

Inducing syntactic cut-elimination for indexed nested sequents

Inducing syntactic cut-elimination for indexed nested sequents Inducing syntactic cut-elimination for indexed nested sequents Revantha Ramanayake Technische Universität Wien (Austria) IJCAR 2016 June 28, 2016 Revantha Ramanayake (TU Wien) Inducing syntactic cut-elimination

More information

G54FOP: Lecture 17 & 18 Denotational Semantics and Domain Theory III & IV

G54FOP: Lecture 17 & 18 Denotational Semantics and Domain Theory III & IV G54FOP: Lecture 17 & 18 Denotational Semantics and Domain Theory III & IV Henrik Nilsson University of Nottingham, UK G54FOP: Lecture 17 & 18 p.1/33 These Two Lectures Revisit attempt to define denotational

More information

Roy L. Crole. Operational Semantics Abstract Machines and Correctness. University of Leicester, UK

Roy L. Crole. Operational Semantics Abstract Machines and Correctness. University of Leicester, UK Midlands Graduate School, University of Birmingham, April 2008 1 Operational Semantics Abstract Machines and Correctness Roy L. Crole University of Leicester, UK Midlands Graduate School, University of

More information

CS 553 Compiler Construction Fall 2006 Homework #2 Dominators, Loops, SSA, and Value Numbering

CS 553 Compiler Construction Fall 2006 Homework #2 Dominators, Loops, SSA, and Value Numbering CS 553 Compiler Construction Fall 2006 Homework #2 Dominators, Loops, SSA, and Value Numbering Answers Write your answers on another sheet of paper. Homework assignments are to be completed individually.

More information

Spring 2016 Program Analysis and Verification. Lecture 3: Axiomatic Semantics I. Roman Manevich Ben-Gurion University

Spring 2016 Program Analysis and Verification. Lecture 3: Axiomatic Semantics I. Roman Manevich Ben-Gurion University Spring 2016 Program Analysis and Verification Lecture 3: Axiomatic Semantics I Roman Manevich Ben-Gurion University Warm-up exercises 1. Define program state: 2. Define structural semantics configurations:

More information

Decision Procedures for Satisfiability and Validity in Propositional Logic

Decision Procedures for Satisfiability and Validity in Propositional Logic Decision Procedures for Satisfiability and Validity in Propositional Logic Meghdad Ghari Institute for Research in Fundamental Sciences (IPM) School of Mathematics-Isfahan Branch Logic Group http://math.ipm.ac.ir/isfahan/logic-group.htm

More information

Lecture 10: Gentzen Systems to Refinement Logic CS 4860 Spring 2009 Thursday, February 19, 2009

Lecture 10: Gentzen Systems to Refinement Logic CS 4860 Spring 2009 Thursday, February 19, 2009 Applied Logic Lecture 10: Gentzen Systems to Refinement Logic CS 4860 Spring 2009 Thursday, February 19, 2009 Last Tuesday we have looked into Gentzen systems as an alternative proof calculus, which focuses

More information

CMSC 336: Type Systems for Programming Languages Lecture 10: Polymorphism Acar & Ahmed 19 February 2008

CMSC 336: Type Systems for Programming Languages Lecture 10: Polymorphism Acar & Ahmed 19 February 2008 CMSC 336: Type Systems for Programming Languages Lecture 10: Polymorphism Acar & Ahmed 19 February 2008 Contents 1 Polymorphism 1 2 Polymorphic λ-calculus: Syntax 1 3 Static Semantics 2 4 Dynamic Semantics

More information

LOGIC PROPOSITIONAL REASONING

LOGIC PROPOSITIONAL REASONING LOGIC PROPOSITIONAL REASONING WS 2017/2018 (342.208) Armin Biere Martina Seidl biere@jku.at martina.seidl@jku.at Institute for Formal Models and Verification Johannes Kepler Universität Linz Version 2018.1

More information

Kirsten Lackner Solberg. Dept. of Math. and Computer Science. Odense University, Denmark

Kirsten Lackner Solberg. Dept. of Math. and Computer Science. Odense University, Denmark Inference Systems for Binding Time Analysis Kirsten Lackner Solberg Dept. of Math. and Computer Science Odense University, Denmark e-mail: kls@imada.ou.dk June 21, 1993 Contents 1 Introduction 4 2 Review

More information

Search and Lookahead. Bernhard Nebel, Julien Hué, and Stefan Wölfl. June 4/6, 2012

Search and Lookahead. Bernhard Nebel, Julien Hué, and Stefan Wölfl. June 4/6, 2012 Search and Lookahead Bernhard Nebel, Julien Hué, and Stefan Wölfl Albert-Ludwigs-Universität Freiburg June 4/6, 2012 Search and Lookahead Enforcing consistency is one way of solving constraint networks:

More information

Developing Modal Tableaux and Resolution Methods via First-Order Resolution

Developing Modal Tableaux and Resolution Methods via First-Order Resolution Developing Modal Tableaux and Resolution Methods via First-Order Resolution Renate Schmidt University of Manchester Reference: Advances in Modal Logic, Vol. 6 (2006) Modal logic: Background Established

More information

Extensions to the Logic of All x are y: Verbs, Relative Clauses, and Only

Extensions to the Logic of All x are y: Verbs, Relative Clauses, and Only 1/53 Extensions to the Logic of All x are y: Verbs, Relative Clauses, and Only Larry Moss Indiana University Nordic Logic School August 7-11, 2017 2/53 An example that we ll see a few times Consider the

More information

Software Verification

Software Verification Software Verification Grégoire Sutre LaBRI, University of Bordeaux, CNRS, France Summer School on Verification Technology, Systems & Applications September 2008 Grégoire Sutre Software Verification VTSA

More information

Introduction to lambda calculus Part 2

Introduction to lambda calculus Part 2 Introduction to lambda calculus Part 2 Antti-Juhani Kaijanaho 2017-01-24... 1 Untyped lambda calculus 1.1 Syntax... x, y, z Var t, u Term t, u ::= x t u λx t... In this document, I will be using the following

More information

Unifying Theories of Programming

Unifying Theories of Programming 1&2 Unifying Theories of Programming Unifying Theories of Programming 3&4 Theories Unifying Theories of Programming designs predicates relations reactive CSP processes Jim Woodcock University of York May

More information

Diagrams for Meaning Preservation

Diagrams for Meaning Preservation Diagrams for Meaning Preservation 2003-06-13 Joe Wells Detlef Plump Fairouz Kamareddine Heriot-Watt University University of York www.cee.hw.ac.uk/ultra www.cs.york.ac.uk/ det Diagrams for Meaning Preservation

More information

Size-Change Termination and Transition Invariants

Size-Change Termination and Transition Invariants Size-Change Termination and Transition Invariants Matthias Heizmann 1, Neil D. Jones 2, and Andreas Podelski 1 1 University of Freiburg, Germany 2 University of Copenhagen, Denmark Abstract. Two directions

More information

Implicit Self-Adjusting Computation for Purely Functional Programs

Implicit Self-Adjusting Computation for Purely Functional Programs Implicit Self-Adjustg Computation for Purely Functional Programs Yan Chen Joshua Dunfield Matthew A. Hammer Umut A. Acar MPI-SWS September 19, 2011 Incremental/Dynamic Problems Input: 3, 5, 8, 2, 10, 4,

More information

Lecture Notes: Program Analysis Correctness

Lecture Notes: Program Analysis Correctness Lecture Notes: Program Analysis Correctness 15-819O: Program Analysis Jonathan Aldrich jonathan.aldrich@cs.cmu.edu Lecture 5 1 Termination As we think about the correctness of program analysis, let us

More information

Automata-based Verification - III

Automata-based Verification - III CS3172: Advanced Algorithms Automata-based Verification - III Howard Barringer Room KB2.20/22: email: howard.barringer@manchester.ac.uk March 2005 Third Topic Infinite Word Automata Motivation Büchi Automata

More information

2 Results I: Lifting Computer Science

2 Results I: Lifting Computer Science Ben Greenman December 12, 2015 Call-By-Name, Call-By-Value, and the λ Calculus Abstract Plotkin s 1975 paper is strictly business. There are many theorems packed in the space of 35 pages, with little room

More information

Programming Languages Fall 2013

Programming Languages Fall 2013 Programming Languages Fall 2013 Lecture 11: Subtyping Prof Liang Huang huang@qccscunyedu Big Picture Part I: Fundamentals Functional Programming and Basic Haskell Proof by Induction and Structural Induction

More information

Propositional and Predicate Logic - V

Propositional and Predicate Logic - V Propositional and Predicate Logic - V Petr Gregor KTIML MFF UK WS 2016/2017 Petr Gregor (KTIML MFF UK) Propositional and Predicate Logic - V WS 2016/2017 1 / 21 Formal proof systems Hilbert s calculus

More information

Formal Methods in Software Engineering

Formal Methods in Software Engineering Formal Methods in Software Engineering An Introduction to Model-Based Analyis and Testing Vesal Vojdani Department of Computer Science University of Tartu Fall 2014 Vesal Vojdani (University of Tartu)

More information

Improved Algorithms for Module Extraction and Atomic Decomposition

Improved Algorithms for Module Extraction and Atomic Decomposition Improved Algorithms for Module Extraction and Atomic Decomposition Dmitry Tsarkov tsarkov@cs.man.ac.uk School of Computer Science The University of Manchester Manchester, UK Abstract. In recent years modules

More information

Using the Prover I: Lee Pike. June 3, NASA Langley Formal Methods Group Using the Prover I:

Using the Prover I: Lee Pike. June 3, NASA Langley Formal Methods Group Using the Prover I: Basic Basic NASA Langley Formal Methods Group lee.s.pike@nasa.gov June 3, 2005 Basic Sequents Basic Sequent semantics: The conjunction of the antecedents above the turnstile implies the disjunction of

More information

Material Covered on the Final

Material Covered on the Final Material Covered on the Final On the final exam, you are responsible for: Anything covered in class, except for stories about my good friend Ken Kennedy All lecture material after the midterm ( below the

More information

Advanced Topics in LP and FP

Advanced Topics in LP and FP Lecture 1: Prolog and Summary of this lecture 1 Introduction to Prolog 2 3 Truth value evaluation 4 Prolog Logic programming language Introduction to Prolog Introduced in the 1970s Program = collection

More information

Type Systems. Today. 1. What is the Lambda Calculus. 1. What is the Lambda Calculus. Lecture 2 Oct. 27th, 2004 Sebastian Maneth

Type Systems. Today. 1. What is the Lambda Calculus. 1. What is the Lambda Calculus. Lecture 2 Oct. 27th, 2004 Sebastian Maneth Today 1. What is the Lambda Calculus? Type Systems 2. Its Syntax and Semantics 3. Church Booleans and Church Numerals 4. Lazy vs. Eager Evaluation (call-by-name vs. call-by-value) Lecture 2 Oct. 27th,

More information

Temporal logics and explicit-state model checking. Pierre Wolper Université de Liège

Temporal logics and explicit-state model checking. Pierre Wolper Université de Liège Temporal logics and explicit-state model checking Pierre Wolper Université de Liège 1 Topics to be covered Introducing explicit-state model checking Finite automata on infinite words Temporal Logics and

More information

Decision Diagrams and Dynamic Programming

Decision Diagrams and Dynamic Programming Decision Diagrams and Dynamic Programming J. N. Hooker Carnegie Mellon University CPAIOR 13 Decision Diagrams & Dynamic Programming Binary/multivalued decision diagrams are related to dynamic programming.

More information

Scalar Optimisation Part 1

Scalar Optimisation Part 1 calar Optimisation Part 1 Michael O Boyle January, 2014 1 Course tructure L1 Introduction and Recap 4/5 lectures on classical optimisation 2 lectures on scalar optimisation Today example optimisations

More information

A Note on Scope and Infinite Behaviour in CCS-like Calculi p.1/32

A Note on Scope and Infinite Behaviour in CCS-like Calculi p.1/32 A Note on Scope and Infinite Behaviour in CCS-like Calculi GERARDO SCHNEIDER UPPSALA UNIVERSITY DEPARTMENT OF INFORMATION TECHNOLOGY UPPSALA, SWEDEN Joint work with Pablo Giambiagi and Frank Valencia A

More information

A Functional Language for Hyperstreaming XSLT

A Functional Language for Hyperstreaming XSLT A Functional Language for Hyperstreaming XSLT Pavel Labath 1, Joachim Niehren 2 1 Commenius University, Bratislava, Slovakia 2 Inria Lille, France May 2013 Motivation some types of tree transformations

More information

Notes from Yesterday s Discussion. Big Picture. CIS 500 Software Foundations Fall November 1. Some lessons.

Notes from Yesterday s  Discussion. Big Picture. CIS 500 Software Foundations Fall November 1. Some lessons. CIS 500 Software Foundations Fall 2006 Notes from Yesterday s Email Discussion November 1 Some lessons This is generally a crunch-time in the semester Slow down a little and give people a chance to catch

More information

Inverting Proof Systems for Secrecy under OWA

Inverting Proof Systems for Secrecy under OWA Inverting Proof Systems for Secrecy under OWA Giora Slutzki Department of Computer Science Iowa State University Ames, Iowa 50010 slutzki@cs.iastate.edu May 9th, 2010 Jointly with Jia Tao and Vasant Honavar

More information

Static Program Analysis using Abstract Interpretation

Static Program Analysis using Abstract Interpretation Static Program Analysis using Abstract Interpretation Introduction Static Program Analysis Static program analysis consists of automatically discovering properties of a program that hold for all possible

More information

Automata-based Verification - III

Automata-based Verification - III COMP30172: Advanced Algorithms Automata-based Verification - III Howard Barringer Room KB2.20: email: howard.barringer@manchester.ac.uk March 2009 Third Topic Infinite Word Automata Motivation Büchi Automata

More information

Lecture 10: Data Flow Analysis II

Lecture 10: Data Flow Analysis II CS 515 Programming Language and Compilers I Lecture 10: Data Flow Analysis II (The lectures are based on the slides copyrighted by Keith Cooper and Linda Torczon from Rice University.) Zheng (Eddy) Zhang

More information

DFA of non-distributive properties

DFA of non-distributive properties DFA of non-distributive properties The general pattern of Dataflow Analysis GA (p)= i if p E { GA (q) q F } otherwise GA (p)= f p ( GA (p) ) where : E is the set of initial/final points of the control-flow

More information

NP-Complete Reductions 2

NP-Complete Reductions 2 x 1 x 1 x 2 x 2 x 3 x 3 x 4 x 4 12 22 32 CS 447 11 13 21 23 31 33 Algorithms NP-Complete Reductions 2 Prof. Gregory Provan Department of Computer Science University College Cork 1 Lecture Outline NP-Complete

More information

Structure. Background. them to their higher order equivalents. functionals in Standard ML source code and converts

Structure. Background. them to their higher order equivalents. functionals in Standard ML source code and converts Introduction 3 Background functionals factor out common behaviour map applies a function to every element of a list fun map [ ] = [ ] map f ( x : : xs ) = f x : : map f xs filter keeps only those elements

More information

From Liveness to Promptness

From Liveness to Promptness From Liveness to Promptness Orna Kupferman Hebrew University Nir Piterman EPFL Moshe Y. Vardi Rice University Abstract Liveness temporal properties state that something good eventually happens, e.g., every

More information

CTL satisfability via tableau A C++ implementation

CTL satisfability via tableau A C++ implementation CTL satisfability via tableau A C++ implementation Nicola Prezza April 30, 2015 Outline 1 Introduction 2 Parsing 3 Data structures 4 Initial sets of labels and edges 5 Cull 6 Examples and benchmarks The

More information

Logical Agents. Knowledge based agents. Knowledge based agents. Knowledge based agents. The Wumpus World. Knowledge Bases 10/20/14

Logical Agents. Knowledge based agents. Knowledge based agents. Knowledge based agents. The Wumpus World. Knowledge Bases 10/20/14 0/0/4 Knowledge based agents Logical Agents Agents need to be able to: Store information about their environment Update and reason about that information Russell and Norvig, chapter 7 Knowledge based agents

More information

Verifying the LLVM. Steve Zdancewic DeepSpec Summer School 2017

Verifying the LLVM. Steve Zdancewic DeepSpec Summer School 2017 Verifying the LLVM Steve Zdancewic DeepSpec Summer School 2017 Vminus OperaAonal SemanAcs Only 5 kinds of instrucaons: Binary arithmeac Memory Load Memory Store Terminators Phi nodes What is the state

More information

Lecture 11: Data Flow Analysis III

Lecture 11: Data Flow Analysis III CS 515 Programming Language and Compilers I Lecture 11: Data Flow Analysis III (The lectures are based on the slides copyrighted by Keith Cooper and Linda Torczon from Rice University.) Zheng (Eddy) Zhang

More information

Abstractions and Decision Procedures for Effective Software Model Checking

Abstractions and Decision Procedures for Effective Software Model Checking Abstractions and Decision Procedures for Effective Software Model Checking Prof. Natasha Sharygina The University of Lugano, Carnegie Mellon University Microsoft Summer School, Moscow, July 2011 Lecture

More information

On the Structure and Complexity of Symbolic Proofs of Polynomial Identities

On the Structure and Complexity of Symbolic Proofs of Polynomial Identities On the Structure and Complexity of Symbolic Proofs of Polynomial Identities Iddo Tzameret Tel Aviv University, Tel Aviv 69978, Israel Abstract A symbolic proof for establishing that a given arithmetic

More information

Chapter 4: Computation tree logic

Chapter 4: Computation tree logic INFOF412 Formal verification of computer systems Chapter 4: Computation tree logic Mickael Randour Formal Methods and Verification group Computer Science Department, ULB March 2017 1 CTL: a specification

More information

CS 4110 Programming Languages & Logics. Lecture 16 Programming in the λ-calculus

CS 4110 Programming Languages & Logics. Lecture 16 Programming in the λ-calculus CS 4110 Programming Languages & Logics Lecture 16 Programming in the λ-calculus 30 September 2016 Review: Church Booleans 2 We can encode TRUE, FALSE, and IF, as: TRUE λx. λy. x FALSE λx. λy. y IF λb.

More information

COMP6463: λ-calculus

COMP6463: λ-calculus COMP6463: λ-calculus 1. Basics Michael Norrish Michael.Norrish@nicta.com.au Canberra Research Lab., NICTA Semester 2, 2015 Outline Introduction Lambda Calculus Terms Alpha Equivalence Substitution Dynamics

More information

A Linear First-Order Functional Intermediate Language for Verified Compilers

A Linear First-Order Functional Intermediate Language for Verified Compilers A Linear First-Order Functional Intermediate Language for Verified Compilers Sigurd Schneider, Gert Smolka, Sebastian Hack Saarland University, Saarbrücken, Germany arxiv:1503.08665v2 [cs.pl] 4 Jun 2015

More information

arxiv: v3 [cs.pl] 15 May 2011

arxiv: v3 [cs.pl] 15 May 2011 A Step-indexed Semantic Model of Types for the Call-by-Name Lambda Calculus arxiv:1105.1985v3 [cs.pl] 15 May 2011 Abstract Step-indexed semantic models of types were proposed as an alternative to purely

More information