Fixing function for stat structures.
Function:
(defun stat-fix$inline (x) (declare (xargs :guard (statp x))) (let ((__function__ 'stat-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((keys (bitcoin::bip32-key-tree-fix (std::da-nth 0 (cdr x)))) (addresses (nfix (std::da-nth 1 (cdr x))))) (cons :state (list keys addresses))) :exec x)))
Theorem:
(defthm statp-of-stat-fix (b* ((new-x (stat-fix$inline x))) (statp new-x)) :rule-classes :rewrite)
Theorem:
(defthm stat-fix-when-statp (implies (statp x) (equal (stat-fix x) x)))
Function:
(defun stat-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (statp acl2::x) (statp acl2::y)))) (equal (stat-fix acl2::x) (stat-fix acl2::y)))
Theorem:
(defthm stat-equiv-is-an-equivalence (and (booleanp (stat-equiv x y)) (stat-equiv x x) (implies (stat-equiv x y) (stat-equiv y x)) (implies (and (stat-equiv x y) (stat-equiv y z)) (stat-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm stat-equiv-implies-equal-stat-fix-1 (implies (stat-equiv acl2::x x-equiv) (equal (stat-fix acl2::x) (stat-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm stat-fix-under-stat-equiv (stat-equiv (stat-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-stat-fix-1-forward-to-stat-equiv (implies (equal (stat-fix acl2::x) acl2::y) (stat-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-stat-fix-2-forward-to-stat-equiv (implies (equal acl2::x (stat-fix acl2::y)) (stat-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm stat-equiv-of-stat-fix-1-forward (implies (stat-equiv (stat-fix acl2::x) acl2::y) (stat-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm stat-equiv-of-stat-fix-2-forward (implies (stat-equiv acl2::x (stat-fix acl2::y)) (stat-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)