This is a reaction to <br><a href="http://blog.athico.com/2011/04/drools-back-chaining-unification-syntax.html" target="_blank">http://blog.athico.com/2011/04/drools-back-chaining-unification-syntax.html</a><br><br><div class="gmail_quote">
Let me begin with a short statement on what we (I&#39;m not alone, here, at my company)<br>think makes a SW product (especially a programming language) attractive: we might<br>
call it &quot;quality of service&quot;. One of the more important aspects of this concept<br>
is the degree of support the programming environment provides for programmers,<br>especially when we consider that programmers are human, of various levels<br>of skill and (temporarily) subject to anything from heat to migraine. Getting good<br>
diagnostics for as many errors as possible is one way of meeting this expectancy,<br>knowing that the earlier one detects an error the cheaper it is. Finally, we have also <br>frequently observed that implementors of some programming environment<br>


rarely are confronted with its real world deployment; moreover, there&#39;s<br>also the issue that certain application areas are subject to requirements that<br>cherish a very high level of reliability (but not based on human factors). The last<br>
sentence should not be understood as a criticism for members on any<br>particular team - it&#39;s merely saying that nobody knows it all.<br>

<br><br>The problem that Mark addresses in the blog is actually very simple.<br><br>Up to now, we simply have the binding of a variable to some fact or field,<br>which is written as<br>   <i>Identfier </i><b>:</b><br>and indicates the introduction of a new identifier within the current scope.<br>


The DRL parser is capable of detecting the reference of an undeclared<br>identifier, and the DRL parser will duly notify you if you try to bind an<br>already bound identifier. A bound identifier can be used freely, LHS and<br>


RHS, but always in an expression.<br><br>Backward Chaining (BC) introduces the need for unification, which, of course,<br>is an algorithm and not (primarily) an issue of syntax. We need a way of<br>associating an identifier with any argument of the (new) query invocation<br>


or a field of a a pattern, both in the legacy (&quot;named&quot;) and in the newly<br>introduced &quot;positional&quot; form.<br><br>Sticking to  <i>&quot;Identfier </i><b>:&quot; </b>throughout means that there is no way of detecting<br>


undeclared or duplicate usage. <br><br>Therefore, we propose -- for the &quot;named&quot; form to use<br><ul><li><i>Identfier </i><b>: </b><i>fieldname  </i><b>  </b>for binding / unifying an identifier for the first time, and <br>


</li><li><i>Identfier </i><b>= </b><i>fieldname   </i><b>  </b>for all successive unification references</li></ul> (Notice that no semantics regarding the in or out usage is implied.) For the<br>&quot;positional&quot; form, we propose to use<br>


<ul><li><i>Identfier </i><b>:    </b>for binding / unifying an identifier for the first occurrence, and</li><li>just    <i>Identfier    </i>for all following occurrences,</li><li>and (optionally, but probably useful) just a colon  <b>:  </b>for the &quot;anonymous&quot; variable, <br>


</li></ul><br>Traditional binding remains as it is; using &quot;bound&quot; variables in expressions is not<br>affected; all checks made in 5.1. can be continued.<br><br>The additional colon for positional declarative unification should not be a hardship,<br>


especially when we consider the nice analogy to the anonymous variable being <br>written with an &quot;empty&quot; name.<br><br>For Drools programmers, the only &quot;price&quot; to pay is the &quot;=&quot; whenever they <i>use an already<br>


bound or unified variable</i>. Well, safety belts have to be put on... <br><br>A last remark: Notations using a minimum of symbols and syntactic variants are<br>indeed more pleasing to the eye, especially when presented in small examples. The<br>
real test, however, is whether it can stand up to being used in more demanding situations. <br>

<br>Cheers<br>-W<br><br><br><br><div class="gmail_quote">On 22 April 2011 17:06, Mark Proctor <span dir="ltr">&lt;<a href="mailto:mproctor@codehaus.org" target="_blank">mproctor@codehaus.org</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;">


Based on the previous BC thread I&#39;ve written a blog to try and get more<br>
engagement. I&#39;ve put this  under a new thread as the other one was<br>
getting quite long.<br>
<a href="http://blog.athico.com/2011/04/drools-back-chaining-unification-syntax.html" target="_blank">http://blog.athico.com/2011/04/drools-back-chaining-unification-syntax.html</a><br>
<br>
Mark<br>
<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org" target="_blank">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>
</blockquote></div>
</div><br>