deciding kcfa is complete for exptime

56
Deciding k CFA is complete for EXPTIME David Van Horn and Harry Mairson

Upload: others

Post on 05-Apr-2022

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Deciding kCFA is complete for EXPTIME

Deciding kCFA is completefor EXPTIMEDavid Van Horn and Harry Mairson

Page 2: Deciding kCFA is complete for EXPTIME

Overview

For any k > 0, we prove that the control flow decision problemis complete for deterministic exponential time (EXPTIME).

This theorem:

⋆ gives an exact characterization of the computationalcomplexity of the kCFA hierarchy

⋆ validates empirical observations that such control flowanalysis is intractable

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.1/29

Page 3: Deciding kCFA is complete for EXPTIME

Plan

⋆ Proving lower bounds — programming with analysis— What is kCFA?— Linearity and precision— Non-linearity and an exponential iterator

⋆ Simulating exponential Turing machines with kCFA

⋆ Conclusions

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.2/29

Page 4: Deciding kCFA is complete for EXPTIME

Proving lower bounds

A lower bound establishes the minimum computationalrequirements it takes to solve a class of problems.

kCFA is provably intractable (EXPTIME-hard)

The proof goes by construction:

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.3/29

Page 5: Deciding kCFA is complete for EXPTIME

Proving lower bounds

A lower bound establishes the minimum computationalrequirements it takes to solve a class of problems.

kCFA is provably intractable (EXPTIME-hard)

The proof goes by construction:

⋆ given the description of a Turing machine and its input,

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.3/29

Page 6: Deciding kCFA is complete for EXPTIME

Proving lower bounds

A lower bound establishes the minimum computationalrequirements it takes to solve a class of problems.

kCFA is provably intractable (EXPTIME-hard)

The proof goes by construction:

⋆ given the description of a Turing machine and its input,

⋆ produce an instance of the kCFA problem,

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.3/29

Page 7: Deciding kCFA is complete for EXPTIME

Proving lower bounds

A lower bound establishes the minimum computationalrequirements it takes to solve a class of problems.

kCFA is provably intractable (EXPTIME-hard)

The proof goes by construction:

⋆ given the description of a Turing machine and its input,

⋆ produce an instance of the kCFA problem,

⋆ whose analysis faithfully simulates the TM on the input

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.3/29

Page 8: Deciding kCFA is complete for EXPTIME

Proving lower bounds

A lower bound establishes the minimum computationalrequirements it takes to solve a class of problems.

kCFA is provably intractable (EXPTIME-hard)

The proof goes by construction:

⋆ given the description of a Turing machine and its input,

⋆ produce an instance of the kCFA problem,

⋆ whose analysis faithfully simulates the TM on the input

⋆ for an exponential number of steps.

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.3/29

Page 9: Deciding kCFA is complete for EXPTIME

Proving lower bounds

A lower bound establishes the minimum computationalrequirements it takes to solve a class of problems.

kCFA is provably intractable (EXPTIME-hard)

The proof goes by construction:

⋆ given the description of a Turing machine and its input,

⋆ produce an instance of the kCFA problem,

⋆ whose analysis faithfully simulates the TM on the input

⋆ for an exponential number of steps.

A compiler!▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.3/29

Page 10: Deciding kCFA is complete for EXPTIME

Proving lower bounds

A lower bound establishes the minimum computationalrequirements it takes to solve a class of problems.

kCFA is provably intractable (EXPTIME-hard)

The proof goes by construction:

⋆ given the description of a Turing machine and its input,

⋆ produce an instance of the kCFA problem,

⋆ whose analysis faithfully simulates the TM on the input

⋆ for an exponential number of steps.

A (weird) compiler!International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.3/29

Page 11: Deciding kCFA is complete for EXPTIME

Strange animal

A compiler:

⋆ Source language: exponential TMs with input

⋆ Target language: the λ-calculus

⋆ Interpreter: kCFA (as TM simulator)

∴ kCFA is complete for EXPTIME.

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.4/29

Page 12: Deciding kCFA is complete for EXPTIME

More strange animals

Other compilers (ICFP’07):

⋆ Source language: Boolean formulas

⋆ Target language: the λ-calculus

⋆ Interpreter: kCFA (as SAT solver)

∴ kCFA is NP-hard.

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.5/29

Page 13: Deciding kCFA is complete for EXPTIME

More strange animals

Other compilers (ICFP’07):

⋆ Source language: circuit with inputs

