diff --git a/dynamics.rkt b/dynamics.rkt index f897137..877f6b5 100644 --- a/dynamics.rkt +++ b/dynamics.rkt @@ -17,7 +17,11 @@ (define/abstract/error (step/annotated st)) (: step* (-> (Listof State) (Listof State))) - (define/abstract/error (step* sts)) + (define/public (step* sts) + (remove-duplicates + (apply append + (for/list : (Listof (Listof State)) ([s sts]) + (step s))))) (: build-state-graph (-> (Listof State) Graph)) (define/abstract/error (build-state-graph sts)) diff --git a/networks.rkt b/networks.rkt index 6a92b0c..13fdc80 100644 --- a/networks.rkt +++ b/networks.rkt @@ -537,7 +537,8 @@ [asyn : Mode '((x) (y) (z))] [dyn-syn (new (inst dynamics% Boolean) [network n1] [mode syn])] [dyn-asyn (new (inst dynamics% Boolean) [network n1] [mode asyn])] - [s1 (hash 'x #f 'y #f 'z #f)]) + [s1 (hash 'x #f 'y #f 'z #f)] + [s2 (hash 'x #t 'y #t 'z #t)]) (test-case "dynamics%" (check-equal? (send dyn-syn step/annotated s1) '(((x y z) . #hash((x . #t) (y . #f) (z . #f))))) @@ -553,6 +554,13 @@ '(#hash((x . #t) (y . #f) (z . #f)) #hash((x . #f) (y . #f) (z . #f)) #hash((x . #f) (y . #f) (z . #f))))) + (test-case "dynamics%:step*" + (check-equal? (list->set (send dyn-syn step* (list s1 s2))) + (list->set (append (send dyn-syn step s1) + (send dyn-syn step s2)))) + (check-equal? (list->set (send dyn-asyn step* (list s1 s2))) + (list->set (append (send dyn-asyn step s1) + (send dyn-asyn step s2))))) ) ) )