Fixing function for param structures.
Function:
(defun param-fix$inline (x) (declare (xargs :guard (paramp x))) (let ((__function__ 'param-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((prime (prime-fix (cdr (std::da-nth 0 x)))) (rate (acl2::pos-fix (cdr (std::da-nth 1 x)))) (capacity (acl2::pos-fix (cdr (std::da-nth 2 x)))) (alpha (ifix (cdr (std::da-nth 3 x)))) (full-rounds-half (nfix (cdr (std::da-nth 4 x)))) (partial-rounds (nfix (cdr (std::da-nth 5 x)))) (constants (cdr (std::da-nth 6 x))) (mds (cdr (std::da-nth 7 x))) (rate-then-capacity-p (acl2::bool-fix (cdr (std::da-nth 8 x)))) (ascending-p (acl2::bool-fix (cdr (std::da-nth 9 x)))) (partial-first-p (acl2::bool-fix (cdr (std::da-nth 10 x))))) (let ((constants (if (and (fe-list-listp constants prime) (all-len-equal-p constants (+ rate capacity)) (equal (len constants) (+ (* 2 full-rounds-half) partial-rounds))) constants (repeat (+ (* 2 full-rounds-half) partial-rounds) (repeat (+ rate capacity) 0)))) (mds (if (and (fe-list-listp mds prime) (all-len-equal-p mds (+ rate capacity)) (equal (len mds) (+ rate capacity))) mds (repeat (+ rate capacity) (repeat (+ rate capacity) 0))))) (list (cons 'prime prime) (cons 'rate rate) (cons 'capacity capacity) (cons 'alpha alpha) (cons 'full-rounds-half full-rounds-half) (cons 'partial-rounds partial-rounds) (cons 'constants constants) (cons 'mds mds) (cons 'rate-then-capacity-p rate-then-capacity-p) (cons 'ascending-p ascending-p) (cons 'partial-first-p partial-first-p)))) :exec x)))
Theorem:
(defthm paramp-of-param-fix (b* ((new-x (param-fix$inline x))) (paramp new-x)) :rule-classes :rewrite)
Theorem:
(defthm param-fix-when-paramp (implies (paramp x) (equal (param-fix x) x)))
Function:
(defun param-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (paramp acl2::x) (paramp acl2::y)))) (equal (param-fix acl2::x) (param-fix acl2::y)))
Theorem:
(defthm param-equiv-is-an-equivalence (and (booleanp (param-equiv x y)) (param-equiv x x) (implies (param-equiv x y) (param-equiv y x)) (implies (and (param-equiv x y) (param-equiv y z)) (param-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm param-equiv-implies-equal-param-fix-1 (implies (param-equiv acl2::x x-equiv) (equal (param-fix acl2::x) (param-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm param-fix-under-param-equiv (param-equiv (param-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-param-fix-1-forward-to-param-equiv (implies (equal (param-fix acl2::x) acl2::y) (param-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-param-fix-2-forward-to-param-equiv (implies (equal acl2::x (param-fix acl2::y)) (param-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm param-equiv-of-param-fix-1-forward (implies (param-equiv (param-fix acl2::x) acl2::y) (param-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm param-equiv-of-param-fix-2-forward (implies (param-equiv acl2::x (param-fix acl2::y)) (param-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)