% 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 }). % n3 is the public actor-demo node. % The shared actor predicates are in shared_db_actor_common.pl. This overlay % holds only n3-specific predicates: the deployment marker and the % mortal/human chain that the tutorial's distributed proof tree pulls % through to n4. :- dynamic mortal/1, human/1. mortal(X) :- human(X). human(socrates). human(X) :- rpc('https://n4.elfenbenstornet.se', human(X)). % Shared database used by example 13 shared-database.xml. shared_fact(n3_shared_db). % The statechart datamodel defines local_label/1 too. Its local definition % shadows this shared one while the chart is running. local_label(n3_shared_db). shared_transition_enabled.