(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)).

Query: log(g,a)

(1) PrologToPiTRSViaGraphTransformerProof (SOUND transformation)

Transformed Prolog program to (Pi-)TRS.

(2) Obligation:

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

logA_in_ga(0, s(0)) → logA_out_ga(0, s(0))
logA_in_ga(s(0), s(s(0))) → logA_out_ga(s(0), s(s(0)))
logA_in_ga(s(s(T10)), s(T7)) → U1_ga(T10, T7, pB_in_gaa(T10, X18, T7))
pB_in_gaa(T10, T11, T7) → U3_gaa(T10, T11, T7, halfC_in_ga(T10, T11))
halfC_in_ga(0, 0) → halfC_out_ga(0, 0)
halfC_in_ga(s(0), 0) → halfC_out_ga(s(0), 0)
halfC_in_ga(s(s(T14)), s(X27)) → U2_ga(T14, X27, halfC_in_ga(T14, X27))
U2_ga(T14, X27, halfC_out_ga(T14, X27)) → halfC_out_ga(s(s(T14)), s(X27))
U3_gaa(T10, T11, T7, halfC_out_ga(T10, T11)) → U4_gaa(T10, T11, T7, logA_in_ga(s(T11), T7))
U4_gaa(T10, T11, T7, logA_out_ga(s(T11), T7)) → pB_out_gaa(T10, T11, T7)
U1_ga(T10, T7, pB_out_gaa(T10, X18, T7)) → logA_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
logA_in_ga(x1, x2)  =  logA_in_ga(x1)
0  =  0
logA_out_ga(x1, x2)  =  logA_out_ga(x1, x2)
s(x1)  =  s(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x1, x3)
pB_in_gaa(x1, x2, x3)  =  pB_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x1, x4)
halfC_in_ga(x1, x2)  =  halfC_in_ga(x1)
halfC_out_ga(x1, x2)  =  halfC_out_ga(x1, x2)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x1, x2, x4)
pB_out_gaa(x1, x2, x3)  =  pB_out_gaa(x1, x2, x3)

(3) DependencyPairsProof (EQUIVALENT transformation)

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

LOGA_IN_GA(s(s(T10)), s(T7)) → U1_GA(T10, T7, pB_in_gaa(T10, X18, T7))
LOGA_IN_GA(s(s(T10)), s(T7)) → PB_IN_GAA(T10, X18, T7)
PB_IN_GAA(T10, T11, T7) → U3_GAA(T10, T11, T7, halfC_in_ga(T10, T11))
PB_IN_GAA(T10, T11, T7) → HALFC_IN_GA(T10, T11)
HALFC_IN_GA(s(s(T14)), s(X27)) → U2_GA(T14, X27, halfC_in_ga(T14, X27))
HALFC_IN_GA(s(s(T14)), s(X27)) → HALFC_IN_GA(T14, X27)
U3_GAA(T10, T11, T7, halfC_out_ga(T10, T11)) → U4_GAA(T10, T11, T7, logA_in_ga(s(T11), T7))
U3_GAA(T10, T11, T7, halfC_out_ga(T10, T11)) → LOGA_IN_GA(s(T11), T7)

The TRS R consists of the following rules:

logA_in_ga(0, s(0)) → logA_out_ga(0, s(0))
logA_in_ga(s(0), s(s(0))) → logA_out_ga(s(0), s(s(0)))
logA_in_ga(s(s(T10)), s(T7)) → U1_ga(T10, T7, pB_in_gaa(T10, X18, T7))
pB_in_gaa(T10, T11, T7) → U3_gaa(T10, T11, T7, halfC_in_ga(T10, T11))
halfC_in_ga(0, 0) → halfC_out_ga(0, 0)
halfC_in_ga(s(0), 0) → halfC_out_ga(s(0), 0)
halfC_in_ga(s(s(T14)), s(X27)) → U2_ga(T14, X27, halfC_in_ga(T14, X27))
U2_ga(T14, X27, halfC_out_ga(T14, X27)) → halfC_out_ga(s(s(T14)), s(X27))
U3_gaa(T10, T11, T7, halfC_out_ga(T10, T11)) → U4_gaa(T10, T11, T7, logA_in_ga(s(T11), T7))
U4_gaa(T10, T11, T7, logA_out_ga(s(T11), T7)) → pB_out_gaa(T10, T11, T7)
U1_ga(T10, T7, pB_out_gaa(T10, X18, T7)) → logA_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
logA_in_ga(x1, x2)  =  logA_in_ga(x1)
0  =  0
logA_out_ga(x1, x2)  =  logA_out_ga(x1, x2)
s(x1)  =  s(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x1, x3)
pB_in_gaa(x1, x2, x3)  =  pB_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x1, x4)
halfC_in_ga(x1, x2)  =  halfC_in_ga(x1)
halfC_out_ga(x1, x2)  =  halfC_out_ga(x1, x2)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x1, x2, x4)
pB_out_gaa(x1, x2, x3)  =  pB_out_gaa(x1, x2, x3)
LOGA_IN_GA(x1, x2)  =  LOGA_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x1, x3)
PB_IN_GAA(x1, x2, x3)  =  PB_IN_GAA(x1)
U3_GAA(x1, x2, x3, x4)  =  U3_GAA(x1, x4)
HALFC_IN_GA(x1, x2)  =  HALFC_IN_GA(x1)
U2_GA(x1, x2, x3)  =  U2_GA(x1, x3)
U4_GAA(x1, x2, x3, x4)  =  U4_GAA(x1, x2, x4)

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

