bn: Variable: Add the type synomym and use it.

This commit is contained in:
Sergiu Ivanov 2020-02-15 15:19:53 +01:00
parent 33fd5f7721
commit 51a7dc8498
1 changed files with 5 additions and 3 deletions

8
bn.rkt
View File

@ -7,11 +7,13 @@
;;; are updated according to their corresponding update functions.
;;; The variables to be updated at each step are given by the mode.
(provide State UpdateFunc Network)
(provide Variable State UpdateFunc Network)
(define-type Variable Symbol)
;;; A state of a Boolean network is a mapping from the variables of the
;;; network to their Boolean values.
(define-type State (HashTable Symbol Boolean))
(define-type State (HashTable Variable Boolean))
;;; An update function is a Boolean function computing a Boolean value
;;; from the given state.
@ -19,4 +21,4 @@
;;; A Boolean network is a mapping from its variables to its update
;;; functions.
(define-type Network (HashTable Symbol UpdateFunc))
(define-type Network (HashTable Variable UpdateFunc))