stateright / stateright

A model checker for implementing distributed systems.

Home Page:https://docs.rs/stateright

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about stateright states

smoelius opened this issue · comments

In stateright, is it possible for the "environment" to have state? Or is all of the state represented in the actors?

For example, could the environment have a clock that is non-deterministically updated?

(Sorry for the naive question.)

Hi @smoelius. Thanks for your interest in the project!

Yes, this is absolutely possible. You could base such an implementation off of impl Model for ActorModel (adding the additional shared environment state to a new type analogous to ActorModelState, for which network is simply one aspect of the environment).

https://github.com/stateright/stateright/blob/master/src/actor/model.rs

https://github.com/stateright/stateright/blob/master/src/actor/model_state.rs

Please let me know if you run into any difficulties. Can you elaborate on the use case as well? I should clarify that shared global time isn't assumed, so if one actor sleeps "at least 20ms" (timer 1) and another sleeps "at least 20,000 ms" (timer 2) then the checker does validate both orderings (timer2 before timer1 and vice versa).