Equality lifting transformation of an
(xeq-stmt-ifelse test test-new test-thm-name
then then-new then-thm-name
else else-new else-thm-name gin)
→
(mv stmt gout)Function:
(defun xeq-stmt-ifelse (test test-new test-thm-name then then-new then-thm-name else else-new else-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) (stmtp else) (stmtp else-new) (symbolp else-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) (stmt-unambp else) (stmt-annop else) (stmt-unambp else-new) (stmt-annop else-new)))) (let ((__function__ 'xeq-stmt-ifelse)) (declare (ignorable __function__)) (b* (((gin gin) gin) (stmt (make-stmt-ifelse :test test :then then :else else)) (stmt-new (make-stmt-ifelse :test test-new :then then-new :else else-new)) ((unless (and test-thm-name then-thm-name else-thm-name)) (mv stmt-new (gout-no-thm gin))) (then-types (stmt-types then)) (else-types (stmt-types else)) ((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 & old-else) (ldm-stmt else)) ((mv & new-else) (ldm-stmt else-new)) ((mv & then-ctypes) (ldm-type-option-set then-types)) ((mv & else-ctypes) (ldm-type-option-set else-types)) (hints (cons (cons '"Goal" (cons ':in-theory (cons ''((:e c::stmt-kind) (:e c::stmt-ifelse->test) (:e c::stmt-ifelse->then) (:e c::stmt-ifelse->else) (:e c::stmt-ifelse) (: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 else-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-ifelse-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 'old-else (cons (cons 'quote (cons old-else '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 'new-else (cons (cons 'quote (cons new-else 'nil)) 'nil)) (cons (cons 'types (cons (cons 'quote (cons then-ctypes 'nil)) 'nil)) 'nil))))))))) (cons (cons ':instance (cons 'stmt-ifelse-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 'old-else (cons (cons 'quote (cons old-else '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 'new-else (cons (cons 'quote (cons new-else 'nil)) 'nil)) (cons (cons 'types (cons (cons 'quote (cons else-ctypes 'nil)) 'nil)) 'nil))))))))) (cons (cons ':instance (cons 'stmt-ifelse-test-errors (cons (cons 'test (cons (cons 'quote (cons old-test 'nil)) 'nil)) (cons (cons 'then (cons (cons 'quote (cons old-then 'nil)) 'nil)) (cons (cons 'else (cons (cons 'quote (cons old-else 'nil)) 'nil)) '((fenv old-fenv))))))) (cons (cons ':instance (cons 'stmt-ifelse-then-errors (cons (cons 'test (cons (cons 'quote (cons old-test 'nil)) 'nil)) (cons (cons 'then (cons (cons 'quote (cons old-then 'nil)) 'nil)) (cons (cons 'else (cons (cons 'quote (cons old-else 'nil)) 'nil)) '((fenv old-fenv))))))) (cons (cons ':instance (cons 'stmt-ifelse-else-errors (cons (cons 'test (cons (cons 'quote (cons old-test 'nil)) 'nil)) (cons (cons 'then (cons (cons 'quote (cons old-then 'nil)) 'nil)) (cons (cons 'else (cons (cons 'quote (cons old-else '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-ifelse.stmt (b* (((mv ?stmt ?gout) (xeq-stmt-ifelse test test-new test-thm-name then then-new then-thm-name else else-new else-thm-name gin))) (stmtp stmt)) :rule-classes :rewrite)
Theorem:
(defthm goutp-of-xeq-stmt-ifelse.gout (b* (((mv ?stmt ?gout) (xeq-stmt-ifelse test test-new test-thm-name then then-new then-thm-name else else-new else-thm-name gin))) (goutp gout)) :rule-classes :rewrite)
Theorem:
(defthm stmt-unambp-of-xeq-stmt-ifelse (implies (and (expr-unambp test-new) (stmt-unambp then-new) (stmt-unambp else-new)) (b* (((mv ?stmt ?gout) (xeq-stmt-ifelse test test-new test-thm-name then then-new then-thm-name else else-new else-thm-name gin))) (stmt-unambp stmt))))
Theorem:
(defthm stmt-annop-of-xeq-stmt-ifelse (implies (and (expr-annop test-new) (stmt-annop then-new) (stmt-annop else-new)) (b* (((mv ?stmt ?gout) (xeq-stmt-ifelse test test-new test-thm-name then then-new then-thm-name else else-new else-thm-name gin))) (stmt-annop stmt))))
Theorem:
(defthm stmt-aidentp-of-xeq-stmt-ifelse (implies (and (expr-aidentp test-new gcc) (stmt-aidentp then-new gcc) (stmt-aidentp else-new gcc)) (b* (((mv ?stmt ?gout) (xeq-stmt-ifelse test test-new test-thm-name then then-new then-thm-name else else-new else-thm-name gin))) (stmt-aidentp stmt gcc))))