networks: Add forms->boolean-network.

This commit is contained in:
Sergiu Ivanov 2020-11-22 21:21:31 +01:00
parent a4979d9c9f
commit ec3c74b5e2

View File

@ -32,6 +32,7 @@
[update-function-form->update-function (-> update-function-form? update-function/c)]
[network-form->network (-> network-form? network?)]
[make-boolean-network-form (-> variable-mapping? network-form?)]
[forms->boolean-network (-> variable-mapping? network?)]
[list-syntactic-interactions (-> network-form? variable? (listof variable?))]
[build-syntactic-interaction-graph (-> network-form? graph?)]
[interaction? (-> network? variable? variable? boolean?)]
@ -299,6 +300,18 @@
(make-boolean-network-form (hash 'a '(and a 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