Evaluation semantics of pkg-imports.
(eval-pkg-imports x packages) → result
The evaluation semantics of this function depends on the package definitions in the ACL2 environment. Thus, this meta-level function takes a list of packages as argument (meant to capture the package definitions in the ACL2 environment).
We find the package with the given name.
If the package does not exist, it is an error,
which we model by returning
Function:
(defun eval-pkg-imports (x packages) (declare (xargs :guard (and (valuep x) (package-listp packages)))) (let ((__function__ 'eval-pkg-imports)) (declare (ignorable __function__)) (if (value-case x :string) (b* ((x-string (value-string->get x)) (package? (package-lookup x-string packages)) ((when (not package?)) nil) (imports (package->imports package?))) (value-list-of (value-symbol-list imports))) (value-nil))))
Theorem:
(defthm value-optionp-of-eval-pkg-imports (b* ((result (eval-pkg-imports x packages))) (value-optionp result)) :rule-classes :rewrite)
Theorem:
(defthm eval-pkg-imports-of-value-fix-x (equal (eval-pkg-imports (value-fix x) packages) (eval-pkg-imports x packages)))
Theorem:
(defthm eval-pkg-imports-value-equiv-congruence-on-x (implies (value-equiv x x-equiv) (equal (eval-pkg-imports x packages) (eval-pkg-imports x-equiv packages))) :rule-classes :congruence)
Theorem:
(defthm eval-pkg-imports-of-package-list-fix-packages (equal (eval-pkg-imports x (package-list-fix packages)) (eval-pkg-imports x packages)))
Theorem:
(defthm eval-pkg-imports-package-list-equiv-congruence-on-packages (implies (package-list-equiv packages packages-equiv) (equal (eval-pkg-imports x packages) (eval-pkg-imports x packages-equiv))) :rule-classes :congruence)