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