Algorithm For Propositional Logic Model In Python