From 7710e56bb82227cee2ddef8ab4faa1bfbefbe421 Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Wed, 22 Jul 2020 23:53:20 +0200 Subject: [PATCH] =?UTF-8?q?networks:=20apply-tbf/state=20=E2=86=92=20apply?= =?UTF-8?q?-tbf-to-state?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The next commits will define tbf/state. The function to apply such a TBF would naturally be called apply-tbf/state, and it will be quite different from the apply-tbf-to-state, hence the renaming. --- networks.rkt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/networks.rkt b/networks.rkt index 4116195..e3508cc 100644 --- a/networks.rkt +++ b/networks.rkt @@ -77,7 +77,7 @@ [random-network (domain-mapping/c . -> . network?)] [random-boolean-network ((listof variable?) . -> . network?)] [random-boolean-network/vars (number? . -> . network?)] - [apply-tbf/state (-> tbf? state? (or/c 0 1))]) + [apply-tbf-to-state (-> tbf? state? (or/c 0 1))]) ;; Predicates (contract-out [variable? (-> any/c boolean?)] [state? (-> any/c boolean?)] @@ -933,10 +933,10 @@ ;;; The values of the variables of the state are ordered by hash-map ;;; and fed to the TBF in order. The number of the inputs of the TBF ;;; must match the number of variables in the state. -(define (apply-tbf/state tbf st) +(define (apply-tbf-to-state tbf st) (apply-tbf tbf (list->vector (hash-map st (λ (_ val) val))))) (module+ test (define st (make-state '((x1 . 0) (x2 . 1)))) (define f (tbf #(1 1) 1)) - (check-equal? (apply-tbf/state f st) 0)) + (check-equal? (apply-tbf-to-state f st) 0))