• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
        • Syntax-for-tools
        • Atc
          • Atc-implementation
            • Atc-abstract-syntax
            • Atc-pretty-printer
            • Atc-event-and-code-generation
            • Fty-pseudo-term-utilities
            • Atc-term-recognizers
            • Atc-input-processing
            • Atc-shallow-embedding
              • Defstruct
                • Defstruct-implementation
                  • Defstruct-info
                  • Defstruct-gen-recognizer
                  • Defstruct-gen-integer-member-ops
                  • Defstruct-gen-constructor
                  • Defstruct-gen-array-member-ops
                  • Defstruct-gen-recognizer-conjuncts
                  • Defstruct-member-info
                  • Defstruct-member-info-list->memtype-list
                  • Defstruct-process-members
                  • Defstruct-gen-fixer
                  • Defstruct-gen-member-ops
                  • Defstruct-process-inputs
                  • Defstruct-gen-fixing-term
                  • Defstruct-info-option
                  • Defstruct-gen-everything
                    • Defstruct-gen-all-member-ops
                    • Defstruct-gen-recognizer-all-conjuncts
                    • Defstruct-info->writer-element-list
                    • Defstruct-info->reader-element-list
                    • Defstruct-gen-fixtype
                    • Defstruct-info->writer-list
                    • Defstruct-info->reader-list
                    • Defstruct-fn
                    • Defstruct-table-record-event
                    • Defstruct-table-lookup
                    • Irr-defstruct-info
                    • Defstruct-info->writer-element-list-aux
                    • Defstruct-info->reader-element-list-aux
                    • Defstruct-info->writer-list-aux
                    • Defstruct-info->reader-list-aux
                    • Defstruct-member-info-list
                    • Defstruct-table-definition
                    • *defstruct-table*
                    • Defstruct-macro-implementtion
                • Defobject
                • Atc-let-designations
                • Pointer-types
                • Atc-conditional-expressions
              • Atc-process-inputs-and-gen-everything
              • Atc-table
              • Atc-fn
              • Atc-pretty-printing-options
              • Atc-types
              • Atc-macro-definition
            • Atc-tutorial
          • Language
          • Representation
          • Transformation-tools
          • Insertion-sort
          • Pack
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Riscv
        • Bitcoin
        • 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
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Defstruct-implementation

    Defstruct-gen-everything

    Generate all the events.

    Signature
    (defstruct-gen-everything tag tag-ident members flexiblep call) 
      → 
    event
    Arguments
    tag — Guard (symbolp tag).
    tag-ident — Guard (identp tag-ident).
    members — Guard (member-type-listp members).
    flexiblep — Guard (booleanp flexiblep).
    call — Guard (pseudo-event-formp call).
    Returns
    event — Type (pseudo-event-formp event).

    These are the recognizer, fixer, fixtype, member operations, and the table event. We conclude with a deflabel event that facilitates history manipulation.

    Definitions and Theorems

    Function: defstruct-gen-everything

    (defun defstruct-gen-everything
           (tag tag-ident members flexiblep call)
     (declare (xargs :guard (and (symbolp tag)
                                 (identp tag-ident)
                                 (member-type-listp members)
                                 (booleanp flexiblep)
                                 (pseudo-event-formp call))))
     (let ((__function__ 'defstruct-gen-everything))
      (declare (ignorable __function__))
      (b*
       ((struct-tag (packn-pos (list 'struct- tag) tag))
        (struct-tag-p (packn-pos (list struct-tag '-p) tag))
        (struct-tag-fix (packn-pos (list struct-tag '-fix) tag))
        (struct-tag-equiv (packn-pos (list struct-tag '-equiv)
                                     tag))
        ((mv recognizer-event
             not-errorp-when-struct-tag-p
             valuep-when-struct-tag-p
             value-kind-when-struct-tag-p
             type-of-value-when-struct-tag-p
             flexiblep-when-struct-tag-p
             struct-tag-to-quoted
             pointer-struct-tag-to-quoted)
         (defstruct-gen-recognizer struct-tag-p tag members flexiblep))
        ((mv fixer-event fixer-recognizer-thm)
         (defstruct-gen-fixer struct-tag-fix
                              struct-tag-p tag members flexiblep))
        (fixtype-event
             (defstruct-gen-fixtype struct-tag struct-tag-p
                                    struct-tag-fix struct-tag-equiv))
        (constructor-event
             (defstruct-gen-constructor tag-ident struct-tag
                                        struct-tag-p members flexiblep))
        ((mv member-op-events member-infos)
         (defstruct-gen-all-member-ops
              struct-tag struct-tag-p struct-tag-fix
              value-kind-when-struct-tag-p
              valuep-when-struct-tag-p members))
        (info
           (make-defstruct-info
                :tag tag-ident
                :members member-infos
                :flexiblep flexiblep
                :fixtype struct-tag
                :recognizer struct-tag-p
                :fixer struct-tag-fix
                :fixer-recognizer-thm fixer-recognizer-thm
                :not-error-thm not-errorp-when-struct-tag-p
                :valuep-thm valuep-when-struct-tag-p
                :value-kind-thm value-kind-when-struct-tag-p
                :type-of-value-thm type-of-value-when-struct-tag-p
                :flexiblep-thm flexiblep-when-struct-tag-p
                :type-to-quoted-thm struct-tag-to-quoted
                :pointer-type-to-quoted-thm pointer-struct-tag-to-quoted
                :call call))
        (table-event (defstruct-table-record-event (symbol-name tag)
                                                   info))
        (label-event (cons 'deflabel (cons tag 'nil))))
       (cons
        'encapsulate
        (cons
         'nil
         (cons
          recognizer-event
          (cons
            fixer-event
            (cons fixtype-event
                  (cons constructor-event
                        (append member-op-events
                                (cons table-event
                                      (cons label-event 'nil))))))))))))

    Theorem: pseudo-event-formp-of-defstruct-gen-everything

    (defthm pseudo-event-formp-of-defstruct-gen-everything
      (b* ((event (defstruct-gen-everything
                       tag tag-ident members flexiblep call)))
        (pseudo-event-formp event))
      :rule-classes :rewrite)