Functional Reachability Luke Ong and Nikos Tzevelekos University of Oxford Shonan, September 2011

What this talk is about Reachability in functional computation. • Consider a term M of a higher-order functional programming language. • Now consider a point p inside M . • Is there a program context C such that computation of C[M ] reaches p?

Functional Reachability – 2

What this talk is about Reachability in functional computation. • Consider a term M of a higher-order functional programming language. • Now consider a point p inside M . •

Is there a program context C such that computation of C[M ] reaches p?

Functional Reachability – 2

What this talk is about Reachability in functional computation. • Consider a term M of a higher-order functional programming language. • Now consider a point p inside M . •

Is there a program context C such that computation of C[M ] reaches p?

Surprisingly, (Contextual) Reachability per se had not been studied in HO functional languages. Idea: Use Games, Traversals, Automata.

Functional Reachability – 2

Relevant work • Control Flow Analysis. Compute at compile time the flow of control that is going to happen at run time. • Reynolds (’70), Jones (’80), Shivers (’90), many more people in this room, . . . Using game semantics: Malacaria & Hankin (late 90’s). • CFA > Reach: more general. Reach > CFA: open vs closed world approach.

Functional Reachability – 3

Relevant work • Control Flow Analysis. Compute at compile time the flow of control that is going to happen at run time. • Reynolds (’70), Jones (’80), Shivers (’90), many more people in this room, . . . Using game semantics: Malacaria & Hankin (late 90’s). • CFA > Reach: more general. Reach > CFA: open vs closed world approach. • Useless code detection. • Strictness analysis, etc. Functional Reachability – 3

PCF The examined language: (binary) PCF. • lambda-calculus, • Boolean base type, • recursion at all types.

A, B ::= o | A → B v ::= t | f M, N ::= v | x | λx.M | M N | if M N1 N2 | YA

Functional Reachability – 4

PCF

A, B ::= o | A → B v ::= t | f M, N ::= v | x | λx.M | M N | if M N1 N2 | YA

Functional Reachability – 5

PCF

A, B ::= o | A → B v ::= t | f M, N ::= v | x | λx.M | M N | if M N1 N2 | YA (λx.M )N → M {N/x} YM → M (YM )

if t → λxy.x if f → λxy.y

M → N =⇒ E[M ] → E[N ] E ::= [−] | E M | if E Functional Reachability – 5

PCF

A, B ::= o | A → B

Call-by-name λ-calculus +if + Y

v ::= t | f M, N ::= v | x | λx.M | M N | if M N1 N2 | YA • Write (A1 , . . . , An , o) for A1 → · · · → An → o. • Divergence definable, e.g. ⊥ := Yo (λx.x).

Functional Reachability – 5

PCF

A, B ::= o | A → B

Call-by-name λ-calculus +if + Y

v ::= t | f M, N ::= v | x | λx.M | M N | if M N1 N2 | YA • Write (A1 , . . . , An , o) for A1 → · · · → An → o. • Divergence definable, e.g. ⊥ := Yo (λx.x). • Finitary restrictions (i.e. no Y): fPCF

M, N ::= v | x | λx.M | M N | if M N1 N2

fPCF⊥

M, N ::= v | x | λx.M | M N | if M N1 N2 | ⊥ Functional Reachability – 5

Reachability Using a Context Lemma we can restate Reachability as:

• Given a closed PCF-term M : (A1 , ..., An , o) and a coloured subterm L of M , • Are there closed PCF-terms N1 : A1 , . . . , Nn : An and a coloured term L′ such that

~ ։ E[L′ ] ? MN

Functional Reachability – 6

Reachability Using a Context Lemma we can restate Reachability as:

• Given a closed PCF-term M : (A1 , ..., An , o) and a coloured subterm L of M , • Are there closed PCF-terms N1 : A1 , . . . , Nn : An and a coloured term L′ such that

~ ։ E[L′ ] ? MN We can make things simpler

Functional Reachability – 6

PCF-with-error: PCF⋆ • Include an error constant: o = {t, f, ⋆} • New rule: if ⋆ → λxy.⋆

(i.e. E[⋆] ։ ⋆)

Functional Reachability – 7

