Update the definition of Dynamics%.

define-type doesn't seem to work with Instance any more in Racket 8.7,
so predefining the type synonym DynamicsClass does not help Dynamics%
shorter.  Defining DynamicsClass as a macros doesn't work either.
This commit is contained in:
Sergiu Ivanov 2023-02-03 12:50:08 +01:00
parent 53e4981845
commit 16626c70ec
1 changed files with 13 additions and 14 deletions

View File

@ -543,20 +543,19 @@
;;
;; NOTE: The type appearing when you type dynamics% in the REPL does
;; not directly type check.
(define-type (DynamicsClass a)
(Class
(init (network (Network a) #:optional)
(mode Mode #:optional))
(field (network (Network a))
(mode Mode))
(step (-> (State Any) (Listof (State Any))))
(step/annotated (-> (State a) (Listof (Pairof Modality (State a)))))
(step* (-> (Listof (State Any)) (Listof (State Any))))
(build-state-graph (-> (Listof (State Any)) Graph))
(build-state-graph/annotated (-> (Listof (State Any)) Graph))
(build-state-graph* (-> (Listof (State Any)) (U Positive-Integer 'full) Graph))
(build-state-graph*/annotated (-> (Listof (State Any)) (U Positive-Integer 'full) Graph))))
(define-type (Dynamics% a) (Instance (DynamicsClass a)))
(define-type (Dynamics% a)
(Instance (Class
(init (network (Network a) #:optional)
(mode Mode #:optional))
(field (network (Network a))
(mode Mode))
(step (-> (State Any) (Listof (State Any))))
(step/annotated (-> (State a) (Listof (Pairof Modality (State a)))))
(step* (-> (Listof (State Any)) (Listof (State Any))))
(build-state-graph (-> (Listof (State Any)) Graph))
(build-state-graph/annotated (-> (Listof (State Any)) Graph))
(build-state-graph* (-> (Listof (State Any)) (U Positive-Integer 'full) Graph))
(build-state-graph*/annotated (-> (Listof (State Any)) (U Positive-Integer 'full) Graph)))))
(module+ test
(let* ([n1 : (Network Boolean)