Filtering...

alist-defthms

books/data-structures/alist-defthms

Included Books

other
(in-package "ACL2")
include-book
(include-book "alist-defuns")
include-book
(include-book "list-defuns")
include-book
(include-book "set-defuns")
local
(local (include-book "arithmetic/equalities" :dir :system))
local
(local (include-book "set-defthms"))
bind->bind-equaltheorem
(defthm bind->bind-equal
  (equal (bind x y a) (bind-equal x y a)))
bind-eq->bind-equaltheorem
(defthm bind-eq->bind-equal
  (equal (bind-eq x y a) (bind-equal x y a)))
bind-all->bind-all-equaltheorem
(defthm bind-all->bind-all-equal
  (equal (bind-all x y a) (bind-all-equal x y a)))
bind-all-eq->bind-all-equaltheorem
(defthm bind-all-eq->bind-all-equal
  (equal (bind-all-eq x y a) (bind-all-equal x y a)))
bound?->bound?-equaltheorem
(defthm bound?->bound?-equal
  (equal (bound? x a) (bound?-equal x a)))
bound?-eq->bound?-equaltheorem
(defthm bound?-eq->bound?-equal
  (equal (bound?-eq x a) (bound?-equal x a)))
binding->binding-equaltheorem
(defthm binding->binding-equal
  (equal (binding x a) (binding-equal x a)))
binding-eq->binding-equaltheorem
(defthm binding-eq->binding-equal
  (equal (binding-eq x a) (binding-equal x a)))
all-bindings->all-bindings-equaltheorem
(defthm all-bindings->all-bindings-equal
  (equal (all-bindings l a) (all-bindings-equal l a)))
all-bindings-eq->all-bindings-equaltheorem
(defthm all-bindings-eq->all-bindings-equal
  (equal (all-bindings-eq l a) (all-bindings-equal l a)))
all-bound?->all-bound?-equaltheorem
(defthm all-bound?->all-bound?-equal
  (equal (all-bound? l a) (all-bound?-equal l a)))
all-bound?-eq->all-bound?-equaltheorem
(defthm all-bound?-eq->all-bound?-equal
  (equal (all-bound?-eq l a) (all-bound?-equal l a)))
rembind->rembind-equaltheorem
(defthm rembind->rembind-equal
  (equal (rembind x a) (rembind-equal x a)))
rembind-eq->rembind-equaltheorem
(defthm rembind-eq->rembind-equal
  (equal (rembind-eq x a) (rembind-equal x a)))
rembind-all->rembind-all-equaltheorem
(defthm rembind-all->rembind-all-equal
  (equal (rembind-all x a) (rembind-all-equal x a)))
rembind-all-eq->rembind-all-equaltheorem
(defthm rembind-all-eq->rembind-all-equal
  (equal (rembind-all-eq x a) (rembind-all-equal x a)))
domain-restrict->domain-restrict-equaltheorem
(defthm domain-restrict->domain-restrict-equal
  (equal (domain-restrict l a) (domain-restrict-equal l a)))
domain-restrict-eq->domain-restrict-equaltheorem
(defthm domain-restrict-eq->domain-restrict-equal
  (equal (domain-restrict-eq l a) (domain-restrict-equal l a)))
bind-pairs->bind-pairs-equaltheorem
(defthm bind-pairs->bind-pairs-equal
  (equal (bind-pairs pairs a) (bind-pairs-equal pairs a)))
bind-pairs-eq->bind-pairs-equaltheorem
(defthm bind-pairs-eq->bind-pairs-equal
  (equal (bind-pairs-eq pairs a) (bind-pairs-equal pairs a)))
collect-bound->collect-bound-equaltheorem
(defthm collect-bound->collect-bound-equal
  (equal (collect-bound x a) (collect-bound-equal x a)))
collect-bound-eq->collect-bound-equaltheorem
(defthm collect-bound-eq->collect-bound-equal
  (equal (collect-bound-eq x a) (collect-bound-equal x a)))
alist-compose-domain->alist-compose-domain-equaltheorem
(defthm alist-compose-domain->alist-compose-domain-equal
  (equal (alist-compose-domain dom a1 a2)
    (alist-compose-domain-equal dom a1 a2)))
