• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/io
      • Std/osets
      • Std/system
      • Std/basic
      • Std/typed-lists
      • Std/bitsets
      • Std/testing
        • Must-fail
        • Assert!-stobj
        • Must-eval-to
        • Assert!
        • Must-succeed
        • Must-succeed*
        • Assert?
        • Must-fail-with-soft-error
        • Must-fail-with-hard-error
        • Must-fail-with-error
        • Must-eval-to-t
        • Must-not-prove
        • Must-prove
        • Must-be-redundant
        • Must-not-be-table-key
        • Must-fail-local
        • Must-be-table-key
          • Assert-equal
        • Std/typed-alists
        • Std/stobjs
        • Std-extensions
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Std/testing

    Must-be-table-key

    A top-level assert$-like command to ensure that a table includes a certain key.

    Macro: must-be-table-key

    (defmacro
     must-be-table-key (key table)
     (declare (xargs :guard (and (symbolp key) (symbolp table))))
     (cons
      'assert!
      (cons
           (cons 'assoc-eq
                 (cons (cons 'quote (cons key 'nil))
                       (cons (cons 'table-alist
                                   (cons (cons 'quote (cons table 'nil))
                                         '((w state))))
                             'nil)))
           'nil)))