(wirelist-rem-dups x) → xx
Function:
(defun wirelist-rem-dups (x) (declare (xargs :guard (wirelist-p x))) (let ((__function__ 'wirelist-rem-dups)) (declare (ignorable __function__)) (if (atom x) nil (cons (wire-fix (car x)) (wirelist-remove-name (wire->name (car x)) (wirelist-rem-dups (cdr x)))))))
Theorem:
(defthm wirelist-nodups-p-of-wirelist-rem-dups (b* ((xx (wirelist-rem-dups x))) (wirelist-nodups-p xx)) :rule-classes :rewrite)
Theorem:
(defthm wirelist->names-of-remove-duplicate-names (equal (wirelist->names (wirelist-rem-dups x)) (acl2::remove-later-duplicates (wirelist->names x))))
Theorem:
(defthm wirelist-rem-dups-when-no-duplicates (implies (no-duplicatesp (wirelist->names x)) (equal (wirelist-rem-dups x) (wirelist-fix x))))
Theorem:
(defthm wirelist-rem-dups-when-wirelist-nodups-p (implies (wirelist-nodups-p x) (equal (wirelist-rem-dups x) x)))
Theorem:
(defthm no-duplicate-names-of-wirelist-rem-dups (no-duplicatesp (wirelist->names (wirelist-rem-dups x))))
Theorem:
(defthm wirelist-rem-dups-of-wirelist-fix-x (equal (wirelist-rem-dups (wirelist-fix x)) (wirelist-rem-dups x)))
Theorem:
(defthm wirelist-rem-dups-wirelist-equiv-congruence-on-x (implies (wirelist-equiv x x-equiv) (equal (wirelist-rem-dups x) (wirelist-rem-dups x-equiv))) :rule-classes :congruence)
Function:
(defun wirelist-nodups-equiv$inline (x y) (declare (xargs :guard (and (wirelist-nodups-p x) (wirelist-nodups-p y)))) (equal (wirelist-rem-dups x) (wirelist-rem-dups y)))
Theorem:
(defthm wirelist-nodups-equiv-is-an-equivalence (and (booleanp (wirelist-nodups-equiv x y)) (wirelist-nodups-equiv x x) (implies (wirelist-nodups-equiv x y) (wirelist-nodups-equiv y x)) (implies (and (wirelist-nodups-equiv x y) (wirelist-nodups-equiv y z)) (wirelist-nodups-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm wirelist-nodups-equiv-implies-equal-wirelist-rem-dups-1 (implies (wirelist-nodups-equiv x x-equiv) (equal (wirelist-rem-dups x) (wirelist-rem-dups x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm wirelist-rem-dups-under-wirelist-nodups-equiv (wirelist-nodups-equiv (wirelist-rem-dups x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-wirelist-rem-dups-1-forward-to-wirelist-nodups-equiv (implies (equal (wirelist-rem-dups x) y) (wirelist-nodups-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-wirelist-rem-dups-2-forward-to-wirelist-nodups-equiv (implies (equal x (wirelist-rem-dups y)) (wirelist-nodups-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm wirelist-nodups-equiv-of-wirelist-rem-dups-1-forward (implies (wirelist-nodups-equiv (wirelist-rem-dups x) y) (wirelist-nodups-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm wirelist-nodups-equiv-of-wirelist-rem-dups-2-forward (implies (wirelist-nodups-equiv x (wirelist-rem-dups y)) (wirelist-nodups-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm wirelist-rem-dups-of-append (equal (wirelist-rem-dups (append a b)) (append (wirelist-rem-dups a) (wirelist-remove-names (wirelist->names a) (wirelist-rem-dups b)))))