propositional logic parser and evaluator addapted from simpleBool