Extension of 4v-sexpr-compose to alists.
(4v-sexpr-compose-alist x al) is given an alist
It is beneficial for
Function:
(defun 4v-sexpr-compose-alist1 (x al) "Assumes AL is fast" (declare (xargs :guard t)) (cond ((atom x) nil) ((atom (car x)) (4v-sexpr-compose-alist1 (cdr x) al)) (t (cons (cons (caar x) (4v-sexpr-compose (cdar x) al)) (4v-sexpr-compose-alist1 (cdr x) al)))))
Function:
(defun 4v-sexpr-compose-alist (x al) "Makes AL fast if necessary" (declare (xargs :guard t)) (mbe :logic (cond ((atom x) nil) ((atom (car x)) (4v-sexpr-compose-alist (cdr x) al)) (t (cons (cons (caar x) (4v-sexpr-compose (cdar x) al)) (4v-sexpr-compose-alist (cdr x) al)))) :exec (with-fast-alist al (4v-sexpr-compose-alist1 x al))))
Theorem:
(defthm 4v-sexpr-compose-alist1-removal (equal (4v-sexpr-compose-alist1 x al) (4v-sexpr-compose-alist x al)))
Theorem:
(defthm hons-assoc-equal-4v-sexpr-compose-alist (equal (hons-assoc-equal k (4v-sexpr-compose-alist x al)) (and (hons-assoc-equal k x) (cons k (4v-sexpr-compose (cdr (hons-assoc-equal k x)) al)))))
Theorem:
(defthm 4v-sexpr-eval-alist-4v-sexpr-compose-alist (equal (4v-sexpr-eval-alist (4v-sexpr-compose-alist x al) env) (4v-sexpr-eval-alist x (4v-sexpr-eval-alist al env))))
Theorem:
(defthm alist-keys-4v-sexpr-compose-alist (equal (alist-keys (4v-sexpr-compose-alist al env)) (alist-keys al)))
Theorem:
(defthm 4v-sexpr-compose-alist-append (equal (4v-sexpr-compose-alist (append al1 al2) env) (append (4v-sexpr-compose-alist al1 env) (4v-sexpr-compose-alist al2 env))))