Merge a vl-immdeps into a vl-immdepgraph.
(vl-immdepgraph-merge name deps graph) → new-graph
Note that we don't check for any duplicate names here; we can do a better check for uniqueness, later.
Function:
(defun vl-immdepgraph-merge (name deps graph) (declare (xargs :guard (and (stringp name) (vl-immdeps-p deps) (vl-immdepgraph-p graph)))) (let ((__function__ 'vl-immdepgraph-merge)) (declare (ignorable __function__)) (b* ((name (string-fix name)) ((vl-immdeps deps)) ((vl-immdepgraph graph)) (new-okp (and deps.all-okp graph.all-okp)) (new-reportcard (vl-extend-reportcard-list name deps.warnings graph.reportcard)) (new-deps (cons (cons name (remove-equal name deps.deps)) graph.deps))) (make-vl-immdepgraph :all-okp new-okp :deps new-deps :reportcard new-reportcard))))
Theorem:
(defthm vl-immdepgraph-p-of-vl-immdepgraph-merge (b* ((new-graph (vl-immdepgraph-merge name deps graph))) (vl-immdepgraph-p new-graph)) :rule-classes :rewrite)
Theorem:
(defthm vl-immdepgraph-merge-of-str-fix-name (equal (vl-immdepgraph-merge (str-fix name) deps graph) (vl-immdepgraph-merge name deps graph)))
Theorem:
(defthm vl-immdepgraph-merge-streqv-congruence-on-name (implies (streqv name name-equiv) (equal (vl-immdepgraph-merge name deps graph) (vl-immdepgraph-merge name-equiv deps graph))) :rule-classes :congruence)
Theorem:
(defthm vl-immdepgraph-merge-of-vl-immdeps-fix-deps (equal (vl-immdepgraph-merge name (vl-immdeps-fix deps) graph) (vl-immdepgraph-merge name deps graph)))
Theorem:
(defthm vl-immdepgraph-merge-vl-immdeps-equiv-congruence-on-deps (implies (vl-immdeps-equiv deps deps-equiv) (equal (vl-immdepgraph-merge name deps graph) (vl-immdepgraph-merge name deps-equiv graph))) :rule-classes :congruence)
Theorem:
(defthm vl-immdepgraph-merge-of-vl-immdepgraph-fix-graph (equal (vl-immdepgraph-merge name deps (vl-immdepgraph-fix graph)) (vl-immdepgraph-merge name deps graph)))
Theorem:
(defthm vl-immdepgraph-merge-vl-immdepgraph-equiv-congruence-on-graph (implies (vl-immdepgraph-equiv graph graph-equiv) (equal (vl-immdepgraph-merge name deps graph) (vl-immdepgraph-merge name deps graph-equiv))) :rule-classes :congruence)