| generates an ordered sequence of numbers.
for(+Start, ?Counter, +End)
for/3 generates an ascending ordered sequence of integers with
starting value Start and ending value End, where the step between two numbers is 1.
If End is less than Start then the predicate fails.
Arguments
Start integer
Counter integer
End integer
Examples
% occurs_in(+Arg, +Term)
% check if Term occurs in Term
occurs_in(Arg, Term) :-
Arg == Term, !.
occurs_in(Arg, Term) :-
compound(Term), !,
functor(Term, _, Arity),
for(1, I, Arity),
arg(I, Term, SubTerm),
occurs_in(Arg, SubTerm), !.
Standard
This predicate is not part of the ISO-Prolog Standard.
See also
is/2.
|