(4) Obligation:

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

LOGA_IN_GA(s(s(T10)), s(T7)) → U1_GA(T10, T7, pB_in_gaa(T10, X18, T7))
LOGA_IN_GA(s(s(T10)), s(T7)) → PB_IN_GAA(T10, X18, T7)
PB_IN_GAA(T10, T11, T7) → U3_GAA(T10, T11, T7, halfC_in_ga(T10, T11))
PB_IN_GAA(T10, T11, T7) → HALFC_IN_GA(T10, T11)
HALFC_IN_GA(s(s(T14)), s(X27)) → U2_GA(T14, X27, halfC_in_ga(T14, X27))
HALFC_IN_GA(s(s(T14)), s(X27)) → HALFC_IN_GA(T14, X27)
U3_GAA(T10, T11, T7, halfC_out_ga(T10, T11)) → U4_GAA(T10, T11, T7, logA_in_ga(s(T11), T7))
U3_GAA(T10, T11, T7, halfC_out_ga(T10, T11)) → LOGA_IN_GA(s(T11), T7)

The TRS R consists of the following rules:

logA_in_ga(0, s(0)) → logA_out_ga(0, s(0))
logA_in_ga(s(0), s(s(0))) → logA_out_ga(s(0), s(s(0)))
logA_in_ga(s(s(T10)), s(T7)) → U1_ga(T10, T7, pB_in_gaa(T10, X18, T7))
pB_in_gaa(T10, T11, T7) → U3_gaa(T10, T11, T7, halfC_in_ga(T10, T11))
halfC_in_ga(0, 0) → halfC_out_ga(0, 0)
halfC_in_ga(s(0), 0) → halfC_out_ga(s(0), 0)
halfC_in_ga(s(s(T14)), s(X27)) → U2_ga(T14, X27, halfC_in_ga(T14, X27))
U2_ga(T14, X27, halfC_out_ga(T14, X27)) → halfC_out_ga(s(s(T14)), s(X27))
U3_gaa(T10, T11, T7, halfC_out_ga(T10, T11)) → U4_gaa(T10, T11, T7, logA_in_ga(s(T11), T7))
U4_gaa(T10, T11, T7, logA_out_ga(s(T11), T7)) → pB_out_gaa(T10, T11, T7)
U1_ga(T10, T7, pB_out_gaa(T10, X18, T7)) → logA_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
logA_in_ga(x1, x2)  =  logA_in_ga(x1)
0  =  0
logA_out_ga(x1, x2)  =  logA_out_ga(x1, x2)
s(x1)  =  s(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x1, x3)
pB_in_gaa(x1, x2, x3)  =  pB_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x1, x4)
halfC_in_ga(x1, x2)  =  halfC_in_ga(x1)
halfC_out_ga(x1, x2)  =  halfC_out_ga(x1, x2)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x1, x2, x4)
pB_out_gaa(x1, x2, x3)  =  pB_out_gaa(x1, x2, x3)
LOGA_IN_GA(x1, x2)  =  LOGA_IN_GA(x1)
U1_GA(x1, x2, x3)  =  U1_GA(x1, x3)
PB_IN_GAA(x1, x2, x3)  =  PB_IN_GAA(x1)
U3_GAA(x1, x2, x3, x4)  =  U3_GAA(x1, x4)
HALFC_IN_GA(x1, x2)  =  HALFC_IN_GA(x1)
U2_GA(x1, x2, x3)  =  U2_GA(x1, x3)
U4_GAA(x1, x2, x3, x4)  =  U4_GAA(x1, x2, x4)

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

(5) DependencyGraphProof (EQUIVALENT transformation)

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

(6) Complex Obligation (AND)

(7) Obligation:

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

HALFC_IN_GA(s(s(T14)), s(X27)) → HALFC_IN_GA(T14, X27)

The TRS R consists of the following rules:

