(constraintlist-add-ctx x ctx) → new-x
Function:
(defun constraintlist-add-ctx (x ctx) (declare (xargs :guard (sv::constraintlist-p x))) (let ((__function__ 'constraintlist-add-ctx)) (declare (ignorable __function__)) (if (atom x) nil (cons (b* (((sv::constraint x1) (car x))) (sv::change-constraint x1 :name (if (and ctx (atom x1.name)) (cons ctx x1.name) x1.name))) (constraintlist-add-ctx (cdr x) ctx)))))
Theorem:
(defthm constraintlist-p-of-constraintlist-add-ctx (b* ((new-x (constraintlist-add-ctx x ctx))) (sv::constraintlist-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm constraintlist-add-ctx-of-append (equal (constraintlist-add-ctx (append x y) ctx) (append (constraintlist-add-ctx x ctx) (constraintlist-add-ctx y ctx))))
Theorem:
(defthm constraintlist-add-ctx-of-atom (implies (atom x) (equal (constraintlist-add-ctx x ctx) nil)) :rule-classes ((:rewrite :backchain-limit-lst 1)))
Theorem:
(defthm constraintlist-add-ctx-of-null-ctx (equal (constraintlist-add-ctx constraints nil) (list-fix (sv::constraintlist-fix constraints))))
Theorem:
(defthm constraintlist-add-ctx-of-constraintlist-fix-x (equal (constraintlist-add-ctx (sv::constraintlist-fix x) ctx) (constraintlist-add-ctx x ctx)))
Theorem:
(defthm constraintlist-add-ctx-constraintlist-equiv-congruence-on-x (implies (sv::constraintlist-equiv x x-equiv) (equal (constraintlist-add-ctx x ctx) (constraintlist-add-ctx x-equiv ctx))) :rule-classes :congruence)