From fc633c2e4c57c2db8a6d7d944bc2c9ae738c6558 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Sun, 1 May 2022 01:07:33 +0200 Subject: [PATCH] Move make-same-domains, make-boolean-domains, and make-01-domains to Utilities. --- scribblings/networks.scrbl | 58 +++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/scribblings/networks.scrbl b/scribblings/networks.scrbl index ceaa80a..6d89386 100644 --- a/scribblings/networks.scrbl +++ b/scribblings/networks.scrbl @@ -108,6 +108,35 @@ Converts the values 0 and 1 in a state to @racket[#f] and (01->boolean/state (hash 'a 0 'b 1)) ]} +@defproc[(make-same-domains [vars (Listof Variable)] + [domain (Domain a)]) + (DomainMapping a)]{ + +Makes a hash set mapping all variables to a single domain. + +@ex[ +(make-same-domains '(a b) '(1 2)) +]} + +@defproc[(make-boolean-domains [vars (Listof Variable)]) + (DomainMapping Boolean)]{ + +Makes a hash set mapping all variables to the Boolean domain. + +@ex[ +(make-boolean-domains '(a b)) +]} + +@defproc[(make-01-domains [vars (Listof Variable)]) + (DomainMapping (U Zero One))]{ + +Makes a hash set mapping all variables to the Boolean domain, expressed as +@tt{{0,1}}. + +@ex[ +(make-01-domains '(a b)) +]} + @section{Networks} @defstruct*[network ([functions (VariableMapping (UpdateFunction a))] @@ -131,25 +160,6 @@ The type of the instances of @racket[Network]. 'b '(#f #t))) ]} -@defproc[(make-same-domains [vars (Listof Variable)] - [domain (Domain a)]) - (DomainMapping a)]{ - -Makes a hash set mapping all variables to a single domain. - -@ex[ -(make-same-domains '(a b) '(1 2)) -]} - -@defproc[(make-boolean-domains [vars (Listof Variable)]) - (DomainMapping Boolean)]{ - -Makes a hash set mapping all variables to the Boolean domain. - -@ex[ -(make-boolean-domains '(a b)) -]} - @defproc[(make-boolean-network [funcs (VariableMapping (UpdateFunction Boolean))]) (Network Boolean)]{ @@ -160,16 +170,6 @@ variables by attributing Boolean domains to every variable. (make-boolean-network (hash 'a or-func 'b and-func)) ]} -@defproc[(make-01-domains [vars (Listof Variable)]) - (DomainMapping (U Zero One))]{ - -Makes a hash set mapping all variables to the Boolean domain, expressed as -@tt{{0,1}}. - -@ex[ -(make-01-domains '(a b)) -]} - @defproc[(make-01-network [funcs (VariableMapping (UpdateFunction (U Zero One)))]) (Network (U Zero One))]{