Recognizer for command structures.
(commandp x) → *
Function:
(defun commandp (x) (declare (xargs :guard t)) (let ((__function__ 'commandp)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :increment)) (and (true-listp (cdr x)) (eql (len (cdr x)) 3) (b* ((map (std::da-nth 0 (cdr x))) (key (std::da-nth 1 (cdr x))) (value (std::da-nth 2 (cdr x)))) (and (identifierp map) (operandp key) (operandp value))))) ((eq (car x) :decrement) (and (true-listp (cdr x)) (eql (len (cdr x)) 3) (b* ((map (std::da-nth 0 (cdr x))) (key (std::da-nth 1 (cdr x))) (value (std::da-nth 2 (cdr x)))) (and (identifierp map) (operandp key) (operandp value))))) (t (and (eq (car x) :instruction) (and (true-listp (cdr x)) (eql (len (cdr x)) 1)) (b* ((get (std::da-nth 0 (cdr x)))) (instructionp get))))))))
Theorem:
(defthm consp-when-commandp (implies (commandp x) (consp x)) :rule-classes :compound-recognizer)