Annotated using CiaoPP: :- mode(len/2, [+,-]). :- measure(len/2, [length,size]). %complexity: len(i,o). %% len(Xs, X) :- X is the length of the list Xs. %% %TWTYPES :- type len(list,nat). len([], 0). len([_ | Ts], s(N)) :- len(Ts, N). /*TWDESC len(Xs, X) :- X is the length of the list Xs. */ /*TWTYPES list([]). list([X|Xs]) :- poly(X), list(Xs). poly(dummy). nat(0). nat(s(X)) :- nat(X). */ /*TWDEMO selected_norms([list,nat,poly]). query(len(b,f,f,f,f,f)). query(len(f,f,b,f,f,f)). query(len(f,f,f,f,b,f)). */ Caslog 1.0, April 1992. * Mutually exclusive classes of clauses for predicate len/2 : [[1],[2]] * Size functions for predicate len/2 : [$(1),$(1)+1] * Relation functions for predicate len/2 : [inf] * Solution functions for predicate len/2 : [1] * Time functions for predicate len/2 : [$(1)+1] {Exexution Time: 0.0 msec} {End of Caslog execution.}