(vl-check-struct-assignpat-keys pairs membs) → err
Function:
(defun vl-check-struct-assignpat-keys (pairs membs) (declare (xargs :guard (and (vl-keyvallist-p pairs) (vl-structmemberlist-p membs)))) (let ((__function__ 'vl-check-struct-assignpat-keys)) (declare (ignorable __function__)) (b* ((pairs (vl-keyvallist-fix pairs)) ((when (atom pairs)) nil) (key (caar pairs)) (err (vl-patternkey-case key :expr (vmsg "Array indexing key ~a0 not valid for struct patterns" key.key) :structmem (if (vl-find-structmember key.name membs) nil (vmsg "Not a field name: ~a0" key.name)) :type (vmsg "Datatype key ~a0 not valid for struct patterns" key.type) :default nil))) (or err (vl-check-struct-assignpat-keys (cdr pairs) membs)))))
Theorem:
(defthm return-type-of-vl-check-struct-assignpat-keys (b* ((err (vl-check-struct-assignpat-keys pairs membs))) (iff (vl-msg-p err) err)) :rule-classes :rewrite)
Theorem:
(defthm vl-check-struct-assignpat-keys-of-vl-keyvallist-fix-pairs (equal (vl-check-struct-assignpat-keys (vl-keyvallist-fix pairs) membs) (vl-check-struct-assignpat-keys pairs membs)))
Theorem:
(defthm vl-check-struct-assignpat-keys-vl-keyvallist-equiv-congruence-on-pairs (implies (vl-keyvallist-equiv pairs pairs-equiv) (equal (vl-check-struct-assignpat-keys pairs membs) (vl-check-struct-assignpat-keys pairs-equiv membs))) :rule-classes :congruence)
Theorem:
(defthm vl-check-struct-assignpat-keys-of-vl-structmemberlist-fix-membs (equal (vl-check-struct-assignpat-keys pairs (vl-structmemberlist-fix membs)) (vl-check-struct-assignpat-keys pairs membs)))
Theorem:
(defthm vl-check-struct-assignpat-keys-vl-structmemberlist-equiv-congruence-on-membs (implies (vl-structmemberlist-equiv membs membs-equiv) (equal (vl-check-struct-assignpat-keys pairs membs) (vl-check-struct-assignpat-keys pairs membs-equiv))) :rule-classes :congruence)