• 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
      • Sidekick
      • Leftist-trees
      • Java
      • Riscv
      • 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
        • Aleovm
        • Leo
          • Grammar
          • Early-version
            • Json2ast
            • Testing
            • Definition
              • Flattening
              • Abstract-syntax
                • Expression
                • Syntax-abstraction
                • Statement
                • Files
                • Input-files
                • Identifiers
                • Types
                • Struct-init
                • Branch
                • Statements
                • Format-strings
                • Input-syntax-abstraction
                • Expressions
                • Output-files
                • Addresses
                • Literals
                • Characters
                • Expression-list
                • Statement-list
                • Output-syntax-abstraction
                • Struct-init-list
                • Branch-list
                • Annotations
                • Abstract-syntax-trees
                • Symbols
                • Keywords
                • Programs
                • Packages
                  • Package
                    • Package-fix
                      • Package-equiv
                      • Make-package
                      • Package->file
                      • Change-package
                      • Packagep
                  • Bit-sizes
                • Dynamic-semantics
                • Compilation
                • Static-semantics
                • Concrete-syntax
        • 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
    • 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* ((file (file-fix (cdr (std::da-nth 0 (cdr x))))))
               (cons :package (list (cons 'file file))))
             :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)