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, r3, r4, r5, r6, r7 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: model-based reduction triple (=A, >=A!, >A!): finite algebra: carrier: {0,1} interpretations: g#_A(0,0) = 1 g#_A(0,1) = 0 g#_A(1,0) = 1 g#_A(1,1) = 0 c_A(0) = 0 c_A(1) = 1 s_A(0) = 1 s_A(1) = 1 f_A(0) = 0 f_A(1) = 0 |0|_A = 1 true_A = 0 |1|_A = 1 false_A = 0 if_A(0,0,0) = 0 if_A(0,0,1) = 0 if_A(0,1,0) = 0 if_A(0,1,1) = 1 if_A(1,0,0) = 0 if_A(1,0,1) = 0 if_A(1,1,0) = 0 if_A(1,1,1) = 1 g_A(0,0) = 1 g_A(0,1) = 1 g_A(1,0) = 1 g_A(1,1) = 1 g#!_A(0,0) = 1 g#!_A(0,1) = 0 g#!_A(1,0) = 0 g#!_A(1,1) = 0 c!_A(0) = 1 c!_A(1) = 0 s!_A(0) = 0 s!_A(1) = 0 f!_A(0) = 0 f!_A(1) = 0 |0|!_A = 1 true!_A = 0 |1|!_A = 0 false!_A = 0 if!_A(0,0,0) = 1 if!_A(0,0,1) = 0 if!_A(0,1,0) = 1 if!_A(0,1,1) = 0 if!_A(1,0,0) = 0 if!_A(1,0,1) = 0 if!_A(1,1,0) = 0 if!_A(1,1,1) = 0 g!_A(0,0) = 1 g!_A(0,1) = 0 g!_A(1,0) = 0 g!_A(1,1) = 0 partial status: pi(g#) = [2] pi(c) = [1] pi(s) = [] pi(f) = [] pi(|0|) = [] pi(true) = [] pi(|1|) = [] pi(false) = [] pi(if) = [] pi(g) = [2] The following rules are removed: p1, p2 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 r1, r2, r3, r4, r5, r6, r7 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: model-based reduction triple (=A, >=A!, >A!): finite algebra: carrier: {0,1} interpretations: f#_A(0) = 0 f#_A(1) = 0 s_A(0) = 1 s_A(1) = 1 f_A(0) = 0 f_A(1) = 0 |0|_A = 0 true_A = 0 |1|_A = 1 false_A = 0 if_A(0,0,0) = 0 if_A(0,0,1) = 0 if_A(0,1,0) = 0 if_A(0,1,1) = 1 if_A(1,0,0) = 0 if_A(1,0,1) = 0 if_A(1,1,0) = 0 if_A(1,1,1) = 0 g_A(0,0) = 0 g_A(0,1) = 1 g_A(1,0) = 0 g_A(1,1) = 1 c_A(0) = 0 c_A(1) = 0 f#!_A(0) = 0 f#!_A(1) = 0 s!_A(0) = 0 s!_A(1) = 0 f!_A(0) = 0 f!_A(1) = 0 |0|!_A = 0 true!_A = 0 |1|!_A = 0 false!_A = 0 if!_A(0,0,0) = 1 if!_A(0,0,1) = 0 if!_A(0,1,0) = 0 if!_A(0,1,1) = 1 if!_A(1,0,0) = 0 if!_A(1,0,1) = 0 if!_A(1,1,0) = 0 if!_A(1,1,1) = 0 g!_A(0,0) = 1 g!_A(0,1) = 0 g!_A(1,0) = 1 g!_A(1,1) = 1 c!_A(0) = 0 c!_A(1) = 1 partial status: pi(f#) = [1] pi(s) = [1] pi(f) = [1] pi(|0|) = [] pi(true) = [] pi(|1|) = [] pi(false) = [] pi(if) = [2, 3] pi(g) = [] pi(c) = [] The following rules are removed: p1 Then no dependency pair remains.