Validate a simple escape.
(valid-simple-escape esc) → code
Simple escapes are always valid.
This function returns their ASCII codes.
Note that these always fit in any of the types
mentioned in [C:6.4.4.4/4].
The GCC escape
Function:
(defun valid-simple-escape (esc) (declare (xargs :guard (simple-escapep esc))) (let ((__function__ 'valid-simple-escape)) (declare (ignorable __function__)) (simple-escape-case esc :squote (char-code #\') :dquote (char-code #\") :qmark (char-code #\?) :bslash (char-code #\\) :a 7 :b 8 :f 12 :n 10 :r 13 :t 9 :v 11 :percent (char-code #\%))))
Theorem:
(defthm natp-of-valid-simple-escape (b* ((code (valid-simple-escape esc))) (natp code)) :rule-classes :rewrite)
Theorem:
(defthm valid-simple-escape-of-simple-escape-fix-esc (equal (valid-simple-escape (simple-escape-fix esc)) (valid-simple-escape esc)))
Theorem:
(defthm valid-simple-escape-simple-escape-equiv-congruence-on-esc (implies (simple-escape-equiv esc esc-equiv) (equal (valid-simple-escape esc) (valid-simple-escape esc-equiv))) :rule-classes :congruence)