<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
<a class="moz-txt-link-freetext" href="http://www.cse.unsw.edu.au/~billw/cs9414/notes/prolog/intro.html">http://www.cse.unsw.edu.au/~billw/cs9414/notes/prolog/intro.html</a><br>
<a name="singleton">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 <b>Warning</b> about a "singleton variable" when you
load the code:
<pre>% <font color="green"><i>prolog -q -s mycode.pl</i></font>
Warning: .../mycode.pl:4:
Singleton variables: [Item]</pre>
</a><br>
<a class="moz-txt-link-freetext" href="http://www.cs.toronto.edu/~dianaz/2501/Manual/sec-B.html">http://www.cs.toronto.edu/~dianaz/2501/Manual/sec-B.html</a><br>
<dl>
<dt><a name="gloss:singleton"><strong>singleton [variable]</strong></a></dt>
<dd>
<a
href="http://www.cs.toronto.edu/%7Edianaz/2501/Manual/sec-B.html#gloss:variable">Variable</a>
appearing only one time in a <a
href="http://www.cs.toronto.edu/%7Edianaz/2501/Manual/sec-B.html#gloss:clause">clause</a>.
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 <code>_</code> (see <a
href="http://www.cs.toronto.edu/%7Edianaz/2501/Manual/sec-B.html#gloss:anonymou">anonymous</a>)
or make sure the first character is a <code>_</code>. See also
the <a name="idx:stylecheck1:887"></a><a
href="http://www.cs.toronto.edu/%7Edianaz/2501/Manual/sec-3.42.html#style_check/1">style_check/1</a>
option <code>singletons</code></dd>
</dl>
<br>
<br>
</body>
</html>