I'm writing a program in Prolog. I've re-ordered the goals to stop infinite recursion.
However, it's still having issues.
When querying...
Take for example the following predicate,
| ?- predicate([x,y,z],x).
yes
| ?- predicate(X,x).
X = [x] ?;
X = [x,y] ?;
no
| ?- predicate([x,y,Z],x).
no
Why might a predicate do this? I can't post my code, but some advice as to what causes this sort of thing would be great. If it knows the query holds when using ground terms, why would it not find it when using variables in it's place? It doesn't even get stuck recursing or anything, it just says there isn't any more solutions, when there is!