On the CRON Conjecture Tom J. Ameloot Jan Van den Bussche Hasselt - - PowerPoint PPT Presentation

on the cron conjecture
SMART_READER_LITE
LIVE PREVIEW

On the CRON Conjecture Tom J. Ameloot Jan Van den Bussche Hasselt - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

On the CRON Conjecture

Tom J. Ameloot Jan Van den Bussche

Hasselt University, Belgium

On the CRON Conjecture

1

slide-2
SLIDE 2

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

On the CRON Conjecture

2

slide-3
SLIDE 3

Typical Operational Semantics

Ingredients: network, replicated program, distributed input database Run of the program on the input:

  • On the CRON Conjecture

3

slide-4
SLIDE 4

Typical Operational Semantics

Ingredients: network, replicated program, distributed input database Run of the program on the input:

  • On the CRON Conjecture

3

slide-5
SLIDE 5

Typical Operational Semantics

Ingredients: network, replicated program, distributed input database Run of the program on the input:

  • On the CRON Conjecture

3

slide-6
SLIDE 6

Typical Operational Semantics

Ingredients: network, replicated program, distributed input database Run of the program on the input:

  • On the CRON Conjecture

3

slide-7
SLIDE 7

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

On the CRON Conjecture

3

slide-8
SLIDE 8

Dedalus

Local step implemented as follows:

  • (Deductive rules: stratified semantics)

On the CRON Conjecture

4

slide-9
SLIDE 9

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. Racc) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Racc(u) ← R(u). Racc(u)• ← Racc(u). R(u) | y ← R(u), Node(y). T(u) ← Racc(u), ¬S(u).

On the CRON Conjecture

5

slide-10
SLIDE 10

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)

  • On the CRON Conjecture

6

slide-11
SLIDE 11

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)

  • On the CRON Conjecture

6

slide-12
SLIDE 12

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)

  • On the CRON Conjecture

6

slide-13
SLIDE 13

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)

  • On the CRON Conjecture

6

slide-14
SLIDE 14

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)

  • On the CRON Conjecture

6

slide-15
SLIDE 15

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 puresz(P) with stable model semantics

Inspired by previous work [Alvaro, Ameloot, Hellerstein, Marczak, Van den Bussche]

On the CRON Conjecture

7

slide-16
SLIDE 16

Dedalus to Datalog¬: illustration

Program P Racc(u) ← R(u). Racc(u)• ← Racc(u). R(u) | y ← R(u), Node(y). T(u) ← Racc(u), ¬S(u). | | | | | | | | | | | | | | | Program puresz(P)

On the CRON Conjecture

8

slide-17
SLIDE 17

Dedalus to Datalog¬: illustration

Program P Racc(u) ← R(u). Racc(u)• ← Racc(u). R(u) | y ← R(u), Node(y). T(u) ← Racc(u), ¬S(u). | | | | | | | | | | | | | | | Program puresz(P)

Deductive Racc(x, s, u) ← R(x, s, u).

On the CRON Conjecture

8

slide-18
SLIDE 18

Dedalus to Datalog¬: illustration

Program P Racc(u) ← R(u). Racc(u)• ← Racc(u). R(u) | y ← R(u), Node(y). T(u) ← Racc(u), ¬S(u). | | | | | | | | | | | | | | | Program puresz(P)

Deductive Racc(x, s, u) ← R(x, s, u). T(x, s, u) ← Racc(x, s, u), ¬S(x, s, u).

On the CRON Conjecture

8

slide-19
SLIDE 19

Dedalus to Datalog¬: illustration

Program P Racc(u) ← R(u). Racc(u)• ← Racc(u). R(u) | y ← R(u), Node(y). T(u) ← Racc(u), ¬S(u). | | | | | | | | | | | | | | | Program puresz(P)

Deductive Racc(x, s, u) ← R(x, s, u). T(x, s, u) ← Racc(x, s, u), ¬S(x, s, u). Inductive Racc(x, t, u) ← Racc(x, s, u), tsucc(s, t).

On the CRON Conjecture

8

slide-20
SLIDE 20

Dedalus to Datalog¬: illustration

Program P Racc(u) ← R(u). Racc(u)• ← Racc(u). R(u) | y ← R(u), Node(y). T(u) ← Racc(u), ¬S(u). | | | | | | | | | | | | | | | Program puresz(P)

Deductive Racc(x, s, u) ← R(x, s, u). T(x, s, u) ← Racc(x, s, u), ¬S(x, s, u). Inductive Racc(x, t, u) ← Racc(x, s, u), tsucc(s, t). Asynchronous (Saccà and Zaniolo — “SZ”) candR(x, s, y, t, u) ← R(x, s, u), Node(x, s, y), time(t).