⋆ Target language: the linear λ-calculus

⋆ Interpreter: 0CFA (as λ evaluator)

∴ 0CFA is complete for PTIME.

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.5/29

Page 14: Deciding kCFA is complete for EXPTIME

More strange animals

Other compilers (SAS’08):

⋆ Source language: circuit with inputs

⋆ Target language: the linear λ-calculus

⋆ Interpreter: Simple closure analysis (as λ evaluator)

∴ Simple closure analysis is complete for PTIME.

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.5/29

Page 15: Deciding kCFA is complete for EXPTIME

More strange animals

Other compilers (Mairson, JFP’04):

⋆ Source language: circuit with inputs

⋆ Target language: the linear λ-calculus

⋆ Interpreter: type inference (as λ evaluator)

∴ Simple type inference is complete for PTIME.

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.5/29

Page 16: Deciding kCFA is complete for EXPTIME

More strange animals

Other examples (Neergaard and Mairson, ICFP’04):

⋆ Source language: elementary TMs with input

⋆ Target language: the λ calculus

⋆ Interpreter: rank-k ∧-type inference (as λ evaluator)

∴ Rank-k ∧-type inference is complete for DTIME(K(k, n)).

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.5/29

Page 17: Deciding kCFA is complete for EXPTIME

More strange animals

Other examples (Mairson, POPL’89):

⋆ Source language: exponential TMs with input

⋆ Target language: ML

⋆ Interpreter: type inference (as ML evaluator)

∴ ML type inference is complete for EXPTIME.

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.5/29

Page 18: Deciding kCFA is complete for EXPTIME

A complexity zoo of static analysis

0CFA ≡ Simple closure analysis ≡ Sub-0CFA ≡ Simple typeinference ≡ Linear λ-calculus ≡ MLL. . .

⊂kCFA ≡ ML type inference. . .

⊂Rank-k intersection type inference. . .

⊂Exact CFA ≡ Simply typed λ-calculus. . .

⊂∞CFA ≡ The λ-calculus. . .

“Program analysis is still far from being able to precisely relateingredients of different approaches to one another.”

(Nielson et al. 1999)

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.6/29

Page 19: Deciding kCFA is complete for EXPTIME

Plan

⋆ Proving lower bounds — programming with analysis— What is kCFA?— Linearity and precision— Non-linearity and an exponential iterator

⋆ Simulating exponential Turing machines with kCFA

⋆ Conclusions

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.7/29

Page 20: Deciding kCFA is complete for EXPTIME

Flow analysis

Flow analysis is concerned with the sound approximation ofrun-time values at compile time.

Analysis answers decision problems such as:does expression e possibly evaluate to value v?

⋆ The most approximate analysis always answers yes.— no resources to compute, but useless

⋆ The most precise analysis answers yes iff e evaluates to v.— useful, but unbounded resources to compute

For tractability, there is a necessary sacrifice of information instatic analysis. (A blessing and a curse.)

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.8/29

Page 21: Deciding kCFA is complete for EXPTIME

kCFA

Intuition— the more information we compute about contexts,the more precisely we can answer flow questions.But this takes work.

It did not take long to discover that the basic analysis, for anyk > 0, was intractably slow for large programs.

Shivers, Higher-order control-flow analysis in retrospect:Lessons learned, lessons abandoned (2004)

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.9/29

Page 22: Deciding kCFA is complete for EXPTIME

Polyvariance

During reduction, a function may copy its argument:

((λ f .· · ·( f e1)ℓ1· · ·( f e2)

ℓ2· · ·)(λx.e))

Contours (strings of application labels) let us talk about ein each of the distinct calling contexts.

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.10/29

Page 23: Deciding kCFA is complete for EXPTIME

Cache-based evaluatorExp e ::= tℓ expressions (or labeled terms)Term t ::= x | e e | λx.e terms (or unlabeled expressions)

Evaluate the term t, which is closed under environment ce.

EJtℓKceδ

Write the result into location (ℓ, δ) of the cache C.

C(ℓ, δ) = v means tℓ evaluates to v in context δ.

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.11/29

Page 24: Deciding kCFA is complete for EXPTIME

∞CFA

A cache-based evaluator:

C ∈ Cache = (Lab + Var)× Lab⋆ → (Term× Env)

EJ(tℓ1 tℓ2)ℓKceδ = EJtℓ1Kce

δ ; EJtℓ2Kceδ ;

