eof
Check for end-of-file
Remarks
The eof/0 checks whether the current file positionis at the end of the file. If so, eof/0 succeeds; otherwise, it fails.
Example
my_consult(FileName) :- see(FileName), repeat, read(Term), assertz(Term), eof.