aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2024-09-19 17:03:54 +0100
committerArun Isaac2024-09-19 18:49:30 +0100
commit377e114834f6157effd205dad5b7078aea12e8d4 (patch)
treedf8e6166ff68bb0afe679da42d27baae2e83a01e
parent64a5cf9d2d4f279eb1560523bf0f8048568811dd (diff)
downloadravanan-377e114834f6157effd205dad5b7078aea12e8d4.tar.gz
ravanan-377e114834f6157effd205dad5b7078aea12e8d4.tar.lz
ravanan-377e114834f6157effd205dad5b7078aea12e8d4.zip
propnet: Describe state machine implementation.
* ravanan/propnet.scm (run-propnet): Add comment describing state machine implementation.
-rw-r--r--ravanan/propnet.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/ravanan/propnet.scm b/ravanan/propnet.scm
index 52a00bc..a8a549e 100644
--- a/ravanan/propnet.scm
+++ b/ravanan/propnet.scm
@@ -128,7 +128,12 @@ add to the inbox."
(cons propagator-input-name
(maybe-assoc-ref (just cells) cell-name))))
(propagator-inputs propagator))))
-
+
+ ;; We implement propagator networks as a state machine. The state consists of
+ ;; the current values of all the cells and the list of all propagators
+ ;; currently in flight. Each iteration of loop represents one state
+ ;; transition. This is a very functional approach. Propagator network
+ ;; implementations don't necessarily have to be mutational.
(let loop ((cells (list))
(cell-values-inbox initial-cell-values)
;; Pre-schedule all propagators to ensure we trigger those