• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
      • Apt
      • Std/util
        • Defprojection
        • Deflist
        • Defaggregate
        • Define
        • Defmapping
          • Defsurj
          • Defiso
          • Defmapping-implementation
            • Defmapping-event-generation
            • Defmapping-check-redundancy
            • Defmapping-table
            • Defmapping-fn
            • Defmapping-input-processing
              • Defmapping-process-thm-names
              • Defmapping-process-inputs
              • Defmapping-process-function
                • Defmapping-process-functions
                • Defmapping-process-thm-enable
                • Defmapping-thm-keywords
                • Defmapping-process-name
              • Defmapping-macro-definition
            • Definj
          • Defenum
          • Add-io-pairs
          • Defalist
          • Defmapappend
          • Returns-specifiers
          • Defarbrec
          • Defines
          • Define-sk
          • Error-value-tuples
          • Defmax-nat
          • Defmin-int
          • Deftutorial
          • Extended-formals
          • Defrule
          • Defval
          • Defsurj
          • Defiso
          • Defconstrained-recognizer
          • Deffixer
          • Defmvtypes
          • Defconsts
          • Defthm-unsigned-byte-p
          • Support
          • Defthm-signed-byte-p
          • Defthm-natp
          • Defund-sk
          • Defmacro+
          • Defsum
          • Defthm-commutative
          • Definj
          • Defirrelevant
          • Defredundant
        • Defdata
        • Defrstobj
        • Seq
        • Match-tree
        • Defrstobj
        • With-supporters
        • Def-partial-measure
        • Template-subst
        • Soft
        • Defthm-domain
        • Event-macros
        • Def-universal-equiv
        • Def-saved-obligs
        • With-supporters-after
        • Definec
        • Sig
        • Outer-local
        • Data-structures
      • ACL2
        • Theories
        • Rule-classes
        • Proof-builder
        • Recursion-and-induction
        • Hons-and-memoization
        • Events
        • Parallelism
        • History
        • Programming
        • Operational-semantics
        • Real
        • Start-here
        • Miscellaneous
        • Output-controls
        • Bdd
        • Macros
          • Make-event
          • Defmacro
          • Untranslate-patterns
          • Tc
          • Trans*
          • Macro-aliases-table
          • Macro-args
          • Defabbrev
          • User-defined-functions-table
          • Trans
          • Untranslate-for-execution
          • Macro-libraries
            • B*
            • Defunc
            • Fty
            • Apt
            • Std/util
              • Defprojection
              • Deflist
              • Defaggregate
              • Define
              • Defmapping
                • Defsurj
                • Defiso
                • Defmapping-implementation
                  • Defmapping-event-generation
                  • Defmapping-check-redundancy
                  • Defmapping-table
                  • Defmapping-fn
                  • Defmapping-input-processing
                    • Defmapping-process-thm-names
                    • Defmapping-process-inputs
                    • Defmapping-process-function
                      • Defmapping-process-functions
                      • Defmapping-process-thm-enable
                      • Defmapping-thm-keywords
                      • Defmapping-process-name
                    • Defmapping-macro-definition
                  • Definj
                • Defenum
                • Add-io-pairs
                • Defalist
                • Defmapappend
                • Returns-specifiers
                • Defarbrec
                • Defines
                • Define-sk
                • Error-value-tuples
                • Defmax-nat
                • Defmin-int
                • Deftutorial
                • Extended-formals
                • Defrule
                • Defval
                • Defsurj
                • Defiso
                • Defconstrained-recognizer
                • Deffixer
                • Defmvtypes
                • Defconsts
                • Defthm-unsigned-byte-p
                • Support
                • Defthm-signed-byte-p
                • Defthm-natp
                • Defund-sk
                • Defmacro+
                • Defsum
                • Defthm-commutative
                • Definj
                • Defirrelevant
                • Defredundant
              • Defdata
              • Defrstobj
              • Seq
              • Match-tree
              • Defrstobj
              • With-supporters
              • Def-partial-measure
              • Template-subst
              • Soft
              • Defthm-domain
              • Event-macros
              • Def-universal-equiv
              • Def-saved-obligs
              • With-supporters-after
              • Definec
              • Sig
              • Outer-local
              • Data-structures
            • Add-macro-fn
            • Check-vars-not-free
            • Safe-mode
            • Trans1
            • Defmacro-untouchable
            • Set-duplicate-keys-action
            • Add-macro-alias
            • Magic-macroexpand
            • Defmacroq
            • Trans!
            • Remove-macro-fn
            • Remove-macro-alias
            • Add-binop
            • Untrans-table
            • Trans*-
            • Remove-binop
            • Tcp
            • Tca
          • Installation
          • Mailing-lists
        • Interfacing-tools
        • Hardware-verification
        • Software-verification
        • Math
        • Testing-utilities
      • Defmapping-input-processing

      Defmapping-process-function

      Process one of the input functions (i.e. doma, domb, alpha, or beta).

      Signature
      (defmapping-process-function 
           function position guard-thms$ ctx state) 
       
        → 
      (mv erp result state)
      Arguments
      function — The doma, domb, alpha, or beta input to defmapping.
      position — Position of the input in the ordered inputs to defmapping.
          Guard (member position '(2 3 4 5)).
      guard-thms$ — Guard (booleanp guard-thms$).
      Returns
      result — A tuple (function$ arity numres) satisfying (typed-tuplep pseudo-termfnp natp posp).

      Return either the input unchanged (if it is a function name) or its translation (if it is a lambda expression). Also return the arity and the number of results.

      Definitions and Theorems

      Function: defmapping-process-function

      (defun defmapping-process-function
             (function position guard-thms$ ctx state)
       (declare (xargs :stobjs (state)))
       (declare (xargs :guard (and (member position '(2 3 4 5))
                                   (booleanp guard-thms$))))
       (let ((__function__ 'defmapping-process-function))
        (declare (ignorable __function__))
        (b*
         (((er (list fn/lambda
                     stobjs-in stobjs-out description))
           (ensure-function/macro/lambda$
                function
                (msg "The ~n0 input" (list position))
                t nil))
          ((er &)
           (ensure-function/lambda-logic-mode$
                fn/lambda description t nil))
          ((er &)
           (ensure-function/lambda-closed$ fn/lambda description t nil))
          ((unless guard-thms$)
           (value (list fn/lambda (len stobjs-in)
                        (len stobjs-out))))
          ((er &)
           (ensure-function/lambda-guard-verified-exec-fns$
            fn/lambda
            (msg
              "Since the :GUARD-THMS input is (perhaps by default) T, ~@0"
              (msg-downcase-first description))
            t nil)))
         (value (list fn/lambda (len stobjs-in)
                      (len stobjs-out))))))