From bobylev17@hotmail.com  Sun Apr  9 21:53:43 2000
Received: from hotmail.com (f280.law7.hotmail.com [216.33.236.158])
	by swi.psy.uva.nl (8.9.3/8.9.3) with SMTP id VAA07224
	for <prolog@swi.psy.uva.nl>; Sun, 9 Apr 2000 21:53:43 +0200 (MET DST)
Received: (qmail 97808 invoked by uid 0); 9 Apr 2000 19:53:36 -0000
Message-ID: <20000409195336.97807.qmail@hotmail.com>
Received: from 161.24.1.173 by www.hotmail.com with HTTP;
	Sun, 09 Apr 2000 12:53:36 PDT
X-Originating-IP: [161.24.1.173]
From: "Aleksandr Mikhailovick L." <bobylev17@hotmail.com>
To: prolog@swi.psy.uva.nl
Subject: I want to know the answer too .
Date: Sun, 09 Apr 2000 19:53:36 GMT
Mime-Version: 1.0
Content-Type: text/plain; format=flowed

I want to know what is the answer for the Pedro's Question , everyone know? 
if please send to me a answer ,


Pedro wrote :
>
>
>>hello all , I'm a  self-student of Prolog , i know just a bit of >>Prolog 
>>,and i have to do on program that do this :
>>
>>
>>The Packet problem
>>
>>At the Supermarket a robot have to ckeck one list of thing that one 
>> >>client want and get the things that this client want and put them in a 
>> >>packet but with the right ordem .
>>
>>The things in stock are writing in the following order :
>>
>>    Thing(name, weight,size , fragility)
>>
>>where,
>>
>>name : ladle , yogurt, bread, refreshement, etc... weight: light ,midle , 
>>heavy size : little , normal , great fragility : fragile , no-frafile
>>
>>the things in liquidation can be write :
>>
>>       liquidation(name , quantity)
>>
>>the things in the list are wanted is :
>>
>>          purchase(thing ,quantity)
>>
>>robot have to use "human" heuristic : a)check the complement : - there is 
>>sufficient things in liquidation ? -when you buy yorgut or ice-cream you 
>>have to by the ladle ? - etc.
>>
>>b)packed
>>
>>- all things have to be packed in bags. -things heavy are packed first. 
>>-things  fragile have to be put on the top of the bags. -the last things 
>>to packed are light and little things. - etc .
>>
>>you have to use little bags not much and not one ,  but without >>thinking 
>>and use a absolute minimum. define the follow initial facts: -thing , 
>>liquidation ,purchase.Formule and use things by "shell" .

>>important : the result have to be a list showing what is the >>contents 
>> >>in each bag.
>>
>>-------------------------------
>>
>>Please i dont know much program in prolog , then , if possible ,do 
>> >>simple this program.
>>
>>when i was tryind do this i use things like :
>>
>>first i define the prioraty:
>>
>>:-op(810, xfy, '::'). :-op(808, fx , if  ). :-op(806, xfy ,then). 
>>:-op(804, xfy , and). :-op(802, xfy , or ). :-op(801, xf ,   no).
>>
>>and i try :
>>
>>------------------------------------------------- solve:-initialize 
>>repeat,    apply-rule, goal, writebags.
>>
>>------------------------------------------------- 
>>------------------------------------------------- Apply-rule :- R: if 
>>condition then   action,                 test (condition),                 
>>perform(Action),!. -------------------------------------------------- [ ] 
>>[eggs eggs  coke  coke]
>>
>>---------------------------------- unpacked(coke,5). unpacked(eggs,3). 
>>unpacked(cup,7). -----------------------------------
>>
>>assert(unpacked(coke,5)). assert(unpacked(eggs,3)). .... 
>>------------------------------------ R :: if C then A
>>
>>test(c):   call(A)
>>
>>C1 and C2 :- call(1) , call(2). C1 or C2 :- call(1)  , call(2),
>>
>>------------------------------------ e.g rules rule_3 :: if unpacked(X,N) 
>>then pack (X,N). -----------------------------------
>>
>>thanks ,
>>
>>
>>Pedro
*************************

  thanks ,


   Aleksandr.
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com

