hehe, so I walked into this one with my eyes wide shut :)<br><br>Given it is only possible to define implicit logical AND&#39;s between field constraints within a decision table and given it is not possible to introduce complexity with parenthesis, is the immediate problem domain smaller than the more generalised discussion surrounding &quot;otherwise&quot; or &quot;else&quot;?<br>
<br>The first limitation can be overcome by converting multiple single field constraints on the same field to a single compound field constraint on the same field; thus:-<br><br>r1:   age &gt; 14, age &lt;= 28 (i.e. age &gt; 14 &amp;&amp; &lt;= 28) becomes<br>
rx:   age &lt;= 14 || &gt; 28<br><br>I wonder whether this problem cannot simply be resolved with application of DeMorgan&#39;s Theorems (something I know a little about from studying electronics as a student years ago).<br>
<br>Unlike some commentators I am not an expert in first order logic, and 
therefore would appreciate guidance if people are willing to help.<br>
<br>Thanks,<br><br>Mike<br><br><div class="gmail_quote">On 1 April 2011 07:02, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Michael,<br>
<br>
My position is that an otherwise for a single column is likely to<br>
cause trouble by misunderstandings. Especially the operators &gt;, &gt;=, &lt;,<br>
&lt;= are likely to be used to separate intervals, as in<br>
r1:   age &gt; 14, age &lt;= 28<br>
r2:   age &gt; 28, age &lt;= 42<br>
<br>
If you apply the proposed definition, the otherwise results in<br>
rx:   age &lt;= 14, age &gt; 42<br>
which is obviously never true.<br>
<br>
You can construct similar blackouts with two different fields, e.g.<br>
r1:   age &gt; 60, income &gt; 100000<br>
r2:   age &gt; 40, income &gt; 80000<br>
<br>
You will have to do an in-depth analysis of the AST resulting from the<br>
condition definition resulting from rule table lines $n+2 and $n+3 in<br>
order to get it right.<br>
<br>
My opinion is: Don&#39;t do it unless you can do it right.<br>
<br>
Cheers<br>
<font color="#888888">Wolfgang<br>
</font><br>
PS: I could provide a definition for otherwise with matches and<br>
soundslike, but I&#39;d rather not.<br>
<div><div></div><div class="h5"><br>
<br>
On 31 March 2011 21:25, Michael Anstis &lt;<a href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; I&#39;m adding support for &quot;otherwise&quot; to (for the time being) the guided<br>
&gt; decision table in Guvnor.<br>
&gt;<br>
&gt; The idea being if you set a cell to represent &quot;otherwise&quot; the generated rule<br>
&gt; is the opposite of the accumulation of the other cells; perhaps best<br>
&gt; explained with an example:-<br>
&gt;<br>
&gt; Person( name == )<br>
&gt; Mark<br>
&gt; Kris<br>
&gt; Geoffrey<br>
&gt; &lt;otherwise&gt;<br>
&gt;<br>
&gt; This would generate:-<br>
&gt;<br>
&gt; Person(name not in (&quot;Mark&quot;, &quot;Kris&quot;, &quot;Geoffrey&quot;)<br>
&gt;<br>
&gt; Equals is the simple example, this is my thoughts for the other operators we<br>
&gt; might like to support:-<br>
&gt;<br>
&gt; != becomes &quot;in (&lt;list of the other cells&#39; values)&quot;<br>
&gt; &lt; becomes &quot;&gt;= the maximum value of the other cells&#39; values<br>
&gt;<br>
&gt; For example:-<br>
&gt;<br>
&gt; Person ( age &lt; )<br>
&gt; 10<br>
&gt; 20<br>
&gt; 30<br>
&gt; &lt;otherwise&gt;<br>
&gt;<br>
&gt; Person ( age &gt;= 30 )<br>
&gt;<br>
&gt; &lt;= becomes &quot;&gt; the maximum value of the other cells&#39; values<br>
&gt;&gt; becomes &quot;&lt;= the minimum value of the other cells&#39; values<br>
&gt;&gt;= becomes &quot;&lt; the minimum value of the other cells&#39; values<br>
&gt; &quot;in&quot; becomes &quot;not in (&lt;a list of all values contained in all the other<br>
&gt; cells&#39; lists of values&gt;)&quot;<br>
&gt;<br>
&gt; For example:-<br>
&gt;<br>
&gt; Person ( name in )<br>
&gt; Jim, Jack<br>
&gt; Lisa, Jane, Paul<br>
&gt; &lt;otherwise&gt;<br>
&gt;<br>
&gt; Person ( name not in (&quot;Jim&quot;, &quot;Jack&quot;, &quot;Lisa&quot;, &quot;Jane&quot;, &quot;Paul&quot; ) )<br>
&gt;<br>
&gt; I&#39;m not sure there is a simple solution for &quot;matches&quot; and &quot;soundslike&quot; but<br>
&gt; welcome advice, although a possibility might be to create a compound field<br>
&gt; constraint:-<br>
&gt;<br>
&gt; Person ( name soundslike )<br>
&gt; Fred<br>
&gt; Phil<br>
&gt;<br>
&gt; not Person ( name soundslike &quot;Fred&quot; || soundslike &quot;Phil&quot; )<br>
&gt;<br>
&gt;<br>
&gt; Would this be considered the most suitable approach?<br>
&gt;<br>
&gt; Inputs and thoughts welcome.<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Mike<br>
&gt;<br>
&gt;<br>
</div></div><div><div></div><div class="h5">&gt; _______________________________________________<br>
&gt; rules-dev mailing list<br>
&gt; <a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
&gt;<br>
&gt;<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</div></div></blockquote></div><br>