Syntax check for a 'rule' defined with rp::custom-rewrite-rule. If warning key is set to non-nil, a warning is issued for failures.
(rule-syntaxp rule &key warning) → *
Function:
(defun rule-syntaxp-fn (rule warning) (declare (xargs :guard t)) (let ((__function__ 'rule-syntaxp)) (declare (ignorable __function__)) (and (or (weak-custom-rewrite-rule-p rule) (and warning (hard-error 'rule-syntaxp "ATTENTION! weak-custom-rewrite-rule-p failed! ~p0 ~%" (list (cons #\0 rule))))) (if (rp-rule-metap rule) (and (symbolp (rp-rule-trig-fnc rule)) (rp-rule-trig-fnc rule) (symbolp (rp-rule-meta-fnc rule)) (rp-rule-meta-fnc rule)) (and (or (not (include-fnc (rp-lhs rule) 'rp)) (and warning (cw "ATTENTION! (not (include-fnc (rp-lhs rule) 'rp)) failed! LHS cannot contain an instance of rp. ~%"))) (or (not (include-fnc (rp-lhs rule) 'equals)) (and warning (cw "ATTENTION! (not (include-fnc (rp-lhs rule) 'equals)) failed! LHS cannot contain an instance of equals. ~%"))) (or (not (include-fnc-subterms (rp-hyp rule) 'rp)) (and warning (cw "ATTENTION! (not (include-fnc-subterms (rp-hyp rule) 'rp)) failed! HYP cannot contain an instance of rp. ~%"))) (or (not (include-fnc-subterms (rp-hyp rule) 'equals)) (and warning (cw "ATTENTION! (not (include-fnc-subterms (rp-hyp rule) 'equals)) failed! HYP cannot contain an instance of equals ~%"))) (or (not (include-fnc (rp-rhs rule) 'falist)) (and warning (cw "ATTENTION! (not (include-fnc (rp-rhs rule) 'falist)) failed! RHS cannot contain an instance of falist ~%"))) (or (not (include-fnc (rp-rhs rule) 'equals)) (and warning (cw "ATTENTION! (not (include-fnc (rp-rhs rule) 'equals)) failed! RHS cannot contain an instance of equals ~%"))) (or (not (include-fnc-subterms (rp-hyp rule) 'falist)) (and warning (cw "ATTENTION! (not (include-fnc (rp-hyp rule) 'falist)) failed! HYP cannot contain an instance of falist ~%"))) (or (and (or (rp-term-listp (rp-hyp rule)) (and warning (cw "ATTENTION! (rp-term-listp (rp-hyp rule)) failed! Hyp of the ~ rule does not satisfy rp::rp-termp. ~%"))) (or (rp-termp (rp-lhs rule)) (and warning (cw "ATTENTION! (rp-termp (rp-lhs rule)) failed! LSH of the ~ rule does not satisfy rp::rp-termp. ~%"))) (or (rp-termp (rp-rhs rule)) (and warning (cw "ATTENTION! (rp-termp (rp-rhs rule)) failed! RHS of the ~ rule does not satisfy rp::rp-termp. ~%"))) (or (consp (rp-lhs rule)) (and warning (cw "ATTENTION! (consp (rp-lhs rule)) failed! LHS cannot be a variable. ~%"))) (or (not (acl2::fquotep (rp-lhs rule))) (and warning (cw "ATTENTION! (not (acl2::fquotep (rp-lhs rule))) failed! LHS cannot be a quoted value ~%"))) (or (not (include-fnc (rp-lhs rule) 'synp)) (and warning (cw "ATTENTION! (not (include-fnc (rp-lhs rule) 'synp)) failed! LHS cannot contain an instance of synp ~%"))) (not (include-fnc (rp-lhs rule) 'list)) (not (include-fnc-subterms (rp-hyp rule) 'list)) (not (include-fnc (rp-rhs rule) 'list))) (and (equal warning ':err) (hard-error 'rule-syntaxp "Read the above messages. Error is issued for: ~% rp-rune: ~p0 ~% rp-hyp: ~p1 ~% rp-lhs: ~p2 ~% rp-rhs ~p3 ~%" (list (cons #\0 (rp-rune rule)) (cons #\1 (rp-hyp rule)) (cons #\2 (rp-lhs rule)) (cons #\3 (rp-rhs rule))))) (and warning (cw "Read the above messages. Warning in rp::rule-syntaxp is issued for: ~% rp-rune: ~p0 ~% rp-hyp: ~p1 ~% rp-lhs: ~p2 ~% rp-rhs ~p3 ~%" (rp-rune rule) (rp-hyp rule) (rp-lhs rule) (rp-rhs rule)))))))))