On the CRON Conjecture Tom J. Ameloot Jan Van den Bussche Hasselt University, Belgium 1 On the CRON Conjecture
Introduction ◮ Declarative networking ◮ Dedalus ◮ Hellerstein: Causality Required Only for Non-monotonicity (CRON) Program semantics require causal message ordering if and only if the messages participate in non-monotonic derivations. ◮ Application to crash-recovery: ◮ Some logged messages are from the “future” (non-causality) ◮ CRON conjecture: enforce causality only when needed ⇒ more efficient 2 On the CRON Conjecture
Typical Operational Semantics Ingredients: network, replicated program, distributed input database Run of the program on the input: � � � ������������� 3 On the CRON Conjecture
Typical Operational Semantics Ingredients: network, replicated program, distributed input database Run of the program on the input: ������� ���� � � � � � � ������������� 3 On the CRON Conjecture
Typical Operational Semantics Ingredients: network, replicated program, distributed input database Run of the program on the input: ������� � ����� ���� ���� � � � � � � � � � ������������� 3 On the CRON Conjecture
Typical Operational Semantics Ingredients: network, replicated program, distributed input database Run of the program on the input: ������� � ����� ������� ���� ���� ���� � � � � � � � � � � � � ������������� 3 On the CRON Conjecture
Typical Operational Semantics Ingredients: network, replicated program, distributed input database Run of the program on the input: ������� � ����� ������� ���� ���� ���� � � � � � � � � � � � � ������������� ◮ Runs have infinite length ◮ Messages are facts ◮ Messages can have arbitrary delay 3 On the CRON Conjecture
Dedalus Local step implemented as follows: ��������� ����� ��������� ���� ����� ���� ����� ����� �������� �������� �������� �� ��� ������������ ����� (Deductive rules: stratified semantics) 4 On the CRON Conjecture
Example Input: on every node, unary rel. R , S and Node Output: on every node x , unary rel. T contains the union of all R -facts except local S -facts of x . (Auxiliary: unary rel. R acc ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . R acc ( u ) ← R ( u ) . R acc ( u ) • ← R acc ( u ) . R ( u ) | y ← R ( u ) , Node ( y ) . T ( u ) ← R acc ( u ) , ¬ S ( u ) . 5 On the CRON Conjecture
Causality Causality: an effect can only happen after its cause Runs are causal ◮ messages can only be delivered after they are sent ◮ replies come after initial messages Happens-before relation: partial order on (nodes × N ) ���� ���� ���� ���� ���� ��� 6 On the CRON Conjecture
Causality Causality: an effect can only happen after its cause Runs are causal ◮ messages can only be delivered after they are sent ◮ replies come after initial messages Happens-before relation: partial order on (nodes × N ) ���� ���� ���� ���� ���� ���� ��� 6 On the CRON Conjecture
Causality Causality: an effect can only happen after its cause Runs are causal ◮ messages can only be delivered after they are sent ◮ replies come after initial messages Happens-before relation: partial order on (nodes × N ) ���� ���� ���� ���� ���� ���� ��� 6 On the CRON Conjecture
Causality Causality: an effect can only happen after its cause Runs are causal ◮ messages can only be delivered after they are sent ◮ replies come after initial messages Happens-before relation: partial order on (nodes × N ) ���� ���� ���� ���� ���� ���� ���� ��� 6 On the CRON Conjecture
Causality Causality: an effect can only happen after its cause Runs are causal ◮ messages can only be delivered after they are sent ◮ replies come after initial messages Happens-before relation: partial order on (nodes × N ) ���� ���� ���� ���� ���� ���� ���� ��� 6 On the CRON Conjecture
Non-causality Recall the CRON conjecture: Program semantics require causal message ordering iff the messages participate in non-monotonic derivations. Runs are always causal ⇒ new semantics needed for non-causality Here is an idea: Dedalus program P ⇒ Datalog ¬ program pure sz ( P ) with stable model semantics Inspired by previous work [Alvaro, Ameloot, Hellerstein, Marczak, Van den Bussche] 7 On the CRON Conjecture
Dedalus to Datalog ¬ : illustration | Program P Program pure sz ( P ) | | | R acc ( u ) ← R ( u ) . | | R acc ( u ) • ← R acc ( u ) . | R ( u ) | y ← R ( u ) , Node ( y ) . | | T ( u ) ← R acc ( u ) , ¬ S ( u ) . | | | | | | 8 On the CRON Conjecture
Dedalus to Datalog ¬ : illustration | Program P Program pure sz ( P ) | | Deductive | R acc ( u ) ← R ( u ) . R acc ( x , s , u ) ← R ( x , s , u ) . | | R acc ( u ) • ← R acc ( u ) . | R ( u ) | y ← R ( u ) , Node ( y ) . | | T ( u ) ← R acc ( u ) , ¬ S ( u ) . | | | | | | 8 On the CRON Conjecture
Dedalus to Datalog ¬ : illustration | Program P Program pure sz ( P ) | | Deductive | R acc ( u ) ← R ( u ) . R acc ( x , s , u ) ← R ( x , s , u ) . | T ( x , s , u ) ← R acc ( x , s , u ) , ¬ S ( x , s , u ) . | R acc ( u ) • ← R acc ( u ) . | R ( u ) | y ← R ( u ) , Node ( y ) . | | T ( u ) ← R acc ( u ) , ¬ S ( u ) . | | | | | | 8 On the CRON Conjecture
Dedalus to Datalog ¬ : illustration | Program P Program pure sz ( P ) | | Deductive | R acc ( u ) ← R ( u ) . R acc ( x , s , u ) ← R ( x , s , u ) . | T ( x , s , u ) ← R acc ( x , s , u ) , ¬ S ( x , s , u ) . | R acc ( u ) • ← R acc ( u ) . | Inductive R ( u ) | y ← R ( u ) , Node ( y ) . | R acc ( x , t , u ) ← R acc ( x , s , u ) , tsucc ( s , t ) . | T ( u ) ← R acc ( u ) , ¬ S ( u ) . | | | | | | 8 On the CRON Conjecture
Dedalus to Datalog ¬ : illustration | Program P Program pure sz ( P ) | | Deductive | R acc ( u ) ← R ( u ) . R acc ( x , s , u ) ← R ( x , s , u ) . | T ( x , s , u ) ← R acc ( x , s , u ) , ¬ S ( x , s , u ) . | R acc ( u ) • ← R acc ( u ) . | Inductive R ( u ) | y ← R ( u ) , Node ( y ) . | R acc ( x , t , u ) ← R acc ( x , s , u ) , tsucc ( s , t ) . | T ( u ) ← R acc ( u ) , ¬ S ( u ) . | Asynchronous (Saccà and Zaniolo — “SZ”) | cand R ( x , s , y , t , u ) ← R ( x , s , u ) , Node ( x , s , y ) , | time ( t ) . | chosen R ( x , s , y , t , u ) ← cand R ( x , s , y , t , u ) , ¬ other R ( x , s , y , t , u ) . | other R ( x , s , y , t , u ) ← cand R ( x , s , y , t , u ) , chosen R ( x , s , y , t ′ , u ) , t � = t ′ . | R ( y , t , u ) ← chosen R ( x , s , y , t , u ) . 8 On the CRON Conjecture
����� � � � � � � � � � � � � � � � ��� ���� ���� 9 On the CRON Conjecture
����� ������ � ����������� � � � � � ���� � � � � � � � � � � ��� ���� ���� ���� ���� 9 On the CRON Conjecture
����� ������ � ����������� � � � � � ���� ������ � ����������� � � � � � ���� � � � � � ��� ���� ���� ���� ���� ���� ���� 9 On the CRON Conjecture
����� ������ � ����������� � � � � � ���� ���� ������ � ����������� � � � � � ���� � � � � � ������ � ����������� ��� ���� ���� ���� ���� ���� ���� ���� 9 On the CRON Conjecture
Output and Consistency ◮ Output of run or stable model: � { ultimate facts of x } . nodes x ◮ We focus on consistent Dedalus programs: on every input, all runs produce the same output ◮ Consistent Dedalus programs can tolerate non-causality if on every input, all stable models produce the output of the runs 10 On the CRON Conjecture
Formal CRON Conjecture Original conjecture Program semantics require causal message ordering iff the messages participate in non-monotonic derivations. 11 On the CRON Conjecture
Recommend
More recommend