tla


Nametla JSON
Version 0.0.2 PyPI version JSON
download
home_pagehttps://github.com/johnyf/tla
SummaryParser and syntax tree for TLA+, the temporal logic of actions.
upload_time2024-06-20 16:25:31
maintainerNone
docs_urlNone
authorIoannis Filippidis
requires_python>=3.10
licenseBSD
keywords tla+ tla temporal logic of actions formal specification expression formula module mathematics theorem proof parser lexer parsing ast abstract syntax tree syntax tree
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            About
=====

A parser for the Temporal Logic of Actions (TLA+). The parser
is based on the [LR(1) algorithm](
    https://en.wikipedia.org/wiki/LR_parser)
with state merging, and has time complexity [linear](
    https://en.wikipedia.org/wiki/Time_complexity#Linear_time)
in the size of the input. The lexer and parser are generated using
[`parstools`](https://pypi.org/project/parstools).

The syntax tree is represented as named-tuples, using
`typing.NamedTuple`.


To install:

```shell
pip install tla
```

To parse a string:

```python
import tla

module_text = r'''
    ---- MODULE name ----
    operator == TRUE
    ====================
    '''

tree = tla.parse(module_text)
print(tree)
text = tla.pformat_ast(tree)
print(text)
```

More examples can be found in the directory `examples/`.
To implement a new translator of TLA+, as example the
module `tla._pprint` can be used.


Documentation
=============

In the [Markdown](https://en.wikipedia.org/wiki/Markdown) file `doc.md`.


Tests
=====

Use [`pytest`](https://pypi.org/project/pytest). Run with:

```shell
cd tests/
pytest -v --continue-on-collection-errors .
```

Read also the file `tests/README.md`.


License
=======
[BSD-3](https://opensource.org/licenses/BSD-3-Clause), read `LICENSE` file.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/johnyf/tla",
    "name": "tla",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "TLA+, TLA, temporal logic of actions, formal, specification, expression, formula, module, mathematics, theorem, proof, parser, lexer, parsing, ast, abstract syntax tree, syntax tree",
    "author": "Ioannis Filippidis",
    "author_email": "jfilippidis@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0b/87/161919cded3063e2fe85bf154eb645faff1cc465bba252f8b5fc77268fc1/tla-0.0.2.tar.gz",
    "platform": null,
    "description": "About\n=====\n\nA parser for the Temporal Logic of Actions (TLA+). The parser\nis based on the [LR(1) algorithm](\n    https://en.wikipedia.org/wiki/LR_parser)\nwith state merging, and has time complexity [linear](\n    https://en.wikipedia.org/wiki/Time_complexity#Linear_time)\nin the size of the input. The lexer and parser are generated using\n[`parstools`](https://pypi.org/project/parstools).\n\nThe syntax tree is represented as named-tuples, using\n`typing.NamedTuple`.\n\n\nTo install:\n\n```shell\npip install tla\n```\n\nTo parse a string:\n\n```python\nimport tla\n\nmodule_text = r'''\n    ---- MODULE name ----\n    operator == TRUE\n    ====================\n    '''\n\ntree = tla.parse(module_text)\nprint(tree)\ntext = tla.pformat_ast(tree)\nprint(text)\n```\n\nMore examples can be found in the directory `examples/`.\nTo implement a new translator of TLA+, as example the\nmodule `tla._pprint` can be used.\n\n\nDocumentation\n=============\n\nIn the [Markdown](https://en.wikipedia.org/wiki/Markdown) file `doc.md`.\n\n\nTests\n=====\n\nUse [`pytest`](https://pypi.org/project/pytest). Run with:\n\n```shell\ncd tests/\npytest -v --continue-on-collection-errors .\n```\n\nRead also the file `tests/README.md`.\n\n\nLicense\n=======\n[BSD-3](https://opensource.org/licenses/BSD-3-Clause), read `LICENSE` file.\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "Parser and syntax tree for TLA+, the temporal logic of actions.",
    "version": "0.0.2",
    "project_urls": {
        "Homepage": "https://github.com/johnyf/tla"
    },
    "split_keywords": [
        "tla+",
        " tla",
        " temporal logic of actions",
        " formal",
        " specification",
        " expression",
        " formula",
        " module",
        " mathematics",
        " theorem",
        " proof",
        " parser",
        " lexer",
        " parsing",
        " ast",
        " abstract syntax tree",
        " syntax tree"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0b87161919cded3063e2fe85bf154eb645faff1cc465bba252f8b5fc77268fc1",
                "md5": "6b8a459f185cb192c9112f1e07e44f73",
                "sha256": "bc52a8898605dcf79eaf7857e1b675c723ad24319fdf8532bcbc7505bde3faf2"
            },
            "downloads": -1,
            "filename": "tla-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6b8a459f185cb192c9112f1e07e44f73",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 128096,
            "upload_time": "2024-06-20T16:25:31",
            "upload_time_iso_8601": "2024-06-20T16:25:31.200939Z",
            "url": "https://files.pythonhosted.org/packages/0b/87/161919cded3063e2fe85bf154eb645faff1cc465bba252f8b5fc77268fc1/tla-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-20 16:25:31",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "johnyf",
    "github_project": "tla",
    "github_not_found": true,
    "lcname": "tla"
}
        
Elapsed time: 0.28117s