<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
On 18/04/2011 17:08, Wolfgang Laun wrote:
<blockquote
cite="mid:BANLkTinkQaKqNmymbJYTqW6+etui4ywFYA@mail.gmail.com"
type="cite">This doesn't seem to be quite correct.<br>
<ul>
<li>There's a fact "location" and another one "Location" - are
they the same?</li>
</ul>
</blockquote>
that misses something, it was just a sample of queries. I had a
location query that maps to the Location fact.<br>
"query location( String thing, String location ) \n" +<br>
"
org.drools.integrationtests.BackwardChainingTest.Location( thing :
thing, location : location ) \n"+<br>
"end\n" + <br>
<br>
That shouldn't be needed after the changes sotty jsut did to allow
positional of Fact patterns too.<br>
<blockquote
cite="mid:BANLkTinkQaKqNmymbJYTqW6+etui4ywFYA@mail.gmail.com"
type="cite">
<ul>
<li>Query "look" is defined; query "look2" is referenced.</li>
</ul>
</blockquote>
I already updated the blog.<br>
<blockquote
cite="mid:BANLkTinkQaKqNmymbJYTqW6+etui4ywFYA@mail.gmail.com"
type="cite">
<ul>
<li>How is the fact L/location defined?</li>
</ul>
</blockquote>
There is a single knowlege store, that hasn't changed. it's no
different to the way that standard querries work.<br>
<br>
Mark<br>
<blockquote
cite="mid:BANLkTinkQaKqNmymbJYTqW6+etui4ywFYA@mail.gmail.com"
type="cite">Regards<br>
Wolfgang<br>
<br>
<br>
<br>
<br>
<div class="gmail_quote">On 18 April 2011 16:57, Mark Proctor <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>></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 "Adventures
in Proglog"'s<br>
"Nani Search". This is just a sampling of queries and rules,
which it<br>
uses to provide an adventure like game environment. The "?"
means to<br>
pull results, rather than the normal reactive nature of
patterns.<br>
<a moz-do-not-send="true"
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( " You are in the " + place );<br>
System.out.println( " You can see " + things );<br>
System.out.println( " You can eat" + eat );<br>
System.out.println( " You can go to " + 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 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>
</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>