2020-02-15 13:32:54 +01:00
|
|
|
#lang typed/racket
|
|
|
|
|
|
|
|
;;; dds/bn
|
|
|
|
|
|
|
|
;;; This module provides some quick definitions for running Boolean
|
|
|
|
;;; networks. A Boolean network is a set of Boolean variables which
|
|
|
|
;;; are updated according to their corresponding update functions.
|
|
|
|
;;; The variables to be updated at each step are given by the mode.
|
|
|
|
|
2020-02-15 15:17:03 +01:00
|
|
|
(provide State UpdateFunc Network)
|
2020-02-15 13:32:54 +01:00
|
|
|
|
2020-02-15 15:16:20 +01:00
|
|
|
;;; A state of a Boolean network is a mapping from the variables of the
|
|
|
|
;;; network to their Boolean values.
|
2020-02-15 13:32:54 +01:00
|
|
|
(define-type State (HashTable Symbol Boolean))
|
|
|
|
|
2020-02-15 15:16:20 +01:00
|
|
|
;;; An update function is a Boolean function computing a Boolean value
|
|
|
|
;;; from the given state.
|
2020-02-15 13:32:54 +01:00
|
|
|
(define-type UpdateFunc (-> State Boolean))
|
|
|
|
|
2020-02-15 15:16:20 +01:00
|
|
|
;;; A Boolean network is a mapping from its variables to its update
|
|
|
|
;;; functions.
|
2020-02-15 13:32:54 +01:00
|
|
|
(define-type Network (HashTable Symbol UpdateFunc))
|