• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
        • Atj
        • Aij
        • Language
          • Syntax
            • Grammar
            • Unicode-escapes
            • Unicode-input-char
            • Escape-sequence
            • Identifiers
            • Primitive-types
            • Reference-types
            • Unicode-characters
            • Keywords
            • Integer-literals
            • String-literals
            • Octal-digits
            • Hexadecimal-digits
              • Hex-digit
              • Hex-digit-value
              • Hexadecimal-digits-grammar-validation
              • Hex-digit-list
                • Hex-digit-list-fix
                  • Hex-digit-list-equiv
                  • Hex-digit-listp
                • Hexadecimal-digits-std/strings-theorems
              • Decimal-digits
              • Binary-digits
              • Character-literals
              • Null-literal
              • Floating-point-literals
              • Boolean-literals
              • Package-names
              • Literals
            • Semantics
        • Riscv
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Hex-digit-list

    Hex-digit-list-fix

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

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

    In the logic, we apply hex-digit-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-list-fix$inline

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

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

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

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

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

    Function: hex-digit-list-equiv$inline

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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