• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
          • Primitive-functions
          • Translated-terms
          • Values
          • Evaluation
          • Program-equivalence
          • Functions
          • Packages
            • Lift-package-list
            • Import-lookup
            • Package-option
            • Package-lookup
            • Package
              • Package-fix
                • Package-equiv
                • Make-package
                • Package->imports
                • Change-package
                • Package->name
                • Packagep
              • Lift-package
              • Package-list
            • Programs
            • Interpreter
            • Evaluation-states
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Package

    Package-fix

    Fixing function for package structures.

    Signature
    (package-fix x) → new-x
    Arguments
    x — Guard (packagep x).
    Returns
    new-x — Type (packagep new-x).

    Definitions and Theorems

    Function: package-fix$inline

    (defun package-fix$inline (x)
      (declare (xargs :guard (packagep x)))
      (let ((__function__ 'package-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((name (str-fix (std::da-nth 0 x)))
                  (imports (symbol-value-list-fix (std::da-nth 1 x))))
               (list name imports))
             :exec x)))

    Theorem: packagep-of-package-fix

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

    Theorem: package-fix-when-packagep

    (defthm package-fix-when-packagep
      (implies (packagep x)
               (equal (package-fix x) x)))

    Function: package-equiv$inline

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

    Theorem: package-equiv-is-an-equivalence

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

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

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

    Theorem: package-fix-under-package-equiv

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

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

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

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

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

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

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

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

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