<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    On 04/04/2011 13:44, Wolfgang Laun wrote:
    <blockquote
      cite="mid:BANLkTikhrxgJ0ixNb0xenO8beN+3nPn9hg@mail.gmail.com"
      type="cite">Fair enough.<br>
      <br>
      Presumably this will only be documented with Guvnor - if at all
      ;-)<br>
    </blockquote>
    We do hope to eventually have excel round tripping. So OTHERWISE
    will need to be treated as a special keyword there.<br>
    <blockquote
      cite="mid:BANLkTikhrxgJ0ixNb0xenO8beN+3nPn9hg@mail.gmail.com"
      type="cite"><br>
      This way it will not confuse users writing their spreadsheets
      manually, which was my primordial fear.<br>
      <br>
      Thanks for you patience, Michael!<br>
      Wolfgang<br>
      <br>
      <br>
      <div class="gmail_quote">On 4 April 2011 13:35, Michael Anstis <span
          dir="ltr">&lt;<a moz-do-not-send="true"
            href="mailto:michael.anstis@gmail.com">michael.anstis@gmail.com</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="border-left: 1px solid
          rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
          1ex;">
          I've spoken to Mark about his direction on this can of works I
          fell into ;-)<br>
          <br>
          What has been added to Guvnor's guided decision table is the
          simple ability to add "else\otherwise" values to single field
          constraints that use literal values and either the equality or
          inequality operator. There are hooks in the code to add future
          support for other operators at the single field constraint
          level - not composite field constraint (I'm taking the
          implicit "and" between single field constraints to imply
          compound field constraints on a single pattern too). It is not
          pretending to be the much more generalised and further
          reaching "else\otherwise" at the whole rule level. For this I
          will wait until the underlying rule engine provides it "out of
          the box" - if ever.<br>
          <br>
          With kind regards,<br>
          <br>
          Mike
          <div>
            <div class="h5"><br>
              <br>
              <div class="gmail_quote">On 1 April 2011 11:54, Wolfgang
                Laun <span dir="ltr">&lt;<a moz-do-not-send="true"
                    href="mailto:wolfgang.laun@gmail.com"
                    target="_blank">wolfgang.laun@gmail.com</a>&gt;</span>
                wrote:<br>
                <blockquote class="gmail_quote" style="border-left: 1px
                  solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex;
                  padding-left: 1ex;">
                  Hello Michael,<br>
                  <br>
                  <div class="gmail_quote">
                    <div>On 1 April 2011 09:01, Michael Anstis <span
                        dir="ltr">&lt;<a moz-do-not-send="true"
                          href="mailto:michael.anstis@gmail.com"
                          target="_blank">michael.anstis@gmail.com</a>&gt;</span>
                      wrote:<br>
                      <blockquote class="gmail_quote"
                        style="border-left: 1px solid rgb(204, 204,
                        204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
                        1ex;">
                        hehe, so I walked into this one with my eyes
                        wide shut :)<br>
                        <br>
                        Given it is only possible to define implicit
                        logical AND'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 "otherwise"
                        or "else"?<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: &nbsp; age &gt; 14, age &lt;= 28 (i.e. age &gt;
                        14 &amp;&amp; &lt;= 28) becomes<br>
                        rx:&nbsp;&nbsp; age &lt;= 14 || &gt; 28<br>
                        <br>
                        I wonder whether this problem cannot simply be
                        resolved with application of DeMorgan's Theorems
                        (something I know a little about from studying
                        electronics as a student years ago).<br>
                      </blockquote>
                    </div>
                    <div><br>
                      Attaboy!<br>
                      &nbsp;</div>
                    <div>
                      <blockquote class="gmail_quote"
                        style="border-left: 1px solid rgb(204, 204,
                        204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
                        1ex;">
                        <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>
                      </blockquote>
                    </div>
                    <div><br>
                      Well, the point is that you can come up with
                      pretty nasty constraints even without parentheses:<br>
                      <br>
                      &nbsp;&nbsp; a &gt; $1 &amp;&amp; != $2 &amp;&amp; &lt;
                      $3&nbsp;&nbsp;&nbsp; # implicit assumption: $1 &lt; $2 &lt; $3<br>
                      <br>
                      Of course, de Morgan will help you here, too, but
                      you'll have to develop some hefty symbolic
                      expression handling.<br>
                      <br>
                      If expressions E<font size="1">1<font size="2">, E<font
                            size="1">2<font size="2">, are the combined
                              logical expressions for some field from
                              rules r1, r2,..., the "otherwise"
                              condition is<br>
                              <br>
                              &not; ( </font></font></font></font>E<font
                        size="1">1<font size="2"> || E<font size="1">2</font></font></font>
                      || ... ) =<br>
                      <font size="1"><font size="2"><font size="1"><font
                              size="2">&not; </font></font></font></font>E<font
                        size="1">1 &amp;&amp; </font><font size="1"><font
                          size="2"><font size="1"><font size="2">&not; </font></font></font></font><font
                        size="1"><font size="2">E<font size="1">2
                            &amp;&amp; ...<br>
                            <font size="2"><br>
                              and you continue to apply de Morgan's laws
                              to all E<font size="1">i<font size="2">.<br>
                                </font></font></font></font></font></font><br>
                      <font size="1"><font size="2"><font size="1"><font
                              size="2"><font size="1"><font size="2">But
                                  what about the very natural constraint
                                  combination of two or more fields as
                                  in my age/income example?<br>
                                  <br>
                                </font></font></font></font></font></font><font
                        size="1"><font size="2"><font size="1"><font
                              size="2"><font size="1"><font size="2">Perhaps
                                  an entirely different approach should
                                  be considered, too. I'm thinking of a
                                  generic mechanism, which would have to
                                  gain control before any rule from a
                                  certain rule table is executed for
                                  another fact or set of facts. Then you
                                  could inspect all pending activations,
                                  and whenever you have one for a rule
                                  without an "otherwise" in a column it
                                  should discard any activations for the
                                  same fact set for rules with an
                                  "otherwise" in that column. I think
                                  this could be done from an agenda
                                  listener.<br>
                                  <br>
                                  -W<br>
                                  <br>
                                </font></font></font></font></font></font><br>
                      <br>
                      &nbsp;</div>
                    <div>
                      <div>
                        <blockquote class="gmail_quote"
                          style="border-left: 1px solid rgb(204, 204,
                          204); margin: 0pt 0pt 0pt 0.8ex; padding-left:
                          1ex;">
                          <br>
                          Thanks,<br>
                          <br>
                          Mike<br>
                          <br>
                          <div class="gmail_quote">On 1 April 2011
                            07:02, Wolfgang Laun <span dir="ltr">&lt;<a
                                moz-do-not-send="true"
                                href="mailto:wolfgang.laun@gmail.com"
                                target="_blank">wolfgang.laun@gmail.com</a>&gt;</span>
                            wrote:<br>
                            <blockquote class="gmail_quote"
                              style="border-left: 1px solid rgb(204,
                              204, 204); margin: 0pt 0pt 0pt 0.8ex;
                              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: &nbsp; age &gt; 14, age &lt;= 28<br>
                              r2: &nbsp; age &gt; 28, age &lt;= 42<br>
                              <br>
                              If you apply the proposed definition, the
                              otherwise results in<br>
                              rx: &nbsp; 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: &nbsp; age &gt; 60, income &gt; 100000<br>
                              r2: &nbsp; 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'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'd rather not.<br>
                              <div>
                                <div><br>
                                  <br>
                                  On 31 March 2011 21:25, Michael Anstis
                                  &lt;<a moz-do-not-send="true"
                                    href="mailto:michael.anstis@gmail.com"
                                    target="_blank">michael.anstis@gmail.com</a>&gt;
                                  wrote:<br>
                                  &gt; Hi,<br>
                                  &gt;<br>
                                  &gt; I'm adding support for
                                  "otherwise" 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 "otherwise" 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 ("Mark",
                                  "Kris", "Geoffrey")<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 "in (&lt;list of the
                                  other cells' values)"<br>
                                  &gt; &lt; becomes "&gt;= the maximum
                                  value of the other cells' 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 "&gt; the maximum
                                  value of the other cells' values<br>
                                  &gt;&gt; becomes "&lt;= the minimum
                                  value of the other cells' values<br>
                                  &gt;&gt;= becomes "&lt; the minimum
                                  value of the other cells' values<br>
                                  &gt; "in" becomes "not in (&lt;a list
                                  of all values contained in all the
                                  other<br>
                                  &gt; cells' lists of values&gt;)"<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 ("Jim",
                                  "Jack", "Lisa", "Jane", "Paul" ) )<br>
                                  &gt;<br>
                                  &gt; I'm not sure there is a simple
                                  solution for "matches" and
                                  "soundslike" 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
                                  "Fred" || soundslike "Phil" )<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>&gt;
                                  _______________________________________________<br>
                                  &gt; rules-dev mailing list<br>
                                  &gt; <a moz-do-not-send="true"
                                    href="mailto:rules-dev@lists.jboss.org"
                                    target="_blank">rules-dev@lists.jboss.org</a><br>
                                  &gt; <a moz-do-not-send="true"
                                    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 moz-do-not-send="true"
                                    href="mailto:rules-dev@lists.jboss.org"
                                    target="_blank">rules-dev@lists.jboss.org</a><br>
                                  <a moz-do-not-send="true"
                                    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>
                          <br>
_______________________________________________<br>
                          rules-dev mailing list<br>
                          <a moz-do-not-send="true"
                            href="mailto:rules-dev@lists.jboss.org"
                            target="_blank">rules-dev@lists.jboss.org</a><br>
                          <a moz-do-not-send="true"
                            href="https://lists.jboss.org/mailman/listinfo/rules-dev"
                            target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
                          <br>
                        </blockquote>
                      </div>
                    </div>
                  </div>
                  <br>
                  <br>
                  _______________________________________________<br>
                  rules-dev mailing list<br>
                  <a moz-do-not-send="true"
                    href="mailto:rules-dev@lists.jboss.org"
                    target="_blank">rules-dev@lists.jboss.org</a><br>
                  <a moz-do-not-send="true"
                    href="https://lists.jboss.org/mailman/listinfo/rules-dev"
                    target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
                  <br>
                </blockquote>
              </div>
              <br>
            </div>
          </div>
          <br>
          _______________________________________________<br>
          rules-dev mailing list<br>
          <a moz-do-not-send="true"
            href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
          <a moz-do-not-send="true"
            href="https://lists.jboss.org/mailman/listinfo/rules-dev"
            target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
          <br>
        </blockquote>
      </div>
      <br>
      <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>