From e44d9c774840d8a3e8e40e8122d068a526b41c9d Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Thu, 21 Apr 2022 11:50:56 +0200 Subject: [PATCH] =?UTF-8?q?Type=20tbf-w=20and=20tbf-=CE=B8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- functions.rkt | 8 +++----- scribblings/functions.scrbl | 7 +++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/functions.rkt b/functions.rkt index fdf827c..0362f92 100644 --- a/functions.rkt +++ b/functions.rkt @@ -27,7 +27,7 @@ enumerate-boolean-functions/pv enumerate-boolean-functions/list random-boolean-table random-boolean-function random-boolean-function/list - (struct-out tbf)) + (struct-out tbf) tbf-w tbf-θ) (module+ test (require typed/rackunit)) @@ -357,6 +357,8 @@ (check-true (random-bool-f/list '(#t #t))))) (struct tbf ([weights : (Vectorof Real)] [threshold : Real]) #:transparent) + (define tbf-w tbf-weights) + (define tbf-θ tbf-threshold) (module untyped racket (module+ test @@ -479,10 +481,6 @@ ;;; Threshold Boolean functions ;;; =========================== -;;; Unicode shortcuts for accessing the elements of a TBF. -(define tbf-w tbf-weights) -(define tbf-θ tbf-threshold) - ;;; Converts a Boolean vector to a 0-1 vector. (define (vector-boolean->01 bool-v) (vector-map any->01 bool-v)) diff --git a/scribblings/functions.scrbl b/scribblings/functions.scrbl index 655e6b7..9c0b4b8 100644 --- a/scribblings/functions.scrbl +++ b/scribblings/functions.scrbl @@ -376,6 +376,13 @@ a vector of weights and @tt{θ} is the threshold. } +@deftogether[(@defproc[(tbf-w [t tbf]) (Vectorof Real)] + @defproc[(tbf-θ [t tbf]) Real])]{ + +Shortcuts for @racket[tbf-weights] and @racket[tbf-threshold]. + +} + @section[#:tag "fuctions/untyped"]{Untyped definitions} @defmodule[(submod dds/functions typed untyped)]