• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
        • Deftagsum
        • Defprod
        • Defflexsum
        • Defbitstruct
        • Deflist
        • Defalist
        • Defbyte
        • Deffixequiv
        • Defresult
        • Deffixtype
        • Defoption
        • Fty-discipline
        • Fold
        • Fty-extensions
        • Defsubtype
        • Specific-types
        • Deftypes
        • Defset
        • Defflatsum
          • Defflatsum-implementation
            • Defflatsum-fn
              • Defflatsum-theorem
              • Defflatsum-flex-summand
              • Defflatsum-flex-summands
              • Defflatsum-theorems
              • Defflatsum-macro-definition
          • Deflist-of-len
          • Defbytelist
          • Defomap
          • 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
        • Theories
        • Rule-classes
        • Proof-builder
        • Recursion-and-induction
        • Hons-and-memoization
        • Events
        • Parallelism
        • History
        • Programming
        • Operational-semantics
        • Real
        • Start-here
        • Miscellaneous
        • Output-controls
        • Bdd
        • Macros
          • Make-event
          • Defmacro
          • Untranslate-patterns
          • Tc
          • Trans*
          • Macro-aliases-table
          • Macro-args
          • Defabbrev
          • User-defined-functions-table
          • Trans
          • Untranslate-for-execution
          • Macro-libraries
            • B*
            • Defunc
            • Fty
              • Deftagsum
              • Defprod
              • Defflexsum
              • Defbitstruct
              • Deflist
              • Defalist
              • Defbyte
              • Deffixequiv
              • Defresult
              • Deffixtype
              • Defoption
              • Fty-discipline
              • Fold
              • Fty-extensions
              • Defsubtype
              • Specific-types
              • Deftypes
              • Defset
              • Defflatsum
                • Defflatsum-implementation
                  • Defflatsum-fn
                    • Defflatsum-theorem
                    • Defflatsum-flex-summand
                    • Defflatsum-flex-summands
                    • Defflatsum-theorems
                    • Defflatsum-macro-definition
                • Deflist-of-len
                • Defbytelist
                • Defomap
                • 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
            • Add-macro-fn
            • Check-vars-not-free
            • Safe-mode
            • Trans1
            • Defmacro-untouchable
            • Set-duplicate-keys-action
            • Add-macro-alias
            • Magic-macroexpand
            • Defmacroq
            • Trans!
            • Remove-macro-fn
            • Remove-macro-alias
            • Add-binop
            • Untrans-table
            • Trans*-
            • Remove-binop
            • Tcp
            • Tca
          • Installation
          • Mailing-lists
        • Interfacing-tools
        • Hardware-verification
        • Software-verification
        • Math
        • Testing-utilities
      • Defflatsum-implementation

      Defflatsum-fn

      Generate the defflexsum.

      Signature
      (defflatsum-fn args wrld) → event
      Arguments
      args — Guard (true-listp args).
      wrld — Guard (plist-worldp wrld).
      Returns
      event — A ACL2::pseudo-event-formp.

      Definitions and Theorems

      Function: defflatsum-fn

      (defun defflatsum-fn (args wrld)
       (declare (xargs :guard (and (true-listp args)
                                   (plist-worldp wrld))))
       (let ((__function__ 'defflatsum-fn))
        (declare (ignorable __function__))
        (b*
         ((allowed-keywords '(:pred :fix :equiv
                                    :parents :short
                                    :long :prepwork))
          ((mv options type+summands)
           (extract-keywords 'defflatsum
                             allowed-keywords args nil))
          ((cons type flat-summands)
           type+summands)
          (pred (getarg :pred (add-suffix-to-fn type "-P")
                        options))
          (fix (getarg :fix (add-suffix-to-fn type "-FIX")
                       options))
          (equiv (getarg :equiv (add-suffix-to-fn type "-EQUIV")
                         options))
          (parents (getarg :parents :noparents options))
          (short (getarg :short nil options))
          (long (getarg :long nil options))
          ((mv flex-summands predicates fixers)
           (defflatsum-flex-summands flat-summands wrld))
          (default-prepwork
           (cons (cons 'local
                       (cons (cons 'in-theory
                                   (cons (cons 'enable
                                               (append predicates fixers))
                                         'nil))
                             'nil))
                 'nil))
          (prepwork (getarg :prepwork default-prepwork options))
          (theorems (defflatsum-theorems predicates pred)))
         (cons
          'defflexsum
          (cons
           type
           (append
            (and (not (eq parents :noparents))
                 (list :parents parents))
            (append
             (and short (list :short short))
             (append
              (and long (list :long long))
              (append
               flex-summands
               (cons
                ':pred
                (cons
                 pred
                 (cons
                  ':fix
                  (cons
                   fix
                   (cons
                    ':equiv
                    (cons
                         equiv
                         (cons ':prepwork
                               (cons prepwork
                                     (cons '/// theorems))))))))))))))))))