PCF-with-error: PCF⋆ • Include an error constant: o = {t, f, ⋆} • New rule: if ⋆ → λxy.⋆

(i.e. E[⋆] ։ ⋆)

⋆-Reachability: • Given a closed PCF⋆ -term M with exactly one ⋆ ,

~ ։ ⋆? • Are there closed PCF-terms N1 , ..., Nn such that M N

Functional Reachability – 7

PCF-with-error: PCF⋆ • Include an error constant: o = {t, f, ⋆} • New rule: if ⋆ → λxy.⋆

(i.e. E[⋆] ։ ⋆)

⋆-Reachability: • Given a closed PCF⋆ -term M with exactly one ⋆ ,

~ ։ ⋆? • Are there closed PCF-terms N1 , ..., Nn such that M N

Reachability ∼ = ⋆-Reachability

Functional Reachability – 7

Reach template v-Reach [L1 , L2 ]:

v ∈ {t, f, ⋆} and L1 , L2 ⊆ PCF⋆

• Given a closed L1 -term M ,

~ ։ v? • Are there closed L2 -terms N1 , ..., Nn such that M N

E.g.

  ⋆-Reachability = ⋆-Reach [PCF1⋆ , PCF] 

Functional Reachability – 8

Reach template v-Reach [L1 , L2 ]:

v ∈ {t, f, ⋆} and L1 , L2 ⊆ PCF⋆

• Given a closed L1 -term M ,

~ ։ v? • Are there closed L2 -terms N1 , ..., Nn such that M N

E.g.

  ⋆-Reachability = ⋆-Reach [PCF1⋆ , PCF]

 v-Reach [L, PCF] = v-Reach [L, fPCF]

Functional Reachability – 8

Reach template v-Reach [L1 , L2 ]:

v ∈ {t, f, ⋆} and L1 , L2 ⊆ PCF⋆

• Given a closed L1 -term M ,

~ ։ v? • Are there closed L2 -terms N1 , ..., Nn such that M N

E.g.

  ⋆-Reachability = ⋆-Reach [PCF1⋆ , PCF]

 v-Reach [L, PCF] = v-Reach [L, fPCF] From [Loader]: Observational equivalence in fPCF⊥ is undecidable. therefore: t-Reach [fPCF⊥ , fPCF] is undecidable. Functional Reachability – 8

Undecidability The following problems are undecidable. • t-Reach [fPCF⊥ , fPCF] • ⋆-Reach [fPCF1⊥⋆ , fPCF] • ⋆-Reachability, i.e. ⋆-Reach [PCF1⋆ , PCF] • Reachability

Functional Reachability – 9

Undecidability The following problems are undecidable. • t-Reach [fPCF⊥ , fPCF] • ⋆-Reach [fPCF1⊥⋆ , fPCF] • ⋆-Reachability, i.e. ⋆-Reach [PCF1⋆ , PCF] • Reachability Not all is lost • Reachability for finitary M ? • ⋆-Reach [fPCF1⋆ , fPCF] ? • ⋆-Reach [fPCF⋆ , fPCF] ? Functional Reachability – 9

Our approach We focus on v-Reach [fPCF⋆ , fPCF]

Computations of fPCF⋆ -term P : o O 

Traversals over its computation tree, λ(P ) O 

Runs of an Alternating Tree Automaton (ATA) on λ(P )

Functional Reachability – 10

Our approach We focus on v-Reach [fPCF⋆ , fPCF]

Computations of fPCF⋆ -term P : o O 

Traversals over its computation tree, λ(P ) O 

Runs of an Alternating Tree Automaton (ATA) on λ(P )

P ։ v iff an ATA accepts λ(P ) on initial state with value v Functional Reachability – 10

Computation trees Starting from a fPCF⋆ -term M , • take its η-long form, • add application symbols (@), • view the result as a tree, λ(M ).

Functional Reachability – 11

Computation trees Starting from a fPCF⋆ -term M ,

λ

• take its η-long form,  

• add application symbols (@),

?? NNN NN

λf x λ

λΦz

• view the result as a tree, λ(M ). ( λΦz. Φ(λy. ify ⋆ z)t ) (λf x. f x) t

