nadia-proof


Namenadia-proof JSON
Version 0.1.9 PyPI version JSON
download
home_pagehttps://github.com/daviromero/nadia
SummaryNADIA is a proof assistant for teaching natural deduction to computer science students. NADIA allows students to write their proofs and automatically checks whether the proofs are correct and, if not, displays any errors found.
upload_time2023-08-13 13:42:09
maintainer
docs_urlNone
authorDavi Romero de Vasconcelos
requires_python
licenseMIT
keywords natural deduction teaching logic educational software
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Natural Deduction Proof Assistant (NADIA)

The NADIA is a tool written in Python that can be used as a desktop application, or in a [web platform](https://sistemas.quixada.ufc.br/nadia/). There is a [Jupyter Notebook](https://colab.research.google.com/github/daviromero/logic4py/blob/main/src/book/Cap%C3%ADtulo%2012.1%20-%20Dedu%C3%A7%C3%A3o%20Natural%20da%20L%C3%B3gica%20de%20Primeira-Ordem%20no%20Estilo%20de%20Fitch.ipynb) (in Portuguese) that presents the Natural Deduction and NADIA concepts. A Playlist of all Fitch-Style Natural Deduction content is available on [YouTube](https://youtube.com/playlist?list=PLfOnKvd6pFiogX1TEA5ZTzZLoC9H-hx9R) (in Portuguese). The main idea is that the students can write their proofs as similar as possible to what is available in the textbooks and to what the students would usually write on paper. NADIA allows the students to automatically check whether a proof in the natural deduction is valid. If the proof is not correct, NADIA will display the errors of the proof. So, the students may make mistakes and learn from the errors. The web interface is very easy-to-use and has: 
- An area for editing the proof in plain text. The students should write a proof in Fitch-style (see [ND Rules](https://raw.githubusercontent.com/daviromero/anita/main/ND-Rules.pdf)).
- A message area to display whether the proof is valid, the countermodel, or the errors on the proof.
- And the following links: 
  - Check, to check the correctness of the proof; 
  - Manual, to view a document with the inference rules and examples; 
  - Fitch, to generate the LaTeX code in a Fitch-style of a valid proof. Use the `logicproof` package in your LaTeX code; 
  - Gentzen, to generate the LaTeX code in a Gentzen-style of a valid proof. Use the `proof` package in your LaTeX code; 
  - Fitch LaTeX in Overleaf, to open the proof source code directly in [Overleaf](http://overleaf.com/) that is a collaborative platform for editing LaTeX

To facilitate the writing of the proofs, we made the following conventions in NADIA:
- The Atoms are written in capital letters (e.g. `A, B,  H(x)`);
- Variables are written with the first letter in lowercase, followed by letters and numbers (e.g. `x, x0, xP0`);
- Formulas with $\forall x$ and $\exists x$ are represented by $Ax$ and $Ex$ ('A' and 'E' followed by the variable x). For instance, `Ax(H(x)->M(x))` represents $\forall x~(H(x)\rightarrow M(x))$.
- Table below shows the equivalence of logic symbols and those used in NADIA.
- The order of precedence of quantifiers and logical connectives is defined by $\lnot,\forall,\exists,\wedge,\vee,\rightarrow$ with right alignment. For example:
  - Formula `~A&B -> C` represents formula $(((\lnot A)\land B)\rightarrow C)$;
  - The theorem `~A|B |- A->C` represents $((\lnot A)\vee B)\vdash (A\rightarrow B)$.
- Each inference rule will be named by its respective connective and `i` (introduction) or `e` (elimination). For example, `->e` represents the elemination and rule. 
- The justifications for the premises  use the reserved word `pre`.

| Symbol |  $\lnot$ | $\land$ | $\lor$ | $\rightarrow$ | $\forall x$ | $\exists x$ | $\bot$ | box | $\vdash$ |
| :---:  |  :---:  | :---: | :---:  | :---:  | :---:  | :---:  | :---:  | :---:  | :---: |
| LaTeX  |  $\backslash\textrm{lnot}$ | $\backslash\textrm{land}$ | $\backslash\textrm{lor}$ | $\backslash\textrm{rightarrow}$ | $\backslash\textrm{forall x}$ | $\backslash\textrm{exists x}$ | $\backslash\textrm{bot}$ | $[.~]$ | $\backslash\textrm{vdash}$ |
| NADIA |  ~  | \& | $\mid$ | -> | Ax | Ex | @  | { } | \|- |

![](https://raw.githubusercontent.com/daviromero/nadia/main/NADIA-EXAMPLE.png)

## License
NADIA is available by [**MIT License**](https://raw.githubusercontent.com/daviromero/anita/main/license.txt).

## Requirements:
You must install 
- [rply 0.7.8 package](https://pypi.org/project/rply/)
- ipywidgets

## Install

To install NADIA from Github, run the following command:
```bash
pip install git+https://github.com/daviromero/nadia.git
```

To install NADIA from PyPi repository, run the following command:
```bash
pip install nadia-proof
```

## NADIA
You can run NADIA with the command line: 
```bash
nadia -i [input_proof_file] [-t input_theorem]
```
## NADIA in Voila
You can run NADIA in Jupyter Nootebook or in a [Voilà](https://voila.readthedocs.io/) 
```bash
voila nadia_pt.ipynb
```
## NADIA in your code
You can import NADIA in your code (basic usage)
```bash
from nadia.nadia_pt_fo import check_proof

print(check_proof('''1. A|B              pre
2. A->C             pre
3. B->C             pre
4. {    A           hip
5.      C           ->e 4,2
   } 
6. {    B           hip
7.      C           ->e 6,3
   }
8. C                |e 1, 4-5, 6-7'''))```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/daviromero/nadia",
    "name": "nadia-proof",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Natural Deduction,Teaching Logic,Educational Software",
    "author": "Davi Romero de Vasconcelos",
    "author_email": "daviromero@ufc.br",
    "download_url": "https://files.pythonhosted.org/packages/42/3c/108a524d5c726063a139f03228c4d2468b91e77fa88ffa7a0affe5f96b90/nadia-proof-0.1.9.tar.gz",
    "platform": null,
    "description": "# Natural Deduction Proof Assistant (NADIA)\r\n\r\nThe NADIA is a tool written in Python that can be used as a desktop application, or in a [web platform](https://sistemas.quixada.ufc.br/nadia/). There is a [Jupyter Notebook](https://colab.research.google.com/github/daviromero/logic4py/blob/main/src/book/Cap%C3%ADtulo%2012.1%20-%20Dedu%C3%A7%C3%A3o%20Natural%20da%20L%C3%B3gica%20de%20Primeira-Ordem%20no%20Estilo%20de%20Fitch.ipynb) (in Portuguese) that presents the Natural Deduction and NADIA concepts. A Playlist of all Fitch-Style Natural Deduction content is available on [YouTube](https://youtube.com/playlist?list=PLfOnKvd6pFiogX1TEA5ZTzZLoC9H-hx9R) (in Portuguese). The main idea is that the students can write their proofs as similar as possible to what is available in the textbooks and to what the students would usually write on paper. NADIA allows the students to automatically check whether a proof in the natural deduction is valid. If the proof is not correct, NADIA will display the errors of the proof. So, the students may make mistakes and learn from the errors. The web interface is very easy-to-use and has: \r\n- An area for editing the proof in plain text. The students should write a proof in Fitch-style (see [ND Rules](https://raw.githubusercontent.com/daviromero/anita/main/ND-Rules.pdf)).\r\n- A message area to display whether the proof is valid, the countermodel, or the errors on the proof.\r\n- And the following links: \r\n  - Check, to check the correctness of the proof; \r\n  - Manual, to view a document with the inference rules and examples; \r\n  - Fitch, to generate the LaTeX code in a Fitch-style of a valid proof. Use the `logicproof` package in your LaTeX code; \r\n  - Gentzen, to generate the LaTeX code in a Gentzen-style of a valid proof. Use the `proof` package in your LaTeX code; \r\n  - Fitch LaTeX in Overleaf, to open the proof source code directly in [Overleaf](http://overleaf.com/) that is a collaborative platform for editing LaTeX\r\n\r\nTo facilitate the writing of the proofs, we made the following conventions in NADIA:\r\n- The Atoms are written in capital letters (e.g. `A, B,  H(x)`);\r\n- Variables are written with the first letter in lowercase, followed by letters and numbers (e.g. `x, x0, xP0`);\r\n- Formulas with $\\forall x$ and $\\exists x$ are represented by $Ax$ and $Ex$ ('A' and 'E' followed by the variable x). For instance, `Ax(H(x)->M(x))` represents $\\forall x~(H(x)\\rightarrow M(x))$.\r\n- Table below shows the equivalence of logic symbols and those used in NADIA.\r\n- The order of precedence of quantifiers and logical connectives is defined by $\\lnot,\\forall,\\exists,\\wedge,\\vee,\\rightarrow$ with right alignment. For example:\r\n  - Formula `~A&B -> C` represents formula $(((\\lnot A)\\land B)\\rightarrow C)$;\r\n  - The theorem `~A|B |- A->C` represents $((\\lnot A)\\vee B)\\vdash (A\\rightarrow B)$.\r\n- Each inference rule will be named by its respective connective and `i` (introduction) or `e` (elimination). For example, `->e` represents the elemination and rule. \r\n- The justifications for the premises  use the reserved word `pre`.\r\n\r\n| Symbol |  $\\lnot$ | $\\land$ | $\\lor$ | $\\rightarrow$ | $\\forall x$ | $\\exists x$ | $\\bot$ | box | $\\vdash$ |\r\n| :---:  |  :---:  | :---: | :---:  | :---:  | :---:  | :---:  | :---:  | :---:  | :---: |\r\n| LaTeX  |  $\\backslash\\textrm{lnot}$ | $\\backslash\\textrm{land}$ | $\\backslash\\textrm{lor}$ | $\\backslash\\textrm{rightarrow}$ | $\\backslash\\textrm{forall x}$ | $\\backslash\\textrm{exists x}$ | $\\backslash\\textrm{bot}$ | $[.~]$ | $\\backslash\\textrm{vdash}$ |\r\n| NADIA |  ~  | \\& | $\\mid$ | -> | Ax | Ex | @  | { } | \\|- |\r\n\r\n![](https://raw.githubusercontent.com/daviromero/nadia/main/NADIA-EXAMPLE.png)\r\n\r\n## License\r\nNADIA is available by [**MIT License**](https://raw.githubusercontent.com/daviromero/anita/main/license.txt).\r\n\r\n## Requirements:\r\nYou must install \r\n- [rply 0.7.8 package](https://pypi.org/project/rply/)\r\n- ipywidgets\r\n\r\n## Install\r\n\r\nTo install NADIA from Github, run the following command:\r\n```bash\r\npip install git+https://github.com/daviromero/nadia.git\r\n```\r\n\r\nTo install NADIA from PyPi repository, run the following command:\r\n```bash\r\npip install nadia-proof\r\n```\r\n\r\n## NADIA\r\nYou can run NADIA with the command line: \r\n```bash\r\nnadia -i [input_proof_file] [-t input_theorem]\r\n```\r\n## NADIA in Voila\r\nYou can run NADIA in Jupyter Nootebook or in a [Voil\u00c3\u00a0](https://voila.readthedocs.io/) \r\n```bash\r\nvoila nadia_pt.ipynb\r\n```\r\n## NADIA in your code\r\nYou can import NADIA in your code (basic usage)\r\n```bash\r\nfrom nadia.nadia_pt_fo import check_proof\r\n\r\nprint(check_proof('''1. A|B              pre\r\n2. A->C             pre\r\n3. B->C             pre\r\n4. {    A           hip\r\n5.      C           ->e 4,2\r\n   } \r\n6. {    B           hip\r\n7.      C           ->e 6,3\r\n   }\r\n8. C                |e 1, 4-5, 6-7'''))```\r\n\r\n\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "NADIA is a proof assistant for teaching natural deduction to computer science students. NADIA allows students to write their proofs and automatically checks whether the proofs are correct and, if not, displays any errors found.",
    "version": "0.1.9",
    "project_urls": {
        "Homepage": "https://github.com/daviromero/nadia"
    },
    "split_keywords": [
        "natural deduction",
        "teaching logic",
        "educational software"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "423c108a524d5c726063a139f03228c4d2468b91e77fa88ffa7a0affe5f96b90",
                "md5": "c60261d87cd1e0a7ee6e7b742eeafa74",
                "sha256": "f6098fa82fe6c845899601fb226343f483f957e36d4ac0da771d976acbd6dcd3"
            },
            "downloads": -1,
            "filename": "nadia-proof-0.1.9.tar.gz",
            "has_sig": false,
            "md5_digest": "c60261d87cd1e0a7ee6e7b742eeafa74",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 25325,
            "upload_time": "2023-08-13T13:42:09",
            "upload_time_iso_8601": "2023-08-13T13:42:09.897687Z",
            "url": "https://files.pythonhosted.org/packages/42/3c/108a524d5c726063a139f03228c4d2468b91e77fa88ffa7a0affe5f96b90/nadia-proof-0.1.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-13 13:42:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "daviromero",
    "github_project": "nadia",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "nadia-proof"
}
        
Elapsed time: 0.87533s