[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlaplus] Announcing PlusPy: Python interpreter for TLA+ specifications



While Cornell was closed down for a few weeks, I wrote a "TLA+ executor" in Python.  It handles a similar subset of specifications that are handled by the TLC model checker.  However, instead of exploring the entire state space, PlusPy just tries to find one behavior consistent with the specification.  If high performance is not a requirement, then, rather than having to manually implement a TLA+ specification, you may be able to run it directly using PlusPy.  PlusPy supports multi-threading so you may be able to run concurrent TLA+ or PlusCal algorithms with PlusPy.  You can, for example, run the Peterson algorithm with actual threads.  PlusPy also has support for distribution and messaging so you may be able to run a consensus algorithm using PlusPy.  PlusPy comes with examples of each.  Using PlusPy TLA+ modules can invoke Python code and vice versa.

If you're interested, try it out.  Clone it from https://github.com/tlaplus/PlusPy.  All you need is Python3 to run it.  Just know that it is brand-new software and likely to have lots of issues, but I would much appreciate your questions and comments.

As a small preview, here's the output of running the HourClock spec from Leslie's book:

$ ./pluspy -c10 HourClock
Initial context: [ hr |-> 6 ]
Next state: 0 [ hr |-> 7 ]
Next state: 1 [ hr |-> 8 ]
Next state: 2 [ hr |-> 9 ]
Next state: 3 [ hr |-> 10 ]
Next state: 4 [ hr |-> 11 ]
Next state: 5 [ hr |-> 12 ]
Next state: 6 [ hr |-> 1 ]
Next state: 7 [ hr |-> 2 ]
Next state: 8 [ hr |-> 3 ]
Next state: 9 [ hr |-> 4 ]
$

--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+unsubscribe@xxxxxxxxxxxxxxxx.
To view this discussion on the web visit https://groups.google.com/d/msgid/tlaplus/137d1356-802d-48c1-8edd-836ca5e9b5e3%40googlegroups.com.