network: Add domains to network-form.
This commit is contained in:
parent
cfe710e6b2
commit
ed03015e81
1 changed files with 7 additions and 4 deletions
11
networks.rkt
11
networks.rkt
|
@ -20,7 +20,9 @@
|
||||||
[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])])
|
[domains domain-mapping/c])]
|
||||||
|
[struct network-form ([forms variable-mapping?]
|
||||||
|
[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?)]
|
||||||
[make-state (-> (listof (cons/c symbol? any/c)) state?)]
|
[make-state (-> (listof (cons/c symbol? any/c)) 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)
|
||||||
|
|
Loading…
Reference in a new issue