843:
903:
36:. A useful property of hash consing is that two structures can be tested for equality in constant time via pointer equality, which in turn can improve efficiency of
40:
algorithms when data sets contain overlapping blocks. Hash consing has been shown to give dramatic performance improvements—both space and time—for
536:
A hash consing compilation technique was presented by A.P. Ershov in 1958. The term "hash consing" originates from implementations in the context of
884:
736:
60:
644:
623:
913:
745:
763:
32:
cell, the technique checks if such a value has been constructed before, and if so reuses the previous value, avoiding a new
80:
37:
569:
64:
877:
537:
826:
Jean
Goubault. Implementing Functional Languages with Fast Equality, Sets and Maps: an Exercise in Hash Consing. In
796:
870:
21:
28:
is a technique used to share values that are structurally equal. When a value is constructed, such as a
41:
772:
45:
815:
689:
590:
681:
619:
554:
75:
Simple, not very efficient, but suitable for demonstration of the concept implementation of a
33:
908:
850:
805:
671:
549:
17:
732:
854:
707:
639:
Filliâtre, Jean-Christophe; Conchon, Sylvain (2006). "Type-Safe
Modular Hash-Consing".
56:
897:
819:
693:
759:
615:
559:
76:
52:
685:
842:
810:
791:
676:
659:
564:
367:;; return a procedure which does the same memoizing some of results
708:"Sharing and Common Subexpression Elimination in EDSL compilation"
595:
589:
Liljenzin, Olle (2013). "Confluently
Persistent Sets and Maps".
29:
364:;; memoizer factory: for given (side-effect-free) procedure,
858:
765:
Monocopy and associative algorithms in extended Lisp
370:;; in the sense of equal? on the whole list of args
904:Implementation of functional programming languages
830:(JFLA’93), pages 222–238, Annecy, February 1993.
51:Hash consing is most commonly implemented with
828:Journées Francophones des Langages Applicatifs
79:by means of hash table and weak references in
878:
8:
885:
871:
809:
792:"On programming of arithmetic operations"
675:
660:"On programming of arithmetic operations"
594:
63:when the data stored therein contains no
581:
7:
839:
837:
14:
841:
746:Xerox Palo Alto Research Center
738:An Interactive Program Verifier
658:Ershov, A. P. (1 August 1958).
1:
857:. You can help Knowledge by
771:(Technical report). Tokyo:
930:
836:
775:Technical Report TR 74-03.
748:Technical Report CSL-73-1.
797:Communications of the ACM
664:Communications of the ACM
85:
67:from outside the table.
733:Deutsch, Laurence Peter
914:Computer science stubs
22:functional programming
811:10.1145/368892.368907
790:Ershov, A.P. (1958).
677:10.1145/368892.368907
610:Allen, John (1978).
773:University of Tokyo
46:dynamic programming
744:(Phd). Palo Alto:
385:make-weak-memoizer
38:divide and conquer
20:, particularly in
866:
865:
555:Flyweight pattern
61:garbage-collected
34:memory allocation
921:
887:
880:
873:
851:computer science
845:
838:
823:
813:
777:
776:
770:
756:
750:
749:
743:
729:
723:
722:
720:
718:
704:
698:
697:
679:
655:
649:
648:
636:
630:
629:
607:
601:
600:
598:
586:
550:String interning
527:
524:
521:
518:
515:
512:
509:
506:
503:
500:
497:
494:
491:
488:
485:
482:
479:
476:
473:
470:
467:
464:
461:
458:
455:
452:
449:
446:
443:
440:
437:
434:
431:
428:
425:
422:
419:
416:
413:
410:
407:
404:
401:
398:
395:
392:
389:
386:
383:
380:
377:
374:
371:
368:
365:
362:
359:
356:
353:
350:
347:
344:
341:
338:
335:
332:
329:
326:
323:
320:
317:
314:
311:
308:
305:
302:
299:
296:
293:
290:
287:
284:
281:
278:
275:
272:
269:
266:
263:
260:
257:
254:
251:
248:
245:
242:
239:
238:make-weak-vector
236:
233:
230:
227:
224:
221:
218:
215:
212:
209:
206:
203:
200:
197:
194:
191:
188:
185:
182:
179:
176:
173:
170:
167:
164:
161:
158:
155:
152:
149:
146:
143:
140:
137:
134:
131:
128:
125:
122:
119:
116:
113:
110:
107:
104:
101:
98:
95:
92:
89:
18:computer science
929:
928:
924:
923:
922:
920:
919:
918:
894:
893:
892:
891:
834:
789:
786:
784:Further reading
781:
780:
768:
758:
757:
753:
741:
731:
730:
726:
716:
714:
706:
705:
701:
657:
656:
652:
638:
637:
633:
626:
612:Anatomy of Lisp
609:
608:
604:
588:
587:
583:
578:
546:
534:
529:
528:
525:
522:
519:
516:
513:
510:
507:
504:
502:weak-table-set!
501:
498:
495:
492:
489:
486:
483:
480:
477:
474:
471:
468:
465:
462:
459:
456:
453:
450:
447:
444:
441:
438:
435:
432:
429:
426:
423:
420:
417:
414:
411:
409:make-weak-table
408:
405:
402:
399:
396:
393:
390:
387:
384:
381:
378:
375:
372:
369:
366:
363:
360:
357:
354:
351:
348:
345:
342:
339:
336:
333:
330:
327:
324:
321:
318:
315:
312:
309:
306:
303:
300:
297:
294:
291:
288:
285:
282:
279:
276:
273:
270:
268:hash-table-set!
267:
264:
261:
258:
255:
252:
249:
246:
243:
240:
237:
234:
231:
228:
225:
222:
219:
216:
213:
210:
207:
204:
201:
198:
195:
192:
189:
186:
183:
180:
177:
174:
171:
168:
165:
162:
159:
156:
153:
151:weak-table-set!
150:
147:
144:
141:
138:
135:
133:make-hash-table
132:
129:
126:
123:
120:
117:
115:make-weak-table
114:
111:
108:
105:
102:
100:'hash-table
99:
96:
93:
90:
87:
73:
57:weak references
12:
11:
5:
927:
925:
917:
916:
911:
906:
896:
895:
890:
889:
882:
875:
867:
864:
863:
846:
832:
831:
824:
785:
782:
779:
778:
751:
724:
699:
650:
641:Workshop on ML
631:
624:
602:
580:
579:
577:
574:
573:
572:
567:
562:
557:
552:
545:
542:
540:in the 1970s.
533:
530:
442:weak-table-ref
319:hash-table-ref
292:weak-table-ref
181:hash-table-ref
88:;; weak hashes
86:
72:
69:
13:
10:
9:
6:
4:
3:
2:
926:
915:
912:
910:
907:
905:
902:
901:
899:
888:
883:
881:
876:
874:
869:
868:
862:
860:
856:
853:article is a
852:
847:
844:
840:
835:
829:
825:
821:
817:
812:
807:
803:
799:
798:
793:
788:
787:
783:
774:
767:
766:
761:
755:
752:
747:
740:
739:
734:
728:
725:
713:
709:
703:
700:
695:
691:
687:
683:
678:
673:
669:
665:
661:
654:
651:
646:
642:
635:
632:
627:
625:0-07-001115-X
621:
617:
613:
606:
603:
597:
592:
585:
582:
575:
571:
568:
566:
563:
561:
558:
556:
553:
551:
548:
547:
543:
541:
539:
531:
84:
82:
78:
70:
68:
66:
62:
58:
54:
49:
48:algorithms.
47:
43:
39:
35:
31:
27:
23:
19:
859:expanding it
848:
833:
827:
801:
795:
764:
760:Goto, Eiichi
754:
737:
727:
715:. Retrieved
711:
702:
667:
663:
653:
640:
634:
611:
605:
584:
535:
74:
59:that may be
50:
26:hash consing
25:
15:
616:McGraw Hill
560:Merkle tree
463:bwp-object?
250:vector-set!
208:vector-set!
53:hash tables
898:Categories
804:(8): 3–6.
670:(8): 3–6.
576:References
346:vector-ref
65:references
712:okmij.org
686:0001-0782
596:1301.3388
570:Interning
820:15986378
762:(1974).
735:(1973).
717:27 April
694:15986378
565:Hashlife
544:See also
77:memoizer
55:storing
42:symbolic
909:Hashing
532:History
97:require
71:Example
818:
692:
684:
622:
421:lambda
412:equal?
379:define
286:define
145:define
109:define
81:Scheme
849:This
816:S2CID
769:(PDF)
742:(PDF)
690:S2CID
591:arXiv
526:)))))
505:cache
487:apply
445:cache
403:cache
322:table
295:table
280:)))))
271:table
184:table
154:table
130:apply
855:stub
719:2023
682:ISSN
620:ISBN
538:Lisp
508:args
493:args
490:proc
448:args
424:args
388:proc
259:data
217:data
160:data
136:args
121:args
44:and
30:cons
806:doi
672:doi
645:ACM
496:)))
475:let
451:)))
430:let
415:)))
397:let
361:)))
331:)))
325:key
307:let
298:key
274:key
244:)))
226:let
193:)))
187:key
169:let
157:key
16:In
900::
814:.
800:.
794:.
710:.
688:.
680:.
666:.
662:.
643:.
618:.
614:.
478:((
457:if
433:((
400:((
373:;;
358:#f
337:if
328:#f
310:((
229:((
199:if
190:#f
172:((
139:))
91:;;
83::
24:,
886:e
879:t
872:v
861:.
822:.
808::
802:1
721:.
696:.
674::
668:1
647:.
628:.
599:.
593::
523:x
520:)
517:r
514:)
511:r
499:(
484:(
481:r
472:(
469:)
466:x
460:(
454:(
439:(
436:x
427:(
418:(
406:(
394:(
391:)
382:(
376:(
355:)
352:0
349:w
343:(
340:w
334:(
316:(
313:w
304:(
301:)
289:(
283:(
277:w
265:(
262:)
256:0
253:w
247:(
241:1
235:(
232:w
223:(
220:)
214:0
211:w
205:(
202:w
196:(
178:(
175:w
166:(
163:)
148:(
142:(
127:(
124:)
118:.
112:(
106:(
103:)
94:(
Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.