networks: Move apply-tbf-to-state to the top of the section.

This commit is contained in:
Sergiu Ivanov 2020-07-23 00:06:26 +02:00
parent 3fa5b7ca89
commit c27b9fe28b

View file

@ -929,17 +929,6 @@
;;; TBF/TBN and SBF/SBN
;;; ===================
;;; A state TBF is a TBF with named inputs. A state TBF can be
;;; applied to states in an unambiguous ways.
(struct state/tbf (weights threshold))
;;; Shortcuts for acessing fields of a state/tbf.
(define state/tbf-w state/tbf-weights)
(define state/tbf-θ state/tbf-threshold)
;;; A TBN is a network form mapping TBFs to variables.
(define tbn? (hash/c variable? tbf?))
;;; Applies a TBF to a state.
;;;
;;; The values of the variables of the state are ordered by hash-map
@ -952,3 +941,14 @@
(define st (make-state '((x1 . 0) (x2 . 1))))
(define f (tbf #(1 1) 1))
(check-equal? (apply-tbf-to-state f st) 0))
;;; A state TBF is a TBF with named inputs. A state TBF can be
;;; applied to states in an unambiguous ways.
(struct state/tbf (weights threshold))
;;; Shortcuts for acessing fields of a state/tbf.
(define state/tbf-w state/tbf-weights)
(define state/tbf-θ state/tbf-threshold)
;;; A TBN is a network form mapping TBFs to variables.
(define tbn? (hash/c variable? tbf?))