• 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
              • Ubyte64-list
              • Ubyte3-list
              • Ubyte2-list
              • Ubyte16-list
              • Ubyte11-list
              • Ubyte1-list
              • Sbyte8-list
              • Sbyte64-list
              • Sbyte4-list
                • Sbyte4-list-fix
                  • Sbyte4-list-equiv
                  • Sbyte4-listp
                • 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
    • Sbyte4-list

    Sbyte4-list-fix

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

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

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

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

    Theorem: sbyte4-listp-of-sbyte4-list-fix

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

    Theorem: sbyte4-list-fix-when-sbyte4-listp

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

    Function: sbyte4-list-equiv$inline

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

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

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

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

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

    Theorem: sbyte4-list-fix-under-sbyte4-list-equiv

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Theorem: consp-of-sbyte4-list-fix

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

    Theorem: sbyte4-list-fix-under-iff

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

    Theorem: sbyte4-list-fix-of-cons

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

    Theorem: len-of-sbyte4-list-fix

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

    Theorem: sbyte4-list-fix-of-append

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

    Theorem: sbyte4-list-fix-of-repeat

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

    Theorem: list-equiv-refines-sbyte4-list-equiv

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

    Theorem: nth-of-sbyte4-list-fix

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

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

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

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

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

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

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

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

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