% Common shared database loaded by every deployment node. % Holds the family relations used in the tutorial's local and distributed % Prolog sections. ancestor_descendant(X, Y) :- parent_child(X, Y). ancestor_descendant(X, Z) :- parent_child(X, Y), ancestor_descendant(Y, Z). parent_child(X, Y) :- mother_child(X, Y). parent_child(X, Y) :- father_child(X, Y). mother_child(trude, sally). father_child(tom, sally). father_child(tom, erica). father_child(mike, tom). list_price(widget, 100). list_price(gadget, 250). list_price(gizmo, 400). price(Item, Price) :- list_price(Item, Price). % Shared database loaded by all ACTOR-profile deployment nodes (n3, n4). % Holds the actor predicates that the tutorial expects to find on either % public actor node, plus the public service directory. service(counter, meta(actor, protocol(count_v1))). service(pubsub_service, meta(actor, protocol(pubsub_v1))). echo_actor :- receive({ echo(From, Msg) -> From ! echo(Msg), echo_actor }). count_actor(Count0) :- receive({ count(From) -> Count is Count0 + 1, From ! count(Count), count_actor(Count) ; stop -> true }). % n4 is the second public actor-demo node. % The shared actor predicates are in shared_db_actor_common.pl. This overlay % holds only n4-specific predicates: the deployment marker and the human/1 % facts that n3's distributed proof tree pulls in over rpc/2-3. :- dynamic human/1. human(plato). human(aristotle). % Shared database used by example 13 shared-database.xml. shared_fact(n4_shared_db). % The statechart datamodel defines local_label/1 too. Its local definition % shadows this shared one while the chart is running. local_label(n4_shared_db). shared_transition_enabled.