@ ?NNN

7−→

λy

~~ ~ ~

>> >

if C  C

λ y



λ ⋆

CC

f

Φ>

λ

λ

t

x

t

λ z

Functional Reachability – 11

Traversals A traversal [Blum, Ong] over a full computation tree: • follows the flow of control within it, • seen from the perspective of Game Semantics.

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: λ • follows the flow of control within it,

@ JTJTTTT t JJ TTTT tt t JJ TTTT t t t TTT

• seen from the perspective of Game Semantics. λΦz

λy

λ y

Φ II t t II t t II t t II t t

v if LLLL v LL vv v LL vv

λ ⋆

λf x

λ

f

t

λ

λ

t

x

λ z

⋆-complete traversal

Functional Reachability – 12

Traversals A traversal [Blum, Ong] over a full computation tree: • follows the flow of control within it, • seen from the perspective of Game Semantics. A traversal is v -complete if: • every question (red visit) has been answered (green visit), • and the root question has been answered with v . For any P : o and v , P ։ v iff there is a v -complete traversal over λ(P ).

Functional Reachability – 12

Alternating Tree Automata An ATA is a quadruple A = hQ, Σ, q0 , ∆i where: • Q is a finite set of states, • Σ is a finite ranked alphabet, • q0 ∈ Q is the initial state, • ∆ is a finite transition relation: q

s∈Σ q∈Q s → (Q1 , . . . , Qk ). Q1 , ... , Qk ⊆ Q

Functional Reachability – 13

Alternating Tree Automata An ATA is a quadruple A = hQ, Σ, q0 , ∆i where: • Q is a finite set of states, • Σ is a finite ranked alphabet, • q0 ∈ Q is the initial state, • ∆ is a finite transition relation: q

s1 ...

s∈Σ q∈Q s → (Q1 , . . . , Qk ). Q1 , ... , Qk ⊆ Q

ly s OOOO l l OOO ll yy l l y OOO ll yy l l OOO y ll l y O l l ...

s2

...

...

sk ... Functional Reachability – 13

Alternating Tree Automata An ATA is a quadruple A = hQ, Σ, q0 , ∆i where: • Q is a finite set of states, • Σ is a finite ranked alphabet, • q0 ∈ Q is the initial state, • ∆ is a finite transition relation: q

s∈Σ q∈Q s → (Q1 , . . . , Qk ). Q1 , ... , Qk ⊆ Q

A(q)

s1 ...

ly s OOOO l l OOO ll yy l l y OOO ll yy l l OOO y ll l y O l l ...

s2

...

...

sk ... Functional Reachability – 13

Alternating Tree Automata An ATA is a quadruple A = hQ, Σ, q0 , ∆i where: • Q is a finite set of states, • Σ is a finite ranked alphabet, • q0 ∈ Q is the initial state, • ∆ is a finite transition relation: q

s∈Σ q∈Q s → (Q1 , . . . , Qk ). Q1 , ... , Qk ⊆ Q

