networks: Include domains into the network.

This change is breaking.  The following commits will progressively fix
the whole network module.
This commit is contained in:
Sergiu Ivanov 2020-11-21 22:53:45 +01:00
parent f1a1123cc4
commit a3ac1c7fcd

View file

@ -18,7 +18,9 @@
(contract-out [struct tbf/state ([weights (hash/c variable? number?)]
[threshold number?])]
[struct dynamics ([network network?]
[mode mode?])])
[mode mode?])]
[struct network ([functions (hash/c variable? procedure?)]
[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?)]
@ -173,13 +175,10 @@
;;; state.
(define update-function/c (-> state? any/c))
;;; A network is a mapping from its variables to its update functions.
;;;
;;; Note that the domains of the variables of the network are not part
;;; of the network definition. This is because the variables of some
;;; networks may have infinite domains, which can be restricted in
;;; multiple different ways.
(define network? (hash/c variable? procedure?))
;;; A network consists of a mapping from its variables to its update
;;; variables, as a well as of a mapping from its variables to
;;; their domains.
(struct network (functions domains))
;;; Given a state s updates all the variables from xs.
(define (update network s xs)