Recognizer for escape-sequence structures.
(escape-sequence-p x) → *
Function:
(defun escape-sequence-p (x) (declare (xargs :guard t)) (let ((__function__ 'escape-sequence-p)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :b)) (and (true-listp (cdr x)) (eql (len (cdr x)) 0) (b* nil t))) ((eq (car x) :t) (and (true-listp (cdr x)) (eql (len (cdr x)) 0) (b* nil t))) ((eq (car x) :n) (and (true-listp (cdr x)) (eql (len (cdr x)) 0) (b* nil t))) ((eq (car x) :f) (and (true-listp (cdr x)) (eql (len (cdr x)) 0) (b* nil t))) ((eq (car x) :r) (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) :single-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))) (t (and (eq (car x) :octal) (and (true-listp (cdr x)) (eql (len (cdr x)) 1)) (b* ((value (std::da-nth 0 (cdr x)))) (acl2::ubyte8p value))))))))
Theorem:
(defthm consp-when-escape-sequence-p (implies (escape-sequence-p x) (consp x)) :rule-classes :compound-recognizer)