networks: Restructure the exports slightly.

This commit is contained in:
Sergiu Ivanov 2020-02-20 14:13:48 +01:00
parent cf19859be8
commit 768fa7aabc
1 changed files with 10 additions and 7 deletions

View File

@ -13,18 +13,21 @@
(require "utils.rkt")
(provide
;; Functions with contracts
;; Functions
(contract-out [update (-> network? state? (listof variable?) state?)]
[make-state (-> (listof (cons/c symbol? any/c)) state?)]
[make-network-from-functions (-> (listof (cons/c symbol? update-function?)) network?)]
[update-function-form->update-function (-> update-function-form? update-function?)]
[make-network-from-functions (-> (listof (cons/c symbol? update-function/c)) network?)]
[update-function-form->update-function (-> update-function-form? update-function/c)]
[network-form->network (-> network-form? network?)]
[make-network-from-forms (-> (listof (cons/c symbol? update-function-form?))
network?)])
;; Functions
variable? state? update-function? update-function-form? network-form?
;; Predicates
(contract-out [variable? (-> any/c boolean?)]
[state? (-> any/c boolean?)]
[update-function-form? (-> any/c boolean?)]
[network-form? (-> any/c boolean?)])
;; Contracts
state/c network/c
state/c network/c update-function/c
;; Syntax
st nn)
@ -42,7 +45,7 @@
;;; An update function is a function computing a value from the given
;;; 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.
(define network? variable-mapping?)