fizzbee-io / fizzbee

Easiest-ever formal methods language! Designed for developers crafting distributed systems, microservices, and cloud applications
https://fizzbee.io
Apache License 2.0
150 stars 8 forks source link

Implement simulation mode #90

Closed jp-fizzbee closed 1 month ago

jp-fizzbee commented 1 month ago

Implements simulation mode. Adds flag --simulation and an optional seed with --seed numeric to reproduce the failure case.

To run without liveness check, the cases are explored randomly until the path reaches the max_actions (default=100) and at each step checks for the safety constraints, without maintaining visited nodes or cycle detection..

With liveness enabled (that is at least one liveness assertion), the paths would be explored randomly until a max length (0, max_actions), without maintaining visited nodes or cycle detection. Once this random path length is reached, only fair actions will be scheduled going forward, and starts maintaining visited nodes to enable cycle detection. If no fair action could be enabled, it will be considered stuttering. If a cycle is found, it will check for always eventually and eventually always property in the cycle.

Note: If the cycle is detected, we do not check if the cycle match the fairness criteria. So this could lead to false positives with error.