warthog-logic / warthog

A Logic Framework in Scala
16 stars 5 forks source link

toString methods of NAryOperator and Not produce redundant brackets #15

Open ghost opened 9 years ago

ghost commented 9 years ago

The toString() methods of the two classes

org.warthog.generic.formulas.NAryOperator org.warthog.generic.formulas.Not

produce redundant brackets. For example println(Not(And(A, B))) shows up as

~((A & B))

instead of

~(A & B)

SHildebrandt commented 9 years ago

Same problem applies to BinaryOperator. I think we could just change the toString() method of Not to override def toString = Formula.NOT + arg ?

Wouldn't be bad to have some unit tests for the toString() method...