• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
        • Z3-installation
        • Smt-hint
        • Tutorial
        • Status
        • Developer
          • Verified
            • Uninterpreted-fn-cp
            • Smt-hint-interface
              • Smtlink-hint
                • Smtlink-hint-p
                • Make-smtlink-hint
                • Func
                  • Func-fix
                    • Func-p
                    • Make-func
                    • Func-equiv
                    • Func->flattened-returns
                    • Func->flattened-formals
                    • Change-func
                    • Func->more-returns
                    • Func->expansion-depth
                    • Func->returns
                    • Func->formals
                    • Func->name
                    • Func->guard
                    • Func-list
                  • Smtlink-hint-fix
                  • Maybe-smtlink-hint
                  • Hint-pair
                  • Decl
                  • Binding
                  • Smtlink-hint-equiv
                  • Let-binding
                  • Change-smtlink-hint
                  • Smtlink-hint->expanded-clause-w/-hint
                  • Smtlink-hint->type-decl-list
                  • Smtlink-hint->fast-functions
                  • Smtlink-hint->expanded-g/type
                  • Smtlink-hint->smt-params
                  • Smtlink-hint->let-binding
                  • Smtlink-hint->hypotheses
                  • Smtlink-hint->fty-info
                  • Smtlink-hint->wrld-fn-len
                  • Smtlink-hint->symbols
                  • Smtlink-hint->smt-fname
                  • Smtlink-hint->smt-dir
                  • Smtlink-hint->smt-cnf
                  • Smtlink-hint->rm-file
                  • Smtlink-hint->main-hint
                  • Smtlink-hint->int-to-rat
                  • Smtlink-hint->functions
                  • Smtlink-hint->fty-types
                  • Smtlink-hint->custom-p
                  • Smtlink-hint->fty
                  • Smtlink-hint->abs
                • Smt-hint
                • Make-alist-fn-lst
                • True-list-fix
              • Function-expansion
              • Smt-config
              • Fty-support
              • Smt-computed-hints
              • Add-hypo-cp
              • Smt-hint-please
              • Type-extract-cp
              • Smt-extract
              • Smtlink-process-user-hint
              • Smt-basics
              • Smt-type-hyp
              • Smt-magic-fix
            • Trusted
        • 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
        • Taspi
        • Bitcoin
        • Riscv
        • 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
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Func

    Func-fix

    Fixing function for func structures.

    Signature
    (func-fix x) → new-x
    Arguments
    x — Guard (func-p x).
    Returns
    new-x — Type (func-p new-x).

    Definitions and Theorems

    Function: func-fix$inline

    (defun func-fix$inline (x)
     (declare (xargs :guard (func-p x)))
     (let ((acl2::__function__ 'func-fix))
      (declare (ignorable acl2::__function__))
      (mbe
        :logic
        (b*
         ((name (symbol-fix (cdr (std::da-nth 0 x))))
          (formals (decl-list-fix (cdr (std::da-nth 1 x))))
          (guard (hint-pair-fix (cdr (std::da-nth 2 x))))
          (returns (decl-list-fix (cdr (std::da-nth 3 x))))
          (more-returns (hint-pair-list-fix (cdr (std::da-nth 4 x))))
          (expansion-depth (nfix (cdr (std::da-nth 5 x))))
          (flattened-formals (symbol-list-fix (cdr (std::da-nth 6 x))))
          (flattened-returns (symbol-list-fix (cdr (std::da-nth 7 x)))))
         (list (cons 'name name)
               (cons 'formals formals)
               (cons 'guard guard)
               (cons 'returns returns)
               (cons 'more-returns more-returns)
               (cons 'expansion-depth expansion-depth)
               (cons 'flattened-formals
                     flattened-formals)
               (cons 'flattened-returns
                     flattened-returns)))
        :exec x)))

    Theorem: func-p-of-func-fix

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

    Theorem: func-fix-when-func-p

    (defthm func-fix-when-func-p
      (implies (func-p x)
               (equal (func-fix x) x)))

    Function: func-equiv$inline

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

    Theorem: func-equiv-is-an-equivalence

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

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

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

    Theorem: func-fix-under-func-equiv

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

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

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

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

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

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

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

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

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