<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><span style="font-family:arial,sans-serif;font-size:12.727272033691406px"><br>
</span></div></div></div></div></blockquote><div><br></div></div></div><div>Daniel's suggestion could actually could be done pretty easily. (assume for now that we are most interested in boolean expressions over 3 variables). There are two parts:</div>

<div><br></div><div>1. Add some code that evaluates a given 3-arg boolean expression at each of the 2^3 == 8 values, creating an 8-bit index.</div><div><br></div><div>2. Create a table of 2^8 == 256 entries (not *too* much work to do by hand) which has the "preferred" representation for each boolean function of 3 variables.</div>

<div><br></div><div>Then, you just use the 8-bit index to look in the table for the "preferred" form of the expression. This approach could get a lot of "bang for your buck" without much code complexity or implementation difficulty.</div>

<div><br></div><div>The same could be done for 2-variable expressions easily (might be a good starting point). For 4-variable expressions, it might be more difficult since the table would need 2^(2^4) == 16k entries.</div>
<div class="">
<div><br></div></div></div></div></div></blockquote><div><br></div><div>Ok. Sounds good. I will try to come up with a patch. Thanks for the suggestions.  </div></div><br><br clear="all"><div><br></div>-- <br>With regards,<br>
Suyog<br>
</div></div>