networks: Restructure the exports slightly.
This commit is contained in:
parent
cf19859be8
commit
768fa7aabc
1 changed files with 10 additions and 7 deletions
17
networks.rkt
17
networks.rkt
|
@ -13,18 +13,21 @@
|
||||||
(require "utils.rkt")
|
(require "utils.rkt")
|
||||||
|
|
||||||
(provide
|
(provide
|
||||||
;; Functions with contracts
|
;; Functions
|
||||||
(contract-out [update (-> network? state? (listof variable?) state?)]
|
(contract-out [update (-> network? state? (listof variable?) state?)]
|
||||||
[make-state (-> (listof (cons/c symbol? any/c)) state?)]
|
[make-state (-> (listof (cons/c symbol? any/c)) state?)]
|
||||||
[make-network-from-functions (-> (listof (cons/c symbol? update-function?)) network?)]
|
[make-network-from-functions (-> (listof (cons/c symbol? update-function/c)) network?)]
|
||||||
[update-function-form->update-function (-> update-function-form? update-function?)]
|
[update-function-form->update-function (-> update-function-form? update-function/c)]
|
||||||
[network-form->network (-> network-form? network?)]
|
[network-form->network (-> network-form? network?)]
|
||||||
[make-network-from-forms (-> (listof (cons/c symbol? update-function-form?))
|
[make-network-from-forms (-> (listof (cons/c symbol? update-function-form?))
|
||||||
network?)])
|
network?)])
|
||||||
;; Functions
|
;; Predicates
|
||||||
variable? state? update-function? update-function-form? network-form?
|
(contract-out [variable? (-> any/c boolean?)]
|
||||||
|
[state? (-> any/c boolean?)]
|
||||||
|
[update-function-form? (-> any/c boolean?)]
|
||||||
|
[network-form? (-> any/c boolean?)])
|
||||||
;; Contracts
|
;; Contracts
|
||||||
state/c network/c
|
state/c network/c update-function/c
|
||||||
;; Syntax
|
;; Syntax
|
||||||
st nn)
|
st nn)
|
||||||
|
|
||||||
|
@ -42,7 +45,7 @@
|
||||||
|
|
||||||
;;; An update function is a function computing a value from the given
|
;;; An update function is a function computing a value from the given
|
||||||
;;; state.
|
;;; state.
|
||||||
(define update-function? (-> state? any/c))
|
(define update-function/c (-> state? any/c))
|
||||||
|
|
||||||
;;; A network is a mapping from its variables to its update functions.
|
;;; A network is a mapping from its variables to its update functions.
|
||||||
(define network? variable-mapping?)
|
(define network? variable-mapping?)
|
||||||
|
|
Loading…
Reference in a new issue