bn: Add some types for syntactic description of Boolean networks.

This commit is contained in:
Sergiu Ivanov 2020-02-18 11:40:41 +01:00
parent 912fe95891
commit a061e2d7bc
1 changed files with 20 additions and 0 deletions

20
bn.rkt
View File

@ -10,6 +10,11 @@
(provide Variable State UpdateFunc Network
update make-state make-bn)
;;; =================
;;; Basic definitions
;;; =================
(define-type Variable Symbol)
;;; 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))
(define (make-bn 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))