From ed03015e8181856da5189a1635c95e0e2f06e3ff Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Sun, 22 Nov 2020 00:22:44 +0100 Subject: [PATCH] network: Add domains to network-form. --- networks.rkt | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/networks.rkt b/networks.rkt index 344fc53..447c187 100644 --- a/networks.rkt +++ b/networks.rkt @@ -20,7 +20,9 @@ [struct dynamics ([network network?] [mode mode?])] [struct network ([functions (hash/c variable? procedure?)] - [domains domain-mapping/c])]) + [domains domain-mapping/c])] + [struct network-form ([forms variable-mapping?] + [domains domain-mapping/c])]) ;; Functions (contract-out [update (-> network? state? (set/c variable? #:kind 'dont-care) state?)] [make-state (-> (listof (cons/c symbol? any/c)) state?)] @@ -236,9 +238,10 @@ ;;; '(and x y (not z)) or '(+ 1 a (- b 10)). (define update-function-form? any/c) -;;; A Boolean network form is a mapping from its variables to the -;;; forms of their update functions. -(define network-form? variable-mapping?) +;;; A network form consists of a mapping from variables to the forms +;;; of their update functions, together with a mapping from its +;;; variables to its update functions. +(struct network-form (forms domains)) ;;; Build an update function from an update function form. (define (update-function-form->update-function form)