This doesn&#39;t seem to be quite correct.<br><ul><li>There&#39;s a fact &quot;location&quot; and another one &quot;Location&quot; - are they the same?</li><li>Query &quot;look&quot; is defined; query &quot;look2&quot; is referenced.</li>
<li>How is the fact L/location defined?</li></ul>Regards<br>Wolfgang<br><br><br><br><br><div class="gmail_quote">On 18 April 2011 16:57, Mark Proctor <span dir="ltr">&lt;<a href="mailto:mproctor@codehaus.org">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;">Here is a more friendly example based around &quot;Adventures in Proglog&quot;&#39;s<br>
&quot;Nani Search&quot;. This is just a sampling of queries and rules, which it<br>
uses to provide an adventure like game environment. The &quot;?&quot; means to<br>
pull results, rather than the normal reactive nature of patterns.<br>
<a href="http://www.amzi.com/AdventureInProlog/" target="_blank">http://www.amzi.com/AdventureInProlog/</a><br>
<br>
query niceFood( String thing, String location )<br>
     location(thing, location) and<br>
     edible(thing)<br>
end<br>
<br>
query connect( String x, String y )<br>
     door(x, y;)<br>
     or<br>
     door(y, x;)<br>
end<br>
<br>
query look(String place, List things, List exits)<br>
     things : List() from accumulate( Location(thing, place;) ,<br>
<br>
collectList( thing ) )<br>
     food : List() from accumulate( ?niceFood(thing, place;) ,<br>
                                                         collectList(<br>
thing ) )<br>
     exits : List() from accumulate( ?connect(place, exit;) ,<br>
                                                          collectList(<br>
[place, exit] ) )<br>
end<br>
<br>
rule reactiveLook when<br>
     Here( place : location)<br>
     ?look2(place, things, exits)<br>
then       System.out.println( &quot;  You are in the &quot; + place );<br>
     System.out.println( &quot;  You can see &quot; + things );<br>
     System.out.println( &quot;     You can eat&quot; + eat );<br>
     System.out.println( &quot;     You can go to &quot; + exits );<br>
end<br>
<br>
-----Output----<br>
   You are in the kitchen<br>
      You can see [crackers, broccoli, apple]<br>
      You can eat[crackers, apple]<br>
      You can go to [[kitchen, dining room], [kitchen, cellar]]<br>
<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>
</blockquote></div><br>