• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
        • Atj
        • Aij
        • Language
          • Syntax
          • Semantics
            • Primitive-function-macros
            • Primitive-values
            • Floating-point-placeholders
            • Pointers
              • Pointerp
              • Pointer
              • New-pointer
              • Pointer-list
                • Pointer-list-fix
                  • Pointer-list-equiv
                  • Pointer-listp
              • Floating-point-value-set-parameters
              • Values
              • Primitive-operations
              • Primitive-conversions
              • Reference-values
        • Riscv
        • Taspi
        • Bitcoin
        • Zcash
        • Des
        • X86isa
        • Sha-2
        • Yul
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Axe
        • Poseidon
        • Where-do-i-place-my-book
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Pointer-list

    Pointer-list-fix

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

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

    In the logic, we apply pointer-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: pointer-list-fix$inline

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

    Theorem: pointer-listp-of-pointer-list-fix

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

    Theorem: pointer-list-fix-when-pointer-listp

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

    Function: pointer-list-equiv$inline

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

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

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

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

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

    Theorem: pointer-list-fix-under-pointer-list-equiv

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Theorem: consp-of-pointer-list-fix

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

    Theorem: pointer-list-fix-under-iff

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

    Theorem: pointer-list-fix-of-cons

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

    Theorem: len-of-pointer-list-fix

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

    Theorem: pointer-list-fix-of-append

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

    Theorem: pointer-list-fix-of-repeat

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

    Theorem: list-equiv-refines-pointer-list-equiv

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

    Theorem: nth-of-pointer-list-fix

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

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

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

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

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

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

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

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

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