• 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
          • Syntax-for-tools
          • Atc
          • Transformation-tools
          • Language
          • Representation
            • Representation-of-integer-operations
            • Atc-arrays
            • Representation-of-integers
              • Def-integer-values
              • Ushort-list-from-integer-list
              • Ullong-list-from-integer-list
              • Sshort-list-from-integer-list
                • Sllong-list-from-integer-list
                • Integer-list-from-ushort-list
                • Integer-list-from-ullong-list
                • Integer-list-from-sshort-list
                • Integer-list-from-sllong-list
                • Ulong-list-from-integer-list
                • Uchar-list-from-integer-list
                • Slong-list-from-integer-list
                • Schar-list-from-integer-list
                • Integer-list-from-ulong-list
                • Integer-list-from-uchar-list
                • Integer-list-from-slong-list
                • Integer-list-from-schar-list
                • Uint-list-from-integer-list
                • Sint-list-from-integer-list
                • Integer-list-from-uint-list
                • Integer-list-from-sint-list
                • Cinteger
                • Sintp
                • Ullongp
                • Ucharp
                • Ushortp
                • Ulongp
                • Uintp
                • Sllongp
                • Slongp
                • Sshortp
                • Scharp
                • Integer-from-sshort
                • Integer-from-sllong
                • Integer-from-sint
                • Integer-from-slong
                • Integer-from-schar
                • Integer-type-to-fixtype
                • Integer-from-ushort
                • Integer-from-ullong
                • Integer-from-uchar
                • Integer-from-cinteger
                • Integer-from-ulong
                • Integer-from-uint
                • Def-integer-values-loop
                • Sint-from-integer
                • Sint
                • Fixtype-to-integer-type
                • Uchar-from-integer
                • Ushort-from-integer-mod
                • Ushort-from-integer
                • Ulong-from-integer-mod
                • Ulong-from-integer
                • Ullong-from-integer-mod
                • Ullong-from-integer
                • Uchar-from-integer-mod
                • Sshort-from-integer
                • Slong-from-integer
                • Sllong-from-integer
                • Schar-from-integer
                • Uint-from-integer-mod
                • Uint-from-integer
                • Uchar
                • Schar
                • Ushort
                • Ulong
                • Ullong
                • Sshort
                • Slong
                • Sllong
                • Ullong-fix
                • Uint
                • Uchar-fix
                • Sint-fix
                • Ushort-fix
                • Ulong-fix
                • Uint-fix
                • Sshort-fix
                • Slong-fix
                • Sllong-fix
                • Schar-fix
                • Ushort-list
                • Ulong-list
                • Ullong-list
                • Uint-list
                • Uchar-list
                • Sshort-list
                • Slong-list
                • Sllong-list
                • Sint-list
                • Schar-list
                • Integer-type-to/from-fixtype-theorems
                • *nonchar-integer-fixtypes*
              • Representation-of-integer-conversions
              • Pointed-integers
              • Shallow-deep-embedding-relation
            • Insertion-sort
            • Pack
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • 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
    • Representation-of-integers

    Sshort-list-from-integer-list

    Lift sshort to lists.

    Signature
    (sshort-list-from-integer-list x) → result
    Arguments
    x — Guard (sshort-integer-listp x).
    Returns
    result — Type (sshort-listp result).

    This is an ordinary std::defprojection.

    Definitions and Theorems

    Function: sshort-list-from-integer-list-exec

    (defun sshort-list-from-integer-list-exec (x acc)
      (declare (xargs :guard (sshort-integer-listp x)))
      (declare (xargs :guard t))
      (let ((__function__ 'sshort-list-from-integer-list-exec))
        (declare (ignorable __function__))
        (if (consp x)
            (sshort-list-from-integer-list-exec
                 (cdr x)
                 (cons (sshort-from-integer (car x))
                       acc))
          acc)))

    Function: sshort-list-from-integer-list-nrev

    (defun sshort-list-from-integer-list-nrev (x acl2::nrev)
     (declare (xargs :stobjs (acl2::nrev)))
     (declare (xargs :guard (sshort-integer-listp x)))
     (declare (xargs :guard t))
     (let ((__function__ 'sshort-list-from-integer-list-nrev))
      (declare (ignorable __function__))
      (if (atom x)
          (acl2::nrev-fix acl2::nrev)
        (let ((acl2::nrev (acl2::nrev-push (sshort-from-integer (car x))
                                           acl2::nrev)))
          (sshort-list-from-integer-list-nrev (cdr x)
                                              acl2::nrev)))))

    Function: sshort-list-from-integer-list

    (defun sshort-list-from-integer-list (x)
     (declare (xargs :guard (sshort-integer-listp x)))
     (declare (xargs :guard t))
     (let ((__function__ 'sshort-list-from-integer-list))
      (declare (ignorable __function__))
      (mbe :logic
           (if (consp x)
               (cons (sshort-from-integer (car x))
                     (sshort-list-from-integer-list (cdr x)))
             nil)
           :exec
           (if (atom x)
               nil
             (acl2::with-local-nrev
                  (sshort-list-from-integer-list-nrev x acl2::nrev))))))

    Theorem: sshort-listp-of-sshort-list-from-integer-list

    (defthm sshort-listp-of-sshort-list-from-integer-list
      (b* ((result (sshort-list-from-integer-list x)))
        (sshort-listp result))
      :rule-classes :rewrite)

    Theorem: sshort-list-from-integer-list-of-update-nth

    (defthm sshort-list-from-integer-list-of-update-nth
      (implies
           (<= (nfix acl2::n) (len acl2::x))
           (equal (sshort-list-from-integer-list
                       (update-nth acl2::n acl2::v acl2::x))
                  (update-nth acl2::n (sshort-from-integer acl2::v)
                              (sshort-list-from-integer-list acl2::x))))
      :rule-classes ((:rewrite)))

    Theorem: nth-of-sshort-list-from-integer-list

    (defthm nth-of-sshort-list-from-integer-list
      (equal (nth acl2::n
                  (sshort-list-from-integer-list acl2::x))
             (and (< (nfix acl2::n) (len acl2::x))
                  (sshort-from-integer (nth acl2::n acl2::x))))
      :rule-classes ((:rewrite)))

    Theorem: sshort-list-from-integer-list-of-take

    (defthm sshort-list-from-integer-list-of-take
      (implies
           (<= (nfix acl2::n) (len acl2::x))
           (equal (sshort-list-from-integer-list (take acl2::n acl2::x))
                  (take acl2::n
                        (sshort-list-from-integer-list acl2::x))))
      :rule-classes ((:rewrite)))

    Theorem: set-equiv-congruence-over-sshort-list-from-integer-list

    (defthm set-equiv-congruence-over-sshort-list-from-integer-list
      (implies (set-equiv acl2::x acl2::y)
               (set-equiv (sshort-list-from-integer-list acl2::x)
                          (sshort-list-from-integer-list acl2::y)))
      :rule-classes ((:congruence)))

    Theorem: subsetp-of-sshort-list-from-integer-list-when-subsetp

    (defthm subsetp-of-sshort-list-from-integer-list-when-subsetp
      (implies (subsetp acl2::x acl2::y)
               (subsetp (sshort-list-from-integer-list acl2::x)
                        (sshort-list-from-integer-list acl2::y)))
      :rule-classes ((:rewrite)))

    Theorem: member-of-sshort-from-integer-in-sshort-list-from-integer-list

    (defthm
         member-of-sshort-from-integer-in-sshort-list-from-integer-list
     (implies
          (common-lisp::member acl2::k acl2::x)
          (common-lisp::member (sshort-from-integer acl2::k)
                               (sshort-list-from-integer-list acl2::x)))
     :rule-classes ((:rewrite)))

    Theorem: sshort-list-from-integer-list-nrev-removal

    (defthm sshort-list-from-integer-list-nrev-removal
      (equal (sshort-list-from-integer-list-nrev acl2::x acl2::nrev)
             (append acl2::nrev
                     (sshort-list-from-integer-list acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: sshort-list-from-integer-list-exec-removal

    (defthm sshort-list-from-integer-list-exec-removal
      (equal (sshort-list-from-integer-list-exec acl2::x acl2::acc)
             (revappend (sshort-list-from-integer-list acl2::x)
                        acl2::acc))
      :rule-classes ((:rewrite)))

    Theorem: sshort-list-from-integer-list-of-rev

    (defthm sshort-list-from-integer-list-of-rev
      (equal (sshort-list-from-integer-list (rev acl2::x))
             (rev (sshort-list-from-integer-list acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: sshort-list-from-integer-list-of-list-fix

    (defthm sshort-list-from-integer-list-of-list-fix
      (equal (sshort-list-from-integer-list (list-fix acl2::x))
             (sshort-list-from-integer-list acl2::x))
      :rule-classes ((:rewrite)))

    Theorem: sshort-list-from-integer-list-of-append

    (defthm sshort-list-from-integer-list-of-append
      (equal (sshort-list-from-integer-list (append acl2::a acl2::b))
             (append (sshort-list-from-integer-list acl2::a)
                     (sshort-list-from-integer-list acl2::b)))
      :rule-classes ((:rewrite)))

    Theorem: cdr-of-sshort-list-from-integer-list

    (defthm cdr-of-sshort-list-from-integer-list
      (equal (cdr (sshort-list-from-integer-list acl2::x))
             (sshort-list-from-integer-list (cdr acl2::x)))
      :rule-classes ((:rewrite)))

    Theorem: car-of-sshort-list-from-integer-list

    (defthm car-of-sshort-list-from-integer-list
      (equal (car (sshort-list-from-integer-list acl2::x))
             (and (consp acl2::x)
                  (sshort-from-integer (car acl2::x))))
      :rule-classes ((:rewrite)))

    Theorem: sshort-list-from-integer-list-under-iff

    (defthm sshort-list-from-integer-list-under-iff
      (iff (sshort-list-from-integer-list acl2::x)
           (consp acl2::x))
      :rule-classes ((:rewrite)))

    Theorem: consp-of-sshort-list-from-integer-list

    (defthm consp-of-sshort-list-from-integer-list
      (equal (consp (sshort-list-from-integer-list acl2::x))
             (consp acl2::x))
      :rule-classes ((:rewrite)))

    Theorem: len-of-sshort-list-from-integer-list

    (defthm len-of-sshort-list-from-integer-list
      (equal (len (sshort-list-from-integer-list acl2::x))
             (len acl2::x))
      :rule-classes ((:rewrite)))

    Theorem: true-listp-of-sshort-list-from-integer-list

    (defthm true-listp-of-sshort-list-from-integer-list
      (true-listp (sshort-list-from-integer-list acl2::x))
      :rule-classes :type-prescription)

    Theorem: sshort-list-from-integer-list-when-not-consp

    (defthm sshort-list-from-integer-list-when-not-consp
      (implies (not (consp acl2::x))
               (equal (sshort-list-from-integer-list acl2::x)
                      nil))
      :rule-classes ((:rewrite)))

    Theorem: sshort-list-from-integer-list-of-cons

    (defthm sshort-list-from-integer-list-of-cons
      (equal (sshort-list-from-integer-list (cons acl2::a acl2::b))
             (cons (sshort-from-integer acl2::a)
                   (sshort-list-from-integer-list acl2::b)))
      :rule-classes ((:rewrite)))

    Theorem: sshort-list-from-integer-list-of-sshort-integer-list-fix-x

    (defthm sshort-list-from-integer-list-of-sshort-integer-list-fix-x
      (equal (sshort-list-from-integer-list (sshort-integer-list-fix x))
             (sshort-list-from-integer-list x)))

    Theorem: sshort-list-from-integer-list-sshort-integer-list-equiv-congruence-on-x

    (defthm
     sshort-list-from-integer-list-sshort-integer-list-equiv-congruence-on-x
     (implies (sshort-integer-list-equiv x x-equiv)
              (equal (sshort-list-from-integer-list x)
                     (sshort-list-from-integer-list x-equiv)))
     :rule-classes :congruence)