(4vs-onehot sexprs) constructs an s-expression that is
(ITE* A1 (AND (NOT A2) (NOT A3) ... (NOT AN)) (ITE* A2 (AND (NOT A3) ... (NOT AN)) (ITE* AN (T) (F)) ...))
Note that although the printed representation is particularly large looking,
the
See also 4v-onehot-list-p.
Function:
(defun 4vs-onehot (sexprs) (declare (xargs :guard t)) (if (atom sexprs) (4vs-f) (4vs-ite*-dumb (car sexprs) (4vs-and-list-dumb (4vs-not-list (cdr sexprs))) (4vs-onehot (cdr sexprs)))))
Theorem:
(defthm 4v-sexpr-eval-of-4vs-onehot (equal (equal (4v-sexpr-eval (4vs-onehot sexprs) env) *4vt*) (4v-onehot-list-p (4v-sexpr-eval-list sexprs env))))
Theorem:
(defthm 4v-sexpr-vars-of-4vs-onehot (set-equiv (4v-sexpr-vars (4vs-onehot sexprs)) (4v-sexpr-vars-list sexprs)))