Thank you so much for your help. In fact running (watch all) I found my
error. I had run a first example using this rules, I had put a rule called
host, and then I changed this rule into hotel. The problem was that my rule
host executed in the correct moment, putting as effects "hotel ok", and at
the end my rule hotel also executed and then printed "hotel services". The
rule host didn't print anything. Thus it was because we could only see
"hotel service" at the end. 

However I have more two questions, the first one I thought that (reset)
clear my knowledge base, I mean, my facts, rules, all things and actually it
doesn't. What is the command I can use to clear my knowledge base? 

More one thing, is there any command that lists all facts before execution,
for example, I only want to know which facts I have put in my knowledge base
before execution.  

Thank you again.
Daniela 



-----Message d'origine-----
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la
part de [EMAIL PROTECTED]
Envoyi : jeudi 3 novembre 2005 20:23
@ : jess-users@sandia.gov
Objet : Re: JESS: Understanding JESS

As you'd expect, this is impossible. It's always fun when impossible things
happen, though, isn't it?

One thing I notice is that number "5" at the end. That's how many rules
fired. But I only would expect four (presumably the same four, in the same
order, that you expect: travel, hotel, rentalcar, and goal. And indeed, the
facts that are asserted seem to be exactly those that you'd expect.

In any case, I ran your problem under Jess 6.1p8 and 7.0b4 and in both cases
I got the expected result; four rules fired, in the order you'd expect, and
the "hotel" output shows up in the right place.

This has been run with "(watch facts)". Can you run it again with "(watch
all)", and show us the output?  Maybe that will give us a clue as to what's
happening.


I think Daniela CLARO wrote:
> Hi everybody,
>  I am a new user of JESS and I am coming from Prolog's world, so I 
> have some misunderstanding using Jess. First of all, I am trying to 
> create a plan that I will have 3 actions: travel, hotel and rentalCar. 
> As I have some preconditions that must be valid in order to execute an 
> action, I want to estabilish a first order. I have only 3 actions 
> because I am trying to understand Jess, so I need to know what exactly 
> they are doing. How can I do the prolog's trace in Jess? Because he 
> shows me only the steps and the result, but if I want to do step by 
> step. I tried to create a batch file, here it is:
> (reset)
> (assert (in paris) (passportValid paris salvador)) (defrule travel 
> "Travel"
>       (in paris)
>       (passportValid paris salvador)
> =>
>       (printout t "Travel service" crlf)
>       (assert (in salvador) (travel ok) (airportArea salvador
> laurofreitas))
> )
> (defrule hotel "Hotel" 
>       (in salvador)
>       (travel ok)
> =>
>       (printout t "Hotel service" crlf)
>       (assert (hotel ok))
> )
> (defrule rentalcar "Rental a car" 
>       (in salvador)
>       (travel ok)
>       (hotel ok)
>       (airportArea salvador laurofreitas)
> =>
>       (printout t "Rental Car service" crlf)
>       (assert (car ok))
> )
> (defrule goal "Aim the goal" 
>       (travel ok)
>       (hotel ok)
>       (car ok)
> =>
>       (printout t "End of the plan" crlf)
> )
> (run)
> When I run it, I receive this answer: 
> Jess> (batch Z:/Implementacao/planning/travel.clp)
>  ==> f-0 (MAIN::initial-fact)
>  ==> f-1 (MAIN::in paris)
>  ==> f-2 (MAIN::passportValid paris salvador) Travel service  ==> f-3 
> (MAIN::in salvador)  ==> f-4 (MAIN::travel ok)  ==> f-5 
> (MAIN::airportArea salvador laurofreitas)  ==> f-6 (MAIN::hotel ok) 
> Rental Car service  ==> f-7 (MAIN::car ok) End of the plan Hotel 
> service
> 5
> 
> The first thing that I do not understand was why it writes "Hotel service"
> at the end if it was executed in the middle as we can see f-6 The next 
> question, I have read about Jess but actually I do not understand what 
> is exactly the best use for deftemplates? I know it is like 
> classes/objects in Java, but in an inference motor where should I use 
> it? In my example here, I thought that I could use, but actually I did 
> not find where I can put it.
> 
> Thanks in advance for all your help. 
> Daniela
> 
> --------------------------------------------------------------------
> To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use 
> your own address!) List problems? Notify [EMAIL PROTECTED]
> --------------------------------------------------------------------
> 



---------------------------------------------------------
Ernest Friedman-Hill  
Advanced Software Research          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 [EMAIL PROTECTED]
Livermore, CA 94550         http://herzberg.ca.sandia.gov

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your
own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------


--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to