1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
<html>
<head><title>ZEROP.html -- ACL2 Version 3.1</title></head>
<body text=#000000 bgcolor="#FFFFFF">
<h2>ZEROP</h2>test an acl2-number against 0
<pre>Major Section: <a href="PROGRAMMING.html">PROGRAMMING</a>
</pre><p>
<code>(zerop x)</code> is <code>t</code> if <code>x</code> is <code>0</code> and is <code>nil</code> otherwise. Thus,
it is logically equivalent to <code>(equal x 0)</code>.
<p>
<code>(Zerop x)</code> has a <a href="GUARD.html">guard</a> requiring <code>x</code> to be numeric and can be
expected to execute more efficiently than <code>(equal x 0)</code> in properly
<a href="GUARD.html">guard</a>ed compiled code.<p>
In recursions down the natural numbers, <code>(zp x)</code> is preferred over
<code>(zerop x)</code> because the former coerces <code>x</code> to a natural and allows
the termination proof. In recursions through the integers,
<code>(zip x)</code> is preferred. See <a href="ZERO-TEST-IDIOMS.html">zero-test-idioms</a>.<p>
<code>Zerop</code> is a Common Lisp function. See any Common Lisp
documentation for more information.
<br><br><br><a href="acl2-doc.html"><img src="llogo.gif"></a> <a href="acl2-doc-index.html"><img src="index.gif"></a>
</body>
</html>
|