A library and command line tool for flattening and validation of hierarchical and concurrent/parallel graphs (mainly .scxml
state charts), written in crystal.
This library takes advantage of the graph's ken (graphken - the guard dependencies of parallel states in .scxml
) to identify feasible edges and necessary triggers to reach a target state.
Install crystal-lang
sudo dnf -y install gcc gcc-c++ gmp-devel libbsd-devel \
libedit-devel libevent-devel libxml2-devel libyaml-devel \
llvm-devel llvm-static libstdc++-static make \
openssl-devel pcre-devel redhat-rpm-config \
fonts-cmu
sudo dnf install snapd
sudo ln -s /var/lib/snapd/snap /snap
sudo snap install crystal --classic
sudo apt install gcc pkg-config git tzdata \
libpcre3-dev libevent-dev libyaml-dev \
libgmp-dev libssl-dev libxml2-dev libz-dev \
fonts-cmu
sudo apt install snapd
sudo ln -s /var/lib/snapd/snap /snap
sudo snap install crystal --classic
Add the dependency to your shard.yml
:
dependencies:
graken:
github: ttrau/graken
Run shards install
and add require "graken"
to your project.
sudo make install
graken < ./spec/simple.scxml ## pipe graph as .scxml file
graken -i ./spec/simple.scxml ## read graph from .scxml file
graken -s /tmp/graken.sock < ./spec/simple.scxml ## keep http service running with unix socket
graken -p 3000 < ./spec/simple.scxml ## keep http service running behind port
graken -f < ./spec/simple.scxml ## flatten
graken -v < ./spec/simple.scxml ## flatten + validate
graken -h ## show help
crystal src/cli.cr -v -o -a < spec/testmodel/simple.scxml
crystal src/cli.cr -v -o -a < spec/testmodel/cell.scxml
crystal spec
crystal build src/cli.cr --release
- Thomas Trautner - creator and maintainer