How to translate formulas into form of natural language?
<p>I am recently working on a project aiming at evaluating whether an android app crashes or not. The evaluation process is </p>

<pre><code>  1.Collect the logs(which record the execution process of an app).
  2.Generate formulas to predict the result
    (formulas is generated by GP)
  3.Evaluate the logs by formulas 
</code></pre>

<p><br><br>
Now I can produce formulas, but for convenience for users, I want to translate formulas into form of natural language and tell users why crash happened.(I think it looks like "inverse natural language processing".)</p>

<p>To explain the idea more clearly, imagine you got a formula like this:</p>

<pre><code>  155 - count(onKeyDown) &gt;= 148
</code></pre>

<p>It's obvious that if count(onKeyDown) > 7, the result of "155 - count(onKeyDown) >= 148" is false, so the log contains more than 7 onKeyDown event would be predicted "Failed".</p>

<p>I want to show users that if onKeyDown event appears more than 7 times(155-148=7), this app will crash.</p>

<p>However, the real formula is much more complicated, such as:</p>

<pre><code>  (&lt; !( ( SUM( {Att[17]}, Event[5]) &lt;= MAX( {Att[7]}, Att[0] &gt;= Att[11]) OR SUM( {Att[17]}, Event[5]) &gt; MIN( {Att[12]}, 734 &gt; Att[19]) ) OR count(Event[5]) != 1 ) &gt; (&lt; count(Att[4] = Att[3]) &gt;= count(702 != Att[8]) + 348 / SUM( {Att[13]}, 641 &lt; Att[12]) mod 587 - SUM( {Att[13]}, Att[10] &lt; Att[15]) mod MAX( {Att[13]}, Event[2]) + 384 &gt; count(Event[10]) != 1))
</code></pre>

<p>I tried to implement this function by C++, but it's quite difficult, <a href="http://homepage.ntu.edu.tw/~b98901160/question/printNatural.cpp" rel="nofollow">here's the snippet of code</a> I am working right now.</p>

<p>Does anyone knows how to implement this function quickly?(maybe by some tools or research findings?)Any idea is welcomed: )</p>

<p>Thanks in advance.</p>
