• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
        • Atj
        • Aij
        • Language
          • Syntax
          • Semantics
            • Primitive-function-macros
            • Primitive-values
            • Floating-point-placeholders
            • Pointers
            • Floating-point-value-set-parameters
            • Values
            • Primitive-operations
              • Integer-operations
              • Floating-point-operations
              • Boolean-operations
                • Boolean-xor
                • Boolean-neq
                • Boolean-ior
                • Boolean-eq
                  • Boolean-and
                  • Boolean-not
              • Primitive-conversions
              • Reference-values
        • 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
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Boolean-operations

    Boolean-eq

    Equality == on booleans [JLS14:4.2.5] [JLS14:15.21.2].

    Signature
    (boolean-eq operand-left operand-right) → result
    Arguments
    operand-left — Guard (boolean-valuep operand-left).
    operand-right — Guard (boolean-valuep operand-right).
    Returns
    result — Type (boolean-valuep result).

    Definitions and Theorems

    Function: boolean-eq

    (defun boolean-eq (operand-left operand-right)
      (declare (xargs :guard (and (boolean-valuep operand-left)
                                  (boolean-valuep operand-right))))
      (b* ((x (boolean-value->bool operand-left))
           (y (boolean-value->bool operand-right)))
        (boolean-value (equal x y))))

    Theorem: boolean-valuep-of-boolean-eq

    (defthm boolean-valuep-of-boolean-eq
      (b* ((result (boolean-eq operand-left operand-right)))
        (boolean-valuep result))
      :rule-classes :rewrite)

    Theorem: boolean-eq-commutative

    (defthm boolean-eq-commutative
      (equal (boolean-eq x y)
             (boolean-eq y x)))

    Theorem: boolean-eq-of-boolean-value-fix-operand-left

    (defthm boolean-eq-of-boolean-value-fix-operand-left
      (equal (boolean-eq (boolean-value-fix operand-left)
                         operand-right)
             (boolean-eq operand-left operand-right)))

    Theorem: boolean-eq-boolean-value-equiv-congruence-on-operand-left

    (defthm boolean-eq-boolean-value-equiv-congruence-on-operand-left
      (implies (boolean-value-equiv operand-left operand-left-equiv)
               (equal (boolean-eq operand-left operand-right)
                      (boolean-eq operand-left-equiv operand-right)))
      :rule-classes :congruence)

    Theorem: boolean-eq-of-boolean-value-fix-operand-right

    (defthm boolean-eq-of-boolean-value-fix-operand-right
      (equal (boolean-eq operand-left
                         (boolean-value-fix operand-right))
             (boolean-eq operand-left operand-right)))

    Theorem: boolean-eq-boolean-value-equiv-congruence-on-operand-right

    (defthm boolean-eq-boolean-value-equiv-congruence-on-operand-right
      (implies (boolean-value-equiv operand-right operand-right-equiv)
               (equal (boolean-eq operand-left operand-right)
                      (boolean-eq operand-left operand-right-equiv)))
      :rule-classes :congruence)