Equality lifting transformation of
an
(xeq-stmt-if test test-new test-thm-name
then then-new then-thm-name gin)
→
(mv stmt gout)Function:
(defun xeq-stmt-if (test test-new test-thm-name then then-new then-thm-name gin) (declare (xargs :guard (and (exprp test) (exprp test-new) (symbolp test-thm-name) (stmtp then) (stmtp then-new) (symbolp then-thm-name) (ginp gin)))) (declare (xargs :guard (and (expr-unambp test) (expr-annop test) (expr-unambp test-new) (expr-annop test-new) (stmt-unambp then) (stmt-annop then) (stmt-unambp then-new) (stmt-annop then-new)))) (let ((__function__ 'xeq-stmt-if)) (declare (ignorable __function__)) (b* (((gin gin) gin) (stmt (make-stmt-if :test test :then then)) (stmt-new (make-stmt-if :test test-new :then then-new)) ((unless (and test-thm-name then-thm-name)) (mv stmt-new (gout-no-thm gin))) (then-types (stmt-types then)) ((mv & old-test) (ldm-expr test)) ((mv & new-test) (ldm-expr test-new)) ((mv & old-then) (ldm-stmt then)) ((mv & new-then) (ldm-stmt then-new)) ((mv & then-ctypes) (ldm-type-option-set then-types)) (hints (cons (cons '"Goal" (cons ':in-theory (cons ''((:e c::stmt-kind) (:e c::stmt-if->test) (:e c::stmt-if->then) (:e c::stmt-if) (:e c::type-nonchar-integerp) (:e insert) (:e subset) set::subset-in c::compustate-frames-number-of-exec-expr c::compustate-frames-number-of-exec-stmt c::compustatep-when-compustate-resultp-and-not-errorp stmt-compustate-vars) (cons ':use (cons (cons (cons ':instance (cons test-thm-name '((limit (1- limit))))) (cons (cons ':instance (cons then-thm-name (cons (cons 'compst (cons (cons 'mv-nth (cons '1 (cons (cons 'c::exec-expr (cons (cons 'quote (cons old-test 'nil)) '(compst old-fenv (1- limit)))) 'nil))) 'nil)) '((limit (1- limit)))))) (cons (cons ':instance (cons 'stmt-if-true-congruence (cons (cons 'old-test (cons (cons 'quote (cons old-test 'nil)) 'nil)) (cons (cons 'old-then (cons (cons 'quote (cons old-then 'nil)) 'nil)) (cons (cons 'new-test (cons (cons 'quote (cons new-test 'nil)) 'nil)) (cons (cons 'new-then (cons (cons 'quote (cons new-then 'nil)) 'nil)) (cons (cons 'types (cons (cons 'quote (cons then-ctypes 'nil)) 'nil)) 'nil))))))) (cons (cons ':instance (cons 'stmt-if-false-congruence (cons (cons 'old-test (cons (cons 'quote (cons old-test 'nil)) 'nil)) (cons (cons 'old-then (cons (cons 'quote (cons old-then 'nil)) 'nil)) (cons (cons 'new-test (cons (cons 'quote (cons new-test 'nil)) 'nil)) (cons (cons 'new-then (cons (cons 'quote (cons new-then 'nil)) 'nil)) 'nil)))))) (cons (cons ':instance (cons 'stmt-if-test-errors (cons (cons 'test (cons (cons 'quote (cons old-test 'nil)) 'nil)) (cons (cons 'then (cons (cons 'quote (cons old-then 'nil)) 'nil)) '((fenv old-fenv)))))) (cons (cons ':instance (cons 'stmt-if-then-errors (cons (cons 'test (cons (cons 'quote (cons old-test 'nil)) 'nil)) (cons (cons 'then (cons (cons 'quote (cons old-then 'nil)) 'nil)) '((fenv old-fenv)))))) 'nil)))))) 'nil))))) 'nil)) ((mv thm-event thm-name thm-index) (gen-stmt-thm stmt stmt-new gin.vartys gin.const-new gin.thm-index hints))) (mv stmt-new (make-gout :events (cons thm-event gin.events) :thm-index thm-index :thm-name thm-name :vartys gin.vartys)))))
Theorem:
(defthm stmtp-of-xeq-stmt-if.stmt (b* (((mv ?stmt ?gout) (xeq-stmt-if test test-new test-thm-name then then-new then-thm-name gin))) (stmtp stmt)) :rule-classes :rewrite)
Theorem:
(defthm goutp-of-xeq-stmt-if.gout (b* (((mv ?stmt ?gout) (xeq-stmt-if test test-new test-thm-name then then-new then-thm-name gin))) (goutp gout)) :rule-classes :rewrite)
Theorem:
(defthm stmt-unambp-of-xeq-stmt-if (implies (and (expr-unambp test-new) (stmt-unambp then-new)) (b* (((mv ?stmt ?gout) (xeq-stmt-if test test-new test-thm-name then then-new then-thm-name gin))) (stmt-unambp stmt))))
Theorem:
(defthm stmt-annop-of-xeq-stmt-if (implies (and (expr-annop test-new) (stmt-annop then-new)) (b* (((mv ?stmt ?gout) (xeq-stmt-if test test-new test-thm-name then then-new then-thm-name gin))) (stmt-annop stmt))))
Theorem:
(defthm stmt-aidentp-of-xeq-stmt-if (implies (and (expr-aidentp test-new gcc) (stmt-aidentp then-new gcc)) (b* (((mv ?stmt ?gout) (xeq-stmt-if test test-new test-thm-name then then-new then-thm-name gin))) (stmt-aidentp stmt gcc))))