SLIDE 1 Exponential Path Order EPO⋆
Martin Avanzini1 Naohi Eguchi2 Georg Moser1
1Computational Logic
Faculty of Computer Science, University of Innsbruck, Austria
2School of Information Science
Japan Advanced Institute of Science and Technology, Japan
June 1 @ RTA’11
SLIDE 2
polynomial time
SLIDE 3
polynomial time
B
Stephen Bellantoni and Stephen Cook A new Recursion-Theoretic Characterization of the Polytime Functions. CC, pages 97–110, 1992
SLIDE 4
polynomial time
B >pop⋆
Martin Avanzini and Georg Moser Complexity Analysis by Rewriting. FLOPS ’09, pages 130–146, 2008
SLIDE 5
polynomial time exponential time
B >pop⋆ N
SNRN Toshiyasu Arai and Naohi Eguchi A new Function Algebra of EXPTIME Functions by Safe Nested Recursion. TCL, pages 130–146, 2008
SLIDE 6
polynomial time exponential time
B >pop⋆ N
SNRN
>epo⋆
SNRN Martin Avanzini and Naohi Eguchi and Georg Moser A Path Order for Rewrite Systems that Compute Exponential Time Functions. RTA’11, pages 123–138, 2011
SLIDE 7
Main Result
Let FEXP denote class of functions computable in time 2O(nk) (k ∈ N)
SLIDE 8 Main Result
Let FEXP denote class of functions computable in time 2O(nk) (k ∈ N)
1 Soundness
Let R be a constructor TRS that computes a function f . If R ⊆ >epo⋆ then f ∈ FEXP.
SLIDE 9 Main Result
Let FEXP denote class of functions computable in time 2O(nk) (k ∈ N)
1 Soundness
Let R be a constructor TRS that computes a function f . If R ⊆ >epo⋆ then f ∈ FEXP.
2 Completeness
Let f ∈ FEXP. There exists a constructor TRS Rf computing f with Rf ⊆ >epo⋆.
SLIDE 10 Main Result
Let FEXP denote class of functions computable in time 2O(nk) (k ∈ N)
1 Soundness
Let R be a constructor TRS that computes a function f . If R ⊆ >epo⋆ then f ∈ FEXP.
2 Completeness
Let f ∈ FEXP. There exists a constructor TRS Rf computing f with Rf ⊆ >epo⋆.
SLIDE 11 Rewriting as Computational Model
We suppose . . . in this talk
◮ R confluent and terminating ◮ signature F underlying TRS R partitioned into defined symbols D
and constructors C
◮ values Val := T (C, V) are terms over constructors C
SLIDE 12 Rewriting as Computational Model
We suppose . . . in this talk
◮ R confluent and terminating ◮ signature F underlying TRS R partitioned into defined symbols D
and constructors C
◮ values Val := T (C, V) are terms over constructors C
Definition
TRS R computes for each f ∈ D partial function f : Valk → Val⊥ s.t. ∀ s ∈ Valk . f ( s) = t : ⇐ ⇒ f( s) − →!
R t and t ∈ Val
SLIDE 13 Rewriting as Computational Model
We suppose . . . in this talk
◮ R confluent and terminating ◮ signature F underlying TRS R partitioned into defined symbols D
and constructors C
◮ values Val := T (C, V) are terms over constructors C
Definition
TRS R computes for each f ∈ D partial function f : Valk → Val⊥ s.t. ∀ s ∈ Valk . f ( s) = t : ⇐ ⇒ f( s)
i
− →!
R t and t ∈ Val
SLIDE 14 Exponential Path Order >epo⋆
◮ constraints of N imposed on lexicographic path order
>epo⋆ ⊆ >lpo
SLIDE 15 Exponential Path Order >epo⋆
◮ constraints of N imposed on lexicographic path order
>epo⋆ ⊆ >lpo = ⇒ sufficiently strong for Completeness
SLIDE 16 Exponential Path Order >epo⋆
◮ constraints of N imposed on lexicographic path order
>epo⋆ ⊆ >lpo = ⇒ sufficiently strong for Completeness
◮ induces exponential bound on innermost runtime complexity rci R
SLIDE 17 Exponential Path Order >epo⋆
◮ constraints of N imposed on lexicographic path order
>epo⋆ ⊆ >lpo = ⇒ sufficiently strong for Completeness
◮ induces exponential bound on innermost runtime complexity rci R
Theorem
Let R denote a constructor TRS. There exists k ∈ N such that R ⊆ >epo⋆ = ⇒ rci
R ∈ 2O(nk)
rci
R(n) = max{ dh(f (
s), i − →R) | s ∈ Valk and f ( s) of size upto n } dh(t, i − →R) = max{ℓ | ∃(t1, . . . , tℓ). t
i
− →R t1
i
− →R . . .
i
− →R tℓ}
SLIDE 18 Exponential Path Order >epo⋆
◮ constraints of N imposed on lexicographic path order
>epo⋆ ⊆ >lpo = ⇒ sufficiently strong for Completeness
◮ induces exponential bound on innermost runtime complexity rci R
= ⇒ implies Soundness
Theorem
Let R denote a constructor TRS. There exists k ∈ N such that R ⊆ >epo⋆ = ⇒ rci
R ∈ 2O(nk)
rci
R(n) = max{ dh(f (
s), i − →R) | s ∈ Valk and f ( s) of size upto n } dh(t, i − →R) = max{ℓ | ∃(t1, . . . , tℓ). t
i
− →R t1
i
− →R . . .
i
− →R tℓ}
SLIDE 19 Exponential Path Order >epo⋆
◮ constraints of N imposed on lexicographic path order
>epo⋆ ⊆ >lpo = ⇒ sufficiently strong for Completeness
◮ induces exponential bound on innermost runtime complexity rci R
= ⇒ implies Soundness Ugo Dal Lago and Simone Martini On Constructor Rewrite Systems and the Lambda-Calculus. 36th ICALP, pages 163–174, 2009
SLIDE 20 Exponential Path Order >epo⋆
◮ constraints of N imposed on lexicographic path order
>epo⋆ ⊆ >lpo = ⇒ sufficiently strong for Completeness
◮ induces exponential bound on innermost runtime complexity rci R
= ⇒ implies Soundness Ugo Dal Lago and Simone Martini On Constructor Rewrite Systems and the Lambda-Calculus. 36th ICALP, pages 163–174, 2009 Martin Avanzini and Georg Moser Closing the Gap Between Runtime Complexity and Polytime Computability. RTA’10, pages 33–48, 2010
SLIDE 21
The class N
Syntactic, Recursion-theoretic Characterisation of FEXP
SLIDE 22 The class N
is the smallest class . . .
1 containing certain initial function
projections, successors, . . .
2 closed under safe nested recursion on notation 3 closed under weak safe composition
SLIDE 23 Safe Recursion on Notation
◮ syntactical restriction of primitive recursion scheme
f (x1, . . . , xk
; y1, . . . , yl
)
SLIDE 24 Safe Recursion on Notation
◮ syntactical restriction of primitive recursion scheme
f (x1, . . . , xk
; y1, . . . , yl
)
◮ separates recursion parameters from recursively computed results
f (ǫ, x; y) = g( x; y) f (zi, x; y) = hi(z, x; y, f(z, x; y)) (i ∈ {0, 1})
SLIDE 25 Safe Recursion on Notation
◮ syntactical restriction of primitive recursion scheme
f (x1, . . . , xk
; y1, . . . , yl
)
◮ separates recursion parameters from recursively computed results
f (ǫ, x; y) = g( x; y) f (zi, x; y) = hi(z, x; y, f(z, x; y)) (i ∈ {0, 1})
SLIDE 26 Safe Recursion on Notation
◮ syntactical restriction of primitive recursion scheme
f (x1, . . . , xk
; y1, . . . , yl
)
◮ separates recursion parameters from recursively computed results
f (ǫ, x; y) = g( x; y) f (zi, x; y) = hi(z, x; y, f(z, x; y)) (i ∈ {0, 1}) where hi(ǫ, x; y, r) = ri( x; y, r) hi(zi, x; y, r) = si,j(z, x; y, hi(z, x; y, r))
no recursion on recursively computed result
SLIDE 27 Safe Nested Recursion on Notation
extends safe recursion on notation with . . .
1 nesting of recursive function calls
nested recursion f (ǫ; y) = g(; y) f (xi; y) = ri(x; y, f (x; si(x; y, f (x; . . .))))
SLIDE 28 Safe Nested Recursion on Notation
extends safe recursion on notation with . . .
1 nesting of recursive function calls
nested recursion f (ǫ; y) = g(; y) f (xi; y) = ri(x; y, f (x; si(x; y, f (x; . . .))))
2 simultaneous recursion on all normal arguments
multiple recursion f (ǫ, ǫ; z) = g(; z) f (xi, ǫ; z) = ri,ǫ(x, ǫ; z, f (x, ǫ; si,ǫ(x, ǫ; f (x, ǫ; z)))) f (ǫ, yj; z) = rǫ,j(ǫ, y; z, f (ǫ, y; sǫ,j(ǫ, y; f (ǫ, y; z)))) f (xi, yj; z) = ri,j(x, y; z, f (xi, y; si,j(x, y; f (x, yj; z))))
- case analysis on least significant “bits” of recursion parameters
SLIDE 29 Safe Nested Recursion on Notation
extends safe recursion on notation with . . .
1 nesting of recursive function calls
nested recursion f (ǫ; y) = g(; y) f (xi; y) = ri(x; y, f (x; si(x; y, f (x; . . .))))
2 simultaneous recursion on all normal arguments
multiple recursion f (ǫ, ǫ; z) = g(; z) f (xi, ǫ; z) = ri,ǫ(x, ǫ; z, f (x, ǫ; si,ǫ(x, ǫ; f (x, ǫ; z)))) f (ǫ, yj; z) = rǫ,j(ǫ, y; z, f (ǫ, y; sǫ,j(ǫ, y; f (ǫ, y; z)))) f (xi, yj; z) = ri,j(x, y; z, f (xi, y; si,j(x, y; f (x, yj; z))))
- case analysis on least significant “bits” of recursion parameters
- lexicographic decreasing recursion parameters
SLIDE 30 Safe Composition
Requirements
1 composition maintains separation of safe and normal arguments
SLIDE 31 Safe Composition
Requirements
1 composition maintains separation of safe and normal arguments
Safe Composition
employed in B f ( x; y) = g( r( x; ); s( x; y))
SLIDE 32 Safe Composition
Requirements
1 composition maintains separation of safe and normal arguments 2 reflects that FEXP is not closed under composition
Safe Composition
employed in B f ( x; y) = g( r( x; ); s( x; y))
Weak Safe Composition
employed in N f ( x; y) = g(xi1, . . . , xik; s( x; y)) {xi1, . . . , xik} ⊆ { x}
SLIDE 33 The class N
is the smallest class . . .
1 containing certain initial function
projections, successors, . . .
2 closed under safe nested recursion on notation 3 closed under weak safe composition
SLIDE 34 The class N
is the smallest class . . .
1 containing certain initial function
projections, successors, . . .
2 closed under safe nested recursion on notation 3 closed under weak safe composition
Theorem
N = FEXP
Toshiyasu Arai and Naohi Eguchi A new Function Algebra of EXPTIME Functions by Safe Nested Recursion. TCL, pages 130–146, 2008
SLIDE 35
Exponential Path Order >epo⋆
A Path Order based on N
SLIDE 36 Exponential Path Order >epo⋆
◮ induced by precedence > and safe mapping safe : F → 2N
SLIDE 37 Exponential Path Order >epo⋆
◮ induced by precedence > and safe mapping safe : F → 2N
> tct -s "epo*" fib.trs YES(?,EXPO) We consider the following Problem: Strict Trs: { fib(s(s(x)), y) -> fib(s(x), fib(x, y)) , fib(s(0()), y)
, fib(0(), y)
StartTerms: basic terms Strategy: innermost The system is compatible with ’epo*’ induced by Precedence: fib > s,0 Safe Mapping: safe(fib) = {2}, safe(s) = {1}
SLIDE 38 Exponential Path Order >epo⋆
◮ induced by precedence > and safe mapping safe : F → 2N
Definition
precedence > and safe mapping safe are admissible if
1 constructors are minimal
f > g ⇒ f ∈ C
2 all argument positions of constructors are safe
f ∈ C ⇒ safe(f ) = {1, . . . , ar(f )}
SLIDE 39 Exponential Path Order >epo⋆
◮ induced by precedence > and safe mapping safe : F → 2N
Definition
precedence > and safe mapping safe are admissible if
1 constructors are minimal
f > g ⇒ f ∈ C
2 all argument positions of constructors are safe
f ∈ C ⇒ safe(f ) = {1, . . . , ar(f )}
Notation
we suppose safe(f ) = {l + 1, . . . , l + m}, we write f (s1, . . . , sl; sl+1, . . . , sl+m)
SLIDE 40
Exponential Path Order >epo⋆
Preliminary Definition Let s = f (s1, . . . , sl; sl+1, . . . , sl+m), let > and safe be admissible.
SLIDE 41 Exponential Path Order >epo⋆
Preliminary Definition Let s = f (s1, . . . , sl; sl+1, . . . , sl+m), let > and safe be admissible.
ST
si epo⋆ t s >epo⋆ t
WSC
“ti are normal arguments of s” s >epo⋆ tk+1 · · · s >epo⋆ tk+n s >epo⋆ g(t1, . . . , tk; tk+1, . . . , tk+n) f > g
SNRN
s1, . . . , sl >lex′ t1, . . . , tl s >epo⋆ tl+1 · · · s >epo⋆ tm s >epo⋆ f (t1, . . . , tl; tl+1, . . . , tl+m)
SLIDE 42 Exponential Path Order >epo⋆
Preliminary Definition Let s = f (s1, . . . , sl; sl+1, . . . , sl+m), let > and safe be admissible.
ST
si epo⋆ t s >epo⋆ t
WSC
“ti are normal arguments of s” s >epo⋆ tk+1 · · · s >epo⋆ tk+n s >epo⋆ g(t1, . . . , tk; tk+1, . . . , tk+n) f > g
SNRN
s1, . . . , sl >lex′ t1, . . . , tl s >epo⋆ tl+1 · · · s >epo⋆ tm s >epo⋆ f (t1, . . . , tl; tl+1, . . . , tl+m)
Recall Weak Safe Composition . . .
f ( x; y) = g(xi1, . . . , xik; s( x; y)) {xi1, . . . , xik} ⊆ { x}
SLIDE 43 Exponential Path Order >epo⋆
Preliminary Definition Let s = f (s1, . . . , sl; sl+1, . . . , sl+m), let > and safe be admissible.
ST
si epo⋆ t s >epo⋆ t
WSC
“ti are normal arguments of s” s >epo⋆ tk+1 · · · s >epo⋆ tk+n s >epo⋆ g(t1, . . . , tk; tk+1, . . . , tk+n) f > g
SNRN
s1, . . . , sl >lex′ t1, . . . , tl s >epo⋆ tl+1 · · · s >epo⋆ tm s >epo⋆ f (t1, . . . , tl; tl+1, . . . , tl+m)
Recall Safe Nested Recursion on Notation . . .
f (xi, yj; . . . ) = r(. . . ; . . . , f (xi, y; s(. . . ; . . . , f (x, yj; . . . ))))
SLIDE 44 Exponential Path Order >epo⋆
Preliminary Definition Let s = f (s1, . . . , sl; sl+1, . . . , sl+m), let > and safe be admissible.
ST
si epo⋆ t s >epo⋆ t
WSC
“ti are normal arguments of s” s >epo⋆ tk+1 · · · s >epo⋆ tk+n s >epo⋆ g(t1, . . . , tk; tk+1, . . . , tk+n) f > g
SNRN
s1, . . . , sl >lex′ t1, . . . , tl s >epo⋆ tl+1 · · · s >epo⋆ tm s >epo⋆ f (t1, . . . , tl; tl+1, . . . , tl+m)
SLIDE 45 Auxiliary Order epo⋆
Order for Val
STn
si ⊒epo⋆ t f (s1, . . . , sl; sl+1, . . . , sl+m) epo⋆ t if f ∈ D then i ∈ {1, . . . , l}
Note
1 epo⋆ = on Val
SLIDE 46 Auxiliary Order epo⋆
Order for Val
STn
si ⊒epo⋆ t f (s1, . . . , sl; sl+1, . . . , sl+m) epo⋆ t if f ∈ D then i ∈ {1, . . . , l}
Note
1 epo⋆ = on Val 2 epo⋆ ⊆
- if f ∈ D, safe(f ) = {2} then f (x; z) epo⋆ x but f (x; z) epo⋆ z
SLIDE 47 Exponential Path Order >epo⋆
Preliminary Definition Let s = f (s1, . . . , sl; sl+1, . . . , sl+m), let > and safe be admissible.
ST
si epo⋆ t s >epo⋆ t
WSC
“ti are normal arguments of s” s >epo⋆ tk+1 · · · s >epo⋆ tk+n s >epo⋆ g(t1, . . . , tk; tk+1, . . . , tk+n) f > g
SNRN
s1, . . . , sl >lex′ t1, . . . , tl s >epo⋆ tl+1 · · · s >epo⋆ tm s >epo⋆ f (t1, . . . , tl; tl+1, . . . , tl+m)
SLIDE 48 Exponential Path Order >epo⋆
Preliminary Definition Let s = f (s1, . . . , sl; sl+1, . . . , sl+m), let > and safe be admissible.
ST
si epo⋆ t s >epo⋆ t
WSC
s epo⋆ t1 · · · s epo⋆ tk s >epo⋆ tk+1 · · · s >epo⋆ tk+n s >epo⋆ g(t1, . . . , tk; tk+1, . . . , tk+n) f > g
SNRN
s1, . . . , sl >lex′ t1, . . . , tl s >epo⋆ tl+1 · · · s >epo⋆ tm s >epo⋆ f (t1, . . . , tl; tl+1, . . . , tl+m)
SLIDE 49 Exponential Path Order >epo⋆
Preliminary Definition Let s = f (s1, . . . , sl; sl+1, . . . , sl+m), let > and safe be admissible.
ST
si epo⋆ t s >epo⋆ t
WSC
s epo⋆ t1 · · · s epo⋆ tk s >epo⋆ tk+1 · · · s >epo⋆ tk+n s >epo⋆ g(t1, . . . , tk; tk+1, . . . , tk+n) f > g
SNRN
s1, . . . , sl >lex′ t1, . . . , tl s >epo⋆ tl+1 · · · s >epo⋆ tm s >epo⋆ f (t1, . . . , tl; tl+1, . . . , tl+m)
SLIDE 50 Exponential Path Order >epo⋆
Preliminary Definition Let s = f (s1, . . . , sl; sl+1, . . . , sl+m), let > and safe be admissible.
ST
si epo⋆ t s >epo⋆ t
WSC
s epo⋆ t1 · · · s epo⋆ tk s >epo⋆ tk+1 · · · s >epo⋆ tk+n s >epo⋆ g(t1, . . . , tk; tk+1, . . . , tk+n) f > g
SNRN
(†) s >epo⋆ tl+1 · · · s >epo⋆ tm s >epo⋆ f (t1, . . . , tl; tl+1, . . . , tl+m) (†)
1 s1 = t1 · · · si−1 = ti−1, 2 si epo⋆ ti, and 3 s epo⋆ ti+1 · · · s epo⋆ tl.
SLIDE 51 Exponential Path Order >epo⋆
Let s = f (s1, . . . , sl; sl+1, . . . , sl+m), let > and safe be admissible.
ST
si epo⋆ t s >epo⋆ t
WSC
s epo⋆ t1 · · · s epo⋆ tk s >epo⋆ tk+1 · · · s >epo⋆ tk+n s >epo⋆ g(t1, . . . , tk; tk+1, . . . , tk+n) f > g
SNRN
(†) s >epo⋆ tl+1 · · · s >epo⋆ tm s >epo⋆ f (t1, . . . , tl; tl+1, . . . , tl+m) (†)
1 s1 = t1 · · · si−1 = ti−1, 2 si epo⋆ ti, and 3 s epo⋆ ti+1 · · · s epo⋆ tl.
SLIDE 52 The Good . . .
the exponential path order EPO⋆ is . . .
◮ a restriction of LPO that induces exponentially bounded rci R ◮ sound and complete for FEXP, implemented in our tool T
C T http://cl-informatik.uibk.ac.at/software/tct
SLIDE 53 The Good . . .
the exponential path order EPO⋆ is . . .
◮ a restriction of LPO that induces exponentially bounded rci R ◮ sound and complete for FEXP, implemented in our tool T
C T http://cl-informatik.uibk.ac.at/software/tct
The Bad . . .
◮ rules out some natural definitions:
d(0) → 0 e(0) → s(0) d(s(x)) → s(s(d(x))) e(s(x)) → d(e(x))
SLIDE 54 The Good . . .
the exponential path order EPO⋆ is . . .
◮ a restriction of LPO that induces exponentially bounded rci R ◮ sound and complete for FEXP, implemented in our tool T
C T http://cl-informatik.uibk.ac.at/software/tct
The Bad . . .
◮ rules out some natural definitions:
d(0) → 0 e(0) → s(0) d(s(x)) → s(s(d(x))) e(s(x)) → d(e(x))
The Ugly . . .
◮ >pop⋆ ⊆ >epo⋆