diff --git a/example/example.org b/example/example.org index 6c45115..bf21db9 100644 --- a/example/example.org +++ b/example/example.org @@ -1042,11 +1042,7 @@ tab #+NAME: tbfs-nots-sg #+BEGIN_SRC racket :results silent drawer :var tbfs-nots=munch-sexp(tbfs-nots) -(dotit ((compose pretty-print-state-graph - build-full-01-state-graph - make-syn-dynamics - tbn->network - read-org-tbn) tbfs-nots)) +(dotit (build-tbn-state-graph (read-org-tbn tbfs-nots))) #+END_SRC #+BEGIN_SRC dot :file dots/examplew206DH.svg :results raw drawer :cmd sfdp :noweb yes @@ -1069,11 +1065,7 @@ tab #+NAME: sbn-figure2-sg #+BEGIN_SRC racket :results silent drawer :var sbn-figure2=munch-sexp(sbn-figure2) -(dotit ((compose pretty-print-state-graph - build-full-01-state-graph - make-syn-dynamics - tbn->network - read-org-sbn) sbn-figure2)) +(dotit (build-tbn-state-graph (read-org-sbn sbn-figure2))) #+END_SRC #+BEGIN_SRC dot :file dots/sbn-figure2-sg.svg :results raw drawer :cmd sfdp :noweb yes @@ -1082,7 +1074,7 @@ tab #+RESULTS: :results: - [[file:dots/sbn-figure2-sg.svg]] + [[file:dots/sbn-figure2-sg.svg]] :end: * Reaction systems diff --git a/networks.rkt b/networks.rkt index b3243dd..6aea0cc 100644 --- a/networks.rkt +++ b/networks.rkt @@ -116,7 +116,8 @@ tbn?)] [read-org-sbn (->* (string?) (#:headers boolean? #:func-names boolean?) - tbn?)]) + tbn?)] + [build-tbn-state-graph (-> tbn? graph?)]) ;; Predicates (contract-out [variable? (-> any/c boolean?)] [state? (-> any/c boolean?)] @@ -1466,3 +1467,10 @@ (tbf/state '#hash((x0 . -1) (x1 . 0)) 0) 'x1 (tbf/state '#hash((x0 . 0) (x1 . -1)) 0))))) + +;;; A shortcut for building the state graphs of TBN. +(define build-tbn-state-graph + (compose pretty-print-state-graph + build-full-01-state-graph + make-syn-dynamics + tbn->network))