• 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
              • Hexadecimal-digits
              • Decimal-digits
              • Binary-digits
                • Bin-digit
                • Binary-digits-grammar-validation
                • Bin-digit-value
                  • Bin-digit-list
                  • Binary-digits-std/strings-theorems
                • 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
    • Binary-digits

    Bin-digit-value

    Numeric value of a Java binary digit.

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

    Definitions and Theorems

    Function: bin-digit-value

    (defun bin-digit-value (x)
      (declare (xargs :guard (bin-digitp x)))
      (let ((__function__ 'bin-digit-value))
        (declare (ignorable __function__))
        (if (eql (bin-digit-fix x) (char-code #\0))
            0
          1)))

    Theorem: bitp-of-bin-digit-value

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

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

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

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

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