networks: Add forms->boolean-network.
This commit is contained in:
parent
a4979d9c9f
commit
ec3c74b5e2
1 changed files with 13 additions and 0 deletions
13
networks.rkt
13
networks.rkt
|
@ -32,6 +32,7 @@
|
||||||
[update-function-form->update-function (-> update-function-form? update-function/c)]
|
[update-function-form->update-function (-> update-function-form? update-function/c)]
|
||||||
[network-form->network (-> network-form? network?)]
|
[network-form->network (-> network-form? network?)]
|
||||||
[make-boolean-network-form (-> variable-mapping? network-form?)]
|
[make-boolean-network-form (-> variable-mapping? network-form?)]
|
||||||
|
[forms->boolean-network (-> variable-mapping? network?)]
|
||||||
[list-syntactic-interactions (-> network-form? variable? (listof variable?))]
|
[list-syntactic-interactions (-> network-form? variable? (listof variable?))]
|
||||||
[build-syntactic-interaction-graph (-> network-form? graph?)]
|
[build-syntactic-interaction-graph (-> network-form? graph?)]
|
||||||
[interaction? (-> network? variable? variable? boolean?)]
|
[interaction? (-> network? variable? variable? boolean?)]
|
||||||
|
@ -299,6 +300,18 @@
|
||||||
(make-boolean-network-form (hash 'a '(and a b)
|
(make-boolean-network-form (hash 'a '(and a b)
|
||||||
'b '(not b)))))
|
'b '(not b)))))
|
||||||
|
|
||||||
|
;;; Build a Boolean network from a given mapping assigning forms
|
||||||
|
;;; to variables.
|
||||||
|
(define forms->boolean-network
|
||||||
|
(compose network-form->network 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
|
;;; Inferring interaction graphs
|
||||||
|
|
Loading…
Reference in a new issue