Filtering...

table-alist-plus

books/std/system/table-alist-plus

Included Books

other
(in-package "ACL2")
include-book
(include-book "std/util/define" :dir :system)
include-book
(include-book "xdoc/constructors" :dir :system)
other
(define table-alist+
  ((name symbolp) (wrld plist-worldp))
  :returns (alist alistp)
  :parents (std/system)
  :short "Enhanced variant of @(tsee table-alist)."
  :long (topstring-p "This returns the same result as the built-in @(tsee 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').")
  (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))))