Luke Ong Nikos Tzevelekos Oxford University Computing ...
Transcript of Luke Ong Nikos Tzevelekos Oxford University Computing ...
Ong & Tzevelekos Functional Reachability – 1
Functional Reachability
Luke Ong Nikos Tzevelekos
Oxford University Computing Laboratory
24th Symposium on Logic in Computer Science
Los Angeles, August 2009.
The Problem
The Problem
Relevant workThe examined
language: PCF
Reachability
PCF-with-error:
PCF⋆
Reach template
An undecidability
result
Our approach
Computation trees
TraversalsAlternating Tree
AutomataTraversal-simulating
ATA’s
Variable profiles
ATA correspondence
ResultsAlternating
Dependency Tree
Automata
Conclusion and on
Ong & Tzevelekos Functional Reachability – 2
Reachability in functional computation.
■ Consider a term M of a higher-order functionalprogramming language.
■ Now consider a point p inside M .
� Is there a program context C such that thecomputation of C[M ] reaches p?
The Problem
The Problem
Relevant workThe examined
language: PCF
Reachability
PCF-with-error:
PCF⋆
Reach template
An undecidability
result
Our approach
Computation trees
TraversalsAlternating Tree
AutomataTraversal-simulating
ATA’s
Variable profiles
ATA correspondence
ResultsAlternating
Dependency Tree
Automata
Conclusion and on
Ong & Tzevelekos Functional Reachability – 2
Reachability in functional computation.
■ Consider a term M of a higher-order functionalprogramming language.
■ Now consider a point p inside M .
� Is there a program context C such that thecomputation of C[M ] reaches p?
The Problem
The Problem
Relevant workThe examined
language: PCF
Reachability
PCF-with-error:
PCF⋆
Reach template
An undecidability
result
Our approach
Computation trees
TraversalsAlternating Tree
AutomataTraversal-simulating
ATA’s
Variable profiles
ATA correspondence
ResultsAlternating
Dependency Tree
Automata
Conclusion and on
Ong & Tzevelekos Functional Reachability – 2
Reachability in functional computation.
■ Consider a term M of a higher-order functionalprogramming language.
■ Now consider a point p inside M .
� Is there a program context C such that thecomputation of C[M ] reaches p?
Surprisingly, (Contextual) Reachability per se hadnot been studied in HO functional languages.
Relevant work
The Problem
Relevant workThe examined
language: PCF
Reachability
PCF-with-error:
PCF⋆
Reach template
An undecidability
result
Our approach
Computation trees
TraversalsAlternating Tree
AutomataTraversal-simulating
ATA’s
Variable profiles
ATA correspondence
ResultsAlternating
Dependency Tree
Automata
Conclusion and on
Ong & Tzevelekos Functional Reachability – 3
■ Control Flow Analysis: Approximate at compiletime the flow of control to happen at run time.
◆ In a HO-setting, the crucial element is that ofclosures.
◆ Reynolds (’70), Jones (’80), Shivers (’90), . . .Malacaria & Hankin (late 90’s).
◆ CFA > Reach: more general.Reach > CFA: open vs closed world approach.
■ Useless code detection, etc.
The examined language: PCF
Ong & Tzevelekos Functional Reachability – 4
Types: A,B ::= o | A → B
Terms: M,N ::= x | λx.M | MN | t | f | if M N1 N2 | YA
Contexts: C ::= . . .
The examined language: PCF
Ong & Tzevelekos Functional Reachability – 4
Types: A,B ::= o | A → B
Terms: M,N ::= x | λx.M | MN | t | f | if M N1 N2 | YA
Contexts: C ::= . . .
Reductions: (λx.M)N → M{N/x} if t → λxy.x
YM → M(YM) if f → λxy.y
M → N =⇒ E[M ] → E[N ]
Ev. Contexts: E ::= [−] | E M | if E
The examined language: PCF
Ong & Tzevelekos Functional Reachability – 4
Types: A,B ::= o | A → B
Terms: M,N ::= x | λx.M | MN | t | f | if M N1 N2 | YA
Contexts: C ::= . . .
Reductions: Call-by-name λ-calculus + if + Y
■ Write (A1, . . . , An, o) for A1 → · · · → An → o.
■ Divergence definable, e.g. ⊥ := Yo(λx.x).
■ Finitary restrictions (i.e. no Y): fPCF, fPCF⊥.
Reachability
The Problem
Relevant workThe examined
language: PCF
Reachability
PCF-with-error:
PCF⋆
Reach template
An undecidability
result
Our approach
Computation trees
TraversalsAlternating Tree
AutomataTraversal-simulating
ATA’s
Variable profiles
ATA correspondence
ResultsAlternating
Dependency Tree
Automata
Conclusion and on
Ong & Tzevelekos Functional Reachability – 5
■ Given a PCF-term M and a coloured subterm Lof M ,
� Is there a program context C such thatC[M ] ։ E[L′] with L′ coloured?
Reachability
The Problem
Relevant workThe examined
language: PCF
Reachability
PCF-with-error:
PCF⋆
Reach template
An undecidability
result
Our approach
Computation trees
TraversalsAlternating Tree
AutomataTraversal-simulating
ATA’s
Variable profiles
ATA correspondence
ResultsAlternating
Dependency Tree
Automata
Conclusion and on
Ong & Tzevelekos Functional Reachability – 5
■ Given a PCF-term M and a coloured subterm Lof M ,
� Is there a program context C such thatC[M ] ։ E[L′] with L′ coloured?
Equivalently:
■ Given a closed PCF-term M : (A1, ..., An, o) anda coloured subterm L of M ,
� Are there closed PCF-terms N1, . . . , Nn such that
M ~N ։ E[L′]
with L′ coloured?
PCF-with-error: PCF⋆
The Problem
Relevant workThe examined
language: PCF
Reachability
PCF-with-error:
PCF⋆
Reach template
An undecidability
result
Our approach
Computation trees
TraversalsAlternating Tree
AutomataTraversal-simulating
ATA’s
Variable profiles
ATA correspondence
ResultsAlternating
Dependency Tree
Automata
Conclusion and on
Ong & Tzevelekos Functional Reachability – 6
Take base type o = {t, f, ⋆} with ⋆ an error constant:
E[⋆] ։ ⋆
⋆-Reachability:
■ Given a closed PCF⋆-term M : (A1, ..., An, o) thathas exactly one occurrence of ⋆,
� are there closed PCF-terms N1, ..., Nn such thatM ~N ։ ⋆?
PCF-with-error: PCF⋆
The Problem
Relevant workThe examined
language: PCF
Reachability
PCF-with-error:
PCF⋆
Reach template
An undecidability
result
Our approach
Computation trees
TraversalsAlternating Tree
AutomataTraversal-simulating
ATA’s
Variable profiles
ATA correspondence
ResultsAlternating
Dependency Tree
Automata
Conclusion and on
Ong & Tzevelekos Functional Reachability – 6
Take base type o = {t, f, ⋆} with ⋆ an error constant:
E[⋆] ։ ⋆
⋆-Reachability:
■ Given a closed PCF⋆-term M : (A1, ..., An, o) thathas exactly one occurrence of ⋆,
� are there closed PCF-terms N1, ..., Nn such thatM ~N ։ ⋆?
Lemma: Reachability ∼= ⋆-Reachability.
Reach template
Ong & Tzevelekos Functional Reachability – 7
For v ∈ {t, f, ⋆} and L1,L2 ⊆ PCF⋆:
v-Reach [L1,L2]:Given a closed L1-term M : (A1, ..., An, o), are there closed
L2-terms N1, ..., Nn such that M ~N ։ v?
e.g. ⋆-Reachability = ⋆-Reach [PCF1⋆,PCF].
Reach template
Ong & Tzevelekos Functional Reachability – 7
For v ∈ {t, f, ⋆} and L1,L2 ⊆ PCF⋆:
v-Reach [L1,L2]:Given a closed L1-term M : (A1, ..., An, o), are there closed
L2-terms N1, ..., Nn such that M ~N ։ v?
Three classes of problems:
Reachability
⋆-Reachability
⋆-Reach [PCF1⋆,PCF]
⋆-Reach [PCF1⋆, fPCF]
⋆-Reach [fPCF1⋆, fPCF]⋆-Reach [fPCF⋆, fPCF]. . .
⋆-Reach [fPCF1⋆⊥, fPCF]
⋆-Reach [fPCF⋆⊥, fPCF]
. . .
An undecidability result
Ong & Tzevelekos Functional Reachability – 8
Lemma: ⋆-Reach [fPCF1⋆⊥, fPCF] is undecidable.
Proof: By reduction of solvability of systems of fPCF⊥-equations(proved undecidable by [Loader’01]).
Reachability
⋆-Reachability
⋆-Reach [PCF1⋆,PCF]
⋆-Reach [PCF1⋆, fPCF]
⋆-Reach [fPCF1⋆, fPCF]⋆-Reach [fPCF⋆, fPCF]. . .
⋆-Reach [fPCF1⋆⊥, fPCF]
⋆-Reach [fPCF⋆⊥, fPCF]
. . .
Our approach
Ong & Tzevelekos Functional Reachability – 9
■ We focus on v-Reach [fPCF⋆, fPCF].
■ For fPCF⋆-term P : o,
Computations of P oo //Traversals over its compu-tation tree, λ(P )
88
xxqqqqqqqqqq
Runs of an Alternating TreeAutomaton (ATA) on λ(P )
Our approach
Ong & Tzevelekos Functional Reachability – 9
■ We focus on v-Reach [fPCF⋆, fPCF].
■ For fPCF⋆-term P : o,
Computations of P oo //Traversals over its compu-tation tree, λ(P )
88
xxqqqqqqqqqq
Runs of an Alternating TreeAutomaton (ATA) on λ(P )
� P ։ v iff an ATA accepts λ(P ) on initial state with value v.
Computation trees
Ong & Tzevelekos Functional Reachability – 10
Starting from a fPCF⋆-term M ,
■ take its η-long form,
■ add application symbols (@),
■ view the result as a tree, λ(M).
Computation trees
Ong & Tzevelekos Functional Reachability – 10
Starting from a fPCF⋆-term M ,
■ take its η-long form,
■ add application symbols (@),
■ view the result as a tree, λ(M).
( λΦz.Φ(λy. ify ⋆ z)t ) (λϕx. ϕx) t 7−→
λ
@���� ??
?
OOOOOOOO
λΦz λϕx λ
Φ}}}
}??
??ϕ t
λy λ λ
if��� CC
CCt x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a computation tree,
■ follows the flow of control within it,
■ seen from the perspective of Game Semantics.
λ
@
tttt
ttt
JJJJJJ
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
ssssss
ss
JJJJJJJJ ϕ t
λy λ λ
if
vvvvvvv
LLLLLLLL t x
λ λ λ
y ⋆ z⋆-complete traversal
Traversals
Ong & Tzevelekos Functional Reachability – 11
A traversal [Blum, Ong] over a 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 beenanswered (green visit), and the root question has been an-swered with v.
Theorem: For any P : o and value v, P ։ v iff there is acomplete v-traversal over λ(P ).
Alternating Tree Automata
Ong & Tzevelekos Functional Reachability – 12
An ATA is a quadruple A = 〈Q,Σ, q0,∆〉 where:
■ Q is a finite set of states,
■ Σ is a finite ranked alphabet,
■ q0 ∈ Q is the initial state,
■ ∆ is a finite transition relation: qs→ (Q1, . . . , Qk).
s ∈ Σq ∈ Q
Q1, ... , Qk ⊆ Q
Alternating Tree Automata
Ong & Tzevelekos Functional Reachability – 12
An ATA is a quadruple A = 〈Q,Σ, q0,∆〉 where:
■ Q is a finite set of states,
■ Σ is a finite ranked alphabet,
■ q0 ∈ Q is the initial state,
■ ∆ is a finite transition relation: qs→ (Q1, . . . , Qk).
s ∈ Σq ∈ Q
Q1, ... , Qk ⊆ Q
s
llllllllllllllll
yyyy
yyyy
OOOOOOOOOOOOOO
s1 s2 . . . sk
. . . . . . . . . . . .
Alternating Tree Automata
Ong & Tzevelekos Functional Reachability – 12
An ATA is a quadruple A = 〈Q,Σ, q0,∆〉 where:
■ Q is a finite set of states,
■ Σ is a finite ranked alphabet,
■ q0 ∈ Q is the initial state,
■ ∆ is a finite transition relation: qs→ (Q1, . . . , Qk).
s ∈ Σq ∈ Q
Q1, ... , Qk ⊆ Q
s
llllllllllllllll
yyyy
yyyy
OOOOOOOOOOOOOO
s1 s2 . . . sk
. . . . . . . . . . . .
A(q)
Alternating Tree Automata
Ong & Tzevelekos Functional Reachability – 12
An ATA is a quadruple A = 〈Q,Σ, q0,∆〉 where:
■ Q is a finite set of states,
■ Σ is a finite ranked alphabet,
■ q0 ∈ Q is the initial state,
■ ∆ is a finite transition relation: qs→ (Q1, . . . , Qk).
s ∈ Σq ∈ Q
Q1, ... , Qk ⊆ Q
s
llllllllllllllll
yyyy
yyyy
OOOOOOOOOOOOOO
s1 s2 . . . sk
. . . . . . . . . . . .
A(Q1) A(Q2) A(Qk)
Traversal-simulating ATA’s
Ong & Tzevelekos Functional Reachability – 13
λ
@
�����
....
.
;;;;
;;
λΦz λϕx λ
Φ
�����
....
. ϕ t
λy λ λ
if
���� 00
000 t x
λ λ λ
y ⋆ z
How can we simulate a complete traversal by an ATA?
Traversal-simulating ATA’s
Ong & Tzevelekos Functional Reachability – 13
λ
@
�����
....
.
;;;;
;;
λΦz λϕx λ
Φ
�����
....
. ϕ t
λy λ λ
if
���� 00
000 t x
λ λ λ
y ⋆ z
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.
■ By verifying these guesses.
Variable profiles
Ong & Tzevelekos Functional Reachability – 14
■ Introduced by [Ong’06].
■ VP(A1, . . . , An, o) := Var × Val ×P(⋃n
i=1VP(Ai))
■ Notation: (x, v), (x, v | π1, . . . , πn)
Variable profiles
Ong & Tzevelekos Functional Reachability – 14
λ
@
uuuuuuuII
IIII
I
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
tttttt
tt
IIIIIIII ϕ t
λy λ λ
if
wwwwwww
KKKKKKKK t x
λ λ λ
y ⋆ z
Variable profiles
Ong & Tzevelekos Functional Reachability – 14
λ
@
uuuuuuuII
IIII
I
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
tttttt
tt
IIIIIIII ϕ t
λy λ λ
if
wwwwwww
KKKKKKKK t x
λ λ λ
y ⋆ z
Φ
ϕ x y
Variable profiles
Ong & Tzevelekos Functional Reachability – 14
λ
@
uuuuuuuII
IIII
I
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
tttttt
tt
IIIIIIII ϕ t
λy λ λ
if
wwwwwww
KKKKKKKK t x
λ λ λ
y ⋆ z
Φ
ϕ x yt
t
t
t
t
t ⋆
⋆
⋆
⋆
⋆
⋆
⋆
⋆
Variable profiles
Ong & Tzevelekos Functional Reachability – 14
λ
@
uuuuuuuII
IIII
I
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
tttttt
tt
IIIIIIII ϕ t
λy λ λ
if
wwwwwww
KKKKKKKK t x
λ λ λ
y ⋆ z
Φ
ϕ x y
t
t
⋆⋆
Variable profiles
Ong & Tzevelekos Functional Reachability – 14
λ
@
uuuuuuuII
IIII
I
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
tttttt
tt
IIIIIIII ϕ t
λy λ λ
if
wwwwwww
KKKKKKKK t x
λ λ λ
y ⋆ z
Φ
ϕ x y
⋆⋆
(x, t)
(y, t)
Variable profiles
Ong & Tzevelekos Functional Reachability – 14
λ
@
uuuuuuuII
IIII
I
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
tttttt
tt
IIIIIIII ϕ t
λy λ λ
if
wwwwwww
KKKKKKKK t x
λ λ λ
y ⋆ z
Φ
ϕ x y
⋆
(x, t)
(y, t)
(ϕ, ⋆ | (y, t))
Variable profiles
Ong & Tzevelekos Functional Reachability – 14
λ
@
uuuuuuuII
IIII
I
TTTTTTTTTTTTTTTT
λΦz λϕx λ
Φ
tttttt
tt
IIIIIIII ϕ t
λy λ λ
if
wwwwwww
KKKKKKKK t x
λ λ λ
y ⋆ z
Φ
ϕ x y
(x, t)
(y, t)
(ϕ, ⋆ | (y, t))(Φ, ⋆ | (ϕ, ⋆ | (y, t)), (x, t))
ATA correspondence
Ong & Tzevelekos Functional Reachability – 15
Given a finite fPCF⋆-alphabet Σ, the states of thetraveral-simulating ATA AΣ are:
Q := Val ×P(VPΣ) ×P(VPΣ)
ATA correspondence
Ong & Tzevelekos Functional Reachability – 15
Given a finite fPCF⋆-alphabet Σ, the states of thetraveral-simulating ATA AΣ are:
Q := Val ×P(VPΣ) ×P(VPΣ)
■ M ~N ։ v iff AΣ accepts λ(M ~N) on initial state with value v.
■ Any tree accepted by AΣ is a closed fPCF-term.
Results
The Problem
Relevant workThe examined
language: PCF
Reachability
PCF-with-error:
PCF⋆
Reach template
An undecidability
result
Our approach
Computation trees
TraversalsAlternating Tree
AutomataTraversal-simulating
ATA’s
Variable profiles
ATA correspondence
ResultsAlternating
Dependency Tree
Automata
Conclusion and on
Ong & Tzevelekos Functional Reachability – 16
Theorem: M ∈ v-Reach [fPCF⋆Σ, fPCFΣ] iff there is
an initial state q0 with value v such that:
■ AΣ(qo) accepts λ(M),
■ ∀i, the language accepted by AΣ(q0 ↾ Ai) isnon-empty.
Results
The Problem
Relevant workThe examined
language: PCF
Reachability
PCF-with-error:
PCF⋆
Reach template
An undecidability
result
Our approach
Computation trees
TraversalsAlternating Tree
AutomataTraversal-simulating
ATA’s
Variable profiles
ATA correspondence
ResultsAlternating
Dependency Tree
Automata
Conclusion and on
Ong & Tzevelekos Functional Reachability – 16
Theorem: M ∈ v-Reach [fPCF⋆Σ, fPCFΣ] iff there is
an initial state q0 with value v such that:
■ AΣ(qo) accepts λ(M),
■ ∀i, the language accepted by AΣ(q0 ↾ Ai) isnon-empty.
Corollary: ⋆-Reach [fPCF⋆, fPCF(n)] is decidable.
Corollary: ⋆-Reach [fPCF⋆, fPCF] is decidable up toorder 3.
Alternating Dependency Tree Automata
The Problem
Relevant workThe examined
language: PCF
Reachability
PCF-with-error:
PCF⋆
Reach template
An undecidability
result
Our approach
Computation trees
TraversalsAlternating Tree
AutomataTraversal-simulating
ATA’s
Variable profiles
ATA correspondence
ResultsAlternating
Dependency Tree
Automata
Conclusion and on
Ong & Tzevelekos Functional Reachability – 17
■ For the general case we can use AlternatingDependency Tree Automata [Stirling’09].
■ Corollary: Emptiness problem is undecidable forADTA’s.
Conclusion and on
The Problem
Relevant workThe examined
language: PCF
Reachability
PCF-with-error:
PCF⋆
Reach template
An undecidability
result
Our approach
Computation trees
TraversalsAlternating Tree
AutomataTraversal-simulating
ATA’s
Variable profiles
ATA correspondence
ResultsAlternating
Dependency Tree
Automata
Conclusion and on
Ong & Tzevelekos Functional Reachability – 18
■ 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.
Conclusion and on
The Problem
Relevant workThe examined
language: PCF
Reachability
PCF-with-error:
PCF⋆
Reach template
An undecidability
result
Our approach
Computation trees
TraversalsAlternating Tree
AutomataTraversal-simulating
ATA’s
Variable profiles
ATA correspondence
ResultsAlternating
Dependency Tree
Automata
Conclusion and on
Ong & Tzevelekos Functional Reachability – 18
■ 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.
� Revisit (semantic) CFA?
� Reachability through intersection types?
� Conjecture: ⋆-Reach [fPCF⋆, fPCF] ?
Conclusion and on
The Problem
Relevant workThe examined
language: PCF
Reachability
PCF-with-error:
PCF⋆
Reach template
An undecidability
result
Our approach
Computation trees
TraversalsAlternating Tree
AutomataTraversal-simulating
ATA’s
Variable profiles
ATA correspondence
ResultsAlternating
Dependency Tree
Automata
Conclusion and on
Ong & Tzevelekos Functional Reachability – 18
■ 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.
� Revisit (semantic) CFA?
� Reachability through intersection types?
� Conjecture: ⋆-Reach [fPCF⋆, fPCF] ?
THANKS!