• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Error-checking
        • Apt
        • Abnf
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Prime-field-constraint-systems
        • Soft
        • Bv
        • Imp-language
        • Event-macros
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
          • Primitive-functions
          • Translated-terms
          • Values
          • Evaluation
          • Program-equivalence
          • Functions
          • Packages
          • Programs
            • Program
              • Program-fix
                • Program-equiv
                • Make-program
                • Program->functions
                • Programp
                • Program->packages
                • Change-program
              • Lift-program
            • Interpreter
            • Evaluation-states
          • Prime-fields
          • Java
          • C
          • Syntheto
          • Number-theory
          • Cryptography
          • Lists-light
          • File-io-light
          • Json
          • Built-ins
          • Solidity
          • Axe
          • Std-extensions
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Execloader
        • Axe
      • Testing-utilities
      • Math
    • Program

    Program-fix

    Fixing function for program structures.

    Signature
    (program-fix x) → new-x
    Arguments
    x — Guard (programp x).
    Returns
    new-x — Type (programp new-x).

    Definitions and Theorems

    Function: program-fix$inline

    (defun
     program-fix$inline (x)
     (declare (xargs :guard (programp x)))
     (let
      ((__function__ 'program-fix))
      (declare (ignorable __function__))
      (mbe :logic (b* ((packages (package-list-fix (std::da-nth 0 x)))
                       (functions (function-set-fix (std::da-nth 1 x))))
                      (list packages functions))
           :exec x)))

    Theorem: programp-of-program-fix

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

    Theorem: program-fix-when-programp

    (defthm program-fix-when-programp
            (implies (programp x)
                     (equal (program-fix x) x)))

    Function: program-equiv$inline

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

    Theorem: program-equiv-is-an-equivalence

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

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

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

    Theorem: program-fix-under-program-equiv

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

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

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

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

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

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

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

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

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