Skip to main content

python cli program to convert latex input to CNF (conjunctive normal form).

Project description

██╗      █████╗ ████████╗███████╗██╗  ██╗████████╗ ██████╗  ██████╗███╗   ██╗███████╗
██║     ██╔══██╗╚══██╔══╝██╔════╝╚██╗██╔╝╚══██╔══╝██╔═══██╗██╔════╝████╗  ██║██╔════╝
██║     ███████║   ██║   █████╗   ╚███╔╝    ██║   ██║   ██║██║     ██╔██╗ ██║█████╗  
██║     ██╔══██║   ██║   ██╔══╝   ██╔██╗    ██║   ██║   ██║██║     ██║╚██╗██║██╔══╝  
███████╗██║  ██║   ██║   ███████╗██╔╝ ██╗   ██║   ╚██████╔╝╚██████╗██║ ╚████║██║     
╚══════╝╚═╝  ╚═╝   ╚═╝   ╚══════╝╚═╝  ╚═╝   ╚═╝    ╚═════╝  ╚═════╝╚═╝  ╚═══╝╚═╝     

python cli to convert latex input to CNF(Conjunctive Normal Form).

PyPI License: MIT

Installation

pip install this repo.

pip3 install LatexToCNF

Usage example

To get help with commandline arguments

LatexToCNF --help

Using Command-line Arguments

LatexToCNF -f "/path/to/folder/myinput.tex"
(or)
LatexToCNF -f "/path/to/folder/myinput.txt"

(or)

LatexToCNf --filepath "/path/to/folder/myinput.tex"
(or)
LatexToCNF --filepath "/path/to/folder/myinput.txt"

Sample input file

myinput.tex

\neg \neg p
\neg p \wedge q \rightarrow p \wedge (r \rightarrow q)
r \rightarrow (s \rightarrow (t \wedge s \rightarrow r))

myinput.text

\neg \neg p
\neg p \wedge q \rightarrow p \wedge (r \rightarrow q)
r \rightarrow (s \rightarrow (t \wedge s \rightarrow r))

output

line-1: p
line-2: (((p \vee (\neg q)) \vee p) \wedge ((p \vee (\neg q)) \vee ((\neg r) \vee q)))
line-3: ((\neg r) \vee ((\neg s) \vee (((\neg t) \vee (\neg s)) \vee r)))

Meta

Azgmohammadd – azgmohammadd@gmail.com

Distributed under the MIT license. See LICENSE for more information.

https://github.com/azgmohammadd

Contributing

  1. Fork it (https://github.com/azgmohammadd/azgmohammadd/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

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

LatexToCNF-0.1.4.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

LatexToCNF-0.1.4-py3-none-any.whl (7.9 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