alist-compose-domain-eq->alist-compose-domain-equaltheorem
(defthm alist-compose-domain-eq->alist-compose-domain-equal
  (equal (alist-compose-domain-eq dom a1 a2)
    (alist-compose-domain-equal dom a1 a2)))
assoc-equal-consp-or-niltheorem
(defthm assoc-equal-consp-or-nil
  (implies (alistp a)
    (or (consp (assoc-equal x a)) (equal (assoc-equal x a) nil)))
  :rule-classes :type-prescription)
true-listp-domaintheorem
(defthm true-listp-domain
  (true-listp (domain a))
  :rule-classes (:rewrite :type-prescription))
eqlable-listp-domaintheorem
(defthm eqlable-listp-domain
  (implies (eqlable-alistp a) (eqlable-listp (domain a))))
symbol-listp-domaintheorem
(defthm symbol-listp-domain
  (implies (symbol-alistp a) (symbol-listp (domain a))))
true-listp-rangetheorem
(defthm true-listp-range
  (true-listp (range a))
  :rule-classes (:rewrite :type-prescription))
alistp-aconstheorem
(defthm alistp-acons
  (implies (alistp a) (alistp (acons x y a)))
  :rule-classes (:rewrite :type-prescription))
eqlable-alistp-aconstheorem
(defthm eqlable-alistp-acons
  (implies (and (eqlablep x) (eqlable-alistp a))
    (eqlable-alistp (acons x y a))))
symbol-alistp-aconstheorem
(defthm symbol-alistp-acons
  (implies (and (symbolp x) (symbol-alistp a))
    (symbol-alistp (acons x y a))))
alistp-appendtheorem
(defthm alistp-append
  (implies (and (alistp a1) (alistp a2))
    (alistp (append a1 a2))))
eqlable-alistp-appendtheorem
(defthm eqlable-alistp-append
  (implies (and (eqlable-alistp a1) (eqlable-alistp a2))
    (eqlable-alistp (append a1 a2))))
symbol-alistp-appendtheorem
(defthm symbol-alistp-append
  (implies (and (symbol-alistp a1) (symbol-alistp a2))
    (symbol-alistp (append a1 a2))))
alistp-bind-equaltheorem
(defthm alistp-bind-equal
  (implies (alistp a) (alistp (bind-equal x y a)))
  :rule-classes (:rewrite :type-prescription))
eqlable-alistp-bind-equaltheorem
(defthm eqlable-alistp-bind-equal
  (implies (and (eqlablep x) (eqlable-alistp a))
    (eqlable-alistp (bind-equal x y a))))
symbol-alistp-bind-equaltheorem
(defthm symbol-alistp-bind-equal
  (implies (and (symbolp x) (symbol-alistp a))
    (symbol-alistp (bind-equal x y a))))
alistp-pairlis$theorem
(defthm alistp-pairlis$ (alistp (pairlis$ a b)))
eqlable-alistp-pairlis$theorem
(defthm eqlable-alistp-pairlis$
  (implies (eqlable-listp a) (eqlable-alistp (pairlis$ a b))))
symbol-alistp-pairlis$theorem
(defthm symbol-alistp-pairlis$
  (implies (symbol-listp a) (symbol-alistp (pairlis$ a b))))
alistp-rembind-equaltheorem
(defthm alistp-rembind-equal
  (implies (alistp a) (alistp (rembind-equal x a)))
  :rule-classes (:rewrite :type-prescription))
eqlable-alistp-rembind-equaltheorem
(defthm eqlable-alistp-rembind-equal
  (implies (eqlable-alistp a)
    (eqlable-alistp (rembind-equal x a))))
symbol-alistp-rembind-equaltheorem
(defthm symbol-alistp-rembind-equal
  (implies (symbol-alistp a)
    (symbol-alistp (rembind-equal x a))))
alistp-bind-all-equaltheorem
(defthm alistp-bind-all-equal
  (implies (alistp a) (alistp (bind-all-equal keys vals a)))
  :rule-classes (:rewrite :type-prescription))
eqlable-alistp-bind-all-equaltheorem
(defthm eqlable-alistp-bind-all-equal
  (implies (and (eqlable-listp keys) (eqlable-alistp a))
    (eqlable-alistp (bind-all-equal keys vals a))))
