example: Update the section on Boolean networks.

This commit is contained in:
Sergiu Ivanov 2020-11-26 23:20:44 +01:00
parent 8f9740d2d7
commit dae4f6570f

View file

@ -436,7 +436,12 @@ tab
Here's the unsigned syntactic interaction graph of this network:
#+NAME: simple-bn-syig
#+BEGIN_SRC racket :results silent :var simple-bn=munch-sexp(simple-bn)
(dotit (build-syntactic-interaction-graph (unorgv simple-bn)))
((compose
dotit
build-syntactic-interaction-graph
make-boolean-network-form
unorgv)
simple-bn)
#+END_SRC
#+BEGIN_SRC dot :file dots/examplejTo8XT.svg :results raw drawer :cmd sfdp :noweb yes
@ -461,7 +466,12 @@ tab
time constructed according to the canonical definition:
#+NAME: simple-bn-ig
#+BEGIN_SRC racket :results silent :var simple-bn=munch-sexp(simple-bn)
(dotit (build-interaction-graph/form (unorgv simple-bn) (make-boolean-domains '(a b c))))
((compose
dotit
build-interaction-graph/form
make-boolean-network-form
unorgv)
simple-bn)
#+END_SRC
#+BEGIN_SRC dot :file dots/example1FH1rZ.svg :results raw drawer :cmd sfdp :noweb yes
@ -486,7 +496,12 @@ tab
#+NAME: simple-bn-sig
#+BEGIN_SRC racket :results silent :var simple-bn=munch-sexp(simple-bn)
(dotit (build-signed-interaction-graph/form (unorgv simple-bn) (make-boolean-domains '(a b c))))
((compose
dotit
build-signed-interaction-graph/form
make-boolean-network-form
unorgv)
simple-bn)
#+END_SRC
#+BEGIN_SRC dot :file dots/exampledpQygl.svg :results raw drawer :cmd sfdp :noweb yes
@ -502,28 +517,37 @@ tab
dynamics:
#+NAME: simple-bn-sg
#+BEGIN_SRC racket :results silent :var simple-bn=munch-sexp(simple-bn)
(let* ([bn (network-form->network (unorgv simple-bn))]
[bn-asyn (make-asyn-dynamics bn)])
(dotit (pretty-print-state-graph (build-full-boolean-state-graph bn-asyn))))
((compose
dotit
pretty-print-state-graph
build-full-state-graph
make-asyn-dynamics
forms->boolean-network
unorgv)
simple-bn)
#+END_SRC
#+BEGIN_SRC dot :file dots/examplem7LpTs.svg :results raw drawer :cmd sfdp :noweb yes
<<simple-bn-sg()>>
#+END_SRC
#+RESULTS:
:RESULTS:
:results:
[[file:dots/examplem7LpTs.svg]]
:END:
:end:
Alternatively, you may prefer a slighty more compact representation
of Boolean values as 0 and 1:
#+NAME: simple-bn-sg-bool
#+BEGIN_SRC racket :results silent :var simple-bn=munch-sexp(simple-bn)
(let* ([bn (network-form->network (unorgv simple-bn))]
[bn-asyn (make-asyn-dynamics bn)])
(dotit (pretty-print-boolean-state-graph (build-full-boolean-state-graph bn-asyn))))
((compose
dotit
pretty-print-boolean-state-graph
build-full-state-graph
make-asyn-dynamics
forms->boolean-network
unorgv)
simple-bn)
#+END_SRC
#+BEGIN_SRC dot :file dots/examplex1Irnk.svg :results raw drawer :cmd sfdp :noweb yes
@ -531,9 +555,9 @@ tab
#+END_SRC
#+RESULTS:
:RESULTS:
:results:
[[file:dots/examplex1Irnk.svg]]
:END:
:end:
Consider the following state (appearing in the upper left corner of
the state graph):
@ -549,7 +573,7 @@ tab
#+HEADER: :var simple-bn=munch-sexp(simple-bn)
#+HEADER: :var some-state=munch-sexp(some-state)
#+BEGIN_SRC racket :results silent
(let* ([bn (network-form->network (unorgv simple-bn))]
(let* ([bn (forms->boolean-network (unorgv simple-bn))]
[bn-asyn (make-asyn-dynamics bn)]
[s0 (booleanize-state (unorgv some-state))])
(dotit (pretty-print-boolean-state-graph (dds-build-n-step-state-graph bn-asyn (set s0) 2))))
@ -560,17 +584,22 @@ tab
#+END_SRC
#+RESULTS:
:RESULTS:
:results:
[[file:dots/examplecHA6gL.svg]]
:END:
:end:
Here is the complete state graph with edges annotated with the
modality leading to the update.
#+NAME: simple-bn-sg-bool-ann
#+BEGIN_SRC racket :results silent :var simple-bn=munch-sexp(simple-bn)
(let* ([bn (network-form->network (unorgv simple-bn))]
[bn-asyn (make-asyn-dynamics bn)])
(dotit (pretty-print-boolean-state-graph (build-full-boolean-state-graph-annotated bn-asyn))))
((compose
dotit
pretty-print-boolean-state-graph
build-full-state-graph-annotated
make-asyn-dynamics
forms->boolean-network
unorgv)
simple-bn)
#+END_SRC
#+BEGIN_SRC dot :file dots/examplei4we6j.svg :results raw drawer :cmd sfdp :noweb yes
@ -590,9 +619,14 @@ tab
#+NAME: bn2-sgr
#+BEGIN_SRC racket :results silent :var input-bn=munch-sexp(bn2)
(let* ([bn (network-form->network (unorgv input-bn))]
[bn-asyn (make-asyn-dynamics bn)])
(dotit (pretty-print-boolean-state-graph (build-full-boolean-state-graph-annotated bn-asyn))))
((compose
dotit
pretty-print-boolean-state-graph
build-full-state-graph-annotated
make-asyn-dynamics
forms->boolean-network
unorgv)
input-bn)
#+END_SRC
#+BEGIN_SRC dot :file dots/examplehsuRqc.svg :results raw drawer :cmd dot :noweb yes