Included Books
other
(in-package "ACL2")
include-book
(include-book "sublis-var")
local
(local (include-book "pseudo-termp-lemmas"))
include-book
(include-book "subst-var")
other
(verify-termination subst-expr1 (declare (xargs :verify-guards nil)))
local
(local (defun subst-expr1-flg (flg new old x) (cond (flg (cond ((endp x) nil) (t (cons (subst-expr1-flg nil new old (car x)) (subst-expr1-flg t new old (cdr x)))))) (t (cond ((equal x old) new) ((variablep x) x) ((fquotep x) x) (t (cons-term (ffn-symb x) (subst-expr1-flg t new old (fargs x)))))))))
local
(local (defthmd subst-expr1-flg-property (equal (subst-expr1-flg flg new old x) (if flg (subst-expr1-lst new old x) (subst-expr1 new old x)))))
local
(local (defthm subst-expr1-flg-preserves-len (implies flg (equal (len (subst-expr1-flg flg vars terms x)) (len x)))))
local
(local (defthm pseudo-termp-subst-expr1-flg (implies (and (pseudo-termp new) (pseudo-termp old) (if flg (pseudo-term-listp x) (pseudo-termp x))) (if flg (pseudo-term-listp (subst-expr1-flg flg new old x)) (pseudo-termp (subst-expr1-flg flg new old x)))) :rule-classes nil))
pseudo-term-listp-subst-expr1-lsttheorem
(defthm pseudo-term-listp-subst-expr1-lst (implies (and (pseudo-termp new) (pseudo-termp old) (pseudo-term-listp args)) (pseudo-term-listp (subst-expr1-lst new old args))) :hints (("Goal" :in-theory (enable subst-expr1-flg-property) :use ((:instance pseudo-termp-subst-expr1-flg (flg t) (x args))))))
pseudo-term-listp-subst-expr1theorem
(defthm pseudo-term-listp-subst-expr1 (implies (and (pseudo-termp new) (pseudo-termp old) (pseudo-termp term)) (pseudo-termp (subst-expr1 new old term))) :hints (("Goal" :in-theory (enable subst-expr1-flg-property) :use ((:instance pseudo-termp-subst-expr1-flg (flg nil) (x term))))))
other
(verify-guards subst-expr1)
other
(verify-termination subst-expr-error)
other
(verify-guards subst-expr-error)
other
(verify-termination subst-expr)