Convert a wire index to a path relative to the module it's in.
Function:
(defun moddb-wireidx->path (wireidx modidx moddb) (declare (xargs :stobjs (moddb))) (declare (xargs :guard (and (natp wireidx) (natp modidx) (moddb-ok moddb)))) (declare (xargs :guard (and (< modidx (moddb->nmods moddb)) (< wireidx (moddb-mod-totalwires modidx moddb))))) (let ((__function__ 'moddb-wireidx->path)) (declare (ignorable __function__)) (b* (((mv path ?wire) (moddb-wireidx->path/decl wireidx modidx moddb))) path)))
Theorem:
(defthm path-p-of-moddb-wireidx->path (b* ((path (moddb-wireidx->path wireidx modidx moddb))) (path-p path)) :rule-classes :rewrite)
Theorem:
(defthm moddb-wireidx->path-of-nfix-wireidx (equal (moddb-wireidx->path (nfix wireidx) modidx moddb) (moddb-wireidx->path wireidx modidx moddb)))
Theorem:
(defthm moddb-wireidx->path-nat-equiv-congruence-on-wireidx (implies (nat-equiv wireidx wireidx-equiv) (equal (moddb-wireidx->path wireidx modidx moddb) (moddb-wireidx->path wireidx-equiv modidx moddb))) :rule-classes :congruence)
Theorem:
(defthm moddb-wireidx->path-of-nfix-modidx (equal (moddb-wireidx->path wireidx (nfix modidx) moddb) (moddb-wireidx->path wireidx modidx moddb)))
Theorem:
(defthm moddb-wireidx->path-nat-equiv-congruence-on-modidx (implies (nat-equiv modidx modidx-equiv) (equal (moddb-wireidx->path wireidx modidx moddb) (moddb-wireidx->path wireidx modidx-equiv moddb))) :rule-classes :congruence)
Theorem:
(defthm moddb-wireidx->path-of-moddb-fix-moddb (equal (moddb-wireidx->path wireidx modidx (moddb-fix moddb)) (moddb-wireidx->path wireidx modidx moddb)))
Theorem:
(defthm moddb-wireidx->path-moddb-equiv-congruence-on-moddb (implies (moddb-equiv moddb moddb-equiv) (equal (moddb-wireidx->path wireidx modidx moddb) (moddb-wireidx->path wireidx modidx moddb-equiv))) :rule-classes :congruence)