40 likes | 119 Views
Progetto PRIN: Specifica e verifica di protocolli di interazione fra agenti Viviana Mascardi Alessandria, 29-03-06. Publisher side. exec(s('sd FruitMarket',0)) :- exec(s(s('sd FruitMarket',0),0)). exec(s(s('sd FruitMarket',0),0)) :-
E N D
Progetto PRIN: Specifica e verifica di protocolli di interazione fra agenti Viviana Mascardi Alessandria, 29-03-06
exec(s('sd FruitMarket',0)) :- exec(s(s('sd FruitMarket',0),0)). exec(s(s('sd FruitMarket',0),0)) :- traceable_receive('REQUEST','availability_and_price(fruit(F))', 'fruitBuyer@klimt:1099/JADE'), exec(s(s('sd FruitMarket',0),1)). exec(s(s('sd FruitMarket',0),1)) :- check_case_guard_passed(s(s(s('sd FruitMarket',0),1),0),no_guard), !, exec(s(s(s('sd FruitMarket',0),1),0)). exec(s(s(s('sd FruitMarket',0),1),0)) :- exec(s(s(s(s('sd FruitMarket',0),1),0),0)). exec(s(s(s(s('sd FruitMarket',0),1),0),0)) :- traceable_send('INFORM','available(fruit(F),price(EuroForKg))', 'fruitBuyer@klimt:1099/JADE'), exec(s(s(s(s('sd FruitMarket',0),1),0),1)). process( parameters( ontology('FruitMarketOntology'), content_language('first order logic')), protocol_name('sd FruitMarket'), agent_publisher(short_name('fruitSeller@klimt:1099/JADE'), long_name('fs/fruitSeller:fruitSellerClass')), agent_reader(short_name('fruitBuyer@klimt:1099/JADE'), long_name('fb/fruitBuyer:fruitBuyerClass')), main_fragment( seq([ send(msg('REQUEST', 'availability_and_price(fruit(F))')), switch([case(no_guard, seq([receive(msg('INFORM', 'available(fruit(F),price(EuroForKg))')), receive(msg('PROPOSE', 'buy(fruit(F),price(EuroForKg))')), switch([case(no_guard, seq([send(msg('REQUEST', 'delivery_modes')), receive(msg('INFORM', 'delivery_mode(ListOfModes)')), Generated Prolog code Prolog representation Execution in DCaseLP: graphical and textual traces ******************** THE PROTOCOL STARTS ******************** Received message: REQUEST availability_and_price(fruit(F)) fruitBuyer@klimt:1099/JADE Checked case guard: s(s(s('sd FruitMarket',0),1),0) no_guard Sent message: INFORM available(fruit(F),price(EuroForKg)) fruitBuyer@klimt:1099/JADE Sent message: PROPOSE buy(fruit(F),price(EuroForKg)) fruitBuyer@klimt:1099/JADE Checked case guard: s(s(s(s(s('sd FruitMarket',0),1),0),2),0) no_guard Received message: REQUEST delivery_modes fruitBuyer@klimt:1099/JADE Sent message: INFORM delivery_mode(ListOfModes) fruitBuyer@klimt:1099/JADE Received message: REQUEST accepted_payment_methods fruitBuyer@klimt:1099/JADE Sent message: INFORM accepted_payment_methods(ListOfMethods) fruitBuyer@klimt:1099/JADE Checked case guard: s(s(s(s(s(s(s('sd FruitMarket',0),1),0),2),0),4),0) no_guard Received message: ACCEPT-PROPOSAL sell(fruit(F), amount(A), payment_method(M), delivery_mode(D)) fruitBuyer@klimt:1099/JADE *********** THE PROTOCOL TERMINATED SUCCESSFULLY ************ Publisher side
process( parameters( ontology('FruitMarketOntology'), content_language('first order logic')), protocol_name('sd FruitMarket'), agent_publisher(short_name('fruitSeller@klimt:1099/JADE'), long_name('fs/fruitSeller:fruitSellerClass')), agent_reader(short_name('fruitBuyer@klimt:1099/JADE'), long_name('fb/fruitBuyer:fruitBuyerClass')), main_fragment( seq([ send(msg('REQUEST', 'availability_and_price(fruit(F))')), switch([case(no_guard, seq([receive(msg('INFORM', 'available(fruit(F),')), receive(msg('PROPOSE', 'buy(fruit(F),price(E4Kg))')), WSDL + WS-BPEL documents 1 Prolog representation <definitions xmlns="http://schemas.xmlsoap.org/wsdl/" … <types> <xs:schema xmlns="http://www.w3.org/2001/XMLSchema"/> <xs:element name="accept-proposal_ca" type="xs:string“ fixed="accept-proposal"/> <xs:element name="agree_ca" type="xs:string" fixed="agree"/> <xs:element name="cfp_ca" type="xs:string" fixed="cfp"/> <xs:element name="confirm_ca" type="xs:string" fixed="confirm"/> <xs:element name="disconfirm_ca" type="xs:string" fixed="disconf 2 exec(s(s('sd FruitMarket',0),1)) :- check_case_guard_passed(s(s(s('sd FruitMarket',0),1),0),no_guard), exec(s(s(s('sd FruitMarket',0),1),0)). exec(s(s(s('sd FruitMarket',0),1),0)) :- exec(s(s(s(s('sd FruitMarket',0),1),0),0)). exec(s(s(s(s('sd FruitMarket',0),1),0),0)) :- traceable_send('INFORM','available(fruit(F),price(EuroForKg))', 'fruitBuyer@klimt:1099/JADE'), exec(s(s(s(s('sd FruitMarket',0),1),0),1)). Reasoning stage Generated Prolog code 3 4 Execution in DCaseLP ******************** THE PROTOCOL STARTS ******************** Received message: REQUEST availability_and_price(fruit(F)) fruitBuyer@klimt:1099/JADE Checked case guard: s(s(s('sd FruitMarket',0),1),0) no_guard Sent message: INFORM available(fruit(F) fruitBuyer@klimt:1099/JADE Sent message: PROPOSE buy(fruit(F),price(E4Kg)) fruitBuyer@klimt:1099/JADE Checked case guard: s(s(s(s(s('sd FruitMarket',0),1),0),2),0) no_guard Received message: REQUEST delivery_modes fruitBuyer@klimt:1099/JADE Sent message: INFORM delivery_mode(ListOfModes) fruitBuyer@klimt:1099/JADE Received message: REQUEST accepted_payment_methods fruitBuyer@klimt:1099/JADE Sent message: INFORM accepted_payment_methods(ListOfMethods) fruitBuyer@klimt:1099/JADE Checked case guard: s(s(s(s(s(s(s('sd FruitMarket',0),1),0),2),0),4),0) no_guard Received message: ACCEPT-PROPOSAL sell(fruit(F), amount(A), payment_method(M), delivery_mode(D)) fruitBuyer@klimt:1099/JADE *********** THE PROTOCOL TERMINATED SUCCESSFULLY ************