symbol-alistp-bind-all-equaltheorem
(defthm symbol-alistp-bind-all-equal
  (implies (and (symbol-listp keys) (symbol-alistp a))
    (symbol-alistp (bind-all-equal keys vals a))))
alistp-domain-restrict-equaltheorem
(defthm alistp-domain-restrict-equal
  (implies (alistp a) (alistp (domain-restrict-equal l a)))
  :rule-classes (:rewrite :type-prescription))
eqlable-alistp-domain-restrict-equaltheorem
(defthm eqlable-alistp-domain-restrict-equal
  (implies (eqlable-alistp a)
    (eqlable-alistp (domain-restrict-equal l a))))
symbol-alistp-domain-restrict-equaltheorem
(defthm symbol-alistp-domain-restrict-equal
  (implies (symbol-alistp a)
    (symbol-alistp (domain-restrict-equal l a))))
alistp-rembind-all-equaltheorem
(defthm alistp-rembind-all-equal
  (implies (alistp a) (alistp (rembind-all-equal keys a)))
  :rule-classes (:rewrite :type-prescription))
eqlable-alistp-rembind-all-equaltheorem
(defthm eqlable-alistp-rembind-all-equal
  (implies (and (eqlable-listp keys) (eqlable-alistp a))
    (eqlable-alistp (rembind-all-equal keys a))))
symbol-alistp-rembind-all-equaltheorem
(defthm symbol-alistp-rembind-all-equal
  (implies (and (symbol-listp keys) (symbol-alistp a))
    (symbol-alistp (rembind-all-equal keys a))))
alistp-bind-pairs-equaltheorem
(defthm alistp-bind-pairs-equal
  (implies (alistp a) (alistp (bind-pairs-equal pairs a))))
eqlable-alistp-bind-pairs-equaltheorem
(defthm eqlable-alistp-bind-pairs-equal
  (implies (and (eqlable-alistp pairs) (eqlable-alistp a))
    (eqlable-alistp (bind-pairs-equal pairs a))))
symbol-alistp-bind-pairs-equaltheorem
(defthm symbol-alistp-bind-pairs-equal
  (implies (and (symbol-alistp pairs) (symbol-alistp a))
    (symbol-alistp (bind-pairs-equal pairs a))))
local
(local (defthm alistp-alist-compose-domain-equal
    (alistp (alist-compose-domain-equal dom a1 a2))))
alistp-alist-compose-equaltheorem
(defthm alistp-alist-compose-equal
  (alistp (alist-compose-equal a1 a2))
  :rule-classes (:rewrite :type-prescription))
local
(local (defthm eqlable-alistp-alist-compose-domain-equal
    (implies (eqlable-listp dom)
      (eqlable-alistp (alist-compose-domain-equal dom a1 a2)))))
local
(local (defthm eqlable-listp-strip-cars
    (implies (eqlable-alistp a) (eqlable-listp (strip-cars a)))))
eqlable-alistp-alist-compose-equaltheorem
(defthm eqlable-alistp-alist-compose-equal
  (implies (eqlable-alistp a1)
    (eqlable-alistp (alist-compose-equal a1 a2)))
  :rule-classes (:rewrite :type-prescription))
local
(local (defthm symbol-alistp-alist-compose-domain-equal
    (implies (symbol-listp dom)
      (symbol-alistp (alist-compose-domain-equal dom a1 a2)))))
local
(local (defthm symbol-listp-strip-cars
    (implies (symbol-alistp a) (symbol-listp (strip-cars a)))))
symbol-alistp-alist-compose-equaltheorem
(defthm symbol-alistp-alist-compose-equal
  (implies (symbol-alistp a1)
    (symbol-alistp (alist-compose-equal a1 a2)))
  :rule-classes (:rewrite :type-prescription))
eqlable-listp-collect-bound-equaltheorem
(defthm eqlable-listp-collect-bound-equal
  (implies (eqlable-listp l)
    (eqlable-listp (collect-bound-equal l a))))
symbol-listp-collect-bound-equaltheorem
(defthm symbol-listp-collect-bound-equal
  (implies (symbol-listp l)
    (symbol-listp (collect-bound-equal l a))))
member-equal-domaintheorem
(defthm member-equal-domain
  (implies (alistp a)
    (iff (member-equal x (domain a)) (bound?-equal x a)))
  :hints (("Goal" :induct (assoc-equal x a))))
