• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
      • Operational-semantics
      • Real
      • Start-here
      • Debugging
      • Miscellaneous
      • Output-controls
      • Macros
        • Make-event
        • Defmacro
        • Untranslate-patterns
        • Tc
        • Trans*
        • Macro-aliases-table
        • Macro-args
        • Defabbrev
        • User-defined-functions-table
        • Trans
        • Untranslate-for-execution
        • Add-macro-fn
        • Check-vars-not-free
        • Safe-mode
        • Macro-libraries
          • B*
          • Defunc
          • Fty
          • Apt
          • Std/util
            • Defprojection
            • Deflist
            • Defaggregate
            • Define
              • Returns-specifiers
              • Extended-formals
              • Defret
                • Defretgen
                  • Defretgen-rules
                  • Defret-mutual-generate
                  • Def-retgen-fnset
              • Define-guards
              • Defret-mutual
              • Post-define-hook
              • More-returns
              • Raise
            • Defmapping
            • Defenum
            • Add-io-pairs
            • Defalist
            • Defmapappend
            • Returns-specifiers
            • Defarbrec
            • Defines
            • Define-sk
            • Error-value-tuples
            • Defmax-nat
            • Defmin-int
            • Deftutorial
            • Extended-formals
            • Defrule
            • Defval
            • Defsurj
            • Defiso
            • Defconstrained-recognizer
            • Deffixer
            • Defmvtypes
            • Defconsts
            • Defthm-unsigned-byte-p
            • Support
            • Defthm-signed-byte-p
            • Defthm-natp
            • Defund-sk
            • Defmacro+
            • Defsum
            • Defthm-commutative
            • Definj
            • Defirrelevant
            • Defredundant
          • 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
        • 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
      • Mailing-lists
      • Interfacing-tools
    • Macro-libraries
      • B*
      • Defunc
      • Fty
      • Apt
      • Std/util
        • Defprojection
        • Deflist
        • Defaggregate
        • Define
          • Returns-specifiers
          • Extended-formals
          • Defret
            • Defretgen
              • Defretgen-rules
              • Defret-mutual-generate
              • Def-retgen-fnset
          • Define-guards
          • Defret-mutual
          • Post-define-hook
          • More-returns
          • Raise
        • Defmapping
        • Defenum
        • Add-io-pairs
        • Defalist
        • Defmapappend
        • Returns-specifiers
        • Defarbrec
        • Defines
        • Define-sk
        • Error-value-tuples
        • Defmax-nat
        • Defmin-int
        • Deftutorial
        • Extended-formals
        • Defrule
        • Defval
        • Defsurj
        • Defiso
        • Defconstrained-recognizer
        • Deffixer
        • Defmvtypes
        • Defconsts
        • Defthm-unsigned-byte-p
        • Support
        • Defthm-signed-byte-p
        • Defthm-natp
        • Defund-sk
        • Defmacro+
        • Defsum
        • Defthm-commutative
        • Definj
        • Defirrelevant
        • Defredundant
      • 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
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Defret

Defretgen

Generate some defret and defret-mutual forms for a set of functions and mutual recursions.

This macro generates theorems based on the same kinds of rules as defret-mutual-generate. However, instead of generating those theorems for a single mutually-recursive clique, it generates them for a user-specified list of functions and mutual recursions, which must be defined using define or defines respectively.

The syntax of defretgen works as follows:

(defretgen my-theorem-about-<fn>
   ;; rules to generate the theorems
   :rules ((condition1 action1 ...)
           (condition2 action2 ...)
           ...)
  ;; abbreviations that generate more rules
  :formal-hyps ...
  :return-concls ...
  :function-keys ...

  ;; optional keywords
  :hints top-level-hints-for-defret-mutual
  :no-induction-hint nil ;; for defret-mutual
  :otf-flg nil

  ;; specifies the set of functions for which to generate the theorems
  :functions my-function-set)

See defretgen-rules for documentation on the :rules, :formal-hyps, :return-concls, and :function-keys arguments. The :hints, :no-induction-hint, and :otf-flg arguments are passed to defret-mutual forms at the top level; hints for defret forms (both standalone and within defret-mutual forms) may be specified by the :rules and :function-keys arguments.

The argument to :functions must be a list of descriptors (described below) or a single symbol, which is an abbreviation for the singleton list containing that symbol. A descriptor may be a symbol or one of the following kinds of pairs:

  • (:fnset <name>) denotes a set of functions as defined by def-retgen-fnset.
  • (:mutrec <name>) names a mutually-recursive clique of functions defined using defines; note that <name> must be the name given to the mutually-recursive clique as a whole (the first argument to defines, which is not necessarily the name of one of the functions.
  • (:function <name>) names a function defined using define.

If it is a symbol, it is treated as (:fnset <name>) if such a function set exists, then (:mutrec <name>) if such a mutual recursion exists, then (:function <name>) otherwise.

Subtopics

Defretgen-rules
Syntax and meaning of rules and abbreviations for defretgen and defret-mutual-generate
Defret-mutual-generate
Generate a defret-mutual form using rules that produce hyps and conclusion conjuncts based on define formal and return specifiers.
Def-retgen-fnset
Give a name to a set of functions and mutual recursions that may be used in defretgen.