• 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
            • 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
            • 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-integer-conversions

    Integer-conversions-signed-from-unsigned-okp

    Theorems about certain conversions from unsigned to signed being always allowed for certain integer type sizes.

    We prove these theorems in a general way, with hypotheses on the integer type sizes, disabling the rules that may otherwise obviate the hypotheses.

    Definitions and Theorems

    Theorem: sint-from-uchar-okp-when-uchar-max-<=-sint-max

    (defthm sint-from-uchar-okp-when-uchar-max-<=-sint-max
      (implies (<= (uchar-max) (sint-max))
               (sint-from-uchar-okp x)))

    Theorem: sint-from-ushort-okp-when-ushort-max-<=-sint-max

    (defthm sint-from-ushort-okp-when-ushort-max-<=-sint-max
      (implies (<= (ushort-max) (sint-max))
               (sint-from-ushort-okp x)))

    Theorem: slong-from-uchar-okp-when-uchar-max-<=slong-max

    (defthm slong-from-uchar-okp-when-uchar-max-<=slong-max
      (implies (<= (uchar-max) (slong-max))
               (slong-from-uchar-okp x)))

    Theorem: slong-from-ushort-okp-when-ushort-max-<=slong-max

    (defthm slong-from-ushort-okp-when-ushort-max-<=slong-max
      (implies (<= (ushort-max) (slong-max))
               (slong-from-ushort-okp x)))

    Theorem: slong-from-uint-okp-when-uint-max-<=slong-max

    (defthm slong-from-uint-okp-when-uint-max-<=slong-max
      (implies (<= (uint-max) (slong-max))
               (slong-from-uint-okp x)))

    Theorem: sllong-from-uchar-okp-when-uchar-max-<=sllong-max

    (defthm sllong-from-uchar-okp-when-uchar-max-<=sllong-max
      (implies (<= (uchar-max) (sllong-max))
               (sllong-from-uchar-okp x)))

    Theorem: sllong-from-ushort-okp-when-ushort-max-<=sllong-max

    (defthm sllong-from-ushort-okp-when-ushort-max-<=sllong-max
      (implies (<= (ushort-max) (sllong-max))
               (sllong-from-ushort-okp x)))

    Theorem: sllong-from-uint-okp-when-uint-max-<=sllong-max

    (defthm sllong-from-uint-okp-when-uint-max-<=sllong-max
      (implies (<= (uint-max) (sllong-max))
               (sllong-from-uint-okp x)))

    Theorem: sllong-from-ulong-okp-when-ulong-max-<=sllong-max

    (defthm sllong-from-ulong-okp-when-ulong-max-<=sllong-max
      (implies (<= (ulong-max) (sllong-max))
               (sllong-from-ulong-okp x)))