• 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-flex-summand

      Generate a summand of the defflexsum.

      Signature
      (defflatsum-flex-summand flat-summand lastp wrld) 
        → 
      (mv flex-summand predicate fixer)
      Arguments
      lastp — Guard (booleanp lastp).
      wrld — Guard (plist-worldp wrld).

      If (and only if) the summand is the last one, do not generate the :cond part of the summand, because this summand applies when the :conds of the preceding summand do not hold.

      Definitions and Theorems

      Function: defflatsum-flex-summand

      (defun defflatsum-flex-summand (flat-summand lastp wrld)
       (declare (xargs :guard (and (booleanp lastp)
                                   (plist-worldp wrld))))
       (let ((__function__ 'defflatsum-flex-summand))
        (declare (ignorable __function__))
        (b*
         ((keyword (first flat-summand))
          (type (second flat-summand))
          (fty-table (get-fixtypes-alist wrld))
          (fty-info (find-fixtype type fty-table))
          (predicate (fixtype->pred fty-info))
          (fixer (fixtype->fix fty-info))
          (flex-summand
           (cons
            keyword
            (cons
             ':fields
             (cons
                 (cons (cons 'get
                             (cons ':type
                                   (cons type '(:acc-body x))))
                       'nil)
                 (cons ':ctor-body
                       (cons 'get
                             (and (not lastp)
                                  (list :cond (list predicate 'x))))))))))
         (mv flex-summand predicate fixer))))