• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
          • Atj
          • Aij
          • Language
            • Syntax
            • Semantics
              • Primitive-function-macros
              • Primitive-values
                • Floating-pointx-value
                • Doublex-value-fns
                • Primitivex-value
                • Floatx-value-fns
                • Primitive-value
                • Numericx-value
                • Numeric-value
                • Integral-value
                • Int-value
                • Char-value
                • Byte-value
                • Short-value
                • Long-value
                • Float-value
                • Double-value
                • Boolean-value
                • Floating-point-value
                • Disjoint-primitive-values
                • Short-value-list
                • Long-value-list
                • Int-value-list
                • Float-value-list
                • Double-value-list
                • Char-value-list
                • Byte-value-list
                  • Byte-value-list-fix
                    • Byte-value-list-equiv
                    • Byte-value-listp
                  • Boolean-value-list
                • Floating-point-placeholders
                • Pointers
                • Floating-point-value-set-parameters
                • Values
                • Primitive-operations
                • Primitive-conversions
                • Reference-values
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Byte-value-list

    Byte-value-list-fix

    (byte-value-list-fix x) is a usual ACL2::fty list fixing function.

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

    In the logic, we apply byte-value-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: byte-value-list-fix$inline

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

    Theorem: byte-value-listp-of-byte-value-list-fix

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

    Theorem: byte-value-list-fix-when-byte-value-listp

    (defthm byte-value-list-fix-when-byte-value-listp
      (implies (byte-value-listp x)
               (equal (byte-value-list-fix x) x)))

    Function: byte-value-list-equiv$inline

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

    Theorem: byte-value-list-equiv-is-an-equivalence

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

    Theorem: byte-value-list-equiv-implies-equal-byte-value-list-fix-1

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

    Theorem: byte-value-list-fix-under-byte-value-list-equiv

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

    Theorem: equal-of-byte-value-list-fix-1-forward-to-byte-value-list-equiv

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

    Theorem: equal-of-byte-value-list-fix-2-forward-to-byte-value-list-equiv

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

    Theorem: byte-value-list-equiv-of-byte-value-list-fix-1-forward

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

    Theorem: byte-value-list-equiv-of-byte-value-list-fix-2-forward

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

    Theorem: car-of-byte-value-list-fix-x-under-byte-value-equiv

    (defthm car-of-byte-value-list-fix-x-under-byte-value-equiv
      (byte-value-equiv (car (byte-value-list-fix acl2::x))
                        (car acl2::x)))

    Theorem: car-byte-value-list-equiv-congruence-on-x-under-byte-value-equiv

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

    Theorem: cdr-of-byte-value-list-fix-x-under-byte-value-list-equiv

    (defthm cdr-of-byte-value-list-fix-x-under-byte-value-list-equiv
      (byte-value-list-equiv (cdr (byte-value-list-fix acl2::x))
                             (cdr acl2::x)))

    Theorem: cdr-byte-value-list-equiv-congruence-on-x-under-byte-value-list-equiv

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

    Theorem: cons-of-byte-value-fix-x-under-byte-value-list-equiv

    (defthm cons-of-byte-value-fix-x-under-byte-value-list-equiv
      (byte-value-list-equiv (cons (byte-value-fix acl2::x) acl2::y)
                             (cons acl2::x acl2::y)))

    Theorem: cons-byte-value-equiv-congruence-on-x-under-byte-value-list-equiv

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

    Theorem: cons-of-byte-value-list-fix-y-under-byte-value-list-equiv

    (defthm cons-of-byte-value-list-fix-y-under-byte-value-list-equiv
     (byte-value-list-equiv (cons acl2::x (byte-value-list-fix acl2::y))
                            (cons acl2::x acl2::y)))

    Theorem: cons-byte-value-list-equiv-congruence-on-y-under-byte-value-list-equiv

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

    Theorem: consp-of-byte-value-list-fix

    (defthm consp-of-byte-value-list-fix
      (equal (consp (byte-value-list-fix acl2::x))
             (consp acl2::x)))

    Theorem: byte-value-list-fix-under-iff

    (defthm byte-value-list-fix-under-iff
      (iff (byte-value-list-fix acl2::x)
           (consp acl2::x)))

    Theorem: byte-value-list-fix-of-cons

    (defthm byte-value-list-fix-of-cons
      (equal (byte-value-list-fix (cons a x))
             (cons (byte-value-fix a)
                   (byte-value-list-fix x))))

    Theorem: len-of-byte-value-list-fix

    (defthm len-of-byte-value-list-fix
      (equal (len (byte-value-list-fix acl2::x))
             (len acl2::x)))

    Theorem: byte-value-list-fix-of-append

    (defthm byte-value-list-fix-of-append
      (equal (byte-value-list-fix (append std::a std::b))
             (append (byte-value-list-fix std::a)
                     (byte-value-list-fix std::b))))

    Theorem: byte-value-list-fix-of-repeat

    (defthm byte-value-list-fix-of-repeat
      (equal (byte-value-list-fix (repeat acl2::n acl2::x))
             (repeat acl2::n (byte-value-fix acl2::x))))

    Theorem: list-equiv-refines-byte-value-list-equiv

    (defthm list-equiv-refines-byte-value-list-equiv
      (implies (list-equiv acl2::x acl2::y)
               (byte-value-list-equiv acl2::x acl2::y))
      :rule-classes :refinement)

    Theorem: nth-of-byte-value-list-fix

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

    Theorem: byte-value-list-equiv-implies-byte-value-list-equiv-append-1

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

    Theorem: byte-value-list-equiv-implies-byte-value-list-equiv-append-2

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

    Theorem: byte-value-list-equiv-implies-byte-value-list-equiv-nthcdr-2

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

    Theorem: byte-value-list-equiv-implies-byte-value-list-equiv-take-2

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