| ▲ | qsort 11 hours ago | |
Am I stupid if I don't get it? What is the intended end state? What does "ungroup operands" mean? | ||
| ▲ | suspended_state 7 hours ago | parent | next [-] | |
I think ungrouping make sense if you consider reverse parentheses as a syntactic construct added to the language, and not replacing the existing parentheses. For instance, using "] e [" as the notation for reverse parentheses around expression e, the second line showing reverse parenthese simplification, third line showing the grouping after parsing, and the fourth line using postfix notation: A + B * (C + D) * (E + F) => A + B * (C + D) * (E + F) => (A + (B * (C + D) * (E + F))) => A B C D + E F + * * + A + ] B * (C + D) [ * (E + F) => A + B * C + D * (E + F) => ((A + (B * C)) + (D * (E + F))) => A B C * + D E F * + + So what ungrouping would mean is to undo the grouping done by regular parentheses. However, this is not what is proposed later in the article. Possibilities include reversing the priority inside the reverse parentheses, or lowering the priority wrt the rest of the expression. | ||
| ▲ | suspended_state 4 hours ago | parent | prev | next [-] | |
I stumbled on this: https://lobste.rs/s/qoqfwz/inverse_parentheses#c_n5z77w which should provide the answer. | ||
| ▲ | jojobas 11 hours ago | parent | prev [-] | |
I'm not sure I'm following but I think what he means is that if normal parenthesis around an addition mean this addition must precede multiplication, these anti-parenthesis around a multiplication have to make addition take place before it. | ||