• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
      • B*
      • Defunc
      • Fty
      • Apt
        • Isodata
        • Simplify-defun
        • 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
        • 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
            • Apt
              • Isodata
              • Simplify-defun
              • 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
              • 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
      • Tailrec-implementation

      Tailrec-fn

      Check redundancy, process the inputs, and generate the event to submit.

      Signature
      (tailrec-fn old variant domain 
                  new-name new-enable accumulator wrapper 
                  wrapper-name wrapper-name-present 
                  wrapper-enable wrapper-enable-present 
                  old-to-new-name old-to-new-name-present 
                  old-to-new-enable 
                  old-to-new-enable-present 
                  new-to-old-name new-to-old-name-present 
                  new-to-old-enable 
                  new-to-old-enable-present 
                  old-to-wrapper-name 
                  old-to-wrapper-name-present 
                  old-to-wrapper-enable 
                  old-to-wrapper-enable-present 
                  wrapper-to-old-name 
                  wrapper-to-old-name-present 
                  wrapper-to-old-enable 
                  wrapper-to-old-enable-present 
                  verify-guards 
                  hints print show-only call ctx state) 
       
        → 
      (mv erp event state)
      Arguments
      wrapper-name-present — Guard (booleanp wrapper-name-present).
      wrapper-enable-present — Guard (booleanp wrapper-enable-present).
      old-to-new-name-present — Guard (booleanp old-to-new-name-present).
      old-to-new-enable-present — Guard (booleanp old-to-new-enable-present).
      new-to-old-name-present — Guard (booleanp new-to-old-name-present).
      new-to-old-enable-present — Guard (booleanp new-to-old-enable-present).
      old-to-wrapper-name-present — Guard (booleanp old-to-wrapper-name-present).
      old-to-wrapper-enable-present — Guard (booleanp old-to-wrapper-enable-present).
      wrapper-to-old-name-present — Guard (booleanp wrapper-to-old-name-present).
      wrapper-to-old-enable-present — Guard (booleanp wrapper-to-old-enable-present).
      call — Guard (pseudo-event-formp call).
      Returns
      event — A pseudo-event-formp.

      If this call to the transformation is redundant, a message to that effect is printed on the screen. If the transformation is redundant and :show-only is t, the encapsulate, retrieved from the table, is shown on the screen.

      Definitions and Theorems

      Function: tailrec-fn

      (defun tailrec-fn (old variant domain
                             new-name new-enable accumulator wrapper
                             wrapper-name wrapper-name-present
                             wrapper-enable wrapper-enable-present
                             old-to-new-name old-to-new-name-present
                             old-to-new-enable
                             old-to-new-enable-present
                             new-to-old-name new-to-old-name-present
                             new-to-old-enable
                             new-to-old-enable-present
                             old-to-wrapper-name
                             old-to-wrapper-name-present
                             old-to-wrapper-enable
                             old-to-wrapper-enable-present
                             wrapper-to-old-name
                             wrapper-to-old-name-present
                             wrapper-to-old-enable
                             wrapper-to-old-enable-present
                             verify-guards
                             hints print show-only call ctx state)
       (declare (xargs :stobjs (state)))
       (declare
            (xargs :guard (and (booleanp wrapper-name-present)
                               (booleanp wrapper-enable-present)
                               (booleanp old-to-new-name-present)
                               (booleanp old-to-new-enable-present)
                               (booleanp new-to-old-name-present)
                               (booleanp new-to-old-enable-present)
                               (booleanp old-to-wrapper-name-present)
                               (booleanp old-to-wrapper-enable-present)
                               (booleanp wrapper-to-old-name-present)
                               (booleanp wrapper-to-old-enable-present)
                               (pseudo-event-formp call))))
       (let ((__function__ 'tailrec-fn))
        (declare (ignorable __function__))
        (b*
         ((encapsulate?
               (previous-transformation-expansion call (w state)))
          ((when encapsulate?)
           (b* (((run-when show-only)
                 (cw "~x0~|" encapsulate?)))
             (cw "~%The transformation ~x0 is redundant.~%"
                 call)
             (value '(value-triple :invisible))))
          ((er (list old$ test
                     base nonrec updates combine q r domain$
                     new-name$ new-enable$ a wrapper-name$
                     wrapper-enable$ old-to-new-name$
                     old-to-new-enable$ new-to-old-name$
                     new-to-old-enable$ old-to-wrapper-name$
                     old-to-wrapper-enable$
                     wrapper-to-old-name$
                     wrapper-to-old-enable$
                     verify-guards$ hints$ names-to-avoid))
           (tailrec-process-inputs old variant domain
                                   new-name new-enable accumulator wrapper
                                   wrapper-name wrapper-name-present
                                   wrapper-enable wrapper-enable-present
                                   old-to-new-name old-to-new-name-present
                                   old-to-new-enable
                                   old-to-new-enable-present
                                   new-to-old-name new-to-old-name-present
                                   new-to-old-enable
                                   new-to-old-enable-present
                                   old-to-wrapper-name
                                   old-to-wrapper-name-present
                                   old-to-wrapper-enable
                                   old-to-wrapper-enable-present
                                   wrapper-to-old-name
                                   wrapper-to-old-name-present
                                   wrapper-to-old-enable
                                   wrapper-to-old-enable-present
                                   verify-guards
                                   hints print show-only ctx state))
          ((er event)
           (tailrec-gen-everything old$ test base nonrec updates
                                   combine q r variant domain$ new-name$
                                   new-enable$ a wrapper wrapper-name$
                                   wrapper-enable$ old-to-new-name$
                                   old-to-new-enable$ new-to-old-name$
                                   new-to-old-enable$ old-to-wrapper-name$
                                   old-to-wrapper-enable$
                                   wrapper-to-old-name$
                                   wrapper-to-old-enable$
                                   verify-guards$ hints$ print show-only
                                   call names-to-avoid ctx state)))
         (value event))))