Type forms->boolean-network.
This commit is contained in:
parent
871a923842
commit
0336526a84
2 changed files with 24 additions and 14 deletions
28
networks.rkt
28
networks.rkt
|
@ -21,6 +21,7 @@
|
|||
update-function-form->update-function/01
|
||||
network-form->network/any network-form->network/boolean
|
||||
network-form->network/01 make-boolean-network-form
|
||||
forms->boolean-network
|
||||
)
|
||||
|
||||
(define-type (State a) (VariableMapping a))
|
||||
|
@ -225,6 +226,18 @@
|
|||
(network-form
|
||||
'#hash((a . (and a b)) (b . (not b)))
|
||||
'#hash((a . (#f #t)) (b . (#f #t)))))))
|
||||
|
||||
(: forms->boolean-network (-> (VariableMapping UpdateFunctionForm)
|
||||
(Network Boolean)))
|
||||
(define forms->boolean-network
|
||||
(compose network-form->network/boolean make-boolean-network-form))
|
||||
|
||||
(module+ test
|
||||
(test-case "forms->boolean-network"
|
||||
(define n (forms->boolean-network (hash 'a '(and a b)
|
||||
'b '(not b))))
|
||||
(check-equal? (network-domains n) (hash 'a '(#f #t)
|
||||
'b '(#f #t)))))
|
||||
)
|
||||
|
||||
(require 'typed)
|
||||
|
@ -241,8 +254,7 @@
|
|||
[struct dynamics ([network network?]
|
||||
[mode mode?])])
|
||||
;; Functions
|
||||
(contract-out [forms->boolean-network (-> variable-mapping? network?)]
|
||||
[list-syntactic-interactions (-> network-form? variable? (listof variable?))]
|
||||
(contract-out [list-syntactic-interactions (-> network-form? variable? (listof variable?))]
|
||||
[build-syntactic-interaction-graph (-> network-form? graph?)]
|
||||
[interaction? (-> network? variable? variable? boolean?)]
|
||||
[get-interaction-sign (-> network? variable? variable? (or/c #f -1 0 1))]
|
||||
|
@ -388,18 +400,6 @@
|
|||
|
||||
(define update-function-form? any/c)
|
||||
|
||||
;;; Build a Boolean network from a given mapping assigning forms
|
||||
;;; to variables.
|
||||
(define forms->boolean-network
|
||||
(compose network-form->network/any make-boolean-network-form))
|
||||
|
||||
(module+ test
|
||||
(test-case "forms->boolean-network"
|
||||
(define n (forms->boolean-network (hash 'a '(and a b)
|
||||
'b '(not b))))
|
||||
(check-equal? (network-domains n) (hash 'a '(#f #t)
|
||||
'b '(#f #t)))))
|
||||
|
||||
|
||||
;;; ============================
|
||||
;;; Inferring interaction graphs
|
||||
|
|
|
@ -320,6 +320,16 @@ Build a Boolean network form from a given mapping assigning forms to variables.
|
|||
'b '(not b)))
|
||||
]}
|
||||
|
||||
@defproc[(forms->boolean-network [forms (VariableMapping UpdateFunctionForm)])
|
||||
(Network Boolean)]{
|
||||
|
||||
Build a Boolean network from a given mapping assigning forms to variables.
|
||||
|
||||
@ex[
|
||||
(forms->boolean-network (hash 'a '(and a b)
|
||||
'b '(not b)))
|
||||
]}
|
||||
|
||||
@section{Inferring interaction graphs}
|
||||
|
||||
This section provides inference of both unsigned and signed interaction graphs.
|
||||
|
|
Loading…
Reference in a new issue