(0) Obligation:

Clauses:

half(0, 0).
half(s(0), 0).
half(s(s(X)), s(Y)) :- half(X, Y).
log(0, s(0)).
log(s(X), s(Y)) :- ','(half(s(X), Z), log(Z, Y)).

Queries:

log(g,a).

(1) PrologToPrologProblemTransformerProof (SOUND transformation)

Built Prolog problem from termination graph.

(2) Obligation:

Clauses:

half24(0, 0).
half24(s(0), 0).
half24(s(s(T14)), s(X31)) :- half24(T14, X31).
log1(0, s(0)).
log1(s(0), s(s(0))).
log1(s(s(T10)), s(T7)) :- half24(T10, X20).
log1(s(s(T10)), s(T7)) :- ','(half24(T10, T11), log1(s(T11), T7)).

Queries:

log1(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:
log1_in: (b,f)
half24_in: (b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

log1_in_ga(0, s(0)) → log1_out_ga(0, s(0))
log1_in_ga(s(0), s(s(0))) → log1_out_ga(s(0), s(s(0)))
log1_in_ga(s(s(T10)), s(T7)) → U2_ga(T10, T7, half24_in_ga(T10, X20))
half24_in_ga(0, 0) → half24_out_ga(0, 0)
half24_in_ga(s(0), 0) → half24_out_ga(s(0), 0)
half24_in_ga(s(s(T14)), s(X31)) → U1_ga(T14, X31, half24_in_ga(T14, X31))
U1_ga(T14, X31, half24_out_ga(T14, X31)) → half24_out_ga(s(s(T14)), s(X31))
U2_ga(T10, T7, half24_out_ga(T10, X20)) → log1_out_ga(s(s(T10)), s(T7))
log1_in_ga(s(s(T10)), s(T7)) → U3_ga(T10, T7, half24_in_ga(T10, T11))
U3_ga(T10, T7, half24_out_ga(T10, T11)) → U4_ga(T10, T7, log1_in_ga(s(T11), T7))
U4_ga(T10, T7, log1_out_ga(s(T11), T7)) → log1_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
log1_in_ga(x1, x2)  =  log1_in_ga(x1)
0  =  0
log1_out_ga(x1, x2)  =  log1_out_ga
s(x1)  =  s(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x3)
half24_in_ga(x1, x2)  =  half24_in_ga(x1)
half24_out_ga(x1, x2)  =  half24_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
U3_ga(x1, x2, x3)  =  U3_ga(x3)
U4_ga(x1, x2, x3)  =  U4_ga(x3)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

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

log1_in_ga(0, s(0)) → log1_out_ga(0, s(0))
log1_in_ga(s(0), s(s(0))) → log1_out_ga(s(0), s(s(0)))
log1_in_ga(s(s(T10)), s(T7)) → U2_ga(T10, T7, half24_in_ga(T10, X20))
half24_in_ga(0, 0) → half24_out_ga(0, 0)
half24_in_ga(s(0), 0) → half24_out_ga(s(0), 0)
half24_in_ga(s(s(T14)), s(X31)) → U1_ga(T14, X31, half24_in_ga(T14, X31))
U1_ga(T14, X31, half24_out_ga(T14, X31)) → half24_out_ga(s(s(T14)), s(X31))
U2_ga(T10, T7, half24_out_ga(T10, X20)) → log1_out_ga(s(s(T10)), s(T7))
log1_in_ga(s(s(T10)), s(T7)) → U3_ga(T10, T7, half24_in_ga(T10, T11))
U3_ga(T10, T7, half24_out_ga(T10, T11)) → U4_ga(T10, T7, log1_in_ga(s(T11), T7))
U4_ga(T10, T7, log1_out_ga(s(T11), T7)) → log1_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
log1_in_ga(x1, x2)  =  log1_in_ga(x1)
0  =  0
log1_out_ga(x1, x2)  =  log1_out_ga
s(x1)  =  s(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x3)
half24_in_ga(x1, x2)  =  half24_in_ga(x1)
half24_out_ga(x1, x2)  =  half24_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
U3_ga(x1, x2, x3)  =  U3_ga(x3)
U4_ga(x1, x2, x3)  =  U4_ga(x3)

(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:

LOG1_IN_GA(s(s(T10)), s(T7)) → U2_GA(T10, T7, half24_in_ga(T10, X20))
LOG1_IN_GA(s(s(T10)), s(T7)) → HALF24_IN_GA(T10, X20)
HALF24_IN_GA(s(s(T14)), s(X31)) → U1_GA(T14, X31, half24_in_ga(T14, X31))
HALF24_IN_GA(s(s(T14)), s(X31)) → HALF24_IN_GA(T14, X31)
LOG1_IN_GA(s(s(T10)), s(T7)) → U3_GA(T10, T7, half24_in_ga(T10, T11))
U3_GA(T10, T7, half24_out_ga(T10, T11)) → U4_GA(T10, T7, log1_in_ga(s(T11), T7))
U3_GA(T10, T7, half24_out_ga(T10, T11)) → LOG1_IN_GA(s(T11), T7)

The TRS R consists of the following rules:

log1_in_ga(0, s(0)) → log1_out_ga(0, s(0))
log1_in_ga(s(0), s(s(0))) → log1_out_ga(s(0), s(s(0)))
log1_in_ga(s(s(T10)), s(T7)) → U2_ga(T10, T7, half24_in_ga(T10, X20))
half24_in_ga(0, 0) → half24_out_ga(0, 0)
half24_in_ga(s(0), 0) → half24_out_ga(s(0), 0)
half24_in_ga(s(s(T14)), s(X31)) → U1_ga(T14, X31, half24_in_ga(T14, X31))
U1_ga(T14, X31, half24_out_ga(T14, X31)) → half24_out_ga(s(s(T14)), s(X31))
U2_ga(T10, T7, half24_out_ga(T10, X20)) → log1_out_ga(s(s(T10)), s(T7))
log1_in_ga(s(s(T10)), s(T7)) → U3_ga(T10, T7, half24_in_ga(T10, T11))
U3_ga(T10, T7, half24_out_ga(T10, T11)) → U4_ga(T10, T7, log1_in_ga(s(T11), T7))
U4_ga(T10, T7, log1_out_ga(s(T11), T7)) → log1_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
log1_in_ga(x1, x2)  =  log1_in_ga(x1)
0  =  0
log1_out_ga(x1, x2)  =  log1_out_ga
s(x1)  =  s(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x3)
half24_in_ga(x1, x2)  =  half24_in_ga(x1)
half24_out_ga(x1, x2)  =  half24_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
U3_ga(x1, x2, x3)  =  U3_ga(x3)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
LOG1_IN_GA(x1, x2)  =  LOG1_IN_GA(x1)
U2_GA(x1, x2, x3)  =  U2_GA(x3)
HALF24_IN_GA(x1, x2)  =  HALF24_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x3)
U3_GA(x1, x2, x3)  =  U3_GA(x3)
U4_GA(x1, x2, x3)  =  U4_GA(x3)

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

(6) Obligation:

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

LOG1_IN_GA(s(s(T10)), s(T7)) → U2_GA(T10, T7, half24_in_ga(T10, X20))
LOG1_IN_GA(s(s(T10)), s(T7)) → HALF24_IN_GA(T10, X20)
HALF24_IN_GA(s(s(T14)), s(X31)) → U1_GA(T14, X31, half24_in_ga(T14, X31))
HALF24_IN_GA(s(s(T14)), s(X31)) → HALF24_IN_GA(T14, X31)
LOG1_IN_GA(s(s(T10)), s(T7)) → U3_GA(T10, T7, half24_in_ga(T10, T11))
U3_GA(T10, T7, half24_out_ga(T10, T11)) → U4_GA(T10, T7, log1_in_ga(s(T11), T7))
U3_GA(T10, T7, half24_out_ga(T10, T11)) → LOG1_IN_GA(s(T11), T7)

The TRS R consists of the following rules:

log1_in_ga(0, s(0)) → log1_out_ga(0, s(0))
log1_in_ga(s(0), s(s(0))) → log1_out_ga(s(0), s(s(0)))
log1_in_ga(s(s(T10)), s(T7)) → U2_ga(T10, T7, half24_in_ga(T10, X20))
half24_in_ga(0, 0) → half24_out_ga(0, 0)
half24_in_ga(s(0), 0) → half24_out_ga(s(0), 0)
half24_in_ga(s(s(T14)), s(X31)) → U1_ga(T14, X31, half24_in_ga(T14, X31))
U1_ga(T14, X31, half24_out_ga(T14, X31)) → half24_out_ga(s(s(T14)), s(X31))
U2_ga(T10, T7, half24_out_ga(T10, X20)) → log1_out_ga(s(s(T10)), s(T7))
log1_in_ga(s(s(T10)), s(T7)) → U3_ga(T10, T7, half24_in_ga(T10, T11))
U3_ga(T10, T7, half24_out_ga(T10, T11)) → U4_ga(T10, T7, log1_in_ga(s(T11), T7))
U4_ga(T10, T7, log1_out_ga(s(T11), T7)) → log1_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
log1_in_ga(x1, x2)  =  log1_in_ga(x1)
0  =  0
log1_out_ga(x1, x2)  =  log1_out_ga
s(x1)  =  s(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x3)
half24_in_ga(x1, x2)  =  half24_in_ga(x1)
half24_out_ga(x1, x2)  =  half24_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
U3_ga(x1, x2, x3)  =  U3_ga(x3)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
LOG1_IN_GA(x1, x2)  =  LOG1_IN_GA(x1)
U2_GA(x1, x2, x3)  =  U2_GA(x3)
HALF24_IN_GA(x1, x2)  =  HALF24_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x3)
U3_GA(x1, x2, x3)  =  U3_GA(x3)
U4_GA(x1, x2, x3)  =  U4_GA(x3)

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

(7) DependencyGraphProof (EQUIVALENT transformation)

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

(8) Complex Obligation (AND)

(9) Obligation:

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

HALF24_IN_GA(s(s(T14)), s(X31)) → HALF24_IN_GA(T14, X31)

The TRS R consists of the following rules:

log1_in_ga(0, s(0)) → log1_out_ga(0, s(0))
log1_in_ga(s(0), s(s(0))) → log1_out_ga(s(0), s(s(0)))
log1_in_ga(s(s(T10)), s(T7)) → U2_ga(T10, T7, half24_in_ga(T10, X20))
half24_in_ga(0, 0) → half24_out_ga(0, 0)
half24_in_ga(s(0), 0) → half24_out_ga(s(0), 0)
half24_in_ga(s(s(T14)), s(X31)) → U1_ga(T14, X31, half24_in_ga(T14, X31))
U1_ga(T14, X31, half24_out_ga(T14, X31)) → half24_out_ga(s(s(T14)), s(X31))
U2_ga(T10, T7, half24_out_ga(T10, X20)) → log1_out_ga(s(s(T10)), s(T7))
log1_in_ga(s(s(T10)), s(T7)) → U3_ga(T10, T7, half24_in_ga(T10, T11))
U3_ga(T10, T7, half24_out_ga(T10, T11)) → U4_ga(T10, T7, log1_in_ga(s(T11), T7))
U4_ga(T10, T7, log1_out_ga(s(T11), T7)) → log1_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
log1_in_ga(x1, x2)  =  log1_in_ga(x1)
0  =  0
log1_out_ga(x1, x2)  =  log1_out_ga
s(x1)  =  s(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x3)
half24_in_ga(x1, x2)  =  half24_in_ga(x1)
half24_out_ga(x1, x2)  =  half24_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
U3_ga(x1, x2, x3)  =  U3_ga(x3)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
HALF24_IN_GA(x1, x2)  =  HALF24_IN_GA(x1)

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:

HALF24_IN_GA(s(s(T14)), s(X31)) → HALF24_IN_GA(T14, X31)

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

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:

HALF24_IN_GA(s(s(T14))) → HALF24_IN_GA(T14)

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:

  • HALF24_IN_GA(s(s(T14))) → HALF24_IN_GA(T14)
    The graph contains the following edges 1 > 1

(15) YES

(16) Obligation:

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

LOG1_IN_GA(s(s(T10)), s(T7)) → U3_GA(T10, T7, half24_in_ga(T10, T11))
U3_GA(T10, T7, half24_out_ga(T10, T11)) → LOG1_IN_GA(s(T11), T7)

The TRS R consists of the following rules:

log1_in_ga(0, s(0)) → log1_out_ga(0, s(0))
log1_in_ga(s(0), s(s(0))) → log1_out_ga(s(0), s(s(0)))
log1_in_ga(s(s(T10)), s(T7)) → U2_ga(T10, T7, half24_in_ga(T10, X20))
half24_in_ga(0, 0) → half24_out_ga(0, 0)
half24_in_ga(s(0), 0) → half24_out_ga(s(0), 0)
half24_in_ga(s(s(T14)), s(X31)) → U1_ga(T14, X31, half24_in_ga(T14, X31))
U1_ga(T14, X31, half24_out_ga(T14, X31)) → half24_out_ga(s(s(T14)), s(X31))
U2_ga(T10, T7, half24_out_ga(T10, X20)) → log1_out_ga(s(s(T10)), s(T7))
log1_in_ga(s(s(T10)), s(T7)) → U3_ga(T10, T7, half24_in_ga(T10, T11))
U3_ga(T10, T7, half24_out_ga(T10, T11)) → U4_ga(T10, T7, log1_in_ga(s(T11), T7))
U4_ga(T10, T7, log1_out_ga(s(T11), T7)) → log1_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
log1_in_ga(x1, x2)  =  log1_in_ga(x1)
0  =  0
log1_out_ga(x1, x2)  =  log1_out_ga
s(x1)  =  s(x1)
U2_ga(x1, x2, x3)  =  U2_ga(x3)
half24_in_ga(x1, x2)  =  half24_in_ga(x1)
half24_out_ga(x1, x2)  =  half24_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
U3_ga(x1, x2, x3)  =  U3_ga(x3)
U4_ga(x1, x2, x3)  =  U4_ga(x3)
LOG1_IN_GA(x1, x2)  =  LOG1_IN_GA(x1)
U3_GA(x1, x2, x3)  =  U3_GA(x3)

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:

LOG1_IN_GA(s(s(T10)), s(T7)) → U3_GA(T10, T7, half24_in_ga(T10, T11))
U3_GA(T10, T7, half24_out_ga(T10, T11)) → LOG1_IN_GA(s(T11), T7)

The TRS R consists of the following rules:

half24_in_ga(0, 0) → half24_out_ga(0, 0)
half24_in_ga(s(0), 0) → half24_out_ga(s(0), 0)
half24_in_ga(s(s(T14)), s(X31)) → U1_ga(T14, X31, half24_in_ga(T14, X31))
U1_ga(T14, X31, half24_out_ga(T14, X31)) → half24_out_ga(s(s(T14)), s(X31))

The argument filtering Pi contains the following mapping:
0  =  0
s(x1)  =  s(x1)
half24_in_ga(x1, x2)  =  half24_in_ga(x1)
half24_out_ga(x1, x2)  =  half24_out_ga(x2)
U1_ga(x1, x2, x3)  =  U1_ga(x3)
LOG1_IN_GA(x1, x2)  =  LOG1_IN_GA(x1)
U3_GA(x1, x2, x3)  =  U3_GA(x3)

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:

LOG1_IN_GA(s(s(T10))) → U3_GA(half24_in_ga(T10))
U3_GA(half24_out_ga(T11)) → LOG1_IN_GA(s(T11))

The TRS R consists of the following rules:

half24_in_ga(0) → half24_out_ga(0)
half24_in_ga(s(0)) → half24_out_ga(0)
half24_in_ga(s(s(T14))) → U1_ga(half24_in_ga(T14))
U1_ga(half24_out_ga(X31)) → half24_out_ga(s(X31))

The set Q consists of the following terms:

half24_in_ga(x0)
U1_ga(x0)

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

(21) MRRProof (EQUIVALENT transformation)

By using the rule removal processor [LPAR04] with the following ordering, at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

LOG1_IN_GA(s(s(T10))) → U3_GA(half24_in_ga(T10))
U3_GA(half24_out_ga(T11)) → LOG1_IN_GA(s(T11))

Strictly oriented rules of the TRS R:

half24_in_ga(0) → half24_out_ga(0)
half24_in_ga(s(0)) → half24_out_ga(0)
half24_in_ga(s(s(T14))) → U1_ga(half24_in_ga(T14))
U1_ga(half24_out_ga(X31)) → half24_out_ga(s(X31))

Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(LOG1_IN_GA(x1)) = x1   
POL(U1_ga(x1)) = 4 + x1   
POL(U3_GA(x1)) = 4 + x1   
POL(half24_in_ga(x1)) = 1 + x1   
POL(half24_out_ga(x1)) = x1   
POL(s(x1)) = 3 + x1   

(22) Obligation:

Q DP problem:
P is empty.
R is empty.
The set Q consists of the following terms:

half24_in_ga(x0)
U1_ga(x0)

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

(23) PisEmptyProof (EQUIVALENT transformation)

The TRS P is empty. Hence, there is no (P,Q,R) chain.

(24) YES