networks: Fix signed interaction graphs.

This commit is contained in:
Sergiu Ivanov 2020-11-22 21:26:26 +01:00
parent 3e35b8e0ab
commit 27bb25c201

View File

@ -336,13 +336,13 @@
;;; function form for x.
(define (list-syntactic-interactions nf x)
(set-intersect
(extract-symbols (hash-ref nf x))
(extract-symbols (hash-ref (network-form-forms nf) x))
(hash-keys nf)))
(module+ test
(test-case "list-syntactic-interactions"
(define n #hash((a . (+ a b c))
(b . (- b c))))
(define n (make-boolean-network-form #hash((a . (+ a b c))
(b . (- b c)))))
(check-true (set=? (list-syntactic-interactions n 'a) '(a b)))
(check-true (set=? (list-syntactic-interactions n 'b) '(b)))))
@ -366,8 +366,8 @@
(module+ test
(test-case "build-syntactic-interaction-graph"
(define n #hash((a . (+ a b c))
(b . (- b c))))
(define n (make-boolean-network-form #hash((a . (+ a b c))
(b . (- b c)))))
(define ig (build-syntactic-interaction-graph n))
(check-true (has-vertex? ig 'a))
(check-true (has-vertex? ig 'b))