subsetp-equal-domaintheorem
(defthm subsetp-equal-domain
  (implies (alistp a)
    (iff (subsetp-equal l (domain a)) (all-bound?-equal l a)))
  :hints (("Goal" :in-theory (disable domain))))
member-equal-binding-equal-rangetheorem
(defthm member-equal-binding-equal-range
  (implies (bound?-equal x a)
    (member-equal (binding-equal x a) (range a)))
  :hints (("Goal" :induct (assoc-equal x a))))
local
(local (defun xposition-equal
    (x l)
    (declare (xargs :guard (and (true-listp l) (or (symbolp x) (symbol-listp l)))))
    (cond ((endp l) nil)
      ((eq x (car l)) 0)
      (t (let ((n (xposition-equal x (cdr l))))
          (and n (1+ n)))))))
local
(local (defthm position-equal-ac-equals-xposition-equal1
    (implies (integerp ac)
      (iff (position-equal-ac x l ac) (xposition-equal x l)))))
local
(local (defthm position-equal-ac-equal-xposition-equal2
    (implies (and (integerp ac) (position-equal-ac x l ac))
      (equal (position-equal-ac x l ac)
        (+ (xposition-equal x l) ac)))))
local
(local (defthm position-equal-ac-iff-member-equal
    (implies (integerp ac)
      (iff (position-equal-ac x l ac) (member-equal x l)))))
local
(local (defthm member-equal-implies-xposition
    (implies (member-equal x l) (xposition-equal x l))))
assoc-equal-aconstheorem
(defthm assoc-equal-acons
  (equal (assoc-equal x (acons y z a))
    (if (equal x y)
      (cons y z)
      (assoc-equal x a))))
assoc-equal-appendtheorem
(defthm assoc-equal-append
  (implies (alistp a1)
    (equal (assoc-equal x (append a1 a2))
      (or (assoc-equal x a1) (assoc-equal x a2)))))
assoc-equal-bind-equaltheorem
(defthm assoc-equal-bind-equal
  (equal (assoc-equal x (bind-equal y v a))
    (if (equal x y)
      (cons y v)
      (assoc-equal x a))))
local
(local (defthm xassoc-equal-pairlis$
    (equal (assoc-equal x (pairlis$ a b))
      (if (member-equal x a)
        (cons x (nth (xposition-equal x a) b))
        nil))))
assoc-equal-pairlis$theorem
(defthm assoc-equal-pairlis$
  (equal (assoc-equal x (pairlis$ a b))
    (if (member-equal x a)
      (cons x (nth (position-equal x a) b))
      nil)))
assoc-equal-rembind-equaltheorem
(defthm assoc-equal-rembind-equal
  (equal (assoc-equal x (rembind-equal y a))
    (and (not (equal x y)) (assoc-equal x a))))
local
(local (defthm xassoc-equal-bind-all-equal
    (equal (assoc-equal x (bind-all-equal keys vals a))
      (if (member-equal x keys)
        (if (< (xposition-equal x keys) (len vals))
          (cons x (nth (xposition-equal x keys) vals))
          (assoc-equal x a))
        (assoc-equal x a)))))
assoc-equal-bind-all-equaltheorem
(defthm assoc-equal-bind-all-equal
  (equal (assoc-equal x (bind-all-equal keys vals a))
    (if (member-equal x keys)
      (if (< (position-equal x keys) (len vals))
        (cons x (nth (position-equal x keys) vals))
        (assoc-equal x a))
      (assoc-equal x a)))
  :hints (("Goal" :do-not-induct t)))
assoc-equal-domain-restrict-equaltheorem
(defthm assoc-equal-domain-restrict-equal
  (equal (assoc-equal x (domain-restrict-equal l a))
    (if (member-equal x l)
      (assoc-equal x a)
      nil)))
assoc-equal-rembind-all-equaltheorem
(defthm assoc-equal-rembind-all-equal
  (equal (assoc-equal x (rembind-all-equal l a))
    (if (member-equal x l)
      nil
      (assoc-equal x a))))
assoc-equal-bind-pairs-equaltheorem
(defthm assoc-equal-bind-pairs-equal
  (implies (alistp pairs)
    (equal (assoc-equal x (bind-pairs-equal pairs a))
      (if (assoc-equal x pairs)
        (assoc-equal x pairs)
        (assoc-equal x a)))))
