• 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
      • Taspi
      • Bitcoin
      • Riscv
      • 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
      • Bigmems
      • Builtins
      • Execloader
      • Aleo
      • Solidity
        • Values
          • Integer-values
          • Boolean-values
            • Bool
              • Boolp
              • Bool-fix
                • Bool-equiv
                • Make-bool
                • Change-bool
                • Bool->get
              • Boolean-operations
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Bool

    Bool-fix

    Fixing function for bool structures.

    Signature
    (bool-fix x) → new-x
    Arguments
    x — Guard (boolp x).
    Returns
    new-x — Type (boolp new-x).

    Definitions and Theorems

    Function: bool-fix$inline

    (defun bool-fix$inline (x)
      (declare (xargs :guard (boolp x)))
      (let ((__function__ 'bool-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((get (acl2::bool-fix (std::da-nth 0 (cdr x)))))
               (cons :bool (list get)))
             :exec x)))

    Theorem: boolp-of-bool-fix

    (defthm boolp-of-bool-fix
      (b* ((new-x (bool-fix$inline x)))
        (boolp new-x))
      :rule-classes :rewrite)

    Theorem: bool-fix-when-boolp

    (defthm bool-fix-when-boolp
      (implies (boolp x)
               (equal (bool-fix x) x)))

    Function: bool-equiv$inline

    (defun bool-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (boolp acl2::x) (boolp acl2::y))))
      (equal (bool-fix acl2::x)
             (bool-fix acl2::y)))

    Theorem: bool-equiv-is-an-equivalence

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

    Theorem: bool-equiv-implies-equal-bool-fix-1

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

    Theorem: bool-fix-under-bool-equiv

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

    Theorem: equal-of-bool-fix-1-forward-to-bool-equiv

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

    Theorem: equal-of-bool-fix-2-forward-to-bool-equiv

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

    Theorem: bool-equiv-of-bool-fix-1-forward

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

    Theorem: bool-equiv-of-bool-fix-2-forward

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