Get the kind (tag) of a node structure.
(stype x) → kind
Function:
(defun stype$inline (x) (declare (xargs :guard (node-p x))) (let ((__function__ 'stype)) (declare (ignorable __function__)) (mbe :logic (cond ((or (atom x) (not (stypep (car x))) (eq (car x) :const)) :const) ((eq (car x) :pi) :pi) ((eq (car x) :reg) :reg) ((eq (car x) :and) :and) ((eq (car x) :xor) :xor) ((eq (car x) :po) :po) ((eq (car x) :nxst) :nxst)) :exec (if (atom x) :const (stype-fix (car x))))))
Theorem:
(defthm stype-possibilities (or (equal (stype x) :const) (equal (stype x) :pi) (equal (stype x) :reg) (equal (stype x) :and) (equal (stype x) :xor) (equal (stype x) :po) (equal (stype x) :nxst)) :rule-classes ((:forward-chaining :trigger-terms ((stype x)))))
Theorem:
(defthm stypep-of-stype (stypep (stype x)))
Theorem:
(defthm stype-not-const-implies-nonempty (implies (not (equal (stype (car x)) (const-stype))) (consp x)) :rule-classes ((:forward-chaining :trigger-terms ((stype (car x))))))