YES We show the termination of the TRS R: eq(|0|(),|0|()) -> true() eq(|0|(),s(x)) -> false() eq(s(x),|0|()) -> false() eq(s(x),s(y)) -> eq(x,y) or(true(),y) -> true() or(false(),y) -> y union(empty(),h) -> h union(edge(x,y,i),h) -> edge(x,y,union(i,h)) reach(x,y,empty(),h) -> false() reach(x,y,edge(u,v,i),h) -> if_reach_1(eq(x,u),x,y,edge(u,v,i),h) if_reach_1(true(),x,y,edge(u,v,i),h) -> if_reach_2(eq(y,v),x,y,edge(u,v,i),h) if_reach_2(true(),x,y,edge(u,v,i),h) -> true() if_reach_2(false(),x,y,edge(u,v,i),h) -> or(reach(x,y,i,h),reach(v,y,union(i,h),empty())) if_reach_1(false(),x,y,edge(u,v,i),h) -> reach(x,y,i,edge(u,v,h)) -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: eq#(s(x),s(y)) -> eq#(x,y) p2: union#(edge(x,y,i),h) -> union#(i,h) p3: reach#(x,y,edge(u,v,i),h) -> if_reach_1#(eq(x,u),x,y,edge(u,v,i),h) p4: reach#(x,y,edge(u,v,i),h) -> eq#(x,u) p5: if_reach_1#(true(),x,y,edge(u,v,i),h) -> if_reach_2#(eq(y,v),x,y,edge(u,v,i),h) p6: if_reach_1#(true(),x,y,edge(u,v,i),h) -> eq#(y,v) p7: if_reach_2#(false(),x,y,edge(u,v,i),h) -> or#(reach(x,y,i,h),reach(v,y,union(i,h),empty())) p8: if_reach_2#(false(),x,y,edge(u,v,i),h) -> reach#(x,y,i,h) p9: if_reach_2#(false(),x,y,edge(u,v,i),h) -> reach#(v,y,union(i,h),empty()) p10: if_reach_2#(false(),x,y,edge(u,v,i),h) -> union#(i,h) p11: if_reach_1#(false(),x,y,edge(u,v,i),h) -> reach#(x,y,i,edge(u,v,h)) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: or(true(),y) -> true() r6: or(false(),y) -> y r7: union(empty(),h) -> h r8: union(edge(x,y,i),h) -> edge(x,y,union(i,h)) r9: reach(x,y,empty(),h) -> false() r10: reach(x,y,edge(u,v,i),h) -> if_reach_1(eq(x,u),x,y,edge(u,v,i),h) r11: if_reach_1(true(),x,y,edge(u,v,i),h) -> if_reach_2(eq(y,v),x,y,edge(u,v,i),h) r12: if_reach_2(true(),x,y,edge(u,v,i),h) -> true() r13: if_reach_2(false(),x,y,edge(u,v,i),h) -> or(reach(x,y,i,h),reach(v,y,union(i,h),empty())) r14: if_reach_1(false(),x,y,edge(u,v,i),h) -> reach(x,y,i,edge(u,v,h)) The estimated dependency graph contains the following SCCs: {p3, p5, p8, p9, p11} {p1} {p2} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: if_reach_2#(false(),x,y,edge(u,v,i),h) -> reach#(v,y,union(i,h),empty()) p2: reach#(x,y,edge(u,v,i),h) -> if_reach_1#(eq(x,u),x,y,edge(u,v,i),h) p3: if_reach_1#(false(),x,y,edge(u,v,i),h) -> reach#(x,y,i,edge(u,v,h)) p4: if_reach_1#(true(),x,y,edge(u,v,i),h) -> if_reach_2#(eq(y,v),x,y,edge(u,v,i),h) p5: if_reach_2#(false(),x,y,edge(u,v,i),h) -> reach#(x,y,i,h) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: or(true(),y) -> true() r6: or(false(),y) -> y r7: union(empty(),h) -> h r8: union(edge(x,y,i),h) -> edge(x,y,union(i,h)) r9: reach(x,y,empty(),h) -> false() r10: reach(x,y,edge(u,v,i),h) -> if_reach_1(eq(x,u),x,y,edge(u,v,i),h) r11: if_reach_1(true(),x,y,edge(u,v,i),h) -> if_reach_2(eq(y,v),x,y,edge(u,v,i),h) r12: if_reach_2(true(),x,y,edge(u,v,i),h) -> true() r13: if_reach_2(false(),x,y,edge(u,v,i),h) -> or(reach(x,y,i,h),reach(v,y,union(i,h),empty())) r14: if_reach_1(false(),x,y,edge(u,v,i),h) -> reach(x,y,i,edge(u,v,h)) The set of usable rules consists of r1, r2, r3, r4, r7, r8 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: if_reach_2#_A(x1,x2,x3,x4,x5) = ((1,0),(1,1)) x4 + x5 + (8,1) false_A() = (2,2) edge_A(x1,x2,x3) = ((1,0),(0,0)) x1 + x3 + (8,2) reach#_A(x1,x2,x3,x4) = ((1,0),(1,1)) x3 + x4 + (9,11) union_A(x1,x2) = ((1,0),(1,0)) x1 + ((1,0),(1,1)) x2 + (3,12) empty_A() = (3,1) if_reach_1#_A(x1,x2,x3,x4,x5) = ((0,0),(1,0)) x1 + ((1,0),(1,1)) x4 + x5 + (9,1) eq_A(x1,x2) = (9,4) true_A() = (9,4) |0|_A() = (10,3) s_A(x1) = (10,5) precedence: edge = union = empty = |0| > eq = true = s > false > if_reach_2# = reach# = if_reach_1# partial status: pi(if_reach_2#) = [5] pi(false) = [] pi(edge) = [] pi(reach#) = [] pi(union) = [] pi(empty) = [] pi(if_reach_1#) = [5] pi(eq) = [] pi(true) = [] pi(|0|) = [] pi(s) = [] 2. weighted path order base order: matrix interpretations: carrier: N^2 order: lexicographic order interpretations: if_reach_2#_A(x1,x2,x3,x4,x5) = (3,4) false_A() = (5,6) edge_A(x1,x2,x3) = (0,2) reach#_A(x1,x2,x3,x4) = (3,4) union_A(x1,x2) = (0,7) empty_A() = (4,5) if_reach_1#_A(x1,x2,x3,x4,x5) = (3,4) eq_A(x1,x2) = (2,1) true_A() = (1,3) |0|_A() = (6,7) s_A(x1) = (6,7) precedence: |0| > empty > union > edge > if_reach_2# = false = reach# = if_reach_1# > eq > true > s partial status: pi(if_reach_2#) = [] pi(false) = [] pi(edge) = [] pi(reach#) = [] pi(union) = [] pi(empty) = [] pi(if_reach_1#) = [] pi(eq) = [] pi(true) = [] pi(|0|) = [] pi(s) = [] The next rules are strictly ordered: p1, p3 We remove them from the problem. -- SCC decomposition. Consider the dependency pair problem (P, R), where P consists of p1: reach#(x,y,edge(u,v,i),h) -> if_reach_1#(eq(x,u),x,y,edge(u,v,i),h) p2: if_reach_1#(true(),x,y,edge(u,v,i),h) -> if_reach_2#(eq(y,v),x,y,edge(u,v,i),h) p3: if_reach_2#(false(),x,y,edge(u,v,i),h) -> reach#(x,y,i,h) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: or(true(),y) -> true() r6: or(false(),y) -> y r7: union(empty(),h) -> h r8: union(edge(x,y,i),h) -> edge(x,y,union(i,h)) r9: reach(x,y,empty(),h) -> false() r10: reach(x,y,edge(u,v,i),h) -> if_reach_1(eq(x,u),x,y,edge(u,v,i),h) r11: if_reach_1(true(),x,y,edge(u,v,i),h) -> if_reach_2(eq(y,v),x,y,edge(u,v,i),h) r12: if_reach_2(true(),x,y,edge(u,v,i),h) -> true() r13: if_reach_2(false(),x,y,edge(u,v,i),h) -> or(reach(x,y,i,h),reach(v,y,union(i,h),empty())) r14: if_reach_1(false(),x,y,edge(u,v,i),h) -> reach(x,y,i,edge(u,v,h)) The estimated dependency graph contains the following SCCs: {p1, p2, p3} -- Reduction pair. Consider the dependency pair problem (P, R), where P consists of p1: reach#(x,y,edge(u,v,i),h) -> if_reach_1#(eq(x,u),x,y,edge(u,v,i),h) p2: if_reach_1#(true(),x,y,edge(u,v,i),h) -> if_reach_2#(eq(y,v),x,y,edge(u,v,i),h) p3: if_reach_2#(false(),x,y,edge(u,v,i),h) -> reach#(x,y,i,h) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: or(true(),y) -> true() r6: or(false(),y) -> y r7: union(empty(),h) -> h r8: union(edge(x,y,i),h) -> edge(x,y,union(i,h)) r9: reach(x,y,empty(),h) -> false() r10: reach(x,y,edge(u,v,i),h) -> if_reach_1(eq(x,u),x,y,edge(u,v,i),h) r11: if_reach_1(true(),x,y,edge(u,v,i),h) -> if_reach_2(eq(y,v),x,y,edge(u,v,i),h) r12: if_reach_2(true(),x,y,edge(u,v,i),h) -> true() r13: if_reach_2(false(),x,y,edge(u,v,i),h) -> or(reach(x,y,i,h),reach(v,y,union(i,h),empty())) r14: if_reach_1(false(),x,y,edge(u,v,i),h) -> reach(x,y,i,edge(u,v,h)) The set of usable rules consists of r1, r2, r3, r4 Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: reach#_A(x1,x2,x3,x4) = x3 + 9 edge_A(x1,x2,x3) = max{18, x1 - 4, x3 + 8} if_reach_1#_A(x1,x2,x3,x4,x5) = max{x1 + 19, x4 + 1} eq_A(x1,x2) = 4 true_A = 0 if_reach_2#_A(x1,x2,x3,x4,x5) = max{x1 + 6, x4 + 1} false_A = 0 |0|_A = 1 s_A(x1) = max{10, x1 + 9} precedence: if_reach_1# > reach# = if_reach_2# > edge = eq = true = false = |0| = s partial status: pi(reach#) = [] pi(edge) = [3] pi(if_reach_1#) = [1, 4] pi(eq) = [] pi(true) = [] pi(if_reach_2#) = [1, 4] pi(false) = [] pi(|0|) = [] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: reach#_A(x1,x2,x3,x4) = 5 edge_A(x1,x2,x3) = max{6, x3} if_reach_1#_A(x1,x2,x3,x4,x5) = x1 eq_A(x1,x2) = 3 true_A = 5 if_reach_2#_A(x1,x2,x3,x4,x5) = x1 + 1 false_A = 4 |0|_A = 0 s_A(x1) = x1 + 5 precedence: true > reach# = edge = if_reach_1# = eq = if_reach_2# = false = |0| = s partial status: pi(reach#) = [] pi(edge) = [3] pi(if_reach_1#) = [1] pi(eq) = [] pi(true) = [] pi(if_reach_2#) = [1] pi(false) = [] pi(|0|) = [] pi(s) = [1] The next rules are strictly ordered: p1, p2, p3 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: eq#(s(x),s(y)) -> eq#(x,y) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: or(true(),y) -> true() r6: or(false(),y) -> y r7: union(empty(),h) -> h r8: union(edge(x,y,i),h) -> edge(x,y,union(i,h)) r9: reach(x,y,empty(),h) -> false() r10: reach(x,y,edge(u,v,i),h) -> if_reach_1(eq(x,u),x,y,edge(u,v,i),h) r11: if_reach_1(true(),x,y,edge(u,v,i),h) -> if_reach_2(eq(y,v),x,y,edge(u,v,i),h) r12: if_reach_2(true(),x,y,edge(u,v,i),h) -> true() r13: if_reach_2(false(),x,y,edge(u,v,i),h) -> or(reach(x,y,i,h),reach(v,y,union(i,h),empty())) r14: if_reach_1(false(),x,y,edge(u,v,i),h) -> reach(x,y,i,edge(u,v,h)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: eq#_A(x1,x2) = max{2, x1 - 1, x2 + 1} s_A(x1) = max{1, x1} precedence: eq# = s partial status: pi(eq#) = [2] pi(s) = [1] 2. weighted path order base order: max/plus interpretations on natural numbers: eq#_A(x1,x2) = 0 s_A(x1) = max{2, x1} precedence: eq# = s partial status: pi(eq#) = [] pi(s) = [1] 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: union#(edge(x,y,i),h) -> union#(i,h) and R consists of: r1: eq(|0|(),|0|()) -> true() r2: eq(|0|(),s(x)) -> false() r3: eq(s(x),|0|()) -> false() r4: eq(s(x),s(y)) -> eq(x,y) r5: or(true(),y) -> true() r6: or(false(),y) -> y r7: union(empty(),h) -> h r8: union(edge(x,y,i),h) -> edge(x,y,union(i,h)) r9: reach(x,y,empty(),h) -> false() r10: reach(x,y,edge(u,v,i),h) -> if_reach_1(eq(x,u),x,y,edge(u,v,i),h) r11: if_reach_1(true(),x,y,edge(u,v,i),h) -> if_reach_2(eq(y,v),x,y,edge(u,v,i),h) r12: if_reach_2(true(),x,y,edge(u,v,i),h) -> true() r13: if_reach_2(false(),x,y,edge(u,v,i),h) -> or(reach(x,y,i,h),reach(v,y,union(i,h),empty())) r14: if_reach_1(false(),x,y,edge(u,v,i),h) -> reach(x,y,i,edge(u,v,h)) The set of usable rules consists of (no rules) Take the reduction pair: lexicographic combination of reduction pairs: 1. weighted path order base order: max/plus interpretations on natural numbers: union#_A(x1,x2) = max{x1 + 1, x2} edge_A(x1,x2,x3) = x3 precedence: union# = edge partial status: pi(union#) = [1, 2] pi(edge) = [3] 2. weighted path order base order: max/plus interpretations on natural numbers: union#_A(x1,x2) = max{x1 - 1, x2 + 1} edge_A(x1,x2,x3) = x3 precedence: union# = edge partial status: pi(union#) = [] pi(edge) = [3] The next rules are strictly ordered: p1 We remove them from the problem. Then no dependency pair remains.