(0) Obligation:

Clauses:

color_map(l(Region, Regions), Colors) :- ','(color_region(Region, Colors), color_map(Regions, Colors)).
color_map(nil, Colors).
color_region(region(Name, Color, Neighbors), Colors) :- ','(select(Color, Colors, Colors1), members(Neighbors, Colors1)).
select(X, .(X, Xs), Xs).
select(X, .(Y, Ys), .(Y, Zs)) :- select(X, Ys, Zs).
members(.(X, Xs), Ys) :- ','(member(X, Ys), members(Xs, Ys)).
members([], Ys).
member(X, .(X, X1)).
member(X, .(X2, T)) :- member(X, T).
test_color(Name, Map) :- ','(map(Name, Map), ','(colors(Name, Colors), color_map(Map, Colors))).
map(test, l(region(a, A, .(B, .(C, .(D, [])))), l(region(b, B, .(A, .(C, .(E, [])))), l(region(c, C, .(A, .(B, .(D, .(E, .(F, [])))))), l(region(d, D, .(A, .(C, .(F, [])))), l(region(e, E, .(B, .(C, .(F, [])))), l(region(f, F, .(C, .(D, .(E, [])))), nil))))))).
colors(X, .(red, .(yellow, .(blue, .(white, []))))).

Queries:

color_map(a,g).

(1) PrologToPiTRSProof (SOUND transformation)