let 〈λx.tℓ0 , ce′〉 = C(ℓ1, δ) inC(x, δℓ)← C(ℓ2, δ);

EJtℓ0Kce′[x 7→δℓ]δℓ

C(ℓ, δ)← C(ℓ0, δℓ)

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.12/29

Page 25: Deciding kCFA is complete for EXPTIME

kCFA

An abstraction of the cache-based evaluator:

C ∈ Cache = (Lab + Var)× Lab≤k → P(Term× Env)

AJ(tℓ1tℓ2)ℓKceδ = AJtℓ1Kce

δ ;AJtℓ2Kceδ ;

foreach 〈λx.tℓ0 , ce′〉 ∈ C(ℓ1, δ) :

C(x, ⌈δℓ⌉k)← C(ℓ2, δ);

AJtℓ0Kce′[x 7→⌈δℓ⌉k]⌈δℓ⌉k

;

C(ℓ, δ)← C(ℓ0, ⌈δℓ⌉k)

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.13/29

Page 26: Deciding kCFA is complete for EXPTIME

Plan

⋆ Proving lower bounds — programming with analysis— What is kCFA?— Linearity and precision— Non-linearity and an exponential iterator

⋆ Simulating exponential Turing machines with kCFA

⋆ Conclusions

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.14/29

Page 27: Deciding kCFA is complete for EXPTIME

Linearity and evaluation

Since in a linear λ-term,

⋆ each abstraction can be applied to at most one argument

⋆ each variable can be bound to at most one value

Analysis of a linear term coincides exactly with its evaluation.

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.15/29

Page 28: Deciding kCFA is complete for EXPTIME

Boolean logic

Coding Boolean logic in linear λ-calculus (ICFP’07):

TT ≡ λp.let 〈x, y〉 = p in 〈x, y〉 True ≡ 〈TT, FF〉

FF ≡ λp.let 〈x, y〉 = p in 〈y, x〉 False ≡ 〈FF, TT〉

Copy ≡ λb.let 〈u, v〉 = b in 〈u〈TT, FF〉, v〈FF, TT〉〉

Implies ≡ λb1.λb2.

let 〈u1, v1〉 = b1 inlet 〈u2, v2〉 = b2 inlet 〈p1, p2〉 = u1〈u2, TT〉 inlet 〈q1, q2〉 = v1〈FF, v2〉 in〈p1, q1 ◦ p2 ◦ q2 ◦ FF〉

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.16/29

Page 29: Deciding kCFA is complete for EXPTIME

Plan

⋆ Proving lower bounds — programming with analysis— What is kCFA?— Linearity and precision— Non-linearity and an exponential iterator

⋆ Simulating exponential Turing machines with kCFA

⋆ Conclusions

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.17/29

Page 30: Deciding kCFA is complete for EXPTIME

Approximation as power tool

Hardness of kCFA relies on two insights:

1. Program points are approximated by an exponentialnumber of closures.

2. Inexactness of analysis engenders reevaluation whichprovides computational power.

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.18/29

Page 31: Deciding kCFA is complete for EXPTIME

Abstract closures

Many closures can flow to a single program point:

(λw.wx1x2 . . . xn)⋆ n free variables

⋆ an exponential number of possible associatedenvironments mapping these variables to program points(contours of length 1 in 1CFA).

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.19/29

Page 32: Deciding kCFA is complete for EXPTIME

Toy calculation, with insights

Consider the following non-linear example

(λ f .( f True)( f False))

(λx.

(λp.p(λu.p(λv.(Implies u v))))(λw.wx))

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.20/29

Page 33: Deciding kCFA is complete for EXPTIME

Toy calculation, with insights

Consider the following non-linear example

(λ f .( f True)( f False))

(λx.

(λp.p(λu.p(λv.(Implies u v))))(λw.wx))

Q: What does Implies u v evaluate to ?

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.20/29

Page 34: Deciding kCFA is complete for EXPTIME

Toy calculation, with insights

Consider the following non-linear example

(λ f .( f True)( f False))

(λx.

(λp.p(λu.p(λv.(Implies u v))))(λw.wx))

Q: What does Implies u v evaluate to ?A: True: it is equivalent to Implies x x, a tautology.

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.20/29

Page 35: Deciding kCFA is complete for EXPTIME

Toy calculation, with insights

Consider the following non-linear example

(λ f .( f True)( f False))

(λx.

(λp.p(λu.p(λv.(Implies u v))))(λw.wx))

Q: What does Implies u v evaluate to ?A: True: it is equivalent to Implies x x, a tautology.

