Generate a theorem for the transformation of a declaration.
(gen-declon-thm old new vartys-pre
vartys-post const-new thm-index hints)
→
(mv thm-event thm-name updated-thm-index)The declarations must be of objects in blocks.
Function:
(defun gen-declon-thm (old new vartys-pre vartys-post const-new thm-index hints) (declare (xargs :guard (and (declonp old) (declonp new) (c::ident-type-mapp vartys-pre) (c::ident-type-mapp vartys-post) (symbolp const-new) (posp thm-index) (true-listp hints)))) (declare (xargs :guard (and (declon-unambp old) (declon-annop old) (declon-unambp new) (declon-annop new)))) (let ((__function__ 'gen-declon-thm)) (declare (ignorable __function__)) (b* ((old (declon-fix old)) (new (declon-fix new)) ((unless (declon-block-formalp old)) (raise "Internal error: ~x0 is not in the formalized subset." old) (mv '(_) nil 1)) ((unless (declon-block-formalp new)) (raise "Internal error: ~x0 is not in the formalized subset." new) (mv '(_) nil 1)) (vars-pre (gen-var-assertions vartys-pre 'compst)) (vars-post (gen-var-assertions vartys-post 'old-compst)) ((mv & old-declon) (ldm-declon-obj old)) ((mv & new-declon) (ldm-declon-obj new)) (formula (cons 'b* (cons (cons (cons 'old-declon (cons (cons 'quote (cons old-declon 'nil)) 'nil)) (cons (cons 'new-declon (cons (cons 'quote (cons new-declon 'nil)) 'nil)) '((old-compst (c::exec-obj-declon old-declon compst old-fenv limit)) (new-compst (c::exec-obj-declon new-declon compst new-fenv limit))))) (cons (cons 'implies (cons (cons 'and (cons '(> (c::compustate-frames-number compst) 0) (append vars-pre '((not (c::errorp old-compst)))))) (cons (cons 'and (cons '(not (c::errorp new-compst)) (cons '(equal old-compst new-compst) 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-declon-thm.thm-event (b* (((mv ?thm-event ?thm-name ?updated-thm-index) (gen-declon-thm old new vartys-pre vartys-post const-new thm-index hints))) (pseudo-event-formp thm-event)) :rule-classes :rewrite)
Theorem:
(defthm symbolp-of-gen-declon-thm.thm-name (b* (((mv ?thm-event ?thm-name ?updated-thm-index) (gen-declon-thm old new vartys-pre vartys-post const-new thm-index hints))) (symbolp thm-name)) :rule-classes :rewrite)
Theorem:
(defthm posp-of-gen-declon-thm.updated-thm-index (b* (((mv ?thm-event ?thm-name ?updated-thm-index) (gen-declon-thm old new vartys-pre vartys-post const-new thm-index hints))) (posp updated-thm-index)) :rule-classes :rewrite)
Theorem:
(defthm gen-declon-thm-of-declon-fix-old (equal (gen-declon-thm (declon-fix old) new vartys-pre vartys-post const-new thm-index hints) (gen-declon-thm old new vartys-pre vartys-post const-new thm-index hints)))
Theorem:
(defthm gen-declon-thm-declon-equiv-congruence-on-old (implies (c$::declon-equiv old old-equiv) (equal (gen-declon-thm old new vartys-pre vartys-post const-new thm-index hints) (gen-declon-thm old-equiv new vartys-pre vartys-post const-new thm-index hints))) :rule-classes :congruence)
Theorem:
(defthm gen-declon-thm-of-declon-fix-new (equal (gen-declon-thm old (declon-fix new) vartys-pre vartys-post const-new thm-index hints) (gen-declon-thm old new vartys-pre vartys-post const-new thm-index hints)))
Theorem:
(defthm gen-declon-thm-declon-equiv-congruence-on-new (implies (c$::declon-equiv new new-equiv) (equal (gen-declon-thm old new vartys-pre vartys-post const-new thm-index hints) (gen-declon-thm old new-equiv vartys-pre vartys-post const-new thm-index hints))) :rule-classes :congruence)