• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
        • Soft
        • C
          • Syntax-for-tools
            • Disambiguator
            • Abstract-syntax
            • Parser
            • Validator
            • Printer
            • Formalized-subset
            • Mapping-to-language-definition
            • Input-files
            • Defpred
            • Output-files
            • Abstract-syntax-operations
            • Validation-information
            • Implementation-environments
              • Ienv
              • Ushort-rangep
              • Ullong-rangep
              • Sshort-rangep
              • Sllong-rangep
              • Ulong-rangep
              • Uint-rangep
              • Slong-rangep
              • Sint-rangep
              • Ushort-max
              • Ulong-max
              • Ullong-max
              • Uint-max
              • Uchar-rangep
              • Sshort-min
              • Sllong-min
              • Schar-rangep
                • Char-min
                • Char-max
                • Sshort-max
                • Slong-min
                • Slong-max
                • Sllong-max
                • Sint-min
                • Sint-max
                • Uchar-max
                • Schar-min
                • Schar-max
                • Ienv-default
              • Concrete-syntax
              • Unambiguity
              • Ascii-identifiers
              • Preprocessing
              • Abstraction-mapping
            • Atc
            • Language
            • Representation
            • 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
    • Implementation-environments

    Schar-rangep

    Check if a mathematical integer is in the range of (i.e. representable in) type signed char.

    Signature
    (schar-rangep val) → yes/no
    Arguments
    val — Guard (integerp val).
    Returns
    yes/no — Type (booleanp yes/no).

    Definitions and Theorems

    Function: schar-rangep

    (defun schar-rangep (val)
      (declare (xargs :guard (integerp val)))
      (let ((__function__ 'schar-rangep))
        (declare (ignorable __function__))
        (and (<= (schar-min) (ifix val))
             (<= (ifix val) (schar-max)))))

    Theorem: booleanp-of-schar-rangep

    (defthm booleanp-of-schar-rangep
      (b* ((yes/no (schar-rangep val)))
        (booleanp yes/no))
      :rule-classes :rewrite)

    Theorem: schar-rangep-of-ifix-val

    (defthm schar-rangep-of-ifix-val
      (equal (schar-rangep (ifix val))
             (schar-rangep val)))

    Theorem: schar-rangep-int-equiv-congruence-on-val

    (defthm schar-rangep-int-equiv-congruence-on-val
      (implies (acl2::int-equiv val val-equiv)
               (equal (schar-rangep val)
                      (schar-rangep val-equiv)))
      :rule-classes :congruence)