From e0329e25192b55934608b1be460996b924eedaf4 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Wed, 15 Jul 2020 00:01:43 +0200 Subject: [PATCH] example: Add some text about SBFs. --- example/example.org | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/example/example.org b/example/example.org index 71f3bed..8f78e15 100644 --- a/example/example.org +++ b/example/example.org @@ -766,6 +766,33 @@ tab inputs. The third column gives the values of the first TBF, and 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 :PROPERTIES: :header-args:racket: :prologue "#lang racket\n(require graph dds/rs dds/utils)"