                                                                        locks
                                                                        %)))))
 ;;=> A set of not locked instructions
-               p-incomplete-instrs (set (->> (:instructions  the-process-
-                                                             scheduled-parts)
+               p-incomplete-instrs (set (->> (:instructions  the-process-scheduled-parts)
                                              (filter incomplete-instruction?)
                                              (map #(dissoc % :count))))
 ;;=> A set of incomplete instructions

(ns recipe3.core
  (:require [instaparse.core :as insta])
  (:require [clojure.zip :as z])
  (:require [clojure.pprint :refer :all]))

                                 (first))
;;=> To update the "scheduled" ref, we begin by finding the
;; ':process-d' in the processes vector
             instr-in-p-in-scheduled (->> (get p-in-scheduled :instructions)
                                          (filter #(= (:inst-id %)
                                                      the-instr-to-fire-id))
                                          (first))
;; Then We find the instruction in this process
             idx-p-in-scheduled (max 0 (.indexOf @scheduled-ref p-in-scheduled))
             idx-inst-in-p-in-scheduled (max 0 (.indexOf  (get p-in-scheduled :instructions) instr-in-p-in-scheduled))
;;=> We compute the index of the instruction; or we set it at 0
;; if it is not found, which means it is the first time it is
;; scheduled.
