title: Recursive hypothesis-building with ambiguites - what's it called?
body: <p>There's a problem I've encountered a lot (in the broad fields of data analyis or AI). However I can't name it, probably because I don't have a formal CS background. Please bear with me, I'll give two examples:</p>
  
  <p>Imagine natural language parsing:</p>
  
  <pre><code>The flower eats the cow.
  </code></pre>
  
  <p>You have a program that takes each word, and determines its type and the relations between them. There are two ways to interpret this sentence:</p>
  
  <pre><code>1) flower (substantive) -- eats (verb) --&gt; cow (object)
  </code></pre>
  
  <p>using the usual SVO word order, or</p>
  
  <pre><code>2) cow (substantive) -- eats (verb) --&gt; flower (object)
  </code></pre>
  
  <p>using a more poetic world order. The program would rule out other possibilities, e.g. "flower" as a verb, since it follows "the". It would then rank the remaining possibilites: 1) has a more natural word order than 2), so it gets more points. But including the world knowledge that flowers can't eat cows, 2) still wins. So it might return both hypotheses, and give 1) a score of 30, and 2) a score of 70.</p>
  
  <p>Then, it remembers both hypotheses and continues parsing the text, branching off. One branch assumes 1), one 2). If a branch reaches a contradiction, or a ranking of ~0, it is discarded. In the end it presents ranked hypotheses again, but for the whole text.</p>
  
  <hr>
  
  <p>For a different example, imagine optical character recognition:</p>
  
  <pre><code>   **      **
     **      **  *****
     **   *******
   *******   **
  *  **      **
     **      **
  </code></pre>
  
  <p>I could look at the strokes and say, sure this is an "H". After identifying the H, I notice there are smudges around it, and give it a slightly poorer score.</p>
  
  <p>Alternatively, I could run my smudge recognition first, and notice that the horizontal line looks like an artifact. After removal, I recognize that this is <code>ll</code> or <code>Il</code>, and give it some ranking.</p>
  
  <p>After processing the whole image, it can be <code>Hlumination</code>, <code>lllumination</code> or <code>Illumination</code>. Using a dictionary and the total ranking, I decide that it's the last one.</p>
  
  <hr>
  
  <ul>
  <li>The general problem is always some kind of parsing / understanding. Examples:
  <ul>
  <li>Natural languages or ambiguous languages</li>
  <li>OCR</li>
  <li>Path finding</li>
  <li>Dealing with ambiguous or incomplete user imput - which interpretations make sense, which is the most plausible?</li>
  </ul></li>
  <li>I'ts recursive.</li>
  <li>It can bail out early (when a branch / interpretation doesn't make sense, or will certainly end up with a score of 0). So it's probably some kind of backtracking.</li>
  <li><em>It keeps all options in mind in light of ambiguities.</em></li>
  <li>It's based off simple rules at the bottom <code>can_eat(cow, flower) = true</code>.</li>
  <li>It keeps a plausibility ranking of interpretations.</li>
  <li>It's recursive on a meta level: It can fork / branch off into different 'worlds' where it assumes different hypotheses when dealing with the next part of data.</li>
  <li>It'll forward the individual rankings, probably using bayesian probability, to dependent hypotheses.</li>
  <li>In practice, there will be methods to train this thing, determine ranking coefficients, and there will be cutoffs if the tree becomes too big.</li>
  </ul>
  
  <p>I have no clue what this is called. One might guess 'decision tree' or 'recursive descent', but I know those terms mean different things.</p>
  
  <p>I know Prolog can solve simple cases of this, like genealogies and finding out who is whom's uncle. But you have to give all the data in code, and it doesn't seem convienent or powerful enough to do this for my real life cases.</p>
  
  <p>I'd like to know, what is this problem called, are there common strategies for dealing with this? Is there good literature on the topic? Are there libraries for ideally C(++), Python, were you can just define a bunch of rules, and it works out all the rankings and hypotheses?</p>