No description
Find a file
2025-07-02 13:24:58 +02:00
logic_classes.py Updated 2025-04-05 21:54:27 +02:00
README.md Update 2025-07-02 13:24:58 +02:00

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 sentence
    • evaluate: evaluates the sentence
  • accessing values directly is possible but leads to undefined behaviour and is NOT the correct way to retrive values