(list-fix x) converts
See also llist-fix, a "logical list fix" that is guarded with true-listp for greater efficiency.
Macro:
(defmacro list-fix-exec (x) (cons 'true-list-fix-exec (cons x 'nil)))
Macro:
(defmacro list-fix (x) (cons 'true-list-fix (cons x 'nil)))
Theorem:
(defthm list-fix-when-not-consp (implies (not (consp x)) (equal (list-fix x) nil)))
Theorem:
(defthm list-fix-of-cons (equal (list-fix (cons a x)) (cons a (list-fix x))))
Theorem:
(defthm list-fix-exec-removal (equal (list-fix-exec x) (list-fix x)))
Theorem:
(defthm car-of-list-fix (equal (car (list-fix x)) (car x)))
Theorem:
(defthm cdr-of-list-fix (equal (cdr (list-fix x)) (list-fix (cdr x))))
Theorem:
(defthm list-fix-when-len-zero (implies (equal (len x) 0) (equal (list-fix x) nil)))
Theorem:
(defthm true-listp-of-list-fix (true-listp (list-fix x)))
Theorem:
(defthm len-of-list-fix (equal (len (list-fix x)) (len x)))
Theorem:
(defthm list-fix-when-true-listp (implies (true-listp x) (equal (list-fix x) x)))
Theorem:
(defthm list-fix-under-iff (iff (list-fix x) (consp x)))
Theorem:
(defthm consp-of-list-fix (equal (consp (list-fix x)) (consp x)))
Theorem:
(defthm last-of-list-fix (equal (last (list-fix x)) (list-fix (last x))))
Theorem:
(defthm equal-of-list-fix-and-self (equal (equal x (list-fix x)) (true-listp x)))
Theorem:
(defthm element-list-p-of-list-fix-non-true-listp (implies (element-list-final-cdr-p t) (equal (element-list-p (list-fix x)) (element-list-p x))) :rule-classes :rewrite)
Theorem:
(defthm element-list-p-of-list-fix-true-listp (implies (element-list-p x) (element-list-p (list-fix x))) :rule-classes :rewrite)
Theorem:
(defthm element-list-fix-of-list-fix-true-list (implies (not (element-list-final-cdr-p t)) (equal (element-list-fix (list-fix x)) (element-list-fix x))) :rule-classes :rewrite)
Theorem:
(defthm element-list-fix-of-list-fix-non-true-list (implies (element-list-final-cdr-p t) (equal (element-list-fix (list-fix x)) (list-fix (element-list-fix x)))) :rule-classes :rewrite)
Theorem:
(defthm elementlist-projection-of-list-fix (equal (elementlist-projection (list-fix x)) (elementlist-projection x)) :rule-classes :rewrite)
Theorem:
(defthm elementlist-mapappend-of-list-fix (equal (elementlist-mapappend (list-fix x)) (elementlist-mapappend x)) :rule-classes :rewrite)