Process the
(deftreeops-process-grammar grammar call wrld) → (mv erp redundantp grammar rules)
If the
Function:
(defun deftreeops-process-grammar (grammar call wrld) (declare (xargs :guard (and (pseudo-event-formp call) (plist-worldp wrld)))) (let ((__function__ 'deftreeops-process-grammar)) (declare (ignorable __function__)) (b* (((reterr) nil nil nil) ((unless (constant-namep grammar wrld)) (reterr (msg "The *GRAMMAR* input ~x0 must be the name of a constant." grammar))) (info (deftreeops-table-lookup grammar wrld)) ((when info) (if (equal call (deftreeops-table-value->call info)) (retok t nil nil) (reterr (msg "DEFTREEOPS has been already called on ~x0, ~ but the previous call ~x1 differs ~ from the new call ~x2, ~ which is therefore not redundant." grammar (deftreeops-table-value->call info) call)))) (rules (constant-value grammar wrld)) ((unless (and (rulelistp rules) (consp rules))) (reterr (msg "The *GRAMMAR* input is the name of a constant, ~ but its value ~x0 is not a non-empty ABNF grammar." rules))) ((unless (rulelist-wfp rules)) (reterr (msg "The *GRAMMAR* input denotes and ABNF grammar, ~ but the grammar is not well-formed (see :DOC ABNF::WELL-FORMEDNESS)."))) ((unless (rulelist-closedp rules)) (reterr (msg "The *GRAMMAR* input denotes an ABNF grammar, ~ but the grammar is not closed (see :DOC ABNF::CLOSURE).")))) (retok nil grammar rules))))
Theorem:
(defthm booleanp-of-deftreeops-process-grammar.redundantp (b* (((mv acl2::?erp ?redundantp ?grammar ?rules) (deftreeops-process-grammar grammar call wrld))) (booleanp redundantp)) :rule-classes :rewrite)
Theorem:
(defthm symbolp-of-deftreeops-process-grammar.grammar (b* (((mv acl2::?erp ?redundantp ?grammar ?rules) (deftreeops-process-grammar grammar call wrld))) (common-lisp::symbolp grammar)) :rule-classes :rewrite)
Theorem:
(defthm rulelistp-of-deftreeops-process-grammar.rules (b* (((mv acl2::?erp ?redundantp ?grammar ?rules) (deftreeops-process-grammar grammar call wrld))) (rulelistp rules)) :rule-classes :rewrite)