Prolog – Arguments are not sufficiently instantiated
I am writing this answer, because the best answer yet was in a comment by lurker. I want to have it show up as an actual answer. Your code is not working, because you’re doing R1 is R+1 when R isn’t instantiated in the case not_number([X|T], R). Your recursive case is strung a little backwards. … Read more