YES
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http:/www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Left Termination proof of ../tpdb/LP/lpexamples/factorial.pl</title>
</head>
<body>
<BR><B>Left Termination</B> of the query pattern
factorial_in_2(g, a)
w.r.t. the given <I>Prolog program</I> could successfully be <font color=#00ff00>proven</font>:<BR><BR><BR><BR><pre>&#8627 <B>Prolog</B></pre><pre>  &#8627 PredefinedPredicateTransformerProof</pre><BR>Clauses:<BR><BR>factorial1(N, F)&#160;:-&#160;','(>(N, 0), ','(is(N1, -(N, 1)), ','(factorial1(N1, F1), is(F, *(N, F1))))).<BR>factorial1(0, 1).<BR>factorial2(N, F)&#160;:-&#160;factorial2(0, N, 1, F).<BR>factorial2(I, N, T, F)&#160;:-&#160;','(<(I, N), ','(is(I1, +(I, 1)), ','(is(T1, *(T, I1)), factorial2(I1, N, T1, F)))).<BR>factorial2(N, N, F, F).<BR>factorial3(N, F)&#160;:-&#160;factorial3(N, 1, F).<BR>factorial3(N, T, F)&#160;:-&#160;','(>(N, 0), ','(is(T1, *(T, N)), ','(is(N1, -(N, 1)), factorial3(N1, T1, F)))).<BR>factorial3(0, F, F).<BR><BR>Queries:<BR><BR>factorial(g,a).<BR><BR>Added definitions of predefined predicates.<BR><BR><pre>&#8627 Prolog</pre><pre>  &#8627 PredefinedPredicateTransformerProof</pre><pre>    &#8627 <B>Prolog</B></pre><pre>      &#8627 PrologToPiTRSProof</pre><BR>Clauses:<BR><BR>factorial1(N, F)&#160;:-&#160;','(=(X, N), ','(=(X1, zero), ','(isGreater(X, X1), ','(isMinus(N, succ(zero), U), ','(=(N1, U), ','(factorial1(N1, F1), ','(isTimes(N, F1, U), =(F, U)))))))).<BR>factorial1(zero, succ(zero)).<BR>factorial2(N, F)&#160;:-&#160;factorial2(zero, N, succ(zero), F).<BR>factorial2(I, N, T, F)&#160;:-&#160;','(=(X, I), ','(=(X1, N), ','(isLess(X, X1), ','(isPlus(I, succ(zero), U), ','(=(I1, U), ','(isTimes(T, I1, U), ','(=(T1, U), factorial2(I1, N, T1, F)))))))).<BR>factorial2(N, N, F, F).<BR>factorial3(N, F)&#160;:-&#160;factorial3(N, succ(zero), F).<BR>factorial3(N, T, F)&#160;:-&#160;','(=(X, N), ','(=(X1, zero), ','(isGreater(X, X1), ','(isTimes(T, N, U), ','(=(T1, U), ','(isMinus(N, succ(zero), U), ','(=(N1, U), factorial3(N1, T1, F)))))))).<BR>factorial3(zero, F, F).<BR>isPlus(zero, X, X).<BR>isPlus(succ(X), zero, succ(X)).<BR>isPlus(succ(X), succ(Y), succ(succ(Z)))&#160;:-&#160;isPlus(X, Y, Z).<BR>isPlus(succ(X), pred(Y), Z)&#160;:-&#160;isPlus(X, Y, Z).<BR>isPlus(pred(X), zero, pred(X)).<BR>isPlus(pred(X), succ(Y), Z)&#160;:-&#160;isPlus(X, Y, Z).<BR>isPlus(pred(X), pred(Y), pred(pred(Z)))&#160;:-&#160;isPlus(X, Y, Z).<BR>isMinus(X, zero, X).<BR>isMinus(zero, succ(Y), pred(Z))&#160;:-&#160;isMinus(zero, Y, Z).<BR>isMinus(zero, pred(Y), succ(Z))&#160;:-&#160;isMinus(zero, Y, Z).<BR>isMinus(succ(X), succ(Y), Z)&#160;:-&#160;isMinus(X, Y, Z).<BR>isMinus(succ(X), pred(Y), succ(succ(Z)))&#160;:-&#160;isMinus(X, Y, Z).<BR>isMinus(pred(X), succ(Y), pred(pred(Z)))&#160;:-&#160;isMinus(X, Y, Z).<BR>isMinus(pred(X), pred(Y), Z)&#160;:-&#160;isMinus(X, Y, Z).<BR>isTimes(X, zero, zero).<BR>isTimes(zero, succ(Y), zero).<BR>isTimes(zero, pred(Y), zero).<BR>isTimes(succ(X), succ(Y), Z)&#160;:-&#160;','(isTimes(succ(X), Y, A), isPlus(A, succ(X), Z)).<BR>isTimes(succ(X), pred(Y), Z)&#160;:-&#160;','(isTimes(succ(X), Y, A), isMinus(A, succ(X), Z)).<BR>isTimes(pred(X), succ(Y), Z)&#160;:-&#160;','(isTimes(pred(X), Y, A), isPlus(A, pred(X), Z)).<BR>isTimes(pred(X), pred(Y), Z)&#160;:-&#160;','(isTimes(pred(X), Y, A), isMinus(A, pred(X), Z)).<BR>isDiv(zero, succ(Y), zero).<BR>isDiv(zero, pred(Y), zero).<BR>isDiv(succ(X), succ(Y), zero)&#160;:-&#160;isMinus(succ(X), succ(Y), pred(Z)).<BR>isDiv(succ(X), succ(Y), succ(Z))&#160;:-&#160;','(isMinus(succ(X), succ(Y), A), isDiv(A, succ(Y), Z)).<BR>isDiv(succ(X), pred(Y), Z)&#160;:-&#160;','(isMinus(zero, pred(Y), A), ','(isDiv(succ(X), A, B), isMinus(zero, B, Z))).<BR>isDiv(pred(X), pred(Y), zero)&#160;:-&#160;isMinus(pred(X), pred(Y), succ(Z)).<BR>isDiv(pred(X), pred(Y), succ(Z))&#160;:-&#160;','(isMinus(pred(X), pred(Y), A), isDiv(A, pred(Y), Z)).<BR>isDiv(pred(X), succ(Y), Z)&#160;:-&#160;','(isMinus(zero, pred(X), A), ','(isDiv(A, succ(Y), B), isMinus(zero, B, Z))).<BR>isModulo(X, Y, Z)&#160;:-&#160;','(isDiv(X, Y, A), ','(isTimes(A, Y, B), isMinus(X, B, Z))).<BR>=(X, X).<BR>isGreater(succ(X), zero).<BR>isGreater(succ(X), pred(Y)).<BR>isGreater(succ(X), succ(Y))&#160;:-&#160;isGreater(X, Y).<BR>isGreater(zero, pred(Y)).<BR>isGreater(pred(X), pred(Y))&#160;:-&#160;isGreater(X, Y).<BR>isLess(pred(X), zero).<BR>isLess(pred(X), succ(Y)).<BR>isLess(pred(X), pred(Y))&#160;:-&#160;isLess(X, Y).<BR>isLess(zero, succ(Y)).<BR>isLess(succ(X), succ(Y))&#160;:-&#160;isLess(X, Y).<BR><BR>Queries:<BR><BR>factorial(g,a).<BR><BR>We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
<BR>Transforming <I>Prolog</I> into the following <B>Term Rewriting System</B>:
<BR>Pi-finite rewrite system:<BR>R is empty.<BR>Pi is empty.<BR>
<P><B>Infinitary Constructor Rewriting Termination</B> of PiTRS implies <B>Termination</B> of Prolog<P>
<BR><BR><pre>&#8627 Prolog</pre><pre>  &#8627 PredefinedPredicateTransformerProof</pre><pre>    &#8627 Prolog</pre><pre>      &#8627 PrologToPiTRSProof</pre><pre>        &#8627 <B>PiTRS</B></pre><pre>          &#8627 RisEmptyProof</pre><BR>Pi-finite rewrite system:<BR>R is empty.<BR>Pi is empty.<BR><BR>The TRS R is empty. Hence, termination is trivially proven.<BR><BR></body>

