0 CpxTRS
↳1 TrsToWeightedTrsProof (BOTH BOUNDS(ID, ID), 0 ms)
↳2 CpxWeightedTrs
↳3 TypeInferenceProof (BOTH BOUNDS(ID, ID), 0 ms)
↳4 CpxTypedWeightedTrs
↳5 CompletionProof (UPPER BOUND(ID), 0 ms)
↳6 CpxTypedWeightedCompleteTrs
↳7 CpxTypedWeightedTrsToRntsProof (UPPER BOUND(ID), 0 ms)
↳8 CpxRNTS
↳9 CompleteCoflocoProof (⇔, 142 ms)
↳10 BOUNDS(1, 1)
a__g(X) → a__h(X)
a__c → d
a__h(d) → a__g(c)
mark(g(X)) → a__g(X)
mark(h(X)) → a__h(X)
mark(c) → a__c
mark(d) → d
a__g(X) → g(X)
a__h(X) → h(X)
a__c → c
a__g(X) → a__h(X) [1]
a__c → d [1]
a__h(d) → a__g(c) [1]
mark(g(X)) → a__g(X) [1]
mark(h(X)) → a__h(X) [1]
mark(c) → a__c [1]
mark(d) → d [1]
a__g(X) → g(X) [1]
a__h(X) → h(X) [1]
a__c → c [1]
a__g(X) → a__h(X) [1]
a__c → d [1]
a__h(d) → a__g(c) [1]
mark(g(X)) → a__g(X) [1]
mark(h(X)) → a__h(X) [1]
mark(c) → a__c [1]
mark(d) → d [1]
a__g(X) → g(X) [1]
a__h(X) → h(X) [1]
a__c → c [1]
a__g :: d:c:g:h → d:c:g:h a__h :: d:c:g:h → d:c:g:h a__c :: d:c:g:h d :: d:c:g:h c :: d:c:g:h mark :: d:c:g:h → d:c:g:h g :: d:c:g:h → d:c:g:h h :: d:c:g:h → d:c:g:h |
Runtime Complexity Weighted TRS with Types. The TRS R consists of the following rules:
The TRS has the following type information:
Rewrite Strategy: INNERMOST |
d => 1
c => 0
a__c -{ 1 }→ 1 :|:
a__c -{ 1 }→ 0 :|:
a__g(z) -{ 1 }→ a__h(X) :|: X >= 0, z = X
a__g(z) -{ 1 }→ 1 + X :|: X >= 0, z = X
a__h(z) -{ 1 }→ a__g(0) :|: z = 1
a__h(z) -{ 1 }→ 1 + X :|: X >= 0, z = X
mark(z) -{ 1 }→ a__h(X) :|: z = 1 + X, X >= 0
mark(z) -{ 1 }→ a__g(X) :|: z = 1 + X, X >= 0
mark(z) -{ 1 }→ a__c :|: z = 0
mark(z) -{ 1 }→ 1 :|: z = 1
eq(start(V),0,[fun(V, Out)],[V >= 0]). eq(start(V),0,[fun2(Out)],[]). eq(start(V),0,[fun1(V, Out)],[V >= 0]). eq(start(V),0,[mark(V, Out)],[V >= 0]). eq(fun(V, Out),1,[fun1(X1, Ret)],[Out = Ret,X1 >= 0,V = X1]). eq(fun2(Out),1,[],[Out = 1]). eq(fun1(V, Out),1,[fun(0, Ret1)],[Out = Ret1,V = 1]). eq(mark(V, Out),1,[fun(X2, Ret2)],[Out = Ret2,V = 1 + X2,X2 >= 0]). eq(mark(V, Out),1,[fun1(X3, Ret3)],[Out = Ret3,V = 1 + X3,X3 >= 0]). eq(mark(V, Out),1,[fun2(Ret4)],[Out = Ret4,V = 0]). eq(mark(V, Out),1,[],[Out = 1,V = 1]). eq(fun(V, Out),1,[],[Out = 1 + X4,X4 >= 0,V = X4]). eq(fun1(V, Out),1,[],[Out = 1 + X5,X5 >= 0,V = X5]). eq(fun2(Out),1,[],[Out = 0]). input_output_vars(fun(V,Out),[V],[Out]). input_output_vars(fun2(Out),[],[Out]). input_output_vars(fun1(V,Out),[V],[Out]). input_output_vars(mark(V,Out),[V],[Out]). |
CoFloCo proof output:
Preprocessing Cost Relations
=====================================
#### Computed strongly connected components
0. recursive : [fun/2,fun1/2]
1. non_recursive : [fun2/1]
2. non_recursive : [mark/2]
3. non_recursive : [start/1]
#### Obtained direct recursion through partial evaluation
0. SCC is partially evaluated into fun1/2
1. SCC is partially evaluated into fun2/1
2. SCC is partially evaluated into mark/2
3. SCC is partially evaluated into start/1
Control-Flow Refinement of Cost Relations
=====================================
### Specialization of cost equations fun1/2
* CE 9 is refined into CE [17]
* CE 7 is refined into CE [18]
* CE 8 is refined into CE [19]
### Cost equations --> "Loop" of fun1/2
* CEs [19] --> Loop 9
* CEs [17] --> Loop 10
* CEs [18] --> Loop 11
### Ranking functions of CR fun1(V,Out)
#### Partial ranking functions of CR fun1(V,Out)
### Specialization of cost equations fun2/1
* CE 10 is refined into CE [20]
* CE 11 is refined into CE [21]
### Cost equations --> "Loop" of fun2/1
* CEs [20] --> Loop 12
* CEs [21] --> Loop 13
### Ranking functions of CR fun2(Out)
#### Partial ranking functions of CR fun2(Out)
### Specialization of cost equations mark/2
* CE 12 is refined into CE [22]
* CE 13 is refined into CE [23,24]
* CE 14 is refined into CE [25,26]
* CE 16 is refined into CE [27]
* CE 15 is refined into CE [28,29]
### Cost equations --> "Loop" of mark/2
* CEs [23,25] --> Loop 14
* CEs [22,24,26,27] --> Loop 15
* CEs [29] --> Loop 16
* CEs [28] --> Loop 17
### Ranking functions of CR mark(V,Out)
#### Partial ranking functions of CR mark(V,Out)
### Specialization of cost equations start/1
* CE 2 is refined into CE [30]
* CE 3 is refined into CE [31,32]
* CE 4 is refined into CE [33,34]
* CE 5 is refined into CE [35,36]
* CE 6 is refined into CE [37,38,39,40]
### Cost equations --> "Loop" of start/1
* CEs [30,31,32,33,34,35,36,37,38,39,40] --> Loop 18
### Ranking functions of CR start(V)
#### Partial ranking functions of CR start(V)
Computing Bounds
=====================================
#### Cost of chains of fun1(V,Out):
* Chain [11]: 2
with precondition: [V=1,Out=1]
* Chain [10]: 1
with precondition: [V+1=Out,V>=0]
* Chain [9,10]: 3
with precondition: [V=1,Out=1]
#### Cost of chains of fun2(Out):
* Chain [13]: 1
with precondition: [Out=0]
* Chain [12]: 1
with precondition: [Out=1]
#### Cost of chains of mark(V,Out):
* Chain [17]: 2
with precondition: [V=0,Out=0]
* Chain [16]: 2
with precondition: [V=0,Out=1]
* Chain [15]: 3
with precondition: [V=Out,V>=1]
* Chain [14]: 5
with precondition: [V=2,Out=1]
#### Cost of chains of start(V):
* Chain [18]: 5
with precondition: []
Closed-form bounds of start(V):
-------------------------------------
* Chain [18] with precondition: []
- Upper bound: 5
- Complexity: constant
### Maximum cost of start(V): 5
Asymptotic class: constant
* Total analysis performed in 78 ms.