bn: Add some types for syntactic description of Boolean networks.
This commit is contained in:
parent
912fe95891
commit
a061e2d7bc
1 changed files with 20 additions and 0 deletions
20
bn.rkt
20
bn.rkt
|
@ -10,6 +10,11 @@
|
||||||
(provide Variable State UpdateFunc Network
|
(provide Variable State UpdateFunc Network
|
||||||
update make-state make-bn)
|
update make-state make-bn)
|
||||||
|
|
||||||
|
|
||||||
|
;;; =================
|
||||||
|
;;; Basic definitions
|
||||||
|
;;; =================
|
||||||
|
|
||||||
(define-type Variable Symbol)
|
(define-type Variable Symbol)
|
||||||
|
|
||||||
;;; A state of a Boolean network is a mapping from the variables of the
|
;;; A state of a Boolean network is a mapping from the variables of the
|
||||||
|
@ -45,3 +50,18 @@
|
||||||
(: make-bn (-> (Listof (Pairof Variable UpdateFunc)) Network))
|
(: make-bn (-> (Listof (Pairof Variable UpdateFunc)) Network))
|
||||||
(define (make-bn funcs)
|
(define (make-bn funcs)
|
||||||
(make-hash funcs))
|
(make-hash funcs))
|
||||||
|
|
||||||
|
|
||||||
|
;;; =========================================
|
||||||
|
;;; Syntactic description of Boolean networks
|
||||||
|
;;; =========================================
|
||||||
|
|
||||||
|
;;; An UpdateFuncForm is any form which can appear as a body of a
|
||||||
|
;;; Boolean function and which can be evaluated with eval. For
|
||||||
|
;;; example, '(and x y (not z)).
|
||||||
|
(define-type UpdateFuncForm Any)
|
||||||
|
|
||||||
|
;;; A Boolean network form is a mapping from its variables to the
|
||||||
|
;;; forms of their update functions.
|
||||||
|
(define-type NetworkForm (HashTable Variable UpdateFuncForm))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue