Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What I understand you're asking for is a set of expressions, each of which implies the input. That is, if any of those expressions is true, then the input is true.</p> <p>Putting it that way, we can see that what we're doing it rewriting the input into a big disjunction, and then listing the terms. In other words, you're looking to rewrite your input into a <a href="http://en.wikipedia.org/wiki/Disjunctive_normal_form" rel="nofollow">Disjunctive normal form</a>. Wikipedia tells us that "All logical formulas can be converted into disjunctive normal form. However, in some cases conversion to DNF can lead to an exponential explosion of the formula."</p> <p>So: if you have an "or" at the top, return a set of all the children (you can apply this algo recursively to each of them). If you have an "and" at the top, run this recursively for each children and then return all combinations of "and"ing one of the options for each children.</p> <p>So for example if you have (A|B|C) that gives you A,B,C as the answers. If you have (A &amp; (B|C)) then you get just A for the left child, and B,C for the right child. So putting them together you get the two answers: A&amp;B and A&amp;C.</p> <p>And if you have a "not", you can use De Morgan's law to push it in, so you can keep on using the two rules above.</p> <p>P.S. I'm answering "how to get all answers" which is what your text asks, as opposed to "how to get the smallest answer" which is what the title asks. It's an easy step to consider all the answers and pick the smallest one.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload