• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Hons-and-memoization
      • Events
      • History
      • Parallelism
      • Programming
        • Defun
        • Declare
        • Stobj
        • State
        • Memoize
        • Mbe
        • Io
        • Apply$
        • System-utilities
        • Defpkg
        • Mutual-recursion
        • Arrays
        • Programming-with-state
        • Characters
        • Loop$
        • Time$
        • Defmacro
        • Defconst
        • Guard
        • Evaluation
        • Equality-variants
        • Fast-alists
          • Slow-alist-warning
          • Hons-acons
          • Fast-alist-fork
          • Hons-acons!
          • With-fast-alist
          • Fast-alist-clean
          • Fast-alist-pop
          • Fast-alist-free
          • Fast-alist-pop*
          • Hons-get
            • Std/alists/hons-assoc-equal
          • 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-make-list
        • Compilation
        • Hons
        • ACL2-built-ins
        • Advanced-features
        • Set-check-invariant-risk
        • Developers-guide
        • Numbers
        • Irrelevant-formals
        • Efficiency
        • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
        • Redefining-programs
        • Lists
        • Invariant-risk
        • Errors
        • Defabbrev
        • Conses
        • Alists
        • Set-register-invariant-risk
        • Program-wrapper
        • Strings
        • Get-internal-time
        • Basics
        • Packages
        • System-attachments
        • Defmacro-untouchable
        • Primitive
        • <<
        • Revert-world
        • Set-duplicate-keys-action
        • Unmemoize
        • Symbols
        • Def-list-constructor
        • Easy-simplify-term
        • Defiteration
        • Defopen
        • Sleep
      • Real
      • ACL2-tutorial
      • Debugging
      • Miscellaneous
      • Prover-output
      • Built-in-theorems
      • Macros
      • Interfacing-tools
      • About-ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Testing-utilities
    • Math
  • 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.

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.