http://www.cse.unsw.edu.au/~billw/cs9414/notes/prolog/intro.html
If Prolog finds a variable name that you only use once in a rule, it assumes that it may be a spelling mistake, and issues a *Warning* about a "singleton variable" when you load the code:

%/prolog -q -s mycode.pl/
Warning: .../mycode.pl:4:
   Singleton variables: [Item]


http://www.cs.toronto.edu/~dianaz/2501/Manual/sec-B.html

*singleton [variable]*
   Variable
   <http://www.cs.toronto.edu/%7Edianaz/2501/Manual/sec-B.html#gloss:variable>
   appearing only one time in a clause
   <http://www.cs.toronto.edu/%7Edianaz/2501/Manual/sec-B.html#gloss:clause>.
   SWI-Prolog normally warns for this to avoid you making spelling
   mistakes. If a variable appears on purpose only once in a clause,
   write it as |_| (see anonymous
   <http://www.cs.toronto.edu/%7Edianaz/2501/Manual/sec-B.html#gloss:anonymou>)
   or make sure the first character is a |_|. See also the
   style_check/1
   <http://www.cs.toronto.edu/%7Edianaz/2501/Manual/sec-3.42.html#style_check/1>
   option |singletons|



_______________________________________________
rules-dev mailing list
rules-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev

Reply via email to