ly s OOOO l l OOO ll yy l l y OOO ll yy l l OOO y 2) ll1 ) A(Q l A(Q y O l l ...

s1

s2

...

...

...

A(Qk )

sk

... Functional Reachability – 13

Traversal-simulating ATA’s λ

How can we simulate a complete traversal by an ATA?

@-;

;   --- ;;; - ; 

λf x λ

λΦz

f

Φ-

  --

λy

λ

λ

if 0

t

x

0   000 

λ λ

λ

y ⋆

z

t

Functional Reachability – 14

Traversal-simulating ATA’s How can we simulate a complete traversal by an ATA?

λ

• By guessing the number of visits of each node.

@-;

;   --- ;;; - ; 

• By guessing the profile of each variable per visit.

λf x λ

λΦz

• By verifying these guesses. f

Φ-

  --

λy

λ

λ

if 0

t

x

0   000 

λ λ

λ

y ⋆

z

t

Functional Reachability – 14

Variable profiles Introduced in [Ong’06]. • VPΣ (A1 , . . . , An , o) :=

Var A Σ

× Val × P(

Sn

i=1 VPΣ (Ai ))

• Notation: (x, v), (x, v | π1 , . . . , πn )

Functional Reachability – 15

VP(A1 , . . . , An , o) := Var × Val × P( Notation: (x, v), (x, v | π1 , . . . , πn )

Variable profiles

Sn

i=1 VP(Ai ))

λ

λΦz

λy

λ y

@ TIITTTT u III TTT uu u II TTTTT u u TTT u

Φ HH u u HH u u HH u u HH uu

w if KKKK w KK ww w KK ww

λ

λ



z

λf x

λ

f

t

λ

λ

t

x

Functional Reachability – 15

VP(A1 , . . . , An , o) := Var × Val × P( Notation: (x, v), (x, v | π1 , . . . , πn )

Variable profiles

Sn

i=1 VP(Ai ))

λ

λΦz

f

λ y

λy

@ TIITTTT u III TTT uu u II TTTTT u u TTT u Φ

Φ HH u u HH u u HH u u HH uu

w if KKKK w KK ww w KK ww

xλ t

λ

λ



z

λf x

λ

f

t

y

λ x

Functional Reachability – 15

VP(A1 , . . . , An , o) := Var × Val × P( Notation: (x, v), (x, v | π1 , . . . , πn )

Variable profiles

Sn

i=1 VP(Ai ))

λ

λΦz

f

λ y

λy

@ TIITTTT u III TTT uu u II TTTTT u u TTT u Φ

Φ HH u u HH u u HH u u HH uu

w if KKKK w KK ww w KK ww

xλ t

λ

λ



z

λf x

λ

f

t

y

λ x

Functional Reachability – 15

VP(A1 , . . . , An , o) := Var × Val × P( Notation: (x, v), (x, v | π1 , . . . , πn )

Variable profiles

Sn

i=1 VP(Ai ))

⋆λ

⋆ λΦz

f ⋆ λy

tλ ty

@ TIITTTT ⋆ u III TTT uu u II TTTTT u u TTT u Φ

Φ HH ⋆ u u HH u u HH u u HH uu

wt if KKKK w KK ww w KK ww

⋆λ

λ



z

⋆ λf x

λ

⋆f

t

xλ t

y tλ

t

tx

Functional Reachability – 15

VP(A1 , . . . , An , o) := Var × Val × P( Notation: (x, v), (x, v | π1 , . . . , πn )

Variable profiles

Sn

i=1 VP(Ai ))

⋆λ

⋆ λΦz

f ⋆ λy

tλ ty

@ TIITTTT ⋆ u III TTT uu u II TTTTT u u TTT u Φ

Φ HH ⋆ u u HH u u HH u u HH uu

wt if KKKK w KK ww w KK ww

⋆λ

λ



z

⋆ λf x

λ

⋆f

t

xλ t

y tλ

t

tx

Functional Reachability – 15

VP(A1 , . . . , An , o) := Var × Val × P( Notation: (x, v), (x, v | π1 , . . . , πn )

Variable profiles

Sn

i=1 VP(Ai ))

λ

λΦz

f

λ ty

λy

@ TIITTTT u III TTT uu u II TTTTT u u TTT u Φ

Φ HH ⋆ u u HH u u HH u u HH uu

w if KKKK w KK ww w KK ww

xλ t

λ

λ



z

λf x

λ

⋆f

t

y

λ

tx

Functional Reachability – 15

VP(A1 , . . . , An , o) := Var × Val × P( Notation: (x, v), (x, v | π1 , . . . , πn )

Variable profiles

Sn

i=1 VP(Ai ))

λ

λΦz

f

λ (y, t)

y

λy

@ TIITTTT u III TTT uu u II TTTTT u u TTT u Φ

Φ HH ⋆ u u HH u u HH u u HH uu

w if KKKK w KK ww w KK ww

xλ t

λ

λ



z

λf x

λ

⋆f

t

y

(x, t)

λ x

Functional Reachability – 15

VP(A1 , . . . , An , o) := Var × Val × P( Notation: (x, v), (x, v | π1 , . . . , πn )

Variable profiles

Sn

i=1 VP(Ai ))

λ

λΦz

f

λ (y, t)

y

λy

@ TIITTTT u III TTT uu u II TTTTT u u TTT u Φ λf x

f Φ HH ⋆ u u (f, ⋆ | (y, t)) H u HH uu HH u H uu

w if KKKK w KK ww w KK ww

xλ t

λ

λ



z

y

(x, t)

λ t

λ x

Functional Reachability – 15

VP(A1 , . . . , An , o) := Var × Val × P( Notation: (x, v), (x, v | π1 , . . . , πn )

Variable profiles

Sn

i=1 VP(Ai ))

λ

λΦz

@ TIITTTT u III TTT uu u II TTTTT u u TTT u Φ λf x

f Φ HH u u (f, ⋆ | (y, t)) H (Φ, ⋆ | (f, ⋆ | (y, t)), (x,ut)) u HH u HH u H uu f

λ (y, t)

y



λy

w if KKKK w KK ww w KK ww

t

λ

λ



z

y

(x, t)

λ t

λ x

Functional Reachability – 15

ATA correspondence Given a finite fPCF⋆ -alphabet Σ, the states of the traveral-simulating ATA AΣ are:

Q := Val × P(VPΣ ) × P(VPΣ ) P ։ v iff AΣ accepts λ(P ) on initial state with value v . Any tree accepted by AΣ on closed initial state represents a closed fPCF⋆ term over Σ.

Functional Reachability – 16

Results Theorem: M : (A1 , . . . , An , o) ∈ v-Reach [fPCF⋆Σ , fPCFΣ ] iff there is a closed initial state q0 with value v such that: • AΣ (q0 ) accepts λ(M ), • ∀i, the language accepted by AΣ ˜ (q0 ↾ Ai ) is non-empty.

Functional Reachability – 17

Results Theorem: M : (A1 , . . . , An , o) ∈ v-Reach [fPCF⋆Σ , fPCFΣ ] iff there is a closed initial state q0 with value v such that: • AΣ (q0 ) accepts λ(M ), • ∀i, the language accepted by AΣ ˜ (q0 ↾ Ai ) is non-empty. Corollary: ⋆-Reach [fPCF⋆ , fPCF(n)] is decidable. Corollary: ⋆-Reach [fPCF⋆ , fPCF] is decidable up to order 3.

Functional Reachability – 17

Results Theorem: M : (A1 , . . . , An , o) ∈ v-Reach [fPCF⋆Σ , fPCFΣ ] iff there is a closed initial state q0 with value v such that: • AΣ (q0 ) accepts λ(M ), • ∀i, the language accepted by AΣ ˜ (q0 ↾ Ai ) is non-empty. Corollary: ⋆-Reach [fPCF⋆ , fPCF(n)] is decidable. Corollary: ⋆-Reach [fPCF⋆ , fPCF] is decidable up to order 3.

• For the general case (also with ⊥) we use Alternating Dependency Tree Automata [Stirling’09]. • Corollary: Emptiness problem is undecidable for ADTA’s. Functional Reachability – 17

Last slide • A new kind of Reachability problems. • Some undecidability results. • Some technology from game semantics. • Characterisation by ATA’s and ADTA’s. • Some (relativised) decidability results.

Functional Reachability – 18

Last slide • A new kind of Reachability problems. • Some undecidability results. • Some technology from game semantics. • Characterisation by ATA’s and ADTA’s. • Some (relativised) decidability results.

• Conjecture: ⋆-Reach [fPCF⋆ , fPCF] ? • Can this yield a (semantic) CFA? • Extensions: expressivity, algorithms, abstractions.

Functional Reachability – 18

Last slide • A new kind of Reachability problems.

Thank you!

• Some undecidability results. • Some technology from game semantics. • Characterisation by ATA’s and ADTA’s. • Some (relativised) decidability results.

• Conjecture: ⋆-Reach [fPCF⋆ , fPCF] ? • Can this yield a (semantic) CFA? • Extensions: expressivity, algorithms, abstractions.

Functional Reachability – 18

Functional Reachability

Is there a program context C such that computation of C[M] reaches p? ..... Functional Reachability – 15. VP(A1,...,An,o) := Var × Val × P(⋃ n i=1. VP(Ai)).

240KB Sizes 0 Downloads 194 Views

Recommend Documents

No documents