local
(local (defthm assoc-equal-alist-compose-domain1
    (implies (and (alistp a1) (alistp a2) (not (assoc-equal x a1)))
      (not (assoc-equal x (alist-compose-domain-equal dom a1 a2))))))
local
(local (defthm assoc-equal-alist-compose-domain
    (implies (and (alistp a1) (alistp a2))
      (equal (assoc-equal x (alist-compose-domain-equal dom a1 a2))
        (if (member-equal x dom)
          (let ((pair1 (assoc-equal x a1)))
            (if pair1
              (let ((pair2 (assoc-equal (cdr pair1) a2)))
                (if pair2
                  (cons x (cdr pair2))
                  nil))
              nil))
          nil)))))
assoc-equal-alist-compose-equaltheorem
(defthm assoc-equal-alist-compose-equal
  (implies (and (alistp a1) (alistp a2))
    (equal (assoc-equal x (alist-compose-equal a1 a2))
      (let ((pair1 (assoc-equal x a1)))
        (if pair1
          (let ((pair2 (assoc-equal (cdr pair1) a2)))
            (if pair2
              (cons x (cdr pair2))
              nil))
          nil))))
  :hints (("Goal" :do-not-induct t :in-theory (disable domain))))
binding-equal-aconstheorem
(defthm binding-equal-acons
  (equal (binding-equal x (acons y z a))
    (if (equal x y)
      z
      (binding-equal x a))))
binding-equal-appendtheorem
(defthm binding-equal-append
  (implies (alistp a1)
    (equal (binding-equal x (append a1 a2))
      (if (bound?-equal x a1)
        (binding-equal x a1)
        (binding-equal x a2)))))
binding-equal-bind-equaltheorem
(defthm binding-equal-bind-equal
  (equal (binding-equal x (bind-equal y v a))
    (if (equal x y)
      v
      (binding-equal x a))))
local
(local (defthm xbinding-equal-pairlis$
    (equal (binding-equal x (pairlis$ a b))
      (if (member-equal x a)
        (nth (xposition-equal x a) b)
        nil))
    :hints (("Goal" :induct t))))
binding-equal-pairlis$theorem
(defthm binding-equal-pairlis$
  (equal (binding-equal x (pairlis$ a b))
    (if (member-equal x a)
      (nth (position-equal x a) b)
      nil))
  :hints (("Goal" :do-not-induct t :in-theory (disable binding-equal))))
binding-equal-rembind-equaltheorem
(defthm binding-equal-rembind-equal
  (equal (binding-equal x (rembind-equal y a))
    (if (eq x y)
      nil
      (binding-equal x a)))
  :hints (("Goal" :induct t)))
local
(local (defthm xbinding-equal-bind-all-equal
    (equal (binding-equal x (bind-all-equal keys vals a))
      (if (member-equal x keys)
        (if (< (xposition-equal x keys) (len vals))
          (nth (xposition-equal x keys) vals)
          (binding-equal x a))
        (binding-equal x a)))
    :hints (("Subgoal *1/1.9" :expand ((nth (+ 1 (xposition-equal x (cdr keys))) vals))))))
binding-equal-bind-all-equaltheorem
(defthm binding-equal-bind-all-equal
  (equal (binding-equal x (bind-all-equal keys vals a))
    (if (member-equal x keys)
      (if (< (position-equal x keys) (len vals))
        (nth (position-equal x keys) vals)
        (binding-equal x a))
      (binding-equal x a)))
  :hints (("Goal" :do-not-induct t :in-theory (disable binding-equal))))
binding-equal-domain-restrict-equaltheorem
(defthm binding-equal-domain-restrict-equal
  (equal (binding-equal x (domain-restrict-equal l a))
    (if (member-equal x l)
      (if (bound?-equal x a)
        (binding-equal x a)
        nil)
      nil))
  :hints (("Goal" :in-theory (enable binding-equal bound?-equal))))
binding-equal-rembind-all-equaltheorem
(defthm binding-equal-rembind-all-equal
  (equal (binding-equal x (rembind-all-equal l a))
    (if (member x l)
      nil
      (binding-equal x a))))
