(vl-elabscopes-subscope key scopes &key (allow-empty 'nil)) → subscope
Function:
(defun vl-elabscopes-subscope-fn (key scopes allow-empty) (declare (xargs :guard (and (vl-elabkey-p key) (vl-elabscopes-p scopes)))) (let ((__function__ 'vl-elabscopes-subscope)) (declare (ignorable __function__)) (b* ((scopes (vl-elabscopes-fix scopes)) ((when (consp scopes)) (vl-elabscope-subscope key (cdar scopes)))) (and (not allow-empty) (raise "Can't get root scope of empty elabscopes")))))
Theorem:
(defthm return-type-of-vl-elabscopes-subscope (b* ((subscope (vl-elabscopes-subscope-fn key scopes allow-empty))) (iff (vl-elabscope-p subscope) subscope)) :rule-classes :rewrite)
Theorem:
(defthm vl-elabscopes-subscope-fn-of-vl-elabkey-fix-key (equal (vl-elabscopes-subscope-fn (vl-elabkey-fix key) scopes allow-empty) (vl-elabscopes-subscope-fn key scopes allow-empty)))
Theorem:
(defthm vl-elabscopes-subscope-fn-vl-elabkey-equiv-congruence-on-key (implies (vl-elabkey-equiv key key-equiv) (equal (vl-elabscopes-subscope-fn key scopes allow-empty) (vl-elabscopes-subscope-fn key-equiv scopes allow-empty))) :rule-classes :congruence)
Theorem:
(defthm vl-elabscopes-subscope-fn-of-vl-elabscopes-fix-scopes (equal (vl-elabscopes-subscope-fn key (vl-elabscopes-fix scopes) allow-empty) (vl-elabscopes-subscope-fn key scopes allow-empty)))
Theorem:
(defthm vl-elabscopes-subscope-fn-vl-elabscopes-equiv-congruence-on-scopes (implies (vl-elabscopes-equiv scopes scopes-equiv) (equal (vl-elabscopes-subscope-fn key scopes allow-empty) (vl-elabscopes-subscope-fn key scopes-equiv allow-empty))) :rule-classes :congruence)