logA_in_ga(0, s(0)) → logA_out_ga(0, s(0))
logA_in_ga(s(0), s(s(0))) → logA_out_ga(s(0), s(s(0)))
logA_in_ga(s(s(T10)), s(T7)) → U1_ga(T10, T7, pB_in_gaa(T10, X18, T7))
pB_in_gaa(T10, T11, T7) → U3_gaa(T10, T11, T7, halfC_in_ga(T10, T11))
halfC_in_ga(0, 0) → halfC_out_ga(0, 0)
halfC_in_ga(s(0), 0) → halfC_out_ga(s(0), 0)
halfC_in_ga(s(s(T14)), s(X27)) → U2_ga(T14, X27, halfC_in_ga(T14, X27))
U2_ga(T14, X27, halfC_out_ga(T14, X27)) → halfC_out_ga(s(s(T14)), s(X27))
U3_gaa(T10, T11, T7, halfC_out_ga(T10, T11)) → U4_gaa(T10, T11, T7, logA_in_ga(s(T11), T7))
U4_gaa(T10, T11, T7, logA_out_ga(s(T11), T7)) → pB_out_gaa(T10, T11, T7)
U1_ga(T10, T7, pB_out_gaa(T10, X18, T7)) → logA_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
logA_in_ga(x1, x2)  =  logA_in_ga(x1)
0  =  0
logA_out_ga(x1, x2)  =  logA_out_ga(x1, x2)
s(x1)  =  s(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x1, x3)
pB_in_gaa(x1, x2, x3)  =  pB_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x1, x4)
halfC_in_ga(x1, x2)  =  halfC_in_ga(x1)
halfC_out_ga(x1, x2)  =  halfC_out_ga(x1, x2)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x1, x2, x4)
pB_out_gaa(x1, x2, x3)  =  pB_out_gaa(x1, x2, x3)
HALFC_IN_GA(x1, x2)  =  HALFC_IN_GA(x1)

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

(8) UsableRulesProof (EQUIVALENT transformation)

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

(9) Obligation:

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

HALFC_IN_GA(s(s(T14)), s(X27)) → HALFC_IN_GA(T14, X27)

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

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

(10) PiDPToQDPProof (SOUND transformation)

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

(11) Obligation:

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

HALFC_IN_GA(s(s(T14))) → HALFC_IN_GA(T14)

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

(12) QDPSizeChangeProof (EQUIVALENT transformation)

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

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

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

(13) YES

(14) Obligation:

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

LOGA_IN_GA(s(s(T10)), s(T7)) → PB_IN_GAA(T10, X18, T7)
PB_IN_GAA(T10, T11, T7) → U3_GAA(T10, T11, T7, halfC_in_ga(T10, T11))
U3_GAA(T10, T11, T7, halfC_out_ga(T10, T11)) → LOGA_IN_GA(s(T11), T7)

The TRS R consists of the following rules:

logA_in_ga(0, s(0)) → logA_out_ga(0, s(0))
logA_in_ga(s(0), s(s(0))) → logA_out_ga(s(0), s(s(0)))
logA_in_ga(s(s(T10)), s(T7)) → U1_ga(T10, T7, pB_in_gaa(T10, X18, T7))
pB_in_gaa(T10, T11, T7) → U3_gaa(T10, T11, T7, halfC_in_ga(T10, T11))
halfC_in_ga(0, 0) → halfC_out_ga(0, 0)
halfC_in_ga(s(0), 0) → halfC_out_ga(s(0), 0)
halfC_in_ga(s(s(T14)), s(X27)) → U2_ga(T14, X27, halfC_in_ga(T14, X27))
U2_ga(T14, X27, halfC_out_ga(T14, X27)) → halfC_out_ga(s(s(T14)), s(X27))
U3_gaa(T10, T11, T7, halfC_out_ga(T10, T11)) → U4_gaa(T10, T11, T7, logA_in_ga(s(T11), T7))
U4_gaa(T10, T11, T7, logA_out_ga(s(T11), T7)) → pB_out_gaa(T10, T11, T7)
U1_ga(T10, T7, pB_out_gaa(T10, X18, T7)) → logA_out_ga(s(s(T10)), s(T7))

The argument filtering Pi contains the following mapping:
logA_in_ga(x1, x2)  =  logA_in_ga(x1)
0  =  0
logA_out_ga(x1, x2)  =  logA_out_ga(x1, x2)
s(x1)  =  s(x1)
U1_ga(x1, x2, x3)  =  U1_ga(x1, x3)
pB_in_gaa(x1, x2, x3)  =  pB_in_gaa(x1)
U3_gaa(x1, x2, x3, x4)  =  U3_gaa(x1, x4)
halfC_in_ga(x1, x2)  =  halfC_in_ga(x1)
halfC_out_ga(x1, x2)  =  halfC_out_ga(x1, x2)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
U4_gaa(x1, x2, x3, x4)  =  U4_gaa(x1, x2, x4)
pB_out_gaa(x1, x2, x3)  =  pB_out_gaa(x1, x2, x3)
LOGA_IN_GA(x1, x2)  =  LOGA_IN_GA(x1)
PB_IN_GAA(x1, x2, x3)  =  PB_IN_GAA(x1)
U3_GAA(x1, x2, x3, x4)  =  U3_GAA(x1, x4)

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

