Mark all the variables in the formal parameters and body of an ACL2 function definition as `new' or `old'
(atj-mark-formals+body formals body) → (mv new-formals new-body)
This is the top level of the marking algorithm; this top level is discussed in atj-mark-term.
Function:
(defun atj-mark-formals+body (formals body) (declare (xargs :guard (and (symbol-listp formals) (pseudo-termp body)))) (let ((__function__ 'atj-mark-formals+body)) (declare (ignorable __function__)) (b* ((marked-formals (atj-mark-vars-new formals)) ((mv marked-body &) (atj-mark-term body formals nil formals))) (mv marked-formals marked-body))))
Theorem:
(defthm symbol-listp-of-atj-mark-formals+body.new-formals (b* (((mv ?new-formals ?new-body) (atj-mark-formals+body formals body))) (symbol-listp new-formals)) :rule-classes :rewrite)
Theorem:
(defthm pseudo-termp-of-atj-mark-formals+body.new-body (implies (and (symbol-listp formals) (pseudo-termp body)) (b* (((mv ?new-formals ?new-body) (atj-mark-formals+body formals body))) (pseudo-termp new-body))) :rule-classes :rewrite)
Theorem:
(defthm len-of-atj-mark-formals+body.new-formals (b* (((mv ?new-formals ?new-body) (atj-mark-formals+body formals body))) (equal (len new-formals) (len formals))))