Replaces either a || b with !(!a && !b) or a && b with !(!a || !b) inside a boolean expression.
a || b
!(!a && !b)
a && b
!(!a || !b)