• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
          • Defbyte
          • Defresult
          • Fold
          • Defsubtype
          • Defset
          • Specific-types
          • Defflatsum
            • Defflatsum-implementation
              • Defflatsum-fn
                • Defflatsum-theorem
                • Defflatsum-flex-summand
                • Defflatsum-flex-summands
                • Defflatsum-theorems
                • Defflatsum-macro-definition
            • Deflist-of-len
            • Pos-list
            • Defbytelist
            • Defomap
            • Defbyte-standard-instances
            • Deffixtype-alias
            • Defbytelist-standard-instances
            • Defunit
            • Byte-list
            • Database
            • Byte
            • Pos-option
            • Nibble
            • Nat-option
            • String-option
            • Byte-list20
            • Byte-list32
            • Byte-list64
            • Pseudo-event-form
            • Natoption/natoptionlist
            • Nati
            • Character-list
            • Nat/natlist
            • Maybe-string
            • Nibble-list
            • Natoption/natoptionlist-result
            • Nat/natlist-result
            • Nat-option-list-result
            • Set
            • String-result
            • String-list-result
            • Nat-result
            • Nat-option-result
            • Nat-list-result
            • Maybe-string-result
            • Integer-result
            • Character-result
            • Character-list-result
            • Boolean-result
            • Map
            • Bag
            • Pos-set
            • Hex-digit-char-list
            • Dec-digit-char-list
            • Pseudo-event-form-list
            • Nat-option-list
            • Symbol-set
            • String-set
            • Nat-set
            • Oct-digit-char-list
            • Bin-digit-char-list
            • Bit-list
          • Isar
          • Kestrel-utilities
          • Set
          • Soft
          • C
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • 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))))))))))))))))))