example: Add some text about SBFs.

This commit is contained in:
Sergiu Ivanov 2020-07-15 00:01:43 +02:00
parent 17ffa3eb81
commit e0329e2519

View file

@ -766,6 +766,33 @@ tab
inputs. The third column gives the values of the first TBF, and inputs. The third column gives the values of the first TBF, and
the fourth column gives the values of the second TBF. the fourth column gives the values of the second TBF.
=dds= also provides a couple shortcuts to deal with SBF—sign
Boolean functions. SBF are TBF with threshold equal to 0:
#+BEGIN_SRC racket :results output drawer
(sbf? (tbf #(1 1) 1))
(sbf? (tbf #(1 1) 0))
#+END_SRC
#+RESULTS:
:RESULTS:
#f
#t
:END:
You can read SBFs from Org tables, like TBFs:
#+NAME: some-sbfs
| 1 | -1 |
| 2 | 2 |
#+BEGIN_SRC racket :results output drawer :var some-sbfs=munch-sexp(some-sbfs)
(read-org-sbfs some-sbfs)
#+END_SRC
#+RESULTS:
:RESULTS:
(list (tbf '#(1 -1) 0) (tbf '#(2 2) 0))
:END:
* Reaction systems * Reaction systems
:PROPERTIES: :PROPERTIES:
:header-args:racket: :prologue "#lang racket\n(require graph dds/rs dds/utils)" :header-args:racket: :prologue "#lang racket\n(require graph dds/rs dds/utils)"