• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
      • Std/lists
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/osets
      • Std/io
      • Std/basic
      • Std/system
        • Fresh-logical-name-with-$s-suffix
        • Irrelevant-formals-info
        • Std/system/function-queries
        • Std/system/term-queries
        • Std/system/term-transformations
        • Std/system/enhanced-utilities
        • Install-not-normalized-event
        • Install-not-normalized-event-lst
        • Std/system/term-function-recognizers
        • Genvar$
        • Std/system/event-name-queries
        • Pseudo-tests-and-call-listp
        • Maybe-pseudo-event-formp
        • Add-suffix-to-fn-or-const
        • Chk-irrelevant-formals-ok
        • Table-alist+
          • Pseudo-tests-and-callp
          • Add-suffix-to-fn-or-const-lst
          • Known-packages+
          • Add-suffix-to-fn-lst
          • Unquote-term
          • Event-landmark-names
          • Add-suffix-lst
          • Std/system/theorem-queries
          • Unquote-term-list
          • Std/system/macro-queries
          • Pseudo-command-landmark-listp
          • Install-not-normalized$
          • Pseudo-event-landmark-listp
          • Known-packages
          • Std/system/partition-rest-and-keyword-args
          • Rune-enabledp
          • Rune-disabledp
          • Included-books
          • Std/system/pseudo-event-formp
          • Std/system/plist-worldp-with-formals
          • Std/system/w
          • Std/system/geprops
          • Std/system/arglistp
          • Std/system/constant-queries
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Community
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Std/system

    Table-alist+

    Enhanced variant of table-alist.

    Signature
    (table-alist+ name wrld) → alist
    Arguments
    name — Guard (symbolp name).
    wrld — Guard (plist-worldp wrld).
    Returns
    alist — Type (alistp alist).

    This returns the same result as the built-in table-alist function (see the ACL2 system sources), but it includes a run-time check (which should always succeed) on the result that allows us to prove the return type theorem without strengthening the guard on wrld.

    Definitions and Theorems

    Function: table-alist+

    (defun table-alist+ (name wrld)
     (declare (xargs :guard (and (symbolp name)
                                 (plist-worldp wrld))))
     (let ((__function__ 'table-alist+))
      (declare (ignorable __function__))
      (b* ((result (table-alist name wrld)))
       (if (alistp result)
           result
        (raise
         "Internal error: ~
                  the TABLE-ALIST property ~x0 of ~x1 is not an alist."
         result name)))))

    Theorem: alistp-of-table-alist+

    (defthm alistp-of-table-alist+
      (b* ((alist (table-alist+ name wrld)))
        (alistp alist))
      :rule-classes :rewrite)