We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
color_map_in: (f,b)
color_region_in: (f,b)
select_in: (f,b,f)
members_in: (f,b)
member_in: (f,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

color_map_in_ag(l(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag(nil, Colors) → color_map_out_ag(nil, Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(l(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x3, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1, x2)
l(x1, x2)  =  l(x1, x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(2) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

color_map_in_ag(l(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag(nil, Colors) → color_map_out_ag(nil, Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(l(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x3, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1, x2)
l(x1, x2)  =  l(x1, x2)

(3) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

COLOR_MAP_IN_AG(l(Region, Regions), Colors) → U1_AG(Region, Regions, Colors, color_region_in_ag(Region, Colors))
COLOR_MAP_IN_AG(l(Region, Regions), Colors) → COLOR_REGION_IN_AG(Region, Colors)
COLOR_REGION_IN_AG(region(Name, Color, Neighbors), Colors) → U3_AG(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
COLOR_REGION_IN_AG(region(Name, Color, Neighbors), Colors) → SELECT_IN_AGA(Color, Colors, Colors1)
SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → U5_AGA(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → SELECT_IN_AGA(X, Ys, Zs)
U3_AG(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_AG(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
U3_AG(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → MEMBERS_IN_AG(Neighbors, Colors1)
MEMBERS_IN_AG(.(X, Xs), Ys) → U6_AG(X, Xs, Ys, member_in_ag(X, Ys))
MEMBERS_IN_AG(.(X, Xs), Ys) → MEMBER_IN_AG(X, Ys)
MEMBER_IN_AG(X, .(X2, T)) → U8_AG(X, X2, T, member_in_ag(X, T))
MEMBER_IN_AG(X, .(X2, T)) → MEMBER_IN_AG(X, T)
U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → U7_AG(X, Xs, Ys, members_in_ag(Xs, Ys))
U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Xs, Ys)
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_AG(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Regions, Colors)

The TRS R consists of the following rules:

color_map_in_ag(l(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag(nil, Colors) → color_map_out_ag(nil, Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(l(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x3, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1, x2)
l(x1, x2)  =  l(x1, x2)
COLOR_MAP_IN_AG(x1, x2)  =  COLOR_MAP_IN_AG(x2)
U1_AG(x1, x2, x3, x4)  =  U1_AG(x3, x4)
COLOR_REGION_IN_AG(x1, x2)  =  COLOR_REGION_IN_AG(x2)
U3_AG(x1, x2, x3, x4, x5)  =  U3_AG(x4, x5)
SELECT_IN_AGA(x1, x2, x3)  =  SELECT_IN_AGA(x2)
U5_AGA(x1, x2, x3, x4, x5)  =  U5_AGA(x2, x3, x5)
U4_AG(x1, x2, x3, x4, x5)  =  U4_AG(x2, x4, x5)
MEMBERS_IN_AG(x1, x2)  =  MEMBERS_IN_AG(x2)
U6_AG(x1, x2, x3, x4)  =  U6_AG(x3, x4)
MEMBER_IN_AG(x1, x2)  =  MEMBER_IN_AG(x2)
U8_AG(x1, x2, x3, x4)  =  U8_AG(x2, x3, x4)
U7_AG(x1, x2, x3, x4)  =  U7_AG(x1, x3, x4)
U2_AG(x1, x2, x3, x4)  =  U2_AG(x1, x3, x4)

We have to consider all (P,R,Pi)-chains

(4) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

COLOR_MAP_IN_AG(l(Region, Regions), Colors) → U1_AG(Region, Regions, Colors, color_region_in_ag(Region, Colors))
COLOR_MAP_IN_AG(l(Region, Regions), Colors) → COLOR_REGION_IN_AG(Region, Colors)
COLOR_REGION_IN_AG(region(Name, Color, Neighbors), Colors) → U3_AG(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
COLOR_REGION_IN_AG(region(Name, Color, Neighbors), Colors) → SELECT_IN_AGA(Color, Colors, Colors1)
SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → U5_AGA(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → SELECT_IN_AGA(X, Ys, Zs)
U3_AG(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_AG(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
U3_AG(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → MEMBERS_IN_AG(Neighbors, Colors1)
MEMBERS_IN_AG(.(X, Xs), Ys) → U6_AG(X, Xs, Ys, member_in_ag(X, Ys))
MEMBERS_IN_AG(.(X, Xs), Ys) → MEMBER_IN_AG(X, Ys)
MEMBER_IN_AG(X, .(X2, T)) → U8_AG(X, X2, T, member_in_ag(X, T))
MEMBER_IN_AG(X, .(X2, T)) → MEMBER_IN_AG(X, T)
U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → U7_AG(X, Xs, Ys, members_in_ag(Xs, Ys))
U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Xs, Ys)
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_AG(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Regions, Colors)

The TRS R consists of the following rules:

color_map_in_ag(l(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag(nil, Colors) → color_map_out_ag(nil, Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(l(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x3, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1, x2)
l(x1, x2)  =  l(x1, x2)
COLOR_MAP_IN_AG(x1, x2)  =  COLOR_MAP_IN_AG(x2)
U1_AG(x1, x2, x3, x4)  =  U1_AG(x3, x4)
COLOR_REGION_IN_AG(x1, x2)  =  COLOR_REGION_IN_AG(x2)
U3_AG(x1, x2, x3, x4, x5)  =  U3_AG(x4, x5)
SELECT_IN_AGA(x1, x2, x3)  =  SELECT_IN_AGA(x2)
U5_AGA(x1, x2, x3, x4, x5)  =  U5_AGA(x2, x3, x5)
U4_AG(x1, x2, x3, x4, x5)  =  U4_AG(x2, x4, x5)
MEMBERS_IN_AG(x1, x2)  =  MEMBERS_IN_AG(x2)
U6_AG(x1, x2, x3, x4)  =  U6_AG(x3, x4)
MEMBER_IN_AG(x1, x2)  =  MEMBER_IN_AG(x2)
U8_AG(x1, x2, x3, x4)  =  U8_AG(x2, x3, x4)
U7_AG(x1, x2, x3, x4)  =  U7_AG(x1, x3, x4)
U2_AG(x1, x2, x3, x4)  =  U2_AG(x1, x3, x4)

We have to consider all (P,R,Pi)-chains

(5) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 4 SCCs with 10 less nodes.

(6) Complex Obligation (AND)

(7) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

MEMBER_IN_AG(X, .(X2, T)) → MEMBER_IN_AG(X, T)

The TRS R consists of the following rules:

color_map_in_ag(l(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag(nil, Colors) → color_map_out_ag(nil, Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(l(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x3, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1, x2)
l(x1, x2)  =  l(x1, x2)
MEMBER_IN_AG(x1, x2)  =  MEMBER_IN_AG(x2)

We have to consider all (P,R,Pi)-chains

(8) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(9) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

MEMBER_IN_AG(X, .(X2, T)) → MEMBER_IN_AG(X, T)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
MEMBER_IN_AG(x1, x2)  =  MEMBER_IN_AG(x2)

We have to consider all (P,R,Pi)-chains

(10) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(11) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MEMBER_IN_AG(.(X2, T)) → MEMBER_IN_AG(T)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(12) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • MEMBER_IN_AG(.(X2, T)) → MEMBER_IN_AG(T)
    The graph contains the following edges 1 > 1

(13) TRUE

(14) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Xs, Ys)
MEMBERS_IN_AG(.(X, Xs), Ys) → U6_AG(X, Xs, Ys, member_in_ag(X, Ys))

The TRS R consists of the following rules:

color_map_in_ag(l(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag(nil, Colors) → color_map_out_ag(nil, Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(l(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x3, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1, x2)
l(x1, x2)  =  l(x1, x2)
MEMBERS_IN_AG(x1, x2)  =  MEMBERS_IN_AG(x2)
U6_AG(x1, x2, x3, x4)  =  U6_AG(x3, x4)

We have to consider all (P,R,Pi)-chains

(15) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(16) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Xs, Ys)
MEMBERS_IN_AG(.(X, Xs), Ys) → U6_AG(X, Xs, Ys, member_in_ag(X, Ys))

The TRS R consists of the following rules:

member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
MEMBERS_IN_AG(x1, x2)  =  MEMBERS_IN_AG(x2)
U6_AG(x1, x2, x3, x4)  =  U6_AG(x3, x4)

We have to consider all (P,R,Pi)-chains

(17) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(18) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U6_AG(Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Ys)
MEMBERS_IN_AG(Ys) → U6_AG(Ys, member_in_ag(Ys))

The TRS R consists of the following rules:

member_in_ag(.(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(.(X2, T)) → U8_ag(X2, T, member_in_ag(T))
U8_ag(X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))

The set Q consists of the following terms:

member_in_ag(x0)
U8_ag(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(19) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule MEMBERS_IN_AG(Ys) → U6_AG(Ys, member_in_ag(Ys)) at position [1] we obtained the following new rules [LPAR04]:

MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), member_out_ag(x0, .(x0, x1)))
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), U8_ag(x0, x1, member_in_ag(x1)))

(20) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U6_AG(Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Ys)
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), member_out_ag(x0, .(x0, x1)))
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), U8_ag(x0, x1, member_in_ag(x1)))

The TRS R consists of the following rules:

member_in_ag(.(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(.(X2, T)) → U8_ag(X2, T, member_in_ag(T))
U8_ag(X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))

The set Q consists of the following terms:

member_in_ag(x0)
U8_ag(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(21) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule U6_AG(Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Ys) we obtained the following new rules [LPAR04]:

U6_AG(.(z0, z1), member_out_ag(z0, .(z0, z1))) → MEMBERS_IN_AG(.(z0, z1))
U6_AG(.(z0, z1), member_out_ag(x1, .(z0, z1))) → MEMBERS_IN_AG(.(z0, z1))

(22) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), member_out_ag(x0, .(x0, x1)))
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), U8_ag(x0, x1, member_in_ag(x1)))
U6_AG(.(z0, z1), member_out_ag(z0, .(z0, z1))) → MEMBERS_IN_AG(.(z0, z1))
U6_AG(.(z0, z1), member_out_ag(x1, .(z0, z1))) → MEMBERS_IN_AG(.(z0, z1))

The TRS R consists of the following rules:

member_in_ag(.(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(.(X2, T)) → U8_ag(X2, T, member_in_ag(T))
U8_ag(X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))

The set Q consists of the following terms:

member_in_ag(x0)
U8_ag(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(23) NonTerminationProof (EQUIVALENT transformation)

We used the non-termination processor [FROCOS05] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

s = U6_AG(.(z0, z1), member_out_ag(z0, .(z0, z1))) evaluates to t =U6_AG(.(z0, z1), member_out_ag(z0, .(z0, z1)))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
  • Semiunifier: [ ]
  • Matcher: [ ]




Rewriting sequence

U6_AG(.(z0, z1), member_out_ag(z0, .(z0, z1)))MEMBERS_IN_AG(.(z0, z1))
with rule U6_AG(.(z0', z1'), member_out_ag(z0', .(z0', z1'))) → MEMBERS_IN_AG(.(z0', z1')) at position [] and matcher [z0' / z0, z1' / z1]

MEMBERS_IN_AG(.(z0, z1))U6_AG(.(z0, z1), member_out_ag(z0, .(z0, z1)))
with rule MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), member_out_ag(x0, .(x0, x1)))

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.



(24) FALSE

(25) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → SELECT_IN_AGA(X, Ys, Zs)

The TRS R consists of the following rules:

color_map_in_ag(l(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag(nil, Colors) → color_map_out_ag(nil, Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(l(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x3, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1, x2)
l(x1, x2)  =  l(x1, x2)
SELECT_IN_AGA(x1, x2, x3)  =  SELECT_IN_AGA(x2)

We have to consider all (P,R,Pi)-chains

(26) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(27) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → SELECT_IN_AGA(X, Ys, Zs)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
SELECT_IN_AGA(x1, x2, x3)  =  SELECT_IN_AGA(x2)

We have to consider all (P,R,Pi)-chains

(28) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(29) Obligation:

Q DP problem:
The TRS P consists of the following rules:

SELECT_IN_AGA(.(Y, Ys)) → SELECT_IN_AGA(Ys)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(30) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • SELECT_IN_AGA(.(Y, Ys)) → SELECT_IN_AGA(Ys)
    The graph contains the following edges 1 > 1

(31) TRUE

(32) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Regions, Colors)
COLOR_MAP_IN_AG(l(Region, Regions), Colors) → U1_AG(Region, Regions, Colors, color_region_in_ag(Region, Colors))

The TRS R consists of the following rules:

color_map_in_ag(l(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag(nil, Colors) → color_map_out_ag(nil, Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(l(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x3, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1, x2)
l(x1, x2)  =  l(x1, x2)
COLOR_MAP_IN_AG(x1, x2)  =  COLOR_MAP_IN_AG(x2)
U1_AG(x1, x2, x3, x4)  =  U1_AG(x3, x4)

We have to consider all (P,R,Pi)-chains

(33) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(34) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Regions, Colors)
COLOR_MAP_IN_AG(l(Region, Regions), Colors) → U1_AG(Region, Regions, Colors, color_region_in_ag(Region, Colors))

The TRS R consists of the following rules:

color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))

The argument filtering Pi contains the following mapping:
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x4, x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x2, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x3, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x4, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1, x2)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x2, x3, x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x3, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1, x2)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1, x2)
region(x1, x2, x3)  =  region(x2, x3)
l(x1, x2)  =  l(x1, x2)
COLOR_MAP_IN_AG(x1, x2)  =  COLOR_MAP_IN_AG(x2)
U1_AG(x1, x2, x3, x4)  =  U1_AG(x3, x4)

We have to consider all (P,R,Pi)-chains

(35) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(36) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U1_AG(Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Colors)
COLOR_MAP_IN_AG(Colors) → U1_AG(Colors, color_region_in_ag(Colors))

The TRS R consists of the following rules:

color_region_in_ag(Colors) → U3_ag(Colors, select_in_aga(Colors))
U3_ag(Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Color, Colors, members_in_ag(Colors1))
select_in_aga(.(X, Xs)) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(.(Y, Ys)) → U5_aga(Y, Ys, select_in_aga(Ys))
U4_ag(Color, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Color, Neighbors), Colors)
U5_aga(Y, Ys, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
members_in_ag(Ys) → U6_ag(Ys, member_in_ag(Ys))
members_in_ag(Ys) → members_out_ag([], Ys)
U6_ag(Ys, member_out_ag(X, Ys)) → U7_ag(X, Ys, members_in_ag(Ys))
member_in_ag(.(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(.(X2, T)) → U8_ag(X2, T, member_in_ag(T))
U7_ag(X, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U8_ag(X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))

The set Q consists of the following terms:

color_region_in_ag(x0)
U3_ag(x0, x1)
select_in_aga(x0)
U4_ag(x0, x1, x2)
U5_aga(x0, x1, x2)
members_in_ag(x0)
U6_ag(x0, x1)
member_in_ag(x0)
U7_ag(x0, x1, x2)
U8_ag(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(37) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule COLOR_MAP_IN_AG(Colors) → U1_AG(Colors, color_region_in_ag(Colors)) at position [1] we obtained the following new rules [LPAR04]:

COLOR_MAP_IN_AG(x0) → U1_AG(x0, U3_ag(x0, select_in_aga(x0)))

(38) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U1_AG(Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Colors)
COLOR_MAP_IN_AG(x0) → U1_AG(x0, U3_ag(x0, select_in_aga(x0)))

The TRS R consists of the following rules:

color_region_in_ag(Colors) → U3_ag(Colors, select_in_aga(Colors))
U3_ag(Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Color, Colors, members_in_ag(Colors1))
select_in_aga(.(X, Xs)) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(.(Y, Ys)) → U5_aga(Y, Ys, select_in_aga(Ys))
U4_ag(Color, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Color, Neighbors), Colors)
U5_aga(Y, Ys, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
members_in_ag(Ys) → U6_ag(Ys, member_in_ag(Ys))
members_in_ag(Ys) → members_out_ag([], Ys)
U6_ag(Ys, member_out_ag(X, Ys)) → U7_ag(X, Ys, members_in_ag(Ys))
member_in_ag(.(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(.(X2, T)) → U8_ag(X2, T, member_in_ag(T))
U7_ag(X, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U8_ag(X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))

The set Q consists of the following terms:

color_region_in_ag(x0)
U3_ag(x0, x1)
select_in_aga(x0)
U4_ag(x0, x1, x2)
U5_aga(x0, x1, x2)
members_in_ag(x0)
U6_ag(x0, x1)
member_in_ag(x0)
U7_ag(x0, x1, x2)
U8_ag(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(39) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(40) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U1_AG(Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Colors)
COLOR_MAP_IN_AG(x0) → U1_AG(x0, U3_ag(x0, select_in_aga(x0)))

The TRS R consists of the following rules:

select_in_aga(.(X, Xs)) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(.(Y, Ys)) → U5_aga(Y, Ys, select_in_aga(Ys))
U3_ag(Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Color, Colors, members_in_ag(Colors1))
members_in_ag(Ys) → U6_ag(Ys, member_in_ag(Ys))
members_in_ag(Ys) → members_out_ag([], Ys)
U4_ag(Color, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Color, Neighbors), Colors)
member_in_ag(.(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(.(X2, T)) → U8_ag(X2, T, member_in_ag(T))
U6_ag(Ys, member_out_ag(X, Ys)) → U7_ag(X, Ys, members_in_ag(Ys))
U7_ag(X, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U8_ag(X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U5_aga(Y, Ys, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))

The set Q consists of the following terms:

color_region_in_ag(x0)
U3_ag(x0, x1)
select_in_aga(x0)
U4_ag(x0, x1, x2)
U5_aga(x0, x1, x2)
members_in_ag(x0)
U6_ag(x0, x1)
member_in_ag(x0)
U7_ag(x0, x1, x2)
U8_ag(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(41) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

color_region_in_ag(x0)

(42) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U1_AG(Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Colors)
COLOR_MAP_IN_AG(x0) → U1_AG(x0, U3_ag(x0, select_in_aga(x0)))

The TRS R consists of the following rules:

select_in_aga(.(X, Xs)) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(.(Y, Ys)) → U5_aga(Y, Ys, select_in_aga(Ys))
U3_ag(Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Color, Colors, members_in_ag(Colors1))
members_in_ag(Ys) → U6_ag(Ys, member_in_ag(Ys))
members_in_ag(Ys) → members_out_ag([], Ys)
U4_ag(Color, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Color, Neighbors), Colors)
member_in_ag(.(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(.(X2, T)) → U8_ag(X2, T, member_in_ag(T))
U6_ag(Ys, member_out_ag(X, Ys)) → U7_ag(X, Ys, members_in_ag(Ys))
U7_ag(X, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U8_ag(X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U5_aga(Y, Ys, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))

The set Q consists of the following terms:

U3_ag(x0, x1)
select_in_aga(x0)
U4_ag(x0, x1, x2)
U5_aga(x0, x1, x2)
members_in_ag(x0)
U6_ag(x0, x1)
member_in_ag(x0)
U7_ag(x0, x1, x2)
U8_ag(x0, x1, x2)

We have to consider all (P,Q,R)-chains.

(43) PrologToPiTRSProof (SOUND transformation)

We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
color_map_in: (f,b)
color_region_in: (f,b)
select_in: (f,b,f)
members_in: (f,b)
member_in: (f,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

color_map_in_ag(l(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag(nil, Colors) → color_map_out_ag(nil, Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(l(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1)
l(x1, x2)  =  l(x1, x2)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(44) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

color_map_in_ag(l(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag(nil, Colors) → color_map_out_ag(nil, Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(l(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1)
l(x1, x2)  =  l(x1, x2)

(45) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

COLOR_MAP_IN_AG(l(Region, Regions), Colors) → U1_AG(Region, Regions, Colors, color_region_in_ag(Region, Colors))
COLOR_MAP_IN_AG(l(Region, Regions), Colors) → COLOR_REGION_IN_AG(Region, Colors)
COLOR_REGION_IN_AG(region(Name, Color, Neighbors), Colors) → U3_AG(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
COLOR_REGION_IN_AG(region(Name, Color, Neighbors), Colors) → SELECT_IN_AGA(Color, Colors, Colors1)
SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → U5_AGA(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → SELECT_IN_AGA(X, Ys, Zs)
U3_AG(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_AG(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
U3_AG(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → MEMBERS_IN_AG(Neighbors, Colors1)
MEMBERS_IN_AG(.(X, Xs), Ys) → U6_AG(X, Xs, Ys, member_in_ag(X, Ys))
MEMBERS_IN_AG(.(X, Xs), Ys) → MEMBER_IN_AG(X, Ys)
MEMBER_IN_AG(X, .(X2, T)) → U8_AG(X, X2, T, member_in_ag(X, T))
MEMBER_IN_AG(X, .(X2, T)) → MEMBER_IN_AG(X, T)
U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → U7_AG(X, Xs, Ys, members_in_ag(Xs, Ys))
U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Xs, Ys)
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_AG(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Regions, Colors)

The TRS R consists of the following rules:

color_map_in_ag(l(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag(nil, Colors) → color_map_out_ag(nil, Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(l(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1)
l(x1, x2)  =  l(x1, x2)
COLOR_MAP_IN_AG(x1, x2)  =  COLOR_MAP_IN_AG(x2)
U1_AG(x1, x2, x3, x4)  =  U1_AG(x3, x4)
COLOR_REGION_IN_AG(x1, x2)  =  COLOR_REGION_IN_AG(x2)
U3_AG(x1, x2, x3, x4, x5)  =  U3_AG(x5)
SELECT_IN_AGA(x1, x2, x3)  =  SELECT_IN_AGA(x2)
U5_AGA(x1, x2, x3, x4, x5)  =  U5_AGA(x2, x5)
U4_AG(x1, x2, x3, x4, x5)  =  U4_AG(x2, x5)
MEMBERS_IN_AG(x1, x2)  =  MEMBERS_IN_AG(x2)
U6_AG(x1, x2, x3, x4)  =  U6_AG(x3, x4)
MEMBER_IN_AG(x1, x2)  =  MEMBER_IN_AG(x2)
U8_AG(x1, x2, x3, x4)  =  U8_AG(x4)
U7_AG(x1, x2, x3, x4)  =  U7_AG(x1, x4)
U2_AG(x1, x2, x3, x4)  =  U2_AG(x1, x4)

We have to consider all (P,R,Pi)-chains

(46) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

COLOR_MAP_IN_AG(l(Region, Regions), Colors) → U1_AG(Region, Regions, Colors, color_region_in_ag(Region, Colors))
COLOR_MAP_IN_AG(l(Region, Regions), Colors) → COLOR_REGION_IN_AG(Region, Colors)
COLOR_REGION_IN_AG(region(Name, Color, Neighbors), Colors) → U3_AG(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
COLOR_REGION_IN_AG(region(Name, Color, Neighbors), Colors) → SELECT_IN_AGA(Color, Colors, Colors1)
SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → U5_AGA(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → SELECT_IN_AGA(X, Ys, Zs)
U3_AG(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_AG(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
U3_AG(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → MEMBERS_IN_AG(Neighbors, Colors1)
MEMBERS_IN_AG(.(X, Xs), Ys) → U6_AG(X, Xs, Ys, member_in_ag(X, Ys))
MEMBERS_IN_AG(.(X, Xs), Ys) → MEMBER_IN_AG(X, Ys)
MEMBER_IN_AG(X, .(X2, T)) → U8_AG(X, X2, T, member_in_ag(X, T))
MEMBER_IN_AG(X, .(X2, T)) → MEMBER_IN_AG(X, T)
U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → U7_AG(X, Xs, Ys, members_in_ag(Xs, Ys))
U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Xs, Ys)
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_AG(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Regions, Colors)

The TRS R consists of the following rules:

color_map_in_ag(l(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag(nil, Colors) → color_map_out_ag(nil, Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(l(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1)
l(x1, x2)  =  l(x1, x2)
COLOR_MAP_IN_AG(x1, x2)  =  COLOR_MAP_IN_AG(x2)
U1_AG(x1, x2, x3, x4)  =  U1_AG(x3, x4)
COLOR_REGION_IN_AG(x1, x2)  =  COLOR_REGION_IN_AG(x2)
U3_AG(x1, x2, x3, x4, x5)  =  U3_AG(x5)
SELECT_IN_AGA(x1, x2, x3)  =  SELECT_IN_AGA(x2)
U5_AGA(x1, x2, x3, x4, x5)  =  U5_AGA(x2, x5)
U4_AG(x1, x2, x3, x4, x5)  =  U4_AG(x2, x5)
MEMBERS_IN_AG(x1, x2)  =  MEMBERS_IN_AG(x2)
U6_AG(x1, x2, x3, x4)  =  U6_AG(x3, x4)
MEMBER_IN_AG(x1, x2)  =  MEMBER_IN_AG(x2)
U8_AG(x1, x2, x3, x4)  =  U8_AG(x4)
U7_AG(x1, x2, x3, x4)  =  U7_AG(x1, x4)
U2_AG(x1, x2, x3, x4)  =  U2_AG(x1, x4)

We have to consider all (P,R,Pi)-chains

(47) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 4 SCCs with 10 less nodes.

(48) Complex Obligation (AND)

(49) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

MEMBER_IN_AG(X, .(X2, T)) → MEMBER_IN_AG(X, T)

The TRS R consists of the following rules:

color_map_in_ag(l(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag(nil, Colors) → color_map_out_ag(nil, Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(l(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1)
l(x1, x2)  =  l(x1, x2)
MEMBER_IN_AG(x1, x2)  =  MEMBER_IN_AG(x2)

We have to consider all (P,R,Pi)-chains

(50) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(51) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

MEMBER_IN_AG(X, .(X2, T)) → MEMBER_IN_AG(X, T)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
MEMBER_IN_AG(x1, x2)  =  MEMBER_IN_AG(x2)

We have to consider all (P,R,Pi)-chains

(52) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(53) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MEMBER_IN_AG(.(X2, T)) → MEMBER_IN_AG(T)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(54) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • MEMBER_IN_AG(.(X2, T)) → MEMBER_IN_AG(T)
    The graph contains the following edges 1 > 1

(55) TRUE

(56) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Xs, Ys)
MEMBERS_IN_AG(.(X, Xs), Ys) → U6_AG(X, Xs, Ys, member_in_ag(X, Ys))

The TRS R consists of the following rules:

color_map_in_ag(l(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag(nil, Colors) → color_map_out_ag(nil, Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(l(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1)
l(x1, x2)  =  l(x1, x2)
MEMBERS_IN_AG(x1, x2)  =  MEMBERS_IN_AG(x2)
U6_AG(x1, x2, x3, x4)  =  U6_AG(x3, x4)

We have to consider all (P,R,Pi)-chains

(57) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(58) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U6_AG(X, Xs, Ys, member_out_ag(X, Ys)) → MEMBERS_IN_AG(Xs, Ys)
MEMBERS_IN_AG(.(X, Xs), Ys) → U6_AG(X, Xs, Ys, member_in_ag(X, Ys))

The TRS R consists of the following rules:

member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
MEMBERS_IN_AG(x1, x2)  =  MEMBERS_IN_AG(x2)
U6_AG(x1, x2, x3, x4)  =  U6_AG(x3, x4)

We have to consider all (P,R,Pi)-chains

(59) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(60) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U6_AG(Ys, member_out_ag(X)) → MEMBERS_IN_AG(Ys)
MEMBERS_IN_AG(Ys) → U6_AG(Ys, member_in_ag(Ys))

The TRS R consists of the following rules:

member_in_ag(.(X, X1)) → member_out_ag(X)
member_in_ag(.(X2, T)) → U8_ag(member_in_ag(T))
U8_ag(member_out_ag(X)) → member_out_ag(X)

The set Q consists of the following terms:

member_in_ag(x0)
U8_ag(x0)

We have to consider all (P,Q,R)-chains.

(61) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule MEMBERS_IN_AG(Ys) → U6_AG(Ys, member_in_ag(Ys)) at position [1] we obtained the following new rules [LPAR04]:

MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), member_out_ag(x0))
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), U8_ag(member_in_ag(x1)))

(62) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U6_AG(Ys, member_out_ag(X)) → MEMBERS_IN_AG(Ys)
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), member_out_ag(x0))
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), U8_ag(member_in_ag(x1)))

The TRS R consists of the following rules:

member_in_ag(.(X, X1)) → member_out_ag(X)
member_in_ag(.(X2, T)) → U8_ag(member_in_ag(T))
U8_ag(member_out_ag(X)) → member_out_ag(X)

The set Q consists of the following terms:

member_in_ag(x0)
U8_ag(x0)

We have to consider all (P,Q,R)-chains.

(63) Instantiation (EQUIVALENT transformation)

By instantiating [LPAR04] the rule U6_AG(Ys, member_out_ag(X)) → MEMBERS_IN_AG(Ys) we obtained the following new rules [LPAR04]:

U6_AG(.(z0, z1), member_out_ag(z0)) → MEMBERS_IN_AG(.(z0, z1))
U6_AG(.(z0, z1), member_out_ag(x1)) → MEMBERS_IN_AG(.(z0, z1))

(64) Obligation:

Q DP problem:
The TRS P consists of the following rules:

MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), member_out_ag(x0))
MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), U8_ag(member_in_ag(x1)))
U6_AG(.(z0, z1), member_out_ag(z0)) → MEMBERS_IN_AG(.(z0, z1))
U6_AG(.(z0, z1), member_out_ag(x1)) → MEMBERS_IN_AG(.(z0, z1))

The TRS R consists of the following rules:

member_in_ag(.(X, X1)) → member_out_ag(X)
member_in_ag(.(X2, T)) → U8_ag(member_in_ag(T))
U8_ag(member_out_ag(X)) → member_out_ag(X)

The set Q consists of the following terms:

member_in_ag(x0)
U8_ag(x0)

We have to consider all (P,Q,R)-chains.

(65) NonTerminationProof (EQUIVALENT transformation)

We used the non-termination processor [FROCOS05] to show that the DP problem is infinite.
Found a loop by narrowing to the left:

s = U6_AG(.(z0, z1), member_out_ag(z0)) evaluates to t =U6_AG(.(z0, z1), member_out_ag(z0))

Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
  • Semiunifier: [ ]
  • Matcher: [ ]




Rewriting sequence

U6_AG(.(z0, z1), member_out_ag(z0))MEMBERS_IN_AG(.(z0, z1))
with rule U6_AG(.(z0', z1'), member_out_ag(z0')) → MEMBERS_IN_AG(.(z0', z1')) at position [] and matcher [z0' / z0, z1' / z1]

MEMBERS_IN_AG(.(z0, z1))U6_AG(.(z0, z1), member_out_ag(z0))
with rule MEMBERS_IN_AG(.(x0, x1)) → U6_AG(.(x0, x1), member_out_ag(x0))

Now applying the matcher to the start term leads to a term which is equal to the last term in the rewriting sequence


All these steps are and every following step will be a correct step w.r.t to Q.



(66) FALSE

(67) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → SELECT_IN_AGA(X, Ys, Zs)

The TRS R consists of the following rules:

color_map_in_ag(l(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag(nil, Colors) → color_map_out_ag(nil, Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(l(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1)
l(x1, x2)  =  l(x1, x2)
SELECT_IN_AGA(x1, x2, x3)  =  SELECT_IN_AGA(x2)

We have to consider all (P,R,Pi)-chains

(68) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(69) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

SELECT_IN_AGA(X, .(Y, Ys), .(Y, Zs)) → SELECT_IN_AGA(X, Ys, Zs)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
SELECT_IN_AGA(x1, x2, x3)  =  SELECT_IN_AGA(x2)

We have to consider all (P,R,Pi)-chains

(70) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(71) Obligation:

Q DP problem:
The TRS P consists of the following rules:

SELECT_IN_AGA(.(Y, Ys)) → SELECT_IN_AGA(Ys)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(72) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • SELECT_IN_AGA(.(Y, Ys)) → SELECT_IN_AGA(Ys)
    The graph contains the following edges 1 > 1

(73) TRUE

(74) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Regions, Colors)
COLOR_MAP_IN_AG(l(Region, Regions), Colors) → U1_AG(Region, Regions, Colors, color_region_in_ag(Region, Colors))

The TRS R consists of the following rules:

color_map_in_ag(l(Region, Regions), Colors) → U1_ag(Region, Regions, Colors, color_region_in_ag(Region, Colors))
color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U1_ag(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → U2_ag(Region, Regions, Colors, color_map_in_ag(Regions, Colors))
color_map_in_ag(nil, Colors) → color_map_out_ag(nil, Colors)
U2_ag(Region, Regions, Colors, color_map_out_ag(Regions, Colors)) → color_map_out_ag(l(Region, Regions), Colors)

The argument filtering Pi contains the following mapping:
color_map_in_ag(x1, x2)  =  color_map_in_ag(x2)
U1_ag(x1, x2, x3, x4)  =  U1_ag(x3, x4)
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
U2_ag(x1, x2, x3, x4)  =  U2_ag(x1, x4)
color_map_out_ag(x1, x2)  =  color_map_out_ag(x1)
l(x1, x2)  =  l(x1, x2)
COLOR_MAP_IN_AG(x1, x2)  =  COLOR_MAP_IN_AG(x2)
U1_AG(x1, x2, x3, x4)  =  U1_AG(x3, x4)

We have to consider all (P,R,Pi)-chains

(75) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(76) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

U1_AG(Region, Regions, Colors, color_region_out_ag(Region, Colors)) → COLOR_MAP_IN_AG(Regions, Colors)
COLOR_MAP_IN_AG(l(Region, Regions), Colors) → U1_AG(Region, Regions, Colors, color_region_in_ag(Region, Colors))

The TRS R consists of the following rules:

color_region_in_ag(region(Name, Color, Neighbors), Colors) → U3_ag(Name, Color, Neighbors, Colors, select_in_aga(Color, Colors, Colors1))
U3_ag(Name, Color, Neighbors, Colors, select_out_aga(Color, Colors, Colors1)) → U4_ag(Name, Color, Neighbors, Colors, members_in_ag(Neighbors, Colors1))
select_in_aga(X, .(X, Xs), Xs) → select_out_aga(X, .(X, Xs), Xs)
select_in_aga(X, .(Y, Ys), .(Y, Zs)) → U5_aga(X, Y, Ys, Zs, select_in_aga(X, Ys, Zs))
U4_ag(Name, Color, Neighbors, Colors, members_out_ag(Neighbors, Colors1)) → color_region_out_ag(region(Name, Color, Neighbors), Colors)
U5_aga(X, Y, Ys, Zs, select_out_aga(X, Ys, Zs)) → select_out_aga(X, .(Y, Ys), .(Y, Zs))
members_in_ag(.(X, Xs), Ys) → U6_ag(X, Xs, Ys, member_in_ag(X, Ys))
members_in_ag([], Ys) → members_out_ag([], Ys)
U6_ag(X, Xs, Ys, member_out_ag(X, Ys)) → U7_ag(X, Xs, Ys, members_in_ag(Xs, Ys))
member_in_ag(X, .(X, X1)) → member_out_ag(X, .(X, X1))
member_in_ag(X, .(X2, T)) → U8_ag(X, X2, T, member_in_ag(X, T))
U7_ag(X, Xs, Ys, members_out_ag(Xs, Ys)) → members_out_ag(.(X, Xs), Ys)
U8_ag(X, X2, T, member_out_ag(X, T)) → member_out_ag(X, .(X2, T))

The argument filtering Pi contains the following mapping:
color_region_in_ag(x1, x2)  =  color_region_in_ag(x2)
U3_ag(x1, x2, x3, x4, x5)  =  U3_ag(x5)
select_in_aga(x1, x2, x3)  =  select_in_aga(x2)
.(x1, x2)  =  .(x1, x2)
select_out_aga(x1, x2, x3)  =  select_out_aga(x1, x3)
U5_aga(x1, x2, x3, x4, x5)  =  U5_aga(x2, x5)
U4_ag(x1, x2, x3, x4, x5)  =  U4_ag(x2, x5)
members_in_ag(x1, x2)  =  members_in_ag(x2)
U6_ag(x1, x2, x3, x4)  =  U6_ag(x3, x4)
member_in_ag(x1, x2)  =  member_in_ag(x2)
member_out_ag(x1, x2)  =  member_out_ag(x1)
U8_ag(x1, x2, x3, x4)  =  U8_ag(x4)
U7_ag(x1, x2, x3, x4)  =  U7_ag(x1, x4)
members_out_ag(x1, x2)  =  members_out_ag(x1)
color_region_out_ag(x1, x2)  =  color_region_out_ag(x1)
region(x1, x2, x3)  =  region(x2, x3)
l(x1, x2)  =  l(x1, x2)
COLOR_MAP_IN_AG(x1, x2)  =  COLOR_MAP_IN_AG(x2)
U1_AG(x1, x2, x3, x4)  =  U1_AG(x3, x4)

We have to consider all (P,R,Pi)-chains

(77) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(78) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U1_AG(Colors, color_region_out_ag(Region)) → COLOR_MAP_IN_AG(Colors)
COLOR_MAP_IN_AG(Colors) → U1_AG(Colors, color_region_in_ag(Colors))

The TRS R consists of the following rules:

color_region_in_ag(Colors) → U3_ag(select_in_aga(Colors))
U3_ag(select_out_aga(Color, Colors1)) → U4_ag(Color, members_in_ag(Colors1))
select_in_aga(.(X, Xs)) → select_out_aga(X, Xs)
select_in_aga(.(Y, Ys)) → U5_aga(Y, select_in_aga(Ys))
U4_ag(Color, members_out_ag(Neighbors)) → color_region_out_ag(region(Color, Neighbors))
U5_aga(Y, select_out_aga(X, Zs)) → select_out_aga(X, .(Y, Zs))
members_in_ag(Ys) → U6_ag(Ys, member_in_ag(Ys))
members_in_ag(Ys) → members_out_ag([])
U6_ag(Ys, member_out_ag(X)) → U7_ag(X, members_in_ag(Ys))
member_in_ag(.(X, X1)) → member_out_ag(X)
member_in_ag(.(X2, T)) → U8_ag(member_in_ag(T))
U7_ag(X, members_out_ag(Xs)) → members_out_ag(.(X, Xs))
U8_ag(member_out_ag(X)) → member_out_ag(X)

The set Q consists of the following terms:

color_region_in_ag(x0)
U3_ag(x0)
select_in_aga(x0)
U4_ag(x0, x1)
U5_aga(x0, x1)
members_in_ag(x0)
U6_ag(x0, x1)
member_in_ag(x0)
U7_ag(x0, x1)
U8_ag(x0)

We have to consider all (P,Q,R)-chains.

(79) Narrowing (SOUND transformation)

By narrowing [LPAR04] the rule COLOR_MAP_IN_AG(Colors) → U1_AG(Colors, color_region_in_ag(Colors)) at position [1] we obtained the following new rules [LPAR04]:

COLOR_MAP_IN_AG(x0) → U1_AG(x0, U3_ag(select_in_aga(x0)))

(80) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U1_AG(Colors, color_region_out_ag(Region)) → COLOR_MAP_IN_AG(Colors)
COLOR_MAP_IN_AG(x0) → U1_AG(x0, U3_ag(select_in_aga(x0)))

The TRS R consists of the following rules:

color_region_in_ag(Colors) → U3_ag(select_in_aga(Colors))
U3_ag(select_out_aga(Color, Colors1)) → U4_ag(Color, members_in_ag(Colors1))
select_in_aga(.(X, Xs)) → select_out_aga(X, Xs)
select_in_aga(.(Y, Ys)) → U5_aga(Y, select_in_aga(Ys))
U4_ag(Color, members_out_ag(Neighbors)) → color_region_out_ag(region(Color, Neighbors))
U5_aga(Y, select_out_aga(X, Zs)) → select_out_aga(X, .(Y, Zs))
members_in_ag(Ys) → U6_ag(Ys, member_in_ag(Ys))
members_in_ag(Ys) → members_out_ag([])
U6_ag(Ys, member_out_ag(X)) → U7_ag(X, members_in_ag(Ys))
member_in_ag(.(X, X1)) → member_out_ag(X)
member_in_ag(.(X2, T)) → U8_ag(member_in_ag(T))
U7_ag(X, members_out_ag(Xs)) → members_out_ag(.(X, Xs))
U8_ag(member_out_ag(X)) → member_out_ag(X)

The set Q consists of the following terms:

color_region_in_ag(x0)
U3_ag(x0)
select_in_aga(x0)
U4_ag(x0, x1)
U5_aga(x0, x1)
members_in_ag(x0)
U6_ag(x0, x1)
member_in_ag(x0)
U7_ag(x0, x1)
U8_ag(x0)

We have to consider all (P,Q,R)-chains.

(81) UsableRulesProof (EQUIVALENT transformation)

As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [LPAR04] we can delete all non-usable rules [FROCOS05] from R.

(82) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U1_AG(Colors, color_region_out_ag(Region)) → COLOR_MAP_IN_AG(Colors)
COLOR_MAP_IN_AG(x0) → U1_AG(x0, U3_ag(select_in_aga(x0)))

The TRS R consists of the following rules:

select_in_aga(.(X, Xs)) → select_out_aga(X, Xs)
select_in_aga(.(Y, Ys)) → U5_aga(Y, select_in_aga(Ys))
U3_ag(select_out_aga(Color, Colors1)) → U4_ag(Color, members_in_ag(Colors1))
members_in_ag(Ys) → U6_ag(Ys, member_in_ag(Ys))
members_in_ag(Ys) → members_out_ag([])
U4_ag(Color, members_out_ag(Neighbors)) → color_region_out_ag(region(Color, Neighbors))
member_in_ag(.(X, X1)) → member_out_ag(X)
member_in_ag(.(X2, T)) → U8_ag(member_in_ag(T))
U6_ag(Ys, member_out_ag(X)) → U7_ag(X, members_in_ag(Ys))
U7_ag(X, members_out_ag(Xs)) → members_out_ag(.(X, Xs))
U8_ag(member_out_ag(X)) → member_out_ag(X)
U5_aga(Y, select_out_aga(X, Zs)) → select_out_aga(X, .(Y, Zs))

The set Q consists of the following terms:

color_region_in_ag(x0)
U3_ag(x0)
select_in_aga(x0)
U4_ag(x0, x1)
U5_aga(x0, x1)
members_in_ag(x0)
U6_ag(x0, x1)
member_in_ag(x0)
U7_ag(x0, x1)
U8_ag(x0)

We have to consider all (P,Q,R)-chains.

(83) QReductionProof (EQUIVALENT transformation)

We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.[THIEMANN].

color_region_in_ag(x0)

(84) Obligation:

Q DP problem:
The TRS P consists of the following rules:

U1_AG(Colors, color_region_out_ag(Region)) → COLOR_MAP_IN_AG(Colors)
COLOR_MAP_IN_AG(x0) → U1_AG(x0, U3_ag(select_in_aga(x0)))

The TRS R consists of the following rules:

select_in_aga(.(X, Xs)) → select_out_aga(X, Xs)
select_in_aga(.(Y, Ys)) → U5_aga(Y, select_in_aga(Ys))
U3_ag(select_out_aga(Color, Colors1)) → U4_ag(Color, members_in_ag(Colors1))
members_in_ag(Ys) → U6_ag(Ys, member_in_ag(Ys))
members_in_ag(Ys) → members_out_ag([])
U4_ag(Color, members_out_ag(Neighbors)) → color_region_out_ag(region(Color, Neighbors))
member_in_ag(.(X, X1)) → member_out_ag(X)
member_in_ag(.(X2, T)) → U8_ag(member_in_ag(T))
U6_ag(Ys, member_out_ag(X)) → U7_ag(X, members_in_ag(Ys))
U7_ag(X, members_out_ag(Xs)) → members_out_ag(.(X, Xs))
U8_ag(member_out_ag(X)) → member_out_ag(X)
U5_aga(Y, select_out_aga(X, Zs)) → select_out_aga(X, .(Y, Zs))

The set Q consists of the following terms:

U3_ag(x0)
select_in_aga(x0)
U4_ag(x0, x1)
U5_aga(x0, x1)
members_in_ag(x0)
U6_ag(x0, x1)
member_in_ag(x0)
U7_ag(x0, x1)
U8_ag(x0)

We have to consider all (P,Q,R)-chains.