Community
Participate
Working Groups
QuickAssists for DeMorgan's laws: 1) !a & !b <=> ! (a | b) 2) !a || !b <=> ! (a && b) 3) ... and both with & and | (&& and ||, resp.) interchanged The => way (reducing ! count) is probably more useful than the other one, but offering both could still be helpful once in a while.
another way to call these is 'push nagation in' and 'pull negation out' i'd find them very useful sometimes boolean expressions get complicated easy to mess up after 2 or 3 clauses once you get them right it's easy to mess stuff up with what seems like a benigh change - you forget a ! here or a paratheses there and you're in trouble +1 here
I would like to implement this QuickAssist and post patch for it. But I not fully understand, how and in which cases to activate it. As I can imagine, "push" is when we stay on ! before parenthesis, for example: !(a && b) and want to transform into: (!a || !b) may be also remove perenthesis if they are not required. "Pull" is when we select some boolean expression, place it in parenthesis and add ! before. I.e. for: !a || !b we will have: !(a && b) May be I don't understand right what is needed? I feel that this method can be too tiring, each time specify exactly, where to perform transformation, so may be you have better idea, that I just don't imagine. So, correct me, if I am wrong, or confirm that this is what required, so I will able to start work on this quick assist. ;-)
IMO, the quick assist should be available when either [a] the whole expression "!(a && b)" or "(!a || !b)" or "!a || !b" is selected, [b] or when the caret is somewhere inside or on the border of the expression. For [a], you would need to look top-down ("is there an && inside the !" / "does the || have ! as children"). The user can simply use "Edit > Expand Selection To" to select the right expression. For [b], you would probably start from !s and &&s, and check whether their parents form a suitable expression.
*** This bug has been marked as a duplicate of 82220 ***