• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
      • Apt
        • 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-process-old
                • Isodata-fresh-defiso-name-with-*s-suffix
                • Isodata-process-newp-of-new-name
                • Isodata-process-undefined
                • Isodata-symbol-isomap-alist-stobjp
                • Isodata-pos-isomap-alist-stobjp
                • Isodata-isomap-listp
              • Isodata-macro-definition
          • Simplify-defun
          • 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
        • 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
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Isodata-input-processing

    Isodata-process-arg/res-list-iso

    Process an (arg/res-list iso) component of the isomaps input.

    Signature
    (isodata-process-arg/res-list-iso 
         arg/res-list-iso 
         k old$ verify-guards$ arg-isomaps 
         res-isomaps names-to-avoid ctx state) 
     
      → 
    (mv erp result state)
    Arguments
    arg/res-list-iso — The (arg/res-listk isok) component of isomaps.
    k — The k in (arg/res-listk isok).
        Guard (posp k).
    old$ — Guard (symbolp old$).
    verify-guards$ — Guard (booleanp verify-guards$).
    arg-isomaps — Guard (isodata-symbol-isomap-alistp arg-isomaps).
    res-isomaps — Guard (isodata-pos-isomap-alistp res-isomaps).
    names-to-avoid — Guard (symbol-listp names-to-avoid).
    Returns
    result — A tuple (arg-isomaps res-isomaps updated-names-to-avoid) satisfying (typed-tuplep isodata-symbol-isomap-alistp isodata-pos-isomap-alistp symbol-listp result).

    The arg-isomaps and res-isomaps inputs are obtained by having previously called this function on (arg/res-list1 iso1), ..., (arg/res-listk-1 isok-1) in turn. When we call this function on (arg/res-listk isok), we extend arg-isomaps and res-isomaps with the information in (arg/res-listk isok). As we do that, we check that the arguments of old in arg/res-listk are not already keys in arg-isomaps: if any of them did, it would mean that it is already present in one of (arg/res-list1 iso1), ..., (arg/res-listk-1 isok-1), violating the disjointness requirement. Similarly, we check that the result indices in arg/res-listk are not already keys in res-isomaps: if any of them did, it would mean that the same result is already present in one of (arg/res-list1 iso1), ..., (arg/res-listk-1 isok-1), violating the disjointness requirement.

    Definitions and Theorems

    Function: isodata-process-arg/res-list-iso-add-args

    (defun isodata-process-arg/res-list-iso-add-args
           (args isomap arg-isomaps)
     (declare
        (xargs :guard (and (symbol-listp args)
                           (isodata-isomapp isomap)
                           (isodata-symbol-isomap-alistp arg-isomaps))))
     (let ((__function__ 'isodata-process-arg/res-list-iso-add-args))
       (declare (ignorable __function__))
       (cond ((endp args) arg-isomaps)
             (t (isodata-process-arg/res-list-iso-add-args
                     (cdr args)
                     isomap
                     (acons (car args)
                            isomap arg-isomaps))))))

    Theorem: isodata-symbol-isomap-alistp-of-isodata-process-arg/res-list-iso-add-args

    (defthm
     isodata-symbol-isomap-alistp-of-isodata-process-arg/res-list-iso-add-args
     (implies (and (symbol-listp args)
                   (isodata-isomapp isomap)
                   (isodata-symbol-isomap-alistp arg-isomaps))
              (b* ((new-arg-isomaps (isodata-process-arg/res-list-iso-add-args
                                         args isomap arg-isomaps)))
                (isodata-symbol-isomap-alistp new-arg-isomaps)))
     :rule-classes :rewrite)

    Function: isodata-process-arg/res-list-iso-add-ress

    (defun isodata-process-arg/res-list-iso-add-ress
           (ress isomap res-isomaps)
      (declare
           (xargs :guard (and (pos-listp ress)
                              (isodata-isomapp isomap)
                              (isodata-pos-isomap-alistp res-isomaps))))
      (let ((__function__ 'isodata-process-arg/res-list-iso-add-ress))
        (declare (ignorable __function__))
        (cond ((endp ress) res-isomaps)
              (t (isodata-process-arg/res-list-iso-add-ress
                      (cdr ress)
                      isomap
                      (acons (car ress)
                             isomap res-isomaps))))))

    Theorem: isodata-pos-isomap-alistp-of-isodata-process-arg/res-list-iso-add-ress

    (defthm
     isodata-pos-isomap-alistp-of-isodata-process-arg/res-list-iso-add-ress
     (implies (and (pos-listp ress)
                   (isodata-isomapp isomap)
                   (isodata-pos-isomap-alistp res-isomaps))
              (b* ((new-res-isomaps (isodata-process-arg/res-list-iso-add-ress
                                         ress isomap res-isomaps)))
                (isodata-pos-isomap-alistp new-res-isomaps)))
     :rule-classes :rewrite)

    Function: isodata-process-arg/res-list-iso

    (defun isodata-process-arg/res-list-iso
           (arg/res-list-iso k old$ verify-guards$ arg-isomaps
                             res-isomaps names-to-avoid ctx state)
     (declare (xargs :stobjs (state)))
     (declare
          (xargs :guard (and (posp k)
                             (symbolp old$)
                             (booleanp verify-guards$)
                             (isodata-symbol-isomap-alistp arg-isomaps)
                             (isodata-pos-isomap-alistp res-isomaps)
                             (symbol-listp names-to-avoid))))
     (let ((__function__ 'isodata-process-arg/res-list-iso))
      (declare (ignorable __function__))
      (b*
       (((er &)
         (ensure-tuple$ arg/res-list-iso 2
                        (msg "The ~n0 component of the second input"
                             (list k))
                        t nil))
        (arg/res-list (first arg/res-list-iso))
        (iso (second arg/res-list-iso))
        ((er (list args ress))
         (isodata-process-arg/res-list arg/res-list k old$ ctx state))
        (arg-overlap (intersection-eq args (strip-cars arg-isomaps)))
        ((when arg-overlap)
         (er-soft+
          ctx t nil
          "The ~n0 component of the second input includes ~&1, ~
                       which are also present in the preceding components. ~
                       This violates the disjointness requirement."
          (list k)
          arg-overlap))
        (res-overlap (intersection$ ress (strip-cars res-isomaps)))
        ((when res-overlap)
         (er-soft+
          ctx t nil
          "The ~n0 component of the second input includes ~
                       the ~s1 ~&2, ~
                       which ~s3 also present in the preceding components. ~
                       This violates the disjointness requirement."
          (list k)
          (if (= (len res-overlap) 1)
              "result with index"
            "results with indices")
          res-overlap
          (if (= (len res-overlap) 1)
              "is"
            "are")))
        ((er (list isomap names-to-avoid))
         (isodata-process-iso iso k old$ verify-guards$
                              names-to-avoid ctx state))
        (arg-isomaps (isodata-process-arg/res-list-iso-add-args
                          args isomap arg-isomaps))
        (res-isomaps (isodata-process-arg/res-list-iso-add-ress
                          ress isomap res-isomaps)))
       (value (list arg-isomaps
                    res-isomaps names-to-avoid)))))