1
Fork 0
mirror of https://git.cs.ou.nl/joshua.moerman/mealy-decompose.git synced 2025-04-29 17:57:44 +02:00
Tools to decompose finite state machines.
Find a file
2024-09-23 16:52:47 +02:00
app Some small changes 2024-09-23 16:52:47 +02:00
other Refactored and cleaned up some things 2024-06-26 09:13:56 +02:00
results meer plaatjes 2023-12-08 20:20:21 +01:00
src Some small changes 2024-09-23 16:52:47 +02:00
test Initial test of general decomposition 2023-11-17 16:21:20 +01:00
.gitignore script to input-decompose a model 2024-06-14 13:25:52 +02:00
.ruff.toml more formatting 2024-06-14 14:09:18 +02:00
fourmolu.yaml Refactored and cleaned up some things 2024-06-26 09:13:56 +02:00
LICENSE Removes the copar dependency 2024-09-23 08:46:49 +02:00
mealy-decompose.cabal Removes the copar dependency 2024-09-23 08:46:49 +02:00
README.md Added documentation and cleaned up some code 2024-09-23 10:06:29 +02:00

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). 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 Ints. 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.

(c) 2024 Joshua Moerman, Open Universiteit