• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
      • Apt
        • Isodata
        • Simplify-defun
        • Tailrec
        • Schemalg
        • Restrict
        • Expdata
          • Expdata-implementation
            • Expdata-event-generation
            • Expdata-fn
            • Expdata-input-processing
              • Expdata-symbol-surjmap-alistp
              • Expdata-surjmapp
              • Expdata-pos-surjmap-alistp
              • Expdata-process-surj
              • Expdata-process-arg/res-list-surj
              • Expdata-process-inputs
              • Expdata-process-surjmaps
              • Expdata-fresh-defsurj-thm-names
              • Expdata-process-arg/res-list
              • Expdata-process-arg/res-list-surj-list
              • Expdata-process-res
                • Expdata-process-newp-of-new-name
                • Expdata-fresh-defsurj-name-with-*s-suffix
                • Expdata-process-surjmaps-ress
                • Expdata-process-surjmaps-args
                • Expdata-process-arg/res-list-surj-add-args
                • Expdata-process-arg/res-list-surj-add-ress
                • Expdata-process-old
                • Expdata-process-arg/res-list-aux
                • Expdata-surjmap-listp
                • Expdata-fresh-defsurj-name-with-*s-suffix-aux
              • 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
        • Std/util
        • 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
              • Isodata
              • Simplify-defun
              • Tailrec
              • Schemalg
              • Restrict
              • Expdata
                • Expdata-implementation
                  • Expdata-event-generation
                  • Expdata-fn
                  • Expdata-input-processing
                    • Expdata-symbol-surjmap-alistp
                    • Expdata-surjmapp
                    • Expdata-pos-surjmap-alistp
                    • Expdata-process-surj
                    • Expdata-process-arg/res-list-surj
                    • Expdata-process-inputs
                    • Expdata-process-surjmaps
                    • Expdata-fresh-defsurj-thm-names
                    • Expdata-process-arg/res-list
                    • Expdata-process-arg/res-list-surj-list
                    • Expdata-process-res
                      • Expdata-process-newp-of-new-name
                      • Expdata-fresh-defsurj-name-with-*s-suffix
                      • Expdata-process-surjmaps-ress
                      • Expdata-process-surjmaps-args
                      • Expdata-process-arg/res-list-surj-add-args
                      • Expdata-process-arg/res-list-surj-add-ress
                      • Expdata-process-old
                      • Expdata-process-arg/res-list-aux
                      • Expdata-surjmap-listp
                      • Expdata-fresh-defsurj-name-with-*s-suffix-aux
                    • 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
              • Std/util
              • 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
      • Expdata-input-processing

      Expdata-process-res

      Process a result specification in the surjmap input.

      Signature
      (expdata-process-res res m err-msg-preamble ctx state) 
        → 
      (mv erp j state)
      Arguments
      m — Guard (posp m).
      err-msg-preamble — Guard (msgp err-msg-preamble).
      Returns
      j — Type (posp j).

      Recall that m is the number of results of old.

      We check that the result specification is a keyword :resultj, where j is a positive integer not exceeding m. We return j, if successful.

      If m is 1, we also accept the keyword :result, treating it the same as :result1.

      Definitions and Theorems

      Function: expdata-process-res

      (defun expdata-process-res (res m err-msg-preamble ctx state)
        (declare (xargs :stobjs (state)))
        (declare (xargs :guard (and (posp m) (msgp err-msg-preamble))))
        (let ((__function__ 'expdata-process-res))
          (declare (ignorable __function__))
          (b* ((err-msg (msg "~@0 But ~x1 is none of those."
                             err-msg-preamble res))
               ((unless (keywordp res))
                (er-soft+ ctx t 1 err-msg-preamble res))
               ((when (and (= m 1) (eq res :result)))
                (value 1))
               (name (symbol-name res))
               ((unless (and (> (length name) 6)
                             (equal (subseq name 0 6) "RESULT")))
                (er-soft+ ctx t 1 "~@0" err-msg))
               (j (str::strval (subseq name 6 (length name))))
               ((unless j)
                (er-soft+ ctx t 1 "~@0" err-msg))
               ((unless (and (<= 1 j) (<= j m)))
                (er-soft+ ctx t 1 "~@0" err-msg)))
            (value j))))

      Theorem: posp-of-expdata-process-res.j

      (defthm posp-of-expdata-process-res.j
        (b* (((mv ?erp ?j acl2::?state)
              (expdata-process-res res m err-msg-preamble ctx state)))
          (posp j))
        :rule-classes :rewrite)