diff --git a/networks.rkt b/networks.rkt index d22bcb6..4ce3eab 100644 --- a/networks.rkt +++ b/networks.rkt @@ -404,14 +404,15 @@ ;;; state f(s') in which the value for y is different from f(s). (define (interaction? network doms x y) (define states-not-x (build-all-states (hash-remove doms x))) + (define dom-x (hash-ref doms x)) + (define y-func (hash-ref network y)) (define (different-ys-exist? st) - (define x-states (for/list ([x-val (in-list (hash-ref doms x))]) + (define x-states (for/list ([x-val (in-list dom-x)]) (hash-set st x x-val))) (for*/first ([st1 x-states] [st2 x-states] #:unless (equal? (hash-ref st1 x) (hash-ref st2 x)) - #:unless (equal? ((hash-ref network y) st1) - ((hash-ref network y) st2))) + #:unless (equal? (y-func st1) (y-func st2))) #t)) (for*/first ([st (in-list states-not-x)] #:when (different-ys-exist? st))