From a967dc4b7487a0ee51b7dbacfbf3e5ebcc2515fa Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Sat, 15 Feb 2020 21:01:28 +0100 Subject: [PATCH] bn: new-state -> make-state --- bn-tests.rkt | 4 ++-- bn.rkt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bn-tests.rkt b/bn-tests.rkt index b839e87..0238c49 100644 --- a/bn-tests.rkt +++ b/bn-tests.rkt @@ -19,14 +19,14 @@ [bn (make-bn `((x1 . ,f1) (x2 . ,f2)))]) (test-case "One-step syncronous update" - (let* ([s (new-state '((x1 . #t) (x2 . #f)))] + (let* ([s (make-state '((x1 . #t) (x2 . #f)))] [new-s (update bn s '(x2 x1))]) (check-equal? (hash-ref new-s 'x1) #t) (check-equal? (hash-ref new-s 'x2) #t) (check-equal? (length (hash-keys new-s)) 2))) (test-case "One-step asynchronous update" - (let* ([s (new-state '((x1 . #f) (x2 . #f)))] + (let* ([s (make-state '((x1 . #f) (x2 . #f)))] [new-s (update bn s '(x2 x1))]) (check-equal? (hash-ref new-s 'x1) #f) (check-equal? (hash-ref new-s 'x2) #t) diff --git a/bn.rkt b/bn.rkt index 2112596..df807cc 100644 --- a/bn.rkt +++ b/bn.rkt @@ -8,7 +8,7 @@ ;;; The variables to be updated at each step are given by the mode. (provide Variable State UpdateFunc Network - update new-state make-bn) + update make-state make-bn) (define-type Variable Symbol) @@ -36,7 +36,7 @@ new-s)) ;;; A version of make-hash restricted to creating Boolean states. -(define (new-state [mappings : (Listof (Pairof Variable Boolean))]) +(define (make-state [mappings : (Listof (Pairof Variable Boolean))]) (make-hash mappings)) ;;; A version of make-hash restricted to creating Boolean networks.