Please see this answer. First getting true
and then getting false
after backtracking, just means that it found an answer, then at your request tried a different path, and then couldn't find any other path to reach true
, so returned false
.
In other words, as that answerer says,
The
false
response can appear inconsistent to beginning Prolog programmers and "feel" like an error or warning, but it's actually a perfectly normal Prolog response.