Append a numeric index to a variable.
This is used to make Java variables unique. The index is appended to the result of atj-var-to-jvar, as explained there.
Function:
(defun atj-var-add-index (var index) (declare (xargs :guard (and (symbolp var) (natp index)))) (let ((__function__ 'atj-var-add-index)) (declare (ignorable __function__)) (b* ((index-chars (if (= index 0) nil (append (list #\$) (str::nat-to-dec-chars index)))) (index-string (implode index-chars))) (add-suffix var index-string))))
Theorem:
(defthm symbolp-of-atj-var-add-index (b* ((new-var (atj-var-add-index var index))) (symbolp new-var)) :rule-classes :rewrite)