polynomial time B polynomial time Stephen Bellantoni and Stephen - - PowerPoint PPT Presentation

polynomial time b
SMART_READER_LITE
LIVE PREVIEW

polynomial time B polynomial time Stephen Bellantoni and Stephen - - PowerPoint PPT Presentation

Exponential Path Order EPO Martin Avanzini 1 Naohi Eguchi 2 Georg Moser 1 1 Computational Logic Faculty of Computer Science, University of Innsbruck, Austria 2 School of Information Science Japan Advanced Institute of Science and Technology,


slide-1
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
SLIDE 2

polynomial time

slide-3
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
SLIDE 4

polynomial time

B >pop⋆

Martin Avanzini and Georg Moser Complexity Analysis by Rewriting. FLOPS ’09, pages 130–146, 2008

slide-5
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
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
SLIDE 7

Main Result

Let FEXP denote class of functions computable in time 2O(nk) (k ∈ N)

slide-8
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
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
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
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
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
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
SLIDE 14

Exponential Path Order >epo⋆

◮ constraints of N imposed on lexicographic path order

>epo⋆ ⊆ >lpo

slide-15
SLIDE 15

Exponential Path Order >epo⋆

◮ constraints of N imposed on lexicographic path order

>epo⋆ ⊆ >lpo = ⇒ sufficiently strong for Completeness

slide-16
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
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
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
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
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
SLIDE 21

The class N

Syntactic, Recursion-theoretic Characterisation of FEXP

slide-22
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
SLIDE 23

Safe Recursion on Notation

◮ syntactical restriction of primitive recursion scheme

f (x1, . . . , xk

  • normal

; y1, . . . , yl

  • safe

)

slide-24
SLIDE 24

Safe Recursion on Notation

◮ syntactical restriction of primitive recursion scheme

f (x1, . . . , xk

  • normal

; y1, . . . , yl

  • safe

)

◮ 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
SLIDE 25

Safe Recursion on Notation

◮ syntactical restriction of primitive recursion scheme

f (x1, . . . , xk

  • normal

; y1, . . . , yl

  • safe

)

◮ 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
SLIDE 26

Safe Recursion on Notation

◮ syntactical restriction of primitive recursion scheme

f (x1, . . . , xk

  • normal

; y1, . . . , yl

  • safe

)

◮ 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
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
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
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
SLIDE 30

Safe Composition

Requirements

1 composition maintains separation of safe and normal arguments

slide-31
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
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
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
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
SLIDE 35

Exponential Path Order >epo⋆

A Path Order based on N

slide-36
SLIDE 36

Exponential Path Order >epo⋆

◮ induced by precedence > and safe mapping safe : F → 2N

slide-37
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)

  • > s(y)

, fib(0(), y)

  • > s(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
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
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
SLIDE 40

Exponential Path Order >epo⋆

Preliminary Definition Let s = f (s1, . . . , sl; sl+1, . . . , sl+m), let > and safe be admissible.

slide-41
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
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
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
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
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
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
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
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
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
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
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
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
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
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⋆