• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
        • Deftagsum
        • Defprod
        • Defflexsum
        • Defbitstruct
        • Deflist
        • Defalist
        • Defbyte
        • Defresult
        • Deffixequiv
        • Deffixtype
        • Defoption
        • Fty-discipline
        • Fold
        • Specific-types
        • Fty-extensions
        • Defsubtype
        • Deftypes
        • Defset
        • Defflatsum
        • Deflist-of-len
        • Defomap
        • 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
            • Sbyte32-list
            • Sbyte3-list
            • Sbyte256-list
            • Sbyte2-list
            • Sbyte16-list
              • Sbyte16-list-fix
                • Sbyte16-list-equiv
                • Sbyte16-listp
              • Sbyte128-list
              • Sbyte1-list
              • Defubytelist
              • Defsbytelist
            • Defbytelist-implementation
          • Fty::basetypes
          • Defvisitors
          • Deffixtype-alias
          • Deffixequiv-sk
          • Defunit
          • Multicase
          • Deffixequiv-mutual
          • Fty::baselists
          • Def-enumcase
          • Defmap
        • Apt
        • Std/util
        • Defdata
        • Defrstobj
        • Seq
        • Match-tree
        • Defrstobj
        • With-supporters
        • Def-partial-measure
        • Template-subst
        • Soft
        • Defthm-domain
        • Event-macros
        • Def-universal-equiv
        • Def-saved-obligs
        • With-supporters-after
        • Definec
        • Sig
        • Outer-local
        • Data-structures
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Sbyte16-list

    Sbyte16-list-fix

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

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

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

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

    Theorem: sbyte16-listp-of-sbyte16-list-fix

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

    Theorem: sbyte16-list-fix-when-sbyte16-listp

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

    Function: sbyte16-list-equiv$inline

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

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

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

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

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

    Theorem: sbyte16-list-fix-under-sbyte16-list-equiv

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Theorem: consp-of-sbyte16-list-fix

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

    Theorem: sbyte16-list-fix-under-iff

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

    Theorem: sbyte16-list-fix-of-cons

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

    Theorem: len-of-sbyte16-list-fix

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

    Theorem: sbyte16-list-fix-of-append

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

    Theorem: sbyte16-list-fix-of-repeat

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

    Theorem: list-equiv-refines-sbyte16-list-equiv

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

    Theorem: nth-of-sbyte16-list-fix

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

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

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

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

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

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

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

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

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