networks: Move booleanize-state before its own test case.
This commit is contained in:
parent
a654ac5896
commit
6560dcbe6c
1 changed files with 4 additions and 4 deletions
|
@ -216,6 +216,10 @@
|
||||||
[(cons var 0) (cons var #f)]
|
[(cons var 0) (cons var #f)]
|
||||||
[(cons var 1) (cons var #t)]))))
|
[(cons var 1) (cons var #t)]))))
|
||||||
|
|
||||||
|
;;; Booleanizes a given state: replaces 0 with #f and 1 with #t.
|
||||||
|
(define (booleanize-state s)
|
||||||
|
(for/hash ([(x val) s]) (match val [0 (values x #f)] [1 (values x #t)])))
|
||||||
|
|
||||||
(module+ test
|
(module+ test
|
||||||
(test-case "make-state, make-state-booleanize, booleanize-state"
|
(test-case "make-state, make-state-booleanize, booleanize-state"
|
||||||
(check-equal? (make-state-booleanize '((a . 0) (b . 1)))
|
(check-equal? (make-state-booleanize '((a . 0) (b . 1)))
|
||||||
|
@ -223,10 +227,6 @@
|
||||||
(check-equal? (booleanize-state (make-state '((a . 0) (b . 1))))
|
(check-equal? (booleanize-state (make-state '((a . 0) (b . 1))))
|
||||||
(make-state '((a . #f) (b . #t))))))
|
(make-state '((a . #f) (b . #t))))))
|
||||||
|
|
||||||
;;; Booleanizes a given state: replaces 0 with #f and 1 with #t.
|
|
||||||
(define (booleanize-state s)
|
|
||||||
(for/hash ([(x val) s]) (match val [0 (values x #f)] [1 (values x #t)])))
|
|
||||||
|
|
||||||
|
|
||||||
;;; =================================
|
;;; =================================
|
||||||
;;; Syntactic description of networks
|
;;; Syntactic description of networks
|
||||||
|
|
Loading…
Reference in a new issue