• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
          • Syntax-for-tools
          • Atc
          • Language
          • Representation
            • Representation-of-integer-operations
            • Atc-arrays
            • Representation-of-integers
            • Representation-of-integer-conversions
              • Def-integer-conversion
              • Integer-conversions-signed-from-unsigned-okp
              • Def-integer-conversions-loop-outer
              • Def-integer-conversions-loop-inner
              • Sshort-from-ullong-okp
              • Sllong-from-ushort-okp
              • Sllong-from-ullong-okp
              • Sshort-from-ushort-okp
              • Sshort-from-ulong-okp
              • Sshort-from-uint-okp
              • Sshort-from-uchar-okp
              • Sshort-from-slong-okp
              • Sshort-from-sllong-okp
              • Sshort-from-sint-okp
              • Slong-from-ushort-okp
              • Slong-from-ulong-okp
              • Slong-from-ullong-okp
              • Slong-from-uint-okp
              • Slong-from-uchar-okp
              • Slong-from-sllong-okp
              • Sllong-from-ulong-okp
              • Sllong-from-uint-okp
              • Sllong-from-uchar-okp
              • Sint-from-ushort-okp
              • Sint-from-ulong-okp
              • Sint-from-ullong-okp
              • Sint-from-uchar-okp
              • Sint-from-slong-okp
              • Sint-from-sllong-okp
              • Schar-from-ushort-okp
              • Schar-from-ulong-okp
              • Schar-from-ullong-okp
              • Schar-from-uint-okp
              • Schar-from-uchar-okp
              • Schar-from-sshort-okp
              • Schar-from-slong-okp
              • Schar-from-sllong-okp
              • Schar-from-sint-okp
              • Ushort-from-ulong
              • Ushort-from-ullong
              • Ushort-from-uint
              • Ushort-from-uchar
                • Ushort-from-sshort
                • Ushort-from-slong
                • Ushort-from-sllong
                • Ushort-from-sint
                • Ushort-from-schar
                • Ulong-from-ushort
                • Ulong-from-ullong
                • Ulong-from-uchar
                • Ulong-from-sshort
                • Ulong-from-slong
                • Ulong-from-sllong
                • Ulong-from-schar
                • Ullong-from-ushort
                • Ullong-from-ulong
                • Ullong-from-uint
                • Ullong-from-uchar
                • Ullong-from-sshort
                • Ullong-from-slong
                • Ullong-from-sllong
                • Ullong-from-sint
                • Ullong-from-schar
                • Uint-from-ushort
                • Uint-from-ullong
                • Uint-from-sshort
                • Uint-from-sllong
                • Uchar-from-ushort
                • Uchar-from-ulong
                • Uchar-from-ullong
                • Uchar-from-sshort
                • Uchar-from-slong
                • Uchar-from-sllong
                • Uchar-from-schar
                • Sshort-from-ushort
                • Sshort-from-ulong
                • Sshort-from-ullong
                • Sshort-from-uint
                • Sshort-from-uchar
                • Sshort-from-slong
                • Sshort-from-sllong
                • Sshort-from-sint
                • Sshort-from-schar
                • Slong-from-ushort
                • Slong-from-ulong
                • Slong-from-ullong
                • Slong-from-uint
                • Slong-from-uchar
                • Slong-from-sshort
                • Slong-from-sllong
                • Sllong-from-ushort
                • Sllong-from-ulong
                • Sllong-from-ullong
                • Sllong-from-uint
                • Sllong-from-uchar
                • Sllong-from-sshort
                • Sllong-from-slong
                • Sllong-from-sint
                • Sllong-from-schar
                • Sint-from-ushort
                • Sint-from-ulong
                • Sint-from-ullong
                • Sint-from-uint-okp
                • Sint-from-uchar
                • Sint-from-sshort
                • Sint-from-slong
                • Sint-from-sllong
                • Schar-from-ushort
                • Schar-from-ulong
                • Schar-from-ullong
                • Schar-from-uint
                • Schar-from-uchar
                • Schar-from-sshort
                • Schar-from-slong
                • Schar-from-sllong
                • Schar-from-sint
                • Ulong-from-uint
                • Ulong-from-sint
                • Uint-from-ulong
                • Uint-from-uchar
                • Uint-from-slong
                • Uint-from-sint
                • Uint-from-schar
                • Uchar-from-uint
                • Uchar-from-sint
                • Slong-from-sint
                • Slong-from-schar
                • Sint-from-uint
                • Sint-from-schar
              • Pointed-integers
              • Shallow-deep-embedding-relation
            • Transformation-tools
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Representation-of-integer-conversions

    Ushort-from-uchar

    Convert from type unsigned char to type unsigned short.

    Signature
    (ushort-from-uchar x) → result
    Arguments
    x — Guard (ucharp x).
    Returns
    result — Type (ushortp result).

    Definitions and Theorems

    Function: ushort-from-uchar

    (defun ushort-from-uchar (x)
      (declare (xargs :guard (ucharp x)))
      (let ((__function__ 'ushort-from-uchar))
        (declare (ignorable __function__))
        (ushort-from-integer-mod (integer-from-uchar x))))

    Theorem: ushortp-of-ushort-from-uchar

    (defthm ushortp-of-ushort-from-uchar
      (b* ((result (ushort-from-uchar x)))
        (ushortp result))
      :rule-classes :rewrite)

    Theorem: ushort-from-uchar-of-uchar-fix-x

    (defthm ushort-from-uchar-of-uchar-fix-x
      (equal (ushort-from-uchar (uchar-fix x))
             (ushort-from-uchar x)))

    Theorem: ushort-from-uchar-uchar-equiv-congruence-on-x

    (defthm ushort-from-uchar-uchar-equiv-congruence-on-x
      (implies (uchar-equiv x x-equiv)
               (equal (ushort-from-uchar x)
                      (ushort-from-uchar x-equiv)))
      :rule-classes :congruence)