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