networks: Add make-boolean-network-form.

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

View File

@ -31,6 +31,7 @@
[booleanize-state (-> state? state?)]
[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?)]
[list-syntactic-interactions (-> network-form? variable? (listof variable?))]
[build-syntactic-interaction-graph (-> network-form? graph?)]
[interaction? (-> network? variable? variable? boolean?)]
@ -288,6 +289,16 @@
(define s (make-state '((a . #t) (b . #t))))
(check-equal? ((hash-ref (network-functions bn) 'a) s) #t)))
;;; Build a Boolean network form from a given mapping assigning forms
;;; to variables.
(define (make-boolean-network-form forms)
(network-form forms (make-boolean-domains (hash-keys forms))))
(module+ test
(test-case "make-boolean-network-form"
(make-boolean-network-form (hash 'a '(and a b)
'b '(not b)))))
;;; ============================
;;; Inferring interaction graphs