Push a frame onto a computation state's call stack.
(push-frame frame compst) → new-compst
Function:
(defun push-frame (frame compst) (declare (xargs :guard (and (framep frame) (compustatep compst)))) (let ((__function__ 'push-frame)) (declare (ignorable __function__)) (b* ((stack (compustate->frames compst)) (new-stack (cons (frame-fix frame) stack))) (change-compustate compst :frames new-stack))))
Theorem:
(defthm compustatep-of-push-frame (b* ((new-compst (push-frame frame compst))) (compustatep new-compst)) :rule-classes :rewrite)
Theorem:
(defthm compustate-frames-number-of-push-frame (b* ((?new-compst (push-frame frame compst))) (equal (compustate-frames-number new-compst) (1+ (compustate-frames-number compst)))))
Theorem:
(defthm push-frame-of-frame-fix-frame (equal (push-frame (frame-fix frame) compst) (push-frame frame compst)))
Theorem:
(defthm push-frame-frame-equiv-congruence-on-frame (implies (frame-equiv frame frame-equiv) (equal (push-frame frame compst) (push-frame frame-equiv compst))) :rule-classes :congruence)
Theorem:
(defthm push-frame-of-compustate-fix-compst (equal (push-frame frame (compustate-fix compst)) (push-frame frame compst)))
Theorem:
(defthm push-frame-compustate-equiv-congruence-on-compst (implies (compustate-equiv compst compst-equiv) (equal (push-frame frame compst) (push-frame frame compst-equiv))) :rule-classes :congruence)