O
L C
mputational
gic
Closing the Gap Between Runtime Complexity and Polytime Computability
Martin Avanzini and Georg Moser
Computational Logic Faculty of Computer Science, University of Innsbruck
RTA ’10
O mputational gic L Closing the Gap Between Runtime Complexity - - PowerPoint PPT Presentation
C O mputational gic L Closing the Gap Between Runtime Complexity and Polytime Computability Martin Avanzini and Georg Moser Computational Logic Faculty of Computer Science, University of Innsbruck RTA 10 Complexity Analysis of Term
Martin Avanzini and Georg Moser
Computational Logic Faculty of Computer Science, University of Innsbruck
RTA ’10
Runtime Complexity Analysis
Simple “Functional Program”
➀ d(c) = 0 ➂ d(x + y) = d(x) + d(y) ➁ d(x × y) = d(x) × y + x × d(y) ➃ d(x − y) = d(x) − d(y) data Exp = Zero | Const c | Times Exp Exp e1 × e2 | Plus Exp Exp e1 + e2 | Minus Exp Exp e1 − e2
MA & GM (ICS @ UIBK) RC = CC 2/15
Runtime Complexity Analysis
Simple “Functional Program”
➀ d(c) = 0 ➂ d(x + y) = d(x) + d(y) ➁ d(x × y) = d(x) × y + x × d(y) ➃ d(x − y) = d(x) − d(y)
Computation
d(c × c)
MA & GM (ICS @ UIBK) RC = CC 2/15
Runtime Complexity Analysis
Simple “Functional Program”
➀ d(c) = 0 ➂ d(x + y) = d(x) + d(y) ➁ d(x × y) = d(x) × y + x × d(y) ➃ d(x − y) = d(x) − d(y)
Computation
d(c × c) = d(c) × c + c × d(c)
MA & GM (ICS @ UIBK) RC = CC 2/15
Runtime Complexity Analysis
Simple “Functional Program”
➀ d(c) = 0 ➂ d(x + y) = d(x) + d(y) ➁ d(x × y) = d(x) × y + x × d(y) ➃ d(x − y) = d(x) − d(y)
Computation
d(c × c) = 0 × c + c × d(c)
MA & GM (ICS @ UIBK) RC = CC 2/15
Runtime Complexity Analysis
Simple “Functional Program”
➀ d(c) = 0 ➂ d(x + y) = d(x) + d(y) ➁ d(x × y) = d(x) × y + x × d(y) ➃ d(x − y) = d(x) − d(y)
Computation
d(c × c) = 0 × c + c × 0
MA & GM (ICS @ UIBK) RC = CC 2/15
Runtime Complexity Analysis
Simple “Functional Program” ≈ Term Rewrite System (TRS)
➀ d(c) → 0 ➂ d(x + y) → d(x) + d(y) ➁ d(x × y) → d(x) × y + x × d(y) ➃ d(x − y) → d(x) − d(y)
Computation ≈ Rewriting
d(c × c) − →!
R 0 × c + c × 0
MA & GM (ICS @ UIBK) RC = CC 2/15
Runtime Complexity Analysis
Simple “Functional Program” ≈ Term Rewrite System (TRS)
➀ d(c) → 0 ➂ d(x + y) → d(x) + d(y) ➁ d(x × y) → d(x) × y + x × d(y) ➃ d(x − y) → d(x) − d(y)
Computation ≈ Rewriting
d(c × c) − →!
R 0 × c + c × 0
Runtime Complexity
“number of reduction steps as function in the size of the initial terms”
MA & GM (ICS @ UIBK) RC = CC 2/15
Runtime Complexity Analysis
Simple “Functional Program” ≈ Term Rewrite System (TRS)
➀ d(c) → 0 ➂ d(x + y) → d(x) + d(y) ➁ d(x × y) → d(x) × y + x × d(y) ➃ d(x − y) → d(x) − d(y)
Computation ≈ Rewriting
d(c × c) − →!
R 0 × c + c × 0
Runtime Complexity
“number of reduction steps as function in the size of the initial terms”
◮ initial terms are argument normalised
MA & GM (ICS @ UIBK) RC = CC 2/15
Computation and Complexity
let C collect all constructor symbols and let Val abbreviate T (C, V)
Definition (Computation)
Let R denote a confluent and terminating TRS. R computes a function f : Valk → Val if ∃ function symbol f f (v1, . . . , vk) = w ⇐ ⇒ f(v1, . . . , vk) − →!
R w
MA & GM (ICS @ UIBK) RC = CC 3/15
Computation and Complexity
let C collect all constructor symbols and let Val abbreviate T (C, V)
Definition (Computation)
Let R denote a confluent and terminating TRS. R computes a relation R ⊆ Valk × Val if ∃ function symbol f (v1, . . . , vk, w) ∈ R ⇐ ⇒ f(v1, . . . , vk) − →!
R w and w accepting
MA & GM (ICS @ UIBK) RC = CC 3/15
Computation and Complexity
let C collect all constructor symbols and let Val abbreviate T (C, V)
Definition (Computation)
Let R denote a confluent and terminating TRS. R computes a relation R ⊆ Valk × Val if ∃ function symbol f (v1, . . . , vk, w) ∈ R ⇐ ⇒ f(v1, . . . , vk) − →!
R w and w accepting
Definition (Runtime Complexity)
rcR(n) = max{ dl(t, − →R) | |t| n } where dl(t, − →R) = max{ℓ | ∃(t1, . . . , tℓ). t − →R t1 − →R . . . − →R tℓ}
MA & GM (ICS @ UIBK) RC = CC 3/15
Computation and Complexity
let C collect all constructor symbols and let Val abbreviate T (C, V)
Definition (Computation)
Let R denote a confluent and terminating TRS. R computes a relation R ⊆ Valk × Val if ∃ function symbol f (v1, . . . , vk, w) ∈ R ⇐ ⇒ f(v1, . . . , vk) − →!
R w and w accepting
Definition (Runtime Complexity)
rcR(n) = max{ dl(t, − →R) | |t| n and arguments from Val } where dl(t, − →R) = max{ℓ | ∃(t1, . . . , tℓ). t − →R t1 − →R . . . − →R tℓ}
MA & GM (ICS @ UIBK) RC = CC 3/15
Automated Complexity Analysis
Example
➀ d(c) → 0 ➂ d(x + y) → d(x) + d(y) ➁ d(x × y) → d(x) × y + x × d(y) ➃ d(x − y) → d(x) − d(y)
MA & GM (ICS @ UIBK) RC = CC 4/15
Automated Complexity Analysis
Example
➀ d(c) → 0 ➂ d(x + y) → d(x) + d(y) ➁ d(x × y) → d(x) × y + x × d(y) ➃ d(x − y) → d(x) − d(y)
◮ derivational complexity of above TRS is at least exponential
MA & GM (ICS @ UIBK) RC = CC 4/15
Automated Complexity Analysis
Example
➀ d(c) → 0 ➂ d(x + y) → d(x) + d(y) ➁ d(x × y) → d(x) × y + x × d(y) ➃ d(x − y) → d(x) − d(y)
◮ derivational complexity of above TRS is at least exponential ◮ runtime complexity of above TRS is linear
$ tct -a rc -p dif.trs YES(?,O(n^1)) ’Weak Dependency Pairs’
YES(?,O(n^1)) Input Problem: runtime-complexity with respect to Rules: { d(c) -> 0() , d(*(x, y)) -> +(*(y, d(x)), *(x, d(y))) , d(+(x, y)) -> +(d(x), d(y)) , d(-(x, y)) -> -(d(x), d(y))} Proof Details: ... MA & GM (ICS @ UIBK) RC = CC 4/15
Automated Complexity Analysis
Example
➀ d(c) → 0 ➂ d(x + y) → d(x) + d(y) ➁ d(x × y) → d(x) × y + x × d(y) ➃ d(x − y) → d(x) − d(y)
◮ derivational complexity of above TRS is at least exponential ◮ runtime complexity of above TRS is linear
$ tct -a rc -p dif.trs YES(?,O(n^1)) ’Weak Dependency Pairs’
YES(?,O(n^1)) Input Problem: runtime-complexity with respect to Rules: { d(c) -> 0() , d(*(x, y)) -> +(*(y, d(x)), *(x, d(y))) , d(+(x, y)) -> +(d(x), d(y)) , d(-(x, y)) -> -(d(x), d(y))} Proof Details: ...
Our Question
what can we infer about the computational complexity from this proof?
MA & GM (ICS @ UIBK) RC = CC 4/15
Automated Complexity Analysis
Example
➀ d(c) → 0 ➂ d(x + y) → d(x) + d(y) ➁ d(x × y) → d(x) × y + x × d(y) ➃ d(x − y) → d(x) − d(y)
◮ derivational complexity of above TRS is at least exponential ◮ runtime complexity of above TRS is linear
$ tct -a rc -p dif.trs YES(?,O(n^1)) ’Weak Dependency Pairs’
YES(?,O(n^1)) Input Problem: runtime-complexity with respect to Rules: { d(c) -> 0() , d(*(x, y)) -> +(*(y, d(x)), *(x, d(y))) , d(+(x, y)) -> +(d(x), d(y)) , d(-(x, y)) -> -(d(x), d(y))} Proof Details: ...
Our Question
In particular, does it certify polytime computability
MA & GM (ICS @ UIBK) RC = CC 4/15
MA & GM (ICS @ UIBK) RC = CC 5/15
runtime complexity is a reasonable cost model for rewriting
MA & GM (ICS @ UIBK) RC = CC 5/15
runtime complexity is a reasonable cost model for rewriting
1 runtime complexity naturally expresses the cost of computation
MA & GM (ICS @ UIBK) RC = CC 5/15
runtime complexity is a reasonable cost model for rewriting
1 runtime complexity naturally expresses the cost of computation 2 polynomially related to actual cost of an implementation
MA & GM (ICS @ UIBK) RC = CC 5/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7)
MA & GM (ICS @ UIBK) RC = CC 6/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7)
s · t1 t2 · t3 · t4 t5 t6 t7
MA & GM (ICS @ UIBK) RC = CC 6/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7)
s · t1 t2 · t3 · t4 t5 t6 t7 computed NF depends on employed strategy
MA & GM (ICS @ UIBK) RC = CC 6/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7) 2 any normal-form is computable in nondeterministic time O(log(ℓ)2ℓ5)
s · t1 t2 · t3 · t4 t5 t6 t7 choice of redex nondeterministically
MA & GM (ICS @ UIBK) RC = CC 6/15
Difficulty
a single rewrite step may copy arbitrarily large terms
◮ terms may grow exponential in the length of derivations
MA & GM (ICS @ UIBK) RC = CC 7/15
Difficulty
a single rewrite step may copy arbitrarily large terms
◮ terms may grow exponential in the length of derivations
Example
➀ d(c) → 0 ➂ d(x + y) → d(x) + d(y) ➁ d(x × y) → d(x) × y + x × d(y) ➃ d(x − y) → d(x) − d(y)
MA & GM (ICS @ UIBK) RC = CC 7/15
Difficulty
a single rewrite step may copy arbitrarily large terms
◮ terms may grow exponential in the length of derivations
Example
➀ d(c) → 0 ➂ d(x + y) → d(x) + d(y) ➁ d(x × y) → d(x) × y + x × d(y) ➃ d(x − y) → d(x) − d(y) d(c) − →!
R 0
MA & GM (ICS @ UIBK) RC = CC 7/15
Difficulty
a single rewrite step may copy arbitrarily large terms
◮ terms may grow exponential in the length of derivations
Example
➀ d(c) → 0 ➂ d(x + y) → d(x) + d(y) ➁ d(x × y) → d(x) × y + x × d(y) ➃ d(x − y) → d(x) − d(y) d(c) − →!
R 0
d(c × c) − →!
R 0 × c + c × 0
MA & GM (ICS @ UIBK) RC = CC 7/15
Difficulty
a single rewrite step may copy arbitrarily large terms
◮ terms may grow exponential in the length of derivations
Example
➀ d(c) → 0 ➂ d(x + y) → d(x) + d(y) ➁ d(x × y) → d(x) × y + x × d(y) ➃ d(x − y) → d(x) − d(y) d(c) − →!
R 0
d(c × c) − →!
R 0 × c + c × 0
d((c × c) × c) − →!
R (0 × c + c × 0) × c + (c × c) × 0
MA & GM (ICS @ UIBK) RC = CC 7/15
Difficulty
a single rewrite step may copy arbitrarily large terms
◮ terms may grow exponential in the length of derivations
Example
➀ d(c) → 0 ➂ d(x + y) → d(x) + d(y) ➁ d(x × y) → d(x) × y + x × d(y) ➃ d(x − y) → d(x) − d(y) d(c) − →!
R 0
d(c × c) − →!
R 0 × c + c × 0
d((c × c) × c) − →!
R (0 × c + c × 0) × c + (c × c) × 0
d((c × c) × (c × c)) − →!
R ((0 × c + c × 0) × c + (c × c) × 0) × (c × c)
+ (c × c) × ((0 × c + c × 0) × c + (c × c) × 0)
MA & GM (ICS @ UIBK) RC = CC 7/15
Proof Outline
f (s1, . . . , sn) t
ℓ R
term rewriting f (s1, . . . , sn) t
p(ℓ) M
Turing machine
MA & GM (ICS @ UIBK) RC = CC 8/15
Proof Outline
f (s1, . . . , sn) t
ℓ R
term rewriting · ·
ℓ G
graph rewriting f (s1, . . . , sn) t
p(ℓ) M
Turing machine
MA & GM (ICS @ UIBK) RC = CC 8/15
Proof Outline
Adequacy of Graph Rewriting – “Complexity Version”
f (s1, . . . , sn) t
ℓ R
term rewriting · ·
ℓ G
graph rewriting f (s1, . . . , sn) t
p(ℓ) M
Turing machine
MA & GM (ICS @ UIBK) RC = CC 8/15
1 term rewriting on graphs
Example
term t = d(x + x) × d(x + x) represented by × d d + x
◮ same variable represented by unique node
MA & GM (ICS @ UIBK) RC = CC 9/15
1 term rewriting on graphs
Example
term t = d(x + x) × d(x + x) represented by × d d + + x × d d + x × d + x
◮ same variable represented by unique node
MA & GM (ICS @ UIBK) RC = CC 9/15
1 term rewriting on graphs
Example
term t = d(x + x) × d(x + x) represented by × d d + + x
d d + x
d + x
◮ same variable represented by unique node
MA & GM (ICS @ UIBK) RC = CC 9/15
1 term rewriting on graphs 2 copying sharing
Example Term Rewriting
d
+
d(x) → x + x
MA & GM (ICS @ UIBK) RC = CC 9/15
1 term rewriting on graphs 2 copying sharing
Example Graph Rewriting
d
+
d(x) → x + x ⇓
d x → + x
MA & GM (ICS @ UIBK) RC = CC 9/15
1 term rewriting on graphs 2 copying sharing 3 structural equality “pointer equality”
Example Matching
+ x y +
x + y → d(x) ⇓
+ x y → d x
MA & GM (ICS @ UIBK) RC = CC 9/15
1 term rewriting on graphs 2 copying sharing 3 structural equality “pointer equality”
Example Matching
+ x y +
x + y → d(x) ⇓
+ x y → d x
MA & GM (ICS @ UIBK) RC = CC 9/15
1 term rewriting on graphs 2 copying sharing 3 structural equality “pointer equality”
Example Matching
+ x y +
x x + y → d(x) ⇓
+ x y → d x
MA & GM (ICS @ UIBK) RC = CC 9/15
1 term rewriting on graphs 2 copying sharing 3 structural equality “pointer equality”
Example Matching
+ x y +
x y x + y → d(x) ⇓
+ x y → d x
MA & GM (ICS @ UIBK) RC = CC 9/15
1 term rewriting on graphs 2 copying sharing 3 structural equality “pointer equality”
Example Matching
+ x +
x + x → d(x) ⇓
+ x → d x
MA & GM (ICS @ UIBK) RC = CC 9/15
1 term rewriting on graphs 2 copying sharing 3 structural equality “pointer equality”
Example Matching
+ x +
x + x → d(x) ⇓
+ x → d x
MA & GM (ICS @ UIBK) RC = CC 9/15
1 term rewriting on graphs 2 copying sharing 3 structural equality “pointer equality”
Example Matching
+ x +
x + x → d(x) ⇓
+ x → d x
MA & GM (ICS @ UIBK) RC = CC 9/15
1 term rewriting on graphs 2 copying sharing 3 structural equality “pointer equality”
Example Matching
+ x +
☞ x + x → d(x) ⇓
+ x → d x
MA & GM (ICS @ UIBK) RC = CC 9/15
1 term rewriting on graphs 2 copying sharing 3 structural equality “pointer equality”
Example Matching
+ x +
x x + x → d(x) ⇓
+ x → d x
MA & GM (ICS @ UIBK) RC = CC 9/15
Problems
→R
MA & GM (ICS @ UIBK) RC = CC 10/15
Problems
→R
× + +
MA & GM (ICS @ UIBK) RC = CC 10/15
Problems
→R
× + +
no redex
MA & GM (ICS @ UIBK) RC = CC 10/15
Problems
→R
× + +
Problem ➀
below redex maximal sharing required
MA & GM (ICS @ UIBK) RC = CC 10/15
Problems
→R
× + +
Problem ➀
below redex maximal sharing required − →G × + d
MA & GM (ICS @ UIBK) RC = CC 10/15
Problems
→R
→3
R
× + +
Problem ➀
below redex maximal sharing required − →G × + d
Problem ➁
both arguments
MA & GM (ICS @ UIBK) RC = CC 10/15
Theorem
suppose S is a term graph such that
1 node corresponding to p is unshared 2 subgraph S ↾p is maximally shared
Then S − →G,p T ⇐ ⇒ term(S) − →R,p term(T)
MA & GM (ICS @ UIBK) RC = CC 11/15
Theorem
suppose S is a term graph such that
1 node corresponding to p is unshared 2 subgraph S ↾p is maximally shared
Then S − →G,p T ⇐ ⇒ term(S) − →R,p term(T)
Idea
◮ extend rewrite relation −
→G with folding and unfolding steps that recover condition ➊ and ➋ S · · − →G T ⇐ ⇒ term(S) − →R term(T)
MA & GM (ICS @ UIBK) RC = CC 11/15
Theorem
suppose S is a term graph such that
1 node corresponding to p is unshared 2 subgraph S ↾p is maximally shared
Then S − →G,p T ⇐ ⇒ term(S) − →R,p term(T)
Idea
◮ extend rewrite relation −
→G with folding and unfolding steps that recover condition ➊ and ➋ S · · − →G T ⇐ ⇒ term(S) − →R term(T)
Observation
◮ unfolding may lead to exponential blowup
MA & GM (ICS @ UIBK) RC = CC 11/15
define for term graphs S, T
◮ S u v T :⇐
⇒ “T obtained from S by identifying nodes u and v” f g g
v f g
T
MA & GM (ICS @ UIBK) RC = CC 12/15
define for term graphs S, T
◮ S u v T :⇐
⇒ “T obtained from S by identifying nodes u and v”
Example u
v
+ +
u v
+ +
MA & GM (ICS @ UIBK) RC = CC 12/15
define for term graphs S, T
◮ S u v T :⇐
⇒ “T obtained from S by identifying nodes u and v” and position p
◮ S ◮p T :⇐
⇒ S u
v T for nodes u, v ∈ S strictly below position p
Example u
v
+ +
u v
+ +
MA & GM (ICS @ UIBK) RC = CC 12/15
define for term graphs S, T
◮ S u v T :⇐
⇒ “T obtained from S by identifying nodes u and v” and position p
◮ S ◮p T :⇐
⇒ S u
v T for nodes u, v ∈ S strictly below position p
Example ◮2
+ +
u v
+ +
MA & GM (ICS @ UIBK) RC = CC 12/15
define for term graphs S, T
◮ S u v T :⇐
⇒ “T obtained from S by identifying nodes u and v” and position p
◮ S ◮p T :⇐
⇒ S u
v T for nodes u, v ∈ S strictly below position p ◮ S ⊳p T :⇐
⇒ S u
v T and u ∈ T
node above position p
MA & GM (ICS @ UIBK) RC = CC 12/15
define for term graphs S, T
◮ S u v T :⇐
⇒ “T obtained from S by identifying nodes u and v” and position p
◮ S ◮p T :⇐
⇒ S u
v T for nodes u, v ∈ S strictly below position p ◮ S ⊳p T :⇐
⇒ S u
v T and u ∈ T unshared node above position p
MA & GM (ICS @ UIBK) RC = CC 12/15
define for term graphs S, T
◮ S u v T :⇐
⇒ “T obtained from S by identifying nodes u and v” and position p
◮ S ◮p T :⇐
⇒ S u
v T for nodes u, v ∈ S strictly below position p ◮ S ⊳p T :⇐
⇒ S u
v T and u ∈ T unshared node above position p
Example u2
v2
+ + + + +
v2 u2
u1
v1
+ + +
v1 u1
MA & GM (ICS @ UIBK) RC = CC 12/15
define for term graphs S, T
◮ S u v T :⇐
⇒ “T obtained from S by identifying nodes u and v” and position p
◮ S ◮p T :⇐
⇒ S u
v T for nodes u, v ∈ S strictly below position p ◮ S ⊳p T :⇐
⇒ S u
v T and u ∈ T unshared node above position p
Example ⊳2.2
+ + + + +
v2 u2
⊳2.2
+ + +
v1 u1
MA & GM (ICS @ UIBK) RC = CC 12/15
“Complexity Version”
Lemma
1 if S is ◮p-minimal then S ↾p is maximally sharing 2 if S is ⊳p-minimal then the node at position p is unshared
MA & GM (ICS @ UIBK) RC = CC 13/15
“Complexity Version”
Lemma
1 if S is ◮p-minimal then S ↾p is maximally sharing 2 if S is ⊳p-minimal then the node at position p is unshared
Theorem
S ⊳!
p · ◮! p · −
→G,p T ⇐ ⇒ term(S) − →R,p term(T)
MA & GM (ICS @ UIBK) RC = CC 13/15
“Complexity Version”
Lemma
1 if S is ◮p-minimal then S ↾p is maximally sharing 2 if S is ⊳p-minimal then the node at position p is unshared
Theorem
S ⊳!
p · ◮! p · −
→G,p T ⇐ ⇒ term(S) − →R,p term(T)
◮ set
⊳ ◮
− →G,p : = ⊳!
p · ◮! p · −
→G,p
MA & GM (ICS @ UIBK) RC = CC 13/15
“Complexity Version”
Lemma
1 if S is ◮p-minimal then S ↾p is maximally sharing 2 if S is ⊳p-minimal then the node at position p is unshared
Theorem
S
⊳ ◮
− →G,p T ⇐ ⇒ term(S) − →R,p term(T)
◮ set
⊳ ◮
− →G,p : = ⊳!
p · ◮! p · −
→G,p
MA & GM (ICS @ UIBK) RC = CC 13/15
“Complexity Version”
Lemma
1 if S is ◮p-minimal then S ↾p is maximally sharing 2 if S is ⊳p-minimal then the node at position p is unshared
Theorem
S
⊳ ◮
− →G,p T ⇐ ⇒ term(S) − →R,p term(T)
◮ set
⊳ ◮
− →G,p : = ⊳!
p · ◮! p · −
→G,p
Lemma
If S
⊳ ◮
− →ℓ
G T then |T| (ℓ + 1) · |S| + ℓ2 · ∆ for fixed ∆ ∈ N ◮ polynomial size growth in |S| and length ℓ
MA & GM (ICS @ UIBK) RC = CC 13/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7) 2 any normal-form is computable in nondeterministic time O(log(ℓ)2ℓ5)
MA & GM (ICS @ UIBK) RC = CC 14/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7) 2 any normal-form is computable in nondeterministic time O(log(ℓ)2ℓ5)
Proof Idea.
s = s0 − →R s1 − →R · · · − →R sl
MA & GM (ICS @ UIBK) RC = CC 14/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7) 2 any normal-form is computable in nondeterministic time O(log(ℓ)2ℓ5)
Proof Idea.
S = S0
⊳ ◮
− →G S1
⊳ ◮
− →G · · ·
⊳ ◮
− →G Sl
1 rewrite graphs instead of terms
adequacy theorem
MA & GM (ICS @ UIBK) RC = CC 14/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7) 2 any normal-form is computable in nondeterministic time O(log(ℓ)2ℓ5)
Proof Idea.
S = S0
⊳ ◮
− →G S1
⊳ ◮
− →G · · ·
⊳ ◮
− →G Sl
1 rewrite graphs instead of terms
adequacy theorem
2 size growth bound polynomially in ℓ and |S|
restrictive unfolding
MA & GM (ICS @ UIBK) RC = CC 14/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|) = Ω(|S|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7) 2 any normal-form is computable in nondeterministic time O(log(ℓ)2ℓ5)
Proof Idea.
S = S0
⊳ ◮
− →G S1
⊳ ◮
− →G · · ·
⊳ ◮
− →G Sl
1 rewrite graphs instead of terms
adequacy theorem
2 size growth bound polynomially in ℓ and |S|
restrictive unfolding
MA & GM (ICS @ UIBK) RC = CC 14/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|) = Ω(|S|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7) 2 any normal-form is computable in nondeterministic time O(log(ℓ)2ℓ5)
Proof Idea.
S = S0
⊳ ◮
− →G S1
⊳ ◮
− →G · · ·
⊳ ◮
− →G Sl
1 rewrite graphs instead of terms
adequacy theorem
2 size growth bound polynomially in ℓ
restrictive unfolding
MA & GM (ICS @ UIBK) RC = CC 14/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|) = Ω(|S|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7) 2 any normal-form is computable in nondeterministic time O(log(ℓ)2ℓ5)
Proof Idea.
S = S0
⊳ ◮
− →G S1
⊳ ◮
− →G · · ·
⊳ ◮
− →G Sl
1 rewrite graphs instead of terms
adequacy theorem
2 size growth bound polynomially in ℓ
restrictive unfolding
3 each step Si
⊳ ◮
− →G Si+1 polytime computable in |Si| tedious
MA & GM (ICS @ UIBK) RC = CC 14/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|) = Ω(|S|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7) 2 any normal-form is computable in nondeterministic time O(log(ℓ)2ℓ5)
Proof Idea.
S = S0
⊳ ◮
− →G S1
⊳ ◮
− →G · · ·
⊳ ◮
− →G Sl
1 rewrite graphs instead of terms
adequacy theorem
2 size growth bound polynomially in ℓ
restrictive unfolding
3 each step Si
⊳ ◮
− →G Si+1 polytime computable in |Si| hence ℓ tedious
MA & GM (ICS @ UIBK) RC = CC 14/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|) = Ω(|S|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7) 2 any normal-form is computable in nondeterministic time O(log(ℓ)2ℓ5)
Proof Idea.
S = S0
⊳ ◮
− →G S1
⊳ ◮
− →G · · ·
⊳ ◮
− →G Sl
1 rewrite graphs instead of terms
adequacy theorem
2 size growth bound polynomially in ℓ
restrictive unfolding
3 each step Si
⊳ ◮
− →G Si+1 polytime computable in |Si| hence ℓ tedious
4 at most ℓ steps have to be performed
assumption
MA & GM (ICS @ UIBK) RC = CC 14/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|) = Ω(|S|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7) 2 any normal-form is computable in nondeterministic time O(log(ℓ)2ℓ5)
MA & GM (ICS @ UIBK) RC = CC 14/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|) = Ω(|S|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7) 2 any normal-form is computable in nondeterministic time O(log(ℓ)2ℓ5)
Corollary
Let R be a terminating TRS with rcR(n) ∈ O(nk) k 1
1 if R computes the function f then f ∈ FP
MA & GM (ICS @ UIBK) RC = CC 14/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|) = Ω(|S|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7) 2 any normal-form is computable in nondeterministic time O(log(ℓ)2ℓ5)
Corollary
Let R be a terminating TRS with rcR(n) ∈ O(nk) k 1
1 if R computes the function f then f ∈ FP 2 if R computes the relation R then the function problem associated
with R is in FNP. given v ∈ Valk, find w ∈ Val with ( v, w) ∈ R
MA & GM (ICS @ UIBK) RC = CC 14/15
Theorem
For any term s with dlR(s) ℓ ℓ = Ω(|s|) = Ω(|S|)
1 some normal-form is computable in deterministic time O(log(ℓ)3ℓ7) 2 any normal-form is computable in nondeterministic time O(log(ℓ)2ℓ5)
Corollary
Let R be a terminating TRS with rcR(n) ∈ O(nk) k 1
1 if R computes the function f then f ∈ FP 2 if R computes the relation R then the function problem associated
with R is in FNP. given v ∈ Valk, find w ∈ Val with ( v, w) ∈ R FNP “is class of function problems associated with L ∈ NP” FSAT = given formula φ, find satisfying assignment α
MA & GM (ICS @ UIBK) RC = CC 14/15
notion of runtime-complexity is a reasonable cost model for rewriting
1 cost of computation naturally expressed 2 polynomially related to actual cost on Turing machines
MA & GM (ICS @ UIBK) RC = CC 15/15
notion of runtime-complexity is a reasonable cost model for rewriting
1 cost of computation naturally expressed 2 polynomially related to actual cost on Turing machines
On Constructor Rewrite Systems and the Lambda-Calculus. In ICALP, pages 163–174, 2009.
Results
polynomially bounded innermost runtime complexity induces polytime computability on orthogonal constructor TRSs
MA & GM (ICS @ UIBK) RC = CC 15/15
notion of runtime-complexity is a reasonable cost model for rewriting
1 cost of computation naturally expressed 2 polynomially related to actual cost on Turing machines
On Constructor Rewrite Systems and the Lambda-Calculus. In ICALP, pages 163–174, 2009.
Derivational Complexity is an Invariant Cost Model. In FOPARA, 2009.
Results
polynomially bounded innermost (outermost) runtime complexity induces polytime computability on orthogonal TRSs
MA & GM (ICS @ UIBK) RC = CC 15/15
notion of runtime-complexity is a reasonable cost model for rewriting
1 cost of computation naturally expressed 2 polynomially related to actual cost on Turing machines
following tools verify polynomial (i)RC fully automatically
◮ T
C T http://cl-informatik.uibk.ac.at/research/software/tct
MA & GM (ICS @ UIBK) RC = CC 15/15
notion of runtime-complexity is a reasonable cost model for rewriting
1 cost of computation naturally expressed 2 polynomially related to actual cost on Turing machines
following tools verify polynomial (i)RC + CC fully automatically
◮ T
C T http://cl-informatik.uibk.ac.at/research/software/tct
MA & GM (ICS @ UIBK) RC = CC 15/15
notion of runtime-complexity is a reasonable cost model for rewriting
1 cost of computation naturally expressed 2 polynomially related to actual cost on Turing machines
following tools verify polynomial (i)RC + CC fully automatically
◮ AProVE
innermost runtime complexity http://aprove.informatik.rwth-aachen.de/
◮ C
a T http://cl-informatik.uibk.ac.at/research/software/ttt2
◮ T
C T http://cl-informatik.uibk.ac.at/research/software/tct
◮ Matchbox/Poly
derivational complexity http://dfa.imn.htwk-leipzig.de/matchbox/poly
MA & GM (ICS @ UIBK) RC = CC 15/15