Type build-all-01-states.
This commit is contained in:
parent
d64b04a8f0
commit
1bfc44491e
2 changed files with 22 additions and 15 deletions
28
networks.rkt
28
networks.rkt
|
@ -23,7 +23,7 @@
|
||||||
network-form->network/01 make-boolean-network-form
|
network-form->network/01 make-boolean-network-form
|
||||||
forms->boolean-network
|
forms->boolean-network
|
||||||
|
|
||||||
build-all-states build-all-boolean-states
|
build-all-states build-all-boolean-states build-all-01-states
|
||||||
|
|
||||||
list-syntactic-interactions build-syntactic-interaction-graph
|
list-syntactic-interactions build-syntactic-interaction-graph
|
||||||
)
|
)
|
||||||
|
@ -275,6 +275,18 @@
|
||||||
#hash((a . #t) (b . #f))
|
#hash((a . #t) (b . #f))
|
||||||
#hash((a . #t) (b . #t))))))
|
#hash((a . #t) (b . #t))))))
|
||||||
|
|
||||||
|
(: build-all-01-states (-> (Listof Variable) (Listof (State (U Zero One)))))
|
||||||
|
(define (build-all-01-states vars)
|
||||||
|
(build-all-states (make-01-domains vars)))
|
||||||
|
|
||||||
|
(module+ test
|
||||||
|
(test-case "build-all-01-states"
|
||||||
|
(check-equal? (build-all-01-states '(a b))
|
||||||
|
'(#hash((a . 0) (b . 0))
|
||||||
|
#hash((a . 0) (b . 1))
|
||||||
|
#hash((a . 1) (b . 0))
|
||||||
|
#hash((a . 1) (b . 1))))))
|
||||||
|
|
||||||
(: list-syntactic-interactions
|
(: list-syntactic-interactions
|
||||||
(All (a) (-> (NetworkForm a) Variable (Listof Variable))))
|
(All (a) (-> (NetworkForm a) Variable (Listof Variable))))
|
||||||
(define (list-syntactic-interactions nf x)
|
(define (list-syntactic-interactions nf x)
|
||||||
|
@ -331,7 +343,6 @@
|
||||||
[build-interaction-graph/form (-> network-form? graph?)]
|
[build-interaction-graph/form (-> network-form? graph?)]
|
||||||
[build-signed-interaction-graph (-> network? graph?)]
|
[build-signed-interaction-graph (-> network? graph?)]
|
||||||
[build-signed-interaction-graph/form (-> network-form? graph?)]
|
[build-signed-interaction-graph/form (-> network-form? graph?)]
|
||||||
[build-all-01-states (-> (listof variable?) (listof state?))]
|
|
||||||
[make-asyn (-> (listof variable?) mode?)]
|
[make-asyn (-> (listof variable?) mode?)]
|
||||||
[make-syn (-> (listof variable?) mode?)]
|
[make-syn (-> (listof variable?) mode?)]
|
||||||
[make-dynamics-from-func (-> network? (-> (listof variable?) mode?) dynamics?)]
|
[make-dynamics-from-func (-> network? (-> (listof variable?) mode?) dynamics?)]
|
||||||
|
@ -472,19 +483,6 @@
|
||||||
;;; Inferring interaction graphs
|
;;; Inferring interaction graphs
|
||||||
;;; ============================
|
;;; ============================
|
||||||
|
|
||||||
;;; Builds all Boolean states over a given set of variables, but with
|
|
||||||
;;; 0 and 1 for Boolean values.
|
|
||||||
(define build-all-01-states
|
|
||||||
(compose build-all-states make-01-domains))
|
|
||||||
|
|
||||||
(module+ test
|
|
||||||
(test-case "build-all-01-states"
|
|
||||||
(check-equal? (build-all-01-states '(a b))
|
|
||||||
'(#hash((a . 0) (b . 0))
|
|
||||||
#hash((a . 0) (b . 1))
|
|
||||||
#hash((a . 1) (b . 0))
|
|
||||||
#hash((a . 1) (b . 1))))))
|
|
||||||
|
|
||||||
;;; Given two variables x and y of a network f, verifies if they
|
;;; Given two variables x and y of a network f, verifies if they
|
||||||
;;; interact, i.e. that there exists such a state s with the property
|
;;; interact, i.e. that there exists such a state s with the property
|
||||||
;;; that s' which is s with a different value for x yields such a new
|
;;; that s' which is s with a different value for x yields such a new
|
||||||
|
|
|
@ -353,6 +353,15 @@ Builds all Boolean states over a given list of variables.
|
||||||
(build-all-boolean-states '(a b))
|
(build-all-boolean-states '(a b))
|
||||||
]}
|
]}
|
||||||
|
|
||||||
|
@defproc[(build-all-01-states [vars (Listof Variable)])
|
||||||
|
(Listof (State Boolean))]{
|
||||||
|
|
||||||
|
Builds all Boolean states over a given set of variables, but with the Boolean
|
||||||
|
values represented as 0 and 1.
|
||||||
|
|
||||||
|
@ex[
|
||||||
|
(build-all-01-states '(a b))
|
||||||
|
]}
|
||||||
@section{Inferring interaction graphs}
|
@section{Inferring interaction graphs}
|
||||||
|
|
||||||
This section provides inference of both unsigned and signed interaction graphs.
|
This section provides inference of both unsigned and signed interaction graphs.
|
||||||
|
|
Loading…
Reference in a new issue