Map a token that is an additive operator to the corresponding additive operator.
Function:
(defun token-to-additive-operator (token) (declare (xargs :guard (tokenp token))) (declare (xargs :guard (token-additive-operator-p token))) (let ((__function__ 'token-to-additive-operator)) (declare (ignorable __function__)) (cond ((token-punctuatorp token "+") (binop-add)) ((token-punctuatorp token "-") (binop-sub)) (t (prog2$ (impossible) (irr-binop))))))
Theorem:
(defthm binopp-of-token-to-additive-operator (b* ((op (token-to-additive-operator token))) (binopp op)) :rule-classes :rewrite)