diff --git a/networks.rkt b/networks.rkt index 82be953..9d8e78f 100644 --- a/networks.rkt +++ b/networks.rkt @@ -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