• 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
        • Semantics
        • Abstract-syntax
          • Aexp
          • Bexp
            • Bexp-case
            • Bexp-fix
              • Bexpp
              • Bexp-count
              • Bexp-equiv
              • Bexp-less
              • Bexp-equal
              • Bexp-and
              • Bexp-const
              • Bexp-not
              • Bexp-kind
            • Comm
            • Comm-list
            • Command-fixtypes
          • Interpreter
        • 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
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Bexp

    Bexp-fix

    Fixing function for bexp structures.

    Signature
    (bexp-fix x) → new-x
    Arguments
    x — Guard (bexpp x).
    Returns
    new-x — Type (bexpp new-x).

    Definitions and Theorems

    Function: bexp-fix$inline

    (defun bexp-fix$inline (x)
     (declare (xargs :guard (bexpp x)))
     (let ((__function__ 'bexp-fix))
      (declare (ignorable __function__))
      (mbe
        :logic
        (case (bexp-kind x)
          (:const (b* ((value (acl2::bool-fix (std::da-nth 0 (cdr x)))))
                    (cons :const (list value))))
          (:equal (b* ((left (aexp-fix (std::da-nth 0 (cdr x))))
                       (right (aexp-fix (std::da-nth 1 (cdr x)))))
                    (cons :equal (list left right))))
          (:less (b* ((left (aexp-fix (std::da-nth 0 (cdr x))))
                      (right (aexp-fix (std::da-nth 1 (cdr x)))))
                   (cons :less (list left right))))
          (:not (b* ((arg (bexp-fix (std::da-nth 0 (cdr x)))))
                  (cons :not (list arg))))
          (:and (b* ((left (bexp-fix (std::da-nth 0 (cdr x))))
                     (right (bexp-fix (std::da-nth 1 (cdr x)))))
                  (cons :and (list left right)))))
        :exec x)))

    Theorem: bexpp-of-bexp-fix

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

    Theorem: bexp-fix-when-bexpp

    (defthm bexp-fix-when-bexpp
      (implies (bexpp x)
               (equal (bexp-fix x) x)))

    Function: bexp-equiv$inline

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

    Theorem: bexp-equiv-is-an-equivalence

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

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

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

    Theorem: bexp-fix-under-bexp-equiv

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

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

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

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

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

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

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

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

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

    Theorem: bexp-kind$inline-of-bexp-fix-x

    (defthm bexp-kind$inline-of-bexp-fix-x
      (equal (bexp-kind$inline (bexp-fix x))
             (bexp-kind$inline x)))

    Theorem: bexp-kind$inline-bexp-equiv-congruence-on-x

    (defthm bexp-kind$inline-bexp-equiv-congruence-on-x
      (implies (bexp-equiv x x-equiv)
               (equal (bexp-kind$inline x)
                      (bexp-kind$inline x-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-bexp-fix

    (defthm consp-of-bexp-fix
      (consp (bexp-fix x))
      :rule-classes :type-prescription)