• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
        • Memoize
        • Fast-alists
          • Slow-alist-warning
          • Hons-acons
          • Fast-alist-fork
          • Hons-acons!
          • With-fast-alist
          • Fast-alist-clean
          • Fast-alist-pop
          • Hons-get
            • Std/alists/hons-assoc-equal
          • Fast-alist-free
          • Fast-alist-pop*
          • Hons-assoc-equal
          • Make-fast-alist
          • Make-fal
          • Fast-alist-free-on-exit
          • With-stolen-alist
          • Fast-alist-fork!
          • Fast-alist-summary
          • Fast-alist-clean!
          • Fast-alist-len
          • With-stolen-alists
          • Fast-alists-free-on-exit
          • Cons-subtrees
          • With-fast-alists
          • Hons-dups-p1
          • Ansfl
          • Hons-revappend
          • Hons-member-equal
          • Hons-make-list
          • Hons-reverse
          • Hons-list*
          • Hons-list
          • Hons-append
        • Hons
        • Set-max-mem
        • Hons-enabled
        • Unmemoize
        • Number-subtrees
      • Events
      • Parallelism
      • History
      • Programming
      • Operational-semantics
      • Real
      • Start-here
      • Miscellaneous
      • Output-controls
      • Bdd
      • Macros
      • Installation
      • Mailing-lists
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Fast-alists
  • ACL2-built-ins

Hons-get

(hons-get key alist) is the efficient lookup operation for fast-alists.

Logically, hons-get is just an alias for hons-assoc-equal; we typically leave it enabled and prefer to reason about hons-assoc-equal instead. One benefit of this approach is that it helps to avoids "false" discipline warnings that might arise from execution during theorem proving.

Under the hood, when alist is a fast alist that is associated with a valid hash table, hons-get first norms key using hons-copy, then becomes a gethash operation on the hidden hash table. Otherwise hons-get simply invokes hons-assoc-equal, which is similar (in definition and in performance) to assoc-equal, on key and alist.

Function: hons-get

(defun hons-get (key alist)
  (declare (xargs :guard t))
  (hons-assoc-equal key alist))

Subtopics

Std/alists/hons-assoc-equal
Lemmas about hons-assoc-equal available in the std/alists library.