No description
logic_classes.py | ||
README.md |
What is this
- this is a simple libary representing logical sentences
Usage
- just include the logic_classes.py file in your project and import all needed classes
Currently supported classes and examples
- Value: Represents a simple boolean
a = Value(False,"a")
- And: Represents a simple logical and
testone = And(a, b, c)
- Or: Represents a simple logical or
testone = Or(a, b, c)
- Not: Represents a not
a = Not(Value(False,"a"))
- Impl: Represents an implication
testone =Impl(And(a, b, c), Not(Value(False, "d")))
- each clas has two functions
print
: prints the logical sentenceevaluate
: evaluates the sentence
- accessing values directly is possible but leads to undefined behaviour and is NOT the correct way to retrive values