binding-equal-bind-pairs-equaltheorem
(defthm binding-equal-bind-pairs-equal
  (implies (alistp pairs)
    (equal (binding-equal x (bind-pairs-equal pairs a))
      (if (bound?-equal x pairs)
        (binding-equal x pairs)
        (binding-equal x a)))))
binding-equal-alist-compose-equaltheorem
(defthm binding-equal-alist-compose-equal
  (implies (and (alistp a1) (alistp a2))
    (equal (binding-equal x (alist-compose-equal a1 a2))
      (if (bound?-equal x a1)
        (if (bound?-equal (binding-equal x a1) a2)
          (binding-equal (binding-equal x a1) a2)
          nil)
        nil)))
  :hints (("Goal" :do-not-induct t :in-theory (disable domain))))
local
(local (defun double-list-induction
    (a b)
    (declare (xargs :guard (and (true-listp a) (true-listp b))))
    (cond ((endp a) nil)
      ((endp b) nil)
      (t (double-list-induction (cdr a) (cdr b))))))
equal-domain-fwd-to-bound?-equaltheorem
(defthm equal-domain-fwd-to-bound?-equal
  (implies (and (equal (domain a) (domain b))
      (bound?-equal x a)
      (alistp a)
      (alistp b))
    (bound?-equal x b))
  :rule-classes :forward-chaining :hints (("Goal" :induct (double-list-induction a b))))
bound?-equal-aconstheorem
(defthm bound?-equal-acons
  (equal (bound?-equal x (acons y z a))
    (or (equal x y) (bound?-equal x a))))
bound?-equal-appendtheorem
(defthm bound?-equal-append
  (implies (alistp a1)
    (equal (bound?-equal x (append a1 a2))
      (or (bound?-equal x a1) (bound?-equal x a2)))))
bound?-equal-bind-equaltheorem
(defthm bound?-equal-bind-equal
  (equal (bound?-equal x (bind-equal y v a))
    (or (equal x y) (bound?-equal x a))))
bound?-equal-pairlis$theorem
(defthm bound?-equal-pairlis$
  (iff (bound?-equal x (pairlis$ a b)) (member-equal x a)))
bound?-equal-rembind-equaltheorem
(defthm bound?-equal-rembind-equal
  (equal (bound?-equal x (rembind-equal y a))
    (and (not (equal x y)) (bound?-equal x a))))
local
(local (defthm xbound?-equal-bind-all-equal
    (equal (bound?-equal x (bind-all-equal keys vals a))
      (if (member-equal x keys)
        (or (< (xposition-equal x keys) (len vals))
          (bound?-equal x a))
        (bound?-equal x a)))
    :hints (("Goal" :do-not-induct t :in-theory (enable bound?-equal)))))
bound?-equal-bind-all-equaltheorem
(defthm bound?-equal-bind-all-equal
  (equal (bound?-equal x (bind-all-equal keys vals a))
    (if (member-equal x keys)
      (or (< (position-equal x keys) (len vals))
        (bound?-equal x a))
      (bound?-equal x a)))
  :hints (("Goal" :do-not-induct t)))
bound?-equal-domain-restrict-equaltheorem
(defthm bound?-equal-domain-restrict-equal
  (equal (bound?-equal x (domain-restrict-equal l a))
    (and (member-equal x l) (bound?-equal x a)))
  :hints (("Goal" :do-not-induct t :in-theory (enable bound?-equal))))
bound?-equal-rembind-all-equaltheorem
(defthm bound?-equal-rembind-all-equal
  (equal (bound?-equal x (rembind-all-equal l a))
    (if (member-equal x l)
      nil
      (bound?-equal x a))))
bound?-equal-bind-pairs-equaltheorem
(defthm bound?-equal-bind-pairs-equal
  (implies (alistp pairs)
    (equal (bound?-equal x (bind-pairs-equal pairs a))
      (or (bound?-equal x pairs) (bound?-equal x a)))))
bound?-equal-alist-compose-equaltheorem
(defthm bound?-equal-alist-compose-equal
  (implies (and (alistp a1) (alistp a2))
    (equal (bound?-equal x (alist-compose-equal a1 a2))
      (and (bound?-equal x a1)
        (bound?-equal (binding-equal x a1) a2))))
  :hints (("Goal" :do-not-induct t :in-theory (disable domain))))
