• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
          • Simplify-defun
          • Isodata
          • Tailrec
            • Tailrec-implementation
              • Tailrec-event-generation
              • Tailrec-fn
              • Tailrec-macro-definition
                • Tailrec-input-processing
            • Schemalg
            • Restrict
            • Expdata
            • Casesplit
            • Simplify-term
            • Simplify-defun-sk
            • Parteval
            • Solve
            • Wrap-output
            • Propagate-iso
            • Simplify
            • Finite-difference
            • Drop-irrelevant-params
            • Copy-function
            • Lift-iso
            • Rename-params
            • Utilities
            • Simplify-term-programmatic
            • Simplify-defun-sk-programmatic
            • Simplify-defun-programmatic
            • Simplify-defun+
            • Common-options
            • Common-concepts
          • Error-checking
          • Fty-extensions
          • 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
    • Tailrec-implementation

    Tailrec-macro-definition

    Definition of the tailrec macro.

    Submit the event form generated by tailrec-fn.

    Macro: tailrec

    (defmacro tailrec
          (&whole call old &key (variant ':monoid)
                  (domain ':auto)
                  (new-name ':auto)
                  (new-enable ':auto)
                  (accumulator ':auto)
                  (wrapper 'nil)
                  (wrapper-name ':auto
                                wrapper-name-present)
                  (wrapper-enable ':irrelevant
                                  wrapper-enable-present)
                  (old-to-new-name ':irrelevant
                                   old-to-new-name-present)
                  (old-to-new-enable ':irrelevant
                                     old-to-new-enable-present)
                  (new-to-old-name ':irrelevant
                                   new-to-old-name-present)
                  (new-to-old-enable ':irrelevant
                                     new-to-old-enable-present)
                  (old-to-wrapper-name ':irrelevant
                                       old-to-wrapper-name-present)
                  (old-to-wrapper-enable ':irrelevant
                                         old-to-wrapper-enable-present)
                  (wrapper-to-old-name ':irrelevant
                                       wrapper-to-old-name-present)
                  (wrapper-to-old-enable ':irrelevant
                                         wrapper-to-old-enable-present)
                  (verify-guards ':auto)
                  (hints 'nil)
                  (print ':result)
                  (show-only 'nil))
     (cons
      'make-event-terse
      (cons
       (cons
        'tailrec-fn
        (cons
         (cons 'quote (cons old 'nil))
         (cons
          (cons 'quote (cons variant 'nil))
          (cons
           (cons 'quote (cons domain 'nil))
           (cons
            (cons 'quote (cons new-name 'nil))
            (cons
             (cons 'quote (cons new-enable 'nil))
             (cons
              (cons 'quote (cons accumulator 'nil))
              (cons
               (cons 'quote (cons wrapper 'nil))
               (cons
                (cons 'quote (cons wrapper-name 'nil))
                (cons
                 (cons 'quote
                       (cons wrapper-name-present 'nil))
                 (cons
                  (cons 'quote (cons wrapper-enable 'nil))
                  (cons
                   (cons 'quote
                         (cons wrapper-enable-present 'nil))
                   (cons
                    (cons 'quote
                          (cons old-to-new-name 'nil))
                    (cons
                     (cons 'quote
                           (cons old-to-new-name-present 'nil))
                     (cons
                      (cons 'quote
                            (cons old-to-new-enable 'nil))
                      (cons
                       (cons 'quote
                             (cons old-to-new-enable-present 'nil))
                       (cons
                        (cons 'quote
                              (cons new-to-old-name 'nil))
                        (cons
                         (cons 'quote
                               (cons new-to-old-name-present 'nil))
                         (cons
                          (cons 'quote
                                (cons new-to-old-enable 'nil))
                          (cons
                           (cons 'quote
                                 (cons new-to-old-enable-present 'nil))
                           (cons
                            (cons 'quote
                                  (cons old-to-wrapper-name 'nil))
                            (cons
                             (cons
                                'quote
                                (cons old-to-wrapper-name-present 'nil))
                             (cons
                              (cons 'quote
                                    (cons old-to-wrapper-enable 'nil))
                              (cons
                               (cons
                                'quote
                                (cons
                                    old-to-wrapper-enable-present 'nil))
                               (cons
                                (cons 'quote
                                      (cons wrapper-to-old-name 'nil))
                                (cons
                                 (cons
                                  'quote
                                  (cons
                                      wrapper-to-old-name-present 'nil))
                                 (cons
                                  (cons
                                      'quote
                                      (cons wrapper-to-old-enable 'nil))
                                  (cons
                                   (cons
                                     'quote
                                     (cons wrapper-to-old-enable-present
                                           'nil))
                                   (cons
                                    (cons 'quote
                                          (cons verify-guards 'nil))
                                    (cons
                                     (cons 'quote (cons hints 'nil))
                                     (cons
                                      (cons 'quote (cons print 'nil))
                                      (cons
                                       (cons 'quote
                                             (cons show-only 'nil))
                                       (cons
                                        (cons 'quote (cons call 'nil))
                                        (cons
                                         (cons
                                          'cons
                                          (cons
                                            ''tailrec
                                            (cons (cons 'quote
                                                        (cons old 'nil))
                                                  'nil)))
                                         '(state)))))))))))))))))))))))))))))))))))
       (cons ':suppress-errors
             (cons (not print) 'nil)))))