AutomaPy


NameAutomaPy JSON
Version 1.3.5 PyPI version JSON
download
home_page
SummaryThis package refers to the topic of automata theory, which includes DFA, NDFA, Mealy machines, Moore machines, Finite state machine and Turing machine.
upload_time2023-03-20 19:33:34
maintainer
docs_urlNone
authorMohammed Varaliya
requires_python
license
keywords python dfa ndfa mealy machines moore machines automata theory of computation finite state machine finite automaton turing machine
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            For more information, see the [GitHub Repository](https://github.com/Mohammedvaraliya/AutomaPy).
## AutomaPy


[![Supported Python versions](https://img.shields.io/pypi/pyversions/AutomaPy.svg)](https://pypi.python.org/pypi/AutomaPy/)
[![Total downloads](https://pepy.tech/badge/AutomaPy)](https://pepy.tech/project/AutomaPy)

The package contains a set of tools and algorithms for theoretical computer science, which could include automata theory as well as other topics.

## Installation

    pip install AutomaPy

## Examples of How To Use (AutomaPy)

#### 1. Create a program that implements a machine that accepts strings ending with '101'.

```py

from AutomaPy import EndingWithOneZeroOne

dfa = EndingWithOneZeroOne()

print(dfa.check_string("101"))

```

#### 2. Design a Program for creating machine that accepts three consecutive one.

```py

from AutomaPy import ThreeConsecutiveOne

dfa = ThreeConsecutiveOne()

print(dfa.check_string("111")) # True
print(dfa.check_string("11100")) # True
print(dfa.check_string("1100")) # False

```

#### 3. Write a program for tokenization of given input.

```py

from AutomaPy import Tokenizer

tokenizer = Tokenizer()

print(tokenizer.tokenize("This is an example of tokenization."))

```

#### 4. Design a program for accepting decimal number divisible by 2.

```py

from AutomaPy import DecimalNumberDivisibleByTwo

dfa = DecimalNumberDivisibleByTwo()

print(dfa.check_string("111")) # True
print(dfa.check_string("11100")) # True
print(dfa.check_string("1001")) # False

```

#### 5. Design a program for creating a machine which accepts string having equal no. of 1’s and 0’s.

```py

from AutomaPy import EqualNumberOfOneZero

dfa = EqualNumberOfOneZero()

print(dfa.check_string("111000")) # True
print(dfa.check_string("111001")) # False
print(dfa.check_string("1100")) # True

```

#### 6. Design a program for creating a machine which count number of 1's and 0's in a given string.

```py

from AutomaPy import CountNumberOfOneZero

dfa = CountNumberOfOneZero()

print(dfa.check_string("111000")) # True
print(dfa.check_string("111001")) # False
print(dfa.check_string("1100")) # True

```

#### 7. Design a program for Turing machine that’s accepts the even number of 1's.

```py

from AutomaPy import TuringMachineEvenOnes

dfa = TuringMachineEvenOnes()

print(dfa.check_string("101111")) #False because 5 is odd (there is 5 1's)
print(dfa.check_string("101")) #True because 2 is even (there is 2 1's)

```

#### You can enter following command to see what functions this package have.

```bash
AutomaPy --help
```

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "AutomaPy",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "python,DFA,NDFA,Mealy machines,Moore machines,Automata,Theory of Computation,Finite State Machine,Finite Automaton,Turing Machine",
    "author": "Mohammed Varaliya",
    "author_email": "<mohammedvaraliya2661392@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/6d/33/c043df9a1d18d2bf85237c567847a6550d85e3e6b582b563868523b8f058/AutomaPy-1.3.5.tar.gz",
    "platform": null,
    "description": "For more information, see the [GitHub Repository](https://github.com/Mohammedvaraliya/AutomaPy).\r\n## AutomaPy\r\n\r\n\r\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/AutomaPy.svg)](https://pypi.python.org/pypi/AutomaPy/)\r\n[![Total downloads](https://pepy.tech/badge/AutomaPy)](https://pepy.tech/project/AutomaPy)\r\n\r\nThe package contains a set of tools and algorithms for theoretical computer science, which could include automata theory as well as other topics.\r\n\r\n## Installation\r\n\r\n    pip install AutomaPy\r\n\r\n## Examples of How To Use (AutomaPy)\r\n\r\n#### 1. Create a program that implements a machine that accepts strings ending with '101'.\r\n\r\n```py\r\n\r\nfrom AutomaPy import EndingWithOneZeroOne\r\n\r\ndfa = EndingWithOneZeroOne()\r\n\r\nprint(dfa.check_string(\"101\"))\r\n\r\n```\r\n\r\n#### 2. Design a Program for creating machine that accepts three consecutive one.\r\n\r\n```py\r\n\r\nfrom AutomaPy import ThreeConsecutiveOne\r\n\r\ndfa = ThreeConsecutiveOne()\r\n\r\nprint(dfa.check_string(\"111\")) # True\r\nprint(dfa.check_string(\"11100\")) # True\r\nprint(dfa.check_string(\"1100\")) # False\r\n\r\n```\r\n\r\n#### 3. Write a program for tokenization of given input.\r\n\r\n```py\r\n\r\nfrom AutomaPy import Tokenizer\r\n\r\ntokenizer = Tokenizer()\r\n\r\nprint(tokenizer.tokenize(\"This is an example of tokenization.\"))\r\n\r\n```\r\n\r\n#### 4. Design a program for accepting decimal number divisible by 2.\r\n\r\n```py\r\n\r\nfrom AutomaPy import DecimalNumberDivisibleByTwo\r\n\r\ndfa = DecimalNumberDivisibleByTwo()\r\n\r\nprint(dfa.check_string(\"111\")) # True\r\nprint(dfa.check_string(\"11100\")) # True\r\nprint(dfa.check_string(\"1001\")) # False\r\n\r\n```\r\n\r\n#### 5. Design a program for creating a machine which accepts string having equal no. of 1\u00e2\u20ac\u2122s and 0\u00e2\u20ac\u2122s.\r\n\r\n```py\r\n\r\nfrom AutomaPy import EqualNumberOfOneZero\r\n\r\ndfa = EqualNumberOfOneZero()\r\n\r\nprint(dfa.check_string(\"111000\")) # True\r\nprint(dfa.check_string(\"111001\")) # False\r\nprint(dfa.check_string(\"1100\")) # True\r\n\r\n```\r\n\r\n#### 6. Design a program for creating a machine which count number of 1's and 0's in a given string.\r\n\r\n```py\r\n\r\nfrom AutomaPy import CountNumberOfOneZero\r\n\r\ndfa = CountNumberOfOneZero()\r\n\r\nprint(dfa.check_string(\"111000\")) # True\r\nprint(dfa.check_string(\"111001\")) # False\r\nprint(dfa.check_string(\"1100\")) # True\r\n\r\n```\r\n\r\n#### 7. Design a program for Turing machine that\u00e2\u20ac\u2122s accepts the even number of 1's.\r\n\r\n```py\r\n\r\nfrom AutomaPy import TuringMachineEvenOnes\r\n\r\ndfa = TuringMachineEvenOnes()\r\n\r\nprint(dfa.check_string(\"101111\")) #False because 5 is odd (there is 5 1's)\r\nprint(dfa.check_string(\"101\")) #True because 2 is even (there is 2 1's)\r\n\r\n```\r\n\r\n#### You can enter following command to see what functions this package have.\r\n\r\n```bash\r\nAutomaPy --help\r\n```\r\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "This package refers to the topic of automata theory, which includes DFA, NDFA, Mealy machines, Moore machines, Finite state machine and Turing machine.",
    "version": "1.3.5",
    "split_keywords": [
        "python",
        "dfa",
        "ndfa",
        "mealy machines",
        "moore machines",
        "automata",
        "theory of computation",
        "finite state machine",
        "finite automaton",
        "turing machine"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7e2c99d3bdce267ec541cabd879196ff21aabc8befee7a79eb1bc4bce26f88dc",
                "md5": "c1b59daff86781c522a73687a35968fa",
                "sha256": "f7aa9fbd97b7da0ab76f25a425477598acf3dcfc8dd45b4c7396449d86a3df5b"
            },
            "downloads": -1,
            "filename": "AutomaPy-1.3.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c1b59daff86781c522a73687a35968fa",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 7855,
            "upload_time": "2023-03-20T19:33:22",
            "upload_time_iso_8601": "2023-03-20T19:33:22.647980Z",
            "url": "https://files.pythonhosted.org/packages/7e/2c/99d3bdce267ec541cabd879196ff21aabc8befee7a79eb1bc4bce26f88dc/AutomaPy-1.3.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6d33c043df9a1d18d2bf85237c567847a6550d85e3e6b582b563868523b8f058",
                "md5": "fd65b6ee3c6aefde3c21cc0430abcb23",
                "sha256": "5b39768b9189b3ecb37a134b8b287a630951e32e2680a6370046bcb93a407730"
            },
            "downloads": -1,
            "filename": "AutomaPy-1.3.5.tar.gz",
            "has_sig": false,
            "md5_digest": "fd65b6ee3c6aefde3c21cc0430abcb23",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6575,
            "upload_time": "2023-03-20T19:33:34",
            "upload_time_iso_8601": "2023-03-20T19:33:34.953638Z",
            "url": "https://files.pythonhosted.org/packages/6d/33/c043df9a1d18d2bf85237c567847a6550d85e3e6b582b563868523b8f058/AutomaPy-1.3.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-20 19:33:34",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "automapy"
}
        
Elapsed time: 0.11227s