Retrieve the Java class name for an ACL2 package name from the mapping, ensuring that the name is present.
(atj-get-pkg-class-name pkg pkg-class-names) → class
This function causes an error if the package name is not in the alist, but it should always be called with arguments that do not result in the error. In other words, the error is never expected to actually happen.
Function:
(defun atj-get-pkg-class-name (pkg pkg-class-names) (declare (xargs :guard (and (stringp pkg) (string-string-alistp pkg-class-names)))) (let ((__function__ 'atj-get-pkg-class-name)) (declare (ignorable __function__)) (b* ((pair (assoc-equal pkg pkg-class-names)) ((unless (consp pair)) (raise "Internal error: no class name for package ~x0." pkg) "")) (cdr pair))))
Theorem:
(defthm stringp-of-atj-get-pkg-class-name (implies (string-string-alistp pkg-class-names) (b* ((class (atj-get-pkg-class-name pkg pkg-class-names))) (stringp class))) :rule-classes :rewrite)