Basic evaluator for meta-reasoning about bfr-eval.
Definition:
(encapsulate (((bfr-cp-ev * *) acl2::=> *) ((bfr-cp-evl * *) acl2::=> *)) (set-inhibit-warnings "theory") (local (value-triple :elided)) (local (value-triple :elided)) (local (value-triple :elided)) (local (value-triple :elided)) (local (value-triple :elided)) (local (value-triple :elided)) (local (value-triple :elided)) (local (value-triple :elided)) (defthmd bfr-cp-ev-constraint-0 (implies (and (consp x) (syntaxp (not (equal a ''nil))) (not (equal (car x) 'quote))) (equal (bfr-cp-ev x a) (bfr-cp-ev (cons (car x) (kwote-lst (bfr-cp-evl (cdr x) a))) nil))) :hints (("Goal" :expand ((:free (x) (hide x)) (bfr-cp-ev x a) (:free (args) (bfr-cp-ev (cons (car x) args) nil))) :in-theory '(acl2::eval-list-kwote-lst acl2::true-list-fix-ev-lst car-cons cdr-cons)))) (local (value-triple :elided)) (defthm bfr-cp-ev-constraint-1 (implies (symbolp x) (equal (bfr-cp-ev x a) (and x (cdr (assoc-equal x a))))) :hints (("Goal" :expand ((bfr-cp-ev x a))))) (local (value-triple :elided)) (defthm bfr-cp-ev-constraint-2 (implies (and (consp x) (equal (car x) 'quote)) (equal (bfr-cp-ev x a) (cadr x))) :hints (("Goal" :expand ((bfr-cp-ev x a))))) (local (value-triple :elided)) (defthm bfr-cp-ev-constraint-3 (implies (and (consp x) (consp (car x))) (equal (bfr-cp-ev x a) (bfr-cp-ev (caddr (car x)) (pairlis$ (cadr (car x)) (bfr-cp-evl (cdr x) a))))) :hints (("Goal" :expand ((bfr-cp-ev x a))))) (local (value-triple :elided)) (defthm bfr-cp-ev-constraint-4 (implies (not (consp acl2::x-lst)) (equal (bfr-cp-evl acl2::x-lst a) nil)) :hints (("Goal" :expand ((bfr-cp-evl acl2::x-lst a))))) (local (value-triple :elided)) (defthm bfr-cp-ev-constraint-5 (implies (consp acl2::x-lst) (equal (bfr-cp-evl acl2::x-lst a) (cons (bfr-cp-ev (car acl2::x-lst) a) (bfr-cp-evl (cdr acl2::x-lst) a)))) :hints (("Goal" :expand ((bfr-cp-evl acl2::x-lst a))))) (local (value-triple :elided)) (defthmd bfr-cp-ev-constraint-6 (implies (and (not (consp x)) (not (symbolp x))) (equal (bfr-cp-ev x a) nil)) :hints (("Goal" :expand ((bfr-cp-ev x a))))) (local (value-triple :elided)) (defthmd bfr-cp-ev-constraint-7 (implies (and (consp x) (not (consp (car x))) (not (symbolp (car x)))) (equal (bfr-cp-ev x a) nil)) :hints (("Goal" :expand ((bfr-cp-ev x a))))) (local (value-triple :elided)) (defthm bfr-cp-ev-constraint-8 (implies (and (consp x) (equal (car x) 'bfr-eval)) (equal (bfr-cp-ev x a) (bfr-eval (bfr-cp-ev (cadr x) a) (bfr-cp-ev (caddr x) a)))) :hints (("Goal" :expand ((bfr-cp-ev x a) (:free (x) (hide x)) (:free (acl2::fn args) (acl2::apply-for-defevaluator acl2::fn args)))))) (local (value-triple :elided)) (defthm bfr-cp-ev-constraint-9 (implies (and (consp x) (equal (car x) 'equal)) (equal (bfr-cp-ev x a) (equal (bfr-cp-ev (cadr x) a) (bfr-cp-ev (caddr x) a)))) :hints (("Goal" :expand ((bfr-cp-ev x a) (:free (x) (hide x)) (:free (acl2::fn args) (acl2::apply-for-defevaluator acl2::fn args)))))) (local (value-triple :elided)) (defthm bfr-cp-ev-constraint-10 (implies (and (consp x) (equal (car x) 'not)) (equal (bfr-cp-ev x a) (not (bfr-cp-ev (cadr x) a)))) :hints (("Goal" :expand ((bfr-cp-ev x a) (:free (x) (hide x)) (:free (acl2::fn args) (acl2::apply-for-defevaluator acl2::fn args)))))) (local (value-triple :elided)) (defthm bfr-cp-ev-constraint-11 (implies (and (consp x) (equal (car x) 'implies)) (equal (bfr-cp-ev x a) (implies (bfr-cp-ev (cadr x) a) (bfr-cp-ev (caddr x) a)))) :hints (("Goal" :expand ((bfr-cp-ev x a) (:free (x) (hide x)) (:free (acl2::fn args) (acl2::apply-for-defevaluator acl2::fn args)))))) (local (value-triple :elided)) (defthm bfr-cp-ev-constraint-12 (implies (and (consp x) (equal (car x) 'if)) (equal (bfr-cp-ev x a) (if (bfr-cp-ev (cadr x) a) (bfr-cp-ev (caddr x) a) (bfr-cp-ev (cadddr x) a)))) :hints (("Goal" :expand ((bfr-cp-ev x a) (:free (x) (hide x)) (:free (acl2::fn args) (acl2::apply-for-defevaluator acl2::fn args)))))) (local (value-triple :elided)))
Theorem:
(defthm bfr-cp-ev-constraint-0 (implies (and (consp x) (syntaxp (not (equal a ''nil))) (not (equal (car x) 'quote))) (equal (bfr-cp-ev x a) (bfr-cp-ev (cons (car x) (kwote-lst (bfr-cp-evl (cdr x) a))) nil))))
Theorem:
(defthm bfr-cp-ev-constraint-1 (implies (symbolp x) (equal (bfr-cp-ev x a) (and x (cdr (assoc-equal x a))))))
Theorem:
(defthm bfr-cp-ev-constraint-2 (implies (and (consp x) (equal (car x) 'quote)) (equal (bfr-cp-ev x a) (cadr x))))
Theorem:
(defthm bfr-cp-ev-constraint-3 (implies (and (consp x) (consp (car x))) (equal (bfr-cp-ev x a) (bfr-cp-ev (caddr (car x)) (pairlis$ (cadr (car x)) (bfr-cp-evl (cdr x) a))))))
Theorem:
(defthm bfr-cp-ev-constraint-4 (implies (not (consp acl2::x-lst)) (equal (bfr-cp-evl acl2::x-lst a) nil)))
Theorem:
(defthm bfr-cp-ev-constraint-5 (implies (consp acl2::x-lst) (equal (bfr-cp-evl acl2::x-lst a) (cons (bfr-cp-ev (car acl2::x-lst) a) (bfr-cp-evl (cdr acl2::x-lst) a)))))
Theorem:
(defthm bfr-cp-ev-constraint-6 (implies (and (not (consp x)) (not (symbolp x))) (equal (bfr-cp-ev x a) nil)))
Theorem:
(defthm bfr-cp-ev-constraint-7 (implies (and (consp x) (not (consp (car x))) (not (symbolp (car x)))) (equal (bfr-cp-ev x a) nil)))
Theorem:
(defthm bfr-cp-ev-constraint-8 (implies (and (consp x) (equal (car x) 'bfr-eval)) (equal (bfr-cp-ev x a) (bfr-eval (bfr-cp-ev (cadr x) a) (bfr-cp-ev (caddr x) a)))))
Theorem:
(defthm bfr-cp-ev-constraint-9 (implies (and (consp x) (equal (car x) 'equal)) (equal (bfr-cp-ev x a) (equal (bfr-cp-ev (cadr x) a) (bfr-cp-ev (caddr x) a)))))
Theorem:
(defthm bfr-cp-ev-constraint-10 (implies (and (consp x) (equal (car x) 'not)) (equal (bfr-cp-ev x a) (not (bfr-cp-ev (cadr x) a)))))
Theorem:
(defthm bfr-cp-ev-constraint-11 (implies (and (consp x) (equal (car x) 'implies)) (equal (bfr-cp-ev x a) (implies (bfr-cp-ev (cadr x) a) (bfr-cp-ev (caddr x) a)))))
Theorem:
(defthm bfr-cp-ev-constraint-12 (implies (and (consp x) (equal (car x) 'if)) (equal (bfr-cp-ev x a) (if (bfr-cp-ev (cadr x) a) (bfr-cp-ev (caddr x) a) (bfr-cp-ev (cadddr x) a)))))
Theorem:
(defthm bfr-cp-ev-disjoin-cons (iff (bfr-cp-ev (disjoin (cons x y)) a) (or (bfr-cp-ev x a) (bfr-cp-ev (disjoin y) a))))
Theorem:
(defthm bfr-cp-ev-disjoin-when-consp (implies (consp x) (iff (bfr-cp-ev (disjoin x) a) (or (bfr-cp-ev (car x) a) (bfr-cp-ev (disjoin (cdr x)) a)))))
Theorem:
(defthm bfr-cp-ev-disjoin-atom (implies (not (consp x)) (equal (bfr-cp-ev (disjoin x) a) nil)) :rule-classes ((:rewrite :backchain-limit-lst 0)))
Theorem:
(defthm bfr-cp-ev-disjoin-append (iff (bfr-cp-ev (disjoin (append x y)) a) (or (bfr-cp-ev (disjoin x) a) (bfr-cp-ev (disjoin y) a))))
Theorem:
(defthm bfr-cp-ev-conjoin-cons (iff (bfr-cp-ev (conjoin (cons x y)) a) (and (bfr-cp-ev x a) (bfr-cp-ev (conjoin y) a))))
Theorem:
(defthm bfr-cp-ev-conjoin-when-consp (implies (consp x) (iff (bfr-cp-ev (conjoin x) a) (and (bfr-cp-ev (car x) a) (bfr-cp-ev (conjoin (cdr x)) a)))))
Theorem:
(defthm bfr-cp-ev-conjoin-atom (implies (not (consp x)) (equal (bfr-cp-ev (conjoin x) a) t)) :rule-classes ((:rewrite :backchain-limit-lst 0)))
Theorem:
(defthm bfr-cp-ev-conjoin-append (iff (bfr-cp-ev (conjoin (append x y)) a) (and (bfr-cp-ev (conjoin x) a) (bfr-cp-ev (conjoin y) a))))
Theorem:
(defthm bfr-cp-ev-conjoin-clauses-cons (iff (bfr-cp-ev (conjoin-clauses (cons x y)) a) (and (bfr-cp-ev (disjoin x) a) (bfr-cp-ev (conjoin-clauses y) a))))
Theorem:
(defthm bfr-cp-ev-conjoin-clauses-when-consp (implies (consp x) (iff (bfr-cp-ev (conjoin-clauses x) a) (and (bfr-cp-ev (disjoin (car x)) a) (bfr-cp-ev (conjoin-clauses (cdr x)) a)))))
Theorem:
(defthm bfr-cp-ev-conjoin-clauses-atom (implies (not (consp x)) (equal (bfr-cp-ev (conjoin-clauses x) a) t)) :rule-classes ((:rewrite :backchain-limit-lst 0)))
Theorem:
(defthm bfr-cp-ev-conjoin-clauses-append (iff (bfr-cp-ev (conjoin-clauses (append x y)) a) (and (bfr-cp-ev (conjoin-clauses x) a) (bfr-cp-ev (conjoin-clauses y) a))))