• 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
                  • Oct-digitp
                  • Oct-digit-fix
                  • 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
    • Oct-digit

    Oct-digit-fix

    Fixer for oct-digit.

    Signature
    (oct-digit-fix x) → fixed-x
    Arguments
    x — Guard (oct-digitp x).
    Returns
    fixed-x — Type (oct-digitp fixed-x).

    Definitions and Theorems

    Function: oct-digit-fix

    (defun oct-digit-fix (x)
      (declare (xargs :guard (oct-digitp x)))
      (mbe :logic (if (oct-digitp x) x (char-code #\0))
           :exec x))

    Theorem: oct-digitp-of-oct-digit-fix

    (defthm oct-digitp-of-oct-digit-fix
      (b* ((fixed-x (oct-digit-fix x)))
        (oct-digitp fixed-x))
      :rule-classes :rewrite)

    Theorem: oct-digit-fix-when-oct-digitp

    (defthm oct-digit-fix-when-oct-digitp
      (implies (oct-digitp x)
               (equal (oct-digit-fix x) x)))