Skip to content

Commit

Permalink
Initial state
Browse files Browse the repository at this point in the history
  • Loading branch information
achamayou committed Dec 19, 2023
1 parent d9a0bd3 commit bffd4fc
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tla/trace2scen.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,10 @@ def step_to_action(pre_state, action, post_state):

if __name__ == "__main__":
with open(sys.argv[1]) as trace:
for step in json.load(trace)["action"]:
steps = json.load(trace)["action"]
initial_state = steps[0][0][1]
initial_node, = [node for node, log in initial_state["log"].items() if log]
print(f"start_node,{initial_node}")
print(f"emit_signature,2")
for step in steps:
print(step_to_action(*step))

0 comments on commit bffd4fc

Please sign in to comment.