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

      Generate the theorem associated to a summand.

      Signature
      (defflatsum-theorem summand-predicate sum-predicate) → thm
      Arguments
      summand-predicate — Guard (symbolp summand-predicate).
      sum-predicate — Guard (symbolp sum-predicate).
      Returns
      thm — A ACL2::pseudo-event-formp.

      The theorem says that anything satisfying the summand also satisfies the sum. It is proved by enabling the definition of the sum recognizer.

      Definitions and Theorems

      Function: defflatsum-theorem

      (defun defflatsum-theorem (summand-predicate sum-predicate)
       (declare (xargs :guard (and (symbolp summand-predicate)
                                   (symbolp sum-predicate))))
       (let ((__function__ 'defflatsum-theorem))
        (declare (ignorable __function__))
        (b* ((thm-name (acl2::packn-pos (list sum-predicate '-when-
                                              summand-predicate)
                                        sum-predicate)))
         (cons
          'defthm
          (cons
           thm-name
           (cons
            (cons 'implies
                  (cons (cons summand-predicate '(x))
                        (cons (cons sum-predicate '(x)) 'nil)))
            (cons
             ':hints
             (cons
              (cons
                (cons '"Goal"
                      (cons ':in-theory
                            (cons (cons 'enable (cons sum-predicate 'nil))
                                  'nil)))
                'nil)
              'nil))))))))