• 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
      • Riscv
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • 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
        • Aleobft
          • Correctness
          • Definition
            • Initialization
            • Transitions
            • States
              • Committees
              • System-states
              • Certificates
              • Messages
              • Transactions
              • Proposals
              • Validator-states
              • Blocks
                • Blocks-last-round
                • Blocks-orderedp
                • Block
                • Block-list
                  • Block-list-fix
                    • Block-list-equiv
                    • Block-listp
                • Addresses
              • Events
              • Reachability
            • Library-extensions
          • Aleovm
          • Leo
        • 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
    • Block-list

    Block-list-fix

    (block-list-fix x) is a usual ACL2::fty list fixing function.

    Signature
    (block-list-fix x) → fty::newx
    Arguments
    x — Guard (block-listp x).
    Returns
    fty::newx — Type (block-listp fty::newx).

    In the logic, we apply block-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.

    Definitions and Theorems

    Function: block-list-fix$inline

    (defun block-list-fix$inline (x)
      (declare (xargs :guard (block-listp x)))
      (let ((__function__ 'block-list-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (if (atom x)
                 nil
               (cons (block-fix (car x))
                     (block-list-fix (cdr x))))
             :exec x)))

    Theorem: block-listp-of-block-list-fix

    (defthm block-listp-of-block-list-fix
      (b* ((fty::newx (block-list-fix$inline x)))
        (block-listp fty::newx))
      :rule-classes :rewrite)

    Theorem: block-list-fix-when-block-listp

    (defthm block-list-fix-when-block-listp
      (implies (block-listp x)
               (equal (block-list-fix x) x)))

    Function: block-list-equiv$inline

    (defun block-list-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (block-listp acl2::x)
                                  (block-listp acl2::y))))
      (equal (block-list-fix acl2::x)
             (block-list-fix acl2::y)))

    Theorem: block-list-equiv-is-an-equivalence

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

    Theorem: block-list-equiv-implies-equal-block-list-fix-1

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

    Theorem: block-list-fix-under-block-list-equiv

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

    Theorem: equal-of-block-list-fix-1-forward-to-block-list-equiv

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

    Theorem: equal-of-block-list-fix-2-forward-to-block-list-equiv

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

    Theorem: block-list-equiv-of-block-list-fix-1-forward

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

    Theorem: block-list-equiv-of-block-list-fix-2-forward

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

    Theorem: car-of-block-list-fix-x-under-block-equiv

    (defthm car-of-block-list-fix-x-under-block-equiv
      (block-equiv (car (block-list-fix acl2::x))
                   (car acl2::x)))

    Theorem: car-block-list-equiv-congruence-on-x-under-block-equiv

    (defthm car-block-list-equiv-congruence-on-x-under-block-equiv
      (implies (block-list-equiv acl2::x x-equiv)
               (block-equiv (car acl2::x)
                            (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-block-list-fix-x-under-block-list-equiv

    (defthm cdr-of-block-list-fix-x-under-block-list-equiv
      (block-list-equiv (cdr (block-list-fix acl2::x))
                        (cdr acl2::x)))

    Theorem: cdr-block-list-equiv-congruence-on-x-under-block-list-equiv

    (defthm cdr-block-list-equiv-congruence-on-x-under-block-list-equiv
      (implies (block-list-equiv acl2::x x-equiv)
               (block-list-equiv (cdr acl2::x)
                                 (cdr x-equiv)))
      :rule-classes :congruence)

    Theorem: cons-of-block-fix-x-under-block-list-equiv

    (defthm cons-of-block-fix-x-under-block-list-equiv
      (block-list-equiv (cons (block-fix acl2::x) acl2::y)
                        (cons acl2::x acl2::y)))

    Theorem: cons-block-equiv-congruence-on-x-under-block-list-equiv

    (defthm cons-block-equiv-congruence-on-x-under-block-list-equiv
      (implies (block-equiv acl2::x x-equiv)
               (block-list-equiv (cons acl2::x acl2::y)
                                 (cons x-equiv acl2::y)))
      :rule-classes :congruence)

    Theorem: cons-of-block-list-fix-y-under-block-list-equiv

    (defthm cons-of-block-list-fix-y-under-block-list-equiv
      (block-list-equiv (cons acl2::x (block-list-fix acl2::y))
                        (cons acl2::x acl2::y)))

    Theorem: cons-block-list-equiv-congruence-on-y-under-block-list-equiv

    (defthm cons-block-list-equiv-congruence-on-y-under-block-list-equiv
      (implies (block-list-equiv acl2::y y-equiv)
               (block-list-equiv (cons acl2::x acl2::y)
                                 (cons acl2::x y-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-block-list-fix

    (defthm consp-of-block-list-fix
      (equal (consp (block-list-fix acl2::x))
             (consp acl2::x)))

    Theorem: block-list-fix-under-iff

    (defthm block-list-fix-under-iff
      (iff (block-list-fix acl2::x)
           (consp acl2::x)))

    Theorem: block-list-fix-of-cons

    (defthm block-list-fix-of-cons
      (equal (block-list-fix (cons a x))
             (cons (block-fix a)
                   (block-list-fix x))))

    Theorem: len-of-block-list-fix

    (defthm len-of-block-list-fix
      (equal (len (block-list-fix acl2::x))
             (len acl2::x)))

    Theorem: block-list-fix-of-append

    (defthm block-list-fix-of-append
      (equal (block-list-fix (append std::a std::b))
             (append (block-list-fix std::a)
                     (block-list-fix std::b))))

    Theorem: block-list-fix-of-repeat

    (defthm block-list-fix-of-repeat
      (equal (block-list-fix (repeat acl2::n acl2::x))
             (repeat acl2::n (block-fix acl2::x))))

    Theorem: list-equiv-refines-block-list-equiv

    (defthm list-equiv-refines-block-list-equiv
      (implies (list-equiv acl2::x acl2::y)
               (block-list-equiv acl2::x acl2::y))
      :rule-classes :refinement)

    Theorem: nth-of-block-list-fix

    (defthm nth-of-block-list-fix
      (equal (nth acl2::n (block-list-fix acl2::x))
             (if (< (nfix acl2::n) (len acl2::x))
                 (block-fix (nth acl2::n acl2::x))
               nil)))

    Theorem: block-list-equiv-implies-block-list-equiv-append-1

    (defthm block-list-equiv-implies-block-list-equiv-append-1
      (implies (block-list-equiv acl2::x fty::x-equiv)
               (block-list-equiv (append acl2::x acl2::y)
                                 (append fty::x-equiv acl2::y)))
      :rule-classes (:congruence))

    Theorem: block-list-equiv-implies-block-list-equiv-append-2

    (defthm block-list-equiv-implies-block-list-equiv-append-2
      (implies (block-list-equiv acl2::y fty::y-equiv)
               (block-list-equiv (append acl2::x acl2::y)
                                 (append acl2::x fty::y-equiv)))
      :rule-classes (:congruence))

    Theorem: block-list-equiv-implies-block-list-equiv-nthcdr-2

    (defthm block-list-equiv-implies-block-list-equiv-nthcdr-2
      (implies (block-list-equiv acl2::l l-equiv)
               (block-list-equiv (nthcdr acl2::n acl2::l)
                                 (nthcdr acl2::n l-equiv)))
      :rule-classes (:congruence))

    Theorem: block-list-equiv-implies-block-list-equiv-take-2

    (defthm block-list-equiv-implies-block-list-equiv-take-2
      (implies (block-list-equiv acl2::l l-equiv)
               (block-list-equiv (take acl2::n acl2::l)
                                 (take acl2::n l-equiv)))
      :rule-classes (:congruence))