Get the kind (tag) of a regex structure.
(regex-kind x) → kind
Function:
(defun regex-kind$inline (x) (declare (xargs :guard (regex-p x))) (let ((__function__ 'regex-kind)) (declare (ignorable __function__)) (mbe :logic (cond ((or (atom x) (eq (car x) :exact)) :exact) ((eq (car x) :repeat) :repeat) ((eq (car x) :concat) :concat) ((eq (car x) :disjunct) :disjunct) ((eq (car x) :charset) :charset) ((eq (car x) :start) :start) ((eq (car x) :end) :end) ((eq (car x) :group) :group) ((eq (car x) :backref) :backref) ((eq (car x) :reverse-pref) :reverse-pref) ((eq (car x) :no-backtrack) :no-backtrack) ((eq (car x) :case-sens) :case-sens) (t :zerolength)) :exec (car x))))
Theorem:
(defthm regex-kind-possibilities (or (equal (regex-kind x) :exact) (equal (regex-kind x) :repeat) (equal (regex-kind x) :concat) (equal (regex-kind x) :disjunct) (equal (regex-kind x) :charset) (equal (regex-kind x) :start) (equal (regex-kind x) :end) (equal (regex-kind x) :group) (equal (regex-kind x) :backref) (equal (regex-kind x) :reverse-pref) (equal (regex-kind x) :no-backtrack) (equal (regex-kind x) :case-sens) (equal (regex-kind x) :zerolength)) :rule-classes ((:forward-chaining :trigger-terms ((regex-kind x)))))