Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • Read both sentences: I'm saying if you replace a singleton with _ and the result makes no sense (it wouldn't in this case) then there is a defect in your reasoning. Some beginners struggle with singleton variable warnings and this helps show them the problem. Commented Dec 7, 2015 at 21:00
  • What you are suggesting makes no sense to me. Singleton warning is not fatal, the meaning of the code is the same either way. I'd suggest exactly the opposite, to think hard about what's the meaning of the "parameter position" where the singleton occurs. OP just haphazardly wrote down some variable names without even thinking what each represents ... Commented Dec 8, 2015 at 10:29
  • We agree about everything except where the root of the error is. The real error is in the mind of the student. They come from C and they do not understand how serious the singleton warning is. My suggestion doesn't change the meaning to Prolog--but making the change often helps the student to see how their mental model of what Prolog is doing is defective. We have the same goal: make the OP think hard about the meaning in that position. Keep in mind 90% of Prolog questions come from experienced procedural programmers just starting with Prolog. Their intuition is often the deeper problem. Commented Dec 8, 2015 at 15:01