networks: state/tbf → tbf/state.

This commit is contained in:
Sergiu Ivanov 2020-07-23 00:11:14 +02:00
parent c27b9fe28b
commit a4be7922d4

View File

@ -15,7 +15,7 @@
(provide
;; Structures
(struct-out dynamics)
(contract-out [struct state/tbf ([weights (hash/c variable? number?)]
(contract-out [struct tbf/state ([weights (hash/c variable? number?)]
[threshold number?])])
;; Functions
(contract-out [update (-> network? state? (set/c variable? #:kind 'dont-care) state?)]
@ -79,8 +79,8 @@
[random-network (domain-mapping/c . -> . network?)]
[random-boolean-network ((listof variable?) . -> . network?)]
[random-boolean-network/vars (number? . -> . network?)]
[state/tbf-w (-> state/tbf? (hash/c variable? number?))]
[state/tbf(-> state/tbf? number?)]
[tbf/state-w (-> tbf/state? (hash/c variable? number?))]
[tbf/state-θ (-> tbf/state? number?)]
[apply-tbf-to-state (-> tbf? state? (or/c 0 1))])
;; Predicates
(contract-out [variable? (-> any/c boolean?)]
@ -944,11 +944,11 @@
;;; 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))
(struct tbf/state (weights threshold))
;;; Shortcuts for acessing fields of a state/tbf.
(define state/tbf-w state/tbf-weights)
(define state/tbfstate/tbf-threshold)
(define tbf/state-w tbf/state-weights)
(define tbf/state-θ tbf/state-threshold)
;;; A TBN is a network form mapping TBFs to variables.
(define tbn? (hash/c variable? tbf?))