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) :single-quote)) (and (true-listp (cdr x)) (eql (len (cdr x)) 0) (b* nil t))) ((eq (car x) :double-quote) (and (true-listp (cdr x)) (eql (len (cdr x)) 0) (b* nil t))) ((eq (car x) :backslash) (and (true-listp (cdr x)) (eql (len (cdr x)) 0) (b* nil t))) ((eq (car x) :letter-n) (and (true-listp (cdr x)) (eql (len (cdr x)) 0) (b* nil t))) ((eq (car x) :letter-r) (and (true-listp (cdr x)) (eql (len (cdr x)) 0) (b* nil t))) ((eq (car x) :letter-t) (and (true-listp (cdr x)) (eql (len (cdr x)) 0) (b* nil t))) ((eq (car x) :line-feed) (and (true-listp (cdr x)) (eql (len (cdr x)) 0) (b* nil t))) ((eq (car x) :carriage-return) (and (true-listp (cdr x)) (eql (len (cdr x)) 0) (b* nil t))) ((eq (car x) :x) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((get (std::da-nth 0 (cdr x)))) (hex-pairp get)))) (t (and (eq (car x) :u) (and (true-listp (cdr x)) (eql (len (cdr x)) 1)) (b* ((get (std::da-nth 0 (cdr x)))) (hex-quadp get))))))))
Theorem:
(defthm consp-when-escapep (implies (escapep x) (consp x)) :rule-classes :compound-recognizer)