(15) UsableRulesProof (EQUIVALENT transformation)

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

(16) Obligation:

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

LOGA_IN_GA(s(s(T10)), s(T7)) → PB_IN_GAA(T10, X18, T7)
PB_IN_GAA(T10, T11, T7) → U3_GAA(T10, T11, T7, halfC_in_ga(T10, T11))
U3_GAA(T10, T11, T7, halfC_out_ga(T10, T11)) → LOGA_IN_GA(s(T11), T7)

The TRS R consists of the following rules:

halfC_in_ga(0, 0) → halfC_out_ga(0, 0)
halfC_in_ga(s(0), 0) → halfC_out_ga(s(0), 0)
halfC_in_ga(s(s(T14)), s(X27)) → U2_ga(T14, X27, halfC_in_ga(T14, X27))
U2_ga(T14, X27, halfC_out_ga(T14, X27)) → halfC_out_ga(s(s(T14)), s(X27))

The argument filtering Pi contains the following mapping:
0  =  0
s(x1)  =  s(x1)
halfC_in_ga(x1, x2)  =  halfC_in_ga(x1)
halfC_out_ga(x1, x2)  =  halfC_out_ga(x1, x2)
U2_ga(x1, x2, x3)  =  U2_ga(x1, x3)
LOGA_IN_GA(x1, x2)  =  LOGA_IN_GA(x1)
PB_IN_GAA(x1, x2, x3)  =  PB_IN_GAA(x1)
U3_GAA(x1, x2, x3, x4)  =  U3_GAA(x1, x4)

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

(17) PiDPToQDPProof (SOUND transformation)

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

(18) Obligation:

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

LOGA_IN_GA(s(s(T10))) → PB_IN_GAA(T10)
PB_IN_GAA(T10) → U3_GAA(T10, halfC_in_ga(T10))
U3_GAA(T10, halfC_out_ga(T10, T11)) → LOGA_IN_GA(s(T11))

The TRS R consists of the following rules:

halfC_in_ga(0) → halfC_out_ga(0, 0)
halfC_in_ga(s(0)) → halfC_out_ga(s(0), 0)
halfC_in_ga(s(s(T14))) → U2_ga(T14, halfC_in_ga(T14))
U2_ga(T14, halfC_out_ga(T14, X27)) → halfC_out_ga(s(s(T14)), s(X27))

The set Q consists of the following terms:

halfC_in_ga(x0)
U2_ga(x0, x1)

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

(19) QDPOrderProof (EQUIVALENT transformation)

We use the reduction pair processor [LPAR04,JAR06].


The following pairs can be oriented strictly and are deleted.


LOGA_IN_GA(s(s(T10))) → PB_IN_GAA(T10)
The remaining pairs can at least be oriented weakly.
Used ordering: Polynomial interpretation [POLO]:

POL(0) = 0   
POL(LOGA_IN_GA(x1)) = x1   
POL(PB_IN_GAA(x1)) = 1 + x1   
POL(U2_ga(x1, x2)) = 1 + x2   
POL(U3_GAA(x1, x2)) = 1 + x2   
POL(halfC_in_ga(x1)) = x1   
POL(halfC_out_ga(x1, x2)) = x2   
POL(s(x1)) = 1 + x1   

The following usable rules [FROCOS05] with respect to the argument filtering of the ordering [JAR06] were oriented:

halfC_in_ga(0) → halfC_out_ga(0, 0)
halfC_in_ga(s(0)) → halfC_out_ga(s(0), 0)
halfC_in_ga(s(s(T14))) → U2_ga(T14, halfC_in_ga(T14))
U2_ga(T14, halfC_out_ga(T14, X27)) → halfC_out_ga(s(s(T14)), s(X27))

(20) Obligation:

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

PB_IN_GAA(T10) → U3_GAA(T10, halfC_in_ga(T10))
U3_GAA(T10, halfC_out_ga(T10, T11)) → LOGA_IN_GA(s(T11))

The TRS R consists of the following rules:

halfC_in_ga(0) → halfC_out_ga(0, 0)
halfC_in_ga(s(0)) → halfC_out_ga(s(0), 0)
halfC_in_ga(s(s(T14))) → U2_ga(T14, halfC_in_ga(T14))
U2_ga(T14, halfC_out_ga(T14, X27)) → halfC_out_ga(s(s(T14)), s(X27))

The set Q consists of the following terms:

halfC_in_ga(x0)
U2_ga(x0, x1)

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

(21) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LPAR04,FROCOS05,EDGSTAR] contains 0 SCCs with 2 less nodes.

(22) TRUE