YES We show the termination of the TRS R: f(|0|()) -> true() f(|1|()) -> false() f(s(x)) -> f(x) if(true(),x,y) -> x if(false(),x,y) -> y g(s(x),s(y)) -> if(f(x),s(x),s(y)) g(x,c(y)) -> g(x,g(s(c(y)),y)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: f#(s(x)) -> f#(x) p2: g#(s(x),s(y)) -> if#(f(x),s(x),s(y)) p3: g#(s(x),s(y)) -> f#(x) p4: g#(x,c(y)) -> g#(x,g(s(c(y)),y)) p5: g#(x,c(y)) -> g#(s(c(y)),y) and R consists of: r1: f(|0|()) -> true() r2: f(|1|()) -> false() r3: f(s(x)) -> f(x) r4: if(true(),x,y) -> x r5: if(false(),x,y) -> y r6: g(s(x),s(y)) -> if(f(x),s(x),s(y)) r7: g(x,c(y)) -> g(x,g(s(c(y)),y)) The estimated dependency graph contains the following SCCs: {p4, p5} {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: g#(x,c(y)) -> g#(s(c(y)),y) p2: g#(x,c(y)) -> g#(x,g(s(c(y)),y)) and R consists of: r1: f(|0|()) -> true() r2: f(|1|()) -> false() r3: f(s(x)) -> f(x) r4: if(true(),x,y) -> x r5: if(false(),x,y) -> y r6: g(s(x),s(y)) -> if(f(x),s(x),s(y)) r7: g(x,c(y)) -> g(x,g(s(c(y)),y)) The set of usable rules consists of r1, r2, r3, r4, r5, r6, r7 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: g#_A(x1,x2) = ((0,0),(1,0)) x2 + (7,2) c_A(x1) = x1 + (22,21) s_A(x1) = (6,9) g_A(x1,x2) = ((1,0),(1,0)) x1 + (14,20) f_A(x1) = (4,4) |0|_A() = (2,1) true_A() = (1,5) |1|_A() = (3,3) false_A() = (2,2) if_A(x1,x2,x3) = x1 + x2 + x3 + (2,2) precedence: g# = c = s = g = f = |0| = true = |1| = false = if partial status: pi(g#) = [] pi(c) = [] pi(s) = [] pi(g) = [] pi(f) = [] pi(|0|) = [] pi(true) = [] pi(|1|) = [] pi(false) = [] pi(if) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: g#_A(x1,x2) = (0,0) c_A(x1) = x1 + (6,5) s_A(x1) = (2,1) g_A(x1,x2) = (5,4) f_A(x1) = (1,5) |0|_A() = (3,7) true_A() = (2,6) |1|_A() = (3,7) false_A() = (2,6) if_A(x1,x2,x3) = x2 + x3 + (1,1) precedence: if > f = true = |1| = false > |0| > g# = c = s = g partial status: pi(g#) = [] pi(c) = [] pi(s) = [] pi(g) = [] pi(f) = [] pi(|0|) = [] pi(true) = [] pi(|1|) = [] pi(false) = [] pi(if) = [] The next rules are strictly ordered: p2 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: g#(x,c(y)) -> g#(s(c(y)),y) and R consists of: r1: f(|0|()) -> true() r2: f(|1|()) -> false() r3: f(s(x)) -> f(x) r4: if(true(),x,y) -> x r5: if(false(),x,y) -> y r6: g(s(x),s(y)) -> if(f(x),s(x),s(y)) r7: g(x,c(y)) -> g(x,g(s(c(y)),y)) The estimated dependency graph contains the following SCCs: {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: g#(x,c(y)) -> g#(s(c(y)),y) and R consists of: r1: f(|0|()) -> true() r2: f(|1|()) -> false() r3: f(s(x)) -> f(x) r4: if(true(),x,y) -> x r5: if(false(),x,y) -> y r6: g(s(x),s(y)) -> if(f(x),s(x),s(y)) r7: g(x,c(y)) -> g(x,g(s(c(y)),y)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: g#_A(x1,x2) = x2 c_A(x1) = ((1,0),(0,0)) x1 + (2,1) s_A(x1) = ((0,0),(1,0)) x1 + (1,1) precedence: c > g# = s partial status: pi(g#) = [] pi(c) = [] pi(s) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: g#_A(x1,x2) = (0,0) c_A(x1) = (2,2) s_A(x1) = (1,1) precedence: g# = c = s partial status: pi(g#) = [] pi(c) = [] pi(s) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains. -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: f#(s(x)) -> f#(x) and R consists of: r1: f(|0|()) -> true() r2: f(|1|()) -> false() r3: f(s(x)) -> f(x) r4: if(true(),x,y) -> x r5: if(false(),x,y) -> y r6: g(s(x),s(y)) -> if(f(x),s(x),s(y)) r7: g(x,c(y)) -> g(x,g(s(c(y)),y)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: f#_A(x1) = ((1,0),(1,1)) x1 + (2,2) s_A(x1) = ((1,0),(0,0)) x1 + (1,1) precedence: f# = s partial status: pi(f#) = [] pi(s) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: f#_A(x1) = ((1,0),(0,0)) x1 s_A(x1) = (1,1) precedence: s > f# partial status: pi(f#) = [] pi(s) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.