• 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-fn

    Process the inputs and generate the events.

    Signature
    (defstruct-fn args call ctx state) → (mv erp event state)
    Arguments
    args — Guard (true-listp args).
    call — Guard (pseudo-event-formp call).
    ctx — Guard (ctxp ctx).
    Returns
    event — Type (pseudo-event-formp event).

    Definitions and Theorems

    Function: defstruct-fn

    (defun defstruct-fn (args call ctx state)
      (declare (xargs :stobjs (state)))
      (declare (xargs :guard (and (true-listp args)
                                  (pseudo-event-formp call)
                                  (ctxp ctx))))
      (let ((__function__ 'defstruct-fn))
        (declare (ignorable __function__))
        (b* (((er (list tag
                        tag-ident members flexiblep redundant)
                  :iferr '(_))
              (defstruct-process-inputs args call ctx state))
             ((when redundant)
              (acl2::value '(value-triple :redundant)))
             (event (defstruct-gen-everything
                         tag tag-ident members flexiblep call)))
          (acl2::value event))))

    Theorem: pseudo-event-formp-of-defstruct-fn.event

    (defthm pseudo-event-formp-of-defstruct-fn.event
      (b* (((mv acl2::?erp acl2::?event acl2::?state)
            (defstruct-fn args call ctx state)))
        (pseudo-event-formp event))
      :rule-classes :rewrite)