Generate a theorem for the transformation of a statement.
(gen-stmt-thm old new vartys const-new thm-index hints) → (mv thm-event thm-name updated-thm-index)
Function:
(defun gen-stmt-thm (old new vartys const-new thm-index hints) (declare (xargs :guard (and (stmtp old) (stmtp new) (c::ident-type-mapp vartys) (symbolp const-new) (posp thm-index) (true-listp hints)))) (declare (xargs :guard (and (stmt-unambp old) (stmt-annop old) (stmt-unambp new) (stmt-annop new)))) (let ((__function__ 'gen-stmt-thm)) (declare (ignorable __function__)) (b* ((old (stmt-fix old)) (new (stmt-fix new)) ((unless (stmt-formalp old)) (raise "Internal error: ~x0 is not in the formalized subset." old) (mv '(_) nil 1)) ((unless (stmt-formalp new)) (raise "Internal error: ~x0 is not in the formalized subset." new) (mv '(_) nil 1)) (types (stmt-types old)) ((unless (equal (stmt-types new) types)) (raise "Internal error: ~ the types ~x0 of the new statement ~x1 differ from ~ the types ~x2 of the old statement ~x3." (stmt-types new) new types old) (mv '(_) nil 1)) (vars-pre (gen-var-assertions vartys 'compst)) (vars-post (gen-var-assertions vartys 'old-compst)) ((mv & old-stmt) (ldm-stmt old)) ((mv & new-stmt) (ldm-stmt new)) ((mv & ctypes) (ldm-type-option-set types)) (formula (cons 'b* (cons (cons (cons 'old-stmt (cons (cons 'quote (cons old-stmt 'nil)) 'nil)) (cons (cons 'new-stmt (cons (cons 'quote (cons new-stmt 'nil)) 'nil)) '(((mv old-sval old-compst) (c::exec-stmt old-stmt compst old-fenv limit)) ((mv new-sval new-compst) (c::exec-stmt new-stmt compst new-fenv limit))))) (cons (cons 'implies (cons (cons 'and (cons '(> (c::compustate-frames-number compst) 0) (append vars-pre '((not (c::errorp old-sval)))))) (cons (cons 'and (cons '(not (c::errorp new-sval)) (cons '(equal old-sval new-sval) (cons '(equal old-compst new-compst) (cons (cons 'in (cons '(c::type-option-of-stmt-value old-sval) (cons (cons 'quote (cons ctypes 'nil)) 'nil))) vars-post))))) 'nil))) 'nil)))) ((mv thm-name thm-index) (gen-thm-name const-new thm-index)) (thm-event (cons 'defrule (cons thm-name (cons formula (cons ':rule-classes (cons 'nil (cons ':hints (cons hints 'nil))))))))) (mv thm-event thm-name thm-index))))
Theorem:
(defthm pseudo-event-formp-of-gen-stmt-thm.thm-event (b* (((mv ?thm-event ?thm-name ?updated-thm-index) (gen-stmt-thm old new vartys const-new thm-index hints))) (pseudo-event-formp thm-event)) :rule-classes :rewrite)
Theorem:
(defthm symbolp-of-gen-stmt-thm.thm-name (b* (((mv ?thm-event ?thm-name ?updated-thm-index) (gen-stmt-thm old new vartys const-new thm-index hints))) (symbolp thm-name)) :rule-classes :rewrite)
Theorem:
(defthm posp-of-gen-stmt-thm.updated-thm-index (b* (((mv ?thm-event ?thm-name ?updated-thm-index) (gen-stmt-thm old new vartys const-new thm-index hints))) (posp updated-thm-index)) :rule-classes :rewrite)
Theorem:
(defthm gen-stmt-thm-of-stmt-fix-old (equal (gen-stmt-thm (stmt-fix old) new vartys const-new thm-index hints) (gen-stmt-thm old new vartys const-new thm-index hints)))
Theorem:
(defthm gen-stmt-thm-stmt-equiv-congruence-on-old (implies (c$::stmt-equiv old old-equiv) (equal (gen-stmt-thm old new vartys const-new thm-index hints) (gen-stmt-thm old-equiv new vartys const-new thm-index hints))) :rule-classes :congruence)
Theorem:
(defthm gen-stmt-thm-of-stmt-fix-new (equal (gen-stmt-thm old (stmt-fix new) vartys const-new thm-index hints) (gen-stmt-thm old new vartys const-new thm-index hints)))
Theorem:
(defthm gen-stmt-thm-stmt-equiv-congruence-on-new (implies (c$::stmt-equiv new new-equiv) (equal (gen-stmt-thm old new vartys const-new thm-index hints) (gen-stmt-thm old new-equiv vartys const-new thm-index hints))) :rule-classes :congruence)