• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
        • Syntax-for-tools
          • Formalized-subset
          • Mapping-to-language-definition
          • Input-files
          • Compilation-database
          • Printer
          • Output-files
          • Abstract-syntax-operations
          • Implementation-environments
            • Ienv
            • Ldm-ienv
            • Ienv-ushort-rangep
            • Ienv-ulong-rangep
            • Ienv-ullong-rangep
            • Ienv-uchar-rangep
            • Ienv-sshort-rangep
            • Ienv-slong-rangep
            • Ienv-sllong-rangep
            • Ienv-sint-rangep
            • Ienv-schar-rangep
            • Ienv-uint-rangep
            • Ienv-char-rangep
            • Ienv->uchar-max
            • Ienv->schar-min
            • Ienv->schar-max
              • Ienv->ushort-max
              • Ienv->ulong-max
              • Ienv->ullong-max
              • Ienv->sshort-max
              • Ienv->slong-max
              • Ienv->sllong-max
              • Ienv->uint-max
              • Ienv->sint-max
              • Ienv->sshort-min
              • Ienv->slong-min
              • Ienv->sllong-min
              • Ienv->sint-min
              • Ienv->char-min
              • Ienv->char-max
              • Ienv->std
              • Ienv->gcc
              • Ienv-default
            • Abstract-syntax
            • Concrete-syntax
            • Disambiguation
            • Validation
            • Gcc-builtins
            • Preprocessing
            • Parsing
          • Atc
          • Transformation-tools
          • Language
          • Representation
          • Insertion-sort
          • Pack
        • Proof-checker-array
        • Soft
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Ethereum
        • Leftist-trees
        • Java
        • Riscv
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Implementation-environments

    Ienv->schar-max

    The ACL2 integer value of SCHAR_MAX [C17:5.2.4.2.1/1].

    Signature
    (ienv->schar-max ienv) → max
    Arguments
    ienv — Guard (ienvp ienv).
    Returns
    max — Type (posp max).

    Although this currently does not depend on the implementation environment, we make that an input to this function for uniformity and extensibility.

    Definitions and Theorems

    Function: ienv->schar-max

    (defun ienv->schar-max (ienv)
     (declare (xargs :guard (ienvp ienv)))
     (declare (ignore ienv))
     (declare
          (xargs :type-prescription (and (posp (ienv->schar-max ienv))
                                         (> (ienv->schar-max ienv) 1))))
     127)

    Theorem: posp-of-ienv->schar-max

    (defthm posp-of-ienv->schar-max
      (b* ((max (ienv->schar-max ienv)))
        (posp max))
      :rule-classes :rewrite)

    Theorem: ienv->schar-max-correct

    (defthm ienv->schar-max-correct
      (equal (ienv->schar-max ienv)
             (c::ienv->schar-max (ldm-ienv ienv))))

    Theorem: ienv->schar-max-of-ienv-fix-ienv

    (defthm ienv->schar-max-of-ienv-fix-ienv
      (equal (ienv->schar-max (ienv-fix ienv))
             (ienv->schar-max ienv)))

    Theorem: ienv->schar-max-ienv-equiv-congruence-on-ienv

    (defthm ienv->schar-max-ienv-equiv-congruence-on-ienv
      (implies (ienv-equiv ienv ienv-equiv)
               (equal (ienv->schar-max ienv)
                      (ienv->schar-max ienv-equiv)))
      :rule-classes :congruence)