(append-alist-keys x) appends all of the values from the alist
Our guard is merely
Note that we do not really treat
Function:
(defun append-alist-keys (x) (declare (xargs :guard t)) (mbe :logic (if (atom x) nil (append (caar x) (append-alist-keys (cdr x)))) :exec (reverse (append-alist-keys-exec x nil))))
Theorem:
(defthm append-alist-keys-exec-removal (equal (append-alist-keys-exec x acc) (revappend (append-alist-keys x) acc)))
Theorem:
(defthm append-alist-keys-when-atom (implies (atom x) (equal (append-alist-keys x) nil)))
Theorem:
(defthm append-alist-keys-of-cons (equal (append-alist-keys (cons a x)) (append (car a) (append-alist-keys x))))
Theorem:
(defthm true-listp-of-append-alist-keys (true-listp (append-alist-keys x)) :rule-classes :type-prescription)
Theorem:
(defthm append-alist-keys-of-append (equal (append-alist-keys (append x y)) (append (append-alist-keys x) (append-alist-keys y))))
Theorem:
(defthm list-equiv-implies-equal-append-alist-keys-1 (implies (list-equiv x x-equiv) (equal (append-alist-keys x) (append-alist-keys x-equiv))) :rule-classes (:congruence))