ChorEr is a static analyzer to generate Choreography Automata from Erlang source code.
The project requires erlang
and rebar3
to run.
Use rebar3
to run the program from the command line or to compile it.
# rebar3 escriptize
# ./_build/default/bin/chorer ./path/to/your/program.erl main/0 path/to/folder
or
# rebar3 shell
1> chorer:generate("./examples/ticktack/tictacstop.erl", "start/0").
finished
The tool will create a DOT file for each actor's local view and a DOT file for the global view in the specified folder. To visualize the Choreography Automatas copy and paste the .dot
files' content in a DOT viewer.
The documentation of the project is aviable at this link. You can also generete it with
# rebar3 ex_doc --output docs
Try out the tool using the ./test.py
script.
Expression | Support |
---|---|
atom | ✅ yes |
integer | ✅ yes |
float | ✅ yes |
boolean | ✅ yes |
tuple | ✅ yes |
list | 🟡 partial |
string | 🟡 partial |
record | ❌ no |
map | ❌ no |
binary | ❌ no |
if | ✅ yes |
case | ✅ yes |
receive | ✅ yes |
send | ✅ yes |
spawn | ✅ yes |
spawn_monitor | ❌ no |
match | 🟡 partial |
function | ✅ yes |
guards | ❌ no |
register | 🟡 static eval |
unregister | ❌ no |
whereis | ❌ no |
rand:uniform | ✅ yes |
self | ✅ yes |
anon functions | ✅ yes |
try catch | ❌ no |
after | ❌ no |
math operation | ❌ no |
This project was made for the Bachelor's degree Thesis of the Computer Science course at Alma Mater Studiorum - University of Bologna. I am grateful to the professor Ivan Lanese, who supervised the development of this project.