mirror of
https://git.cs.ou.nl/joshua.moerman/mealy-decompose.git
synced 2025-04-30 02:07:44 +02:00
53 lines
1.6 KiB
Markdown
53 lines
1.6 KiB
Markdown
mealy-decompose
|
|
===============
|
|
|
|
Tools to investigate decomposition of Mealy machines, aka finite state
|
|
machines (FSMs). Notable entry points are:
|
|
|
|
* `app/Main.hs` is a heuristic to decompose finite state machines into
|
|
multiple components, based on their outputs.
|
|
|
|
* `other/decompose_fsm_optimise.py` does the same, but optimally and with a
|
|
SAT solver. This can only handle state spaces of at most a few hundred
|
|
states.
|
|
|
|
* `app/RandomGen.hs` for generating FSMs which are decomposable.
|
|
|
|
|
|
## How to run
|
|
|
|
The the haskell tools (tested with ghc 9.2.8 and ghc 9.10.1):
|
|
```
|
|
cabal run mealy-decompose -- <path-to-fsm>
|
|
```
|
|
|
|
For the python tools (tested with python 3.12):
|
|
```
|
|
pip3 install python-sat
|
|
python3 decompose_fsm_optimise.py -h
|
|
```
|
|
|
|
|
|
## Notes on `copar`
|
|
|
|
In the first versions of this tool, I used the `copar` library:
|
|
[CoPaR (The Coalgebraic Partition Refiner)](https://git8.cs.fau.de/software/copar).
|
|
This is a great library and in particular very fast. Despite that, I switched
|
|
to my own partition refinement implementations because of the reasons below.
|
|
The last commit to use `copar` is `2b8b79a4`.
|
|
|
|
* I needed witnesses for some tasks. So I not only construct a partition,
|
|
but also a splitting tree, where are track all the actions needed to
|
|
separate states.
|
|
|
|
* I prefer to use the actual strings (or other data type) for the states,
|
|
inputs and outputs as opposed to `Int`s. This makes it easier to debug, and
|
|
less error-prone, as one cannot mix these entities anymore.
|
|
|
|
* `copar` comes with many dependencies, and it was a bit tricky to get the
|
|
versioning correct.
|
|
|
|
|
|
## Copyright
|
|
|
|
(c) 2024 Joshua Moerman, Open Universiteit
|