Fixing function for jliteral structures.
Function:
(defun jliteral-fix$inline (x) (declare (xargs :guard (jliteralp x))) (let ((__function__ 'jliteral-fix)) (declare (ignorable __function__)) (mbe :logic (case (jliteral-kind x) (:integer (b* ((get (integer-literal-fix (std::da-nth 0 (cdr x))))) (cons :integer (list get)))) (:floating (b* ((value (nfix (std::da-nth 0 (cdr x))))) (cons :floating (list value)))) (:boolean (b* ((value (acl2::bool-fix (std::da-nth 0 (cdr x))))) (cons :boolean (list value)))) (:character (b* ((value (acl2::char-fix (std::da-nth 0 (cdr x))))) (cons :character (list value)))) (:string (b* ((value (str-fix (std::da-nth 0 (cdr x))))) (cons :string (list value)))) (:null (cons :null (list)))) :exec x)))
Theorem:
(defthm jliteralp-of-jliteral-fix (b* ((new-x (jliteral-fix$inline x))) (jliteralp new-x)) :rule-classes :rewrite)
Theorem:
(defthm jliteral-fix-when-jliteralp (implies (jliteralp x) (equal (jliteral-fix x) x)))
Function:
(defun jliteral-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (jliteralp acl2::x) (jliteralp acl2::y)))) (equal (jliteral-fix acl2::x) (jliteral-fix acl2::y)))
Theorem:
(defthm jliteral-equiv-is-an-equivalence (and (booleanp (jliteral-equiv x y)) (jliteral-equiv x x) (implies (jliteral-equiv x y) (jliteral-equiv y x)) (implies (and (jliteral-equiv x y) (jliteral-equiv y z)) (jliteral-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm jliteral-equiv-implies-equal-jliteral-fix-1 (implies (jliteral-equiv acl2::x x-equiv) (equal (jliteral-fix acl2::x) (jliteral-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm jliteral-fix-under-jliteral-equiv (jliteral-equiv (jliteral-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-jliteral-fix-1-forward-to-jliteral-equiv (implies (equal (jliteral-fix acl2::x) acl2::y) (jliteral-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-jliteral-fix-2-forward-to-jliteral-equiv (implies (equal acl2::x (jliteral-fix acl2::y)) (jliteral-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm jliteral-equiv-of-jliteral-fix-1-forward (implies (jliteral-equiv (jliteral-fix acl2::x) acl2::y) (jliteral-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm jliteral-equiv-of-jliteral-fix-2-forward (implies (jliteral-equiv acl2::x (jliteral-fix acl2::y)) (jliteral-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm jliteral-kind$inline-of-jliteral-fix-x (equal (jliteral-kind$inline (jliteral-fix x)) (jliteral-kind$inline x)))
Theorem:
(defthm jliteral-kind$inline-jliteral-equiv-congruence-on-x (implies (jliteral-equiv x x-equiv) (equal (jliteral-kind$inline x) (jliteral-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-jliteral-fix (consp (jliteral-fix x)) :rule-classes :type-prescription)