Add UpdateFunctionForm.

This commit is contained in:
Sergiu Ivanov 2022-05-02 00:16:16 +02:00
parent fc633c2e4c
commit 901720d2f5
2 changed files with 21 additions and 4 deletions

View File

@ -13,7 +13,10 @@
(struct-out network) Network
make-same-domains make-boolean-domains make-boolean-network
make-01-domains make-01-network update)
make-01-domains make-01-network update
UpdateFunctionForm
)
(define-type (State a) (VariableMapping a))
(define-type (UpdateFunction a) (-> (State a) a))
@ -113,6 +116,8 @@
#hash((x1 . #f) (x2 . #f)))
(check-equal? (update bn (hash 'x1 #f 'x2 #f) '(x1 x2))
#hash((x1 . #f) (x2 . #t)))))
(define-type UpdateFunctionForm Any)
)
(require 'typed)
@ -281,9 +286,6 @@
;;; Syntactic description of networks
;;; =================================
;;; An update function form is any form which can appear as a body of
;;; a function and which can be evaluated with eval. For example,
;;; '(and x y (not z)) or '(+ 1 a (- b 10)).
(define update-function-form? any/c)
;;; A network form consists of a mapping from variables to the forms

View File

@ -194,6 +194,21 @@ Given a state @racket[s] updates all the variables of @racket[network] from
@section{Syntactic description of networks}
@deftype[UpdateFunctionForm]{
An update function form is any form which can appear as a body of a function
and which can be evaluated with @racket[eval].
@ex[
(ann '(and x y (not z)) UpdateFunctionForm)
(ann '(+ 1 a (- b 10)) UpdateFunctionForm)
]
@racket[UpdateFunctionForm] is a synonym of @racket[Any].
}
@section{Inferring interaction graphs}
This section provides inference of both unsigned and signed interaction graphs.