Check if an expression is an identifier, returning the identifier if the check passes.
(check-expr-ident expr) → ident?
Function:
(defun check-expr-ident (expr) (declare (xargs :guard (exprp expr))) (let ((__function__ 'check-expr-ident)) (declare (ignorable __function__)) (and (expr-case expr :ident) (expr-ident->ident expr))))
Theorem:
(defthm ident-optionp-of-check-expr-ident (b* ((ident? (check-expr-ident expr))) (ident-optionp ident?)) :rule-classes :rewrite)
Theorem:
(defthm check-expr-ident-of-expr-fix-expr (equal (check-expr-ident (expr-fix expr)) (check-expr-ident expr)))
Theorem:
(defthm check-expr-ident-expr-equiv-congruence-on-expr (implies (expr-equiv expr expr-equiv) (equal (check-expr-ident expr) (check-expr-ident expr-equiv))) :rule-classes :congruence)