• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
        • C
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
          • Atj
          • Aij
          • Language
            • Syntax
              • Grammar
              • Unicode-escapes
              • Unicode-input-char
              • Escape-sequence
              • Identifiers
              • Primitive-types
              • Reference-types
              • Unicode-characters
              • Keywords
              • Integer-literals
              • String-literals
              • Octal-digits
              • Hexadecimal-digits
              • Decimal-digits
              • Binary-digits
                • Bin-digit
                • Binary-digits-grammar-validation
                  • Grammar-bin-digitp
                  • Bin-digitp-when-grammar-bin-digitp
                  • Bin-digit-tree
                    • Grammar-bin-digitp-when-bin-digitp
                    • Bin-digitp-is-grammar-bin-digitp
                  • Bin-digit-value
                  • Bin-digit-list
                  • Binary-digits-std/strings-theorems
                • Character-literals
                • Null-literal
                • Floating-point-literals
                • Boolean-literals
                • Package-names
                • Literals
              • Semantics
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Binary-digits-grammar-validation

    Bin-digit-tree

    Tree for a binary digit.

    Signature
    (bin-digit-tree digit) → tree
    Arguments
    digit — Guard (bin-digitp digit).
    Returns
    tree — Type (abnf-tree-with-root-p tree "binary-digit").

    This is used in grammar-bin-digitp-when-bin-digitp.

    Definitions and Theorems

    Function: bin-digit-tree

    (defun bin-digit-tree (digit)
     (declare (xargs :guard (bin-digitp digit)))
     (let ((__function__ 'bin-digit-tree))
      (declare (ignorable __function__))
      (abnf::tree-nonleaf
       (abnf::rulename "binary-digit")
       (list
           (list (abnf::tree-leafterm (list (bin-digit-fix digit))))))))

    Theorem: return-type-of-bin-digit-tree

    (defthm return-type-of-bin-digit-tree
      (b* ((tree (bin-digit-tree digit)))
        (abnf-tree-with-root-p tree "binary-digit"))
      :rule-classes :rewrite)

    Theorem: tree->string-of-bin-digit-tree

    (defthm tree->string-of-bin-digit-tree
      (equal (abnf::tree->string (bin-digit-tree digit))
             (list (bin-digit-fix digit))))

    Theorem: bin-digit-tree-of-bin-digit-fix-digit

    (defthm bin-digit-tree-of-bin-digit-fix-digit
      (equal (bin-digit-tree (bin-digit-fix digit))
             (bin-digit-tree digit)))

    Theorem: bin-digit-tree-bin-digit-equiv-congruence-on-digit

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