diff --git a/networks.rkt b/networks.rkt index ffbb33a..c237830 100644 --- a/networks.rkt +++ b/networks.rkt @@ -25,6 +25,7 @@ [domains domain-mapping/c])]) ;; Functions (contract-out [make-boolean-network (-> (hash/c variable? procedure?) network?)] + [make-01-network (-> (hash/c variable? procedure?) network?)] [update (-> network? state? (set/c variable? #:kind 'dont-care) state?)] [make-state (-> (listof (cons/c symbol? any/c)) state?)] [make-state-booleanize (-> (listof (cons/c symbol? (or/c 0 1))) state?)] @@ -190,6 +191,11 @@ (define (make-boolean-network funcs) (network funcs (make-boolean-domains (hash-keys funcs)))) +;;; Build a network from a given hash table assigning functions to +;;; variables by attributing the domain {0,1} to every variable. +(define (make-01-network funcs) + (network funcs (make-01-domains (hash-keys funcs)))) + (module+ test (test-case "make-boolean-network" (define f1 (λ (s) (let ([x1 (hash-ref s 'x1)]