Bounded retry always terminates
Input
{
"check_livelocks": true,
"initial": {
"phase": "idle",
"tries": 0
},
"initial_states": null,
"reachability": null,
"terminal_condition": {
"op": "in",
"values": [
"acked",
"failed"
],
"var": "phase"
},
"transitions": [
{
"guard": {
"op": "eq",
"value": "idle",
"var": "phase"
},
"name": "send",
"updates": {
"phase": {
"op": "const",
"value": "sending"
}
}
},
{
"guard": {
"args": [
{
"op": "eq",
"value": "sending",
"var": "phase"
},
{
"op": "lt",
"value": 2,
"var": "tries"
}
],
"op": "and"
},
"name": "retry",
"updates": {
"tries": {
"left": {
"op": "var",
"var": "tries"
},
"op": "add",
"right": {
"op": "const",
"value": 1
}
}
}
},
{
"guard": {
"op": "eq",
"value": "sending",
"var": "phase"
},
"name": "ack",
"updates": {
"phase": {
"op": "const",
"value": "acked"
}
}
},
{
"guard": {
"args": [
{
"op": "eq",
"value": "sending",
"var": "phase"
},
{
"op": "eq",
"value": 2,
"var": "tries"
}
],
"op": "and"
},
"name": "give_up",
"updates": {
"phase": {
"op": "const",
"value": "failed"
}
}
}
],
"variables": [
{
"name": "phase",
"type": "enum",
"values": [
"idle",
"sending",
"acked",
"failed"
]
},
{
"max": 2,
"min": 0,
"name": "tries",
"type": "int"
}
]
}Output
Build-time verified. stats.elapsed_ms normalized to 0.
{
"deadlock": {
"found": false,
"trace": null
},
"domain_violations": [],
"exhaustive": true,
"invariant_violations": [],
"livelock": {
"found": false,
"loop_start": null,
"trace": null
},
"reachability": [],
"states_explored": 8,
"stats": {
"elapsed_ms": 0,
"timed_out": false
},
"status": "verified_safe",
"transitions_fired": 7,
"unreachable_transitions": [],
"verified": true
}Request
curl --fail-with-body --silent --show-error https://oracles.burgeonads.com/v1/verify/state-machine -H 'Content-Type: application/json' --data-raw '{"variables":[{"name":"phase","type":"enum","values":["idle","sending","acked","failed"]},{"name":"tries","type":"int","min":0,"max":2}],"initial":{"phase":"idle","tries":0},"initial_states":null,"transitions":[{"name":"send","guard":{"op":"eq","var":"phase","value":"idle"},"updates":{"phase":{"op":"const","value":"sending"}}},{"name":"retry","guard":{"op":"and","args":[{"op":"eq","var":"phase","value":"sending"},{"op":"lt","var":"tries","value":2}]},"updates":{"tries":{"op":"add","left":{"op":"var","var":"tries"},"right":{"op":"const","value":1}}}},{"name":"ack","guard":{"op":"eq","var":"phase","value":"sending"},"updates":{"phase":{"op":"const","value":"acked"}}},{"name":"give_up","guard":{"op":"and","args":[{"op":"eq","var":"phase","value":"sending"},{"op":"eq","var":"tries","value":2}]},"updates":{"phase":{"op":"const","value":"failed"}}}],"terminal_condition":{"op":"in","var":"phase","values":["acked","failed"]},"check_livelocks":true,"reachability":null}'