:- fold(i,i,o).

% mode: fold[i,i,o]
fold(X,[Y|Ys],Z) :- op(X,Y,V), fold(V,Ys,Z).
fold(X,[],X).

% mode: op[i,i,o]
op(a,b,c).
