• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
        • Deftagsum
        • Defprod
        • Defflexsum
        • Defbitstruct
        • Deflist
        • Defalist
        • Defbyte
        • Defresult
        • Deffixequiv
        • Deffixtype
        • Defoption
        • Fty-discipline
        • Fold
          • Deffold-reduce
          • Deffold-map
            • Deffold-map-implementation
              • Deffold-map-event-generation
                • Deffold-map-gen-list-map
                • Deffold-map-gen-omap-map
                • Deffold-map-gen-clique-map/maps
                • Deffold-map-gen-prod-map
                • Deffold-map-gen-sum-case
                • Deffold-map-gen-sum-map
                • Deffold-map-gen-option-map
                • Deffold-map-gen-sum-cases
                • Deffold-map-gen-everything
                • Deffold-map-gen-sum-case-loop
                  • Deffold-map-gen-prod/sum/option-map
                  • Deffold-map-gen-cliques-maps
                  • Deffold-map-gen-types-maps
                  • Deffold-map-gen-type-map
                  • Deffold-map-extra-args-to-names
                  • Deffold-map-gen-map-name
                  • Deffold-map-gen-topic-name
                  • Deffold-map-gen-ruleset-name
                • Deffold-map-process-inputs-and-gen-everything
                • Deffold-map-fn
                • Deffold-map-input-processing
                • Deffold-map-macro-definition
            • Defmake-self
          • Specific-types
          • Fty-extensions
          • Defsubtype
          • Deftypes
          • Defset
          • Defflatsum
          • Deflist-of-len
          • Defomap
          • Defbytelist
          • Fty::basetypes
          • Defvisitors
          • Deffixtype-alias
          • Deffixequiv-sk
          • Defunit
          • Multicase
          • Deffixequiv-mutual
          • Fty::baselists
          • Def-enumcase
          • Defmap
        • Apt
        • 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
    • Deffold-map-event-generation

    Deffold-map-gen-sum-case-loop

    Signature
    (deffold-map-gen-sum-case-loop type fields 
                                   suffix targets extra-args fty-table) 
     
      → 
    (mv maps targeted)
    Arguments
    type — Guard (symbolp type).
    fields — Guard (flexprod-field-listp fields).
    suffix — Guard (symbolp suffix).
    targets — Guard (symbol-listp targets).
    extra-args — Guard (true-listp extra-args).
    fty-table — Guard (alistp fty-table).
    Returns
    maps — Type (true-listp maps).
    targeted — Type (booleanp targeted).

    Definitions and Theorems

    Function: deffold-map-gen-sum-case-loop

    (defun deffold-map-gen-sum-case-loop
           (type fields
                 suffix targets extra-args fty-table)
     (declare (xargs :guard (and (symbolp type)
                                 (flexprod-field-listp fields)
                                 (symbolp suffix)
                                 (symbol-listp targets)
                                 (true-listp extra-args)
                                 (alistp fty-table))))
     (let ((__function__ 'deffold-map-gen-sum-case-loop))
      (declare (ignorable __function__))
      (b*
       (((when (endp fields)) (mv nil nil))
        (field (car fields))
        (recog (flexprod-field->type field))
        ((unless (symbolp recog))
         (raise "Internal error: malformed field recognizer ~x0."
                recog)
         (mv nil nil))
        (info (flextype-with-recognizer recog fty-table))
        (field-type (and info (flextype->name info)))
        (accessor (flexprod-field->acc-name field))
        (field-type-suffix (deffold-map-gen-map-name field-type suffix))
        ((unless (and field-type
                      (member-eq field-type targets)))
         (b* (((mv maps targeted)
               (deffold-map-gen-sum-case-loop
                    type (cdr fields)
                    suffix targets extra-args fty-table)))
           (mv (cons (cons accessor (cons type 'nil))
                     maps)
               targeted)))
        (extra-args-names (deffold-map-extra-args-to-names extra-args))
        (map (cons field-type-suffix
                   (cons (cons accessor (cons type 'nil))
                         extra-args-names)))
        ((mv maps -)
         (deffold-map-gen-sum-case-loop
              type (cdr fields)
              suffix targets extra-args fty-table)))
       (mv (cons map maps) t))))

    Theorem: true-listp-of-deffold-map-gen-sum-case-loop.maps

    (defthm true-listp-of-deffold-map-gen-sum-case-loop.maps
      (b* (((mv ?maps ?targeted)
            (deffold-map-gen-sum-case-loop
                 type fields
                 suffix targets extra-args fty-table)))
        (true-listp maps))
      :rule-classes :rewrite)

    Theorem: booleanp-of-deffold-map-gen-sum-case-loop.targeted

    (defthm booleanp-of-deffold-map-gen-sum-case-loop.targeted
      (b* (((mv ?maps ?targeted)
            (deffold-map-gen-sum-case-loop
                 type fields
                 suffix targets extra-args fty-table)))
        (booleanp targeted))
      :rule-classes :rewrite)