Recognizer for escape structures.
(escapep x) → *
Function:
(defun escapep (x) (declare (xargs :guard t)) (let ((__function__ 'escapep)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :simple)) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((unwrap (std::da-nth 0 (cdr x)))) (simple-escapep unwrap)))) ((eq (car x) :oct) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((unwrap (std::da-nth 0 (cdr x)))) (oct-escapep unwrap)))) ((eq (car x) :hex) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((unwrap (std::da-nth 0 (cdr x)))) (hex-digit-char-listp unwrap)))) (t (and (eq (car x) :univ) (and (true-listp (cdr x)) (eql (len (cdr x)) 1)) (b* ((unwrap (std::da-nth 0 (cdr x)))) (univ-char-name-p unwrap))))))))
Theorem:
(defthm consp-when-escapep (implies (escapep x) (consp x)) :rule-classes :compound-recognizer)