Recognizer for constraint-db.
(constraint-db-p x) → *
Function:
(defun constraint-db-p (x) (declare (xargs :guard t)) (let ((__function__ 'constraint-db-p)) (declare (ignorable __function__)) (if (atom x) (eq x nil) (and (consp (car x)) (pseudo-fnsym-p (caar x)) (constraint-tuplelist-p (cdar x)) (constraint-db-p (cdr x))))))
Theorem:
(defthm constraint-db-p-of-revappend (equal (constraint-db-p (revappend x y)) (and (constraint-db-p (list-fix x)) (constraint-db-p y))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-remove (implies (constraint-db-p x) (constraint-db-p (remove a x))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-last (implies (constraint-db-p (double-rewrite x)) (constraint-db-p (last x))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-nthcdr (implies (constraint-db-p (double-rewrite x)) (constraint-db-p (nthcdr n x))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-butlast (implies (constraint-db-p (double-rewrite x)) (constraint-db-p (butlast x n))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-update-nth (implies (constraint-db-p (double-rewrite x)) (iff (constraint-db-p (update-nth n y x)) (and (and (consp y) (pseudo-fnsym-p (car y)) (constraint-tuplelist-p (cdr y))) (or (<= (nfix n) (len x)) (and (consp nil) (pseudo-fnsym-p (car nil)) (constraint-tuplelist-p (cdr nil))))))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-repeat (iff (constraint-db-p (acl2::repeat n x)) (or (and (consp x) (pseudo-fnsym-p (car x)) (constraint-tuplelist-p (cdr x))) (zp n))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-take (implies (constraint-db-p (double-rewrite x)) (iff (constraint-db-p (take n x)) (or (and (consp nil) (pseudo-fnsym-p (car nil)) (constraint-tuplelist-p (cdr nil))) (<= (nfix n) (len x))))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-union-equal (equal (constraint-db-p (union-equal x y)) (and (constraint-db-p (list-fix x)) (constraint-db-p (double-rewrite y)))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-intersection-equal-2 (implies (constraint-db-p (double-rewrite y)) (constraint-db-p (intersection-equal x y))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-intersection-equal-1 (implies (constraint-db-p (double-rewrite x)) (constraint-db-p (intersection-equal x y))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-set-difference-equal (implies (constraint-db-p x) (constraint-db-p (set-difference-equal x y))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-when-subsetp-equal (and (implies (and (subsetp-equal x y) (constraint-db-p y)) (equal (constraint-db-p x) (true-listp x))) (implies (and (constraint-db-p y) (subsetp-equal x y)) (equal (constraint-db-p x) (true-listp x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-rcons (iff (constraint-db-p (acl2::rcons a x)) (and (and (consp a) (pseudo-fnsym-p (car a)) (constraint-tuplelist-p (cdr a))) (constraint-db-p (list-fix x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-append (equal (constraint-db-p (append a b)) (and (constraint-db-p (list-fix a)) (constraint-db-p b))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-rev (equal (constraint-db-p (rev x)) (constraint-db-p (list-fix x))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-duplicated-members (implies (constraint-db-p x) (constraint-db-p (acl2::duplicated-members x))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-difference (implies (constraint-db-p x) (constraint-db-p (set::difference x y))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-intersect-2 (implies (constraint-db-p y) (constraint-db-p (set::intersect x y))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-intersect-1 (implies (constraint-db-p x) (constraint-db-p (set::intersect x y))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-union (iff (constraint-db-p (set::union x y)) (and (constraint-db-p (set::sfix x)) (constraint-db-p (set::sfix y)))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-mergesort (iff (constraint-db-p (set::mergesort x)) (constraint-db-p (list-fix x))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-delete (implies (constraint-db-p x) (constraint-db-p (set::delete k x))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-insert (iff (constraint-db-p (set::insert a x)) (and (constraint-db-p (set::sfix x)) (and (consp a) (pseudo-fnsym-p (car a)) (constraint-tuplelist-p (cdr a))))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-sfix (iff (constraint-db-p (set::sfix x)) (or (constraint-db-p x) (not (set::setp x)))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-list-fix (implies (constraint-db-p x) (constraint-db-p (list-fix x))) :rule-classes ((:rewrite)))
Theorem:
(defthm true-listp-when-constraint-db-p-compound-recognizer (implies (constraint-db-p x) (true-listp x)) :rule-classes :compound-recognizer)
Theorem:
(defthm constraint-db-p-when-not-consp (implies (not (consp x)) (equal (constraint-db-p x) (not x))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-cdr-when-constraint-db-p (implies (constraint-db-p (double-rewrite x)) (constraint-db-p (cdr x))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-cons (equal (constraint-db-p (cons a x)) (and (and (consp a) (pseudo-fnsym-p (car a)) (constraint-tuplelist-p (cdr a))) (constraint-db-p x))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-remove-assoc (implies (constraint-db-p x) (constraint-db-p (remove-assoc-equal name x))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-put-assoc (implies (and (constraint-db-p x)) (iff (constraint-db-p (put-assoc-equal name acl2::val x)) (and (pseudo-fnsym-p name) (constraint-tuplelist-p acl2::val)))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-fast-alist-clean (implies (constraint-db-p x) (constraint-db-p (fast-alist-clean x))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-hons-shrink-alist (implies (and (constraint-db-p x) (constraint-db-p y)) (constraint-db-p (hons-shrink-alist x y))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-db-p-of-hons-acons (equal (constraint-db-p (hons-acons a n x)) (and (pseudo-fnsym-p a) (constraint-tuplelist-p n) (constraint-db-p x))) :rule-classes ((:rewrite)))
Theorem:
(defthm constraint-tuplelist-p-of-cdr-of-hons-assoc-equal-when-constraint-db-p (implies (constraint-db-p x) (iff (constraint-tuplelist-p (cdr (hons-assoc-equal k x))) (or (hons-assoc-equal k x) (constraint-tuplelist-p nil)))) :rule-classes ((:rewrite)))
Theorem:
(defthm alistp-when-constraint-db-p-rewrite (implies (constraint-db-p x) (alistp x)) :rule-classes ((:rewrite)))
Theorem:
(defthm alistp-when-constraint-db-p (implies (constraint-db-p x) (alistp x)) :rule-classes :tau-system)
Theorem:
(defthm constraint-tuplelist-p-of-cdar-when-constraint-db-p (implies (constraint-db-p x) (iff (constraint-tuplelist-p (cdar x)) (or (consp x) (constraint-tuplelist-p nil)))) :rule-classes ((:rewrite)))
Theorem:
(defthm pseudo-fnsym-p-of-caar-when-constraint-db-p (implies (constraint-db-p x) (iff (pseudo-fnsym-p (caar x)) (or (consp x) (pseudo-fnsym-p nil)))) :rule-classes ((:rewrite)))