define methods for logical operators `and`, `or` and `not`