WS Presentations Main Page
Simple server:
:- module(popserver,[population/2,stop/0],ciao(h)).
:- ensure_loaded('filebased_server_locator.cl').
population(spain,40).
population(germany,80).
population(italy,60).
stop :- halt.
:- save_addr_active_module(simple_server).
Simple client:
:- module(simple_client,_,ciao(h)).
:- use_active_module(popserver,[population/2,stop/0]).
:- ensure_loaded('filebased_server_locator.cl').
pop(X,Y) :- population(X,Y).
add_pop(S) :- findall(P,pop(_,P),L), sumlist(L,S).
sumlist([],0).
sumlist([X|T],S) :-
sumlist(T,S1),
S is X + S1.