Abstract a
(abs-unicode-escape tree) → unicode
A
A
Function:
(defun abs-unicode-escape (tree) (declare (xargs :guard (abnf-tree-with-root-p tree "unicode-escape"))) (let ((__function__ 'abs-unicode-escape)) (declare (ignorable __function__)) (b* ((subtrees (abnf::tree-nonleaf->branches tree)) (subtree1 (car (third subtrees))) (subtree2 (car (fourth subtrees))) (subtree3 (car (fifth subtrees))) (subtree4 (car (sixth subtrees))) (val1 (abs-hex-digit subtree1)) (val2 (abs-hex-digit subtree2)) (val3 (abs-hex-digit subtree3)) (val4 (abs-hex-digit subtree4))) (+ (ash val1 12) (ash val2 8) (ash val3 4) val4))))
Theorem:
(defthm unicodep-of-abs-unicode-escape (implies (and (abnf-tree-with-root-p tree '"unicode-escape")) (b* ((unicode (abs-unicode-escape tree))) (unicodep unicode))) :rule-classes :rewrite)