A
The parse tree must have a root labeled by no rule name, with a single leaf subtree labeled by a list of one natural number. That natural number is returned.
Function:
(defun abstract-grouped-terminal (tree) (declare (xargs :guard (treep tree))) (b* ((nats (abstract-grouped-terminals tree))) (if (consp nats) (car nats) (prog2$ (abstract-fail) 0))))
Theorem:
(defthm natp-of-abstract-grouped-terminal (b* ((nat (abstract-grouped-terminal tree))) (natp nat)) :rule-classes :rewrite)