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 28 29 30 31 32 33 34 35 36 37 38
|
<html>
<head><title>COMPRESS2.html -- ACL2 Version 3.1</title></head>
<body text=#000000 bgcolor="#FFFFFF">
<h3>COMPRESS2</h3>remove irrelevant pairs from a 2-dimensional array
<pre>Major Section: <a href="ARRAYS.html">ARRAYS</a>
</pre><p>
<pre>
Example Form:
(compress2 'delta1 a)
<p>
General Form:
(compress2 name alist)
</pre>
where <code>name</code> is a symbol and <code>alist</code> is a 2-dimensional array named
<code>name</code>. See <a href="ARRAYS.html">arrays</a> for details. Logically speaking, this
function removes irrelevant pairs from <code>alist</code>, possibly shortening
it. The function returns a new array, <code>alist'</code>, of the same name and
dimension as <code>alist</code>, that, under <code><a href="AREF2.html">aref2</a></code>, is everywhere equal to <code>alist</code>.
That is, <code>(aref2 name alist' i j)</code> is <code>(aref2 name alist i j)</code>, for all
legal indices <code>i</code> and <code>j</code>. <code>Alist'</code> may be shorter than <code>alist</code> and the
non-irrelevant pairs may occur in a different order in <code>alist'</code> than
in <code>alist</code>.<p>
Practically speaking, this function plays an important role in the
efficient implementation of <code><a href="AREF2.html">aref2</a></code>. In addition to creating the new
array, <code>alist'</code>, <code>compress2</code> makes that array the ``semantic value'' of
<code>name</code> and allocates a raw lisp array to <code>name</code>. For all legal indices,
<code>i</code> and <code>j</code>, that raw lisp array contains <code>(aref2 name alist' i j)</code> in
slot <code>i</code>,<code>j</code>. Thus, subsequent <code><a href="AREF2.html">aref2</a></code> operations can be executed in
virtually constant time provided they are given <code>name</code> and the <code>alist'</code>
returned by the most recently executed <code>compress2</code> or <code><a href="ASET2.html">aset2</a></code> on <code>name</code>.
See <a href="ARRAYS.html">arrays</a>.
<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>
|