Apply onehot-rewriting to a single s-expression.
(4v-onehot-rw-sexpr vars sexpr) is given:
It returns a new sexpression that is a (possibly simpler) conservative
approximation of
We usually don't call this function in practice, because 4v-onehot-rw-sexpr-alist uses a more efficient scheme that bypasses it. On the other hand, it's a nice function for reasoning about.
Function:
(defun 4v-onehot-rw-sexpr (vars sexpr) (declare (xargs :guard (and (atom-listp vars) (not (member-equal nil vars))))) (4vs-ite*-dumb (4vs-onehot vars) (4v-onehot-sexpr-prime vars sexpr) (4vs-x)))
Theorem:
(defthm 4v-sexpr-eval-of-4v-onehot-rw-sexpr (implies (and (atom-listp vars) (not (member-equal nil vars))) (4v-<= (4v-sexpr-eval (4v-onehot-rw-sexpr vars sexpr) env) (4v-sexpr-eval sexpr env))))
Theorem:
(defthm 4v-sexpr-<=-of-4v-onehot-rw-sexpr (implies (and (atom-listp vars) (not (member-equal nil vars))) (4v-sexpr-<= (4v-onehot-rw-sexpr vars sexpr) sexpr)))
Theorem:
(defthm 4v-sexpr-vars-of-4v-onehot-rw-sexpr (implies (atom-listp vars) (subsetp-equal (4v-sexpr-vars (4v-onehot-rw-sexpr vars sexpr)) (append vars (4v-sexpr-vars sexpr)))))