A and B -> A d B
not A and B -> flip horizontally: A b B
A and not B -> flip vertically: A q B
not A and not B -> rotate: A p B
etc...
A and B -> A d B
not A and B -> flip horizontally: A b B
A and not B -> flip vertically: A q B
not A and not B -> rotate: A p B
etc...