• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
        • Simplify-defun
        • Isodata
          • Isodata-implementation
            • Isodata-event-generation
            • Isodata-fn
            • Isodata-input-processing
              • Isodata-symbol-isomap-alistp
              • Isodata-isomapp
              • Isodata-pos-isomap-alistp
              • Isodata-process-iso
              • Isodata-process-inputs
              • Isodata-process-arg/res-list-iso
              • Isodata-process-isomaps
              • Isodata-fresh-defiso-thm-names
              • Isodata-process-arg/res-list
              • Isodata-process-arg/res-list-iso-list
              • Isodata-process-res
                • Isodata-fresh-defiso-name-with-*s-suffix
                • Isodata-process-newp-of-new-name
                • Isodata-process-isomaps-ress
                • Isodata-process-isomaps-args
                • Isodata-process-arg/res-list-iso-add-ress
                • Isodata-process-arg/res-list-iso-add-args
                • Isodata-process-old
                • Isodata-process-undefined
                • Isodata-process-arg/res-list-aux
                • Isodata-isomap-listp
                • Isodata-fresh-defiso-name-with-*s-suffix-aux
              • Isodata-macro-definition
          • Tailrec
          • Schemalg
          • Restrict
          • Expdata
          • 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
        • 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
        • 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
    • Isodata-input-processing

    Isodata-process-res

    Process a result specification in the isomap input.

    Signature
    (isodata-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: isodata-process-res

    (defun isodata-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__ 'isodata-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 "~@0" err-msg))
             ((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-isodata-process-res.j

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