oncetakes a single argument, which must be a "callable term" - one that makes sense as a goal - e.g.
happy(X)makes sense as a goal, but
23does not - and calls the term in such a way as to produces just one solution. It is defined as:
once(P) :- P, !.