An
Function:
(defun abstract-element (tree) (declare (xargs :guard (treep tree))) (b* (((fun (fail)) (prog2$ (abstract-fail) (element-group nil))) ((unless (tree-case tree :nonleaf)) (fail)) (treess (tree-nonleaf->branches tree)) ((unless (consp treess)) (fail)) (trees (car treess)) ((unless (consp trees)) (fail)) (tree (car trees)) ((unless (tree-case tree :nonleaf)) (fail)) (rulename (tree-nonleaf->rulename? tree))) (cond ((equal rulename (rulename "rulename")) (element-rulename (abstract-rulename tree))) ((equal rulename (rulename "group")) (element-group (abstract-group/option tree))) ((equal rulename (rulename "option")) (element-option (abstract-group/option tree))) ((equal rulename (rulename "char-val")) (element-char-val (abstract-char-val tree))) ((equal rulename (rulename "num-val")) (element-num-val (abstract-num-val tree))) (t (element-prose-val (abstract-prose-val tree))))))