(0) Obligation:
Clauses:
prime_fact(0, L) :- ','(!, eq(L, [])).
prime_fact(s(0), L) :- ','(!, eq(L, [])).
prime_fact(X, .(F, Fs)) :- ','(prime_number(P), ','(div(X, P, Q, 0), ','(!, ','(eq(F, P), prime_fact(Q, Fs))))).
prime_number(X) :- prime_number(s(s(0)), [], X).
prime_number(C, Ps, C) :- no_divisor_in_list(C, Ps).
prime_number(C, Ps, P) :- ','(no_divisor_in_list(C, Ps), ','(!, prime_number(s(C), .(C, Ps), P))).
prime_number(C, Ps, P) :- prime_number(s(C), Ps, P).
no_divisor_in_list(X1, []).
no_divisor_in_list(V, .(D, Ds)) :- ','(not_div(V, D), no_divisor_in_list(V, Ds)).
not_div(V, D) :- ','(div(V, D, X2, 0), ','(!, failure(a))).
not_div(X3, X4).
failure(b).
div(X5, 0, X6, X7) :- ','(!, failure(a)).
div(0, X8, Z, R) :- ','(!, ','(eq(Z, 0), eq(R, 0))).
div(X, Y, s(Z), R) :- ','(minus(X, Y, U), ','(!, div(U, Y, Z, R))).
div(X, X9, X10, X).
minus(X, 0, X).
minus(s(X), s(Y), Z) :- minus(X, Y, Z).
eq(X, X).
Queries:
prime_fact(g,a).
(1) CutEliminatorProof (SOUND transformation)
Eliminated all cuts by simply ignoring them[PROLOG].
(2) Obligation:
Clauses:
prime_fact(0, L) :- eq(L, []).
prime_fact(s(0), L) :- eq(L, []).
prime_fact(X, .(F, Fs)) :- ','(prime_number(P), ','(div(X, P, Q, 0), ','(eq(F, P), prime_fact(Q, Fs)))).
prime_number(X) :- prime_number(s(s(0)), [], X).
prime_number(C, Ps, C) :- no_divisor_in_list(C, Ps).
prime_number(C, Ps, P) :- ','(no_divisor_in_list(C, Ps), prime_number(s(C), .(C, Ps), P)).
prime_number(C, Ps, P) :- prime_number(s(C), Ps, P).
no_divisor_in_list(X1, []).
no_divisor_in_list(V, .(D, Ds)) :- ','(not_div(V, D), no_divisor_in_list(V, Ds)).
not_div(V, D) :- ','(div(V, D, X2, 0), failure(a)).
not_div(X3, X4).
failure(b).
div(X5, 0, X6, X7) :- failure(a).
div(0, X8, Z, R) :- ','(eq(Z, 0), eq(R, 0)).
div(X, Y, s(Z), R) :- ','(minus(X, Y, U), div(U, Y, Z, R)).
div(X, X9, X10, X).
minus(X, 0, X).
minus(s(X), s(Y), Z) :- minus(X, Y, Z).
eq(X, X).
Queries:
prime_fact(g,a).
(3) PrologToPiTRSProof (SOUND transformation)
We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
prime_fact_in: (b,f) (f,f)
prime_number_in: (f)
prime_number_in: (b,b,f)
no_divisor_in_list_in: (b,b)
not_div_in: (b,b)
div_in: (b,b,f,b) (f,b,f,b)
minus_in: (b,b,f) (f,b,f)
Transforming
Prolog into the following
Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1,
x2)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x1,
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x2,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x2,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x1,
x2,
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x1,
x3,
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag(
x1,
x2,
x4)
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x1,
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x1,
x3,
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg(
x1,
x2)
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x1,
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x1,
x2,
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x1,
x2,
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x1,
x2,
x4,
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x1,
x2,
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg(
x1,
x2)
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x1,
x2,
x3,
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x1,
x2,
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x1,
x2,
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x1,
x2,
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x1,
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x1,
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x1,
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x3,
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag(
x2,
x4)
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x1,
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x1,
x3,
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga(
x2)
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x2,
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x2,
x4,
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
(4) Obligation:
Pi-finite rewrite system:
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1,
x2)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x1,
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x2,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x2,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x1,
x2,
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x1,
x3,
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag(
x1,
x2,
x4)
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x1,
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x1,
x3,
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg(
x1,
x2)
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x1,
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x1,
x2,
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x1,
x2,
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x1,
x2,
x4,
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x1,
x2,
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg(
x1,
x2)
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x1,
x2,
x3,
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x1,
x2,
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x1,
x2,
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x1,
x2,
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x1,
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x1,
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x1,
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x3,
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag(
x2,
x4)
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x1,
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x1,
x3,
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga(
x2)
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x2,
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x2,
x4,
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
(5) 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:
PRIME_FACT_IN_GA(0, L) → U1_GA(L, eq_in_ag(L, []))
PRIME_FACT_IN_GA(0, L) → EQ_IN_AG(L, [])
PRIME_FACT_IN_GA(s(0), L) → U2_GA(L, eq_in_ag(L, []))
PRIME_FACT_IN_GA(s(0), L) → EQ_IN_AG(L, [])
PRIME_FACT_IN_GA(X, .(F, Fs)) → U3_GA(X, F, Fs, prime_number_in_a(P))
PRIME_FACT_IN_GA(X, .(F, Fs)) → PRIME_NUMBER_IN_A(P)
PRIME_NUMBER_IN_A(X) → U7_A(X, prime_number_in_gga(s(s(0)), [], X))
PRIME_NUMBER_IN_A(X) → PRIME_NUMBER_IN_GGA(s(s(0)), [], X)
PRIME_NUMBER_IN_GGA(C, Ps, C) → U8_GGA(C, Ps, no_divisor_in_list_in_gg(C, Ps))
PRIME_NUMBER_IN_GGA(C, Ps, C) → NO_DIVISOR_IN_LIST_IN_GG(C, Ps)
NO_DIVISOR_IN_LIST_IN_GG(V, .(D, Ds)) → U12_GG(V, D, Ds, not_div_in_gg(V, D))
NO_DIVISOR_IN_LIST_IN_GG(V, .(D, Ds)) → NOT_DIV_IN_GG(V, D)
NOT_DIV_IN_GG(V, D) → U14_GG(V, D, div_in_ggag(V, D, X2, 0))
NOT_DIV_IN_GG(V, D) → DIV_IN_GGAG(V, D, X2, 0)
DIV_IN_GGAG(X5, 0, X6, X7) → U16_GGAG(X5, X6, X7, failure_in_g(a))
DIV_IN_GGAG(X5, 0, X6, X7) → FAILURE_IN_G(a)
DIV_IN_GGAG(0, X8, Z, R) → U17_GGAG(X8, Z, R, eq_in_ag(Z, 0))
DIV_IN_GGAG(0, X8, Z, R) → EQ_IN_AG(Z, 0)
U17_GGAG(X8, Z, R, eq_out_ag(Z, 0)) → U18_GGAG(X8, Z, R, eq_in_gg(R, 0))
U17_GGAG(X8, Z, R, eq_out_ag(Z, 0)) → EQ_IN_GG(R, 0)
DIV_IN_GGAG(X, Y, s(Z), R) → U19_GGAG(X, Y, Z, R, minus_in_gga(X, Y, U))
DIV_IN_GGAG(X, Y, s(Z), R) → MINUS_IN_GGA(X, Y, U)
MINUS_IN_GGA(s(X), s(Y), Z) → U21_GGA(X, Y, Z, minus_in_gga(X, Y, Z))
MINUS_IN_GGA(s(X), s(Y), Z) → MINUS_IN_GGA(X, Y, Z)
U19_GGAG(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_GGAG(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
U19_GGAG(X, Y, Z, R, minus_out_gga(X, Y, U)) → DIV_IN_GGAG(U, Y, Z, R)
U14_GG(V, D, div_out_ggag(V, D, X2, 0)) → U15_GG(V, D, failure_in_g(a))
U14_GG(V, D, div_out_ggag(V, D, X2, 0)) → FAILURE_IN_G(a)
U12_GG(V, D, Ds, not_div_out_gg(V, D)) → U13_GG(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U12_GG(V, D, Ds, not_div_out_gg(V, D)) → NO_DIVISOR_IN_LIST_IN_GG(V, Ds)
PRIME_NUMBER_IN_GGA(C, Ps, P) → U9_GGA(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
PRIME_NUMBER_IN_GGA(C, Ps, P) → NO_DIVISOR_IN_LIST_IN_GG(C, Ps)
U9_GGA(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_GGA(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
U9_GGA(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → PRIME_NUMBER_IN_GGA(s(C), .(C, Ps), P)
PRIME_NUMBER_IN_GGA(C, Ps, P) → U11_GGA(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
PRIME_NUMBER_IN_GGA(C, Ps, P) → PRIME_NUMBER_IN_GGA(s(C), Ps, P)
U3_GA(X, F, Fs, prime_number_out_a(P)) → U4_GA(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U3_GA(X, F, Fs, prime_number_out_a(P)) → DIV_IN_GGAG(X, P, Q, 0)
U4_GA(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_GA(X, F, Fs, Q, eq_in_ag(F, P))
U4_GA(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → EQ_IN_AG(F, P)
U5_GA(X, F, Fs, Q, eq_out_ag(F, P)) → U6_GA(X, F, Fs, prime_fact_in_aa(Q, Fs))
U5_GA(X, F, Fs, Q, eq_out_ag(F, P)) → PRIME_FACT_IN_AA(Q, Fs)
PRIME_FACT_IN_AA(0, L) → U1_AA(L, eq_in_ag(L, []))
PRIME_FACT_IN_AA(0, L) → EQ_IN_AG(L, [])
PRIME_FACT_IN_AA(s(0), L) → U2_AA(L, eq_in_ag(L, []))
PRIME_FACT_IN_AA(s(0), L) → EQ_IN_AG(L, [])
PRIME_FACT_IN_AA(X, .(F, Fs)) → U3_AA(X, F, Fs, prime_number_in_a(P))
PRIME_FACT_IN_AA(X, .(F, Fs)) → PRIME_NUMBER_IN_A(P)
U3_AA(X, F, Fs, prime_number_out_a(P)) → U4_AA(X, F, Fs, P, div_in_agag(X, P, Q, 0))
U3_AA(X, F, Fs, prime_number_out_a(P)) → DIV_IN_AGAG(X, P, Q, 0)
DIV_IN_AGAG(X5, 0, X6, X7) → U16_AGAG(X5, X6, X7, failure_in_g(a))
DIV_IN_AGAG(X5, 0, X6, X7) → FAILURE_IN_G(a)
DIV_IN_AGAG(0, X8, Z, R) → U17_AGAG(X8, Z, R, eq_in_ag(Z, 0))
DIV_IN_AGAG(0, X8, Z, R) → EQ_IN_AG(Z, 0)
U17_AGAG(X8, Z, R, eq_out_ag(Z, 0)) → U18_AGAG(X8, Z, R, eq_in_gg(R, 0))
U17_AGAG(X8, Z, R, eq_out_ag(Z, 0)) → EQ_IN_GG(R, 0)
DIV_IN_AGAG(X, Y, s(Z), R) → U19_AGAG(X, Y, Z, R, minus_in_aga(X, Y, U))
DIV_IN_AGAG(X, Y, s(Z), R) → MINUS_IN_AGA(X, Y, U)
MINUS_IN_AGA(s(X), s(Y), Z) → U21_AGA(X, Y, Z, minus_in_aga(X, Y, Z))
MINUS_IN_AGA(s(X), s(Y), Z) → MINUS_IN_AGA(X, Y, Z)
U19_AGAG(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_AGAG(X, Y, Z, R, div_in_agag(U, Y, Z, R))
U19_AGAG(X, Y, Z, R, minus_out_aga(X, Y, U)) → DIV_IN_AGAG(U, Y, Z, R)
U4_AA(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_AA(X, F, Fs, Q, eq_in_ag(F, P))
U4_AA(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → EQ_IN_AG(F, P)
U5_AA(X, F, Fs, Q, eq_out_ag(F, P)) → U6_AA(X, F, Fs, prime_fact_in_aa(Q, Fs))
U5_AA(X, F, Fs, Q, eq_out_ag(F, P)) → PRIME_FACT_IN_AA(Q, Fs)
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1,
x2)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x1,
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x2,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x2,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x1,
x2,
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x1,
x3,
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag(
x1,
x2,
x4)
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x1,
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x1,
x3,
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg(
x1,
x2)
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x1,
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x1,
x2,
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x1,
x2,
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x1,
x2,
x4,
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x1,
x2,
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg(
x1,
x2)
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x1,
x2,
x3,
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x1,
x2,
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x1,
x2,
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x1,
x2,
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x1,
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x1,
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x1,
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x3,
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag(
x2,
x4)
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x1,
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x1,
x3,
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga(
x2)
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x2,
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x2,
x4,
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
PRIME_FACT_IN_GA(
x1,
x2) =
PRIME_FACT_IN_GA(
x1)
U1_GA(
x1,
x2) =
U1_GA(
x2)
EQ_IN_AG(
x1,
x2) =
EQ_IN_AG(
x2)
U2_GA(
x1,
x2) =
U2_GA(
x2)
U3_GA(
x1,
x2,
x3,
x4) =
U3_GA(
x1,
x4)
PRIME_NUMBER_IN_A(
x1) =
PRIME_NUMBER_IN_A
U7_A(
x1,
x2) =
U7_A(
x2)
PRIME_NUMBER_IN_GGA(
x1,
x2,
x3) =
PRIME_NUMBER_IN_GGA(
x1,
x2)
U8_GGA(
x1,
x2,
x3) =
U8_GGA(
x1,
x2,
x3)
NO_DIVISOR_IN_LIST_IN_GG(
x1,
x2) =
NO_DIVISOR_IN_LIST_IN_GG(
x1,
x2)
U12_GG(
x1,
x2,
x3,
x4) =
U12_GG(
x1,
x2,
x3,
x4)
NOT_DIV_IN_GG(
x1,
x2) =
NOT_DIV_IN_GG(
x1,
x2)
U14_GG(
x1,
x2,
x3) =
U14_GG(
x1,
x2,
x3)
DIV_IN_GGAG(
x1,
x2,
x3,
x4) =
DIV_IN_GGAG(
x1,
x2,
x4)
U16_GGAG(
x1,
x2,
x3,
x4) =
U16_GGAG(
x1,
x3,
x4)
FAILURE_IN_G(
x1) =
FAILURE_IN_G(
x1)
U17_GGAG(
x1,
x2,
x3,
x4) =
U17_GGAG(
x1,
x3,
x4)
U18_GGAG(
x1,
x2,
x3,
x4) =
U18_GGAG(
x1,
x3,
x4)
EQ_IN_GG(
x1,
x2) =
EQ_IN_GG(
x1,
x2)
U19_GGAG(
x1,
x2,
x3,
x4,
x5) =
U19_GGAG(
x1,
x2,
x4,
x5)
MINUS_IN_GGA(
x1,
x2,
x3) =
MINUS_IN_GGA(
x1,
x2)
U21_GGA(
x1,
x2,
x3,
x4) =
U21_GGA(
x1,
x2,
x4)
U20_GGAG(
x1,
x2,
x3,
x4,
x5) =
U20_GGAG(
x1,
x2,
x4,
x5)
U15_GG(
x1,
x2,
x3) =
U15_GG(
x1,
x2,
x3)
U13_GG(
x1,
x2,
x3,
x4) =
U13_GG(
x1,
x2,
x3,
x4)
U9_GGA(
x1,
x2,
x3,
x4) =
U9_GGA(
x1,
x2,
x4)
U10_GGA(
x1,
x2,
x3,
x4) =
U10_GGA(
x1,
x2,
x4)
U11_GGA(
x1,
x2,
x3,
x4) =
U11_GGA(
x1,
x2,
x4)
U4_GA(
x1,
x2,
x3,
x4,
x5) =
U4_GA(
x1,
x4,
x5)
U5_GA(
x1,
x2,
x3,
x4,
x5) =
U5_GA(
x1,
x5)
U6_GA(
x1,
x2,
x3,
x4) =
U6_GA(
x1,
x2,
x4)
PRIME_FACT_IN_AA(
x1,
x2) =
PRIME_FACT_IN_AA
U1_AA(
x1,
x2) =
U1_AA(
x2)
U2_AA(
x1,
x2) =
U2_AA(
x2)
U3_AA(
x1,
x2,
x3,
x4) =
U3_AA(
x4)
U4_AA(
x1,
x2,
x3,
x4,
x5) =
U4_AA(
x4,
x5)
DIV_IN_AGAG(
x1,
x2,
x3,
x4) =
DIV_IN_AGAG(
x2,
x4)
U16_AGAG(
x1,
x2,
x3,
x4) =
U16_AGAG(
x3,
x4)
U17_AGAG(
x1,
x2,
x3,
x4) =
U17_AGAG(
x1,
x3,
x4)
U18_AGAG(
x1,
x2,
x3,
x4) =
U18_AGAG(
x1,
x3,
x4)
U19_AGAG(
x1,
x2,
x3,
x4,
x5) =
U19_AGAG(
x2,
x4,
x5)
MINUS_IN_AGA(
x1,
x2,
x3) =
MINUS_IN_AGA(
x2)
U21_AGA(
x1,
x2,
x3,
x4) =
U21_AGA(
x2,
x4)
U20_AGAG(
x1,
x2,
x3,
x4,
x5) =
U20_AGAG(
x2,
x4,
x5)
U5_AA(
x1,
x2,
x3,
x4,
x5) =
U5_AA(
x5)
U6_AA(
x1,
x2,
x3,
x4) =
U6_AA(
x2,
x4)
We have to consider all (P,R,Pi)-chains
(6) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
PRIME_FACT_IN_GA(0, L) → U1_GA(L, eq_in_ag(L, []))
PRIME_FACT_IN_GA(0, L) → EQ_IN_AG(L, [])
PRIME_FACT_IN_GA(s(0), L) → U2_GA(L, eq_in_ag(L, []))
PRIME_FACT_IN_GA(s(0), L) → EQ_IN_AG(L, [])
PRIME_FACT_IN_GA(X, .(F, Fs)) → U3_GA(X, F, Fs, prime_number_in_a(P))
PRIME_FACT_IN_GA(X, .(F, Fs)) → PRIME_NUMBER_IN_A(P)
PRIME_NUMBER_IN_A(X) → U7_A(X, prime_number_in_gga(s(s(0)), [], X))
PRIME_NUMBER_IN_A(X) → PRIME_NUMBER_IN_GGA(s(s(0)), [], X)
PRIME_NUMBER_IN_GGA(C, Ps, C) → U8_GGA(C, Ps, no_divisor_in_list_in_gg(C, Ps))
PRIME_NUMBER_IN_GGA(C, Ps, C) → NO_DIVISOR_IN_LIST_IN_GG(C, Ps)
NO_DIVISOR_IN_LIST_IN_GG(V, .(D, Ds)) → U12_GG(V, D, Ds, not_div_in_gg(V, D))
NO_DIVISOR_IN_LIST_IN_GG(V, .(D, Ds)) → NOT_DIV_IN_GG(V, D)
NOT_DIV_IN_GG(V, D) → U14_GG(V, D, div_in_ggag(V, D, X2, 0))
NOT_DIV_IN_GG(V, D) → DIV_IN_GGAG(V, D, X2, 0)
DIV_IN_GGAG(X5, 0, X6, X7) → U16_GGAG(X5, X6, X7, failure_in_g(a))
DIV_IN_GGAG(X5, 0, X6, X7) → FAILURE_IN_G(a)
DIV_IN_GGAG(0, X8, Z, R) → U17_GGAG(X8, Z, R, eq_in_ag(Z, 0))
DIV_IN_GGAG(0, X8, Z, R) → EQ_IN_AG(Z, 0)
U17_GGAG(X8, Z, R, eq_out_ag(Z, 0)) → U18_GGAG(X8, Z, R, eq_in_gg(R, 0))
U17_GGAG(X8, Z, R, eq_out_ag(Z, 0)) → EQ_IN_GG(R, 0)
DIV_IN_GGAG(X, Y, s(Z), R) → U19_GGAG(X, Y, Z, R, minus_in_gga(X, Y, U))
DIV_IN_GGAG(X, Y, s(Z), R) → MINUS_IN_GGA(X, Y, U)
MINUS_IN_GGA(s(X), s(Y), Z) → U21_GGA(X, Y, Z, minus_in_gga(X, Y, Z))
MINUS_IN_GGA(s(X), s(Y), Z) → MINUS_IN_GGA(X, Y, Z)
U19_GGAG(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_GGAG(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
U19_GGAG(X, Y, Z, R, minus_out_gga(X, Y, U)) → DIV_IN_GGAG(U, Y, Z, R)
U14_GG(V, D, div_out_ggag(V, D, X2, 0)) → U15_GG(V, D, failure_in_g(a))
U14_GG(V, D, div_out_ggag(V, D, X2, 0)) → FAILURE_IN_G(a)
U12_GG(V, D, Ds, not_div_out_gg(V, D)) → U13_GG(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U12_GG(V, D, Ds, not_div_out_gg(V, D)) → NO_DIVISOR_IN_LIST_IN_GG(V, Ds)
PRIME_NUMBER_IN_GGA(C, Ps, P) → U9_GGA(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
PRIME_NUMBER_IN_GGA(C, Ps, P) → NO_DIVISOR_IN_LIST_IN_GG(C, Ps)
U9_GGA(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_GGA(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
U9_GGA(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → PRIME_NUMBER_IN_GGA(s(C), .(C, Ps), P)
PRIME_NUMBER_IN_GGA(C, Ps, P) → U11_GGA(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
PRIME_NUMBER_IN_GGA(C, Ps, P) → PRIME_NUMBER_IN_GGA(s(C), Ps, P)
U3_GA(X, F, Fs, prime_number_out_a(P)) → U4_GA(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U3_GA(X, F, Fs, prime_number_out_a(P)) → DIV_IN_GGAG(X, P, Q, 0)
U4_GA(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_GA(X, F, Fs, Q, eq_in_ag(F, P))
U4_GA(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → EQ_IN_AG(F, P)
U5_GA(X, F, Fs, Q, eq_out_ag(F, P)) → U6_GA(X, F, Fs, prime_fact_in_aa(Q, Fs))
U5_GA(X, F, Fs, Q, eq_out_ag(F, P)) → PRIME_FACT_IN_AA(Q, Fs)
PRIME_FACT_IN_AA(0, L) → U1_AA(L, eq_in_ag(L, []))
PRIME_FACT_IN_AA(0, L) → EQ_IN_AG(L, [])
PRIME_FACT_IN_AA(s(0), L) → U2_AA(L, eq_in_ag(L, []))
PRIME_FACT_IN_AA(s(0), L) → EQ_IN_AG(L, [])
PRIME_FACT_IN_AA(X, .(F, Fs)) → U3_AA(X, F, Fs, prime_number_in_a(P))
PRIME_FACT_IN_AA(X, .(F, Fs)) → PRIME_NUMBER_IN_A(P)
U3_AA(X, F, Fs, prime_number_out_a(P)) → U4_AA(X, F, Fs, P, div_in_agag(X, P, Q, 0))
U3_AA(X, F, Fs, prime_number_out_a(P)) → DIV_IN_AGAG(X, P, Q, 0)
DIV_IN_AGAG(X5, 0, X6, X7) → U16_AGAG(X5, X6, X7, failure_in_g(a))
DIV_IN_AGAG(X5, 0, X6, X7) → FAILURE_IN_G(a)
DIV_IN_AGAG(0, X8, Z, R) → U17_AGAG(X8, Z, R, eq_in_ag(Z, 0))
DIV_IN_AGAG(0, X8, Z, R) → EQ_IN_AG(Z, 0)
U17_AGAG(X8, Z, R, eq_out_ag(Z, 0)) → U18_AGAG(X8, Z, R, eq_in_gg(R, 0))
U17_AGAG(X8, Z, R, eq_out_ag(Z, 0)) → EQ_IN_GG(R, 0)
DIV_IN_AGAG(X, Y, s(Z), R) → U19_AGAG(X, Y, Z, R, minus_in_aga(X, Y, U))
DIV_IN_AGAG(X, Y, s(Z), R) → MINUS_IN_AGA(X, Y, U)
MINUS_IN_AGA(s(X), s(Y), Z) → U21_AGA(X, Y, Z, minus_in_aga(X, Y, Z))
MINUS_IN_AGA(s(X), s(Y), Z) → MINUS_IN_AGA(X, Y, Z)
U19_AGAG(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_AGAG(X, Y, Z, R, div_in_agag(U, Y, Z, R))
U19_AGAG(X, Y, Z, R, minus_out_aga(X, Y, U)) → DIV_IN_AGAG(U, Y, Z, R)
U4_AA(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_AA(X, F, Fs, Q, eq_in_ag(F, P))
U4_AA(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → EQ_IN_AG(F, P)
U5_AA(X, F, Fs, Q, eq_out_ag(F, P)) → U6_AA(X, F, Fs, prime_fact_in_aa(Q, Fs))
U5_AA(X, F, Fs, Q, eq_out_ag(F, P)) → PRIME_FACT_IN_AA(Q, Fs)
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1,
x2)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x1,
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x2,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x2,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x1,
x2,
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x1,
x3,
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag(
x1,
x2,
x4)
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x1,
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x1,
x3,
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg(
x1,
x2)
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x1,
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x1,
x2,
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x1,
x2,
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x1,
x2,
x4,
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x1,
x2,
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg(
x1,
x2)
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x1,
x2,
x3,
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x1,
x2,
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x1,
x2,
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x1,
x2,
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x1,
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x1,
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x1,
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x3,
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag(
x2,
x4)
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x1,
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x1,
x3,
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga(
x2)
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x2,
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x2,
x4,
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
PRIME_FACT_IN_GA(
x1,
x2) =
PRIME_FACT_IN_GA(
x1)
U1_GA(
x1,
x2) =
U1_GA(
x2)
EQ_IN_AG(
x1,
x2) =
EQ_IN_AG(
x2)
U2_GA(
x1,
x2) =
U2_GA(
x2)
U3_GA(
x1,
x2,
x3,
x4) =
U3_GA(
x1,
x4)
PRIME_NUMBER_IN_A(
x1) =
PRIME_NUMBER_IN_A
U7_A(
x1,
x2) =
U7_A(
x2)
PRIME_NUMBER_IN_GGA(
x1,
x2,
x3) =
PRIME_NUMBER_IN_GGA(
x1,
x2)
U8_GGA(
x1,
x2,
x3) =
U8_GGA(
x1,
x2,
x3)
NO_DIVISOR_IN_LIST_IN_GG(
x1,
x2) =
NO_DIVISOR_IN_LIST_IN_GG(
x1,
x2)
U12_GG(
x1,
x2,
x3,
x4) =
U12_GG(
x1,
x2,
x3,
x4)
NOT_DIV_IN_GG(
x1,
x2) =
NOT_DIV_IN_GG(
x1,
x2)
U14_GG(
x1,
x2,
x3) =
U14_GG(
x1,
x2,
x3)
DIV_IN_GGAG(
x1,
x2,
x3,
x4) =
DIV_IN_GGAG(
x1,
x2,
x4)
U16_GGAG(
x1,
x2,
x3,
x4) =
U16_GGAG(
x1,
x3,
x4)
FAILURE_IN_G(
x1) =
FAILURE_IN_G(
x1)
U17_GGAG(
x1,
x2,
x3,
x4) =
U17_GGAG(
x1,
x3,
x4)
U18_GGAG(
x1,
x2,
x3,
x4) =
U18_GGAG(
x1,
x3,
x4)
EQ_IN_GG(
x1,
x2) =
EQ_IN_GG(
x1,
x2)
U19_GGAG(
x1,
x2,
x3,
x4,
x5) =
U19_GGAG(
x1,
x2,
x4,
x5)
MINUS_IN_GGA(
x1,
x2,
x3) =
MINUS_IN_GGA(
x1,
x2)
U21_GGA(
x1,
x2,
x3,
x4) =
U21_GGA(
x1,
x2,
x4)
U20_GGAG(
x1,
x2,
x3,
x4,
x5) =
U20_GGAG(
x1,
x2,
x4,
x5)
U15_GG(
x1,
x2,
x3) =
U15_GG(
x1,
x2,
x3)
U13_GG(
x1,
x2,
x3,
x4) =
U13_GG(
x1,
x2,
x3,
x4)
U9_GGA(
x1,
x2,
x3,
x4) =
U9_GGA(
x1,
x2,
x4)
U10_GGA(
x1,
x2,
x3,
x4) =
U10_GGA(
x1,
x2,
x4)
U11_GGA(
x1,
x2,
x3,
x4) =
U11_GGA(
x1,
x2,
x4)
U4_GA(
x1,
x2,
x3,
x4,
x5) =
U4_GA(
x1,
x4,
x5)
U5_GA(
x1,
x2,
x3,
x4,
x5) =
U5_GA(
x1,
x5)
U6_GA(
x1,
x2,
x3,
x4) =
U6_GA(
x1,
x2,
x4)
PRIME_FACT_IN_AA(
x1,
x2) =
PRIME_FACT_IN_AA
U1_AA(
x1,
x2) =
U1_AA(
x2)
U2_AA(
x1,
x2) =
U2_AA(
x2)
U3_AA(
x1,
x2,
x3,
x4) =
U3_AA(
x4)
U4_AA(
x1,
x2,
x3,
x4,
x5) =
U4_AA(
x4,
x5)
DIV_IN_AGAG(
x1,
x2,
x3,
x4) =
DIV_IN_AGAG(
x2,
x4)
U16_AGAG(
x1,
x2,
x3,
x4) =
U16_AGAG(
x3,
x4)
U17_AGAG(
x1,
x2,
x3,
x4) =
U17_AGAG(
x1,
x3,
x4)
U18_AGAG(
x1,
x2,
x3,
x4) =
U18_AGAG(
x1,
x3,
x4)
U19_AGAG(
x1,
x2,
x3,
x4,
x5) =
U19_AGAG(
x2,
x4,
x5)
MINUS_IN_AGA(
x1,
x2,
x3) =
MINUS_IN_AGA(
x2)
U21_AGA(
x1,
x2,
x3,
x4) =
U21_AGA(
x2,
x4)
U20_AGAG(
x1,
x2,
x3,
x4,
x5) =
U20_AGAG(
x2,
x4,
x5)
U5_AA(
x1,
x2,
x3,
x4,
x5) =
U5_AA(
x5)
U6_AA(
x1,
x2,
x3,
x4) =
U6_AA(
x2,
x4)
We have to consider all (P,R,Pi)-chains
(7) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LOPSTR] contains 7 SCCs with 51 less nodes.
(8) Complex Obligation (AND)
(9) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
MINUS_IN_AGA(s(X), s(Y), Z) → MINUS_IN_AGA(X, Y, Z)
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1,
x2)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x1,
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x2,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x2,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x1,
x2,
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x1,
x3,
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag(
x1,
x2,
x4)
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x1,
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x1,
x3,
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg(
x1,
x2)
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x1,
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x1,
x2,
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x1,
x2,
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x1,
x2,
x4,
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x1,
x2,
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg(
x1,
x2)
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x1,
x2,
x3,
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x1,
x2,
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x1,
x2,
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x1,
x2,
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x1,
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x1,
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x1,
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x3,
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag(
x2,
x4)
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x1,
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x1,
x3,
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga(
x2)
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x2,
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x2,
x4,
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
MINUS_IN_AGA(
x1,
x2,
x3) =
MINUS_IN_AGA(
x2)
We have to consider all (P,R,Pi)-chains
(10) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(11) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
MINUS_IN_AGA(s(X), s(Y), Z) → MINUS_IN_AGA(X, Y, Z)
R is empty.
The argument filtering Pi contains the following mapping:
s(
x1) =
s(
x1)
MINUS_IN_AGA(
x1,
x2,
x3) =
MINUS_IN_AGA(
x2)
We have to consider all (P,R,Pi)-chains
(12) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(13) Obligation:
Q DP problem:
The TRS P consists of the following rules:
MINUS_IN_AGA(s(Y)) → MINUS_IN_AGA(Y)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(14) 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:
- MINUS_IN_AGA(s(Y)) → MINUS_IN_AGA(Y)
The graph contains the following edges 1 > 1
(15) TRUE
(16) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
DIV_IN_AGAG(X, Y, s(Z), R) → U19_AGAG(X, Y, Z, R, minus_in_aga(X, Y, U))
U19_AGAG(X, Y, Z, R, minus_out_aga(X, Y, U)) → DIV_IN_AGAG(U, Y, Z, R)
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1,
x2)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x1,
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x2,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x2,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x1,
x2,
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x1,
x3,
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag(
x1,
x2,
x4)
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x1,
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x1,
x3,
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg(
x1,
x2)
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x1,
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x1,
x2,
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x1,
x2,
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x1,
x2,
x4,
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x1,
x2,
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg(
x1,
x2)
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x1,
x2,
x3,
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x1,
x2,
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x1,
x2,
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x1,
x2,
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x1,
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x1,
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x1,
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x3,
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag(
x2,
x4)
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x1,
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x1,
x3,
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga(
x2)
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x2,
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x2,
x4,
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
DIV_IN_AGAG(
x1,
x2,
x3,
x4) =
DIV_IN_AGAG(
x2,
x4)
U19_AGAG(
x1,
x2,
x3,
x4,
x5) =
U19_AGAG(
x2,
x4,
x5)
We have to consider all (P,R,Pi)-chains
(17) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(18) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
DIV_IN_AGAG(X, Y, s(Z), R) → U19_AGAG(X, Y, Z, R, minus_in_aga(X, Y, U))
U19_AGAG(X, Y, Z, R, minus_out_aga(X, Y, U)) → DIV_IN_AGAG(U, Y, Z, R)
The TRS R consists of the following rules:
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
The argument filtering Pi contains the following mapping:
0 =
0
s(
x1) =
s(
x1)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga(
x2)
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x2,
x4)
DIV_IN_AGAG(
x1,
x2,
x3,
x4) =
DIV_IN_AGAG(
x2,
x4)
U19_AGAG(
x1,
x2,
x3,
x4,
x5) =
U19_AGAG(
x2,
x4,
x5)
We have to consider all (P,R,Pi)-chains
(19) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(20) Obligation:
Q DP problem:
The TRS P consists of the following rules:
DIV_IN_AGAG(Y, R) → U19_AGAG(Y, R, minus_in_aga(Y))
U19_AGAG(Y, R, minus_out_aga(Y)) → DIV_IN_AGAG(Y, R)
The TRS R consists of the following rules:
minus_in_aga(0) → minus_out_aga(0)
minus_in_aga(s(Y)) → U21_aga(Y, minus_in_aga(Y))
U21_aga(Y, minus_out_aga(Y)) → minus_out_aga(s(Y))
The set Q consists of the following terms:
minus_in_aga(x0)
U21_aga(x0, x1)
We have to consider all (P,Q,R)-chains.
(21) Narrowing (SOUND transformation)
By narrowing [LPAR04] the rule
DIV_IN_AGAG(
Y,
R) →
U19_AGAG(
Y,
R,
minus_in_aga(
Y)) at position [2] we obtained the following new rules [LPAR04]:
DIV_IN_AGAG(0, y1) → U19_AGAG(0, y1, minus_out_aga(0))
DIV_IN_AGAG(s(x0), y1) → U19_AGAG(s(x0), y1, U21_aga(x0, minus_in_aga(x0)))
(22) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_AGAG(Y, R, minus_out_aga(Y)) → DIV_IN_AGAG(Y, R)
DIV_IN_AGAG(0, y1) → U19_AGAG(0, y1, minus_out_aga(0))
DIV_IN_AGAG(s(x0), y1) → U19_AGAG(s(x0), y1, U21_aga(x0, minus_in_aga(x0)))
The TRS R consists of the following rules:
minus_in_aga(0) → minus_out_aga(0)
minus_in_aga(s(Y)) → U21_aga(Y, minus_in_aga(Y))
U21_aga(Y, minus_out_aga(Y)) → minus_out_aga(s(Y))
The set Q consists of the following terms:
minus_in_aga(x0)
U21_aga(x0, x1)
We have to consider all (P,Q,R)-chains.
(23) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
U19_AGAG(
Y,
R,
minus_out_aga(
Y)) →
DIV_IN_AGAG(
Y,
R) we obtained the following new rules [LPAR04]:
U19_AGAG(0, z0, minus_out_aga(0)) → DIV_IN_AGAG(0, z0)
U19_AGAG(s(z0), z1, minus_out_aga(s(z0))) → DIV_IN_AGAG(s(z0), z1)
(24) Obligation:
Q DP problem:
The TRS P consists of the following rules:
DIV_IN_AGAG(0, y1) → U19_AGAG(0, y1, minus_out_aga(0))
DIV_IN_AGAG(s(x0), y1) → U19_AGAG(s(x0), y1, U21_aga(x0, minus_in_aga(x0)))
U19_AGAG(0, z0, minus_out_aga(0)) → DIV_IN_AGAG(0, z0)
U19_AGAG(s(z0), z1, minus_out_aga(s(z0))) → DIV_IN_AGAG(s(z0), z1)
The TRS R consists of the following rules:
minus_in_aga(0) → minus_out_aga(0)
minus_in_aga(s(Y)) → U21_aga(Y, minus_in_aga(Y))
U21_aga(Y, minus_out_aga(Y)) → minus_out_aga(s(Y))
The set Q consists of the following terms:
minus_in_aga(x0)
U21_aga(x0, x1)
We have to consider all (P,Q,R)-chains.
(25) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 2 SCCs.
(26) Complex Obligation (AND)
(27) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_AGAG(s(z0), z1, minus_out_aga(s(z0))) → DIV_IN_AGAG(s(z0), z1)
DIV_IN_AGAG(s(x0), y1) → U19_AGAG(s(x0), y1, U21_aga(x0, minus_in_aga(x0)))
The TRS R consists of the following rules:
minus_in_aga(0) → minus_out_aga(0)
minus_in_aga(s(Y)) → U21_aga(Y, minus_in_aga(Y))
U21_aga(Y, minus_out_aga(Y)) → minus_out_aga(s(Y))
The set Q consists of the following terms:
minus_in_aga(x0)
U21_aga(x0, x1)
We have to consider all (P,Q,R)-chains.
(28) 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 =
U19_AGAG(
s(
0),
z1,
U21_aga(
0,
minus_in_aga(
0))) evaluates to t =
U19_AGAG(
s(
0),
z1,
U21_aga(
0,
minus_in_aga(
0)))
Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
- Semiunifier: [ ]
- Matcher: [ ]
Rewriting sequenceU19_AGAG(s(0), z1, U21_aga(0, minus_in_aga(0))) →
U19_AGAG(
s(
0),
z1,
U21_aga(
0,
minus_out_aga(
0)))
with rule
minus_in_aga(
0) →
minus_out_aga(
0) at position [2,1] and matcher [ ]
U19_AGAG(s(0), z1, U21_aga(0, minus_out_aga(0))) →
U19_AGAG(
s(
0),
z1,
minus_out_aga(
s(
0)))
with rule
U21_aga(
Y,
minus_out_aga(
Y)) →
minus_out_aga(
s(
Y)) at position [2] and matcher [
Y /
0]
U19_AGAG(s(0), z1, minus_out_aga(s(0))) →
DIV_IN_AGAG(
s(
0),
z1)
with rule
U19_AGAG(
s(
z0),
z1',
minus_out_aga(
s(
z0))) →
DIV_IN_AGAG(
s(
z0),
z1') at position [] and matcher [
z0 /
0,
z1' /
z1]
DIV_IN_AGAG(s(0), z1) →
U19_AGAG(
s(
0),
z1,
U21_aga(
0,
minus_in_aga(
0)))
with rule
DIV_IN_AGAG(
s(
x0),
y1) →
U19_AGAG(
s(
x0),
y1,
U21_aga(
x0,
minus_in_aga(
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.
(29) FALSE
(30) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_AGAG(0, z0, minus_out_aga(0)) → DIV_IN_AGAG(0, z0)
DIV_IN_AGAG(0, y1) → U19_AGAG(0, y1, minus_out_aga(0))
The TRS R consists of the following rules:
minus_in_aga(0) → minus_out_aga(0)
minus_in_aga(s(Y)) → U21_aga(Y, minus_in_aga(Y))
U21_aga(Y, minus_out_aga(Y)) → minus_out_aga(s(Y))
The set Q consists of the following terms:
minus_in_aga(x0)
U21_aga(x0, x1)
We have to consider all (P,Q,R)-chains.
(31) 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.
(32) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_AGAG(0, z0, minus_out_aga(0)) → DIV_IN_AGAG(0, z0)
DIV_IN_AGAG(0, y1) → U19_AGAG(0, y1, minus_out_aga(0))
R is empty.
The set Q consists of the following terms:
minus_in_aga(x0)
U21_aga(x0, x1)
We have to consider all (P,Q,R)-chains.
(33) 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].
minus_in_aga(x0)
U21_aga(x0, x1)
(34) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_AGAG(0, z0, minus_out_aga(0)) → DIV_IN_AGAG(0, z0)
DIV_IN_AGAG(0, y1) → U19_AGAG(0, y1, minus_out_aga(0))
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(35) 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 =
DIV_IN_AGAG(
0,
y1) evaluates to t =
DIV_IN_AGAG(
0,
y1)
Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
- Matcher: [ ]
- Semiunifier: [ ]
Rewriting sequenceDIV_IN_AGAG(0, y1) →
U19_AGAG(
0,
y1,
minus_out_aga(
0))
with rule
DIV_IN_AGAG(
0,
y1') →
U19_AGAG(
0,
y1',
minus_out_aga(
0)) at position [] and matcher [
y1' /
y1]
U19_AGAG(0, y1, minus_out_aga(0)) →
DIV_IN_AGAG(
0,
y1)
with rule
U19_AGAG(
0,
z0,
minus_out_aga(
0)) →
DIV_IN_AGAG(
0,
z0)
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.
(36) FALSE
(37) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
MINUS_IN_GGA(s(X), s(Y), Z) → MINUS_IN_GGA(X, Y, Z)
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1,
x2)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x1,
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x2,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x2,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x1,
x2,
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x1,
x3,
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag(
x1,
x2,
x4)
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x1,
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x1,
x3,
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg(
x1,
x2)
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x1,
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x1,
x2,
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x1,
x2,
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x1,
x2,
x4,
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x1,
x2,
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg(
x1,
x2)
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x1,
x2,
x3,
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x1,
x2,
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x1,
x2,
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x1,
x2,
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x1,
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x1,
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x1,
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x3,
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag(
x2,
x4)
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x1,
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x1,
x3,
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga(
x2)
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x2,
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x2,
x4,
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
MINUS_IN_GGA(
x1,
x2,
x3) =
MINUS_IN_GGA(
x1,
x2)
We have to consider all (P,R,Pi)-chains
(38) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(39) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
MINUS_IN_GGA(s(X), s(Y), Z) → MINUS_IN_GGA(X, Y, Z)
R is empty.
The argument filtering Pi contains the following mapping:
s(
x1) =
s(
x1)
MINUS_IN_GGA(
x1,
x2,
x3) =
MINUS_IN_GGA(
x1,
x2)
We have to consider all (P,R,Pi)-chains
(40) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(41) Obligation:
Q DP problem:
The TRS P consists of the following rules:
MINUS_IN_GGA(s(X), s(Y)) → MINUS_IN_GGA(X, Y)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(42) 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:
- MINUS_IN_GGA(s(X), s(Y)) → MINUS_IN_GGA(X, Y)
The graph contains the following edges 1 > 1, 2 > 2
(43) TRUE
(44) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
DIV_IN_GGAG(X, Y, s(Z), R) → U19_GGAG(X, Y, Z, R, minus_in_gga(X, Y, U))
U19_GGAG(X, Y, Z, R, minus_out_gga(X, Y, U)) → DIV_IN_GGAG(U, Y, Z, R)
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1,
x2)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x1,
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x2,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x2,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x1,
x2,
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x1,
x3,
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag(
x1,
x2,
x4)
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x1,
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x1,
x3,
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg(
x1,
x2)
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x1,
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x1,
x2,
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x1,
x2,
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x1,
x2,
x4,
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x1,
x2,
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg(
x1,
x2)
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x1,
x2,
x3,
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x1,
x2,
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x1,
x2,
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x1,
x2,
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x1,
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x1,
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x1,
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x3,
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag(
x2,
x4)
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x1,
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x1,
x3,
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga(
x2)
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x2,
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x2,
x4,
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
DIV_IN_GGAG(
x1,
x2,
x3,
x4) =
DIV_IN_GGAG(
x1,
x2,
x4)
U19_GGAG(
x1,
x2,
x3,
x4,
x5) =
U19_GGAG(
x1,
x2,
x4,
x5)
We have to consider all (P,R,Pi)-chains
(45) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(46) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
DIV_IN_GGAG(X, Y, s(Z), R) → U19_GGAG(X, Y, Z, R, minus_in_gga(X, Y, U))
U19_GGAG(X, Y, Z, R, minus_out_gga(X, Y, U)) → DIV_IN_GGAG(U, Y, Z, R)
The TRS R consists of the following rules:
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The argument filtering Pi contains the following mapping:
0 =
0
s(
x1) =
s(
x1)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x1,
x2,
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x1,
x2,
x4)
DIV_IN_GGAG(
x1,
x2,
x3,
x4) =
DIV_IN_GGAG(
x1,
x2,
x4)
U19_GGAG(
x1,
x2,
x3,
x4,
x5) =
U19_GGAG(
x1,
x2,
x4,
x5)
We have to consider all (P,R,Pi)-chains
(47) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(48) Obligation:
Q DP problem:
The TRS P consists of the following rules:
DIV_IN_GGAG(X, Y, R) → U19_GGAG(X, Y, R, minus_in_gga(X, Y))
U19_GGAG(X, Y, R, minus_out_gga(X, Y, U)) → DIV_IN_GGAG(U, Y, R)
The TRS R consists of the following rules:
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
minus_in_gga(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(49) Narrowing (SOUND transformation)
By narrowing [LPAR04] the rule
DIV_IN_GGAG(
X,
Y,
R) →
U19_GGAG(
X,
Y,
R,
minus_in_gga(
X,
Y)) at position [3] we obtained the following new rules [LPAR04]:
DIV_IN_GGAG(x0, 0, y2) → U19_GGAG(x0, 0, y2, minus_out_gga(x0, 0, x0))
DIV_IN_GGAG(s(x0), s(x1), y2) → U19_GGAG(s(x0), s(x1), y2, U21_gga(x0, x1, minus_in_gga(x0, x1)))
(50) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_GGAG(X, Y, R, minus_out_gga(X, Y, U)) → DIV_IN_GGAG(U, Y, R)
DIV_IN_GGAG(x0, 0, y2) → U19_GGAG(x0, 0, y2, minus_out_gga(x0, 0, x0))
DIV_IN_GGAG(s(x0), s(x1), y2) → U19_GGAG(s(x0), s(x1), y2, U21_gga(x0, x1, minus_in_gga(x0, x1)))
The TRS R consists of the following rules:
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
minus_in_gga(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(51) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
U19_GGAG(
X,
Y,
R,
minus_out_gga(
X,
Y,
U)) →
DIV_IN_GGAG(
U,
Y,
R) we obtained the following new rules [LPAR04]:
U19_GGAG(z0, 0, z1, minus_out_gga(z0, 0, z0)) → DIV_IN_GGAG(z0, 0, z1)
U19_GGAG(s(z0), s(z1), z2, minus_out_gga(s(z0), s(z1), x3)) → DIV_IN_GGAG(x3, s(z1), z2)
(52) Obligation:
Q DP problem:
The TRS P consists of the following rules:
DIV_IN_GGAG(x0, 0, y2) → U19_GGAG(x0, 0, y2, minus_out_gga(x0, 0, x0))
DIV_IN_GGAG(s(x0), s(x1), y2) → U19_GGAG(s(x0), s(x1), y2, U21_gga(x0, x1, minus_in_gga(x0, x1)))
U19_GGAG(z0, 0, z1, minus_out_gga(z0, 0, z0)) → DIV_IN_GGAG(z0, 0, z1)
U19_GGAG(s(z0), s(z1), z2, minus_out_gga(s(z0), s(z1), x3)) → DIV_IN_GGAG(x3, s(z1), z2)
The TRS R consists of the following rules:
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
minus_in_gga(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(53) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 2 SCCs.
(54) Complex Obligation (AND)
(55) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_GGAG(s(z0), s(z1), z2, minus_out_gga(s(z0), s(z1), x3)) → DIV_IN_GGAG(x3, s(z1), z2)
DIV_IN_GGAG(s(x0), s(x1), y2) → U19_GGAG(s(x0), s(x1), y2, U21_gga(x0, x1, minus_in_gga(x0, x1)))
The TRS R consists of the following rules:
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
minus_in_gga(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(56) ForwardInstantiation (EQUIVALENT transformation)
By forward instantiating [JAR06] the rule
U19_GGAG(
s(
z0),
s(
z1),
z2,
minus_out_gga(
s(
z0),
s(
z1),
x3)) →
DIV_IN_GGAG(
x3,
s(
z1),
z2) we obtained the following new rules [LPAR04]:
U19_GGAG(s(x0), s(x1), x2, minus_out_gga(s(x0), s(x1), s(y_0))) → DIV_IN_GGAG(s(y_0), s(x1), x2)
(57) Obligation:
Q DP problem:
The TRS P consists of the following rules:
DIV_IN_GGAG(s(x0), s(x1), y2) → U19_GGAG(s(x0), s(x1), y2, U21_gga(x0, x1, minus_in_gga(x0, x1)))
U19_GGAG(s(x0), s(x1), x2, minus_out_gga(s(x0), s(x1), s(y_0))) → DIV_IN_GGAG(s(y_0), s(x1), x2)
The TRS R consists of the following rules:
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
minus_in_gga(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(58) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04].
The following pairs can be oriented strictly and are deleted.
DIV_IN_GGAG(s(x0), s(x1), y2) → U19_GGAG(s(x0), s(x1), y2, U21_gga(x0, x1, minus_in_gga(x0, x1)))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:
POL(0) = 0
POL(DIV_IN_GGAG(x1, x2, x3)) = x1 + x2
POL(U19_GGAG(x1, x2, x3, x4)) = x2 + x4
POL(U21_gga(x1, x2, x3)) = x3
POL(minus_in_gga(x1, x2)) = x1
POL(minus_out_gga(x1, x2, x3)) = x3
POL(s(x1)) = 1 + x1
The following usable rules [FROCOS05] were oriented:
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
(59) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_GGAG(s(x0), s(x1), x2, minus_out_gga(s(x0), s(x1), s(y_0))) → DIV_IN_GGAG(s(y_0), s(x1), x2)
The TRS R consists of the following rules:
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
minus_in_gga(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(60) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.
(61) TRUE
(62) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_GGAG(z0, 0, z1, minus_out_gga(z0, 0, z0)) → DIV_IN_GGAG(z0, 0, z1)
DIV_IN_GGAG(x0, 0, y2) → U19_GGAG(x0, 0, y2, minus_out_gga(x0, 0, x0))
The TRS R consists of the following rules:
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
minus_in_gga(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(63) 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.
(64) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_GGAG(z0, 0, z1, minus_out_gga(z0, 0, z0)) → DIV_IN_GGAG(z0, 0, z1)
DIV_IN_GGAG(x0, 0, y2) → U19_GGAG(x0, 0, y2, minus_out_gga(x0, 0, x0))
R is empty.
The set Q consists of the following terms:
minus_in_gga(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(65) 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].
minus_in_gga(x0, x1)
U21_gga(x0, x1, x2)
(66) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_GGAG(z0, 0, z1, minus_out_gga(z0, 0, z0)) → DIV_IN_GGAG(z0, 0, z1)
DIV_IN_GGAG(x0, 0, y2) → U19_GGAG(x0, 0, y2, minus_out_gga(x0, 0, x0))
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(67) 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 =
DIV_IN_GGAG(
x0,
0,
y2) evaluates to t =
DIV_IN_GGAG(
x0,
0,
y2)
Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
- Matcher: [ ]
- Semiunifier: [ ]
Rewriting sequenceDIV_IN_GGAG(x0, 0, y2) →
U19_GGAG(
x0,
0,
y2,
minus_out_gga(
x0,
0,
x0))
with rule
DIV_IN_GGAG(
x0',
0,
y2') →
U19_GGAG(
x0',
0,
y2',
minus_out_gga(
x0',
0,
x0')) at position [] and matcher [
x0' /
x0,
y2' /
y2]
U19_GGAG(x0, 0, y2, minus_out_gga(x0, 0, x0)) →
DIV_IN_GGAG(
x0,
0,
y2)
with rule
U19_GGAG(
z0,
0,
z1,
minus_out_gga(
z0,
0,
z0)) →
DIV_IN_GGAG(
z0,
0,
z1)
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.
(68) FALSE
(69) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
U12_GG(V, D, Ds, not_div_out_gg(V, D)) → NO_DIVISOR_IN_LIST_IN_GG(V, Ds)
NO_DIVISOR_IN_LIST_IN_GG(V, .(D, Ds)) → U12_GG(V, D, Ds, not_div_in_gg(V, D))
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1,
x2)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x1,
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x2,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x2,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x1,
x2,
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x1,
x3,
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag(
x1,
x2,
x4)
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x1,
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x1,
x3,
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg(
x1,
x2)
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x1,
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x1,
x2,
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x1,
x2,
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x1,
x2,
x4,
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x1,
x2,
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg(
x1,
x2)
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x1,
x2,
x3,
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x1,
x2,
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x1,
x2,
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x1,
x2,
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x1,
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x1,
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x1,
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x3,
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag(
x2,
x4)
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x1,
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x1,
x3,
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga(
x2)
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x2,
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x2,
x4,
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
NO_DIVISOR_IN_LIST_IN_GG(
x1,
x2) =
NO_DIVISOR_IN_LIST_IN_GG(
x1,
x2)
U12_GG(
x1,
x2,
x3,
x4) =
U12_GG(
x1,
x2,
x3,
x4)
We have to consider all (P,R,Pi)-chains
(70) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(71) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
U12_GG(V, D, Ds, not_div_out_gg(V, D)) → NO_DIVISOR_IN_LIST_IN_GG(V, Ds)
NO_DIVISOR_IN_LIST_IN_GG(V, .(D, Ds)) → U12_GG(V, D, Ds, not_div_in_gg(V, D))
The TRS R consists of the following rules:
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
eq_in_ag(X, X) → eq_out_ag(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The argument filtering Pi contains the following mapping:
0 =
0
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1,
x2)
s(
x1) =
s(
x1)
.(
x1,
x2) =
.(
x1,
x2)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x1,
x2,
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x1,
x3,
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag(
x1,
x2,
x4)
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x1,
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x1,
x3,
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg(
x1,
x2)
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x1,
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x1,
x2,
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x1,
x2,
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x1,
x2,
x4,
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x1,
x2,
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg(
x1,
x2)
NO_DIVISOR_IN_LIST_IN_GG(
x1,
x2) =
NO_DIVISOR_IN_LIST_IN_GG(
x1,
x2)
U12_GG(
x1,
x2,
x3,
x4) =
U12_GG(
x1,
x2,
x3,
x4)
We have to consider all (P,R,Pi)-chains
(72) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(73) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U12_GG(V, D, Ds, not_div_out_gg(V, D)) → NO_DIVISOR_IN_LIST_IN_GG(V, Ds)
NO_DIVISOR_IN_LIST_IN_GG(V, .(D, Ds)) → U12_GG(V, D, Ds, not_div_in_gg(V, D))
The TRS R consists of the following rules:
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
not_div_in_gg(x0, x1)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(74) 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:
- NO_DIVISOR_IN_LIST_IN_GG(V, .(D, Ds)) → U12_GG(V, D, Ds, not_div_in_gg(V, D))
The graph contains the following edges 1 >= 1, 2 > 2, 2 > 3
- U12_GG(V, D, Ds, not_div_out_gg(V, D)) → NO_DIVISOR_IN_LIST_IN_GG(V, Ds)
The graph contains the following edges 1 >= 1, 4 > 1, 3 >= 2
(75) TRUE
(76) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(C, Ps, P) → U9_GGA(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_GGA(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → PRIME_NUMBER_IN_GGA(s(C), .(C, Ps), P)
PRIME_NUMBER_IN_GGA(C, Ps, P) → PRIME_NUMBER_IN_GGA(s(C), Ps, P)
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1,
x2)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x1,
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x2,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x2,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x1,
x2,
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x1,
x3,
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag(
x1,
x2,
x4)
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x1,
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x1,
x3,
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg(
x1,
x2)
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x1,
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x1,
x2,
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x1,
x2,
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x1,
x2,
x4,
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x1,
x2,
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg(
x1,
x2)
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x1,
x2,
x3,
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x1,
x2,
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x1,
x2,
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x1,
x2,
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x1,
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x1,
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x1,
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x3,
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag(
x2,
x4)
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x1,
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x1,
x3,
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga(
x2)
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x2,
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x2,
x4,
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
PRIME_NUMBER_IN_GGA(
x1,
x2,
x3) =
PRIME_NUMBER_IN_GGA(
x1,
x2)
U9_GGA(
x1,
x2,
x3,
x4) =
U9_GGA(
x1,
x2,
x4)
We have to consider all (P,R,Pi)-chains
(77) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(78) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(C, Ps, P) → U9_GGA(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_GGA(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → PRIME_NUMBER_IN_GGA(s(C), .(C, Ps), P)
PRIME_NUMBER_IN_GGA(C, Ps, P) → PRIME_NUMBER_IN_GGA(s(C), Ps, P)
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
eq_in_ag(X, X) → eq_out_ag(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The argument filtering Pi contains the following mapping:
0 =
0
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1,
x2)
[] =
[]
s(
x1) =
s(
x1)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x2,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x1,
x2,
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x1,
x3,
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag(
x1,
x2,
x4)
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x1,
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x1,
x3,
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg(
x1,
x2)
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x1,
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x1,
x2,
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x1,
x2,
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x1,
x2,
x4,
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x1,
x2,
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg(
x1,
x2)
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x1,
x2,
x3,
x4)
PRIME_NUMBER_IN_GGA(
x1,
x2,
x3) =
PRIME_NUMBER_IN_GGA(
x1,
x2)
U9_GGA(
x1,
x2,
x3,
x4) =
U9_GGA(
x1,
x2,
x4)
We have to consider all (P,R,Pi)-chains
(79) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(80) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(C, Ps) → U9_GGA(C, Ps, no_divisor_in_list_in_gg(C, Ps))
U9_GGA(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → PRIME_NUMBER_IN_GGA(s(C), .(C, Ps))
PRIME_NUMBER_IN_GGA(C, Ps) → PRIME_NUMBER_IN_GGA(s(C), Ps)
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(81) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
C,
Ps) →
U9_GGA(
C,
Ps,
no_divisor_in_list_in_gg(
C,
Ps)) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(z0), .(z0, z1)) → U9_GGA(s(z0), .(z0, z1), no_divisor_in_list_in_gg(s(z0), .(z0, z1)))
PRIME_NUMBER_IN_GGA(s(z0), z1) → U9_GGA(s(z0), z1, no_divisor_in_list_in_gg(s(z0), z1))
(82) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U9_GGA(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → PRIME_NUMBER_IN_GGA(s(C), .(C, Ps))
PRIME_NUMBER_IN_GGA(C, Ps) → PRIME_NUMBER_IN_GGA(s(C), Ps)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, z1)) → U9_GGA(s(z0), .(z0, z1), no_divisor_in_list_in_gg(s(z0), .(z0, z1)))
PRIME_NUMBER_IN_GGA(s(z0), z1) → U9_GGA(s(z0), z1, no_divisor_in_list_in_gg(s(z0), z1))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(83) Narrowing (SOUND transformation)
By narrowing [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
C,
Ps) →
U9_GGA(
C,
Ps,
no_divisor_in_list_in_gg(
C,
Ps)) at position [2] we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(x0, []) → U9_GGA(x0, [], no_divisor_in_list_out_gg(x0, []))
PRIME_NUMBER_IN_GGA(x0, .(x1, x2)) → U9_GGA(x0, .(x1, x2), U12_gg(x0, x1, x2, not_div_in_gg(x0, x1)))
(84) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U9_GGA(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → PRIME_NUMBER_IN_GGA(s(C), .(C, Ps))
PRIME_NUMBER_IN_GGA(C, Ps) → PRIME_NUMBER_IN_GGA(s(C), Ps)
PRIME_NUMBER_IN_GGA(x0, []) → U9_GGA(x0, [], no_divisor_in_list_out_gg(x0, []))
PRIME_NUMBER_IN_GGA(x0, .(x1, x2)) → U9_GGA(x0, .(x1, x2), U12_gg(x0, x1, x2, not_div_in_gg(x0, x1)))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(85) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
U9_GGA(
C,
Ps,
no_divisor_in_list_out_gg(
C,
Ps)) →
PRIME_NUMBER_IN_GGA(
s(
C),
.(
C,
Ps)) we obtained the following new rules [LPAR04]:
U9_GGA(z0, [], no_divisor_in_list_out_gg(z0, [])) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, []))
U9_GGA(z0, .(z1, z2), no_divisor_in_list_out_gg(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2)))
(86) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(C, Ps) → PRIME_NUMBER_IN_GGA(s(C), Ps)
PRIME_NUMBER_IN_GGA(x0, []) → U9_GGA(x0, [], no_divisor_in_list_out_gg(x0, []))
PRIME_NUMBER_IN_GGA(x0, .(x1, x2)) → U9_GGA(x0, .(x1, x2), U12_gg(x0, x1, x2, not_div_in_gg(x0, x1)))
U9_GGA(z0, [], no_divisor_in_list_out_gg(z0, [])) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, []))
U9_GGA(z0, .(z1, z2), no_divisor_in_list_out_gg(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2)))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(87) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
C,
Ps) →
PRIME_NUMBER_IN_GGA(
s(
C),
Ps) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(z0), z1) → PRIME_NUMBER_IN_GGA(s(s(z0)), z1)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2)))
(88) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(x0, []) → U9_GGA(x0, [], no_divisor_in_list_out_gg(x0, []))
PRIME_NUMBER_IN_GGA(x0, .(x1, x2)) → U9_GGA(x0, .(x1, x2), U12_gg(x0, x1, x2, not_div_in_gg(x0, x1)))
U9_GGA(z0, [], no_divisor_in_list_out_gg(z0, [])) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, []))
U9_GGA(z0, .(z1, z2), no_divisor_in_list_out_gg(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(z0), z1) → PRIME_NUMBER_IN_GGA(s(s(z0)), z1)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2)))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(89) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
x0,
[]) →
U9_GGA(
x0,
[],
no_divisor_in_list_out_gg(
x0,
[])) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(z0)), []) → U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), []))
(90) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(x0, .(x1, x2)) → U9_GGA(x0, .(x1, x2), U12_gg(x0, x1, x2, not_div_in_gg(x0, x1)))
U9_GGA(z0, [], no_divisor_in_list_out_gg(z0, [])) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, []))
U9_GGA(z0, .(z1, z2), no_divisor_in_list_out_gg(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(z0), z1) → PRIME_NUMBER_IN_GGA(s(s(z0)), z1)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), []) → U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), []))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(91) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
x0,
.(
x1,
x2)) →
U9_GGA(
x0,
.(
x1,
x2),
U12_gg(
x0,
x1,
x2,
not_div_in_gg(
x0,
x1))) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → U9_GGA(s(z0), .(z0, []), U12_gg(s(z0), z0, [], not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), z0, .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x1, x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), z0, [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), z0, .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
(92) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U9_GGA(z0, [], no_divisor_in_list_out_gg(z0, [])) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, []))
U9_GGA(z0, .(z1, z2), no_divisor_in_list_out_gg(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(z0), z1) → PRIME_NUMBER_IN_GGA(s(s(z0)), z1)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), []) → U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → U9_GGA(s(z0), .(z0, []), U12_gg(s(z0), z0, [], not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), z0, .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x1, x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), z0, [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), z0, .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(93) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
U9_GGA(
z0,
[],
no_divisor_in_list_out_gg(
z0,
[])) →
PRIME_NUMBER_IN_GGA(
s(
z0),
.(
z0,
[])) we obtained the following new rules [LPAR04]:
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
(94) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U9_GGA(z0, .(z1, z2), no_divisor_in_list_out_gg(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(z0), z1) → PRIME_NUMBER_IN_GGA(s(s(z0)), z1)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), []) → U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → U9_GGA(s(z0), .(z0, []), U12_gg(s(z0), z0, [], not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), z0, .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x1, x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), z0, [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), z0, .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(95) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
U9_GGA(
z0,
.(
z1,
z2),
no_divisor_in_list_out_gg(
z0,
.(
z1,
z2))) →
PRIME_NUMBER_IN_GGA(
s(
z0),
.(
z0,
.(
z1,
z2))) we obtained the following new rules [LPAR04]:
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
(96) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(z0), z1) → PRIME_NUMBER_IN_GGA(s(s(z0)), z1)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), []) → U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → U9_GGA(s(z0), .(z0, []), U12_gg(s(z0), z0, [], not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), z0, .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x1, x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), z0, [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), z0, .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(97) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
z0),
z1) →
PRIME_NUMBER_IN_GGA(
s(
s(
z0)),
z1) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
(98) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), []) → U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → U9_GGA(s(z0), .(z0, []), U12_gg(s(z0), z0, [], not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), z0, .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x1, x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), z0, [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), z0, .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(99) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
z0),
.(
z0,
[])) →
PRIME_NUMBER_IN_GGA(
s(
s(
z0)),
.(
z0,
[])) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
(100) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), []) → U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → U9_GGA(s(z0), .(z0, []), U12_gg(s(z0), z0, [], not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), z0, .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x1, x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), z0, [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), z0, .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(101) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
z0),
.(
z0,
.(
z1,
z2))) →
PRIME_NUMBER_IN_GGA(
s(
s(
z0)),
.(
z0,
.(
z1,
z2))) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
(102) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(s(z0)), []) → U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → U9_GGA(s(z0), .(z0, []), U12_gg(s(z0), z0, [], not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), z0, .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x1, x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), z0, [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), z0, .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(103) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
s(
z0)),
[]) →
U9_GGA(
s(
s(
z0)),
[],
no_divisor_in_list_out_gg(
s(
s(
z0)),
[])) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(s(z0))), []) → U9_GGA(s(s(s(z0))), [], no_divisor_in_list_out_gg(s(s(s(z0))), []))
(104) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → U9_GGA(s(z0), .(z0, []), U12_gg(s(z0), z0, [], not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), z0, .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x1, x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), z0, [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), z0, .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), []) → U9_GGA(s(s(s(z0))), [], no_divisor_in_list_out_gg(s(s(s(z0))), []))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(105) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
z0),
.(
z0,
[])) →
U9_GGA(
s(
z0),
.(
z0,
[]),
U12_gg(
s(
z0),
z0,
[],
not_div_in_gg(
s(
z0),
z0))) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), s(s(z0)), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
(106) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), z0, .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x1, x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), z0, [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), z0, .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), []) → U9_GGA(s(s(s(z0))), [], no_divisor_in_list_out_gg(s(s(s(z0))), []))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), s(s(z0)), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(107) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
z0),
.(
z0,
.(
z1,
z2))) →
U9_GGA(
s(
z0),
.(
z0,
.(
z1,
z2)),
U12_gg(
s(
z0),
z0,
.(
z1,
z2),
not_div_in_gg(
s(
z0),
z0))) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), s(z0), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
(108) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x1, x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), z0, [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), z0, .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), []) → U9_GGA(s(s(s(z0))), [], no_divisor_in_list_out_gg(s(s(s(z0))), []))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), s(s(z0)), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), s(z0), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(109) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
s(
z0)),
.(
x1,
x2)) →
U9_GGA(
s(
s(
z0)),
.(
x1,
x2),
U12_gg(
s(
s(
z0)),
x1,
x2,
not_div_in_gg(
s(
s(
z0)),
x1))) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), s(s(z0)), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), s(z0), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x1, x2, not_div_in_gg(s(s(s(z0))), x1)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, [])) → U9_GGA(s(s(s(z0))), .(z0, []), U12_gg(s(s(s(z0))), z0, [], not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), z0, .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), s(s(z0)), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), s(z0), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
(110) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), z0, [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), z0, .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), []) → U9_GGA(s(s(s(z0))), [], no_divisor_in_list_out_gg(s(s(s(z0))), []))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), s(s(z0)), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), s(z0), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x1, x2, not_div_in_gg(s(s(s(z0))), x1)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, [])) → U9_GGA(s(s(s(z0))), .(z0, []), U12_gg(s(s(s(z0))), z0, [], not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), z0, .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), s(s(z0)), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), s(z0), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(111) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
s(
z0)),
.(
z0,
[])) →
U9_GGA(
s(
s(
z0)),
.(
z0,
[]),
U12_gg(
s(
s(
z0)),
z0,
[],
not_div_in_gg(
s(
s(
z0)),
z0))) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), [])) → U9_GGA(s(s(s(z0))), .(s(z0), []), U12_gg(s(s(s(z0))), s(z0), [], not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), s(s(z0)), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
(112) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), z0, .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), []) → U9_GGA(s(s(s(z0))), [], no_divisor_in_list_out_gg(s(s(s(z0))), []))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), s(s(z0)), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), s(z0), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x1, x2, not_div_in_gg(s(s(s(z0))), x1)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, [])) → U9_GGA(s(s(s(z0))), .(z0, []), U12_gg(s(s(s(z0))), z0, [], not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), z0, .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), s(s(z0)), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), s(z0), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), [])) → U9_GGA(s(s(s(z0))), .(s(z0), []), U12_gg(s(s(s(z0))), s(z0), [], not_div_in_gg(s(s(s(z0))), s(z0))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(113) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
s(
z0)),
.(
z0,
.(
z1,
z2))) →
U9_GGA(
s(
s(
z0)),
.(
z0,
.(
z1,
z2)),
U12_gg(
s(
s(
z0)),
z0,
.(
z1,
z2),
not_div_in_gg(
s(
s(
z0)),
z0))) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(x1, x2))) → U9_GGA(s(s(s(z0))), .(s(z0), .(x1, x2)), U12_gg(s(s(s(z0))), s(z0), .(x1, x2), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), s(z0), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
(114) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), []) → U9_GGA(s(s(s(z0))), [], no_divisor_in_list_out_gg(s(s(s(z0))), []))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), s(s(z0)), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), s(z0), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x1, x2, not_div_in_gg(s(s(s(z0))), x1)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, [])) → U9_GGA(s(s(s(z0))), .(z0, []), U12_gg(s(s(s(z0))), z0, [], not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), z0, .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), s(s(z0)), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), s(z0), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), [])) → U9_GGA(s(s(s(z0))), .(s(z0), []), U12_gg(s(s(s(z0))), s(z0), [], not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(x1, x2))) → U9_GGA(s(s(s(z0))), .(s(z0), .(x1, x2)), U12_gg(s(s(s(z0))), s(z0), .(x1, x2), not_div_in_gg(s(s(s(z0))), s(z0))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(115) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04].
The following pairs can be oriented strictly and are deleted.
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:
POL(.(x1, x2)) = 0
POL(0) = 0
POL(PRIME_NUMBER_IN_GGA(x1, x2)) = x2
POL(U12_gg(x1, x2, x3, x4)) = 0
POL(U13_gg(x1, x2, x3, x4)) = 0
POL(U14_gg(x1, x2, x3)) = 0
POL(U15_gg(x1, x2, x3)) = 0
POL(U16_ggag(x1, x2, x3)) = 0
POL(U17_ggag(x1, x2, x3)) = 0
POL(U18_ggag(x1, x2, x3)) = 0
POL(U19_ggag(x1, x2, x3, x4)) = 0
POL(U20_ggag(x1, x2, x3, x4)) = 0
POL(U21_gga(x1, x2, x3)) = 0
POL(U9_GGA(x1, x2, x3)) = x2
POL([]) = 1
POL(a) = 0
POL(div_in_ggag(x1, x2, x3)) = 0
POL(div_out_ggag(x1, x2, x3)) = 0
POL(eq_in_ag(x1)) = 1 + x1
POL(eq_in_gg(x1, x2)) = 1 + x1
POL(eq_out_ag(x1, x2)) = 1
POL(eq_out_gg(x1, x2)) = 0
POL(failure_in_g(x1)) = 0
POL(minus_in_gga(x1, x2)) = 0
POL(minus_out_gga(x1, x2, x3)) = 0
POL(no_divisor_in_list_in_gg(x1, x2)) = 0
POL(no_divisor_in_list_out_gg(x1, x2)) = 0
POL(not_div_in_gg(x1, x2)) = 0
POL(not_div_out_gg(x1, x2)) = 0
POL(s(x1)) = 0
The following usable rules [FROCOS05] were oriented:
none
(116) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), []) → U9_GGA(s(s(s(z0))), [], no_divisor_in_list_out_gg(s(s(s(z0))), []))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), s(s(z0)), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), s(z0), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x1, x2, not_div_in_gg(s(s(s(z0))), x1)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, [])) → U9_GGA(s(s(s(z0))), .(z0, []), U12_gg(s(s(s(z0))), z0, [], not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), z0, .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), s(s(z0)), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), s(z0), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), [])) → U9_GGA(s(s(s(z0))), .(s(z0), []), U12_gg(s(s(s(z0))), s(z0), [], not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(x1, x2))) → U9_GGA(s(s(s(z0))), .(s(z0), .(x1, x2)), U12_gg(s(s(s(z0))), s(z0), .(x1, x2), not_div_in_gg(s(s(s(z0))), s(z0))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(117) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.
(118) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x1, x2, not_div_in_gg(s(s(s(z0))), x1)))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), z0, .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), s(z0), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(x1, x2))) → U9_GGA(s(s(s(z0))), .(s(z0), .(x1, x2)), U12_gg(s(s(s(z0))), s(z0), .(x1, x2), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), s(z0), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, [])) → U9_GGA(s(s(s(z0))), .(z0, []), U12_gg(s(s(s(z0))), z0, [], not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), s(s(z0)), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), [])) → U9_GGA(s(s(s(z0))), .(s(z0), []), U12_gg(s(s(s(z0))), s(z0), [], not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), s(s(z0)), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(119) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04].
The following pairs can be oriented strictly and are deleted.
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO]:
POL(PRIME_NUMBER_IN_GGA(x1, x2)) = | 0 | + | | · | x1 | + | | · | x2 |
POL(.(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U9_GGA(x1, x2, x3)) = | 0 | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(U12_gg(x1, x2, x3, x4)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 | + | | · | x4 |
POL(not_div_in_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(no_divisor_in_list_out_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U14_gg(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(div_in_ggag(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(not_div_out_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U13_gg(x1, x2, x3, x4)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 | + | | · | x4 |
POL(no_divisor_in_list_in_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U16_ggag(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(failure_in_g(x1)) = | | + | | · | x1 |
POL(U17_ggag(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(eq_in_ag(x1)) = | | + | | · | x1 |
POL(U19_ggag(x1, x2, x3, x4)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 | + | | · | x4 |
POL(minus_in_gga(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(div_out_ggag(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(U15_gg(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(minus_out_gga(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(U21_gga(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(U20_ggag(x1, x2, x3, x4)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 | + | | · | x4 |
POL(eq_out_ag(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U18_ggag(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(eq_in_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(eq_out_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
The following usable rules [FROCOS05] were oriented:
none
(120) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x1, x2, not_div_in_gg(s(s(s(z0))), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), z0, .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), s(z0), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(x1, x2))) → U9_GGA(s(s(s(z0))), .(s(z0), .(x1, x2)), U12_gg(s(s(s(z0))), s(z0), .(x1, x2), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), s(z0), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, [])) → U9_GGA(s(s(s(z0))), .(z0, []), U12_gg(s(s(s(z0))), z0, [], not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), s(s(z0)), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), [])) → U9_GGA(s(s(s(z0))), .(s(z0), []), U12_gg(s(s(s(z0))), s(z0), [], not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), s(s(z0)), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(121) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04].
The following pairs can be oriented strictly and are deleted.
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, [])) → U9_GGA(s(s(s(z0))), .(z0, []), U12_gg(s(s(s(z0))), z0, [], not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), s(s(z0)), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), [])) → U9_GGA(s(s(s(z0))), .(s(z0), []), U12_gg(s(s(s(z0))), s(z0), [], not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), s(s(z0)), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO]:
POL(PRIME_NUMBER_IN_GGA(x1, x2)) = | 0 | + | | · | x1 | + | | · | x2 |
POL(.(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U9_GGA(x1, x2, x3)) = | 0 | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(U12_gg(x1, x2, x3, x4)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 | + | | · | x4 |
POL(not_div_in_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(no_divisor_in_list_out_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U14_gg(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(div_in_ggag(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(not_div_out_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U13_gg(x1, x2, x3, x4)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 | + | | · | x4 |
POL(no_divisor_in_list_in_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U16_ggag(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(failure_in_g(x1)) = | | + | | · | x1 |
POL(U17_ggag(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(eq_in_ag(x1)) = | | + | | · | x1 |
POL(U19_ggag(x1, x2, x3, x4)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 | + | | · | x4 |
POL(minus_in_gga(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(div_out_ggag(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(U15_gg(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(minus_out_gga(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(U21_gga(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(U20_ggag(x1, x2, x3, x4)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 | + | | · | x4 |
POL(eq_out_ag(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U18_ggag(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(eq_in_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(eq_out_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
The following usable rules [FROCOS05] were oriented:
none
(122) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x1, x2, not_div_in_gg(s(s(s(z0))), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), z0, .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), s(z0), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(x1, x2))) → U9_GGA(s(s(s(z0))), .(s(z0), .(x1, x2)), U12_gg(s(s(s(z0))), s(z0), .(x1, x2), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), s(z0), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(123) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04].
The following pairs can be oriented strictly and are deleted.
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), s(z0), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), s(z0), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO,RATPOLO]:
POL(.(x1, x2)) = [3/4]x2
POL(0) = 0
POL(PRIME_NUMBER_IN_GGA(x1, x2)) = [1/4] + [13/4]x2
POL(U12_gg(x1, x2, x3, x4)) = [5/2] + [9/4]x1 + [4]x3
POL(U13_gg(x1, x2, x3, x4)) = [11/4] + [13/4]x1 + [15/4]x2 + [15/4]x3 + [1/2]x4
POL(U14_gg(x1, x2, x3)) = [3/2] + [7/4]x1 + [7/2]x2 + x3
POL(U15_gg(x1, x2, x3)) = [1/2] + [7/4]x1 + [5/2]x2 + [3/2]x3
POL(U16_ggag(x1, x2, x3)) = [5/4] + [11/4]x1 + [5/2]x2 + [1/2]x3
POL(U17_ggag(x1, x2, x3)) = [4] + x1 + [15/4]x2 + [1/2]x3
POL(U18_ggag(x1, x2, x3)) = [1/4] + [5/2]x1 + x2
POL(U19_ggag(x1, x2, x3, x4)) = [13/4] + [7/4]x1 + [15/4]x2 + [15/4]x3 + [11/4]x4
POL(U20_ggag(x1, x2, x3, x4)) = [7/2] + [4]x1 + [5/2]x2 + [3/2]x3 + [9/4]x4
POL(U21_gga(x1, x2, x3)) = [9/4] + [5/2]x1 + [1/2]x2 + [1/2]x3
POL(U9_GGA(x1, x2, x3)) = [1/4] + [11/4]x2
POL([]) = [3]
POL(a) = [7/4]
POL(div_in_ggag(x1, x2, x3)) = [5/2] + [5/4]x1 + [13/4]x2 + [1/4]x3
POL(div_out_ggag(x1, x2, x3)) = [7/2] + [7/4]x1 + [5/2]x2 + [15/4]x3
POL(eq_in_ag(x1)) = [13/4] + [4]x1
POL(eq_in_gg(x1, x2)) = [7/2] + [5/4]x1 + [9/4]x2
POL(eq_out_ag(x1, x2)) = [3/2] + x1 + [5/4]x2
POL(eq_out_gg(x1, x2)) = [3] + [7/4]x1 + x2
POL(failure_in_g(x1)) = [1/4] + [5/2]x1
POL(minus_in_gga(x1, x2)) = [3/4] + [3/2]x1 + [7/2]x2
POL(minus_out_gga(x1, x2, x3)) = [3/4] + [9/4]x1 + [5/2]x2 + [13/4]x3
POL(no_divisor_in_list_in_gg(x1, x2)) = [9/4] + [1/2]x1 + [4]x2
POL(no_divisor_in_list_out_gg(x1, x2)) = [4] + [15/4]x1
POL(not_div_in_gg(x1, x2)) = [1] + [9/4]x1
POL(not_div_out_gg(x1, x2)) = [7/4] + [3/2]x1
POL(s(x1)) = x1
The value of delta used in the strict ordering is 27/32.
The following usable rules [FROCOS05] were oriented:
none
(124) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x1, x2, not_div_in_gg(s(s(s(z0))), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), z0, .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(x1, x2))) → U9_GGA(s(s(s(z0))), .(s(z0), .(x1, x2)), U12_gg(s(s(s(z0))), s(z0), .(x1, x2), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), s(s(z0)), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), s(z0), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X, X)
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
eq_in_ag(x0)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
eq_in_gg(x0, x1)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(125) NonTerminationProof (EQUIVALENT transformation)
We used the non-termination processor [FROCOS05] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.
s =
PRIME_NUMBER_IN_GGA(
s(
s(
z0)),
z1) evaluates to t =
PRIME_NUMBER_IN_GGA(
s(
s(
s(
z0))),
z1)
Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
- Semiunifier: [ ]
- Matcher: [z0 / s(z0)]
Rewriting sequenceThe DP semiunifies directly so there is only one rewrite step from PRIME_NUMBER_IN_GGA(s(s(z0)), z1) to PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1).
(126) FALSE
(127) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
PRIME_FACT_IN_AA(X, .(F, Fs)) → U3_AA(X, F, Fs, prime_number_in_a(P))
U3_AA(X, F, Fs, prime_number_out_a(P)) → U4_AA(X, F, Fs, P, div_in_agag(X, P, Q, 0))
U4_AA(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_AA(X, F, Fs, Q, eq_in_ag(F, P))
U5_AA(X, F, Fs, Q, eq_out_ag(F, P)) → PRIME_FACT_IN_AA(Q, Fs)
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1,
x2)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x1,
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x2,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x2,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x1,
x2,
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x1,
x3,
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag(
x1,
x2,
x4)
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x1,
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x1,
x3,
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg(
x1,
x2)
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x1,
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x1,
x2,
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x1,
x2,
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x1,
x2,
x4,
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x1,
x2,
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg(
x1,
x2)
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x1,
x2,
x3,
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x1,
x2,
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x1,
x2,
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x1,
x2,
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x1,
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x1,
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x1,
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x3,
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag(
x2,
x4)
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x1,
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x1,
x3,
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga(
x2)
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x2,
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x2,
x4,
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
PRIME_FACT_IN_AA(
x1,
x2) =
PRIME_FACT_IN_AA
U3_AA(
x1,
x2,
x3,
x4) =
U3_AA(
x4)
U4_AA(
x1,
x2,
x3,
x4,
x5) =
U4_AA(
x4,
x5)
U5_AA(
x1,
x2,
x3,
x4,
x5) =
U5_AA(
x5)
We have to consider all (P,R,Pi)-chains
(128) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(129) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
PRIME_FACT_IN_AA(X, .(F, Fs)) → U3_AA(X, F, Fs, prime_number_in_a(P))
U3_AA(X, F, Fs, prime_number_out_a(P)) → U4_AA(X, F, Fs, P, div_in_agag(X, P, Q, 0))
U4_AA(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_AA(X, F, Fs, Q, eq_in_ag(F, P))
U5_AA(X, F, Fs, Q, eq_out_ag(F, P)) → PRIME_FACT_IN_AA(Q, Fs)
The TRS R consists of the following rules:
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
eq_in_ag(X, X) → eq_out_ag(X, X)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The argument filtering Pi contains the following mapping:
0 =
0
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1,
x2)
[] =
[]
s(
x1) =
s(
x1)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x2,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg(
x1,
x2)
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x2,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x1,
x2,
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x1,
x3,
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag(
x1,
x2,
x4)
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x1,
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x1,
x3,
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg(
x1,
x2)
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x1,
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x1,
x2,
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x1,
x2,
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x1,
x2,
x4,
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x1,
x2,
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg(
x1,
x2)
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x1,
x2,
x3,
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x1,
x2,
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x1,
x2,
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x1,
x2,
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x3,
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag(
x2,
x4)
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x1,
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x1,
x3,
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga(
x2)
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x2,
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x2,
x4,
x5)
PRIME_FACT_IN_AA(
x1,
x2) =
PRIME_FACT_IN_AA
U3_AA(
x1,
x2,
x3,
x4) =
U3_AA(
x4)
U4_AA(
x1,
x2,
x3,
x4,
x5) =
U4_AA(
x4,
x5)
U5_AA(
x1,
x2,
x3,
x4,
x5) =
U5_AA(
x5)
We have to consider all (P,R,Pi)-chains
(130) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(131) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_FACT_IN_AA → U3_AA(prime_number_in_a)
U3_AA(prime_number_out_a(P)) → U4_AA(P, div_in_agag(P, 0))
U4_AA(P, div_out_agag(P, 0)) → U5_AA(eq_in_ag(P))
U5_AA(eq_out_ag(F, P)) → PRIME_FACT_IN_AA
The TRS R consists of the following rules:
prime_number_in_a → U7_a(prime_number_in_gga(s(s(0)), []))
div_in_agag(0, X7) → U16_agag(X7, failure_in_g(a))
div_in_agag(X8, R) → U17_agag(X8, R, eq_in_ag(0))
div_in_agag(Y, R) → U19_agag(Y, R, minus_in_aga(Y))
div_in_agag(X9, X) → div_out_agag(X9, X)
eq_in_ag(X) → eq_out_ag(X, X)
U7_a(prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U17_agag(X8, R, eq_out_ag(Z, 0)) → U18_agag(X8, R, eq_in_gg(R, 0))
U19_agag(Y, R, minus_out_aga(Y)) → U20_agag(Y, R, div_in_agag(Y, R))
prime_number_in_gga(C, Ps) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U9_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U11_gga(C, Ps, prime_number_in_gga(s(C), Ps))
U18_agag(X8, R, eq_out_gg(R, 0)) → div_out_agag(X8, R)
minus_in_aga(0) → minus_out_aga(0)
minus_in_aga(s(Y)) → U21_aga(Y, minus_in_aga(Y))
U20_agag(Y, R, div_out_agag(Y, R)) → div_out_agag(Y, R)
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
U9_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, prime_number_in_gga(s(C), .(C, Ps)))
U11_gga(C, Ps, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_aga(Y, minus_out_aga(Y)) → minus_out_aga(s(Y))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U10_gga(C, Ps, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(X5, X7, failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(X8, R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(X, Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag(X, X9, X)
U17_ggag(X8, R, eq_out_ag(Z, 0)) → U18_ggag(X8, R, eq_in_gg(R, 0))
U19_ggag(X, Y, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, R, div_in_ggag(U, Y, R))
U18_ggag(X8, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, R)
minus_in_gga(X, 0) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y)) → U21_gga(X, Y, minus_in_gga(X, Y))
U20_ggag(X, Y, R, div_out_ggag(U, Y, R)) → div_out_ggag(X, Y, R)
U21_gga(X, Y, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The set Q consists of the following terms:
prime_number_in_a
div_in_agag(x0, x1)
eq_in_ag(x0)
U7_a(x0)
U17_agag(x0, x1, x2)
U19_agag(x0, x1, x2)
prime_number_in_gga(x0, x1)
U18_agag(x0, x1, x2)
minus_in_aga(x0)
U20_agag(x0, x1, x2)
U8_gga(x0, x1, x2)
U9_gga(x0, x1, x2)
U11_gga(x0, x1, x2)
eq_in_gg(x0, x1)
U21_aga(x0, x1)
no_divisor_in_list_in_gg(x0, x1)
U10_gga(x0, x1, x2)
U12_gg(x0, x1, x2, x3)
not_div_in_gg(x0, x1)
U13_gg(x0, x1, x2, x3)
U14_gg(x0, x1, x2)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1, x2)
U19_ggag(x0, x1, x2, x3)
U18_ggag(x0, x1, x2)
minus_in_gga(x0, x1)
U20_ggag(x0, x1, x2, x3)
U21_gga(x0, x1, x2)
We have to consider all (P,Q,R)-chains.
(132) PrologToPiTRSProof (SOUND transformation)
We use the technique of [LOPSTR]. With regard to the inferred argument filtering the predicates were used in the following modes:
prime_fact_in: (b,f) (f,f)
prime_number_in: (f)
prime_number_in: (b,b,f)
no_divisor_in_list_in: (b,b)
not_div_in: (b,b)
div_in: (b,b,f,b) (f,b,f,b)
minus_in: (b,b,f) (f,b,f)
Transforming
Prolog into the following
Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog
(133) Obligation:
Pi-finite rewrite system:
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
(134) 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:
PRIME_FACT_IN_GA(0, L) → U1_GA(L, eq_in_ag(L, []))
PRIME_FACT_IN_GA(0, L) → EQ_IN_AG(L, [])
PRIME_FACT_IN_GA(s(0), L) → U2_GA(L, eq_in_ag(L, []))
PRIME_FACT_IN_GA(s(0), L) → EQ_IN_AG(L, [])
PRIME_FACT_IN_GA(X, .(F, Fs)) → U3_GA(X, F, Fs, prime_number_in_a(P))
PRIME_FACT_IN_GA(X, .(F, Fs)) → PRIME_NUMBER_IN_A(P)
PRIME_NUMBER_IN_A(X) → U7_A(X, prime_number_in_gga(s(s(0)), [], X))
PRIME_NUMBER_IN_A(X) → PRIME_NUMBER_IN_GGA(s(s(0)), [], X)
PRIME_NUMBER_IN_GGA(C, Ps, C) → U8_GGA(C, Ps, no_divisor_in_list_in_gg(C, Ps))
PRIME_NUMBER_IN_GGA(C, Ps, C) → NO_DIVISOR_IN_LIST_IN_GG(C, Ps)
NO_DIVISOR_IN_LIST_IN_GG(V, .(D, Ds)) → U12_GG(V, D, Ds, not_div_in_gg(V, D))
NO_DIVISOR_IN_LIST_IN_GG(V, .(D, Ds)) → NOT_DIV_IN_GG(V, D)
NOT_DIV_IN_GG(V, D) → U14_GG(V, D, div_in_ggag(V, D, X2, 0))
NOT_DIV_IN_GG(V, D) → DIV_IN_GGAG(V, D, X2, 0)
DIV_IN_GGAG(X5, 0, X6, X7) → U16_GGAG(X5, X6, X7, failure_in_g(a))
DIV_IN_GGAG(X5, 0, X6, X7) → FAILURE_IN_G(a)
DIV_IN_GGAG(0, X8, Z, R) → U17_GGAG(X8, Z, R, eq_in_ag(Z, 0))
DIV_IN_GGAG(0, X8, Z, R) → EQ_IN_AG(Z, 0)
U17_GGAG(X8, Z, R, eq_out_ag(Z, 0)) → U18_GGAG(X8, Z, R, eq_in_gg(R, 0))
U17_GGAG(X8, Z, R, eq_out_ag(Z, 0)) → EQ_IN_GG(R, 0)
DIV_IN_GGAG(X, Y, s(Z), R) → U19_GGAG(X, Y, Z, R, minus_in_gga(X, Y, U))
DIV_IN_GGAG(X, Y, s(Z), R) → MINUS_IN_GGA(X, Y, U)
MINUS_IN_GGA(s(X), s(Y), Z) → U21_GGA(X, Y, Z, minus_in_gga(X, Y, Z))
MINUS_IN_GGA(s(X), s(Y), Z) → MINUS_IN_GGA(X, Y, Z)
U19_GGAG(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_GGAG(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
U19_GGAG(X, Y, Z, R, minus_out_gga(X, Y, U)) → DIV_IN_GGAG(U, Y, Z, R)
U14_GG(V, D, div_out_ggag(V, D, X2, 0)) → U15_GG(V, D, failure_in_g(a))
U14_GG(V, D, div_out_ggag(V, D, X2, 0)) → FAILURE_IN_G(a)
U12_GG(V, D, Ds, not_div_out_gg(V, D)) → U13_GG(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U12_GG(V, D, Ds, not_div_out_gg(V, D)) → NO_DIVISOR_IN_LIST_IN_GG(V, Ds)
PRIME_NUMBER_IN_GGA(C, Ps, P) → U9_GGA(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
PRIME_NUMBER_IN_GGA(C, Ps, P) → NO_DIVISOR_IN_LIST_IN_GG(C, Ps)
U9_GGA(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_GGA(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
U9_GGA(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → PRIME_NUMBER_IN_GGA(s(C), .(C, Ps), P)
PRIME_NUMBER_IN_GGA(C, Ps, P) → U11_GGA(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
PRIME_NUMBER_IN_GGA(C, Ps, P) → PRIME_NUMBER_IN_GGA(s(C), Ps, P)
U3_GA(X, F, Fs, prime_number_out_a(P)) → U4_GA(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U3_GA(X, F, Fs, prime_number_out_a(P)) → DIV_IN_GGAG(X, P, Q, 0)
U4_GA(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_GA(X, F, Fs, Q, eq_in_ag(F, P))
U4_GA(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → EQ_IN_AG(F, P)
U5_GA(X, F, Fs, Q, eq_out_ag(F, P)) → U6_GA(X, F, Fs, prime_fact_in_aa(Q, Fs))
U5_GA(X, F, Fs, Q, eq_out_ag(F, P)) → PRIME_FACT_IN_AA(Q, Fs)
PRIME_FACT_IN_AA(0, L) → U1_AA(L, eq_in_ag(L, []))
PRIME_FACT_IN_AA(0, L) → EQ_IN_AG(L, [])
PRIME_FACT_IN_AA(s(0), L) → U2_AA(L, eq_in_ag(L, []))
PRIME_FACT_IN_AA(s(0), L) → EQ_IN_AG(L, [])
PRIME_FACT_IN_AA(X, .(F, Fs)) → U3_AA(X, F, Fs, prime_number_in_a(P))
PRIME_FACT_IN_AA(X, .(F, Fs)) → PRIME_NUMBER_IN_A(P)
U3_AA(X, F, Fs, prime_number_out_a(P)) → U4_AA(X, F, Fs, P, div_in_agag(X, P, Q, 0))
U3_AA(X, F, Fs, prime_number_out_a(P)) → DIV_IN_AGAG(X, P, Q, 0)
DIV_IN_AGAG(X5, 0, X6, X7) → U16_AGAG(X5, X6, X7, failure_in_g(a))
DIV_IN_AGAG(X5, 0, X6, X7) → FAILURE_IN_G(a)
DIV_IN_AGAG(0, X8, Z, R) → U17_AGAG(X8, Z, R, eq_in_ag(Z, 0))
DIV_IN_AGAG(0, X8, Z, R) → EQ_IN_AG(Z, 0)
U17_AGAG(X8, Z, R, eq_out_ag(Z, 0)) → U18_AGAG(X8, Z, R, eq_in_gg(R, 0))
U17_AGAG(X8, Z, R, eq_out_ag(Z, 0)) → EQ_IN_GG(R, 0)
DIV_IN_AGAG(X, Y, s(Z), R) → U19_AGAG(X, Y, Z, R, minus_in_aga(X, Y, U))
DIV_IN_AGAG(X, Y, s(Z), R) → MINUS_IN_AGA(X, Y, U)
MINUS_IN_AGA(s(X), s(Y), Z) → U21_AGA(X, Y, Z, minus_in_aga(X, Y, Z))
MINUS_IN_AGA(s(X), s(Y), Z) → MINUS_IN_AGA(X, Y, Z)
U19_AGAG(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_AGAG(X, Y, Z, R, div_in_agag(U, Y, Z, R))
U19_AGAG(X, Y, Z, R, minus_out_aga(X, Y, U)) → DIV_IN_AGAG(U, Y, Z, R)
U4_AA(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_AA(X, F, Fs, Q, eq_in_ag(F, P))
U4_AA(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → EQ_IN_AG(F, P)
U5_AA(X, F, Fs, Q, eq_out_ag(F, P)) → U6_AA(X, F, Fs, prime_fact_in_aa(Q, Fs))
U5_AA(X, F, Fs, Q, eq_out_ag(F, P)) → PRIME_FACT_IN_AA(Q, Fs)
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
PRIME_FACT_IN_GA(
x1,
x2) =
PRIME_FACT_IN_GA(
x1)
U1_GA(
x1,
x2) =
U1_GA(
x2)
EQ_IN_AG(
x1,
x2) =
EQ_IN_AG(
x2)
U2_GA(
x1,
x2) =
U2_GA(
x2)
U3_GA(
x1,
x2,
x3,
x4) =
U3_GA(
x1,
x4)
PRIME_NUMBER_IN_A(
x1) =
PRIME_NUMBER_IN_A
U7_A(
x1,
x2) =
U7_A(
x2)
PRIME_NUMBER_IN_GGA(
x1,
x2,
x3) =
PRIME_NUMBER_IN_GGA(
x1,
x2)
U8_GGA(
x1,
x2,
x3) =
U8_GGA(
x1,
x3)
NO_DIVISOR_IN_LIST_IN_GG(
x1,
x2) =
NO_DIVISOR_IN_LIST_IN_GG(
x1,
x2)
U12_GG(
x1,
x2,
x3,
x4) =
U12_GG(
x1,
x3,
x4)
NOT_DIV_IN_GG(
x1,
x2) =
NOT_DIV_IN_GG(
x1,
x2)
U14_GG(
x1,
x2,
x3) =
U14_GG(
x3)
DIV_IN_GGAG(
x1,
x2,
x3,
x4) =
DIV_IN_GGAG(
x1,
x2,
x4)
U16_GGAG(
x1,
x2,
x3,
x4) =
U16_GGAG(
x4)
FAILURE_IN_G(
x1) =
FAILURE_IN_G(
x1)
U17_GGAG(
x1,
x2,
x3,
x4) =
U17_GGAG(
x3,
x4)
U18_GGAG(
x1,
x2,
x3,
x4) =
U18_GGAG(
x4)
EQ_IN_GG(
x1,
x2) =
EQ_IN_GG(
x1,
x2)
U19_GGAG(
x1,
x2,
x3,
x4,
x5) =
U19_GGAG(
x2,
x4,
x5)
MINUS_IN_GGA(
x1,
x2,
x3) =
MINUS_IN_GGA(
x1,
x2)
U21_GGA(
x1,
x2,
x3,
x4) =
U21_GGA(
x4)
U20_GGAG(
x1,
x2,
x3,
x4,
x5) =
U20_GGAG(
x5)
U15_GG(
x1,
x2,
x3) =
U15_GG(
x3)
U13_GG(
x1,
x2,
x3,
x4) =
U13_GG(
x4)
U9_GGA(
x1,
x2,
x3,
x4) =
U9_GGA(
x1,
x2,
x4)
U10_GGA(
x1,
x2,
x3,
x4) =
U10_GGA(
x4)
U11_GGA(
x1,
x2,
x3,
x4) =
U11_GGA(
x4)
U4_GA(
x1,
x2,
x3,
x4,
x5) =
U4_GA(
x4,
x5)
U5_GA(
x1,
x2,
x3,
x4,
x5) =
U5_GA(
x5)
U6_GA(
x1,
x2,
x3,
x4) =
U6_GA(
x2,
x4)
PRIME_FACT_IN_AA(
x1,
x2) =
PRIME_FACT_IN_AA
U1_AA(
x1,
x2) =
U1_AA(
x2)
U2_AA(
x1,
x2) =
U2_AA(
x2)
U3_AA(
x1,
x2,
x3,
x4) =
U3_AA(
x4)
U4_AA(
x1,
x2,
x3,
x4,
x5) =
U4_AA(
x4,
x5)
DIV_IN_AGAG(
x1,
x2,
x3,
x4) =
DIV_IN_AGAG(
x2,
x4)
U16_AGAG(
x1,
x2,
x3,
x4) =
U16_AGAG(
x4)
U17_AGAG(
x1,
x2,
x3,
x4) =
U17_AGAG(
x3,
x4)
U18_AGAG(
x1,
x2,
x3,
x4) =
U18_AGAG(
x4)
U19_AGAG(
x1,
x2,
x3,
x4,
x5) =
U19_AGAG(
x2,
x4,
x5)
MINUS_IN_AGA(
x1,
x2,
x3) =
MINUS_IN_AGA(
x2)
U21_AGA(
x1,
x2,
x3,
x4) =
U21_AGA(
x4)
U20_AGAG(
x1,
x2,
x3,
x4,
x5) =
U20_AGAG(
x5)
U5_AA(
x1,
x2,
x3,
x4,
x5) =
U5_AA(
x5)
U6_AA(
x1,
x2,
x3,
x4) =
U6_AA(
x2,
x4)
We have to consider all (P,R,Pi)-chains
(135) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
PRIME_FACT_IN_GA(0, L) → U1_GA(L, eq_in_ag(L, []))
PRIME_FACT_IN_GA(0, L) → EQ_IN_AG(L, [])
PRIME_FACT_IN_GA(s(0), L) → U2_GA(L, eq_in_ag(L, []))
PRIME_FACT_IN_GA(s(0), L) → EQ_IN_AG(L, [])
PRIME_FACT_IN_GA(X, .(F, Fs)) → U3_GA(X, F, Fs, prime_number_in_a(P))
PRIME_FACT_IN_GA(X, .(F, Fs)) → PRIME_NUMBER_IN_A(P)
PRIME_NUMBER_IN_A(X) → U7_A(X, prime_number_in_gga(s(s(0)), [], X))
PRIME_NUMBER_IN_A(X) → PRIME_NUMBER_IN_GGA(s(s(0)), [], X)
PRIME_NUMBER_IN_GGA(C, Ps, C) → U8_GGA(C, Ps, no_divisor_in_list_in_gg(C, Ps))
PRIME_NUMBER_IN_GGA(C, Ps, C) → NO_DIVISOR_IN_LIST_IN_GG(C, Ps)
NO_DIVISOR_IN_LIST_IN_GG(V, .(D, Ds)) → U12_GG(V, D, Ds, not_div_in_gg(V, D))
NO_DIVISOR_IN_LIST_IN_GG(V, .(D, Ds)) → NOT_DIV_IN_GG(V, D)
NOT_DIV_IN_GG(V, D) → U14_GG(V, D, div_in_ggag(V, D, X2, 0))
NOT_DIV_IN_GG(V, D) → DIV_IN_GGAG(V, D, X2, 0)
DIV_IN_GGAG(X5, 0, X6, X7) → U16_GGAG(X5, X6, X7, failure_in_g(a))
DIV_IN_GGAG(X5, 0, X6, X7) → FAILURE_IN_G(a)
DIV_IN_GGAG(0, X8, Z, R) → U17_GGAG(X8, Z, R, eq_in_ag(Z, 0))
DIV_IN_GGAG(0, X8, Z, R) → EQ_IN_AG(Z, 0)
U17_GGAG(X8, Z, R, eq_out_ag(Z, 0)) → U18_GGAG(X8, Z, R, eq_in_gg(R, 0))
U17_GGAG(X8, Z, R, eq_out_ag(Z, 0)) → EQ_IN_GG(R, 0)
DIV_IN_GGAG(X, Y, s(Z), R) → U19_GGAG(X, Y, Z, R, minus_in_gga(X, Y, U))
DIV_IN_GGAG(X, Y, s(Z), R) → MINUS_IN_GGA(X, Y, U)
MINUS_IN_GGA(s(X), s(Y), Z) → U21_GGA(X, Y, Z, minus_in_gga(X, Y, Z))
MINUS_IN_GGA(s(X), s(Y), Z) → MINUS_IN_GGA(X, Y, Z)
U19_GGAG(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_GGAG(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
U19_GGAG(X, Y, Z, R, minus_out_gga(X, Y, U)) → DIV_IN_GGAG(U, Y, Z, R)
U14_GG(V, D, div_out_ggag(V, D, X2, 0)) → U15_GG(V, D, failure_in_g(a))
U14_GG(V, D, div_out_ggag(V, D, X2, 0)) → FAILURE_IN_G(a)
U12_GG(V, D, Ds, not_div_out_gg(V, D)) → U13_GG(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U12_GG(V, D, Ds, not_div_out_gg(V, D)) → NO_DIVISOR_IN_LIST_IN_GG(V, Ds)
PRIME_NUMBER_IN_GGA(C, Ps, P) → U9_GGA(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
PRIME_NUMBER_IN_GGA(C, Ps, P) → NO_DIVISOR_IN_LIST_IN_GG(C, Ps)
U9_GGA(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_GGA(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
U9_GGA(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → PRIME_NUMBER_IN_GGA(s(C), .(C, Ps), P)
PRIME_NUMBER_IN_GGA(C, Ps, P) → U11_GGA(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
PRIME_NUMBER_IN_GGA(C, Ps, P) → PRIME_NUMBER_IN_GGA(s(C), Ps, P)
U3_GA(X, F, Fs, prime_number_out_a(P)) → U4_GA(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U3_GA(X, F, Fs, prime_number_out_a(P)) → DIV_IN_GGAG(X, P, Q, 0)
U4_GA(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_GA(X, F, Fs, Q, eq_in_ag(F, P))
U4_GA(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → EQ_IN_AG(F, P)
U5_GA(X, F, Fs, Q, eq_out_ag(F, P)) → U6_GA(X, F, Fs, prime_fact_in_aa(Q, Fs))
U5_GA(X, F, Fs, Q, eq_out_ag(F, P)) → PRIME_FACT_IN_AA(Q, Fs)
PRIME_FACT_IN_AA(0, L) → U1_AA(L, eq_in_ag(L, []))
PRIME_FACT_IN_AA(0, L) → EQ_IN_AG(L, [])
PRIME_FACT_IN_AA(s(0), L) → U2_AA(L, eq_in_ag(L, []))
PRIME_FACT_IN_AA(s(0), L) → EQ_IN_AG(L, [])
PRIME_FACT_IN_AA(X, .(F, Fs)) → U3_AA(X, F, Fs, prime_number_in_a(P))
PRIME_FACT_IN_AA(X, .(F, Fs)) → PRIME_NUMBER_IN_A(P)
U3_AA(X, F, Fs, prime_number_out_a(P)) → U4_AA(X, F, Fs, P, div_in_agag(X, P, Q, 0))
U3_AA(X, F, Fs, prime_number_out_a(P)) → DIV_IN_AGAG(X, P, Q, 0)
DIV_IN_AGAG(X5, 0, X6, X7) → U16_AGAG(X5, X6, X7, failure_in_g(a))
DIV_IN_AGAG(X5, 0, X6, X7) → FAILURE_IN_G(a)
DIV_IN_AGAG(0, X8, Z, R) → U17_AGAG(X8, Z, R, eq_in_ag(Z, 0))
DIV_IN_AGAG(0, X8, Z, R) → EQ_IN_AG(Z, 0)
U17_AGAG(X8, Z, R, eq_out_ag(Z, 0)) → U18_AGAG(X8, Z, R, eq_in_gg(R, 0))
U17_AGAG(X8, Z, R, eq_out_ag(Z, 0)) → EQ_IN_GG(R, 0)
DIV_IN_AGAG(X, Y, s(Z), R) → U19_AGAG(X, Y, Z, R, minus_in_aga(X, Y, U))
DIV_IN_AGAG(X, Y, s(Z), R) → MINUS_IN_AGA(X, Y, U)
MINUS_IN_AGA(s(X), s(Y), Z) → U21_AGA(X, Y, Z, minus_in_aga(X, Y, Z))
MINUS_IN_AGA(s(X), s(Y), Z) → MINUS_IN_AGA(X, Y, Z)
U19_AGAG(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_AGAG(X, Y, Z, R, div_in_agag(U, Y, Z, R))
U19_AGAG(X, Y, Z, R, minus_out_aga(X, Y, U)) → DIV_IN_AGAG(U, Y, Z, R)
U4_AA(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_AA(X, F, Fs, Q, eq_in_ag(F, P))
U4_AA(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → EQ_IN_AG(F, P)
U5_AA(X, F, Fs, Q, eq_out_ag(F, P)) → U6_AA(X, F, Fs, prime_fact_in_aa(Q, Fs))
U5_AA(X, F, Fs, Q, eq_out_ag(F, P)) → PRIME_FACT_IN_AA(Q, Fs)
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
PRIME_FACT_IN_GA(
x1,
x2) =
PRIME_FACT_IN_GA(
x1)
U1_GA(
x1,
x2) =
U1_GA(
x2)
EQ_IN_AG(
x1,
x2) =
EQ_IN_AG(
x2)
U2_GA(
x1,
x2) =
U2_GA(
x2)
U3_GA(
x1,
x2,
x3,
x4) =
U3_GA(
x1,
x4)
PRIME_NUMBER_IN_A(
x1) =
PRIME_NUMBER_IN_A
U7_A(
x1,
x2) =
U7_A(
x2)
PRIME_NUMBER_IN_GGA(
x1,
x2,
x3) =
PRIME_NUMBER_IN_GGA(
x1,
x2)
U8_GGA(
x1,
x2,
x3) =
U8_GGA(
x1,
x3)
NO_DIVISOR_IN_LIST_IN_GG(
x1,
x2) =
NO_DIVISOR_IN_LIST_IN_GG(
x1,
x2)
U12_GG(
x1,
x2,
x3,
x4) =
U12_GG(
x1,
x3,
x4)
NOT_DIV_IN_GG(
x1,
x2) =
NOT_DIV_IN_GG(
x1,
x2)
U14_GG(
x1,
x2,
x3) =
U14_GG(
x3)
DIV_IN_GGAG(
x1,
x2,
x3,
x4) =
DIV_IN_GGAG(
x1,
x2,
x4)
U16_GGAG(
x1,
x2,
x3,
x4) =
U16_GGAG(
x4)
FAILURE_IN_G(
x1) =
FAILURE_IN_G(
x1)
U17_GGAG(
x1,
x2,
x3,
x4) =
U17_GGAG(
x3,
x4)
U18_GGAG(
x1,
x2,
x3,
x4) =
U18_GGAG(
x4)
EQ_IN_GG(
x1,
x2) =
EQ_IN_GG(
x1,
x2)
U19_GGAG(
x1,
x2,
x3,
x4,
x5) =
U19_GGAG(
x2,
x4,
x5)
MINUS_IN_GGA(
x1,
x2,
x3) =
MINUS_IN_GGA(
x1,
x2)
U21_GGA(
x1,
x2,
x3,
x4) =
U21_GGA(
x4)
U20_GGAG(
x1,
x2,
x3,
x4,
x5) =
U20_GGAG(
x5)
U15_GG(
x1,
x2,
x3) =
U15_GG(
x3)
U13_GG(
x1,
x2,
x3,
x4) =
U13_GG(
x4)
U9_GGA(
x1,
x2,
x3,
x4) =
U9_GGA(
x1,
x2,
x4)
U10_GGA(
x1,
x2,
x3,
x4) =
U10_GGA(
x4)
U11_GGA(
x1,
x2,
x3,
x4) =
U11_GGA(
x4)
U4_GA(
x1,
x2,
x3,
x4,
x5) =
U4_GA(
x4,
x5)
U5_GA(
x1,
x2,
x3,
x4,
x5) =
U5_GA(
x5)
U6_GA(
x1,
x2,
x3,
x4) =
U6_GA(
x2,
x4)
PRIME_FACT_IN_AA(
x1,
x2) =
PRIME_FACT_IN_AA
U1_AA(
x1,
x2) =
U1_AA(
x2)
U2_AA(
x1,
x2) =
U2_AA(
x2)
U3_AA(
x1,
x2,
x3,
x4) =
U3_AA(
x4)
U4_AA(
x1,
x2,
x3,
x4,
x5) =
U4_AA(
x4,
x5)
DIV_IN_AGAG(
x1,
x2,
x3,
x4) =
DIV_IN_AGAG(
x2,
x4)
U16_AGAG(
x1,
x2,
x3,
x4) =
U16_AGAG(
x4)
U17_AGAG(
x1,
x2,
x3,
x4) =
U17_AGAG(
x3,
x4)
U18_AGAG(
x1,
x2,
x3,
x4) =
U18_AGAG(
x4)
U19_AGAG(
x1,
x2,
x3,
x4,
x5) =
U19_AGAG(
x2,
x4,
x5)
MINUS_IN_AGA(
x1,
x2,
x3) =
MINUS_IN_AGA(
x2)
U21_AGA(
x1,
x2,
x3,
x4) =
U21_AGA(
x4)
U20_AGAG(
x1,
x2,
x3,
x4,
x5) =
U20_AGAG(
x5)
U5_AA(
x1,
x2,
x3,
x4,
x5) =
U5_AA(
x5)
U6_AA(
x1,
x2,
x3,
x4) =
U6_AA(
x2,
x4)
We have to consider all (P,R,Pi)-chains
(136) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LOPSTR] contains 7 SCCs with 51 less nodes.
(137) Complex Obligation (AND)
(138) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
MINUS_IN_AGA(s(X), s(Y), Z) → MINUS_IN_AGA(X, Y, Z)
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
MINUS_IN_AGA(
x1,
x2,
x3) =
MINUS_IN_AGA(
x2)
We have to consider all (P,R,Pi)-chains
(139) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(140) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
MINUS_IN_AGA(s(X), s(Y), Z) → MINUS_IN_AGA(X, Y, Z)
R is empty.
The argument filtering Pi contains the following mapping:
s(
x1) =
s(
x1)
MINUS_IN_AGA(
x1,
x2,
x3) =
MINUS_IN_AGA(
x2)
We have to consider all (P,R,Pi)-chains
(141) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(142) Obligation:
Q DP problem:
The TRS P consists of the following rules:
MINUS_IN_AGA(s(Y)) → MINUS_IN_AGA(Y)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(143) 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:
- MINUS_IN_AGA(s(Y)) → MINUS_IN_AGA(Y)
The graph contains the following edges 1 > 1
(144) TRUE
(145) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
DIV_IN_AGAG(X, Y, s(Z), R) → U19_AGAG(X, Y, Z, R, minus_in_aga(X, Y, U))
U19_AGAG(X, Y, Z, R, minus_out_aga(X, Y, U)) → DIV_IN_AGAG(U, Y, Z, R)
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
DIV_IN_AGAG(
x1,
x2,
x3,
x4) =
DIV_IN_AGAG(
x2,
x4)
U19_AGAG(
x1,
x2,
x3,
x4,
x5) =
U19_AGAG(
x2,
x4,
x5)
We have to consider all (P,R,Pi)-chains
(146) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(147) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
DIV_IN_AGAG(X, Y, s(Z), R) → U19_AGAG(X, Y, Z, R, minus_in_aga(X, Y, U))
U19_AGAG(X, Y, Z, R, minus_out_aga(X, Y, U)) → DIV_IN_AGAG(U, Y, Z, R)
The TRS R consists of the following rules:
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
The argument filtering Pi contains the following mapping:
0 =
0
s(
x1) =
s(
x1)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x4)
DIV_IN_AGAG(
x1,
x2,
x3,
x4) =
DIV_IN_AGAG(
x2,
x4)
U19_AGAG(
x1,
x2,
x3,
x4,
x5) =
U19_AGAG(
x2,
x4,
x5)
We have to consider all (P,R,Pi)-chains
(148) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(149) Obligation:
Q DP problem:
The TRS P consists of the following rules:
DIV_IN_AGAG(Y, R) → U19_AGAG(Y, R, minus_in_aga(Y))
U19_AGAG(Y, R, minus_out_aga) → DIV_IN_AGAG(Y, R)
The TRS R consists of the following rules:
minus_in_aga(0) → minus_out_aga
minus_in_aga(s(Y)) → U21_aga(minus_in_aga(Y))
U21_aga(minus_out_aga) → minus_out_aga
The set Q consists of the following terms:
minus_in_aga(x0)
U21_aga(x0)
We have to consider all (P,Q,R)-chains.
(150) Narrowing (SOUND transformation)
By narrowing [LPAR04] the rule
DIV_IN_AGAG(
Y,
R) →
U19_AGAG(
Y,
R,
minus_in_aga(
Y)) at position [2] we obtained the following new rules [LPAR04]:
DIV_IN_AGAG(0, y1) → U19_AGAG(0, y1, minus_out_aga)
DIV_IN_AGAG(s(x0), y1) → U19_AGAG(s(x0), y1, U21_aga(minus_in_aga(x0)))
(151) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_AGAG(Y, R, minus_out_aga) → DIV_IN_AGAG(Y, R)
DIV_IN_AGAG(0, y1) → U19_AGAG(0, y1, minus_out_aga)
DIV_IN_AGAG(s(x0), y1) → U19_AGAG(s(x0), y1, U21_aga(minus_in_aga(x0)))
The TRS R consists of the following rules:
minus_in_aga(0) → minus_out_aga
minus_in_aga(s(Y)) → U21_aga(minus_in_aga(Y))
U21_aga(minus_out_aga) → minus_out_aga
The set Q consists of the following terms:
minus_in_aga(x0)
U21_aga(x0)
We have to consider all (P,Q,R)-chains.
(152) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
U19_AGAG(
Y,
R,
minus_out_aga) →
DIV_IN_AGAG(
Y,
R) we obtained the following new rules [LPAR04]:
U19_AGAG(0, z0, minus_out_aga) → DIV_IN_AGAG(0, z0)
U19_AGAG(s(z0), z1, minus_out_aga) → DIV_IN_AGAG(s(z0), z1)
(153) Obligation:
Q DP problem:
The TRS P consists of the following rules:
DIV_IN_AGAG(0, y1) → U19_AGAG(0, y1, minus_out_aga)
DIV_IN_AGAG(s(x0), y1) → U19_AGAG(s(x0), y1, U21_aga(minus_in_aga(x0)))
U19_AGAG(0, z0, minus_out_aga) → DIV_IN_AGAG(0, z0)
U19_AGAG(s(z0), z1, minus_out_aga) → DIV_IN_AGAG(s(z0), z1)
The TRS R consists of the following rules:
minus_in_aga(0) → minus_out_aga
minus_in_aga(s(Y)) → U21_aga(minus_in_aga(Y))
U21_aga(minus_out_aga) → minus_out_aga
The set Q consists of the following terms:
minus_in_aga(x0)
U21_aga(x0)
We have to consider all (P,Q,R)-chains.
(154) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 2 SCCs.
(155) Complex Obligation (AND)
(156) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_AGAG(s(z0), z1, minus_out_aga) → DIV_IN_AGAG(s(z0), z1)
DIV_IN_AGAG(s(x0), y1) → U19_AGAG(s(x0), y1, U21_aga(minus_in_aga(x0)))
The TRS R consists of the following rules:
minus_in_aga(0) → minus_out_aga
minus_in_aga(s(Y)) → U21_aga(minus_in_aga(Y))
U21_aga(minus_out_aga) → minus_out_aga
The set Q consists of the following terms:
minus_in_aga(x0)
U21_aga(x0)
We have to consider all (P,Q,R)-chains.
(157) 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 =
U19_AGAG(
s(
z0),
z1,
U21_aga(
minus_in_aga(
0))) evaluates to t =
U19_AGAG(
s(
z0),
z1,
U21_aga(
minus_in_aga(
z0)))
Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
- Semiunifier: [z0 / 0]
- Matcher: [ ]
Rewriting sequenceU19_AGAG(s(0), z1, U21_aga(minus_in_aga(0))) →
U19_AGAG(
s(
0),
z1,
U21_aga(
minus_out_aga))
with rule
minus_in_aga(
0) →
minus_out_aga at position [2,0] and matcher [ ]
U19_AGAG(s(0), z1, U21_aga(minus_out_aga)) →
U19_AGAG(
s(
0),
z1,
minus_out_aga)
with rule
U21_aga(
minus_out_aga) →
minus_out_aga at position [2] and matcher [ ]
U19_AGAG(s(0), z1, minus_out_aga) →
DIV_IN_AGAG(
s(
0),
z1)
with rule
U19_AGAG(
s(
z0),
z1',
minus_out_aga) →
DIV_IN_AGAG(
s(
z0),
z1') at position [] and matcher [
z0 /
0,
z1' /
z1]
DIV_IN_AGAG(s(0), z1) →
U19_AGAG(
s(
0),
z1,
U21_aga(
minus_in_aga(
0)))
with rule
DIV_IN_AGAG(
s(
x0),
y1) →
U19_AGAG(
s(
x0),
y1,
U21_aga(
minus_in_aga(
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.
(158) FALSE
(159) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_AGAG(0, z0, minus_out_aga) → DIV_IN_AGAG(0, z0)
DIV_IN_AGAG(0, y1) → U19_AGAG(0, y1, minus_out_aga)
The TRS R consists of the following rules:
minus_in_aga(0) → minus_out_aga
minus_in_aga(s(Y)) → U21_aga(minus_in_aga(Y))
U21_aga(minus_out_aga) → minus_out_aga
The set Q consists of the following terms:
minus_in_aga(x0)
U21_aga(x0)
We have to consider all (P,Q,R)-chains.
(160) 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.
(161) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_AGAG(0, z0, minus_out_aga) → DIV_IN_AGAG(0, z0)
DIV_IN_AGAG(0, y1) → U19_AGAG(0, y1, minus_out_aga)
R is empty.
The set Q consists of the following terms:
minus_in_aga(x0)
U21_aga(x0)
We have to consider all (P,Q,R)-chains.
(162) 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].
minus_in_aga(x0)
U21_aga(x0)
(163) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_AGAG(0, z0, minus_out_aga) → DIV_IN_AGAG(0, z0)
DIV_IN_AGAG(0, y1) → U19_AGAG(0, y1, minus_out_aga)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(164) 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 =
DIV_IN_AGAG(
0,
y1) evaluates to t =
DIV_IN_AGAG(
0,
y1)
Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
- Matcher: [ ]
- Semiunifier: [ ]
Rewriting sequenceDIV_IN_AGAG(0, y1) →
U19_AGAG(
0,
y1,
minus_out_aga)
with rule
DIV_IN_AGAG(
0,
y1') →
U19_AGAG(
0,
y1',
minus_out_aga) at position [] and matcher [
y1' /
y1]
U19_AGAG(0, y1, minus_out_aga) →
DIV_IN_AGAG(
0,
y1)
with rule
U19_AGAG(
0,
z0,
minus_out_aga) →
DIV_IN_AGAG(
0,
z0)
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.
(165) FALSE
(166) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
MINUS_IN_GGA(s(X), s(Y), Z) → MINUS_IN_GGA(X, Y, Z)
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
MINUS_IN_GGA(
x1,
x2,
x3) =
MINUS_IN_GGA(
x1,
x2)
We have to consider all (P,R,Pi)-chains
(167) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(168) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
MINUS_IN_GGA(s(X), s(Y), Z) → MINUS_IN_GGA(X, Y, Z)
R is empty.
The argument filtering Pi contains the following mapping:
s(
x1) =
s(
x1)
MINUS_IN_GGA(
x1,
x2,
x3) =
MINUS_IN_GGA(
x1,
x2)
We have to consider all (P,R,Pi)-chains
(169) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(170) Obligation:
Q DP problem:
The TRS P consists of the following rules:
MINUS_IN_GGA(s(X), s(Y)) → MINUS_IN_GGA(X, Y)
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(171) 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:
- MINUS_IN_GGA(s(X), s(Y)) → MINUS_IN_GGA(X, Y)
The graph contains the following edges 1 > 1, 2 > 2
(172) TRUE
(173) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
DIV_IN_GGAG(X, Y, s(Z), R) → U19_GGAG(X, Y, Z, R, minus_in_gga(X, Y, U))
U19_GGAG(X, Y, Z, R, minus_out_gga(X, Y, U)) → DIV_IN_GGAG(U, Y, Z, R)
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
DIV_IN_GGAG(
x1,
x2,
x3,
x4) =
DIV_IN_GGAG(
x1,
x2,
x4)
U19_GGAG(
x1,
x2,
x3,
x4,
x5) =
U19_GGAG(
x2,
x4,
x5)
We have to consider all (P,R,Pi)-chains
(174) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(175) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
DIV_IN_GGAG(X, Y, s(Z), R) → U19_GGAG(X, Y, Z, R, minus_in_gga(X, Y, U))
U19_GGAG(X, Y, Z, R, minus_out_gga(X, Y, U)) → DIV_IN_GGAG(U, Y, Z, R)
The TRS R consists of the following rules:
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The argument filtering Pi contains the following mapping:
0 =
0
s(
x1) =
s(
x1)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x4)
DIV_IN_GGAG(
x1,
x2,
x3,
x4) =
DIV_IN_GGAG(
x1,
x2,
x4)
U19_GGAG(
x1,
x2,
x3,
x4,
x5) =
U19_GGAG(
x2,
x4,
x5)
We have to consider all (P,R,Pi)-chains
(176) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(177) Obligation:
Q DP problem:
The TRS P consists of the following rules:
DIV_IN_GGAG(X, Y, R) → U19_GGAG(Y, R, minus_in_gga(X, Y))
U19_GGAG(Y, R, minus_out_gga(U)) → DIV_IN_GGAG(U, Y, R)
The TRS R consists of the following rules:
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
minus_in_gga(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(178) Narrowing (SOUND transformation)
By narrowing [LPAR04] the rule
DIV_IN_GGAG(
X,
Y,
R) →
U19_GGAG(
Y,
R,
minus_in_gga(
X,
Y)) at position [2] we obtained the following new rules [LPAR04]:
DIV_IN_GGAG(x0, 0, y2) → U19_GGAG(0, y2, minus_out_gga(x0))
DIV_IN_GGAG(s(x0), s(x1), y2) → U19_GGAG(s(x1), y2, U21_gga(minus_in_gga(x0, x1)))
(179) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_GGAG(Y, R, minus_out_gga(U)) → DIV_IN_GGAG(U, Y, R)
DIV_IN_GGAG(x0, 0, y2) → U19_GGAG(0, y2, minus_out_gga(x0))
DIV_IN_GGAG(s(x0), s(x1), y2) → U19_GGAG(s(x1), y2, U21_gga(minus_in_gga(x0, x1)))
The TRS R consists of the following rules:
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
minus_in_gga(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(180) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
U19_GGAG(
Y,
R,
minus_out_gga(
U)) →
DIV_IN_GGAG(
U,
Y,
R) we obtained the following new rules [LPAR04]:
U19_GGAG(0, z1, minus_out_gga(z0)) → DIV_IN_GGAG(z0, 0, z1)
U19_GGAG(s(z1), z2, minus_out_gga(x2)) → DIV_IN_GGAG(x2, s(z1), z2)
(181) Obligation:
Q DP problem:
The TRS P consists of the following rules:
DIV_IN_GGAG(x0, 0, y2) → U19_GGAG(0, y2, minus_out_gga(x0))
DIV_IN_GGAG(s(x0), s(x1), y2) → U19_GGAG(s(x1), y2, U21_gga(minus_in_gga(x0, x1)))
U19_GGAG(0, z1, minus_out_gga(z0)) → DIV_IN_GGAG(z0, 0, z1)
U19_GGAG(s(z1), z2, minus_out_gga(x2)) → DIV_IN_GGAG(x2, s(z1), z2)
The TRS R consists of the following rules:
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
minus_in_gga(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(182) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 2 SCCs.
(183) Complex Obligation (AND)
(184) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_GGAG(s(z1), z2, minus_out_gga(x2)) → DIV_IN_GGAG(x2, s(z1), z2)
DIV_IN_GGAG(s(x0), s(x1), y2) → U19_GGAG(s(x1), y2, U21_gga(minus_in_gga(x0, x1)))
The TRS R consists of the following rules:
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
minus_in_gga(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(185) ForwardInstantiation (EQUIVALENT transformation)
By forward instantiating [JAR06] the rule
U19_GGAG(
s(
z1),
z2,
minus_out_gga(
x2)) →
DIV_IN_GGAG(
x2,
s(
z1),
z2) we obtained the following new rules [LPAR04]:
U19_GGAG(s(x0), x1, minus_out_gga(s(y_0))) → DIV_IN_GGAG(s(y_0), s(x0), x1)
(186) Obligation:
Q DP problem:
The TRS P consists of the following rules:
DIV_IN_GGAG(s(x0), s(x1), y2) → U19_GGAG(s(x1), y2, U21_gga(minus_in_gga(x0, x1)))
U19_GGAG(s(x0), x1, minus_out_gga(s(y_0))) → DIV_IN_GGAG(s(y_0), s(x0), x1)
The TRS R consists of the following rules:
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
minus_in_gga(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(187) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04].
The following pairs can be oriented strictly and are deleted.
DIV_IN_GGAG(s(x0), s(x1), y2) → U19_GGAG(s(x1), y2, U21_gga(minus_in_gga(x0, x1)))
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:
POL(0) = 0
POL(DIV_IN_GGAG(x1, x2, x3)) = x1
POL(U19_GGAG(x1, x2, x3)) = x3
POL(U21_gga(x1)) = x1
POL(minus_in_gga(x1, x2)) = x1
POL(minus_out_gga(x1)) = x1
POL(s(x1)) = 1 + x1
The following usable rules [FROCOS05] were oriented:
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
(188) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_GGAG(s(x0), x1, minus_out_gga(s(y_0))) → DIV_IN_GGAG(s(y_0), s(x0), x1)
The TRS R consists of the following rules:
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
minus_in_gga(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(189) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 1 less node.
(190) TRUE
(191) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_GGAG(0, z1, minus_out_gga(z0)) → DIV_IN_GGAG(z0, 0, z1)
DIV_IN_GGAG(x0, 0, y2) → U19_GGAG(0, y2, minus_out_gga(x0))
The TRS R consists of the following rules:
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
minus_in_gga(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(192) 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.
(193) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_GGAG(0, z1, minus_out_gga(z0)) → DIV_IN_GGAG(z0, 0, z1)
DIV_IN_GGAG(x0, 0, y2) → U19_GGAG(0, y2, minus_out_gga(x0))
R is empty.
The set Q consists of the following terms:
minus_in_gga(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(194) 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].
minus_in_gga(x0, x1)
U21_gga(x0)
(195) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U19_GGAG(0, z1, minus_out_gga(z0)) → DIV_IN_GGAG(z0, 0, z1)
DIV_IN_GGAG(x0, 0, y2) → U19_GGAG(0, y2, minus_out_gga(x0))
R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
(196) 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 =
DIV_IN_GGAG(
x0,
0,
y2) evaluates to t =
DIV_IN_GGAG(
x0,
0,
y2)
Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
- Semiunifier: [ ]
- Matcher: [ ]
Rewriting sequenceDIV_IN_GGAG(x0, 0, y2) →
U19_GGAG(
0,
y2,
minus_out_gga(
x0))
with rule
DIV_IN_GGAG(
x0',
0,
y2') →
U19_GGAG(
0,
y2',
minus_out_gga(
x0')) at position [] and matcher [
x0' /
x0,
y2' /
y2]
U19_GGAG(0, y2, minus_out_gga(x0)) →
DIV_IN_GGAG(
x0,
0,
y2)
with rule
U19_GGAG(
0,
z1,
minus_out_gga(
z0)) →
DIV_IN_GGAG(
z0,
0,
z1)
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.
(197) FALSE
(198) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
U12_GG(V, D, Ds, not_div_out_gg(V, D)) → NO_DIVISOR_IN_LIST_IN_GG(V, Ds)
NO_DIVISOR_IN_LIST_IN_GG(V, .(D, Ds)) → U12_GG(V, D, Ds, not_div_in_gg(V, D))
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
NO_DIVISOR_IN_LIST_IN_GG(
x1,
x2) =
NO_DIVISOR_IN_LIST_IN_GG(
x1,
x2)
U12_GG(
x1,
x2,
x3,
x4) =
U12_GG(
x1,
x3,
x4)
We have to consider all (P,R,Pi)-chains
(199) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(200) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
U12_GG(V, D, Ds, not_div_out_gg(V, D)) → NO_DIVISOR_IN_LIST_IN_GG(V, Ds)
NO_DIVISOR_IN_LIST_IN_GG(V, .(D, Ds)) → U12_GG(V, D, Ds, not_div_in_gg(V, D))
The TRS R consists of the following rules:
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
eq_in_ag(X, X) → eq_out_ag(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The argument filtering Pi contains the following mapping:
0 =
0
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1)
s(
x1) =
s(
x1)
.(
x1,
x2) =
.(
x1,
x2)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg
NO_DIVISOR_IN_LIST_IN_GG(
x1,
x2) =
NO_DIVISOR_IN_LIST_IN_GG(
x1,
x2)
U12_GG(
x1,
x2,
x3,
x4) =
U12_GG(
x1,
x3,
x4)
We have to consider all (P,R,Pi)-chains
(201) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(202) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U12_GG(V, Ds, not_div_out_gg) → NO_DIVISOR_IN_LIST_IN_GG(V, Ds)
NO_DIVISOR_IN_LIST_IN_GG(V, .(D, Ds)) → U12_GG(V, Ds, not_div_in_gg(V, D))
The TRS R consists of the following rules:
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
not_div_in_gg(x0, x1)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(203) 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:
- NO_DIVISOR_IN_LIST_IN_GG(V, .(D, Ds)) → U12_GG(V, Ds, not_div_in_gg(V, D))
The graph contains the following edges 1 >= 1, 2 > 2
- U12_GG(V, Ds, not_div_out_gg) → NO_DIVISOR_IN_LIST_IN_GG(V, Ds)
The graph contains the following edges 1 >= 1, 2 >= 2
(204) TRUE
(205) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(C, Ps, P) → U9_GGA(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_GGA(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → PRIME_NUMBER_IN_GGA(s(C), .(C, Ps), P)
PRIME_NUMBER_IN_GGA(C, Ps, P) → PRIME_NUMBER_IN_GGA(s(C), Ps, P)
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
PRIME_NUMBER_IN_GGA(
x1,
x2,
x3) =
PRIME_NUMBER_IN_GGA(
x1,
x2)
U9_GGA(
x1,
x2,
x3,
x4) =
U9_GGA(
x1,
x2,
x4)
We have to consider all (P,R,Pi)-chains
(206) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(207) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(C, Ps, P) → U9_GGA(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_GGA(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → PRIME_NUMBER_IN_GGA(s(C), .(C, Ps), P)
PRIME_NUMBER_IN_GGA(C, Ps, P) → PRIME_NUMBER_IN_GGA(s(C), Ps, P)
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
eq_in_ag(X, X) → eq_out_ag(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The argument filtering Pi contains the following mapping:
0 =
0
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1)
[] =
[]
s(
x1) =
s(
x1)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x4)
PRIME_NUMBER_IN_GGA(
x1,
x2,
x3) =
PRIME_NUMBER_IN_GGA(
x1,
x2)
U9_GGA(
x1,
x2,
x3,
x4) =
U9_GGA(
x1,
x2,
x4)
We have to consider all (P,R,Pi)-chains
(208) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(209) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(C, Ps) → U9_GGA(C, Ps, no_divisor_in_list_in_gg(C, Ps))
U9_GGA(C, Ps, no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(C), .(C, Ps))
PRIME_NUMBER_IN_GGA(C, Ps) → PRIME_NUMBER_IN_GGA(s(C), Ps)
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(210) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
C,
Ps) →
U9_GGA(
C,
Ps,
no_divisor_in_list_in_gg(
C,
Ps)) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(z0), .(z0, z1)) → U9_GGA(s(z0), .(z0, z1), no_divisor_in_list_in_gg(s(z0), .(z0, z1)))
PRIME_NUMBER_IN_GGA(s(z0), z1) → U9_GGA(s(z0), z1, no_divisor_in_list_in_gg(s(z0), z1))
(211) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U9_GGA(C, Ps, no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(C), .(C, Ps))
PRIME_NUMBER_IN_GGA(C, Ps) → PRIME_NUMBER_IN_GGA(s(C), Ps)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, z1)) → U9_GGA(s(z0), .(z0, z1), no_divisor_in_list_in_gg(s(z0), .(z0, z1)))
PRIME_NUMBER_IN_GGA(s(z0), z1) → U9_GGA(s(z0), z1, no_divisor_in_list_in_gg(s(z0), z1))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(212) Narrowing (SOUND transformation)
By narrowing [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
C,
Ps) →
U9_GGA(
C,
Ps,
no_divisor_in_list_in_gg(
C,
Ps)) at position [2] we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(x0, []) → U9_GGA(x0, [], no_divisor_in_list_out_gg)
PRIME_NUMBER_IN_GGA(x0, .(x1, x2)) → U9_GGA(x0, .(x1, x2), U12_gg(x0, x2, not_div_in_gg(x0, x1)))
(213) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U9_GGA(C, Ps, no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(C), .(C, Ps))
PRIME_NUMBER_IN_GGA(C, Ps) → PRIME_NUMBER_IN_GGA(s(C), Ps)
PRIME_NUMBER_IN_GGA(x0, []) → U9_GGA(x0, [], no_divisor_in_list_out_gg)
PRIME_NUMBER_IN_GGA(x0, .(x1, x2)) → U9_GGA(x0, .(x1, x2), U12_gg(x0, x2, not_div_in_gg(x0, x1)))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(214) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
U9_GGA(
C,
Ps,
no_divisor_in_list_out_gg) →
PRIME_NUMBER_IN_GGA(
s(
C),
.(
C,
Ps)) we obtained the following new rules [LPAR04]:
U9_GGA(z0, [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, []))
U9_GGA(z0, .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2)))
(215) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(C, Ps) → PRIME_NUMBER_IN_GGA(s(C), Ps)
PRIME_NUMBER_IN_GGA(x0, []) → U9_GGA(x0, [], no_divisor_in_list_out_gg)
PRIME_NUMBER_IN_GGA(x0, .(x1, x2)) → U9_GGA(x0, .(x1, x2), U12_gg(x0, x2, not_div_in_gg(x0, x1)))
U9_GGA(z0, [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, []))
U9_GGA(z0, .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2)))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(216) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
C,
Ps) →
PRIME_NUMBER_IN_GGA(
s(
C),
Ps) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(z0), z1) → PRIME_NUMBER_IN_GGA(s(s(z0)), z1)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2)))
(217) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(x0, []) → U9_GGA(x0, [], no_divisor_in_list_out_gg)
PRIME_NUMBER_IN_GGA(x0, .(x1, x2)) → U9_GGA(x0, .(x1, x2), U12_gg(x0, x2, not_div_in_gg(x0, x1)))
U9_GGA(z0, [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, []))
U9_GGA(z0, .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(z0), z1) → PRIME_NUMBER_IN_GGA(s(s(z0)), z1)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2)))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(218) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
x0,
[]) →
U9_GGA(
x0,
[],
no_divisor_in_list_out_gg) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(z0)), []) → U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg)
(219) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(x0, .(x1, x2)) → U9_GGA(x0, .(x1, x2), U12_gg(x0, x2, not_div_in_gg(x0, x1)))
U9_GGA(z0, [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, []))
U9_GGA(z0, .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(z0), z1) → PRIME_NUMBER_IN_GGA(s(s(z0)), z1)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), []) → U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg)
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(220) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
x0,
.(
x1,
x2)) →
U9_GGA(
x0,
.(
x1,
x2),
U12_gg(
x0,
x2,
not_div_in_gg(
x0,
x1))) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → U9_GGA(s(z0), .(z0, []), U12_gg(s(z0), [], not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
(221) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U9_GGA(z0, [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, []))
U9_GGA(z0, .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(z0), z1) → PRIME_NUMBER_IN_GGA(s(s(z0)), z1)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), []) → U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → U9_GGA(s(z0), .(z0, []), U12_gg(s(z0), [], not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(222) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
U9_GGA(
z0,
[],
no_divisor_in_list_out_gg) →
PRIME_NUMBER_IN_GGA(
s(
z0),
.(
z0,
[])) we obtained the following new rules [LPAR04]:
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
(223) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U9_GGA(z0, .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(z0), z1) → PRIME_NUMBER_IN_GGA(s(s(z0)), z1)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), []) → U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → U9_GGA(s(z0), .(z0, []), U12_gg(s(z0), [], not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(224) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
U9_GGA(
z0,
.(
z1,
z2),
no_divisor_in_list_out_gg) →
PRIME_NUMBER_IN_GGA(
s(
z0),
.(
z0,
.(
z1,
z2))) we obtained the following new rules [LPAR04]:
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
(225) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(z0), z1) → PRIME_NUMBER_IN_GGA(s(s(z0)), z1)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), []) → U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → U9_GGA(s(z0), .(z0, []), U12_gg(s(z0), [], not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(226) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
z0),
z1) →
PRIME_NUMBER_IN_GGA(
s(
s(
z0)),
z1) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
(227) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, []))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), []) → U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → U9_GGA(s(z0), .(z0, []), U12_gg(s(z0), [], not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(228) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
z0),
.(
z0,
[])) →
PRIME_NUMBER_IN_GGA(
s(
s(
z0)),
.(
z0,
[])) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
(229) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), []) → U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → U9_GGA(s(z0), .(z0, []), U12_gg(s(z0), [], not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(230) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
z0),
.(
z0,
.(
z1,
z2))) →
PRIME_NUMBER_IN_GGA(
s(
s(
z0)),
.(
z0,
.(
z1,
z2))) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
(231) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(s(z0)), []) → U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg)
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → U9_GGA(s(z0), .(z0, []), U12_gg(s(z0), [], not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(232) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
s(
z0)),
[]) →
U9_GGA(
s(
s(
z0)),
[],
no_divisor_in_list_out_gg) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(s(z0))), []) → U9_GGA(s(s(s(z0))), [], no_divisor_in_list_out_gg)
(233) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(z0), .(z0, [])) → U9_GGA(s(z0), .(z0, []), U12_gg(s(z0), [], not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), []) → U9_GGA(s(s(s(z0))), [], no_divisor_in_list_out_gg)
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(234) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
z0),
.(
z0,
[])) →
U9_GGA(
s(
z0),
.(
z0,
[]),
U12_gg(
s(
z0),
[],
not_div_in_gg(
s(
z0),
z0))) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
(235) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(z0), .(z0, .(z1, z2))) → U9_GGA(s(z0), .(z0, .(z1, z2)), U12_gg(s(z0), .(z1, z2), not_div_in_gg(s(z0), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), []) → U9_GGA(s(s(s(z0))), [], no_divisor_in_list_out_gg)
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(236) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
z0),
.(
z0,
.(
z1,
z2))) →
U9_GGA(
s(
z0),
.(
z0,
.(
z1,
z2)),
U12_gg(
s(
z0),
.(
z1,
z2),
not_div_in_gg(
s(
z0),
z0))) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
(237) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(s(z0)), .(x1, x2)) → U9_GGA(s(s(z0)), .(x1, x2), U12_gg(s(s(z0)), x2, not_div_in_gg(s(s(z0)), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), []) → U9_GGA(s(s(s(z0))), [], no_divisor_in_list_out_gg)
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(238) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
s(
z0)),
.(
x1,
x2)) →
U9_GGA(
s(
s(
z0)),
.(
x1,
x2),
U12_gg(
s(
s(
z0)),
x2,
not_div_in_gg(
s(
s(
z0)),
x1))) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x2, not_div_in_gg(s(s(s(z0))), x1)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, [])) → U9_GGA(s(s(s(z0))), .(z0, []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
(239) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → U9_GGA(s(s(z0)), .(z0, []), U12_gg(s(s(z0)), [], not_div_in_gg(s(s(z0)), z0)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), []) → U9_GGA(s(s(s(z0))), [], no_divisor_in_list_out_gg)
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x2, not_div_in_gg(s(s(s(z0))), x1)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, [])) → U9_GGA(s(s(s(z0))), .(z0, []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(240) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
s(
z0)),
.(
z0,
[])) →
U9_GGA(
s(
s(
z0)),
.(
z0,
[]),
U12_gg(
s(
s(
z0)),
[],
not_div_in_gg(
s(
s(
z0)),
z0))) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), [])) → U9_GGA(s(s(s(z0))), .(s(z0), []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
(241) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → U9_GGA(s(s(z0)), .(z0, .(z1, z2)), U12_gg(s(s(z0)), .(z1, z2), not_div_in_gg(s(s(z0)), z0)))
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), []) → U9_GGA(s(s(s(z0))), [], no_divisor_in_list_out_gg)
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x2, not_div_in_gg(s(s(s(z0))), x1)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, [])) → U9_GGA(s(s(s(z0))), .(z0, []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), [])) → U9_GGA(s(s(s(z0))), .(s(z0), []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), s(z0))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(242) Instantiation (EQUIVALENT transformation)
By instantiating [LPAR04] the rule
PRIME_NUMBER_IN_GGA(
s(
s(
z0)),
.(
z0,
.(
z1,
z2))) →
U9_GGA(
s(
s(
z0)),
.(
z0,
.(
z1,
z2)),
U12_gg(
s(
s(
z0)),
.(
z1,
z2),
not_div_in_gg(
s(
s(
z0)),
z0))) we obtained the following new rules [LPAR04]:
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(x1, x2))) → U9_GGA(s(s(s(z0))), .(s(z0), .(x1, x2)), U12_gg(s(s(s(z0))), .(x1, x2), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
(243) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), []) → U9_GGA(s(s(s(z0))), [], no_divisor_in_list_out_gg)
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x2, not_div_in_gg(s(s(s(z0))), x1)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, [])) → U9_GGA(s(s(s(z0))), .(z0, []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), [])) → U9_GGA(s(s(s(z0))), .(s(z0), []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(x1, x2))) → U9_GGA(s(s(s(z0))), .(s(z0), .(x1, x2)), U12_gg(s(s(s(z0))), .(x1, x2), not_div_in_gg(s(s(s(z0))), s(z0))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(244) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04].
The following pairs can be oriented strictly and are deleted.
PRIME_NUMBER_IN_GGA(s(s(s(z0))), []) → U9_GGA(s(s(s(z0))), [], no_divisor_in_list_out_gg)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:
POL(.(x1, x2)) = x1
POL(0) = 1
POL(PRIME_NUMBER_IN_GGA(x1, x2)) = x2
POL(U12_gg(x1, x2, x3)) = 0
POL(U13_gg(x1)) = 0
POL(U14_gg(x1)) = 0
POL(U15_gg(x1)) = 0
POL(U16_ggag(x1)) = 1
POL(U17_ggag(x1, x2)) = 1 + x1 + x2
POL(U18_ggag(x1)) = 1 + x1
POL(U19_ggag(x1, x2, x3)) = 1 + x1
POL(U20_ggag(x1)) = 1
POL(U21_gga(x1)) = 0
POL(U9_GGA(x1, x2, x3)) = 0
POL([]) = 1
POL(a) = 0
POL(div_in_ggag(x1, x2, x3)) = 1 + x1 + x2 + x3
POL(div_out_ggag) = 1
POL(eq_in_ag(x1)) = 0
POL(eq_in_gg(x1, x2)) = x1
POL(eq_out_ag(x1)) = 1
POL(eq_out_gg) = 1
POL(failure_in_g(x1)) = 0
POL(minus_in_gga(x1, x2)) = x2
POL(minus_out_gga(x1)) = 0
POL(no_divisor_in_list_in_gg(x1, x2)) = 0
POL(no_divisor_in_list_out_gg) = 0
POL(not_div_in_gg(x1, x2)) = x1
POL(not_div_out_gg) = 0
POL(s(x1)) = 0
The following usable rules [FROCOS05] were oriented:
none
(245) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U9_GGA(s(s(z0)), [], no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), []))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x2, not_div_in_gg(s(s(s(z0))), x1)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, [])) → U9_GGA(s(s(s(z0))), .(z0, []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), [])) → U9_GGA(s(s(s(z0))), .(s(z0), []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(x1, x2))) → U9_GGA(s(s(s(z0))), .(s(z0), .(x1, x2)), U12_gg(s(s(s(z0))), .(x1, x2), not_div_in_gg(s(s(s(z0))), s(z0))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(246) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.
(247) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x2, not_div_in_gg(s(s(s(z0))), x1)))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(x1, x2))) → U9_GGA(s(s(s(z0))), .(s(z0), .(x1, x2)), U12_gg(s(s(s(z0))), .(x1, x2), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, [])) → U9_GGA(s(s(s(z0))), .(z0, []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), [])) → U9_GGA(s(s(s(z0))), .(s(z0), []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(248) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04].
The following pairs can be oriented strictly and are deleted.
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, [])) → U9_GGA(s(s(s(z0))), .(z0, []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), z0)))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), [])) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), []), U12_gg(s(s(s(s(z0)))), [], not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), [])) → U9_GGA(s(s(s(z0))), .(s(z0), []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → U9_GGA(s(s(s(z0))), .(s(s(z0)), []), U12_gg(s(s(s(z0))), [], not_div_in_gg(s(s(s(z0))), s(s(z0)))))
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO]:
POL(PRIME_NUMBER_IN_GGA(x1, x2)) = | 0 | + | | · | x1 | + | | · | x2 |
POL(.(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U9_GGA(x1, x2, x3)) = | 0 | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(U12_gg(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(not_div_in_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(no_divisor_in_list_out_gg) = | |
POL(div_in_ggag(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(no_divisor_in_list_in_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U16_ggag(x1)) = | | + | | · | x1 |
POL(failure_in_g(x1)) = | | + | | · | x1 |
POL(U17_ggag(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(eq_in_ag(x1)) = | | + | | · | x1 |
POL(U19_ggag(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(minus_in_gga(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(minus_out_gga(x1)) = | | + | | · | x1 |
POL(U20_ggag(x1)) = | | + | | · | x1 |
POL(eq_out_ag(x1)) = | | + | | · | x1 |
POL(U18_ggag(x1)) = | | + | | · | x1 |
POL(eq_in_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
The following usable rules [FROCOS05] were oriented:
none
(249) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x2, not_div_in_gg(s(s(s(z0))), x1)))
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(x1, x2))) → U9_GGA(s(s(s(z0))), .(s(z0), .(x1, x2)), U12_gg(s(s(s(z0))), .(x1, x2), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(250) QDPOrderProof (EQUIVALENT transformation)
We use the reduction pair processor [LPAR04].
The following pairs can be oriented strictly and are deleted.
U9_GGA(s(z0), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, [])))
U9_GGA(s(s(z0)), .(z0, []), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])))
The remaining pairs can at least be oriented weakly.
Used ordering: Matrix interpretation [MATRO]:
POL(PRIME_NUMBER_IN_GGA(x1, x2)) = | 0 | + | | · | x1 | + | | · | x2 |
POL(.(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U9_GGA(x1, x2, x3)) = | 0 | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(U12_gg(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(not_div_in_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(no_divisor_in_list_out_gg) = | |
POL(div_in_ggag(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(no_divisor_in_list_in_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(U16_ggag(x1)) = | | + | | · | x1 |
POL(failure_in_g(x1)) = | | + | | · | x1 |
POL(U17_ggag(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(eq_in_ag(x1)) = | | + | | · | x1 |
POL(U19_ggag(x1, x2, x3)) = | | + | | · | x1 | + | | · | x2 | + | | · | x3 |
POL(minus_in_gga(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
POL(minus_out_gga(x1)) = | | + | | · | x1 |
POL(U20_ggag(x1)) = | | + | | · | x1 |
POL(eq_out_ag(x1)) = | | + | | · | x1 |
POL(U18_ggag(x1)) = | | + | | · | x1 |
POL(eq_in_gg(x1, x2)) = | | + | | · | x1 | + | | · | x2 |
The following usable rules [FROCOS05] were oriented:
none
(251) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_NUMBER_IN_GGA(s(s(z0)), z1) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1)
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, [])) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, []))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(x1, x2)) → U9_GGA(s(s(s(z0))), .(x1, x2), U12_gg(s(s(s(z0))), x2, not_div_in_gg(s(s(s(z0))), x1)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(z0, .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(z0, .(z1, z2))) → U9_GGA(s(s(s(z0))), .(z0, .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), z0)))
U9_GGA(s(s(z0)), .(z1, z2), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(z0))))
U9_GGA(s(s(z0)), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(z0), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(s(z0)))), .(z1, z2), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(s(z0)))), .(z0, []), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(s(z0)))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(s(z0)))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(z0), .(x1, x2))) → U9_GGA(s(s(s(z0))), .(s(z0), .(x1, x2)), U12_gg(s(s(s(z0))), .(x1, x2), not_div_in_gg(s(s(s(z0))), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z1, z2)), U12_gg(s(s(s(z0))), .(z1, z2), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
U9_GGA(s(z0), .(z0, .(z1, z2)), no_divisor_in_list_out_gg) → PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2)))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, .(z1, z2))), U12_gg(s(s(z0)), .(z0, .(z1, z2)), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2)))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, .(z1, z2))), U12_gg(s(s(s(z0))), .(z0, .(z1, z2)), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), .(z0, [])))
PRIME_NUMBER_IN_GGA(s(s(z0)), .(s(z0), .(z0, []))) → U9_GGA(s(s(z0)), .(s(z0), .(z0, [])), U12_gg(s(s(z0)), .(z0, []), not_div_in_gg(s(s(z0)), s(z0))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, []))) → U9_GGA(s(s(s(z0))), .(s(s(z0)), .(z0, [])), U12_gg(s(s(s(z0))), .(z0, []), not_div_in_gg(s(s(s(z0))), s(s(z0)))))
PRIME_NUMBER_IN_GGA(s(s(s(z0))), .(s(s(z0)), [])) → PRIME_NUMBER_IN_GGA(s(s(s(s(z0)))), .(s(s(z0)), []))
The TRS R consists of the following rules:
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
eq_in_ag(X) → eq_out_ag(X)
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
eq_in_gg(X, X) → eq_out_gg
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
no_divisor_in_list_in_gg(x0, x1)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
eq_in_ag(x0)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
eq_in_gg(x0, x1)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(252) NonTerminationProof (EQUIVALENT transformation)
We used the non-termination processor [FROCOS05] to show that the DP problem is infinite.
Found a loop by semiunifying a rule from P directly.
s =
PRIME_NUMBER_IN_GGA(
s(
s(
z0)),
z1) evaluates to t =
PRIME_NUMBER_IN_GGA(
s(
s(
s(
z0))),
z1)
Thus s starts an infinite chain as s semiunifies with t with the following substitutions:
- Matcher: [z0 / s(z0)]
- Semiunifier: [ ]
Rewriting sequenceThe DP semiunifies directly so there is only one rewrite step from PRIME_NUMBER_IN_GGA(s(s(z0)), z1) to PRIME_NUMBER_IN_GGA(s(s(s(z0))), z1).
(253) FALSE
(254) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
PRIME_FACT_IN_AA(X, .(F, Fs)) → U3_AA(X, F, Fs, prime_number_in_a(P))
U3_AA(X, F, Fs, prime_number_out_a(P)) → U4_AA(X, F, Fs, P, div_in_agag(X, P, Q, 0))
U4_AA(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_AA(X, F, Fs, Q, eq_in_ag(F, P))
U5_AA(X, F, Fs, Q, eq_out_ag(F, P)) → PRIME_FACT_IN_AA(Q, Fs)
The TRS R consists of the following rules:
prime_fact_in_ga(0, L) → U1_ga(L, eq_in_ag(L, []))
eq_in_ag(X, X) → eq_out_ag(X, X)
U1_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(0, L)
prime_fact_in_ga(s(0), L) → U2_ga(L, eq_in_ag(L, []))
U2_ga(L, eq_out_ag(L, [])) → prime_fact_out_ga(s(0), L)
prime_fact_in_ga(X, .(F, Fs)) → U3_ga(X, F, Fs, prime_number_in_a(P))
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
failure_in_g(b) → failure_out_g(b)
U16_ggag(X5, X6, X7, failure_out_g(a)) → div_out_ggag(X5, 0, X6, X7)
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg(X, X)
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
U15_gg(V, D, failure_out_g(a)) → not_div_out_gg(V, D)
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U3_ga(X, F, Fs, prime_number_out_a(P)) → U4_ga(X, F, Fs, P, div_in_ggag(X, P, Q, 0))
U4_ga(X, F, Fs, P, div_out_ggag(X, P, Q, 0)) → U5_ga(X, F, Fs, Q, eq_in_ag(F, P))
U5_ga(X, F, Fs, Q, eq_out_ag(F, P)) → U6_ga(X, F, Fs, prime_fact_in_aa(Q, Fs))
prime_fact_in_aa(0, L) → U1_aa(L, eq_in_ag(L, []))
U1_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(0, L)
prime_fact_in_aa(s(0), L) → U2_aa(L, eq_in_ag(L, []))
U2_aa(L, eq_out_ag(L, [])) → prime_fact_out_aa(s(0), L)
prime_fact_in_aa(X, .(F, Fs)) → U3_aa(X, F, Fs, prime_number_in_a(P))
U3_aa(X, F, Fs, prime_number_out_a(P)) → U4_aa(X, F, Fs, P, div_in_agag(X, P, Q, 0))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
U16_agag(X5, X6, X7, failure_out_g(a)) → div_out_agag(X5, 0, X6, X7)
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U4_aa(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_aa(X, F, Fs, Q, eq_in_ag(F, P))
U5_aa(X, F, Fs, Q, eq_out_ag(F, P)) → U6_aa(X, F, Fs, prime_fact_in_aa(Q, Fs))
U6_aa(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_aa(X, .(F, Fs))
U6_ga(X, F, Fs, prime_fact_out_aa(Q, Fs)) → prime_fact_out_ga(X, .(F, Fs))
The argument filtering Pi contains the following mapping:
prime_fact_in_ga(
x1,
x2) =
prime_fact_in_ga(
x1)
0 =
0
U1_ga(
x1,
x2) =
U1_ga(
x2)
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1)
[] =
[]
prime_fact_out_ga(
x1,
x2) =
prime_fact_out_ga(
x2)
s(
x1) =
s(
x1)
U2_ga(
x1,
x2) =
U2_ga(
x2)
U3_ga(
x1,
x2,
x3,
x4) =
U3_ga(
x1,
x4)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
b =
b
failure_out_g(
x1) =
failure_out_g
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
U4_ga(
x1,
x2,
x3,
x4,
x5) =
U4_ga(
x4,
x5)
U5_ga(
x1,
x2,
x3,
x4,
x5) =
U5_ga(
x5)
U6_ga(
x1,
x2,
x3,
x4) =
U6_ga(
x2,
x4)
prime_fact_in_aa(
x1,
x2) =
prime_fact_in_aa
U1_aa(
x1,
x2) =
U1_aa(
x2)
prime_fact_out_aa(
x1,
x2) =
prime_fact_out_aa(
x2)
U2_aa(
x1,
x2) =
U2_aa(
x2)
U3_aa(
x1,
x2,
x3,
x4) =
U3_aa(
x4)
U4_aa(
x1,
x2,
x3,
x4,
x5) =
U4_aa(
x4,
x5)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x5)
U5_aa(
x1,
x2,
x3,
x4,
x5) =
U5_aa(
x5)
U6_aa(
x1,
x2,
x3,
x4) =
U6_aa(
x2,
x4)
PRIME_FACT_IN_AA(
x1,
x2) =
PRIME_FACT_IN_AA
U3_AA(
x1,
x2,
x3,
x4) =
U3_AA(
x4)
U4_AA(
x1,
x2,
x3,
x4,
x5) =
U4_AA(
x4,
x5)
U5_AA(
x1,
x2,
x3,
x4,
x5) =
U5_AA(
x5)
We have to consider all (P,R,Pi)-chains
(255) UsableRulesProof (EQUIVALENT transformation)
For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.
(256) Obligation:
Pi DP problem:
The TRS P consists of the following rules:
PRIME_FACT_IN_AA(X, .(F, Fs)) → U3_AA(X, F, Fs, prime_number_in_a(P))
U3_AA(X, F, Fs, prime_number_out_a(P)) → U4_AA(X, F, Fs, P, div_in_agag(X, P, Q, 0))
U4_AA(X, F, Fs, P, div_out_agag(X, P, Q, 0)) → U5_AA(X, F, Fs, Q, eq_in_ag(F, P))
U5_AA(X, F, Fs, Q, eq_out_ag(F, P)) → PRIME_FACT_IN_AA(Q, Fs)
The TRS R consists of the following rules:
prime_number_in_a(X) → U7_a(X, prime_number_in_gga(s(s(0)), [], X))
div_in_agag(X5, 0, X6, X7) → U16_agag(X5, X6, X7, failure_in_g(a))
div_in_agag(0, X8, Z, R) → U17_agag(X8, Z, R, eq_in_ag(Z, 0))
div_in_agag(X, Y, s(Z), R) → U19_agag(X, Y, Z, R, minus_in_aga(X, Y, U))
div_in_agag(X, X9, X10, X) → div_out_agag(X, X9, X10, X)
eq_in_ag(X, X) → eq_out_ag(X, X)
U7_a(X, prime_number_out_gga(s(s(0)), [], X)) → prime_number_out_a(X)
U17_agag(X8, Z, R, eq_out_ag(Z, 0)) → U18_agag(X8, Z, R, eq_in_gg(R, 0))
U19_agag(X, Y, Z, R, minus_out_aga(X, Y, U)) → U20_agag(X, Y, Z, R, div_in_agag(U, Y, Z, R))
prime_number_in_gga(C, Ps, C) → U8_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps, P) → U9_gga(C, Ps, P, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps, P) → U11_gga(C, Ps, P, prime_number_in_gga(s(C), Ps, P))
U18_agag(X8, Z, R, eq_out_gg(R, 0)) → div_out_agag(0, X8, Z, R)
minus_in_aga(X, 0, X) → minus_out_aga(X, 0, X)
minus_in_aga(s(X), s(Y), Z) → U21_aga(X, Y, Z, minus_in_aga(X, Y, Z))
U20_agag(X, Y, Z, R, div_out_agag(U, Y, Z, R)) → div_out_agag(X, Y, s(Z), R)
U8_gga(C, Ps, no_divisor_in_list_out_gg(C, Ps)) → prime_number_out_gga(C, Ps, C)
U9_gga(C, Ps, P, no_divisor_in_list_out_gg(C, Ps)) → U10_gga(C, Ps, P, prime_number_in_gga(s(C), .(C, Ps), P))
U11_gga(C, Ps, P, prime_number_out_gga(s(C), Ps, P)) → prime_number_out_gga(C, Ps, P)
eq_in_gg(X, X) → eq_out_gg(X, X)
U21_aga(X, Y, Z, minus_out_aga(X, Y, Z)) → minus_out_aga(s(X), s(Y), Z)
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg(X1, [])
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, D, Ds, not_div_in_gg(V, D))
U10_gga(C, Ps, P, prime_number_out_gga(s(C), .(C, Ps), P)) → prime_number_out_gga(C, Ps, P)
U12_gg(V, D, Ds, not_div_out_gg(V, D)) → U13_gg(V, D, Ds, no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(V, D, div_in_ggag(V, D, X2, 0))
not_div_in_gg(X3, X4) → not_div_out_gg(X3, X4)
U13_gg(V, D, Ds, no_divisor_in_list_out_gg(V, Ds)) → no_divisor_in_list_out_gg(V, .(D, Ds))
U14_gg(V, D, div_out_ggag(V, D, X2, 0)) → U15_gg(V, D, failure_in_g(a))
div_in_ggag(X5, 0, X6, X7) → U16_ggag(X5, X6, X7, failure_in_g(a))
div_in_ggag(0, X8, Z, R) → U17_ggag(X8, Z, R, eq_in_ag(Z, 0))
div_in_ggag(X, Y, s(Z), R) → U19_ggag(X, Y, Z, R, minus_in_gga(X, Y, U))
div_in_ggag(X, X9, X10, X) → div_out_ggag(X, X9, X10, X)
U17_ggag(X8, Z, R, eq_out_ag(Z, 0)) → U18_ggag(X8, Z, R, eq_in_gg(R, 0))
U19_ggag(X, Y, Z, R, minus_out_gga(X, Y, U)) → U20_ggag(X, Y, Z, R, div_in_ggag(U, Y, Z, R))
U18_ggag(X8, Z, R, eq_out_gg(R, 0)) → div_out_ggag(0, X8, Z, R)
minus_in_gga(X, 0, X) → minus_out_gga(X, 0, X)
minus_in_gga(s(X), s(Y), Z) → U21_gga(X, Y, Z, minus_in_gga(X, Y, Z))
U20_ggag(X, Y, Z, R, div_out_ggag(U, Y, Z, R)) → div_out_ggag(X, Y, s(Z), R)
U21_gga(X, Y, Z, minus_out_gga(X, Y, Z)) → minus_out_gga(s(X), s(Y), Z)
The argument filtering Pi contains the following mapping:
0 =
0
eq_in_ag(
x1,
x2) =
eq_in_ag(
x2)
eq_out_ag(
x1,
x2) =
eq_out_ag(
x1)
[] =
[]
s(
x1) =
s(
x1)
prime_number_in_a(
x1) =
prime_number_in_a
U7_a(
x1,
x2) =
U7_a(
x2)
prime_number_in_gga(
x1,
x2,
x3) =
prime_number_in_gga(
x1,
x2)
U8_gga(
x1,
x2,
x3) =
U8_gga(
x1,
x3)
no_divisor_in_list_in_gg(
x1,
x2) =
no_divisor_in_list_in_gg(
x1,
x2)
no_divisor_in_list_out_gg(
x1,
x2) =
no_divisor_in_list_out_gg
.(
x1,
x2) =
.(
x1,
x2)
U12_gg(
x1,
x2,
x3,
x4) =
U12_gg(
x1,
x3,
x4)
not_div_in_gg(
x1,
x2) =
not_div_in_gg(
x1,
x2)
U14_gg(
x1,
x2,
x3) =
U14_gg(
x3)
div_in_ggag(
x1,
x2,
x3,
x4) =
div_in_ggag(
x1,
x2,
x4)
U16_ggag(
x1,
x2,
x3,
x4) =
U16_ggag(
x4)
failure_in_g(
x1) =
failure_in_g(
x1)
a =
a
div_out_ggag(
x1,
x2,
x3,
x4) =
div_out_ggag
U17_ggag(
x1,
x2,
x3,
x4) =
U17_ggag(
x3,
x4)
U18_ggag(
x1,
x2,
x3,
x4) =
U18_ggag(
x4)
eq_in_gg(
x1,
x2) =
eq_in_gg(
x1,
x2)
eq_out_gg(
x1,
x2) =
eq_out_gg
U19_ggag(
x1,
x2,
x3,
x4,
x5) =
U19_ggag(
x2,
x4,
x5)
minus_in_gga(
x1,
x2,
x3) =
minus_in_gga(
x1,
x2)
minus_out_gga(
x1,
x2,
x3) =
minus_out_gga(
x3)
U21_gga(
x1,
x2,
x3,
x4) =
U21_gga(
x4)
U20_ggag(
x1,
x2,
x3,
x4,
x5) =
U20_ggag(
x5)
U15_gg(
x1,
x2,
x3) =
U15_gg(
x3)
not_div_out_gg(
x1,
x2) =
not_div_out_gg
U13_gg(
x1,
x2,
x3,
x4) =
U13_gg(
x4)
prime_number_out_gga(
x1,
x2,
x3) =
prime_number_out_gga(
x3)
U9_gga(
x1,
x2,
x3,
x4) =
U9_gga(
x1,
x2,
x4)
U10_gga(
x1,
x2,
x3,
x4) =
U10_gga(
x4)
U11_gga(
x1,
x2,
x3,
x4) =
U11_gga(
x4)
prime_number_out_a(
x1) =
prime_number_out_a(
x1)
div_in_agag(
x1,
x2,
x3,
x4) =
div_in_agag(
x2,
x4)
U16_agag(
x1,
x2,
x3,
x4) =
U16_agag(
x4)
div_out_agag(
x1,
x2,
x3,
x4) =
div_out_agag
U17_agag(
x1,
x2,
x3,
x4) =
U17_agag(
x3,
x4)
U18_agag(
x1,
x2,
x3,
x4) =
U18_agag(
x4)
U19_agag(
x1,
x2,
x3,
x4,
x5) =
U19_agag(
x2,
x4,
x5)
minus_in_aga(
x1,
x2,
x3) =
minus_in_aga(
x2)
minus_out_aga(
x1,
x2,
x3) =
minus_out_aga
U21_aga(
x1,
x2,
x3,
x4) =
U21_aga(
x4)
U20_agag(
x1,
x2,
x3,
x4,
x5) =
U20_agag(
x5)
PRIME_FACT_IN_AA(
x1,
x2) =
PRIME_FACT_IN_AA
U3_AA(
x1,
x2,
x3,
x4) =
U3_AA(
x4)
U4_AA(
x1,
x2,
x3,
x4,
x5) =
U4_AA(
x4,
x5)
U5_AA(
x1,
x2,
x3,
x4,
x5) =
U5_AA(
x5)
We have to consider all (P,R,Pi)-chains
(257) PiDPToQDPProof (SOUND transformation)
Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.
(258) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_FACT_IN_AA → U3_AA(prime_number_in_a)
U3_AA(prime_number_out_a(P)) → U4_AA(P, div_in_agag(P, 0))
U4_AA(P, div_out_agag) → U5_AA(eq_in_ag(P))
U5_AA(eq_out_ag(F)) → PRIME_FACT_IN_AA
The TRS R consists of the following rules:
prime_number_in_a → U7_a(prime_number_in_gga(s(s(0)), []))
div_in_agag(0, X7) → U16_agag(failure_in_g(a))
div_in_agag(X8, R) → U17_agag(R, eq_in_ag(0))
div_in_agag(Y, R) → U19_agag(Y, R, minus_in_aga(Y))
div_in_agag(X9, X) → div_out_agag
eq_in_ag(X) → eq_out_ag(X)
U7_a(prime_number_out_gga(X)) → prime_number_out_a(X)
U17_agag(R, eq_out_ag(Z)) → U18_agag(eq_in_gg(R, 0))
U19_agag(Y, R, minus_out_aga) → U20_agag(div_in_agag(Y, R))
prime_number_in_gga(C, Ps) → U8_gga(C, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U9_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U11_gga(prime_number_in_gga(s(C), Ps))
U18_agag(eq_out_gg) → div_out_agag
minus_in_aga(0) → minus_out_aga
minus_in_aga(s(Y)) → U21_aga(minus_in_aga(Y))
U20_agag(div_out_agag) → div_out_agag
U8_gga(C, no_divisor_in_list_out_gg) → prime_number_out_gga(C)
U9_gga(C, Ps, no_divisor_in_list_out_gg) → U10_gga(prime_number_in_gga(s(C), .(C, Ps)))
U11_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
eq_in_gg(X, X) → eq_out_gg
U21_aga(minus_out_aga) → minus_out_aga
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U10_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
prime_number_in_a
div_in_agag(x0, x1)
eq_in_ag(x0)
U7_a(x0)
U17_agag(x0, x1)
U19_agag(x0, x1, x2)
prime_number_in_gga(x0, x1)
U18_agag(x0)
minus_in_aga(x0)
U20_agag(x0)
U8_gga(x0, x1)
U9_gga(x0, x1, x2)
U11_gga(x0)
eq_in_gg(x0, x1)
U21_aga(x0)
no_divisor_in_list_in_gg(x0, x1)
U10_gga(x0)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(259) Rewriting (EQUIVALENT transformation)
By rewriting [LPAR04] the rule
U4_AA(
P,
div_out_agag) →
U5_AA(
eq_in_ag(
P)) at position [0] we obtained the following new rules [LPAR04]:
U4_AA(P, div_out_agag) → U5_AA(eq_out_ag(P))
(260) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_FACT_IN_AA → U3_AA(prime_number_in_a)
U3_AA(prime_number_out_a(P)) → U4_AA(P, div_in_agag(P, 0))
U5_AA(eq_out_ag(F)) → PRIME_FACT_IN_AA
U4_AA(P, div_out_agag) → U5_AA(eq_out_ag(P))
The TRS R consists of the following rules:
prime_number_in_a → U7_a(prime_number_in_gga(s(s(0)), []))
div_in_agag(0, X7) → U16_agag(failure_in_g(a))
div_in_agag(X8, R) → U17_agag(R, eq_in_ag(0))
div_in_agag(Y, R) → U19_agag(Y, R, minus_in_aga(Y))
div_in_agag(X9, X) → div_out_agag
eq_in_ag(X) → eq_out_ag(X)
U7_a(prime_number_out_gga(X)) → prime_number_out_a(X)
U17_agag(R, eq_out_ag(Z)) → U18_agag(eq_in_gg(R, 0))
U19_agag(Y, R, minus_out_aga) → U20_agag(div_in_agag(Y, R))
prime_number_in_gga(C, Ps) → U8_gga(C, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U9_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U11_gga(prime_number_in_gga(s(C), Ps))
U18_agag(eq_out_gg) → div_out_agag
minus_in_aga(0) → minus_out_aga
minus_in_aga(s(Y)) → U21_aga(minus_in_aga(Y))
U20_agag(div_out_agag) → div_out_agag
U8_gga(C, no_divisor_in_list_out_gg) → prime_number_out_gga(C)
U9_gga(C, Ps, no_divisor_in_list_out_gg) → U10_gga(prime_number_in_gga(s(C), .(C, Ps)))
U11_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
eq_in_gg(X, X) → eq_out_gg
U21_aga(minus_out_aga) → minus_out_aga
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U10_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
prime_number_in_a
div_in_agag(x0, x1)
eq_in_ag(x0)
U7_a(x0)
U17_agag(x0, x1)
U19_agag(x0, x1, x2)
prime_number_in_gga(x0, x1)
U18_agag(x0)
minus_in_aga(x0)
U20_agag(x0)
U8_gga(x0, x1)
U9_gga(x0, x1, x2)
U11_gga(x0)
eq_in_gg(x0, x1)
U21_aga(x0)
no_divisor_in_list_in_gg(x0, x1)
U10_gga(x0)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(261) Narrowing (SOUND transformation)
By narrowing [LPAR04] the rule
PRIME_FACT_IN_AA →
U3_AA(
prime_number_in_a) at position [0] we obtained the following new rules [LPAR04]:
PRIME_FACT_IN_AA → U3_AA(U7_a(prime_number_in_gga(s(s(0)), [])))
(262) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U3_AA(prime_number_out_a(P)) → U4_AA(P, div_in_agag(P, 0))
U5_AA(eq_out_ag(F)) → PRIME_FACT_IN_AA
U4_AA(P, div_out_agag) → U5_AA(eq_out_ag(P))
PRIME_FACT_IN_AA → U3_AA(U7_a(prime_number_in_gga(s(s(0)), [])))
The TRS R consists of the following rules:
prime_number_in_a → U7_a(prime_number_in_gga(s(s(0)), []))
div_in_agag(0, X7) → U16_agag(failure_in_g(a))
div_in_agag(X8, R) → U17_agag(R, eq_in_ag(0))
div_in_agag(Y, R) → U19_agag(Y, R, minus_in_aga(Y))
div_in_agag(X9, X) → div_out_agag
eq_in_ag(X) → eq_out_ag(X)
U7_a(prime_number_out_gga(X)) → prime_number_out_a(X)
U17_agag(R, eq_out_ag(Z)) → U18_agag(eq_in_gg(R, 0))
U19_agag(Y, R, minus_out_aga) → U20_agag(div_in_agag(Y, R))
prime_number_in_gga(C, Ps) → U8_gga(C, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U9_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U11_gga(prime_number_in_gga(s(C), Ps))
U18_agag(eq_out_gg) → div_out_agag
minus_in_aga(0) → minus_out_aga
minus_in_aga(s(Y)) → U21_aga(minus_in_aga(Y))
U20_agag(div_out_agag) → div_out_agag
U8_gga(C, no_divisor_in_list_out_gg) → prime_number_out_gga(C)
U9_gga(C, Ps, no_divisor_in_list_out_gg) → U10_gga(prime_number_in_gga(s(C), .(C, Ps)))
U11_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
eq_in_gg(X, X) → eq_out_gg
U21_aga(minus_out_aga) → minus_out_aga
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U10_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
U18_ggag(eq_out_gg) → div_out_ggag
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U20_ggag(div_out_ggag) → div_out_ggag
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
The set Q consists of the following terms:
prime_number_in_a
div_in_agag(x0, x1)
eq_in_ag(x0)
U7_a(x0)
U17_agag(x0, x1)
U19_agag(x0, x1, x2)
prime_number_in_gga(x0, x1)
U18_agag(x0)
minus_in_aga(x0)
U20_agag(x0)
U8_gga(x0, x1)
U9_gga(x0, x1, x2)
U11_gga(x0)
eq_in_gg(x0, x1)
U21_aga(x0)
no_divisor_in_list_in_gg(x0, x1)
U10_gga(x0)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(263) 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.
(264) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U3_AA(prime_number_out_a(P)) → U4_AA(P, div_in_agag(P, 0))
U5_AA(eq_out_ag(F)) → PRIME_FACT_IN_AA
U4_AA(P, div_out_agag) → U5_AA(eq_out_ag(P))
PRIME_FACT_IN_AA → U3_AA(U7_a(prime_number_in_gga(s(s(0)), [])))
The TRS R consists of the following rules:
prime_number_in_gga(C, Ps) → U8_gga(C, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U9_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U11_gga(prime_number_in_gga(s(C), Ps))
U7_a(prime_number_out_gga(X)) → prime_number_out_a(X)
U11_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U9_gga(C, Ps, no_divisor_in_list_out_gg) → U10_gga(prime_number_in_gga(s(C), .(C, Ps)))
U10_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
U20_ggag(div_out_ggag) → div_out_ggag
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
eq_in_ag(X) → eq_out_ag(X)
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg
U18_ggag(eq_out_gg) → div_out_ggag
U8_gga(C, no_divisor_in_list_out_gg) → prime_number_out_gga(C)
div_in_agag(0, X7) → U16_agag(failure_in_g(a))
div_in_agag(X8, R) → U17_agag(R, eq_in_ag(0))
div_in_agag(Y, R) → U19_agag(Y, R, minus_in_aga(Y))
div_in_agag(X9, X) → div_out_agag
minus_in_aga(0) → minus_out_aga
minus_in_aga(s(Y)) → U21_aga(minus_in_aga(Y))
U19_agag(Y, R, minus_out_aga) → U20_agag(div_in_agag(Y, R))
U20_agag(div_out_agag) → div_out_agag
U21_aga(minus_out_aga) → minus_out_aga
U17_agag(R, eq_out_ag(Z)) → U18_agag(eq_in_gg(R, 0))
U18_agag(eq_out_gg) → div_out_agag
The set Q consists of the following terms:
prime_number_in_a
div_in_agag(x0, x1)
eq_in_ag(x0)
U7_a(x0)
U17_agag(x0, x1)
U19_agag(x0, x1, x2)
prime_number_in_gga(x0, x1)
U18_agag(x0)
minus_in_aga(x0)
U20_agag(x0)
U8_gga(x0, x1)
U9_gga(x0, x1, x2)
U11_gga(x0)
eq_in_gg(x0, x1)
U21_aga(x0)
no_divisor_in_list_in_gg(x0, x1)
U10_gga(x0)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(265) 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].
prime_number_in_a
(266) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U3_AA(prime_number_out_a(P)) → U4_AA(P, div_in_agag(P, 0))
U5_AA(eq_out_ag(F)) → PRIME_FACT_IN_AA
U4_AA(P, div_out_agag) → U5_AA(eq_out_ag(P))
PRIME_FACT_IN_AA → U3_AA(U7_a(prime_number_in_gga(s(s(0)), [])))
The TRS R consists of the following rules:
prime_number_in_gga(C, Ps) → U8_gga(C, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U9_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U11_gga(prime_number_in_gga(s(C), Ps))
U7_a(prime_number_out_gga(X)) → prime_number_out_a(X)
U11_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U9_gga(C, Ps, no_divisor_in_list_out_gg) → U10_gga(prime_number_in_gga(s(C), .(C, Ps)))
U10_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
U20_ggag(div_out_ggag) → div_out_ggag
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
eq_in_ag(X) → eq_out_ag(X)
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg
U18_ggag(eq_out_gg) → div_out_ggag
U8_gga(C, no_divisor_in_list_out_gg) → prime_number_out_gga(C)
div_in_agag(0, X7) → U16_agag(failure_in_g(a))
div_in_agag(X8, R) → U17_agag(R, eq_in_ag(0))
div_in_agag(Y, R) → U19_agag(Y, R, minus_in_aga(Y))
div_in_agag(X9, X) → div_out_agag
minus_in_aga(0) → minus_out_aga
minus_in_aga(s(Y)) → U21_aga(minus_in_aga(Y))
U19_agag(Y, R, minus_out_aga) → U20_agag(div_in_agag(Y, R))
U20_agag(div_out_agag) → div_out_agag
U21_aga(minus_out_aga) → minus_out_aga
U17_agag(R, eq_out_ag(Z)) → U18_agag(eq_in_gg(R, 0))
U18_agag(eq_out_gg) → div_out_agag
The set Q consists of the following terms:
div_in_agag(x0, x1)
eq_in_ag(x0)
U7_a(x0)
U17_agag(x0, x1)
U19_agag(x0, x1, x2)
prime_number_in_gga(x0, x1)
U18_agag(x0)
minus_in_aga(x0)
U20_agag(x0)
U8_gga(x0, x1)
U9_gga(x0, x1, x2)
U11_gga(x0)
eq_in_gg(x0, x1)
U21_aga(x0)
no_divisor_in_list_in_gg(x0, x1)
U10_gga(x0)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(267) Narrowing (SOUND transformation)
By narrowing [LPAR04] the rule
U3_AA(
prime_number_out_a(
P)) →
U4_AA(
P,
div_in_agag(
P,
0)) at position [1] we obtained the following new rules [LPAR04]:
U3_AA(prime_number_out_a(0)) → U4_AA(0, U16_agag(failure_in_g(a)))
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, U17_agag(0, eq_in_ag(0)))
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, U19_agag(x0, 0, minus_in_aga(x0)))
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, div_out_agag)
(268) Obligation:
Q DP problem:
The TRS P consists of the following rules:
U5_AA(eq_out_ag(F)) → PRIME_FACT_IN_AA
U4_AA(P, div_out_agag) → U5_AA(eq_out_ag(P))
PRIME_FACT_IN_AA → U3_AA(U7_a(prime_number_in_gga(s(s(0)), [])))
U3_AA(prime_number_out_a(0)) → U4_AA(0, U16_agag(failure_in_g(a)))
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, U17_agag(0, eq_in_ag(0)))
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, U19_agag(x0, 0, minus_in_aga(x0)))
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, div_out_agag)
The TRS R consists of the following rules:
prime_number_in_gga(C, Ps) → U8_gga(C, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U9_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U11_gga(prime_number_in_gga(s(C), Ps))
U7_a(prime_number_out_gga(X)) → prime_number_out_a(X)
U11_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U9_gga(C, Ps, no_divisor_in_list_out_gg) → U10_gga(prime_number_in_gga(s(C), .(C, Ps)))
U10_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
U20_ggag(div_out_ggag) → div_out_ggag
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
eq_in_ag(X) → eq_out_ag(X)
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg
U18_ggag(eq_out_gg) → div_out_ggag
U8_gga(C, no_divisor_in_list_out_gg) → prime_number_out_gga(C)
div_in_agag(0, X7) → U16_agag(failure_in_g(a))
div_in_agag(X8, R) → U17_agag(R, eq_in_ag(0))
div_in_agag(Y, R) → U19_agag(Y, R, minus_in_aga(Y))
div_in_agag(X9, X) → div_out_agag
minus_in_aga(0) → minus_out_aga
minus_in_aga(s(Y)) → U21_aga(minus_in_aga(Y))
U19_agag(Y, R, minus_out_aga) → U20_agag(div_in_agag(Y, R))
U20_agag(div_out_agag) → div_out_agag
U21_aga(minus_out_aga) → minus_out_aga
U17_agag(R, eq_out_ag(Z)) → U18_agag(eq_in_gg(R, 0))
U18_agag(eq_out_gg) → div_out_agag
The set Q consists of the following terms:
div_in_agag(x0, x1)
eq_in_ag(x0)
U7_a(x0)
U17_agag(x0, x1)
U19_agag(x0, x1, x2)
prime_number_in_gga(x0, x1)
U18_agag(x0)
minus_in_aga(x0)
U20_agag(x0)
U8_gga(x0, x1)
U9_gga(x0, x1, x2)
U11_gga(x0)
eq_in_gg(x0, x1)
U21_aga(x0)
no_divisor_in_list_in_gg(x0, x1)
U10_gga(x0)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(269) DependencyGraphProof (EQUIVALENT transformation)
The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 1 SCC with 1 less node.
(270) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_FACT_IN_AA → U3_AA(U7_a(prime_number_in_gga(s(s(0)), [])))
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, U17_agag(0, eq_in_ag(0)))
U4_AA(P, div_out_agag) → U5_AA(eq_out_ag(P))
U5_AA(eq_out_ag(F)) → PRIME_FACT_IN_AA
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, U19_agag(x0, 0, minus_in_aga(x0)))
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, div_out_agag)
The TRS R consists of the following rules:
prime_number_in_gga(C, Ps) → U8_gga(C, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U9_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U11_gga(prime_number_in_gga(s(C), Ps))
U7_a(prime_number_out_gga(X)) → prime_number_out_a(X)
U11_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U9_gga(C, Ps, no_divisor_in_list_out_gg) → U10_gga(prime_number_in_gga(s(C), .(C, Ps)))
U10_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
U20_ggag(div_out_ggag) → div_out_ggag
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
eq_in_ag(X) → eq_out_ag(X)
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg
U18_ggag(eq_out_gg) → div_out_ggag
U8_gga(C, no_divisor_in_list_out_gg) → prime_number_out_gga(C)
div_in_agag(0, X7) → U16_agag(failure_in_g(a))
div_in_agag(X8, R) → U17_agag(R, eq_in_ag(0))
div_in_agag(Y, R) → U19_agag(Y, R, minus_in_aga(Y))
div_in_agag(X9, X) → div_out_agag
minus_in_aga(0) → minus_out_aga
minus_in_aga(s(Y)) → U21_aga(minus_in_aga(Y))
U19_agag(Y, R, minus_out_aga) → U20_agag(div_in_agag(Y, R))
U20_agag(div_out_agag) → div_out_agag
U21_aga(minus_out_aga) → minus_out_aga
U17_agag(R, eq_out_ag(Z)) → U18_agag(eq_in_gg(R, 0))
U18_agag(eq_out_gg) → div_out_agag
The set Q consists of the following terms:
div_in_agag(x0, x1)
eq_in_ag(x0)
U7_a(x0)
U17_agag(x0, x1)
U19_agag(x0, x1, x2)
prime_number_in_gga(x0, x1)
U18_agag(x0)
minus_in_aga(x0)
U20_agag(x0)
U8_gga(x0, x1)
U9_gga(x0, x1, x2)
U11_gga(x0)
eq_in_gg(x0, x1)
U21_aga(x0)
no_divisor_in_list_in_gg(x0, x1)
U10_gga(x0)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(271) Rewriting (EQUIVALENT transformation)
By rewriting [LPAR04] the rule
U3_AA(
prime_number_out_a(
x0)) →
U4_AA(
x0,
U17_agag(
0,
eq_in_ag(
0))) at position [1,1] we obtained the following new rules [LPAR04]:
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, U17_agag(0, eq_out_ag(0)))
(272) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_FACT_IN_AA → U3_AA(U7_a(prime_number_in_gga(s(s(0)), [])))
U4_AA(P, div_out_agag) → U5_AA(eq_out_ag(P))
U5_AA(eq_out_ag(F)) → PRIME_FACT_IN_AA
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, U19_agag(x0, 0, minus_in_aga(x0)))
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, div_out_agag)
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, U17_agag(0, eq_out_ag(0)))
The TRS R consists of the following rules:
prime_number_in_gga(C, Ps) → U8_gga(C, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U9_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U11_gga(prime_number_in_gga(s(C), Ps))
U7_a(prime_number_out_gga(X)) → prime_number_out_a(X)
U11_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U9_gga(C, Ps, no_divisor_in_list_out_gg) → U10_gga(prime_number_in_gga(s(C), .(C, Ps)))
U10_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
U20_ggag(div_out_ggag) → div_out_ggag
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
eq_in_ag(X) → eq_out_ag(X)
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg
U18_ggag(eq_out_gg) → div_out_ggag
U8_gga(C, no_divisor_in_list_out_gg) → prime_number_out_gga(C)
div_in_agag(0, X7) → U16_agag(failure_in_g(a))
div_in_agag(X8, R) → U17_agag(R, eq_in_ag(0))
div_in_agag(Y, R) → U19_agag(Y, R, minus_in_aga(Y))
div_in_agag(X9, X) → div_out_agag
minus_in_aga(0) → minus_out_aga
minus_in_aga(s(Y)) → U21_aga(minus_in_aga(Y))
U19_agag(Y, R, minus_out_aga) → U20_agag(div_in_agag(Y, R))
U20_agag(div_out_agag) → div_out_agag
U21_aga(minus_out_aga) → minus_out_aga
U17_agag(R, eq_out_ag(Z)) → U18_agag(eq_in_gg(R, 0))
U18_agag(eq_out_gg) → div_out_agag
The set Q consists of the following terms:
div_in_agag(x0, x1)
eq_in_ag(x0)
U7_a(x0)
U17_agag(x0, x1)
U19_agag(x0, x1, x2)
prime_number_in_gga(x0, x1)
U18_agag(x0)
minus_in_aga(x0)
U20_agag(x0)
U8_gga(x0, x1)
U9_gga(x0, x1, x2)
U11_gga(x0)
eq_in_gg(x0, x1)
U21_aga(x0)
no_divisor_in_list_in_gg(x0, x1)
U10_gga(x0)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(273) Rewriting (EQUIVALENT transformation)
By rewriting [LPAR04] the rule
U3_AA(
prime_number_out_a(
x0)) →
U4_AA(
x0,
U17_agag(
0,
eq_out_ag(
0))) at position [1] we obtained the following new rules [LPAR04]:
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, U18_agag(eq_in_gg(0, 0)))
(274) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_FACT_IN_AA → U3_AA(U7_a(prime_number_in_gga(s(s(0)), [])))
U4_AA(P, div_out_agag) → U5_AA(eq_out_ag(P))
U5_AA(eq_out_ag(F)) → PRIME_FACT_IN_AA
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, U19_agag(x0, 0, minus_in_aga(x0)))
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, div_out_agag)
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, U18_agag(eq_in_gg(0, 0)))
The TRS R consists of the following rules:
prime_number_in_gga(C, Ps) → U8_gga(C, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U9_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U11_gga(prime_number_in_gga(s(C), Ps))
U7_a(prime_number_out_gga(X)) → prime_number_out_a(X)
U11_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U9_gga(C, Ps, no_divisor_in_list_out_gg) → U10_gga(prime_number_in_gga(s(C), .(C, Ps)))
U10_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
U20_ggag(div_out_ggag) → div_out_ggag
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
eq_in_ag(X) → eq_out_ag(X)
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg
U18_ggag(eq_out_gg) → div_out_ggag
U8_gga(C, no_divisor_in_list_out_gg) → prime_number_out_gga(C)
div_in_agag(0, X7) → U16_agag(failure_in_g(a))
div_in_agag(X8, R) → U17_agag(R, eq_in_ag(0))
div_in_agag(Y, R) → U19_agag(Y, R, minus_in_aga(Y))
div_in_agag(X9, X) → div_out_agag
minus_in_aga(0) → minus_out_aga
minus_in_aga(s(Y)) → U21_aga(minus_in_aga(Y))
U19_agag(Y, R, minus_out_aga) → U20_agag(div_in_agag(Y, R))
U20_agag(div_out_agag) → div_out_agag
U21_aga(minus_out_aga) → minus_out_aga
U17_agag(R, eq_out_ag(Z)) → U18_agag(eq_in_gg(R, 0))
U18_agag(eq_out_gg) → div_out_agag
The set Q consists of the following terms:
div_in_agag(x0, x1)
eq_in_ag(x0)
U7_a(x0)
U17_agag(x0, x1)
U19_agag(x0, x1, x2)
prime_number_in_gga(x0, x1)
U18_agag(x0)
minus_in_aga(x0)
U20_agag(x0)
U8_gga(x0, x1)
U9_gga(x0, x1, x2)
U11_gga(x0)
eq_in_gg(x0, x1)
U21_aga(x0)
no_divisor_in_list_in_gg(x0, x1)
U10_gga(x0)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(275) Rewriting (EQUIVALENT transformation)
By rewriting [LPAR04] the rule
U3_AA(
prime_number_out_a(
x0)) →
U4_AA(
x0,
U18_agag(
eq_in_gg(
0,
0))) at position [1,0] we obtained the following new rules [LPAR04]:
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, U18_agag(eq_out_gg))
(276) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_FACT_IN_AA → U3_AA(U7_a(prime_number_in_gga(s(s(0)), [])))
U4_AA(P, div_out_agag) → U5_AA(eq_out_ag(P))
U5_AA(eq_out_ag(F)) → PRIME_FACT_IN_AA
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, U19_agag(x0, 0, minus_in_aga(x0)))
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, div_out_agag)
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, U18_agag(eq_out_gg))
The TRS R consists of the following rules:
prime_number_in_gga(C, Ps) → U8_gga(C, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U9_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U11_gga(prime_number_in_gga(s(C), Ps))
U7_a(prime_number_out_gga(X)) → prime_number_out_a(X)
U11_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U9_gga(C, Ps, no_divisor_in_list_out_gg) → U10_gga(prime_number_in_gga(s(C), .(C, Ps)))
U10_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
U20_ggag(div_out_ggag) → div_out_ggag
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
eq_in_ag(X) → eq_out_ag(X)
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg
U18_ggag(eq_out_gg) → div_out_ggag
U8_gga(C, no_divisor_in_list_out_gg) → prime_number_out_gga(C)
div_in_agag(0, X7) → U16_agag(failure_in_g(a))
div_in_agag(X8, R) → U17_agag(R, eq_in_ag(0))
div_in_agag(Y, R) → U19_agag(Y, R, minus_in_aga(Y))
div_in_agag(X9, X) → div_out_agag
minus_in_aga(0) → minus_out_aga
minus_in_aga(s(Y)) → U21_aga(minus_in_aga(Y))
U19_agag(Y, R, minus_out_aga) → U20_agag(div_in_agag(Y, R))
U20_agag(div_out_agag) → div_out_agag
U21_aga(minus_out_aga) → minus_out_aga
U17_agag(R, eq_out_ag(Z)) → U18_agag(eq_in_gg(R, 0))
U18_agag(eq_out_gg) → div_out_agag
The set Q consists of the following terms:
div_in_agag(x0, x1)
eq_in_ag(x0)
U7_a(x0)
U17_agag(x0, x1)
U19_agag(x0, x1, x2)
prime_number_in_gga(x0, x1)
U18_agag(x0)
minus_in_aga(x0)
U20_agag(x0)
U8_gga(x0, x1)
U9_gga(x0, x1, x2)
U11_gga(x0)
eq_in_gg(x0, x1)
U21_aga(x0)
no_divisor_in_list_in_gg(x0, x1)
U10_gga(x0)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.
(277) Rewriting (EQUIVALENT transformation)
By rewriting [LPAR04] the rule
U3_AA(
prime_number_out_a(
x0)) →
U4_AA(
x0,
U18_agag(
eq_out_gg)) at position [1] we obtained the following new rules [LPAR04]:
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, div_out_agag)
(278) Obligation:
Q DP problem:
The TRS P consists of the following rules:
PRIME_FACT_IN_AA → U3_AA(U7_a(prime_number_in_gga(s(s(0)), [])))
U4_AA(P, div_out_agag) → U5_AA(eq_out_ag(P))
U5_AA(eq_out_ag(F)) → PRIME_FACT_IN_AA
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, U19_agag(x0, 0, minus_in_aga(x0)))
U3_AA(prime_number_out_a(x0)) → U4_AA(x0, div_out_agag)
The TRS R consists of the following rules:
prime_number_in_gga(C, Ps) → U8_gga(C, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U9_gga(C, Ps, no_divisor_in_list_in_gg(C, Ps))
prime_number_in_gga(C, Ps) → U11_gga(prime_number_in_gga(s(C), Ps))
U7_a(prime_number_out_gga(X)) → prime_number_out_a(X)
U11_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
no_divisor_in_list_in_gg(X1, []) → no_divisor_in_list_out_gg
no_divisor_in_list_in_gg(V, .(D, Ds)) → U12_gg(V, Ds, not_div_in_gg(V, D))
U9_gga(C, Ps, no_divisor_in_list_out_gg) → U10_gga(prime_number_in_gga(s(C), .(C, Ps)))
U10_gga(prime_number_out_gga(P)) → prime_number_out_gga(P)
not_div_in_gg(V, D) → U14_gg(div_in_ggag(V, D, 0))
not_div_in_gg(X3, X4) → not_div_out_gg
U12_gg(V, Ds, not_div_out_gg) → U13_gg(no_divisor_in_list_in_gg(V, Ds))
U13_gg(no_divisor_in_list_out_gg) → no_divisor_in_list_out_gg
div_in_ggag(X5, 0, X7) → U16_ggag(failure_in_g(a))
div_in_ggag(0, X8, R) → U17_ggag(R, eq_in_ag(0))
div_in_ggag(X, Y, R) → U19_ggag(Y, R, minus_in_gga(X, Y))
div_in_ggag(X, X9, X) → div_out_ggag
U14_gg(div_out_ggag) → U15_gg(failure_in_g(a))
minus_in_gga(X, 0) → minus_out_gga(X)
minus_in_gga(s(X), s(Y)) → U21_gga(minus_in_gga(X, Y))
U19_ggag(Y, R, minus_out_gga(U)) → U20_ggag(div_in_ggag(U, Y, R))
U20_ggag(div_out_ggag) → div_out_ggag
U21_gga(minus_out_gga(Z)) → minus_out_gga(Z)
eq_in_ag(X) → eq_out_ag(X)
U17_ggag(R, eq_out_ag(Z)) → U18_ggag(eq_in_gg(R, 0))
eq_in_gg(X, X) → eq_out_gg
U18_ggag(eq_out_gg) → div_out_ggag
U8_gga(C, no_divisor_in_list_out_gg) → prime_number_out_gga(C)
div_in_agag(0, X7) → U16_agag(failure_in_g(a))
div_in_agag(X8, R) → U17_agag(R, eq_in_ag(0))
div_in_agag(Y, R) → U19_agag(Y, R, minus_in_aga(Y))
div_in_agag(X9, X) → div_out_agag
minus_in_aga(0) → minus_out_aga
minus_in_aga(s(Y)) → U21_aga(minus_in_aga(Y))
U19_agag(Y, R, minus_out_aga) → U20_agag(div_in_agag(Y, R))
U20_agag(div_out_agag) → div_out_agag
U21_aga(minus_out_aga) → minus_out_aga
U17_agag(R, eq_out_ag(Z)) → U18_agag(eq_in_gg(R, 0))
U18_agag(eq_out_gg) → div_out_agag
The set Q consists of the following terms:
div_in_agag(x0, x1)
eq_in_ag(x0)
U7_a(x0)
U17_agag(x0, x1)
U19_agag(x0, x1, x2)
prime_number_in_gga(x0, x1)
U18_agag(x0)
minus_in_aga(x0)
U20_agag(x0)
U8_gga(x0, x1)
U9_gga(x0, x1, x2)
U11_gga(x0)
eq_in_gg(x0, x1)
U21_aga(x0)
no_divisor_in_list_in_gg(x0, x1)
U10_gga(x0)
U12_gg(x0, x1, x2)
not_div_in_gg(x0, x1)
U13_gg(x0)
U14_gg(x0)
div_in_ggag(x0, x1, x2)
U17_ggag(x0, x1)
U19_ggag(x0, x1, x2)
U18_ggag(x0)
minus_in_gga(x0, x1)
U20_ggag(x0)
U21_gga(x0)
We have to consider all (P,Q,R)-chains.