A customer, C, can send a request to a vendor, V, to buy an item, X, that the customer needs and believes the vendor sells. Then the customer takes the role of negotiator with the vendor.A negotiating customer with a set, S, of negotiated attributes of the desired item, X, either receives an offer of a new attribute, A, or it receives a request to commit to the current set of negotiated attributes and replies with the constrants, CA, it wishes to impose on those attributes. In the scenario of purchasing a computer, A could represent, for example, the size of the monitor.A vendor, V, receives a request from a customer, C, to buy an item, X; then takes the role of negotiator with the customer over the attribute set, S, that applies to that item. A negotiating vendor with a set, S, of negotiable attributes of the desired item, X, either takes the first attribute, A, of S and offers it to the customer for acceptance, or if S is empty it asks the customer to commit to the attributes they have discussed and receives the customer's constraints, CA, on the final values of those attributes. If these are satisfiable, it informs the customer of the final attribute values, F, for the sold item.
// Written by Dave Robertson // // LCC Specification for a customer and vendor negotiation: a(customer,C):: ask(buy(X)) => a(vendor,V) <- need(X) and sells(X,V) then a(neg_customer(X,V,[]),C) a(neg_customer(X,V,S),C):: ( offer(A) <= a(neg_vendor(X,C,_),V) then accept(A) => a(neg_vendor(X,C,_),V) <- acceptable(A) then a(neg_customer(X,V,[att(A)|S],C) ) or ( ask(commit) <= a(neg_vendor(X,C,_),V) then tell(commit(S,CA)) => a(neg_vendor(X,C,_),V) <- choose(S,CA) then tell(sold(F)) <= a(neg_vendor(X,C,_),V) ) a(vendor,V):: ask(buy(X)) <= a(customer,C) then a(neg_vendor(X,C,S),V) <- attributes(X,S) a(neg_vendor(X,C,S),V):: ( offer(A) <= a(neg_customer(X,V,_),C) <- S=[A|T] and available(A) then accept(A) => a(neg_customer(X,V,_),C) then a(neg_vendor(X,C,T),V) ) or ( ask(commit) => a(neg_customer(X,V,_),C) <- S = [] then tell(commit(F,CA)) <= a(neg_customer(X,V,_),C) then tell(sold(F)) => a(neg_customer(X,V,_),C) <- CA )
