network: Add domains to network-form.

This commit is contained in:
Sergiu Ivanov 2020-11-22 00:22:44 +01:00
parent cfe710e6b2
commit ed03015e81

View file

@ -20,6 +20,8 @@
[struct dynamics ([network network?] [struct dynamics ([network network?]
[mode mode?])] [mode mode?])]
[struct network ([functions (hash/c variable? procedure?)] [struct network ([functions (hash/c variable? procedure?)]
[domains domain-mapping/c])]
[struct network-form ([forms variable-mapping?]
[domains domain-mapping/c])]) [domains domain-mapping/c])])
;; Functions ;; Functions
(contract-out [update (-> network? state? (set/c variable? #:kind 'dont-care) state?)] (contract-out [update (-> network? state? (set/c variable? #:kind 'dont-care) state?)]
@ -236,9 +238,10 @@
;;; '(and x y (not z)) or '(+ 1 a (- b 10)). ;;; '(and x y (not z)) or '(+ 1 a (- b 10)).
(define update-function-form? any/c) (define update-function-form? any/c)
;;; A Boolean network form is a mapping from its variables to the ;;; A network form consists of a mapping from variables to the forms
;;; forms of their update functions. ;;; of their update functions, together with a mapping from its
(define network-form? variable-mapping?) ;;; variables to its update functions.
(struct network-form (forms domains))
;;; Build an update function from an update function form. ;;; Build an update function from an update function form.
(define (update-function-form->update-function form) (define (update-function-form->update-function form)