Delete an entry from the defines list, if it exists.
(vl-delete-define name x) → new-x
Function:
(defun vl-delete-define (name x) (declare (xargs :guard (and (stringp name) (vl-defines-p x)))) (let ((__function__ 'vl-delete-define)) (declare (ignorable __function__)) (cond ((atom x) nil) ((equal (string-fix name) (vl-define->name (car x))) (vl-delete-define name (cdr x))) (t (cons (vl-define-fix (car x)) (vl-delete-define name (cdr x)))))))
Theorem:
(defthm vl-defines-p-of-vl-delete-define (b* ((new-x (vl-delete-define name x))) (vl-defines-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-delete-define-of-str-fix-name (equal (vl-delete-define (str-fix name) x) (vl-delete-define name x)))
Theorem:
(defthm vl-delete-define-streqv-congruence-on-name (implies (streqv name name-equiv) (equal (vl-delete-define name x) (vl-delete-define name-equiv x))) :rule-classes :congruence)
Theorem:
(defthm vl-delete-define-of-vl-defines-fix-x (equal (vl-delete-define name (vl-defines-fix x)) (vl-delete-define name x)))
Theorem:
(defthm vl-delete-define-vl-defines-equiv-congruence-on-x (implies (vl-defines-equiv x x-equiv) (equal (vl-delete-define name x) (vl-delete-define name x-equiv))) :rule-classes :congruence)