Cons onto the back of a list.
(rcons a x) is like cons, except that instead of putting
Function:
(defun rcons (a x) (declare (xargs :guard t)) (append-without-guard x (list a)))
Theorem:
(defthm type-of-rcons (and (consp (rcons a x)) (true-listp (rcons a x))) :rule-classes :type-prescription)
Theorem:
(defthm rcons-of-list-fix (equal (rcons a (list-fix x)) (rcons a x)))
Theorem:
(defthm list-equiv-implies-equal-rcons-2 (implies (list-equiv x x-equiv) (equal (rcons a x) (rcons a x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm list-equiv-of-rcons-and-rcons (equal (list-equiv (rcons a x) (rcons a y)) (list-equiv x y)))
Theorem:
(defthm len-of-rcons (equal (len (rcons a x)) (+ 1 (len x))))
Theorem:
(defthm rev-of-rcons (equal (rev (rcons a x)) (cons a (rev x))))
Theorem:
(defthm append-of-rcons (equal (append (rcons a x) y) (append x (cons a y))))
Theorem:
(defthm rcons-of-append (equal (rcons a (append x y)) (append x (rcons a y))))
Theorem:
(defthm revappend-of-rcons (equal (revappend (rcons a x) y) (cons a (revappend x y))))
Theorem:
(defthm element-list-p-of-rcons (iff (element-list-p (rcons a x)) (and (element-p a) (element-list-p (list-fix x)))) :rule-classes :rewrite)