all-bound?-equal-aconstheorem
(defthm all-bound?-equal-acons
  (implies (all-bound?-equal l a)
    (all-bound?-equal l (acons x y a))))
all-bound?-equal-append1theorem
(defthm all-bound?-equal-append1
  (equal (all-bound?-equal (append x y) a)
    (and (all-bound?-equal x a) (all-bound?-equal y a))))
all-bound?-equal-append2atheorem
(defthm all-bound?-equal-append2a
  (implies (all-bound?-equal l a)
    (all-bound?-equal l (append a b))))
all-bound?-equal-append2btheorem
(defthm all-bound?-equal-append2b
  (implies (and (alistp a) (all-bound?-equal l b))
    (all-bound?-equal l (append a b))))
all-bound?-firstntheorem
(defthm all-bound?-firstn
  (implies (all-bound?-equal l a)
    (all-bound?-equal (firstn n l) a)))
all-bound?-nthcdrtheorem
(defthm all-bound?-nthcdr
  (implies (all-bound?-equal l a)
    (all-bound?-equal (nthcdr n l) a)))
all-bound?-equal-bind-equaltheorem
(defthm all-bound?-equal-bind-equal
  (implies (all-bound?-equal l a)
    (all-bound?-equal l (bind-equal x y a))))
all-bound?-equal-pairlis$theorem
(defthm all-bound?-equal-pairlis$
  (iff (all-bound?-equal x (pairlis$ a b))
    (subsetp-equal x a)))
all-bound?-equal-rembind-equaltheorem
(defthm all-bound?-equal-rembind-equal
  (equal (all-bound?-equal l (rembind-equal x a))
    (if (member-equal x l)
      nil
      (all-bound?-equal l a))))
all-bound?-equal-bind-all-equaltheorem
(defthm all-bound?-equal-bind-all-equal
  (implies (<= (len keys) (len vals))
    (all-bound?-equal keys (bind-all-equal keys vals a))))
all-bound?-equal-domain-restrict-equaltheorem
(defthm all-bound?-equal-domain-restrict-equal
  (implies (and (all-bound?-equal l a) (subsetp-equal l l1))
    (all-bound?-equal l (domain-restrict-equal l1 a))))
all-bound?-equal-rembind-all-equaltheorem
(defthm all-bound?-equal-rembind-all-equal
  (equal (all-bound?-equal l1 (rembind-all-equal l2 a))
    (if (intersection-equal l1 l2)
      nil
      (all-bound?-equal l1 a))))
all-bound?-equal-bind-pairs-equal1theorem
(defthm all-bound?-equal-bind-pairs-equal1
  (implies (all-bound?-equal l pairs)
    (all-bound?-equal l (bind-pairs-equal pairs a))))
all-bound?-equal-bind-pairs-equal2theorem
(defthm all-bound?-equal-bind-pairs-equal2
  (implies (all-bound?-equal l a)
    (all-bound?-equal l (bind-pairs-equal pairs a))))
local
(local (defthm bound?-equal-alist-compose-domain-equal
    (implies (and (alistp a1) (alistp a2))
      (equal (bound?-equal x (alist-compose-domain-equal dom a1 a2))
        (and (member x dom)
          (bound?-equal x a1)
          (bound?-equal (binding-equal x a1) a2))))))
all-bound?-equal-alist-compose-equaltheorem
(defthm all-bound?-equal-alist-compose-equal
  (implies (and (alistp a1)
      (alistp a2)
      (all-bound?-equal l a1)
      (all-bound?-equal (all-bindings-equal l a1) a2))
    (all-bound?-equal l (alist-compose-equal a1 a2)))
  :hints (("Goal" :in-theory (disable bound?-equal domain))))
all-bound?-equal-collect-bound-equaltheorem
(defthm all-bound?-equal-collect-bound-equal
  (all-bound?-equal (collect-bound-equal l a) a))
all-bound?-equal-collect-bound-equal1theorem
(defthm all-bound?-equal-collect-bound-equal1
  (implies (and (true-listp l) (all-bound?-equal l a))
    (equal (collect-bound-equal l a) l)))
collect-bound-equal-appendtheorem
(defthm collect-bound-equal-append
  (equal (collect-bound-equal (append x y) a)
    (append (collect-bound-equal x a) (collect-bound-equal y a))))
