Tree for a contextual keyword.
(contextual-keyword-tree keyword) → tree
This is used in grammar-contextual-keywordp-when-contextual-keywordp.
Function:
(defun contextual-keyword-tree (keyword) (declare (xargs :guard (contextual-keywordp keyword))) (let ((keyword (mbe :logic (if (contextual-keywordp keyword) keyword (string=>unicode "yield")) :exec keyword))) (abnf::tree-nonleaf (abnf::rulename "contextual-keyword") (list (list (abnf::tree-leafterm keyword))))))
Theorem:
(defthm return-type-of-contextual-keyword-tree (b* ((tree (contextual-keyword-tree keyword))) (abnf-tree-with-root-p tree "contextual-keyword")) :rule-classes :rewrite)
Theorem:
(defthm tree->string-of-contextual-keyword-tree (equal (abnf::tree->string (contextual-keyword-tree keyword)) (if (contextual-keywordp keyword) keyword (string=>unicode "yield"))))