• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
          • Name-database
          • Vl-gc
          • Symbol-list-names
          • Ints-from
          • Nats-from
          • Make-lookup-alist
          • Redundant-mergesort
          • Longest-common-prefix
          • Vl-remove-keys
            • Vl-plural-p
            • Vl-merge-contiguous-indices
            • Sum-nats
            • Vl-edition-p
            • Vl-maybe-integer-listp
            • Fast-memberp
            • Nat-listp
            • Max-nats
            • Longest-common-prefix-list
            • Character-list-listp
            • Vl-character-list-list-values-p
            • Remove-from-alist
            • Prefix-of-eachp
            • Vl-string-keys-p
            • Vl-maybe-nat-listp
            • Vl-string-list-values-p
            • String-list-listp
            • Vl-string-values-p
            • Explode-list
            • True-list-listp
            • Symbol-list-listp
            • All-have-len
            • Pos-listp
            • Min-nats
            • Debuggable-and
            • Vl-starname
            • Remove-equal-without-guard
            • String-fix
            • Anyp
            • Vl-maybe-string-list
            • Longer-than-p
            • Fast-alist-free-each-alist-val
            • Not*
            • Free-list-of-fast-alists
            • *nls*
          • Printer
          • Kit
          • Mlib
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Testing-utilities
      • Math
    • Utilities

    Vl-remove-keys

    (vl-remove-keys keys x) removes all bindings for the given keys from alist.

    Signature
    (vl-remove-keys keys x) → ans
    Arguments
    keys — Guard (true-listp keys).
    Returns
    ans — Type (alistp ans).

    BOZO name consistency with remove-from-alist.

    Definitions and Theorems

    Function: vl-remove-keys

    (defun vl-remove-keys (keys x)
           (declare (xargs :guard (true-listp keys)))
           (let ((__function__ 'vl-remove-keys))
                (declare (ignorable __function__))
                (cond ((atom x) nil)
                      ((atom (car x))
                       (vl-remove-keys keys (cdr x)))
                      ((member-equal (caar x) keys)
                       (vl-remove-keys keys (cdr x)))
                      (t (cons (car x)
                               (vl-remove-keys keys (cdr x)))))))

    Theorem: alistp-of-vl-remove-keys

    (defthm alistp-of-vl-remove-keys
            (b* ((ans (vl-remove-keys keys x)))
                (alistp ans))
            :rule-classes :rewrite)

    Theorem: vl-remove-keys-when-not-consp

    (defthm vl-remove-keys-when-not-consp
            (implies (not (consp x))
                     (equal (vl-remove-keys keys x) nil)))

    Theorem: vl-remove-keys-of-cons

    (defthm vl-remove-keys-of-cons
            (equal (vl-remove-keys keys (cons a x))
                   (if (atom a)
                       (vl-remove-keys keys x)
                       (if (member-equal (car a)
                                         (double-rewrite keys))
                           (vl-remove-keys keys x)
                           (cons a (vl-remove-keys keys x))))))

    Theorem: true-listp-of-vl-remove-keys

    (defthm true-listp-of-vl-remove-keys
            (true-listp (vl-remove-keys keys x))
            :rule-classes :type-prescription)

    Theorem: consp-of-car-of-vl-remove-keys

    (defthm consp-of-car-of-vl-remove-keys
            (equal (consp (car (vl-remove-keys keys x)))
                   (consp (vl-remove-keys keys x))))

    Theorem: acl2-count-of-vl-remove-keys

    (defthm acl2-count-of-vl-remove-keys
            (<= (acl2-count (vl-remove-keys keys x))
                (acl2-count x))
            :rule-classes ((:rewrite) (:linear)))