Artifact 32b11cfabc9a41ed04f715192e570eb6cb957a8edcc1e5cb460be977d7dbca5d:
- File
psl-1983/3-1/help/hcons.doc
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 3167) [annotate] [blame] [check-ins using] [more...]
- File
psl-1983/help/hcons.hlp
— part of check-in
[eb17ceb7f6]
at
2020-04-21 19:40:01
on branch master
— Add Reduce 3.0 to the historical section of the archive, and some more
files relating to version sof PSL from the early 1980s. Thanks are due to
Paul McJones and Nelson Beebe for these, as well as to all the original
authors.git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/historical@5328 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 3167) [annotate] [blame] [check-ins using]
HCONS - Hashing (unique) CONS and associated utilities. The Hcons function creates unique dotted pairs. In other words, Hcons(A,B) eq Hcons(C,D) if and only if A eq C and B eq D. This allows very rapid tests for equality between structures, at the cost of expending more time in creating the structures. The use of Hcons may also save space in cases where lists share a large amount of common substructure, since only one copy of the substructure is stored. The system works by keeping a hash table of all pairs that have been created by Hcons. (So the space advantage of sharing substructure may be offset by the space consumed by table entries.) This hash table allows the system to store property lists for pairs--in the same way that Lisp has property lists for identifiers. Pairs created by Hcons SHOULD NOT be modified with RPLACA and RPLACD. Doing so will make the pair hash table inconsistent, as well as being very likely to modify structure shared with something that you don't wish to change. Also note that large numbers may be equal without being eq, so the Hcons of two large numbers may not be eq to the Hcons of two other numbers that appear to be the same. (Similar warnings hold for strings and vectors.) The following "user" functions are provided by HCONS: Hcons([U:any]): pair macro - --- ---- ----- The Hcons macro takes one or more arguments and returns their "hashed cons" (right associatively). Two arguments corresponds to a call of Cons. Hlist([U:any]): list nexpr - --- ---- ----- Hlist is the "Hcons version" of the List function. Hcopy(U:any): any macro - --- --- ----- Hcopy is the Hcons version of the copy function. Note that Hcopy serves a very different purpose than copy--which is usually used to copy a structure so that destructive changes can be made to the copy without changing the original. Hcopy, on the other hand, will only actually copy those parts of the structure which haven't already been "consed together" by Hcons. Happend (U:list, V:list): list expr - ---- - ---- ---- ---- Hcons version of append. Hreverse (U:list): list expr - ---- ---- ---- Hcons version of reverse. The following two functions can be used to "get" and "put" properties for pairs or identifiers. The pairs for these functions must be created by Hcons. These functions are known to the Setf macro. extended-put (U:id-or-pair, IND:id, PROP:any): any expr - ---------- --- -- ---- --- --- ---- extended-get (U:id-or-pair, IND:any): any expr - ---------- --- --- --- ----