A TPTP parser using Lark
Project description
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:
C (by TPTP’s creator Geoff Sutcliffe)
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tptp_lark_parser-0.2.0.tar.gz
.
File metadata
- Download URL: tptp_lark_parser-0.2.0.tar.gz
- Upload date:
- Size: 57.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.4 Linux/5.19.0-29-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b0479220b8a889633c2be598c767da9b891cb40d448b9d2505a5dfb5347193b |
|
MD5 | 99f04b6c3dee8b3fa2180c41bdca7e03 |
|
BLAKE2b-256 | 7384be2116a5e4772c344b9fc02ec6dd1471333cec33384a3e32341e43bef495 |
File details
Details for the file tptp_lark_parser-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: tptp_lark_parser-0.2.0-py3-none-any.whl
- Upload date:
- Size: 59.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.3.2 CPython/3.10.4 Linux/5.19.0-29-generic
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca851fc62fcffae5b91b2b49e92ac0ba39a0a45d43f8949ba48ce9615082de52 |
|
MD5 | 6124ee4b3278cfdd736f69e67301b0cc |
|
BLAKE2b-256 | c6ea1c9d19dac7c1b066d7d4cf800280ddb0ccba64cc6566f5c5e14755e056a3 |