(similar-patternsp pat1 pat2) determines whether
Function:
(defun similar-patternsp (pat1 pat2) (declare (xargs :guard t)) (if pat1 (and pat2 (if (atom pat1) (atom pat2) (and (consp pat2) (similar-patternsp (car pat1) (car pat2)) (similar-patternsp (cdr pat1) (cdr pat2))))) (not pat2)))
Theorem:
(defthm similar-patternsp-commutes (implies (similar-patternsp pat2 pat1) (similar-patternsp pat1 pat2)))
Theorem:
(defthm similar-patternsp-self (similar-patternsp x x))
Theorem:
(defthm similar-patternsp-is-an-equivalence (and (booleanp (similar-patternsp x y)) (similar-patternsp x x) (implies (similar-patternsp x y) (similar-patternsp y x)) (implies (and (similar-patternsp x y) (similar-patternsp y z)) (similar-patternsp x z))) :rule-classes (:equivalence))
Theorem:
(defthm similar-patternsp-implies-iff-data-for-patternp-1 (implies (similar-patternsp x x-equiv) (iff (data-for-patternp x y) (data-for-patternp x-equiv y))) :rule-classes (:congruence))
Theorem:
(defthm similar-patternsp-implies-iff-data-for-patternp-2 (implies (similar-patternsp y y-equiv) (iff (data-for-patternp x y) (data-for-patternp x y-equiv))) :rule-classes (:congruence))