Skip to content

a GUI and CLI tool for converting a non-deterministic finite automaton (NFA) to a deterministic finite automaton (DFA) and further minimizing the DFA.

License

Notifications You must be signed in to change notification settings

arashsm79/automapy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AutomaPy

GUI and CLI tool for converting NFA to DFA and minizing the DFA

Table of Contents

Introduction

This tool takes a NFA in a JSON format as input and draws the graphs of its corresponding DFA and minimized DFA. It can also provide the JSON representation of the DFA as output.

The CLI tool provides various options for tuning the behaviour of the tool.

The GUI front-end is a wrapper around the CLI tool that uses Pyside6 as its toolkit and graphviz to draw the automaton. You can also test strings for acceptance or rejection by the automaton.

The JSON format that is used to represent an automaton is as follows: ( '@' is used to denote to the epsilon transition)

{
    "states": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
    "alphabet": ["a", "b"],
    "transitions": [
        [0, "@", [1, 7]],
        [1, "@", [2, 4]],
        [2, "a", [3]],
        [3, "@", [6]],
        [4, "b", [5]],

        [5, "@", [6]],
        [6, "@", [7, 1]],
        [7, "a", [8]],
        [8, "b", [9]],
        [9, "b", [10]]
    ],
    "initial": 0,
    "final": [10]
}

Usage Guide

The CLI provides the following options:

    Provide the output path: -o /out/path
    Disable print to stdout: -s
    Read from stdin: -i
    Render graph to output file path: -r
    Minimize the DFA: -m

The GUI is pretty straight forward and requires no further explanation.

Screenshots

nfa dfa

See Also

About

a GUI and CLI tool for converting a non-deterministic finite automaton (NFA) to a deterministic finite automaton (DFA) and further minimizing the DFA.

Topics

Resources

License

Stars

Watchers

Forks

Languages