chosenR(x,s,y,t,u)←candR(x,s,y,t,u), ¬otherR(x,s,y,t,u).

  • therR(x,s,y,t,u)←candR(x,s,y,t,u), chosenR(x,s,y,t′,u), t=t′.

R(y, t, u) ← chosenR(x, s, y, t, u).

On the CRON Conjecture

8

slide-21
SLIDE 21
  • On the CRON Conjecture

9

slide-22
SLIDE 22
  • On the CRON Conjecture

9

slide-23
SLIDE 23
  • On the CRON Conjecture

9

slide-24
SLIDE 24
  • On the CRON Conjecture

9

slide-25
SLIDE 25

Output and Consistency

◮ Output of run or stable model:

  • nodes x

{ultimate facts of 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

On the CRON Conjecture

10

slide-26
SLIDE 26

Formal CRON Conjecture

Original conjecture Program semantics require causal message ordering iff the messages participate in non-monotonic derivations.

On the CRON Conjecture

11

slide-27
SLIDE 27

Formal CRON Conjecture

Original conjecture Program semantics require causal message ordering iff the messages participate in non-monotonic derivations. Formally: A Dedalus program does not tolerate non-causality iff it contains negation.

On the CRON Conjecture

11

slide-28
SLIDE 28

Formal CRON Conjecture

Original conjecture Program semantics require causal message ordering iff the messages participate in non-monotonic derivations. Formally: A Dedalus program does not tolerate non-causality iff it contains negation. Or, equivalently: A Dedalus program tolerates non-causality iff it is positive.

On the CRON Conjecture

11

slide-29
SLIDE 29

Result

Every positive Dedalus program tolerates non-causality. ⇒ declarative semantics for positive Dedalus programs

On the CRON Conjecture

12

slide-30
SLIDE 30

Result

Every positive Dedalus program tolerates non-causality. ⇒ declarative semantics for positive Dedalus programs Check the other direction: “every program tolerating non-causality is equivalent to a positive program”

◮ Program P computes query Q if for every input I, for every

partition of I over a network, every run outputs Q(I)

On the CRON Conjecture

12

slide-31
SLIDE 31

Result

Every positive Dedalus program tolerates non-causality. ⇒ declarative semantics for positive Dedalus programs Check the other direction: “every program tolerating non-causality is equivalent to a positive program”

◮ Program P computes query Q if for every input I, for every

partition of I over a network, every run outputs Q(I)

◮ Possible: program tolerates non-causality and computes

non-monotone query ⇒ no equivalent positive program

On the CRON Conjecture

12

slide-32
SLIDE 32

Result

Every positive Dedalus program tolerates non-causality. ⇒ declarative semantics for positive Dedalus programs Check the other direction: “every program tolerating non-causality is equivalent to a positive program”

◮ Program P computes query Q if for every input I, for every

partition of I over a network, every run outputs Q(I)

◮ Possible: program tolerates non-causality and computes

non-monotone query ⇒ no equivalent positive program

◮ Possible: program computes monotone query and does not

tolerate non-causality

On the CRON Conjecture

12

slide-33
SLIDE 33

Causal Declarative Semantics

[Alvaro, Ameloot, Hellerstein, Marczak, Van den Bussche]

Represent exactly the runs: enforce causality on stable models pure(P) = puresz(P) + explicit representation of causal happens-before relation

On the CRON Conjecture

13

slide-34
SLIDE 34

Causal Declarative Semantics

[Alvaro, Ameloot, Hellerstein, Marczak, Van den Bussche]

Represent exactly the runs: enforce causality on stable models pure(P) = puresz(P) + explicit representation of causal happens-before relation R(u) | y ← R(u), Node(y). candR(x, s, y, t, u) ← R(x, s, u), Node(x, s, y), time(t), ¬before(y, t, x, s).

On the CRON Conjecture

13

slide-35
SLIDE 35

Result

Trace of run = facts R(x, s, ¯ a) such that x during local step s has R(¯ a) in deductive fixpoint

On the CRON Conjecture

14

slide-36
SLIDE 36

Result

Trace of run = facts R(x, s, ¯ a) such that x during local step s has R(¯ a) in deductive fixpoint With pure(P), for each input (i) For each trace T of a run there is a stable model M such that T = M|sch(P). (ii) For each stable model M there is a trace T of a run such that T = M|sch(P).

On the CRON Conjecture

14

slide-37
SLIDE 37

Questions

On the CRON Conjecture

15