Generate an updated symbol table according to entering a new scope.
(atc-gen-enter-inscope fn fn-guard inscope context compst-var prec-tags thm-index names-to-avoid wrld) → (mv new-inscope new-context events thm-index names-to-avoid)
The context is updated with a let binding for the computation state that updates it via enter-scope; we return the updated context. We use atc-gen-new-inscope to generate most of the new symbol table and then we add a new empty scope to it.
The theorems for the new symbol table are proved from the old ones using the rule that reduces objdesign-of-var and read-object of enter-scope to just objdesign-of-var and read-object. The hypothesis of that rule saying that there are frames is discharged via the rules in atc-compustate-frames-number-rules: the computation state that enter-scope is applied to always starts with add-frame or enter-scope or add-var; there may be other forms possible, which we will handle later. For pointers, we also need the rule that reduces read-object of the object designator of enter-scope to just read-object of enter-scope.
Function:
(defun atc-gen-enter-inscope (fn fn-guard inscope context compst-var prec-tags thm-index names-to-avoid wrld) (declare (xargs :guard (and (symbolp fn) (symbolp fn-guard) (atc-symbol-varinfo-alist-listp inscope) (atc-contextp context) (symbolp compst-var) (atc-string-taginfo-alistp prec-tags) (posp thm-index) (symbol-listp names-to-avoid) (plist-worldp wrld)))) (let ((__function__ 'atc-gen-enter-inscope)) (declare (ignorable __function__)) (b* ((premise (make-atc-premise-compustate :var compst-var :term (cons 'enter-scope (cons compst-var 'nil)))) (new-context (atc-context-extend context (list premise))) (rules '(objdesign-of-var-of-enter-scope-iff read-object-of-objdesign-of-var-of-enter-scope compustate-frames-number-of-add-frame-not-zero compustate-frames-number-of-enter-scope-not-zero compustate-frames-number-of-add-var-not-zero read-object-of-enter-scope)) ((mv new-inscope events names-to-avoid) (atc-gen-new-inscope fn fn-guard inscope new-context compst-var rules prec-tags thm-index names-to-avoid wrld))) (mv (cons nil new-inscope) new-context events (1+ thm-index) names-to-avoid))))
Theorem:
(defthm atc-symbol-varinfo-alist-listp-of-atc-gen-enter-inscope.new-inscope (implies (atc-symbol-varinfo-alist-listp inscope) (b* (((mv ?new-inscope ?new-context ?events ?thm-index ?names-to-avoid) (atc-gen-enter-inscope fn fn-guard inscope context compst-var prec-tags thm-index names-to-avoid wrld))) (atc-symbol-varinfo-alist-listp new-inscope))) :rule-classes :rewrite)
Theorem:
(defthm atc-contextp-of-atc-gen-enter-inscope.new-context (implies (atc-contextp context) (b* (((mv ?new-inscope ?new-context ?events ?thm-index ?names-to-avoid) (atc-gen-enter-inscope fn fn-guard inscope context compst-var prec-tags thm-index names-to-avoid wrld))) (atc-contextp new-context))) :rule-classes :rewrite)
Theorem:
(defthm pseudo-event-form-listp-of-atc-gen-enter-inscope.events (b* (((mv ?new-inscope ?new-context ?events ?thm-index ?names-to-avoid) (atc-gen-enter-inscope fn fn-guard inscope context compst-var prec-tags thm-index names-to-avoid wrld))) (pseudo-event-form-listp events)) :rule-classes :rewrite)
Theorem:
(defthm posp-of-atc-gen-enter-inscope.thm-index (implies (posp thm-index) (b* (((mv ?new-inscope ?new-context ?events ?thm-index ?names-to-avoid) (atc-gen-enter-inscope fn fn-guard inscope context compst-var prec-tags thm-index names-to-avoid wrld))) (posp thm-index))) :rule-classes :rewrite)
Theorem:
(defthm symbol-listp-of-atc-gen-enter-inscope.names-to-avoid (implies (symbol-listp names-to-avoid) (b* (((mv ?new-inscope ?new-context ?events ?thm-index ?names-to-avoid) (atc-gen-enter-inscope fn fn-guard inscope context compst-var prec-tags thm-index names-to-avoid wrld))) (symbol-listp names-to-avoid))) :rule-classes :rewrite)