all-bindings-equal-appendtheorem
(defthm all-bindings-equal-append
  (equal (all-bindings-equal (append x y) a)
    (append (all-bindings-equal x a) (all-bindings-equal y a))))
domain-aconstheorem
(defthm domain-acons
  (equal (domain (acons x v a)) (cons x (domain a))))
domain-appendtheorem
(defthm domain-append
  (equal (domain (append a1 a2))
    (append (domain a1) (domain a2))))
domain-constheorem
(defthm domain-cons
  (equal (domain (cons pair a)) (cons (car pair) (domain a))))
domain-bind-equaltheorem
(defthm domain-bind-equal
  (implies (alistp a)
    (equal (domain (bind-equal x v a))
      (if (bound?-equal x a)
        (domain a)
        (append (domain a) (list x)))))
  :hints (("Goal" :induct t)))
domain-pairlis$theorem
(defthm domain-pairlis$
  (implies (true-listp a) (equal (domain (pairlis$ a b)) a))
  :hints (("Goal" :induct t)))
domain-rembind-equaltheorem
(defthm domain-rembind-equal
  (equal (domain (rembind-equal x a))
    (remove-equal x (domain a)))
  :hints (("Goal" :induct t)))
domain-bind-all-equaltheorem
(defthm domain-bind-all-equal
  (implies (and (alistp a) (all-bound?-equal l a))
    (equal (domain (bind-all-equal l vals a)) (domain a)))
  :hints (("Goal" :induct (bind-all-equal l vals a)
     :in-theory (disable bound?-equal bind-equal domain))))
domain-domain-restrict-equaltheorem
(defthm domain-domain-restrict-equal
  (equal (domain (domain-restrict-equal l a))
    (intersection-equal (domain a) l))
  :hints (("Goal" :in-theory (enable domain))))
domain-rembind-all-equaltheorem
(defthm domain-rembind-all-equal
  (subsetp-equal (domain (rembind-all-equal l a)) (domain a)))
domain-bind-pairs-equaltheorem
(defthm domain-bind-pairs-equal
  (implies (and (alistp pairs)
      (alistp a)
      (all-bound?-equal (domain pairs) a))
    (equal (domain (bind-pairs-equal pairs a)) (domain a)))
  :hints (("Goal" :induct (bind-pairs-equal pairs a)
     :in-theory (disable domain bind-equal bound?-equal))))
local
(local (defthm domain-alist-compose-domain-equal
    (implies (and (alistp a1) (alistp a2))
      (subsetp-equal (domain (alist-compose-domain-equal dom a1 a2))
        dom))
    :hints (("Goal" :in-theory (disable domain bound?-equal binding-equal)))))
domain-alist-compose-equaltheorem
(defthm domain-alist-compose-equal
  (implies (and (alistp a1) (alistp a2))
    (subsetp-equal (domain (alist-compose-equal a1 a2))
      (domain a1)))
  :hints (("Goal" :in-theory (disable domain bound?-equal binding-equal))))
range-aconstheorem
(defthm range-acons
  (equal (range (acons x y a)) (cons y (range a))))
range-appendtheorem
(defthm range-append
  (equal (range (append a1 a2))
    (append (range a1) (range a2))))
range-constheorem
(defthm range-cons
  (equal (range (cons pair a)) (cons (cdr pair) (range a))))
range-bind-equaltheorem
(defthm range-bind-equal
  (implies (and (alistp a) (not (bound?-equal x a)))
    (equal (range (bind-equal x v a))
      (append (range a) (list v))))
  :hints (("goal" :induct t)))
range-pairlis$theorem
(defthm range-pairlis$
  (implies (and (true-listp y) (equal (len x) (len y)))
    (equal (range (pairlis$ x y)) y))
  :hints (("Goal" :in-theory (enable range) :induct (pairlis$ x y))))
subsetp-equal-range-rembind-equaltheorem
(defthm subsetp-equal-range-rembind-equal
  (subsetp-equal (range (rembind-equal x l)) (range l))
  :hints (("Goal" :in-theory (enable range))))
in-theory
(in-theory (disable acons
    alist-compose
    alist-compose-eq
    alist-compose-equal
    bound?
    bound?-eq
    bound?-equal
    binding
    binding-eq
    binding-equal
    domain
    range))