• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
      • Std/lists
      • Omaps
      • Std/alists
      • Obags
      • Std/util
      • Std/strings
      • Std/osets
      • Std/io
      • Std/basic
      • Std/system
      • Std/typed-lists
        • Std/typed-lists/character-listp
        • Std/typed-lists/symbol-listp
        • Std/typed-lists/boolean-listp
        • Std/typed-lists/string-listp
        • Std/typed-lists/eqlable-listp
        • Theorems-about-true-list-lists
        • Std/typed-lists/atom-listp
        • Unsigned-byte-listp
          • Defbytelist
            • Defbytelist-standard-instances
              • Ubyte8-list
              • Ubyte4-list
              • Ubyte32-list
              • Ubyte256-list
              • Ubyte128-list
                • Ubyte128-list-fix
                  • Ubyte128-list-equiv
                  • Ubyte128-listp
                • Ubyte64-list
                • Ubyte3-list
                • Ubyte2-list
                • Ubyte16-list
                • Ubyte11-list
                • Ubyte1-list
                • Sbyte8-list
                • Sbyte64-list
                • Sbyte4-list
                • Sbyte32-list
                • Sbyte3-list
                • Sbyte256-list
                • Sbyte2-list
                • Sbyte16-list
                • Sbyte128-list
                • Sbyte1-list
                • Defubytelist
                • Defsbytelist
              • Defbytelist-implementation
            • Unsigned-byte-list-fix
          • Cons-listp
          • Cons-list-listp
          • Signed-byte-listp
          • String-or-symbol-listp
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Ubyte128-list

    Ubyte128-list-fix

    (ubyte128-list-fix x) is a usual fty list fixing function.

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

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

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

    Theorem: ubyte128-listp-of-ubyte128-list-fix

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

    Theorem: ubyte128-list-fix-when-ubyte128-listp

    (defthm ubyte128-list-fix-when-ubyte128-listp
      (implies (ubyte128-listp x)
               (equal (ubyte128-list-fix x) x)))

    Function: ubyte128-list-equiv$inline

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

    Theorem: ubyte128-list-equiv-is-an-equivalence

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

    Theorem: ubyte128-list-equiv-implies-equal-ubyte128-list-fix-1

    (defthm ubyte128-list-equiv-implies-equal-ubyte128-list-fix-1
      (implies (ubyte128-list-equiv x x-equiv)
               (equal (ubyte128-list-fix x)
                      (ubyte128-list-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: ubyte128-list-fix-under-ubyte128-list-equiv

    (defthm ubyte128-list-fix-under-ubyte128-list-equiv
      (ubyte128-list-equiv (ubyte128-list-fix x)
                           x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-ubyte128-list-fix-1-forward-to-ubyte128-list-equiv

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

    Theorem: equal-of-ubyte128-list-fix-2-forward-to-ubyte128-list-equiv

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

    Theorem: ubyte128-list-equiv-of-ubyte128-list-fix-1-forward

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

    Theorem: ubyte128-list-equiv-of-ubyte128-list-fix-2-forward

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

    Theorem: car-of-ubyte128-list-fix-x-under-ubyte128-equiv

    (defthm car-of-ubyte128-list-fix-x-under-ubyte128-equiv
      (ubyte128-equiv (car (ubyte128-list-fix x))
                      (car x)))

    Theorem: car-ubyte128-list-equiv-congruence-on-x-under-ubyte128-equiv

    (defthm car-ubyte128-list-equiv-congruence-on-x-under-ubyte128-equiv
      (implies (ubyte128-list-equiv x x-equiv)
               (ubyte128-equiv (car x) (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-ubyte128-list-fix-x-under-ubyte128-list-equiv

    (defthm cdr-of-ubyte128-list-fix-x-under-ubyte128-list-equiv
      (ubyte128-list-equiv (cdr (ubyte128-list-fix x))
                           (cdr x)))

    Theorem: cdr-ubyte128-list-equiv-congruence-on-x-under-ubyte128-list-equiv

    (defthm
      cdr-ubyte128-list-equiv-congruence-on-x-under-ubyte128-list-equiv
      (implies (ubyte128-list-equiv x x-equiv)
               (ubyte128-list-equiv (cdr x)
                                    (cdr x-equiv)))
      :rule-classes :congruence)

    Theorem: cons-of-ubyte128-fix-x-under-ubyte128-list-equiv

    (defthm cons-of-ubyte128-fix-x-under-ubyte128-list-equiv
      (ubyte128-list-equiv (cons (ubyte128-fix x) y)
                           (cons x y)))

    Theorem: cons-ubyte128-equiv-congruence-on-x-under-ubyte128-list-equiv

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

    Theorem: cons-of-ubyte128-list-fix-y-under-ubyte128-list-equiv

    (defthm cons-of-ubyte128-list-fix-y-under-ubyte128-list-equiv
      (ubyte128-list-equiv (cons x (ubyte128-list-fix y))
                           (cons x y)))

    Theorem: cons-ubyte128-list-equiv-congruence-on-y-under-ubyte128-list-equiv

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

    Theorem: consp-of-ubyte128-list-fix

    (defthm consp-of-ubyte128-list-fix
      (equal (consp (ubyte128-list-fix x))
             (consp x)))

    Theorem: ubyte128-list-fix-under-iff

    (defthm ubyte128-list-fix-under-iff
      (iff (ubyte128-list-fix x) (consp x)))

    Theorem: ubyte128-list-fix-of-cons

    (defthm ubyte128-list-fix-of-cons
      (equal (ubyte128-list-fix (cons a x))
             (cons (ubyte128-fix a)
                   (ubyte128-list-fix x))))

    Theorem: len-of-ubyte128-list-fix

    (defthm len-of-ubyte128-list-fix
      (equal (len (ubyte128-list-fix x))
             (len x)))

    Theorem: ubyte128-list-fix-of-append

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

    Theorem: ubyte128-list-fix-of-repeat

    (defthm ubyte128-list-fix-of-repeat
      (equal (ubyte128-list-fix (repeat n x))
             (repeat n (ubyte128-fix x))))

    Theorem: list-equiv-refines-ubyte128-list-equiv

    (defthm list-equiv-refines-ubyte128-list-equiv
      (implies (list-equiv x y)
               (ubyte128-list-equiv x y))
      :rule-classes :refinement)

    Theorem: nth-of-ubyte128-list-fix

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

    Theorem: ubyte128-list-equiv-implies-ubyte128-list-equiv-append-1

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

    Theorem: ubyte128-list-equiv-implies-ubyte128-list-equiv-append-2

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

    Theorem: ubyte128-list-equiv-implies-ubyte128-list-equiv-nthcdr-2

    (defthm ubyte128-list-equiv-implies-ubyte128-list-equiv-nthcdr-2
      (implies (ubyte128-list-equiv l l-equiv)
               (ubyte128-list-equiv (nthcdr n l)
                                    (nthcdr n l-equiv)))
      :rule-classes (:congruence))

    Theorem: ubyte128-list-equiv-implies-ubyte128-list-equiv-take-2

    (defthm ubyte128-list-equiv-implies-ubyte128-list-equiv-take-2
      (implies (ubyte128-list-equiv l l-equiv)
               (ubyte128-list-equiv (take n l)
                                    (take n l-equiv)))
      :rule-classes (:congruence))