> Nothing will warn you that the variable wasn't declared because that's also a normal thing to do.

Minor nitpick regarding an otherwise good answer: Prolog systems will warn you about "singleton variables", that is, variables with exactly one occurrence. This does catch the usual cases of this kind of error.