• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
      • Std/lists
      • Omaps
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
        • Pretty-printing
        • Printtree
        • Base64
        • Charset-p
        • Strtok!
        • Cases
        • Concatenation
        • Character-kinds
        • Html-encoding
        • Substrings
        • Strtok
        • Equivalences
        • Url-encoding
        • Lines
        • Explode-implode-equalities
        • Ordering
        • Numbers
          • Decimal
          • Hex
            • Parse-hex-from-string
            • Hex-digit-char-p
              • Hex-digit-char
                • Hex-digit-char-fix
                • Hex-digit-char-list
                  • Hex-digit-char-list-fix
                    • Hex-digit-char-list-equiv
              • Nat-to-hex-chars
              • Parse-hex-from-charlist
              • Hex-digit-chars-value
              • Hex-digit-char-value
              • Take-leading-hex-digit-chars
              • Hexify
              • Hex-digit-char-listp
              • Hex-digit-char-list*p
              • Hex-digit-string-p
              • Strval16
              • Skip-leading-hex-digits
              • Nat-to-hex-string
              • Hexify-width
              • Nonzero-hex-digit-char-p
              • Nat-to-hex-string-list
              • Revappend-nat-to-hex-chars
              • Hex-digit-to-char
              • Nat-to-hex-string-size
            • Octal
            • Binary
          • Pad-trim
          • Coercion
          • Std/strings/digit-to-char
          • Substitution
          • Symbols
        • Std/osets
        • Std/io
        • Std/basic
        • Std/system
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Hex-digit-char-list

    Hex-digit-char-list-fix

    (hex-digit-char-list-fix x) is a usual ACL2::fty list fixing function.

    Signature
    (hex-digit-char-list-fix x) → fty::newx
    Arguments
    x — Guard (hex-digit-char-listp x).
    Returns
    fty::newx — Type (hex-digit-char-listp fty::newx).

    In the logic, we apply hex-digit-char-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.

    Definitions and Theorems

    Function: hex-digit-char-list-fix$inline

    (defun hex-digit-char-list-fix$inline (x)
      (declare (xargs :guard (hex-digit-char-listp x)))
      (let ((acl2::__function__ 'hex-digit-char-list-fix))
        (declare (ignorable acl2::__function__))
        (mbe :logic
             (if (atom x)
                 nil
               (cons (hex-digit-char-fix (car x))
                     (hex-digit-char-list-fix (cdr x))))
             :exec x)))

    Theorem: hex-digit-char-listp-of-hex-digit-char-list-fix

    (defthm hex-digit-char-listp-of-hex-digit-char-list-fix
      (b* ((fty::newx (hex-digit-char-list-fix$inline x)))
        (hex-digit-char-listp fty::newx))
      :rule-classes :rewrite)

    Theorem: hex-digit-char-list-fix-when-hex-digit-char-listp

    (defthm hex-digit-char-list-fix-when-hex-digit-char-listp
      (implies (hex-digit-char-listp x)
               (equal (hex-digit-char-list-fix x) x)))

    Function: hex-digit-char-list-equiv$inline

    (defun hex-digit-char-list-equiv$inline (x y)
      (declare (xargs :guard (and (hex-digit-char-listp x)
                                  (hex-digit-char-listp y))))
      (equal (hex-digit-char-list-fix x)
             (hex-digit-char-list-fix y)))

    Theorem: hex-digit-char-list-equiv-is-an-equivalence

    (defthm hex-digit-char-list-equiv-is-an-equivalence
      (and (booleanp (hex-digit-char-list-equiv x y))
           (hex-digit-char-list-equiv x x)
           (implies (hex-digit-char-list-equiv x y)
                    (hex-digit-char-list-equiv y x))
           (implies (and (hex-digit-char-list-equiv x y)
                         (hex-digit-char-list-equiv y z))
                    (hex-digit-char-list-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: hex-digit-char-list-equiv-implies-equal-hex-digit-char-list-fix-1

    (defthm
      hex-digit-char-list-equiv-implies-equal-hex-digit-char-list-fix-1
      (implies (hex-digit-char-list-equiv x x-equiv)
               (equal (hex-digit-char-list-fix x)
                      (hex-digit-char-list-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: hex-digit-char-list-fix-under-hex-digit-char-list-equiv

    (defthm hex-digit-char-list-fix-under-hex-digit-char-list-equiv
      (hex-digit-char-list-equiv (hex-digit-char-list-fix x)
                                 x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-hex-digit-char-list-fix-1-forward-to-hex-digit-char-list-equiv

    (defthm
     equal-of-hex-digit-char-list-fix-1-forward-to-hex-digit-char-list-equiv
     (implies (equal (hex-digit-char-list-fix x) y)
              (hex-digit-char-list-equiv x y))
     :rule-classes :forward-chaining)

    Theorem: equal-of-hex-digit-char-list-fix-2-forward-to-hex-digit-char-list-equiv

    (defthm
     equal-of-hex-digit-char-list-fix-2-forward-to-hex-digit-char-list-equiv
     (implies (equal x (hex-digit-char-list-fix y))
              (hex-digit-char-list-equiv x y))
     :rule-classes :forward-chaining)

    Theorem: hex-digit-char-list-equiv-of-hex-digit-char-list-fix-1-forward

    (defthm
         hex-digit-char-list-equiv-of-hex-digit-char-list-fix-1-forward
      (implies (hex-digit-char-list-equiv (hex-digit-char-list-fix x)
                                          y)
               (hex-digit-char-list-equiv x y))
      :rule-classes :forward-chaining)

    Theorem: hex-digit-char-list-equiv-of-hex-digit-char-list-fix-2-forward

    (defthm
         hex-digit-char-list-equiv-of-hex-digit-char-list-fix-2-forward
      (implies (hex-digit-char-list-equiv x (hex-digit-char-list-fix y))
               (hex-digit-char-list-equiv x y))
      :rule-classes :forward-chaining)

    Theorem: car-of-hex-digit-char-list-fix-x-under-hex-digit-char-equiv

    (defthm car-of-hex-digit-char-list-fix-x-under-hex-digit-char-equiv
      (hex-digit-char-equiv (car (hex-digit-char-list-fix x))
                            (car x)))

    Theorem: car-hex-digit-char-list-equiv-congruence-on-x-under-hex-digit-char-equiv

    (defthm
     car-hex-digit-char-list-equiv-congruence-on-x-under-hex-digit-char-equiv
     (implies (hex-digit-char-list-equiv x x-equiv)
              (hex-digit-char-equiv (car x)
                                    (car x-equiv)))
     :rule-classes :congruence)

    Theorem: cdr-of-hex-digit-char-list-fix-x-under-hex-digit-char-list-equiv

    (defthm
       cdr-of-hex-digit-char-list-fix-x-under-hex-digit-char-list-equiv
      (hex-digit-char-list-equiv (cdr (hex-digit-char-list-fix x))
                                 (cdr x)))

    Theorem: cdr-hex-digit-char-list-equiv-congruence-on-x-under-hex-digit-char-list-equiv

    (defthm
     cdr-hex-digit-char-list-equiv-congruence-on-x-under-hex-digit-char-list-equiv
     (implies (hex-digit-char-list-equiv x x-equiv)
              (hex-digit-char-list-equiv (cdr x)
                                         (cdr x-equiv)))
     :rule-classes :congruence)

    Theorem: cons-of-hex-digit-char-fix-x-under-hex-digit-char-list-equiv

    (defthm cons-of-hex-digit-char-fix-x-under-hex-digit-char-list-equiv
      (hex-digit-char-list-equiv (cons (hex-digit-char-fix x) y)
                                 (cons x y)))

    Theorem: cons-hex-digit-char-equiv-congruence-on-x-under-hex-digit-char-list-equiv

    (defthm
     cons-hex-digit-char-equiv-congruence-on-x-under-hex-digit-char-list-equiv
     (implies (hex-digit-char-equiv x x-equiv)
              (hex-digit-char-list-equiv (cons x y)
                                         (cons x-equiv y)))
     :rule-classes :congruence)

    Theorem: cons-of-hex-digit-char-list-fix-y-under-hex-digit-char-list-equiv

    (defthm
      cons-of-hex-digit-char-list-fix-y-under-hex-digit-char-list-equiv
      (hex-digit-char-list-equiv (cons x (hex-digit-char-list-fix y))
                                 (cons x y)))

    Theorem: cons-hex-digit-char-list-equiv-congruence-on-y-under-hex-digit-char-list-equiv

    (defthm
     cons-hex-digit-char-list-equiv-congruence-on-y-under-hex-digit-char-list-equiv
     (implies (hex-digit-char-list-equiv y y-equiv)
              (hex-digit-char-list-equiv (cons x y)
                                         (cons x y-equiv)))
     :rule-classes :congruence)

    Theorem: consp-of-hex-digit-char-list-fix

    (defthm consp-of-hex-digit-char-list-fix
      (equal (consp (hex-digit-char-list-fix x))
             (consp x)))

    Theorem: hex-digit-char-list-fix-under-iff

    (defthm hex-digit-char-list-fix-under-iff
      (iff (hex-digit-char-list-fix x)
           (consp x)))

    Theorem: hex-digit-char-list-fix-of-cons

    (defthm hex-digit-char-list-fix-of-cons
      (equal (hex-digit-char-list-fix (cons a x))
             (cons (hex-digit-char-fix a)
                   (hex-digit-char-list-fix x))))

    Theorem: len-of-hex-digit-char-list-fix

    (defthm len-of-hex-digit-char-list-fix
      (equal (len (hex-digit-char-list-fix x))
             (len x)))

    Theorem: hex-digit-char-list-fix-of-append

    (defthm hex-digit-char-list-fix-of-append
      (equal (hex-digit-char-list-fix (append std::a std::b))
             (append (hex-digit-char-list-fix std::a)
                     (hex-digit-char-list-fix std::b))))

    Theorem: hex-digit-char-list-fix-of-repeat

    (defthm hex-digit-char-list-fix-of-repeat
      (equal (hex-digit-char-list-fix (repeat n x))
             (repeat n (hex-digit-char-fix x))))

    Theorem: list-equiv-refines-hex-digit-char-list-equiv

    (defthm list-equiv-refines-hex-digit-char-list-equiv
      (implies (list-equiv x y)
               (hex-digit-char-list-equiv x y))
      :rule-classes :refinement)

    Theorem: nth-of-hex-digit-char-list-fix

    (defthm nth-of-hex-digit-char-list-fix
      (equal (nth n (hex-digit-char-list-fix x))
             (if (< (nfix n) (len x))
                 (hex-digit-char-fix (nth n x))
               nil)))

    Theorem: hex-digit-char-list-equiv-implies-hex-digit-char-list-equiv-append-1

    (defthm
     hex-digit-char-list-equiv-implies-hex-digit-char-list-equiv-append-1
     (implies (hex-digit-char-list-equiv x fty::x-equiv)
              (hex-digit-char-list-equiv (append x y)
                                         (append fty::x-equiv y)))
     :rule-classes (:congruence))

    Theorem: hex-digit-char-list-equiv-implies-hex-digit-char-list-equiv-append-2

    (defthm
     hex-digit-char-list-equiv-implies-hex-digit-char-list-equiv-append-2
     (implies (hex-digit-char-list-equiv y fty::y-equiv)
              (hex-digit-char-list-equiv (append x y)
                                         (append x fty::y-equiv)))
     :rule-classes (:congruence))

    Theorem: hex-digit-char-list-equiv-implies-hex-digit-char-list-equiv-nthcdr-2

    (defthm
     hex-digit-char-list-equiv-implies-hex-digit-char-list-equiv-nthcdr-2
     (implies (hex-digit-char-list-equiv l l-equiv)
              (hex-digit-char-list-equiv (nthcdr n l)
                                         (nthcdr n l-equiv)))
     :rule-classes (:congruence))

    Theorem: hex-digit-char-list-equiv-implies-hex-digit-char-list-equiv-take-2

    (defthm
     hex-digit-char-list-equiv-implies-hex-digit-char-list-equiv-take-2
     (implies (hex-digit-char-list-equiv l l-equiv)
              (hex-digit-char-list-equiv (take n l)
                                         (take n l-equiv)))
     :rule-classes (:congruence))