From 377e114834f6157effd205dad5b7078aea12e8d4 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Thu, 19 Sep 2024 17:03:54 +0100 Subject: propnet: Describe state machine implementation. * ravanan/propnet.scm (run-propnet): Add comment describing state machine implementation. --- ravanan/propnet.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3