Get the idx field from a lhbit-var.
This is an ordinary field accessor created by defprod.
Function:
(defun lhbit-var->idx$inline (x) (declare (xargs :guard (lhbit-p x))) (declare (xargs :guard (equal (lhbit-kind x) :var))) (let ((__function__ 'lhbit-var->idx)) (declare (ignorable __function__)) (mbe :logic (b* ((x (and (equal (lhbit-kind x) :var) x))) (nfix (std::prod-cdr (cdr x)))) :exec (std::prod-cdr (cdr x)))))
Theorem:
(defthm natp-of-lhbit-var->idx (b* ((idx (lhbit-var->idx$inline x))) (natp idx)) :rule-classes :rewrite)
Theorem:
(defthm lhbit-var->idx$inline-of-lhbit-fix-x (equal (lhbit-var->idx$inline (lhbit-fix x)) (lhbit-var->idx$inline x)))
Theorem:
(defthm lhbit-var->idx$inline-lhbit-equiv-congruence-on-x (implies (lhbit-equiv x x-equiv) (equal (lhbit-var->idx$inline x) (lhbit-var->idx$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm lhbit-var->idx-when-wrong-kind (implies (not (equal (lhbit-kind x) :var)) (equal (lhbit-var->idx x) (nfix nil))))