networks: Fix signed interaction graphs.
This commit is contained in:
parent
3e35b8e0ab
commit
27bb25c201
1 changed files with 5 additions and 5 deletions
10
networks.rkt
10
networks.rkt
|
@ -336,13 +336,13 @@
|
||||||
;;; function form for x.
|
;;; function form for x.
|
||||||
(define (list-syntactic-interactions nf x)
|
(define (list-syntactic-interactions nf x)
|
||||||
(set-intersect
|
(set-intersect
|
||||||
(extract-symbols (hash-ref nf x))
|
(extract-symbols (hash-ref (network-form-forms nf) x))
|
||||||
(hash-keys nf)))
|
(hash-keys nf)))
|
||||||
|
|
||||||
(module+ test
|
(module+ test
|
||||||
(test-case "list-syntactic-interactions"
|
(test-case "list-syntactic-interactions"
|
||||||
(define n #hash((a . (+ a b c))
|
(define n (make-boolean-network-form #hash((a . (+ a b c))
|
||||||
(b . (- b c))))
|
(b . (- b c)))))
|
||||||
(check-true (set=? (list-syntactic-interactions n 'a) '(a b)))
|
(check-true (set=? (list-syntactic-interactions n 'a) '(a b)))
|
||||||
(check-true (set=? (list-syntactic-interactions n 'b) '(b)))))
|
(check-true (set=? (list-syntactic-interactions n 'b) '(b)))))
|
||||||
|
|
||||||
|
@ -366,8 +366,8 @@
|
||||||
|
|
||||||
(module+ test
|
(module+ test
|
||||||
(test-case "build-syntactic-interaction-graph"
|
(test-case "build-syntactic-interaction-graph"
|
||||||
(define n #hash((a . (+ a b c))
|
(define n (make-boolean-network-form #hash((a . (+ a b c))
|
||||||
(b . (- b c))))
|
(b . (- b c)))))
|
||||||
(define ig (build-syntactic-interaction-graph n))
|
(define ig (build-syntactic-interaction-graph n))
|
||||||
(check-true (has-vertex? ig 'a))
|
(check-true (has-vertex? ig 'a))
|
||||||
(check-true (has-vertex? ig 'b))
|
(check-true (has-vertex? ig 'b))
|
||||||
|
|
Loading…
Reference in a new issue