tptp-lark-parser
Attention!
The project is inactive.
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)
- Java
- C++
- JavaScript
- Rust
- Common Lisp
- Scala
- Haskell
- OCaml
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.