If a clause being compiled contains a syntax error, Prolog tells you that a syntax error has been found and displays the clause. For example, suppose you accidentally omitted a closing parenthesis in a clause:
| ?- member(X,[a,b,c,d].
When you compile a file containing this clause, Prolog compiles all the clauses that precede the clause containing the error. When it reaches this clause, it displays the message:
! Syntax error ! between lines 26 and 27 ! member(X,[a,b,c,d] ! <<here>>
to let you know
Prolog then ignores the clause and continues loading the rest of the file into the database.