Recognizer for fgl-rule structures.
(fgl-rule-p x) → *
Function:
(defun fgl-rule-p (x) (declare (xargs :guard t)) (let ((__function__ 'fgl-rule-p)) (declare (ignorable __function__)) (and (consp x) (cond ((or (atom x) (eq (car x) :rewrite)) (and (consp (cdr x)) (b* ((rune (car (cdr x))) (rule (cdr (cdr x)))) (and (fgl-rune-p rune) (cmr::rewrite-p rule))))) ((eq (car x) :primitive) (and (true-listp (cdr x)) (eql (len (cdr x)) 1) (b* ((name (std::da-nth 0 (cdr x)))) (pseudo-fnsym-p name)))) (t (and (eq (car x) :meta) (and (true-listp (cdr x)) (eql (len (cdr x)) 1)) (b* ((name (std::da-nth 0 (cdr x)))) (pseudo-fnsym-p name))))))))
Theorem:
(defthm consp-when-fgl-rule-p (implies (fgl-rule-p x) (consp x)) :rule-classes :compound-recognizer)