{"id":21206177,"url":"https://github.com/shysaur/fsmmin","last_synced_at":"2025-03-14T23:11:45.406Z","repository":{"id":89737404,"uuid":"51779700","full_name":"shysaur/fsmmin","owner":"shysaur","description":"Toolkit for Finite State Machines","archived":false,"fork":false,"pushed_at":"2016-02-15T22:17:10.000Z","size":38,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T15:32:12.081Z","etag":null,"topics":["cross-platform","finite-state-machine","minimization"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shysaur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-15T19:28:14.000Z","updated_at":"2018-06-01T08:26:52.000Z","dependencies_parsed_at":"2023-05-02T15:31:06.574Z","dependency_job_id":null,"html_url":"https://github.com/shysaur/fsmmin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shysaur%2Ffsmmin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shysaur%2Ffsmmin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shysaur%2Ffsmmin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shysaur%2Ffsmmin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shysaur","download_url":"https://codeload.github.com/shysaur/fsmmin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243658273,"owners_count":20326467,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cross-platform","finite-state-machine","minimization"],"created_at":"2024-11-20T20:54:41.276Z","updated_at":"2025-03-14T23:11:45.383Z","avatar_url":"https://github.com/shysaur.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Finite State Machine Minimizer\n\nThis is a small tool for analyzing complete or incomplete [Mealy finite state \nmachines](https://en.wikipedia.org/wiki/Finite-state_machine).\n\nIt can:\n\n - generate a [Graphviz](http://www.graphviz.org)-format graph of the machine\n   from a state transition table;\n - identify any equivalence or compatibility between states of a machine using\n   [Moore's algorithm](https://en.wikipedia.org/wiki/Moore_reduction_procedure);\n - produce an (hopefully) smaller machine equivalent to the one given in\n   input.\n   \nA separate tool (`fsmgen`) is included, which generates random finite state\nmachines. The machines it generates tend to be completely useless, but they\ncan be used to test `fsmmin`.\n\n## Compiling\n\n`fsmmin` and `fsmgen` can be compiled with [gcc](https://gcc.gnu.org/) or \n[clang](http://clang.llvm.org/) on Linux and OS X, or with \n[mingw-w64](http://mingw-w64.org/doku.php) on Windows. Just open a shell\nand run `make`.\n\nIf you want to compile with Visual Studio on Windows, you'll have to make\nthe Visual Studio project yourself. It should work, but you'll need some\nkind of implementation for `getopt_long`.\n\n## Q \u0026 A\n\n### How did the \"prime\" heuristic get to this result?\n\nUse the `--verbose` option and see for yourself.\n\nIf you don't like the result, experiment with the `--prime-weights` option. For\nexample, by specifying `--prime-weights=1,2,1` when minimizing \n`test-machines/m9.txt` you'll get a much better result.\n\n### This program is slow\n\nIf your input brings `fsmmin` to the knees, I bet you've produced it with\n`fsmgen -e999 -s20 -u999` or something like that. Since almost the whole\nmachine is undefined, basically every state is compatible with all others;\nthis makes [Bron-Kerbosch's \nalgorithm](https://en.wikipedia.org/wiki/Bron–Kerbosch_algorithm) take an\ninordinate amount of time, because it runs in exponential time.\n\nAlso note that generating all primitive compatibility classes is also very\nslow, because the algorithm is basically brute-force.\n\nTry compiling it with `CXXFLAGS=-O3` and see if it improves. Probably, \nit will not. Otherwise you can wait a couple of years or kill the process\n(trust me, the result is not going to be very interesting).\n\n### \"Incomplete\" machine? What's that?\n\n\"Incomplete finite state machine\" doesn't mean \"*nondeterministic* finite \nstate machine\". \"Incomplete\" just means that some output or transition is not \ndefined, and thus can be replaced with any other possible transition.\n\nIncomplete finite state machines are used in hardware design to optimize away\nthose inputs that are believed to be impossible for some reason.\n\nWe're talking about another kind of nondeterminism here: since the machine\ncan go to any other state when performing an undefined transition, it's not\nan \"useful\" kind of nondeterminism. If you're still confused, go read\n[Wikipedia on nondeterministic finite state \nmachines](https://en.wikipedia.org/wiki/Nondeterministic_finite_automaton).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshysaur%2Ffsmmin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshysaur%2Ffsmmin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshysaur%2Ffsmmin/lists"}