diff --git a/networks.rkt b/networks.rkt index 3328a74..931bef3 100644 --- a/networks.rkt +++ b/networks.rkt @@ -473,11 +473,11 @@ [(and (member '> impacts) (not (member '< impacts))) '>] [(equal? impacts '(=)) '=] [else 0])))) - (match interactions - [(list '<) 1] - [(list '>) -1] - [(list '=) #f] - [_ 0])) + (cond + [(and (member '< interactions) (not (member '> interactions))) 1] + [(and (member '> interactions) (not (member '< interactions))) -1] + [(equal? interactions '(=)) #f] + [else 0])) (module+ test (test-case "get-interaction-sign" @@ -491,6 +491,7 @@ (check-equal? (get-interaction-sign n-bool bool-doms 'x 'y) 1) (check-equal? (get-interaction-sign n-bool bool-doms 'y 'x) -1) (check-false (get-interaction-sign n-bool bool-doms 'x 'z)) + (check-equal? (get-interaction-sign n-bool bool-doms 'y 'z) 1) (check-equal? (get-interaction-sign n-bool bool-doms 'x 't) 0) (define n-multi (network-form->network (hash 'x '(min (+ y 1) 2)