1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
<html>
<head><title>ASSOC.html -- ACL2 Version 3.1</title></head>
<body text=#000000 bgcolor="#FFFFFF">
<h2>ASSOC</h2>look up key in association list, using <code><a href="EQL.html">eql</a></code> as test
<pre>Major Section: <a href="PROGRAMMING.html">PROGRAMMING</a>
</pre><p>
<code>(Assoc x alist)</code> is the first member of <code>alist</code> whose <code><a href="CAR.html">car</a></code>
is <code>x</code>, or <code>nil</code> if no such member exists.
<p>
<code>(Assoc x alist)</code> is provably the same in the ACL2 logic as
<code>(assoc-equal x alist)</code>. It has a stronger <a href="GUARD.html">guard</a> than
<code><a href="ASSOC-EQUAL.html">assoc-equal</a></code> because it uses <code><a href="EQL.html">eql</a></code> to test whether <code>x</code> is equal
to the <code><a href="CAR.html">car</a></code> of a given member of <code>alist</code>. Its <a href="GUARD.html">guard</a>
requires that <code>alist</code> is an <code><a href="ALISTP.html">alistp</a></code>, and moreover, either
<code>(eqlablep x)</code> or all <code><a href="CAR.html">car</a></code>s of members of <code>alist</code> are
<code><a href="EQLABLEP.html">eqlablep</a></code>. See <a href="ASSOC-EQUAL.html">assoc-equal</a> and see <a href="ASSOC-EQ.html">assoc-eq</a>.<p>
<code>Assoc</code> is a Common Lisp function. See any Common Lisp
documentation for more information. Since ACL2 functions cannot
take keyword arguments (though macros can), the ACL2 functions
<code><a href="ASSOC-EQUAL.html">assoc-equal</a></code> and <code><a href="ASSOC-EQ.html">assoc-eq</a></code> are defined to correspond to calls
of the Common Lisp function <code>assoc</code> whose keyword argument
<code>:test</code> is <code><a href="EQUAL.html">equal</a></code> or <code><a href="EQ.html">eq</a></code>, respectively.
<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>
|