I’m using: SWI-Prolog version 9.0.4 for x86_64-linux
With
a(1).
a(2).
Querying a(1) seems to “yield a single choice point” as the REPL finishes immediately and does not prompt for another answer.
However, with the program
a([_]).
a([_, _]).
Querying with a([1]) returns true but prompts for another answer.
Is a choice point being created for a([_, _])? if so, why since a([_, _]) does not unify with `a([1])
The indexing distinction for lists is [] (empty list) vs [_|_] (non-empty list).
[_] and [_, _] are both non-empty lists, so have no indexing distinction between them.
Perhaps they could be put inside meaningful terms having different term names, so that the term name is the indexing distinction? This depends on the meaning/significance/classification of 1 vs 2 elements in the list, of course. Basic example: