Fixing function for tyspecseq structures.
(tyspecseq-fix x) → new-x
Function:
(defun tyspecseq-fix$inline (x) (declare (xargs :guard (tyspecseqp x))) (let ((__function__ 'tyspecseq-fix)) (declare (ignorable __function__)) (mbe :logic (case (tyspecseq-kind x) (:void (cons :void (list))) (:char (cons :char (list))) (:schar (cons :schar (list))) (:uchar (cons :uchar (list))) (:sshort (b* ((signed (acl2::bool-fix (std::da-nth 0 (cdr x)))) (int (acl2::bool-fix (std::da-nth 1 (cdr x))))) (cons :sshort (list signed int)))) (:ushort (b* ((int (acl2::bool-fix (std::da-nth 0 (cdr x))))) (cons :ushort (list int)))) (:sint (b* ((signed (acl2::bool-fix (std::da-nth 0 (cdr x)))) (int (acl2::bool-fix (std::da-nth 1 (cdr x))))) (let ((signed (if (not int) t signed)) (int (if (not signed) t int))) (cons :sint (list signed int))))) (:uint (b* ((int (acl2::bool-fix (std::da-nth 0 (cdr x))))) (cons :uint (list int)))) (:slong (b* ((signed (acl2::bool-fix (std::da-nth 0 (cdr x)))) (int (acl2::bool-fix (std::da-nth 1 (cdr x))))) (cons :slong (list signed int)))) (:ulong (b* ((int (acl2::bool-fix (std::da-nth 0 (cdr x))))) (cons :ulong (list int)))) (:sllong (b* ((signed (acl2::bool-fix (std::da-nth 0 (cdr x)))) (int (acl2::bool-fix (std::da-nth 1 (cdr x))))) (cons :sllong (list signed int)))) (:ullong (b* ((int (acl2::bool-fix (std::da-nth 0 (cdr x))))) (cons :ullong (list int)))) (:bool (cons :bool (list))) (:float (b* ((complex (acl2::bool-fix (std::da-nth 0 (cdr x))))) (cons :float (list complex)))) (:double (b* ((complex (acl2::bool-fix (std::da-nth 0 (cdr x))))) (cons :double (list complex)))) (:ldouble (b* ((complex (acl2::bool-fix (std::da-nth 0 (cdr x))))) (cons :ldouble (list complex)))) (:struct (b* ((tag (ident-fix (std::da-nth 0 (cdr x))))) (cons :struct (list tag)))) (:union (b* ((tag (ident-fix (std::da-nth 0 (cdr x))))) (cons :union (list tag)))) (:enum (b* ((tag (ident-fix (std::da-nth 0 (cdr x))))) (cons :enum (list tag)))) (:typedef (b* ((name (ident-fix (std::da-nth 0 (cdr x))))) (cons :typedef (list name))))) :exec x)))
Theorem:
(defthm tyspecseqp-of-tyspecseq-fix (b* ((new-x (tyspecseq-fix$inline x))) (tyspecseqp new-x)) :rule-classes :rewrite)
Theorem:
(defthm tyspecseq-fix-when-tyspecseqp (implies (tyspecseqp x) (equal (tyspecseq-fix x) x)))
Function:
(defun tyspecseq-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (tyspecseqp acl2::x) (tyspecseqp acl2::y)))) (equal (tyspecseq-fix acl2::x) (tyspecseq-fix acl2::y)))
Theorem:
(defthm tyspecseq-equiv-is-an-equivalence (and (booleanp (tyspecseq-equiv x y)) (tyspecseq-equiv x x) (implies (tyspecseq-equiv x y) (tyspecseq-equiv y x)) (implies (and (tyspecseq-equiv x y) (tyspecseq-equiv y z)) (tyspecseq-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm tyspecseq-equiv-implies-equal-tyspecseq-fix-1 (implies (tyspecseq-equiv acl2::x x-equiv) (equal (tyspecseq-fix acl2::x) (tyspecseq-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm tyspecseq-fix-under-tyspecseq-equiv (tyspecseq-equiv (tyspecseq-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-tyspecseq-fix-1-forward-to-tyspecseq-equiv (implies (equal (tyspecseq-fix acl2::x) acl2::y) (tyspecseq-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-tyspecseq-fix-2-forward-to-tyspecseq-equiv (implies (equal acl2::x (tyspecseq-fix acl2::y)) (tyspecseq-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm tyspecseq-equiv-of-tyspecseq-fix-1-forward (implies (tyspecseq-equiv (tyspecseq-fix acl2::x) acl2::y) (tyspecseq-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm tyspecseq-equiv-of-tyspecseq-fix-2-forward (implies (tyspecseq-equiv acl2::x (tyspecseq-fix acl2::y)) (tyspecseq-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm tyspecseq-kind$inline-of-tyspecseq-fix-x (equal (tyspecseq-kind$inline (tyspecseq-fix x)) (tyspecseq-kind$inline x)))
Theorem:
(defthm tyspecseq-kind$inline-tyspecseq-equiv-congruence-on-x (implies (tyspecseq-equiv x x-equiv) (equal (tyspecseq-kind$inline x) (tyspecseq-kind$inline x-equiv))) :rule-classes :congruence)