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