Q: What flows out of Implies u v?

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.20/29

Page 36: Deciding kCFA is complete for EXPTIME

Toy calculation, with insights

Consider the following non-linear example

(λ f .( f True)( f False))

(λx.

(λp.p(λu.p(λv.(Implies u v))))(λw.wx))

Q: What does Implies u v evaluate to ?A: True: it is equivalent to Implies x x, a tautology.

Q: What flows out of Implies u v?A: both True and False: Not true evaluation!

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.20/29

Page 37: Deciding kCFA is complete for EXPTIME

Toy calculation, with insights

Consider the following non-linear example

(λ f .( f True)( f False))

(λx.

(λp.p(λu.p(λv.(Implies u v))))(λw.wx))

Q: What does Implies u v evaluate to ?A: True: it is equivalent to Implies x x, a tautology.

Q: What flows out of Implies u v?A: both True and False: Not true evaluation!

We are computing with the approximation (spurious flows).

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.20/29

Page 38: Deciding kCFA is complete for EXPTIME

Plan

⋆ Proving lower bounds — programming with analysis— What is kCFA?— Linearity and precision— Non-linearity and an exponential iterator

⋆ Simulating exponential Turing machines with kCFA

⋆ Conclusions

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.21/29

Page 39: Deciding kCFA is complete for EXPTIME

Jigsaw puzzles, Machines

The idea:

⋆ Break machine ID into an exponentialnumber of pieces

⋆ Do piecemeal transitions on pairs ofpuzzle pieces

〈T, S, H, C, b〉

“At time T, machine is in state S, the head is atcell H, and cell C holds symbol b”

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.22/29

Page 40: Deciding kCFA is complete for EXPTIME

Jigsaw puzzles, Machines

〈T, S, H, C, b〉: “At time T, machine is in state S, the head is atcell H, and cell C holds symbol b”

1) Compute:δ〈T, S, H, H, b〉〈T, S′, H′, C′, b′〉 =

〈T + 1, δQ(S, b), δLR(S, H, b), H, δΣ(S, b)〉

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.23/29

Page 41: Deciding kCFA is complete for EXPTIME

Jigsaw puzzles, Machines

〈T, S, H, C, b〉: “At time T, machine is in state S, the head is atcell H, and cell C holds symbol b”

1) Compute:δ〈T, S, H, H, b〉〈T, S′, H′, C′, b′〉 =

〈T + 1, δQ(S, b), δLR(S, H, b), H, δΣ(S, b)〉

2) Communicate:δ〈T + 1, S, H, C, b〉〈T, S′, H′, C′, b′〉 = 〈T + 1, S, H, C′, b′〉

(H′ 6= C′)

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.23/29

Page 42: Deciding kCFA is complete for EXPTIME

Jigsaw puzzles, Machines

〈T, S, H, C, b〉: “At time T, machine is in state S, the head is atcell H, and cell C holds symbol b”

1) Compute:δ〈T, S, H, H, b〉〈T, S′, H′, C′, b′〉 =

〈T + 1, δQ(S, b), δLR(S, H, b), H, δΣ(S, b)〉

2) Communicate:δ〈T + 1, S, H, C, b〉〈T, S′, H′, C′, b′〉 = 〈T + 1, S, H, C′, b′〉

(H′ 6= C′)

3) Otherwise:δ〈T, S, H, C, b〉〈T′, S′, H′, C′, b′〉 = 〈some goofy null value〉

(T 6= T′ and T 6= T′ + 1)

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.23/29

Page 43: Deciding kCFA is complete for EXPTIME

The real deal

Setting up initial ID, iterator, and test:

(λ f1.( f1 0)( f1 1))

(λz1.

(λ f2.( f2 0)( f2 1))

(λz2.

· · ·

(λ fN .( fN 0)( fN 1))

(λzN .

(let Φ = coding of transition function of TM in

Widget[Extract(Y Φ (λw.w 0 . . . 0 Q0 H0 z1z2 . . . zN 0))])) . . .))

〈T, S, H, C, b〉

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.24/29

Page 44: Deciding kCFA is complete for EXPTIME

The real deal. . . let Φ = coding of transition function of TM in

Widget[Extract(Y Φ (λw.w 0 . . . 0 Q0 H0 z1z2 . . . zN 0))] . . .

〈T, S, H, C, b〉

