Fixing function for cconst structures.
Function:
(defun cconst-fix$inline (x) (declare (xargs :guard (cconstp x))) (let ((__function__ 'cconst-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((prefix? (cprefix-option-fix (cdr (std::da-nth 0 x)))) (cchars (c-char-list-fix (cdr (std::da-nth 1 x))))) (list (cons 'prefix? prefix?) (cons 'cchars cchars))) :exec x)))
Theorem:
(defthm cconstp-of-cconst-fix (b* ((new-x (cconst-fix$inline x))) (cconstp new-x)) :rule-classes :rewrite)
Theorem:
(defthm cconst-fix-when-cconstp (implies (cconstp x) (equal (cconst-fix x) x)))
Function:
(defun cconst-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (cconstp acl2::x) (cconstp acl2::y)))) (equal (cconst-fix acl2::x) (cconst-fix acl2::y)))
Theorem:
(defthm cconst-equiv-is-an-equivalence (and (booleanp (cconst-equiv x y)) (cconst-equiv x x) (implies (cconst-equiv x y) (cconst-equiv y x)) (implies (and (cconst-equiv x y) (cconst-equiv y z)) (cconst-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm cconst-equiv-implies-equal-cconst-fix-1 (implies (cconst-equiv acl2::x x-equiv) (equal (cconst-fix acl2::x) (cconst-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm cconst-fix-under-cconst-equiv (cconst-equiv (cconst-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-cconst-fix-1-forward-to-cconst-equiv (implies (equal (cconst-fix acl2::x) acl2::y) (cconst-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-cconst-fix-2-forward-to-cconst-equiv (implies (equal acl2::x (cconst-fix acl2::y)) (cconst-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm cconst-equiv-of-cconst-fix-1-forward (implies (cconst-equiv (cconst-fix acl2::x) acl2::y) (cconst-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm cconst-equiv-of-cconst-fix-2-forward (implies (cconst-equiv acl2::x (cconst-fix acl2::y)) (cconst-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)