From ab56b64d381a53d303aad30e344e1053de35b280 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Mon, 22 May 2023 15:55:36 +0200 Subject: [PATCH] Add the type TBN. --- scribblings/tbn.scrbl | 9 +++++++++ tbn.rkt | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/scribblings/tbn.scrbl b/scribblings/tbn.scrbl index a6654ff..6d96ac1 100644 --- a/scribblings/tbn.scrbl +++ b/scribblings/tbn.scrbl @@ -277,6 +277,15 @@ Like @racket[tabulate-tbfs/state] and (tabulate-tbf/state+headers (tbf/state (hash 'a 1 'b 2) 2)) ]} +@section{TBNs and SBNs} + +@deftype[TBN]{ + +The type of a TBN, i.e. a mapping assigning to each variable +a @racket[TBF/State]. + +} + @section{Miscellaneous utilities} @defproc[(group-truth-table-by-nai [tt (Listof (Listof Integer))]) diff --git a/tbn.rkt b/tbn.rkt index 286b69b..0ba0288 100644 --- a/tbn.rkt +++ b/tbn.rkt @@ -34,6 +34,8 @@ tabulate-tbf/state tabulate-tbf/state+headers group-truth-table-by-nai + + TBN ) (: apply-tbf-to-state (-> TBF (State (U Zero One)) (U Zero One))) @@ -317,6 +319,8 @@ ((0 0 1 1) (0 1 0 0) (1 0 0 0)) ((0 1 1 1) (1 0 1 0) (1 1 0 1)) ((1 1 1 0)))))) + + (define-type TBN (HashTable Variable TBF/State)) ) (module+ test