Update 'README.md'
This commit is contained in:
parent
71fb198169
commit
db0712f35a
16
README.md
16
README.md
@ -1,12 +1,12 @@
|
|||||||
# Logic formula checker
|
# Logic formula checker
|
||||||
Script for checking is formula is correct
|
Script for checking if formula is correct
|
||||||
|
|
||||||
### Installation
|
### Installation
|
||||||
You can run this script without downloading any other libraries.
|
You can run this script without downloading any other libraries.
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
There are several ways of usage.
|
There are several ways of usage.
|
||||||
+ You can use is as a library in your project:
|
+ You can use it as a library in your project:
|
||||||
```
|
```
|
||||||
from logic_formula_checker import is_formula_correct
|
from logic_formula_checker import is_formula_correct
|
||||||
```
|
```
|
||||||
@ -17,21 +17,21 @@ There are several ways of usage.
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Testing
|
### Testing
|
||||||
Some tests is written in tests.py file. They check if formula single tests work properly.
|
Some tests are written in tests.py file. They check if formula's single tests work properly.
|
||||||
|
|
||||||
|
|
||||||
## Script logic explaination
|
## Script logic explaination
|
||||||
It takes two test of formula for checking formula's correctness.
|
It takes two tests of formula for checking formula's correctness.
|
||||||
Firstly check if all brackets are properly opened and closed.
|
Firstly, check if all brackets are properly opened and closed.
|
||||||
```
|
```
|
||||||
( { } ) - Good
|
( { } ) - Good
|
||||||
( { ) } - Wrong
|
( { ) } - Wrong
|
||||||
( { } - Wrong
|
( { } - Wrong
|
||||||
```
|
```
|
||||||
Next script checks if signs are rightly put. Brackets are bypassed. Steps:
|
The next script checks if signs are put correctly. Brackets are bypassed. Steps:
|
||||||
1. Read sign, check what kind it is (Types are in logic_formula_checker/types.py).
|
1. Read sign, check its type (Types are in logic_formula_checker/types.py).
|
||||||
2. Check if it is in expected_sign list.
|
2. Check if it is in expected_sign list.
|
||||||
3. Update expected_sign list base on current sign
|
3. Update expected_sign list based on current sign.
|
||||||
|
|
||||||
```
|
```
|
||||||
a ^ ¬ b # take a, write to expected_sign conjuction symbols and negation symbols
|
a ^ ¬ b # take a, write to expected_sign conjuction symbols and negation symbols
|
||||||
|
Loading…
Reference in New Issue
Block a user