Presentation is loading. Please wait.

Presentation is loading. Please wait.

University of North Texas

Similar presentations


Presentation on theme: "University of North Texas"— Presentation transcript:

1 University of North Texas
Jinni: Intelligent Mobile Agent Programming at the Intersection of Java and Prolog Paul Tarau University of North Texas & BinNet Corporation Copyright © 1999, BinNet Corp.

2 other talk: Blackboard Constraints in Jinni http://www.binnetcorp.com
Paul Tarau University of North Texas & BinNet Corporation Copyright © 1999, BinNet Corp.

3 What is Jinni? JINNI: Java INference engine and Networked Interactor
lightweight, multi-threaded Prolog-style agent scripting language knowledge processing components high level, distributed, Java based: alternative to RMI, CORBA, KQML

4 Motivation paradigm shift towards networked, mobile, ubiquitous computing increasingly complex patterns of interaction reactive and mobile agents inference capabilities, autonomy and self- reliance.

5 BASIC ONTOLOGY: THE USERS' VIEW
Things: represented as Prolog terms Places: server component listening on a port + Linda blackboard Agents: collections of mobile threads running a set of goals at set of Places transporting and processing Things

6 A typical Jinni application
a hierarchy of Places and Agents Agent threads moving between Places wait for/produce Things satisfying constraints sensing changes of state, produce and react to events

7 THE ARCHITECTURE OF JINNI
operatorless syntactic subset of Prolog multiple engines running on separate threads, blackboards to communicate between engines Linda coordination, associative search

8 Architecture of Jinni - details -
high level networking operations: code and compoutation mobility, remote execution Jinni-to-Java translator ability to load code directly from the Web hyothetical reasoning, backtrackable assumptions, Assumption Grammars

9 The Jinni Kernel: Basic Linda + Remote Predicate Calls
out(X): puts X on the blackboard in(X): waits until it can take an object matching X from the blackboard all(X,Xs): reads the list Xs matching X currently on the blackboard the(Pattern,Goal,Answer): runs Goal to produce the(Answer) or no => here/there switch =>local/remote

10 Assertional Constraints vs. Binding Constrains
when nonvar(X) ... when proven(X) … when a_fact(X)… more realistic lower granularity arguably: more appropriate for distributed programming

11 Beyond Linda: Blackboard Constraint Operations
wait_for(Pattern,Constraint): waits for a Pattern on the blackboard, such that Constraint holds, and when this happens, it removes the result of the match from the blackboard notify_about(Pattern): notifies about this Pattern one of the blocked threads which waits for it with a matching constraint

12 Coordination with Blackboard Constraints
?- notify_about(stock_offer(nscp,29)). ?-wait_for(stock_offer(nscp,Price), less(Price,30)).

13 wait_for(Pattern,Constr)
wait_for(P,C):- if(take_pattern(available_for(P),C), true, and(local_out(waiting_for(P,C)), local_in(holds_for(P,C)) ) ).

14 notify_about(Pattern,Constr)
if(take_pattern(waiting_for(P,C),C), local_out(holds_for(P,C)), local_out(available_for(P)) ).

15 take_pattern/2 take_pattern(Pattern,Constraint):-
local_all(Pattern,Ps), member(Pattern,Ps), Constraint, local_cin(Pattern,_).

16 Mobile thread operations
run_server/0, here/0, there/0, where/1 set_this_host/1, set_this_port/1 set_that_host/1,set_that_port/1 move/0, return/0 bg/1, bg/2, thread_clone/1

17 BUILDING BEHAVIORS: BASIC AGENT PROGRAMMING CONSTRUCTS
a reactive channel listener ?-listen(fun(_)). selective channel publisher ?-talk(fun(jokes)). will not match: ?-talk(stocks(quotes,nasdaq))

18 Example: a stock market trader agent
sell(Who,Stock,AskPrice) :- notify_about(offer(Who,Stock,AskPrice)). buy(Who,Stock,SellingPrice) :- bg(try_to_buy(Who,Stock,SellingPrice)). try_to_buy(Me,Stock,LimitPrice) :- wait_for(offer(You,Stock,YourPrice), ……….

19 Examples of Mobile Computations
Window 1: a mobile thread ?- there, move, println(on_server), member(X,[1,2,3]), return, println(back). Window 2: a server ?- run_server.

20 Mobile code vs. RPCs: move once, compute many times
?-for(I,1,1000), remote_run(println(I)), eq(I,1000). ?-there, move, for(I,1,1000), println(I), eq(I,1000).

21 Mobile code: WHY? Large database, small agent
Speed-up: move to a fast processor and back, transparently here/there switch: same code can be run localy or remotely fault tolerance - move->run->come back

22 Emulating multiple answer computations
?- there, move, findall(X,for(I,1,3),Xs), return, member(X,Xs). X=1; X=2; X=3

23 Reflective Meta Interpreter
solve(G):-once(reduce(G,NewG)),NewG. reduce(G,G):-is_builtin(G). reduce(','(A,B),','(solve(A),solve(B))). reduce(G,','(clause(G,Gs),solve(Gs))).

24 MUTUAL AGENT/HOST SECURITY: THE BRING YOUR OWN WINE PRINCIPLE
reflective meta-interpreter: a few lines of Prolog - can be mobile - bring your own! a sandbox can protect the Host against the Agent undecidability of a Turing equivalent meta-interpreter protects the Agent against the Host

25 Ongoing Work Day trader: reactive agent, using Internet data mining for quotes and user defined rules beyond conventional limit/stop/market transactions Network monitoring: new Internet2 infrastructure at UNT, experiments with mobile agents on Gigabit networks Visual Jinni, educational agents

26 Conclusion Synergy between Logic Programming and Java based distributed programming Integrated infrastructure for builting Internet aware, GUI-eanbled, networked Agent components High level software patterns for productivity, reusabilty, quick prototyping


Download ppt "University of North Texas"

Similar presentations


Ads by Google