/export/starexec/sandbox2/solver/bin/starexec_run_FirstOrder /export/starexec/sandbox2/benchmark/theBenchmark.xml /export/starexec/sandbox2/output/output_files -------------------------------------------------------------------------------- YES We consider the system theBenchmark. We are asked to determine termination of the following first-order TRS. 0 : [] --> o a!6220!6220add : [o * o] --> o a!6220!6220and : [o * o] --> o a!6220!6220first : [o * o] --> o a!6220!6220from : [o] --> o a!6220!6220if : [o * o * o] --> o add : [o * o] --> o and : [o * o] --> o cons : [o * o] --> o false : [] --> o first : [o * o] --> o from : [o] --> o if : [o * o * o] --> o mark : [o] --> o nil : [] --> o s : [o] --> o true : [] --> o a!6220!6220and(true, X) => mark(X) a!6220!6220and(false, X) => false a!6220!6220if(true, X, Y) => mark(X) a!6220!6220if(false, X, Y) => mark(Y) a!6220!6220add(0, X) => mark(X) a!6220!6220add(s(X), Y) => s(add(X, Y)) a!6220!6220first(0, X) => nil a!6220!6220first(s(X), cons(Y, Z)) => cons(Y, first(X, Z)) a!6220!6220from(X) => cons(X, from(s(X))) mark(and(X, Y)) => a!6220!6220and(mark(X), Y) mark(if(X, Y, Z)) => a!6220!6220if(mark(X), Y, Z) mark(add(X, Y)) => a!6220!6220add(mark(X), Y) mark(first(X, Y)) => a!6220!6220first(mark(X), mark(Y)) mark(from(X)) => a!6220!6220from(X) mark(true) => true mark(false) => false mark(0) => 0 mark(s(X)) => s(X) mark(nil) => nil mark(cons(X, Y)) => cons(X, Y) a!6220!6220and(X, Y) => and(X, Y) a!6220!6220if(X, Y, Z) => if(X, Y, Z) a!6220!6220add(X, Y) => add(X, Y) a!6220!6220first(X, Y) => first(X, Y) a!6220!6220from(X) => from(X) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): a!6220!6220and(true, X) >? mark(X) a!6220!6220and(false, X) >? false a!6220!6220if(true, X, Y) >? mark(X) a!6220!6220if(false, X, Y) >? mark(Y) a!6220!6220add(0, X) >? mark(X) a!6220!6220add(s(X), Y) >? s(add(X, Y)) a!6220!6220first(0, X) >? nil a!6220!6220first(s(X), cons(Y, Z)) >? cons(Y, first(X, Z)) a!6220!6220from(X) >? cons(X, from(s(X))) mark(and(X, Y)) >? a!6220!6220and(mark(X), Y) mark(if(X, Y, Z)) >? a!6220!6220if(mark(X), Y, Z) mark(add(X, Y)) >? a!6220!6220add(mark(X), Y) mark(first(X, Y)) >? a!6220!6220first(mark(X), mark(Y)) mark(from(X)) >? a!6220!6220from(X) mark(true) >? true mark(false) >? false mark(0) >? 0 mark(s(X)) >? s(X) mark(nil) >? nil mark(cons(X, Y)) >? cons(X, Y) a!6220!6220and(X, Y) >? and(X, Y) a!6220!6220if(X, Y, Z) >? if(X, Y, Z) a!6220!6220add(X, Y) >? add(X, Y) a!6220!6220first(X, Y) >? first(X, Y) a!6220!6220from(X) >? from(X) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: 0 = 0 a!6220!6220add = \y0y1.y0 + 2y1 a!6220!6220and = \y0y1.2y0 + 2y1 a!6220!6220first = \y0y1.y0 + y1 a!6220!6220from = \y0.3y0 a!6220!6220if = \y0y1y2.y0 + 2y1 + 2y2 add = \y0y1.y0 + 2y1 and = \y0y1.2y0 + 2y1 cons = \y0y1.y0 + y1 false = 2 first = \y0y1.y0 + y1 from = \y0.2y0 if = \y0y1y2.y0 + y1 + 2y2 mark = \y0.2y0 nil = 0 s = \y0.y0 true = 2 Using this interpretation, the requirements translate to: [[a!6220!6220and(true, _x0)]] = 4 + 2x0 > 2x0 = [[mark(_x0)]] [[a!6220!6220and(false, _x0)]] = 4 + 2x0 > 2 = [[false]] [[a!6220!6220if(true, _x0, _x1)]] = 2 + 2x0 + 2x1 > 2x0 = [[mark(_x0)]] [[a!6220!6220if(false, _x0, _x1)]] = 2 + 2x0 + 2x1 > 2x1 = [[mark(_x1)]] [[a!6220!6220add(0, _x0)]] = 2x0 >= 2x0 = [[mark(_x0)]] [[a!6220!6220add(s(_x0), _x1)]] = x0 + 2x1 >= x0 + 2x1 = [[s(add(_x0, _x1))]] [[a!6220!6220first(0, _x0)]] = x0 >= 0 = [[nil]] [[a!6220!6220first(s(_x0), cons(_x1, _x2))]] = x0 + x1 + x2 >= x0 + x1 + x2 = [[cons(_x1, first(_x0, _x2))]] [[a!6220!6220from(_x0)]] = 3x0 >= 3x0 = [[cons(_x0, from(s(_x0)))]] [[mark(and(_x0, _x1))]] = 4x0 + 4x1 >= 2x1 + 4x0 = [[a!6220!6220and(mark(_x0), _x1)]] [[mark(if(_x0, _x1, _x2))]] = 2x0 + 2x1 + 4x2 >= 2x0 + 2x1 + 2x2 = [[a!6220!6220if(mark(_x0), _x1, _x2)]] [[mark(add(_x0, _x1))]] = 2x0 + 4x1 >= 2x0 + 2x1 = [[a!6220!6220add(mark(_x0), _x1)]] [[mark(first(_x0, _x1))]] = 2x0 + 2x1 >= 2x0 + 2x1 = [[a!6220!6220first(mark(_x0), mark(_x1))]] [[mark(from(_x0))]] = 4x0 >= 3x0 = [[a!6220!6220from(_x0)]] [[mark(true)]] = 4 > 2 = [[true]] [[mark(false)]] = 4 > 2 = [[false]] [[mark(0)]] = 0 >= 0 = [[0]] [[mark(s(_x0))]] = 2x0 >= x0 = [[s(_x0)]] [[mark(nil)]] = 0 >= 0 = [[nil]] [[mark(cons(_x0, _x1))]] = 2x0 + 2x1 >= x0 + x1 = [[cons(_x0, _x1)]] [[a!6220!6220and(_x0, _x1)]] = 2x0 + 2x1 >= 2x0 + 2x1 = [[and(_x0, _x1)]] [[a!6220!6220if(_x0, _x1, _x2)]] = x0 + 2x1 + 2x2 >= x0 + x1 + 2x2 = [[if(_x0, _x1, _x2)]] [[a!6220!6220add(_x0, _x1)]] = x0 + 2x1 >= x0 + 2x1 = [[add(_x0, _x1)]] [[a!6220!6220first(_x0, _x1)]] = x0 + x1 >= x0 + x1 = [[first(_x0, _x1)]] [[a!6220!6220from(_x0)]] = 3x0 >= 2x0 = [[from(_x0)]] We can thus remove the following rules: a!6220!6220and(true, X) => mark(X) a!6220!6220and(false, X) => false a!6220!6220if(true, X, Y) => mark(X) a!6220!6220if(false, X, Y) => mark(Y) mark(true) => true mark(false) => false We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): a!6220!6220add(0, X) >? mark(X) a!6220!6220add(s(X), Y) >? s(add(X, Y)) a!6220!6220first(0, X) >? nil a!6220!6220first(s(X), cons(Y, Z)) >? cons(Y, first(X, Z)) a!6220!6220from(X) >? cons(X, from(s(X))) mark(and(X, Y)) >? a!6220!6220and(mark(X), Y) mark(if(X, Y, Z)) >? a!6220!6220if(mark(X), Y, Z) mark(add(X, Y)) >? a!6220!6220add(mark(X), Y) mark(first(X, Y)) >? a!6220!6220first(mark(X), mark(Y)) mark(from(X)) >? a!6220!6220from(X) mark(0) >? 0 mark(s(X)) >? s(X) mark(nil) >? nil mark(cons(X, Y)) >? cons(X, Y) a!6220!6220and(X, Y) >? and(X, Y) a!6220!6220if(X, Y, Z) >? if(X, Y, Z) a!6220!6220add(X, Y) >? add(X, Y) a!6220!6220first(X, Y) >? first(X, Y) a!6220!6220from(X) >? from(X) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: 0 = 1 a!6220!6220add = \y0y1.2 + y0 + 2y1 a!6220!6220and = \y0y1.y0 + 2y1 a!6220!6220first = \y0y1.y0 + y1 a!6220!6220from = \y0.3y0 a!6220!6220if = \y0y1y2.1 + y0 + 2y1 + 2y2 add = \y0y1.1 + y0 + y1 and = \y0y1.y0 + y1 cons = \y0y1.y0 + y1 first = \y0y1.y0 + y1 from = \y0.2y0 if = \y0y1y2.1 + y0 + y1 + y2 mark = \y0.2y0 nil = 0 s = \y0.y0 Using this interpretation, the requirements translate to: [[a!6220!6220add(0, _x0)]] = 3 + 2x0 > 2x0 = [[mark(_x0)]] [[a!6220!6220add(s(_x0), _x1)]] = 2 + x0 + 2x1 > 1 + x0 + x1 = [[s(add(_x0, _x1))]] [[a!6220!6220first(0, _x0)]] = 1 + x0 > 0 = [[nil]] [[a!6220!6220first(s(_x0), cons(_x1, _x2))]] = x0 + x1 + x2 >= x0 + x1 + x2 = [[cons(_x1, first(_x0, _x2))]] [[a!6220!6220from(_x0)]] = 3x0 >= 3x0 = [[cons(_x0, from(s(_x0)))]] [[mark(and(_x0, _x1))]] = 2x0 + 2x1 >= 2x0 + 2x1 = [[a!6220!6220and(mark(_x0), _x1)]] [[mark(if(_x0, _x1, _x2))]] = 2 + 2x0 + 2x1 + 2x2 > 1 + 2x0 + 2x1 + 2x2 = [[a!6220!6220if(mark(_x0), _x1, _x2)]] [[mark(add(_x0, _x1))]] = 2 + 2x0 + 2x1 >= 2 + 2x0 + 2x1 = [[a!6220!6220add(mark(_x0), _x1)]] [[mark(first(_x0, _x1))]] = 2x0 + 2x1 >= 2x0 + 2x1 = [[a!6220!6220first(mark(_x0), mark(_x1))]] [[mark(from(_x0))]] = 4x0 >= 3x0 = [[a!6220!6220from(_x0)]] [[mark(0)]] = 2 > 1 = [[0]] [[mark(s(_x0))]] = 2x0 >= x0 = [[s(_x0)]] [[mark(nil)]] = 0 >= 0 = [[nil]] [[mark(cons(_x0, _x1))]] = 2x0 + 2x1 >= x0 + x1 = [[cons(_x0, _x1)]] [[a!6220!6220and(_x0, _x1)]] = x0 + 2x1 >= x0 + x1 = [[and(_x0, _x1)]] [[a!6220!6220if(_x0, _x1, _x2)]] = 1 + x0 + 2x1 + 2x2 >= 1 + x0 + x1 + x2 = [[if(_x0, _x1, _x2)]] [[a!6220!6220add(_x0, _x1)]] = 2 + x0 + 2x1 > 1 + x0 + x1 = [[add(_x0, _x1)]] [[a!6220!6220first(_x0, _x1)]] = x0 + x1 >= x0 + x1 = [[first(_x0, _x1)]] [[a!6220!6220from(_x0)]] = 3x0 >= 2x0 = [[from(_x0)]] We can thus remove the following rules: a!6220!6220add(0, X) => mark(X) a!6220!6220add(s(X), Y) => s(add(X, Y)) a!6220!6220first(0, X) => nil mark(if(X, Y, Z)) => a!6220!6220if(mark(X), Y, Z) mark(0) => 0 a!6220!6220add(X, Y) => add(X, Y) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): a!6220!6220first(s(X), cons(Y, Z)) >? cons(Y, first(X, Z)) a!6220!6220from(X) >? cons(X, from(s(X))) mark(and(X, Y)) >? a!6220!6220and(mark(X), Y) mark(add(X, Y)) >? a!6220!6220add(mark(X), Y) mark(first(X, Y)) >? a!6220!6220first(mark(X), mark(Y)) mark(from(X)) >? a!6220!6220from(X) mark(s(X)) >? s(X) mark(nil) >? nil mark(cons(X, Y)) >? cons(X, Y) a!6220!6220and(X, Y) >? and(X, Y) a!6220!6220if(X, Y, Z) >? if(X, Y, Z) a!6220!6220first(X, Y) >? first(X, Y) a!6220!6220from(X) >? from(X) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: a!6220!6220add = \y0y1.y0 + y1 a!6220!6220and = \y0y1.y0 + y1 a!6220!6220first = \y0y1.y0 + 2y1 a!6220!6220from = \y0.3 + 3y0 a!6220!6220if = \y0y1y2.3 + y0 + y1 + 2y2 add = \y0y1.3 + y1 + 3y0 and = \y0y1.y0 + y1 cons = \y0y1.1 + y0 + y1 first = \y0y1.y0 + 2y1 from = \y0.2 + 2y0 if = \y0y1y2.y0 + y1 + y2 mark = \y0.2y0 nil = 0 s = \y0.y0 Using this interpretation, the requirements translate to: [[a!6220!6220first(s(_x0), cons(_x1, _x2))]] = 2 + x0 + 2x1 + 2x2 > 1 + x0 + x1 + 2x2 = [[cons(_x1, first(_x0, _x2))]] [[a!6220!6220from(_x0)]] = 3 + 3x0 >= 3 + 3x0 = [[cons(_x0, from(s(_x0)))]] [[mark(and(_x0, _x1))]] = 2x0 + 2x1 >= x1 + 2x0 = [[a!6220!6220and(mark(_x0), _x1)]] [[mark(add(_x0, _x1))]] = 6 + 2x1 + 6x0 > x1 + 2x0 = [[a!6220!6220add(mark(_x0), _x1)]] [[mark(first(_x0, _x1))]] = 2x0 + 4x1 >= 2x0 + 4x1 = [[a!6220!6220first(mark(_x0), mark(_x1))]] [[mark(from(_x0))]] = 4 + 4x0 > 3 + 3x0 = [[a!6220!6220from(_x0)]] [[mark(s(_x0))]] = 2x0 >= x0 = [[s(_x0)]] [[mark(nil)]] = 0 >= 0 = [[nil]] [[mark(cons(_x0, _x1))]] = 2 + 2x0 + 2x1 > 1 + x0 + x1 = [[cons(_x0, _x1)]] [[a!6220!6220and(_x0, _x1)]] = x0 + x1 >= x0 + x1 = [[and(_x0, _x1)]] [[a!6220!6220if(_x0, _x1, _x2)]] = 3 + x0 + x1 + 2x2 > x0 + x1 + x2 = [[if(_x0, _x1, _x2)]] [[a!6220!6220first(_x0, _x1)]] = x0 + 2x1 >= x0 + 2x1 = [[first(_x0, _x1)]] [[a!6220!6220from(_x0)]] = 3 + 3x0 > 2 + 2x0 = [[from(_x0)]] We can thus remove the following rules: a!6220!6220first(s(X), cons(Y, Z)) => cons(Y, first(X, Z)) mark(add(X, Y)) => a!6220!6220add(mark(X), Y) mark(from(X)) => a!6220!6220from(X) mark(cons(X, Y)) => cons(X, Y) a!6220!6220if(X, Y, Z) => if(X, Y, Z) a!6220!6220from(X) => from(X) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): a!6220!6220from(X) >? cons(X, from(s(X))) mark(and(X, Y)) >? a!6220!6220and(mark(X), Y) mark(first(X, Y)) >? a!6220!6220first(mark(X), mark(Y)) mark(s(X)) >? s(X) mark(nil) >? nil a!6220!6220and(X, Y) >? and(X, Y) a!6220!6220first(X, Y) >? first(X, Y) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: a!6220!6220and = \y0y1.2 + y0 + 2y1 a!6220!6220first = \y0y1.3 + y0 + 2y1 a!6220!6220from = \y0.3 + 3y0 and = \y0y1.2 + y0 + y1 cons = \y0y1.y0 + y1 first = \y0y1.2 + y0 + 2y1 from = \y0.y0 mark = \y0.2y0 nil = 0 s = \y0.y0 Using this interpretation, the requirements translate to: [[a!6220!6220from(_x0)]] = 3 + 3x0 > 2x0 = [[cons(_x0, from(s(_x0)))]] [[mark(and(_x0, _x1))]] = 4 + 2x0 + 2x1 > 2 + 2x0 + 2x1 = [[a!6220!6220and(mark(_x0), _x1)]] [[mark(first(_x0, _x1))]] = 4 + 2x0 + 4x1 > 3 + 2x0 + 4x1 = [[a!6220!6220first(mark(_x0), mark(_x1))]] [[mark(s(_x0))]] = 2x0 >= x0 = [[s(_x0)]] [[mark(nil)]] = 0 >= 0 = [[nil]] [[a!6220!6220and(_x0, _x1)]] = 2 + x0 + 2x1 >= 2 + x0 + x1 = [[and(_x0, _x1)]] [[a!6220!6220first(_x0, _x1)]] = 3 + x0 + 2x1 > 2 + x0 + 2x1 = [[first(_x0, _x1)]] We can thus remove the following rules: a!6220!6220from(X) => cons(X, from(s(X))) mark(and(X, Y)) => a!6220!6220and(mark(X), Y) mark(first(X, Y)) => a!6220!6220first(mark(X), mark(Y)) a!6220!6220first(X, Y) => first(X, Y) We use rule removal, following [Kop12, Theorem 2.23]. This gives the following requirements (possibly using Theorems 2.25 and 2.26 in [Kop12]): mark(s(X)) >? s(X) mark(nil) >? nil a!6220!6220and(X, Y) >? and(X, Y) We orient these requirements with a polynomial interpretation in the natural numbers. The following interpretation satisfies the requirements: a!6220!6220and = \y0y1.3 + y0 + y1 and = \y0y1.y0 + y1 mark = \y0.3 + 3y0 nil = 0 s = \y0.y0 Using this interpretation, the requirements translate to: [[mark(s(_x0))]] = 3 + 3x0 > x0 = [[s(_x0)]] [[mark(nil)]] = 3 > 0 = [[nil]] [[a!6220!6220and(_x0, _x1)]] = 3 + x0 + x1 > x0 + x1 = [[and(_x0, _x1)]] We can thus remove the following rules: mark(s(X)) => s(X) mark(nil) => nil a!6220!6220and(X, Y) => and(X, Y) All rules were succesfully removed. Thus, termination of the original system has been reduced to termination of the beta-rule, which is well-known to hold. +++ Citations +++ [Kop12] C. Kop. Higher Order Termination. PhD Thesis, 2012.