• 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
        • Bv
        • Imp-language
        • Event-macros
        • Java
          • Atj
          • Aij
          • Language
            • Syntax
              • Grammar
              • Unicode-escapes
              • Unicode-input-char
              • Escape-sequence
              • Identifiers
              • Primitive-types
              • Reference-types
              • Keywords
              • Unicode-characters
              • Integer-literals
              • String-literals
              • Octal-digits
                • Oct-digit
                • Octal-digits-grammar-validation
                • Oct-digit-value
                  • Oct-digit-list
                  • Octal-digits-std/strings-theorems
                • Hexadecimal-digits
                • Decimal-digits
                • Binary-digits
                • Character-literals
                • Null-literal
                • Floating-point-literals
                • Boolean-literals
                • Package-names
                • Literals
              • Semantics
          • 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
    • Octal-digits

    Oct-digit-value

    Numeric value of a Java octal digit.

    Signature
    (oct-digit-value x) → val
    Arguments
    x — Guard (oct-digitp x).
    Returns
    val — Type (natp val).

    Definitions and Theorems

    Function: oct-digit-value

    (defun oct-digit-value (x)
      (declare (xargs :guard (oct-digitp x)))
      (let ((__function__ 'oct-digit-value))
        (declare (ignorable __function__))
        (b* ((x (mbe :logic (oct-digit-fix x) :exec x)))
          (- x (char-code #\0)))))

    Theorem: natp-of-oct-digit-value

    (defthm natp-of-oct-digit-value
      (b* ((val (oct-digit-value x)))
        (natp val))
      :rule-classes (:rewrite :type-prescription))

    Theorem: oct-digit-value-upper-bound

    (defthm oct-digit-value-upper-bound
      (b* ((?val (oct-digit-value x)))
        (<= val 7))
      :rule-classes :linear)

    Theorem: oct-digit-value-of-oct-digit-fix-x

    (defthm oct-digit-value-of-oct-digit-fix-x
      (equal (oct-digit-value (oct-digit-fix x))
             (oct-digit-value x)))

    Theorem: oct-digit-value-oct-digit-equiv-congruence-on-x

    (defthm oct-digit-value-oct-digit-equiv-congruence-on-x
      (implies (oct-digit-equiv x x-equiv)
               (equal (oct-digit-value x)
                      (oct-digit-value x-equiv)))
      :rule-classes :congruence)