(defn index-instruction [blk-id idx inst]
(let [idx (reduce
(fn [acc id]
(update-in acc [id :read-in] (fnil conj #{}) blk-id))
idx
(filter instruction? (reads-from inst)))
idx (reduce
(fn [acc id]
(update-in acc [id :written-in] (fnil conj #{}) blk-id))
idx
(filter instruction? (writes-to inst)))]
idx))