Annotated using CiaoPP:
:- mode(sum/3, [-,-,+]).
:- measure(sum/3, [size,size,size]).
%complexity: sum(o,o,i).
%% sum(X, Y, Z) :- X, Y, Z are numerals such that Z is the sum of X and Y.
%%

%TWTYPES     :- type sum(nat,nat,nat).

sum(X, 0, X).
sum(X, s(Y), s(Z)) :- sum(X, Y, Z).


/*TWDESC

sum(X, Y, Z) :- X, Y, Z are numerals such that Z is the sum of X and Y.

*/


/*TWTYPES

nat(0).
nat(s(X)) :- nat(X).

*/


/*TWDEMO

selected_norms([nat]).

query(sum(f,b,f)).
query(sum(f,f,b)).


*/


Caslog 1.0, April 1992.

* Mutually exclusive classes of clauses for predicate sum/3 :

[[1,2]]

* Size functions for predicate sum/3 :

[$(3),$(3)+1,$(3)]

* Relation functions for predicate sum/3 :

[inf]

* Solution functions for predicate sum/3 :

[$(3)]

* Time functions for predicate sum/3 :

[2* $(3)]

{Exexution Time: 4.0 msec}

{End of Caslog execution.}