• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
          • Simplify-defun
          • Isodata
          • Tailrec
          • Schemalg
          • Restrict
          • Expdata
            • Expdata-implementation
              • Expdata-event-generation
                • Expdata-gen-everything
                • Expdata-gen-thm-instances-to-terms-back
                • Expdata-gen-new-fn-body-nonpred
                • Expdata-gen-new-fn
                • Expdata-gen-new-fn-verify-guards
                • Expdata-gen-new-fn-verify-guards-hints-nonpred-rec-1res/mres
                • Expdata-gen-back-of-forth-instances-to-terms-back
                • Expdata-gen-new-fn-verify-guards-hints-nonpred-nonrec-1res/mres
                • Expdata-gen-forth-image-instances-to-terms-back
                • Expdata-gen-forth-guard-instances-to-terms-back
                • Expdata-gen-new-to-old-thm-hints-rec-1res
                • Expdata-gen-defsurj
                  • Expdata-gen-new-to-old-thm-hints-rec-mres
                  • Expdata-gen-lemma-instances-var-to-new-forth-rec-call-args-back
                  • Expdata-gen-new-fn-verify-guards-hints-pred-rec
                  • Expdata-gen-lemma-instances-x1...xn-to-forth-rec-call-args-back
                  • Expdata-gen-thm-instances-to-x1...xn
                  • Expdata-gen-newp-of-new-thm-hints
                  • Expdata-gen-all-back-guard-instances-to-mv-nth
                  • Expdata-gen-result-vars
                  • Expdata-gen-lemma-instances-x1...xn-to-rec-call-args-back
                  • Expdata-gen-new-to-old-thm-hints-rec-0res
                  • Expdata-gen-new-fn-verify-guards-hints-nonpred-rec-0res
                  • Expdata-gen-newp-of-new-thm
                  • Expdata-gen-new-to-old-thm
                  • Expdata-gen-lemma-instances-var-to-rec-calls-back
                  • Expdata-gen-new-fn-body-pred
                  • Expdata-gen-old-to-new-thm-hints-1res
                  • Expdata-gen-new-fn-verify-guards-hints-nonpred
                  • Expdata-gen-new-fn-verify-guards-hints
                  • Expdata-gen-all-back-of-forth-instances-to-terms-back
                  • Expdata-gen-old-to-new-thm
                  • Expdata-gen-new-to-old-thm-hints
                  • Expdata-gen-new-fn-verify-guards-hints-pred-nonrec
                  • Expdata-gen-all-forth-image-instances-to-terms-back
                  • Expdata-gen-all-forth-guard-instances-to-terms-back
                  • Expdata-gen-old-to-new-thm-hints-mres
                  • Expdata-gen-appconds
                  • Expdata-xform-rec-calls
                  • Expdata-gen-back-of-forth-instances-to-mv-nth
                  • Expdata-gen-lemma-instance-x1...xn-to-forth-of-x1...xn
                  • Expdata-gen-forth-image-instances-to-mv-nth
                  • Expdata-gen-forth-guard-instances-to-mv-nth
                  • Expdata-gen-back-guard-instances-to-mv-nth
                  • Expdata-gen-all-back-of-forth-instances-to-mv-nth
                  • Expdata-gen-old-to-new-thm-formula
                  • Expdata-gen-newp-guard-instances-to-x1...xn
                  • Expdata-gen-new-to-old-thm-formula
                  • Expdata-gen-new-fn-verify-guards-hints-nonpred-nonrec-0res
                  • Expdata-gen-lemma-instance-x1...xn-to-back-of-x1...xn
                  • Expdata-gen-forth-image-instances-to-x1...xn
                  • Expdata-gen-forth-image-instances-to-terms-back-aux
                  • Expdata-gen-forth-guard-instances-to-x1...xn
                  • Expdata-gen-forth-guard-instances-to-terms-back-aux
                  • Expdata-gen-back-of-forth-instances-to-x1...xn
                  • Expdata-gen-back-of-forth-instances-to-terms-back-aux
                  • Expdata-gen-back-image-instances-to-x1...xn
                  • Expdata-gen-back-guard-instances-to-x1...xn
                  • Expdata-gen-newp-of-new-thm-formula
                  • Expdata-gen-fn-of-terms
                  • Expdata-gen-oldp-of-rec-call-args-under-contexts
                  • Expdata-gen-new-fn-termination-hints
                  • Expdata-gen-old-to-new-thm-hints
                  • Expdata-gen-lemma-instance-x1...xn-to-fn-of-x1...xn
                  • Expdata-gen-old-to-new-thm-hints-0res
                  • Expdata-gen-new-fn-verify-guards-hints-pred
                  • Expdata-gen-new-to-old-thm-hints-nonrec
                  • Expdata-gen-subst-x1...xn-with-back-of-x1...xn
                  • Expdata-gen-oldp-of-terms
                  • Expdata-gen-newp-of-terms
                  • Expdata-gen-new-fn-body
                  • Expdata-gen-forth-of-terms
                  • Expdata-gen-defsurjs
                  • Expdata-gen-back-of-terms
                  • Expdata-gen-new-fn-guard
                  • Expdata-gen-result-vars-aux
                  • Expdata-gen-new-fn-measure
                  • Expdata-formal-of-newp
                  • Expdata-formal-of-forth
                  • Expdata-formal-of-back
                  • Expdata-formal-of-unary
                • Expdata-fn
                • Expdata-input-processing
                • Expdata-macro-definition
            • Casesplit
            • Simplify-term
            • Simplify-defun-sk
            • Parteval
            • Solve
            • Wrap-output
            • Propagate-iso
            • Simplify
            • Finite-difference
            • Drop-irrelevant-params
            • Copy-function
            • Lift-iso
            • Rename-params
            • Utilities
            • Simplify-term-programmatic
            • Simplify-defun-sk-programmatic
            • Simplify-defun-programmatic
            • Simplify-defun+
            • Common-options
            • Common-concepts
          • Error-checking
          • Fty-extensions
          • Isar
          • Kestrel-utilities
          • Set
          • Soft
          • C
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • 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
    • Expdata-event-generation

    Expdata-gen-defsurj

    Generate a local defsurj.

    Signature
    (expdata-gen-defsurj surjmap verify-guards$ print$) → event
    Arguments
    surjmap — Guard (expdata-surjmapp surjmap).
    verify-guards$ — Guard (booleanp verify-guards$).
    print$ — Guard (evmac-input-print-p print$).
    Returns
    event — Type (pseudo-event-formp event).

    When the surj input is not a name, expdata internally generates and uses a defsurj, so that the rest of the generated events can uniformly rely on a defsurj that has established the surjective mapping.

    This event is local to the encapsulate generated by expdata.

    Since the defsurj is local, we normally do not want to print its result or info output. But we want to print errors. So we pass :error as the :print input. However, if expdata's :print input is :all, the we use :all for defsurj's :print input as well.

    This is also used for the identity surjective mapping, which is also locally generated.

    Definitions and Theorems

    Function: expdata-gen-defsurj

    (defun expdata-gen-defsurj (surjmap verify-guards$ print$)
     (declare (xargs :guard (and (expdata-surjmapp surjmap)
                                 (booleanp verify-guards$)
                                 (evmac-input-print-p print$))))
     (declare (xargs :guard (expdata-surjmap->localp surjmap)))
     (let ((__function__ 'expdata-gen-defsurj))
      (declare (ignorable __function__))
      (b*
       (((expdata-surjmap surjmap) surjmap)
        (name surjmap.surjname)
        (doma surjmap.newp)
        (domb surjmap.oldp)
        (alpha surjmap.back)
        (beta surjmap.forth)
        (unconditional nil)
        (guard-thms verify-guards$)
        (nonguard-thm-names
             (list :alpha-image surjmap.back-image
                   :beta-image surjmap.forth-image
                   :alpha-of-beta surjmap.back-of-forth
                   :beta-injective surjmap.forth-injective))
        (guard-thm-names? (and guard-thms
                               (list :doma-guard surjmap.newp-guard
                                     :domb-guard surjmap.oldp-guard
                                     :alpha-guard surjmap.back-guard
                                     :beta-guard surjmap.forth-guard)))
        (thm-names (append nonguard-thm-names guard-thm-names?))
        (hints surjmap.hints)
        (print (if (eq print$ :all) :all :error)))
       (cons
        'local
        (cons
         (cons
          'defsurj
          (cons
           name
           (cons
            doma
            (cons
             domb
             (cons
              alpha
              (cons
               beta
               (cons
                ':unconditional
                (cons
                 unconditional
                 (cons
                  ':guard-thms
                  (cons
                   guard-thms
                   (cons
                    ':thm-names
                    (cons
                      thm-names
                      (cons ':hints
                            (cons hints
                                  (cons ':print
                                        (cons print 'nil))))))))))))))))
         'nil)))))

    Theorem: pseudo-event-formp-of-expdata-gen-defsurj

    (defthm pseudo-event-formp-of-expdata-gen-defsurj
      (b* ((event (expdata-gen-defsurj surjmap verify-guards$ print$)))
        (pseudo-event-formp event))
      :rule-classes :rewrite)