Φ ≡ (λp.p(λx1.λx2. . . . λxm.p(λy1.λy2 . . . λym.

(φx1x2 . . . xmy1y2 . . . ym))))

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.25/29

Page 45: Deciding kCFA is complete for EXPTIME

The real deal. . . let Φ = coding of transition function of TM in

Widget[Extract(Y Φ (λw.w 0 . . . 0 Q0 H0 z1z2 . . . zN 0))] . . .

〈T, S, H, C, b〉

Φ ≡ (λp.p(λx1.λx2. . . . λxm.p(λy1.λy2 . . . λym.

(φx1x2 . . . xmy1y2 . . . ym))))

Widget[E] ≡ . . . f . . . a . . ., where a flows as an argument to fiff a True value flows out of E.

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.25/29

Page 46: Deciding kCFA is complete for EXPTIME

The real deal. . . let Φ = coding of transition function of TM in

Widget[Extract(Y Φ (λw.w 0 . . . 0 Q0 H0 z1z2 . . . zN 0))] . . .

〈T, S, H, C, b〉

Φ ≡ (λp.p(λx1.λx2. . . . λxm.p(λy1.λy2 . . . λym.

(φx1x2 . . . xmy1y2 . . . ym))))

Widget[E] ≡ . . . f . . . a . . ., where a flows as an argument to fiff a True value flows out of E.

Theorem In kCFA, a flow to f iff TM accept in 2n steps.

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.25/29

Page 47: Deciding kCFA is complete for EXPTIME

The real deal. . . let Φ = coding of transition function of TM in

Widget[Extract(Y Φ (λw.w 0 . . . 0 Q0 H0 z1z2 . . . zN 0))] . . .

〈T, S, H, C, b〉

Φ ≡ (λp.p(λx1.λx2. . . . λxm.p(λy1.λy2 . . . λym.

(φx1x2 . . . xmy1y2 . . . ym))))

Widget[E] ≡ . . . f . . . a . . ., where a flows as an argument to fiff a True value flows out of E.

Theorem In kCFA, a flow to f iff TM accept in 2n steps.Theorem kCFA decision problem is complete for EXPTIME.

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.25/29

Page 48: Deciding kCFA is complete for EXPTIME

Plan

⋆ Proving lower bounds — programming with analysis— What is kCFA?— Linearity and precision— Non-linearity and an exponential iterator

⋆ Simulating exponential Turing machines with kCFA

⋆ Conclusions

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.26/29

Page 49: Deciding kCFA is complete for EXPTIME

What makes kCFA hard?

This is not just a replaying of the previous proofs.

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.27/29

Page 50: Deciding kCFA is complete for EXPTIME

What makes kCFA hard?

This is not just a replaying of the previous proofs.

⋆ If the analysis were simulating evaluation,

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.27/29

Page 51: Deciding kCFA is complete for EXPTIME

What makes kCFA hard?

This is not just a replaying of the previous proofs.

⋆ If the analysis were simulating evaluation,

⋆ there would be one entry in each cache location,

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.27/29

Page 52: Deciding kCFA is complete for EXPTIME

What makes kCFA hard?

This is not just a replaying of the previous proofs.

⋆ If the analysis were simulating evaluation,

⋆ there would be one entry in each cache location,

⋆ therefore bounded by a polynomial!

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.27/29

Page 53: Deciding kCFA is complete for EXPTIME

What makes kCFA hard?

This is not just a replaying of the previous proofs.

⋆ If the analysis were simulating evaluation,

⋆ there would be one entry in each cache location,

⋆ therefore bounded by a polynomial!

Might and Shivers’ observation:improved precision leads to analyzer speedups.

▽International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.27/29

Page 54: Deciding kCFA is complete for EXPTIME

What makes kCFA hard?

This is not just a replaying of the previous proofs.

⋆ If the analysis were simulating evaluation,

⋆ there would be one entry in each cache location,

⋆ therefore bounded by a polynomial!

Might and Shivers’ observation:improved precision leads to analyzer speedups.

Analytic understanding:What you pay for in kCFA is the junk (spurious flows).

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.27/29

Page 55: Deciding kCFA is complete for EXPTIME

Doggie bag

⋆ There is no tractable algorithm for kCFA

⋆ Linearity is key in understanding static analysis

⋆ The approximation of kCFA is what makes it hard

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.28/29

Page 56: Deciding kCFA is complete for EXPTIME

The End

Thank you.

International Conference on Functional Programming (ICFP), 2008 Deciding kCFA is complete for EXPTIME – p.29/29