YES We show the termination of the TRS R: f(|0|()) -> true() f(|1|()) -> false() f(s(x)) -> f(x) if(true(),s(x),s(y)) -> s(x) if(false(),s(x),s(y)) -> s(y) g(x,c(y)) -> c(g(x,y)) g(x,c(y)) -> g(x,if(f(x),c(g(s(x),y)),c(y))) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: f#(s(x)) -> f#(x) p2: g#(x,c(y)) -> g#(x,y) p3: g#(x,c(y)) -> g#(x,if(f(x),c(g(s(x),y)),c(y))) p4: g#(x,c(y)) -> if#(f(x),c(g(s(x),y)),c(y)) p5: g#(x,c(y)) -> f#(x) p6: g#(x,c(y)) -> g#(s(x),y) and R consists of: r1: f(|0|()) -> true() r2: f(|1|()) -> false() r3: f(s(x)) -> f(x) r4: if(true(),s(x),s(y)) -> s(x) r5: if(false(),s(x),s(y)) -> s(y) r6: g(x,c(y)) -> c(g(x,y)) r7: g(x,c(y)) -> g(x,if(f(x),c(g(s(x),y)),c(y))) The estimated dependency graph contains the following SCCs: {p2, p6} {p1} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: g#(x,c(y)) -> g#(s(x),y) p2: g#(x,c(y)) -> g#(x,y) and R consists of: r1: f(|0|()) -> true() r2: f(|1|()) -> false() r3: f(s(x)) -> f(x) r4: if(true(),s(x),s(y)) -> s(x) r5: if(false(),s(x),s(y)) -> s(y) r6: g(x,c(y)) -> c(g(x,y)) r7: g(x,c(y)) -> g(x,if(f(x),c(g(s(x),y)),c(y))) The set of usable rules consists of r1, r2 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: g#_A(x1,x2) = max{0, x1 - 1, x2 - 5} c_A(x1) = x1 + 3 s_A(x1) = x1 f_A(x1) = max{18, x1 - 1} |0|_A = 0 true_A = 7 |1|_A = 0 false_A = 7 g#!_A(x1,x2) = max{3, x1 - 17, x2 - 15} c!_A(x1) = max{0, x1 - 15} s!_A(x1) = max{2, x1 - 16} f!_A(x1) = max{4, x1 - 1} |0|!_A = 2 true!_A = 1 |1|!_A = 4 false!_A = 3 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: g#_A(x1,x2) = max{0, x1 - 2, x2 - 13} c_A(x1) = max{11, x1 + 7} s_A(x1) = max{1, x1 - 1} f_A(x1) = max{13, x1 - 2} |0|_A = 1 true_A = 0 |1|_A = 1 false_A = 0 g#!_A(x1,x2) = max{2, x1 - 14, x2 - 8} c!_A(x1) = max{1, x1 - 44} s!_A(x1) = max{4, x1 - 13} f!_A(x1) = max{6, x1 - 2} |0|!_A = 6 true!_A = 5 |1|!_A = 7 false!_A = 6 partial status: pi(g#) = [] pi(c) = [] pi(s) = [1] pi(f) = [1] pi(|0|) = [] pi(true) = [] pi(|1|) = [] pi(false) = [] The following rules are removed: p1 -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: g#(x,c(y)) -> g#(x,y) and R consists of: r1: f(|0|()) -> true() r2: f(|1|()) -> false() r3: f(s(x)) -> f(x) r4: if(true(),s(x),s(y)) -> s(x) r5: if(false(),s(x),s(y)) -> s(y) r6: g(x,c(y)) -> c(g(x,y)) r7: g(x,c(y)) -> g(x,if(f(x),c(g(s(x),y)),c(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,y) and R consists of: r1: f(|0|()) -> true() r2: f(|1|()) -> false() r3: f(s(x)) -> f(x) r4: if(true(),s(x),s(y)) -> s(x) r5: if(false(),s(x),s(y)) -> s(y) r6: g(x,c(y)) -> c(g(x,y)) r7: g(x,c(y)) -> g(x,if(f(x),c(g(s(x),y)),c(y))) The set of usable rules consists of r1, r2 Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: g#_A(x1,x2) = 0 c_A(x1) = max{4, x1 - 4} f_A(x1) = max{13, x1 - 5} |0|_A = 4 true_A = 0 |1|_A = 4 false_A = 0 g#!_A(x1,x2) = max{1, x2 - 5} c!_A(x1) = max{2, x1 - 4} f!_A(x1) = max{5, x1 - 22} |0|!_A = 5 true!_A = 4 |1|!_A = 5 false!_A = 4 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: g#_A(x1,x2) = 0 c_A(x1) = max{7, x1 - 7} f_A(x1) = max{9, x1 - 3} |0|_A = 2 true_A = 0 |1|_A = 2 false_A = 0 g#!_A(x1,x2) = max{2, x1 - 1, x2 - 8} c!_A(x1) = max{1, x1 - 33} f!_A(x1) = max{4, x1 - 3} |0|!_A = 4 true!_A = 3 |1|!_A = 4 false!_A = 3 partial status: pi(g#) = [2] pi(c) = [1] pi(f) = [] pi(|0|) = [] pi(true) = [] pi(|1|) = [] pi(false) = [] The following rules are removed: p1 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(),s(x),s(y)) -> s(x) r5: if(false(),s(x),s(y)) -> s(y) r6: g(x,c(y)) -> c(g(x,y)) r7: g(x,c(y)) -> g(x,if(f(x),c(g(s(x),y)),c(y))) The set of usable rules consists of (no rules) Take the reduction pair: generalized weighted path order (>=MG, >G) base order 1: trivial reduction triple (T x T, T x T, Φ) base order 2: lexicographic combination of reduction triples: 1. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: f#_A(x1) = x1 s_A(x1) = max{6, x1 + 1} f#!_A(x1) = max{3, x1 - 2} s!_A(x1) = max{2, x1 - 48} 2. marked-algebra reduction triple (>=A, >=A!, >A!): max/plus interpretation on natural numbers: f#_A(x1) = x1 s_A(x1) = x1 + 8 f#!_A(x1) = max{2, x1 - 18} s!_A(x1) = max{1, x1 - 18} partial status: pi(f#) = [1] pi(s) = [1] The following rules are removed: p1 Then no dependency pair remains.