[![enter image description here](https://i.stack.imgur.com/P1yZq.gif)](https://i.stack.imgur.com/P1yZq.gif)

I am a bit rusty on my propositional logic. I'm writting a program and want to see if there is a better way to phrase this. I wanted to 'factor' our the negation, but I think that is illegal.