Automating the Analysis of Quantitative Automata with QuAK
Contributors
Supervisor:
Description
Requirements
You need docker installed. Alternatively, you can download QuAK from https://github.com/ista-vamos/QuAK or use the code in src.zip, and build QuAK from sources using the instructions in QuAK's README.md.
Running the docker image
First, download the docker image from the artifact link. Loading and running a docker image takes these two steps:docker load < quak-tacas25.tar.gzdocker run --rm -ti quak
The first command loads the docker image and the other command runs a new container with this image and gives you a terminal from which you can run the binary `quak`. You can also examine and play with the code of QuAK inside this terminal. Options `--rm` and `-ti` make docker to remove the container after it exits and give you the terminal, resp.
(Re-)building the docker image
If you wish to (re-)build the docker image yourself, instead of using the one from Zenodo, run:
docker build . -t quak
from the top-level repository directory (https://github.com/ista-vamos/QuAK). For more guidance, see README.md of QuAK.
Examples
A few examples of the new features follow. For more examples, the entire usage instructions, and the description of API of QuAK, see README.md in the QuAK's repository (or the attached source code). In the examples below, we use some sample automata stored in the repository of QuAK, feel free to modify them or use new ones.
Improvement 1: decomposition of nondeterministic automata
The old version of QuAK could decompose only deterministic automata (for certain value functions). You can try decomposing a deterministic automaton, in this case ../samples/ainf.txt, into its liveness and safe components with this command:./quak -d ../samples/ainf.txt decompose LimInf s.txt l.txt
The safety and liveness component automata are stored into s.txt and l.txt, resp. Because of the -d switch, the automata are also printed to stdout.
For an example of decomposing a nondeterministic automaton into its liveness and safe components, you can decompose ../samples/binf.txt:./quak -d ../samples/binf.txt decompose LimInf s.txt l.txt
You can also check the decomposition of the automaton in Fig. 1. in the paper. This automaton is in ../samples/ex.txt:
./quak -d ../samples/ex.txt decompose LimInfAvg s.txt l.txt
Note that the decomposed automata might be slightly different than in the figure, they are equivalent, though.
Improvement 2: witnesses
Here are some examples of getting witnesses from operations:
./quak -print-witness ../samples/A.txt isEquivalent LimInf ../samples/B.txt ----------isEquivalent(LimInf) = 0Witness: ab(a)----------
./quak -print-witness ../samples/B.txt constant LimSup----------isConstant(LimSup) = 0Witness: ab(ba)----------
./quak -print-witness ../samples/D2.txt empty Inf 4----------isEmpty(Inf, weight=4) = 1Witness: a(ba)----------
Using C++ API
An example of how to use the C++ API to get witnesses and the new liveness-safety decomposition can be found in the file examples/sampleProgramWitness.cpp. You can compile and run it manually (the automaton is hard-coded, feel free to change it) using these commands:cd ../examplesg++ sampleProgramWitness.cpp -I ../src -DWEIGHT_EQ_EPSILON=10e-5 ../build/src/libquak.a -o ex./ex
For more details on the API, check README of QuAK.