(al->pat pat al default) builds a new data object that is compatible with
For instance,
(al->pat '((a (b c)) d) '((a . 1) (b . 2) (d . 4)) 'oops) --> ((1 (2 oops)) 4)
Note that
Function:
(defun al->pat (pat al default) (declare (xargs :guard t)) (if pat (if (atom pat) (let ((look (hons-get pat al))) (if look (cdr look) default)) (cons (al->pat (car pat) al default) (al->pat (cdr pat) al default))) nil))
Theorem:
(defthm true-listp-al->pat (implies (true-listp pat) (true-listp (al->pat pat al default))) :rule-classes ((:rewrite) (:type-prescription)))
Theorem:
(defthm len-al->pat (implies (true-listp pat) (equal (len (al->pat pat al default)) (len pat))))