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