{"id":17384421,"url":"https://github.com/jakubriegel/putflap","last_synced_at":"2025-07-06T13:07:22.570Z","repository":{"id":117762105,"uuid":"160336189","full_name":"jakubriegel/PUTflap","owner":"jakubriegel","description":"Extension of JFLAP. Provides command line interface, automaton and words generation and JSON results. Written in Kotlin.","archived":false,"fork":false,"pushed_at":"2018-12-27T20:47:25.000Z","size":3530,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T03:01:50.246Z","etag":null,"topics":["automaton","cli","formal-languages","jflap","json"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jakubriegel.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-04T09:57:31.000Z","updated_at":"2023-08-28T06:33:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"e0dbe534-3de2-49f4-99e2-00dca7490b1b","html_url":"https://github.com/jakubriegel/PUTflap","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jakubriegel/PUTflap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubriegel%2FPUTflap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubriegel%2FPUTflap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubriegel%2FPUTflap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubriegel%2FPUTflap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakubriegel","download_url":"https://codeload.github.com/jakubriegel/PUTflap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakubriegel%2FPUTflap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263905742,"owners_count":23527972,"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":["automaton","cli","formal-languages","jflap","json"],"created_at":"2024-10-16T07:45:26.077Z","updated_at":"2025-07-06T13:07:22.563Z","avatar_url":"https://github.com/jakubriegel.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PUTflap\nPUTflap is an extension of JFLAP, which makes JFLAP features available from the command line. It can report results as JSON and is capable of performing operations on many arguments at once. PUTflap will help students and researchers with their work and also it is a foundation for developing web application, which will visualize JFLAP operations in web browser and provide REST API.\n\nTask can be done with _[CLI](#cli)_ or automated with _[smart](#smart)_.\n\nApplication is usable, although some features are still missing. Contribution is open, but as it is university project, further consultation with maintainers is urged. More: [development](#development) and [credits](#credits)\n\n## features\nThe aim of this project is to support full JFLAP functionality from command line.\n\nEvery operation provides its results as a JSON file. Optionally if the result can be written as JFLAP file, it can output such file.\n\n### current support\n#### Finite State Automaton\n- generation of random, deterministic FSA\n- generation of random valid word\n- run FSA for given input\n- test for nondeterminism\n- test for lambda transitions\n- test of equivalence of two FSAs\n- retrieve alphabet\n- conversion to deterministic FSA\n- conversion to minimal FSA\n- conversion to grammar\n- conversion to regular expression\n- convert from `.jff` to `.json`\n\n#### Mealy and Moore Machine\n- generation of random, deterministic machine\n- generation of random valid word\n- run machine for given input\n- test for nondeterminism\n- test for lambda transitions\n- retrieve input and output alphabet\n- convert from `.jff` to `.json`\n\n#### Pushdown Automaton\n- generation of random valid word\n- run PDA for given input\n- test for nondeterminism\n- test for lambda transitions\n- retrieve alphabet\n- conversion to grammar\n- convert from `.jff` to `.json`\n\n\u003e In order to properly run PDA or generate word for it, transitions to its final state **must** read _lambda_, pop and push _Z_. \n\n#### grammar\n- generation of random regular grammar\n- retrieve alphabet\n- conversion of regular grammar to FSA\n- convert from `.jff` to `.json`\n\n## usage\nGradle tasks implemented in project generate two equally capable version of PUTflap: **jar** and **Windows exe**.\n\n### build and run\n#### jar\n**build:** `./gradlew clean build shadowJar` build result is saved in `build/libs`\n\n **run:** `java -jar putflap.jar ARGS`\n\n#### Windows\n**build:** `gradlew.exe clean build shadowJar createExe` build result is saved in `build/exe`\n\n**run:** `putflap.exe ARGS`\n\n### CLI\nThe _command line interface_ is divided into six sections. Each of them is described below. Short description and arguments are also available from _CLI_ with `-h` flag.\n\n#### random\ngeneration of random automatons and grammars\n\nflags:\n* `-t`, `--type` - type of structure to generate: `fsa` - finite state automaton, `moore` - Moore machine, `mealy` - Mealy machine, `regr` - regular grammar. All generated structures are deterministic.\n* `-n`, - number of states\n* `-f`, `--finals` - number of final states. Has no effect on Mealy and Moore machines. Default = 1\n* `-m`, `--multiple` - number of structures to generate. Default = 1\n* `-j`, `--json` - write answer as json file\n\narguments:\n* `alpahbet` - alphabet to generate automaton on. Symbols can be single or multiple letters. The generator might but does not have to use all of given symbols. For Mealy and Moore machines is a template for input and output alphabet\n\nsample usage: `java -jar putflap.jar random -t fsa -n 10 -f 3 a b c d e f g h`\n\n#### run\nrunning automatons for given inputs\n\nflags:\n* `-i`, `--input` - name of file with automaton to run\n\narguments:\n* `words` - words to run given automaton on\n\nsample usage: `java -jar putflap.jar run -i automaton.jff abc acb bac`\n\n#### test\ncheck of specific characteristics of given automatons and grammars\n\nflags:\n* `-t`, `--type` - type of test to perform: `ndet` - check if automaton is deterministic, `eq` - check equivalence of two or more FSAs, `al` - retrieve alphabet of automaton or grammar\n\narguments:\n* `inputs` - names of files with structures to test\n\nsample usage: `java -jar putflap.jar test -t ndet automaton_1.jff automaton_2.jff`\n\n#### word\ngeneration of valid words for given automatons\n\nflags:\n* `-m`, `--multiple` - number of words to generate. Default = 1\n* `-j`, `--json` - write answer as json file\n\narguments:\n* `automatonFile` - name of file with automaton\n\nsample usage: `java -jar putflap.jar word automaton.jff`\n\n#### convert\nperform various conversion tasks on automaton and grammars\n\nflags:\n* `-t`, `--type` - type of conversion to perform: `dfa` - FSA to deterministic FSA, `mini` - FSA to minimal FSA, `gra` - automaton to grammar, `re` - FSA to regular expression, `pda` - grammar to PDA, `fsa` - grammar to FSA, `json` - automaton or grammar as `.jff` file to `.json` file. All generated structures are deterministic.\n* `-j`, `--json` - write answer as json file\n\narguments:\n* `inputs` - names of files with structures to convert\n\nsample usage: `java -jar putflap.jar convert -t re -j fsa.jff`\n\n\n### **smart** \nperform tasks from other sections with parameters written in `.json` file\n\nsample usage: `java -jar putflap.jar smart random_fsa.json`\n\n\u003e *Smart* currently supports all _PUTflap_ functionality except conversions from grammar and testing grammars. \n\n#### configuration format\nParameters in smart configurations are equivalent to CLI parameters. General structure of `json` looks like this:\n```json\n{\n  \"instruction\": \"name of section to perform task from\",\n  \"parameters\": \"dictionary of task parameters\"\n}\n```  \n\nMain feature of *smart* is that each input can be specified as array of automatons and *PUTflap* will perform requested task for all of them. \n\nIn `parameters` longer names are used. Sample configurations are provided in `samples/smart`. \n\n## development\nSome features worth of implementing:\n- exceptions handling (error reports in JSON)\n- possibility to specify path to automaton or folder with automatons to use in _smart_\n- Turing Machine\n- edition of automatons from _CLI_\n- traffic statistics after running automaton\n- random PDA\n- nondeterministic radom automatons\n\n## license\nPUTflap is distributed free of charge based on JFLAP license and CC BY-NC-SA 4.0\t \n\n### JFLAP 7.1 LICENSE\n\nSusan H. Rodger\nComputer Science Department\nDuke University\nJuly 27, 2018\n\nDuke University students contributing to JFLAP source include: Thomas Finley,\nRyan Cavalcante, Stephen Reading, Bart Bressler, Jinghui Lim, Chris Morgan,\nKyung Min (Jason) Lee, Jonathan Su, Henry Qin and Jay Patel.\n\nCopyright (c) 2002-2018.\nAll rights reserved.\n\n\nI)  You are allowed distribute unmodified copies of JFLAP under the following two conditions:\n    1) You must include a copy of this license text.\n    2) You cannot charge a fee for any product that includes any part of JFLAP, in source or binary form.\n\n\nII) You are allowed to distribute modified copies of JFLAP under the following conditions:\n    1) You must include a copy of this license text.\n    2) You cannot charge a fee for any product that includes any part of your modified JFLAP, in source or binary form.\n    3) If you made the changes yourself, you must clearly describe how to contact you.\n       When the maintainer asks you (in any way) for a copy of the modified JFLAP you distributed, you\n       must make your changes, including source code, available to the maintainer without fee.  \n       The maintainer reserves the right to include your changes in the official version of JFLAP. \n       The current maintainer is Susan Rodger . If this changes, it will be announced at www.jflap.org.\n       \n\nThe name of the author may not be used to\nendorse or promote products derived from this software without\nspecific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED\nWARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\n\n## credits\nThis is a project made by Jakub Riegel and supervised by dr Krzysztof Zwierzyński from [Poznan University of Technology](https://www4.put.poznan.pl/en) as a part of Formal Languages and Compilers course and will be further developed by future course participants.\n\nThe maintainer of the original JFLAP is Susan Rodger. More information can be found on [www.jflap.org](http://www.jflap.org/)\n\n### contact\nJakub Riegel: jakub.riegel@student.put.poznan.pl\n\ndr Krzysztof Zwierzyński: krzysztof.zwierzynski@put.poznan.pl\n\n---\n[\u003cimg src=\"http://iim.put.poznan.pl/Szata/PP.gif\" width=\"100dp\" /\u003e](https://www4.put.poznan.pl/en)\n[\u003cimg src=\"http://www.cie.put.poznan.pl/images/nowelogo3eng.png\" height=\"70dp\"/\u003e](http://www.cie.put.poznan.pl/index.php?lang=en)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakubriegel%2Fputflap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakubriegel%2Fputflap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakubriegel%2Fputflap/lists"}