Open oli-obk opened 6 years ago
E.g. !a && (b || c) || a && (d || e) || !a && f produces
!a && (b || c) || a && (d || e) || !a && f
!(!a && !b && !c && !f || a && !d && !e)
(a || b || c || f) && (!a || d || e)
But a human would rather have
a && (d || e) || !a && (b || c || f)
which is three operators deep, and our algorithm always produces expressions two operators deep.
There must be some scientific papers, theses or blog posts about different models of "simple" boolean expressions. Lets find some and implement them.
For this particular example, I think the best representation would be:
if a { d || e } else { b || c || f }
Context: https://github.com/rust-lang-nursery/rust-clippy/pull/3129#discussion_r215662788
E.g.
!a && (b || c) || a && (d || e) || !a && f
produces!(!a && !b && !c && !f || a && !d && !e)
(a || b || c || f) && (!a || d || e)
But a human would rather have
a && (d || e) || !a && (b || c || f)
which is three operators deep, and our algorithm always produces expressions two operators deep.
There must be some scientific papers, theses or blog posts about different models of "simple" boolean expressions. Lets find some and implement them.