• 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
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
        • Soft
          • Soft-future-work
          • Soft-macros
          • Updates-to-workshop-material
          • Soft-implementation
            • Soft-implementation-core
              • Sothm-inst-facts
              • Ext-fun-subst-term/terms/function
              • Fun-subst-function
              • Sothm-inst-pairs
              • Funvars-of-term/terms
              • Funvars-of-plain-fn
              • Sothm-inst-proof
              • Fun-subst-term/terms
                • Fun-subst-term
                • Fun-subst-terms
              • Get-sof-instance
              • Sof-instancesp
              • Put-sof-instance
              • Fun-substp
              • Sofun-kindp
              • Funvar-listp
              • *-listp
              • Funvars-of-quantifier-fn
              • No-trivial-pairsp
              • Funvars-of-choice-fn
              • Funvar-instp
              • Funvars-of-thm
              • Sofunp
              • Funvarp
              • Sof-instances
              • Sothmp
              • Quant-sofunp
              • Plain-sofunp
              • Funvar-inst-listp
              • Choice-sofunp
              • Sofun-funvars
              • Sofun-kind
              • Function-variables-table
              • Sof-instances-table
              • Second-order-functions-table
            • Gen-macro2-of-macro
            • Defun-inst-implementation
            • Defthm-inst-implementation
            • Defsoft-implementation
            • Defunvar-implementation
            • Defund-sk2-implementation
            • Defun-sk2-implementation
            • Define-sk2-implementation
            • Defchoose2-implementation
            • Defund2-implementation
            • Defun2-implementation
            • Define2-implementation
          • Soft-notions
        • 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
  • Soft-implementation-core

Fun-subst-term/terms

Apply function substitutions to terms.

See the discussion in fun-subst-function.

Function: fun-subst-term

(defun fun-subst-term (fsbs term wrld)
 (declare (xargs :guard (and (fun-substp fsbs)
                             (pseudo-termp term)
                             (plist-worldp wrld))))
 (let ((__function__ 'fun-subst-term))
  (declare (ignorable __function__))
  (if (or (variablep term) (quotep term))
      term
    (let*
       ((fn (fn-symb term))
        (new-fn (if (symbolp fn)
                    (fun-subst-function fsbs fn wrld)
                  (make-lambda (lambda-formals fn)
                               (fun-subst-term fsbs (lambda-body fn)
                                               wrld))))
        (new-args (fun-subst-terms fsbs (fargs term)
                                   wrld)))
      (cons new-fn new-args)))))

Function: fun-subst-terms

(defun fun-subst-terms (fsbs terms wrld)
  (declare (xargs :guard (and (fun-substp fsbs)
                              (pseudo-term-listp terms)
                              (plist-worldp wrld))))
  (let ((__function__ 'fun-subst-terms))
    (declare (ignorable __function__))
    (if (endp terms)
        nil
      (cons (fun-subst-term fsbs (car terms) wrld)
            (fun-subst-terms fsbs (cdr terms)
                             wrld)))))

Definitions and Theorems

Function: fun-subst-term

(defun fun-subst-term (fsbs term wrld)
 (declare (xargs :guard (and (fun-substp fsbs)
                             (pseudo-termp term)
                             (plist-worldp wrld))))
 (let ((__function__ 'fun-subst-term))
  (declare (ignorable __function__))
  (if (or (variablep term) (quotep term))
      term
    (let*
       ((fn (fn-symb term))
        (new-fn (if (symbolp fn)
                    (fun-subst-function fsbs fn wrld)
                  (make-lambda (lambda-formals fn)
                               (fun-subst-term fsbs (lambda-body fn)
                                               wrld))))
        (new-args (fun-subst-terms fsbs (fargs term)
                                   wrld)))
      (cons new-fn new-args)))))

Function: fun-subst-terms

(defun fun-subst-terms (fsbs terms wrld)
  (declare (xargs :guard (and (fun-substp fsbs)
                              (pseudo-term-listp terms)
                              (plist-worldp wrld))))
  (let ((__function__ 'fun-subst-terms))
    (declare (ignorable __function__))
    (if (endp terms)
        nil
      (cons (fun-subst-term fsbs (car terms) wrld)
            (fun-subst-terms fsbs (cdr terms)
                             wrld)))))

Subtopics

Fun-subst-term
Fun-subst-terms