networks: list-interactions → list-syntactic-interactions.

This commit is contained in:
Sergiu Ivanov 2020-11-12 01:09:18 +01:00
parent 681ed0e732
commit 5ece1f6c88

View file

@ -29,7 +29,7 @@
[network-form->network (-> network-form? network?)]
[make-network-from-forms (-> (listof (cons/c symbol? update-function-form?))
network?)]
[list-interactions (-> network-form? variable? (listof variable?))]
[list-syntactic-interactions (-> network-form? variable? (listof variable?))]
[build-syntactic-interaction-graph (-> network-form? graph?)]
[build-all-states (-> domain-mapping/c (listof state?))]
[make-same-domains (-> (listof variable?) generic-set? domain-mapping/c)]
@ -294,17 +294,17 @@
;;; Lists the variables of the network form appearing in the update
;;; function form for x.
(define (list-interactions nf x)
(define (list-syntactic-interactions nf x)
(set-intersect
(extract-symbols (hash-ref nf x))
(hash-keys nf)))
(module+ test
(test-case "list-interactions"
(test-case "list-syntactic-interactions"
(define n #hash((a . (+ a b c))
(b . (- b c))))
(check-true (set=? (list-interactions n 'a) '(a b)))
(check-true (set=? (list-interactions n 'b) '(b)))))
(check-true (set=? (list-syntactic-interactions n 'a) '(a b)))
(check-true (set=? (list-syntactic-interactions n 'b) '(b)))))
;;; Builds the graph in which the vertices are the variables of a
;;; given network, and which contains an arrow from a to b whenever a
@ -322,7 +322,7 @@
(define (build-syntactic-interaction-graph n)
(transpose
(unweighted-graph/adj
(for/list ([(var _) n]) (cons var (list-interactions n var))))))
(for/list ([(var _) n]) (cons var (list-syntactic-interactions n var))))))
(module+ test
(test-case "build-syntactic-interaction-graph"