https://github.com/vadyushkins/yafolps
Yet Another First-Order Logic Problem Solver
https://github.com/vadyushkins/yafolps
first-order-logic getopt haskell haskell-exercises predicate-logic theorem-proving
Last synced: about 1 year ago
JSON representation
Yet Another First-Order Logic Problem Solver
- Host: GitHub
- URL: https://github.com/vadyushkins/yafolps
- Owner: vadyushkins
- License: apache-2.0
- Created: 2020-02-19T12:30:48.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-22T20:50:13.000Z (about 6 years ago)
- Last Synced: 2025-01-25T09:25:56.707Z (over 1 year ago)
- Topics: first-order-logic, getopt, haskell, haskell-exercises, predicate-logic, theorem-proving
- Language: Haskell
- Size: 304 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- License: LICENSE
Awesome Lists containing this project
README
# YAFOLPS (Yet Another First-Order Logic Problem Solver)
#### Semester project on mathematical logic of the fourth semester of Software Engineering, Department of System Programming, Faculty of Mathematics and Mechanics, St. Petersburg State University.
## Goal
#### We must determine whether the input formula in First-Order Logic is a tautology or not. For this to be done, we have implemented the resolution method.
## EBNF (Extended Backus–Naur form)
```
::= "!"
::= "?"
::= "&"
::= "|"
::= "-"
::= ">"
::= "^"
::= "_"
::= [a-z] | [A-Z] | [0-9] | "_"
::= [A-Z] ()*
::= | [a-z] ()* "(" (( ",")* ) ")"
::= |
::= | |
::= [a-z] ()* "(" (( ",")* ) ")"
::= | |
::= | "(" ")"
|
| "(" ")"
```
# Usage
## ``stack build && stack exec -- YAFOLPS-exe ``
## Args
* ``--input-file filename / --i filename -- Reads a formula from a file. Without specifying this option reads a formula from standard input.``
* ``--print-formula / -f -- Prints the formula that have been read.``
* ``--print-ast / -a -- Prints the AST of the formula.``
* ``--print-ssf / -s -- Prints the SSF of the negated formula.``
* ``--print-solution / -r -- Prints "VALID" if is the formula is a tautology, otherwise prints "NOT VALID".``
## Examples
* ``stack build && stack exec -- YAFOLPS-exe --i examples/1.txt -fas`` -- ``Prints formula, AST and SSF``
* ``stack build && stack exec -- YAFOLPS-exe --i examples/1.txt -r`` ``-- Prints "NOT VALID"``
* ``stack build && stack exec -- YAFOLPS-exe --i examples/2.txt -r`` ``-- Prints "NOT VALID"``
* ``stack build && stack exec -- YAFOLPS-exe --i examples/3.txt -r`` ``-- Prints "NOT VALID"``
* ``stack build && stack exec -- YAFOLPS-exe --i examples/4.txt -r`` ``-- Prints "VALID"``
* ``stack build && stack exec -- YAFOLPS-exe --i examples/Top.txt -r`` ``-- Prints "VALID"``
* ``stack build && stack exec -- YAFOLPS-exe --i examples/Bottom.txt -r`` ``-- Prints "VALID"``
## Tests
* ``stack test`` -- ``Prints results on the Hilbert's axioms``
