Check if an expression does not contain any function calls.
Function:
(defun expr-nocallsp (expr) (declare (xargs :guard (exprp expr))) (let ((__function__ 'expr-nocallsp)) (declare (ignorable __function__)) (expr-case expr :ident t :const t :arrsub (and (expr-nocallsp expr.arr) (expr-nocallsp expr.sub)) :call nil :member (expr-nocallsp expr.target) :memberp (expr-nocallsp expr.target) :postinc (expr-nocallsp expr.arg) :postdec (expr-nocallsp expr.arg) :preinc (expr-nocallsp expr.arg) :predec (expr-nocallsp expr.arg) :unary (expr-nocallsp expr.arg) :cast (expr-nocallsp expr.arg) :binary (and (expr-nocallsp expr.arg1) (expr-nocallsp expr.arg2)) :cond (and (expr-nocallsp expr.test) (expr-nocallsp expr.then) (expr-nocallsp expr.else)))))
Theorem:
(defthm booleanp-of-expr-nocallsp (b* ((yes/no (expr-nocallsp expr))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm expr-nocallsp-of-expr-fix-expr (equal (expr-nocallsp (expr-fix expr)) (expr-nocallsp expr)))
Theorem:
(defthm expr-nocallsp-expr-equiv-congruence-on-expr (implies (expr-equiv expr expr-equiv) (equal (expr-nocallsp expr) (expr-nocallsp expr-equiv))) :rule-classes :congruence)