• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
          • Isodata
          • Simplify-defun
          • Tailrec
          • 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
            • Defaults-table
            • Xdoc::apt-constructors
            • Input-processors
            • Transformation-table
              • Remove-irrelevant-inputs-from-transformation-call
                • Record-transformation-call-event
                • Previous-transformation-expansion
              • Find-base-cases
              • Untranslate-specifier-utilities
              • Print-specifier-utilities
              • Hints-specifier-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
          • C
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Transformation-table

    Remove-irrelevant-inputs-from-transformation-call

    Remove from a call to a transformation the :print and :show-only inputs, if present.

    Signature
    (remove-irrelevant-inputs-from-transformation-call call wrld) 
      → 
    call-without-print-showonly
    Arguments
    call — Guard (pseudo-event-formp call).
    wrld — Guard (plist-worldp wrld).
    Returns
    call-without-print-showonly — Type (pseudo-event-formp call-without-print-showonly), given (pseudo-event-formp call).

    See the discussion here for motivation.

    A transformation macro consists of some mandatory inputs followed by some optional keyed inputs. We look up the number of required arguments of the macro, and use that to separate mandatory and optional inputs. We trim the optional inputs and we join them with the mandatory ones to form the trimmed call to return.

    Definitions and Theorems

    Function: remove-irrelevant-inputs-from-transformation-call

    (defun remove-irrelevant-inputs-from-transformation-call (call wrld)
     (declare (xargs :guard (and (pseudo-event-formp call)
                                 (plist-worldp wrld))))
     (let ((__function__
                'remove-irrelevant-inputs-from-transformation-call))
       (declare (ignorable __function__))
       (b*
         (((cons name args) call)
          (number-of-mandatory-inputs
               (len (macro-required-args name wrld)))
          (mandatory-inputs (take number-of-mandatory-inputs args))
          (optional-inputs (nthcdr number-of-mandatory-inputs args))
          (optional-inputs (remove-keyword :print optional-inputs))
          (optional-inputs (remove-keyword :show-only optional-inputs)))
         (cons name
               (append mandatory-inputs optional-inputs)))))

    Theorem: pseudo-event-formp-of-remove-irrelevant-inputs-from-transformation-call

    (defthm
     pseudo-event-formp-of-remove-irrelevant-inputs-from-transformation-call
     (implies
      (pseudo-event-formp call)
      (b*
       ((call-without-print-showonly
         (remove-irrelevant-inputs-from-transformation-call call wrld)))
       (pseudo-event-formp call-without-print-showonly)))
     :rule-classes :rewrite)