Level 3 Substitution Rules, Both Directions.
(aig-and-pass6 x y) → (mv status arg1 arg2)
Function:
(defun aig-and-pass6$inline (x y) (declare (xargs :guard t)) (let ((__function__ 'aig-and-pass6)) (declare (ignorable __function__)) (b* (((mv status arg1 arg2) (aig-and-pass6a y x)) ((unless (eq status :fail)) (mv status arg1 arg2))) (aig-and-pass6a x y))))
Theorem:
(defthm aig-and-pass6-correct (b* (((mv ?status ?arg1 ?arg2) (aig-and-pass6$inline x y))) (equal (and (aig-eval arg1 env) (aig-eval arg2 env)) (and (aig-eval x env) (aig-eval y env)))) :rule-classes nil)
Theorem:
(defthm aig-and-pass6-reduces-count (b* (((mv ?status ?arg1 ?arg2) (aig-and-pass6$inline x y))) (implies (eq status :reduced) (< (+ (aig-and-count arg1) (aig-and-count arg2)) (+ (aig-and-count x) (aig-and-count y))))) :rule-classes nil)
Theorem:
(defthm aig-and-pass6-subterm-convention (b* (((mv ?status ?arg1 ?arg2) (aig-and-pass6$inline x y))) (implies (equal status :subterm) (equal arg2 arg1))))
Theorem:
(defthm aig-and-pass6-arg2-on-failure (b* (((mv ?status ?arg1 ?arg2) (aig-and-pass6$inline x y))) (implies (and (equal status :fail) y) (iff arg2 t))))
Theorem:
(defthm aig-and-pass6-when-fail (b* (((mv ?status ?arg1 ?arg2) (aig-and-pass6$inline x y))) (implies (and (not (equal status :subterm)) (not (equal status :reduced))) (and (equal status :fail) (equal arg1 x) (equal arg2 y)))))