Look up the arity of an operator.
(vl-op-arity x) → arity
(vl-op-arity x) determines the arity of the operator
We prefer to use
Function:
(defun vl-op-arity (x) (declare (xargs :guard (vl-op-p x))) (let ((__function__ 'vl-op-arity)) (declare (ignorable __function__)) (b* ((op (vl-op-fix x)) (info (cdr (assoc op (vl-ops-table))))) (vl-opinfo->arity info))))
Theorem:
(defthm maybe-natp-of-vl-op-arity (b* ((arity (vl-op-arity x))) (maybe-natp arity)) :rule-classes :type-prescription)
Theorem:
(defthm vl-op-arity-of-vl-op-fix-x (equal (vl-op-arity (vl-op-fix x)) (vl-op-arity x)))
Theorem:
(defthm vl-op-arity-vl-op-equiv-congruence-on-x (implies (vl-op-equiv x x-equiv) (equal (vl-op-arity x) (vl-op-arity x-equiv))) :rule-classes :congruence)