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: weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: g#_A(x1,x2) = x1 + ((1,0),(1,0)) x2 + (4,1) c_A(x1) = ((1,1),(0,1)) x1 + (8,1) s_A(x1) = ((0,1),(0,0)) x1 + (4,1) g_A(x1,x2) = ((1,0),(0,0)) x1 + x2 + (2,1) f_A(x1) = (3,3) |0|_A() = (1,0) true_A() = (2,1) |1|_A() = (2,0) false_A() = (1,1) if_A(x1,x2,x3) = x2 + x3 + (1,0) precedence: false > f = |1| > |0| > g# > c = s = g = true > if partial status: pi(g#) = [1] pi(c) = [] pi(s) = [] pi(g) = [] pi(f) = [] pi(|0|) = [] pi(true) = [] pi(|1|) = [] pi(false) = [] pi(if) = [2, 3] The next rules are strictly ordered: p1 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#(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 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#(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: weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: g#_A(x1,x2) = ((1,0),(0,0)) x2 + (1,1) c_A(x1) = ((1,1),(0,1)) x1 + (7,0) g_A(x1,x2) = ((0,1),(1,1)) x1 + ((1,0),(1,0)) x2 + (3,1) s_A(x1) = ((0,1),(0,1)) x1 + (1,2) f_A(x1) = ((0,0),(0,1)) x1 + (6,1) |0|_A() = (2,0) true_A() = (1,0) |1|_A() = (1,0) false_A() = (6,0) if_A(x1,x2,x3) = ((0,0),(0,1)) x1 + x2 + x3 + (1,0) precedence: true > g = s = f > c = |1| = false = if > g# = |0| partial status: pi(g#) = [] pi(c) = [] pi(g) = [] pi(s) = [] pi(f) = [] pi(|0|) = [] pi(true) = [] pi(|1|) = [] pi(false) = [] pi(if) = [2, 3] 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: weighted path order base order: matrix interpretations: carrier: N^2 order: standard order interpretations: f#_A(x1) = ((1,0),(1,0)) x1 + (2,2) s_A(x1) = ((1,0),(0,0)) x1 + (1,1) precedence: f# = s partial status: pi(f#) = [] pi(s) = [] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.