Skip to main content

A TPTP parser using Lark

Project description

BinderPyPI versionAnacondaCircleCIAppveyorCIDocumentation StatuscodecovZenodo

tptp-lark-parser

tptp-lark-parser is a parser for the TPTP library language using the Lark parser. For now, only CNF sublanguage is supported.

How to Install

The best way to install this package is to use pip:

pip install tptp-lark-parser

The package is also available on conda-forge:

conda install -c conda-forge tptp-lark-parser

One can also run it in a Docker container:

docker build -t tptp-lark-parser https://github.com/inpefess/tptp-lark-parser.git
docker run -it --rm -p 8888:8888 tptp-lark-parser jupyter-lab --ip=0.0.0.0 --port=8888

How to Use

from tptp_lark_parser import TPTPParser

tptp_parser = TPTPParser()
parsed_text = tptp_parser.parse("cnf(test, axiom, ~ p(Y, X) | q(X, Y)).")
clause_literals = parsed_text[0].literals

See the notebook or run it in Binder for more information.

More Documentation

More documentation can be found here.

Similar Projects

There are many TPTP parsers in different languages:

There also is another parser in Python containing only the Lark syntax file.

How to Cite

If you want to cite the tptp-lark-parser in your research paper, please use the following doi: https://doi.org/10.5281/zenodo.7040540.

How to Contribute

Please read the Code of Conduct and then follow the contribution guide.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tptp_lark_parser-0.2.0.tar.gz (57.7 kB view hashes)

Uploaded Source

Built Distribution

tptp_lark_parser-0.2.0-py3-none-any.whl (59.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page