• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Pfcs
      • Wp-gen
      • Dimacs-reader
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • 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
                • Bin-digitp
                • Bin-digit-fix
              • 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
      • Taspi
      • Riscv
      • Bitcoin
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
      • Zcash
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Poseidon
      • Where-do-i-place-my-book
      • Axe
      • Aleo
      • Bigmems
      • Builtins
      • Execloader
      • Solidity
      • Paco
      • Concurrent-programs
      • Bls12-377-curves
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Binary-digits

Bin-digit

Fixtype of Java binary digits [JLS14:3.10.1].

A Java binary digit is one of the Java ASCII characters `0' and `1'. See the grammar rule binary-digit.

This is a type introduced by fty::deffixtype.

Definitions and Theorems

Function: bin-digitp

(defun bin-digitp (x)
  (declare (xargs :guard t))
  (let ((__function__ 'bin-digitp))
    (declare (ignorable __function__))
    (or (eql x (char-code #\0))
        (eql x (char-code #\1)))))

Theorem: booleanp-of-bin-digitp

(defthm booleanp-of-bin-digitp
  (b* ((yes/no (bin-digitp x)))
    (booleanp yes/no))
  :rule-classes :rewrite)

Function: bin-digit-fix

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

Theorem: bin-digitp-of-bin-digit-fix

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

Theorem: bin-digit-fix-when-bin-digitp

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

Function: bin-digit-equiv$inline

(defun bin-digit-equiv$inline (acl2::x acl2::y)
  (declare (xargs :guard (and (bin-digitp acl2::x)
                              (bin-digitp acl2::y))))
  (equal (bin-digit-fix acl2::x)
         (bin-digit-fix acl2::y)))

Theorem: bin-digit-equiv-is-an-equivalence

(defthm bin-digit-equiv-is-an-equivalence
  (and (booleanp (bin-digit-equiv x y))
       (bin-digit-equiv x x)
       (implies (bin-digit-equiv x y)
                (bin-digit-equiv y x))
       (implies (and (bin-digit-equiv x y)
                     (bin-digit-equiv y z))
                (bin-digit-equiv x z)))
  :rule-classes (:equivalence))

Theorem: bin-digit-equiv-implies-equal-bin-digit-fix-1

(defthm bin-digit-equiv-implies-equal-bin-digit-fix-1
  (implies (bin-digit-equiv acl2::x x-equiv)
           (equal (bin-digit-fix acl2::x)
                  (bin-digit-fix x-equiv)))
  :rule-classes (:congruence))

Theorem: bin-digit-fix-under-bin-digit-equiv

(defthm bin-digit-fix-under-bin-digit-equiv
  (bin-digit-equiv (bin-digit-fix acl2::x)
                   acl2::x)
  :rule-classes (:rewrite :rewrite-quoted-constant))

Theorem: equal-of-bin-digit-fix-1-forward-to-bin-digit-equiv

(defthm equal-of-bin-digit-fix-1-forward-to-bin-digit-equiv
  (implies (equal (bin-digit-fix acl2::x) acl2::y)
           (bin-digit-equiv acl2::x acl2::y))
  :rule-classes :forward-chaining)

Theorem: equal-of-bin-digit-fix-2-forward-to-bin-digit-equiv

(defthm equal-of-bin-digit-fix-2-forward-to-bin-digit-equiv
  (implies (equal acl2::x (bin-digit-fix acl2::y))
           (bin-digit-equiv acl2::x acl2::y))
  :rule-classes :forward-chaining)

Theorem: bin-digit-equiv-of-bin-digit-fix-1-forward

(defthm bin-digit-equiv-of-bin-digit-fix-1-forward
  (implies (bin-digit-equiv (bin-digit-fix acl2::x)
                            acl2::y)
           (bin-digit-equiv acl2::x acl2::y))
  :rule-classes :forward-chaining)

Theorem: bin-digit-equiv-of-bin-digit-fix-2-forward

(defthm bin-digit-equiv-of-bin-digit-fix-2-forward
  (implies (bin-digit-equiv acl2::x (bin-digit-fix acl2::y))
           (bin-digit-equiv acl2::x acl2::y))
  :rule-classes :forward-chaining)

Subtopics

Bin-digitp
Recognizer for bin-digit.
Bin-digit-fix
Fixer for bin-digit.