• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
      • Std/lists
      • Std/alists
        • Alist-keys
        • Remove-assocs
        • Alist-vals
        • Alist-map-vals
        • Std/alists/strip-cdrs
        • Hons-rassoc-equal
        • Alist-map-keys
        • Std/alists/hons-assoc-equal
        • Fal-extract
        • Std/alists/strip-cars
        • Fal-find-any
        • Fal-extract-vals
        • Std/alists/abstract
        • Fal-all-boundp
        • Std/alists/alistp
        • Append-alist-vals
        • Append-alist-keys
          • Append-alist-keys-exec
          • Alist-equiv
          • Hons-remove-assoc
          • Std/alists/pairlis$
          • Alists-agree
          • Worth-hashing
          • Sub-alistp
          • Alist-fix
          • Std/alists/remove-assoc-equal
          • Std/alists/assoc-equal
        • Obags
        • Std/util
        • Std/strings
        • Std/io
        • Std/osets
        • Std/system
        • Std/basic
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
        • Std-extensions
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Append-alist-keys

    Append-alist-keys-exec

    Tail-recursive implementation of append-alist-keys.

    This is used in the implementation of append-alist-keys. You should never need to reason about this -exec function directly, thanks to the following rule:

    Theorem: append-alist-keys-exec-removal

    (defthm append-alist-keys-exec-removal
            (equal (append-alist-keys-exec x acc)
                   (revappend (append-alist-keys x) acc)))

    Definitions and Theorems

    Function: append-alist-keys-exec

    (defun
     append-alist-keys-exec (x acc)
     (declare (xargs :guard t))
     (mbe
      :logic (if (atom x)
                 acc
                 (append-alist-keys-exec (cdr x)
                                         (revappend (caar x) acc)))
      :exec
      (cond
           ((atom x) acc)
           ((atom (car x))
            (append-alist-keys-exec (cdr x) acc))
           (t (append-alist-keys-exec (cdr x)
                                      (revappend-without-guard (caar x)
                                                               acc))))))