• No results found

Comparison of definitions of knowledge for epistemic gossip protocols

N/A
N/A
Protected

Academic year: 2021

Share "Comparison of definitions of knowledge for epistemic gossip protocols"

Copied!
44
0
0

Bezig met laden.... (Bekijk nu de volledige tekst)

Hele tekst

(1)

Comparison of definitions of

knowledge for epistemic gossip

protocols

Zarina Efendijeva July 24, 2015

Supervisor: Prof Dr Jan van Eijck

Organisation: Centrum Wiskunde & Informatica, www.cwi.nl

Universiteit van Amsterdam Master Software Engineering

(2)
(3)

Acknowledgements

Firstly, I would like to express my sincere gratitude to Prof. dr Jan van Eijck for his patience, encouragement and continuous support during this study, and for all the help and time invested during the supervision of this thesis. On top of his general support, his guidance helped me to see functional programming from a positive perspective.

I would like to express my deepest thanks to my colleagues and managers Nora Kouwenhoven and Kees Rijsenbrij for supporting me and giving me the opportunity to do this masters. I am also grateful to my friends Alex and Rasmus for their support, time and grammatical edits.

Finally I would like to thank my mother for her continuous love and enduring support during my whole study process.

(4)
(5)

Abstract

The aim of this study is to investigate definitions of knowledge for gossip protocols. Gossip protocols are communication protocols, mostly used in large scale distributed systems, through which agents exchange information in order to maximize the information they hold. The semantics of these protocols are based on epistemic models, in which S5 is associated with an equivalence accessibility relation.

This report investigates eight possible definitions of knowledge - accessi-bility relations - that represent informational states within gossip protocol semantics. Implementations of these definitions were developed using the functional programming language Haskell which were used to test theoretical assumptions underpinning the definitions by comparing the outcomes of applying each relation between two graphs. The results of the experiment show that the definitions entail significant differences in the knowledge representation of an agent.

(6)
(7)

Table of Contents

Introduction 5

1 The world of epistemic logic 7

1.1 Propositional Epistemic Logic . . . 7

1.2 Language . . . 7

1.3 Semantics . . . 8

1.4 Accessibility Relations . . . 9

2 Implementation 10 2.1 Graphs and Sequence of calls . . . 10

2.2 Synchronous definitions . . . 12 2.2.1 Definition 1 . . . 13 2.2.2 Definition 2 . . . 15 2.2.3 Definition 3 . . . 16 2.2.4 Definition 4 . . . 18 2.3 Asynchronous definitions . . . 19 2.3.1 Definition 5 . . . 20 2.3.2 Definition 6 . . . 20 2.3.3 Definition 7 . . . 22 2.3.4 Definition 8 . . . 24 3 Results 26 3.1 Synchronous vs Asynchronous communication . . . 26

3.2 Merge before and after inspection . . . 27

3.3 Memory-less vs. State-based memory . . . 28

3.4 Evaluation . . . 30

4 Conclusion 32

References 35

A Appendix A. List of Symbols 37

(8)
(9)

Introduction

Gossip communication protocols are used in the technological world for dis-tributing information throughout the network. The origins of the technique go back to the early 70s, a period in which mathematicians were interested in the solving the so called “gossip-problem”. If each member of a group of people knew secrets and could call one another to exchange them, then what is the minimum number of calls that must be made such that everyone knows all the secrets?

It would be strange to consider the obtaining of knowledge as some sort of static event. On the contrary, we acquire new knowledge through communication, in which the asking of questions and the receipt of answers lead to changes in information states. The study of knowledge and change is called “dynamic epistemic logic”, and the gossip protocol also bears the name “epistemic protocol” [Hedetniemi et al., 1988].

[Van Ditmarsch et al., 2015] analyze in their work dynamic gossip pro-tocols and the Learn New Secrets (LNS) protocol, in which the goal is to call a person whose secret you don’t know yet. In this thesis we investi-gate definitions of knowledge for the epistemic LNS protocol as defined by [van Eijck, 2015].

Problem statement

The epistemic gossip protocol is an interesting subject and has been used to solve various problems. [Burmester et al., 2007] introduced new gossip proto-cols to reduce transmission redundancy in dense ad hoc networks. A study by [Agrawal et al., 1997] proposed epistemic algorithms to distribute updates and maintain replicated data in transactional frameworks. Various models for epistemic gossip protocols are investigated in [Attamah et al., 2014].

[Van Ditmarsch et al., 2015] analyze gossip protocols using a connection graph in which agents not only exchange all secrets they know but also exchange phone numbers. Thus the possible calls the agents can make are constrained by the phone numbers and secrets they have obtained. In a further analysis, [van Eijck, 2015] proposed eight definitions of knowledge as equivalence accessibility relations. Every definition has 3 characteristics, such

(10)

as synchronous or asynchronous communication, memory-less agent or agent with a state-based memory, and where the merging of current information with new information happens before or after inspect.

Research Questions

The aim of this study is to research various definitions of knowledge for gossip protocols as defined by [van Eijck, 2015], to explore differences between them and to find out how the characteristics of each definition affects the knowledge of an agent.

For this purpose implementations of all definitions were developed in the functional programming language Haskell. Both it’s operational design and syntax pair well with mathematical fields, so implementations of accessibility relations in Haskell can easily resemble the notation of modal logic and exclude obstacles and inaccuracies that can be introduced by the syntax of the programming language. Furthermore, the use of Haskell can also lead to the optimisation of current definitions of knowledge.

To achieve the goal of this study, two research questions were formulated as follows:

How do the proposed definitions of knowledge for gossip protocols differ from one other?

What does each definition say about the knowledge of an agent? The research questions will be answered in the last two chapters of this thesis.

Outline

This thesis comprises of five chapters which are organized as follows. The first chapter consists mainly of background information relating to the problem statement, and provides basic information about epistemic logic; syntax, semantics and accessibility relations.

The second part discusses the implementation and analysis of eight definitions for accessibility relations. Chapter two is devoted to the Haskell implementations. The third chapter is an analysis of the similarities and differences between the definitions of knowledge. The final chapter presents concluding remarks and a review of the most important findings.

(11)

1

The world of epistemic logic

This chapter introduces background information on the definition of epistemic logic. A basic knowledge of propositional and first-order logic is assumed. An overview of the symbols and acronyms used can be found in Appendix A.

1.1 Propositional Epistemic Logic

Logical thinking has been always an important skill in everyday life. Critical reasoning plays a gigantic role for analyzing other people’s intentions and beliefs correctly. The greek philosopher Aristotle can be seen as the founder of this discipline, and more concretely, of epistemic logic. The greek word episteme means science or knowledge, and epistemic logic is the logic of knowledge and belief. Despite its ancient origins, the primary development of epistemic logic, a sub-field of modal logic, took a place in the middle of last century.

In the early 60’s, Jaakko Hintikka, a pioneer in the concepts of knowledge and belief, opened the door to the world of modal logic in his logical analysis of modal concepts in his book “Knowledge and Belief: An Introduction to the Logic of the Two Notions” [Hintikka, 1962]. Another significant contribution to modal logic was semantics of [Kripke, 1963], also known as Kripke models.

1.2 Language

From time to time, I and a friend Anna go to a café and order drinks. Whenever the waiter comes back with our drinks, he asks: “Tea?” and I answer: “That would be for me, thank you.”, then he automatically gives a coffee to Anna. As [van Benthem, 2004] said “asking questions and giving

(12)

CHAPTER 1. THE WORLD OF EPISTEMIC LOGIC

answers are just as much logical core activities as drawing conclusions”. In this situation, the waiter concludes that the other drink would be for a second person, so he knows that the coffee must be for Anna.

As mentioned, epistemic logic is concerned with knowledge and belief, about sentences that contain expressions such as “believes that” or “knows that”. The epistemic language is actually propositional language extended with unary epistemic operators for knowledge Ka' and belief Ba'.

In epistemic logic, the previous example that can be written as: Kw', and

reads as “agent w knows that '”, where agent w is the waiter and where ' stands for some arbitrary proposition, in this case that the coffee is for Anna.

Definition 1.2.1 (Basic epistemic language). Let P= {p, q, r...} be a set of atomic propositions. The language Lk is generated by the following BNF:

'::= p|¬'|(' ^ ')|Ka'

This means that more complex formulas can be built by using negation ’¬’, conjunction ’^’ and the knowledge operator ’Ka'’. The knowledge operator

combined with negation, written as ¬Kw', reads as “It is not true that

agent w knows '”. An interesting formulation for ¬Kw¬'(or ^Kw') reads as

follows: “the agent considers it possible that '”. Notice that agent can admit both truth and falsity of a formula ^Kw' ^ ^Kw¬', but can’t be convinced at

the same time of it’s truth and falsity.

1.3 Semantics

Almost every Saturday my neighbour Ben goes to the nearby bakery and buys two pumpkin breads, and if he is lucky, a couple of muffins. The muffins are very popular and are sometimes sold out by the time Ben arrives. While Ben is on his way to the bakery he can’t distinguish between two worlds in which one has a bakery with muffins and another one in which they are sold out. Those two worlds are equivalent at that moment.

If we add the baker to this example, his ignorance of whether Ben will come or not can be represented by two worlds, both of which from the perspective of the baker are equivalent. In the end, we have four possible worlds: «Ben will come and muffins are available», «Ben won’t come and muffins are available», «Ben will come and muffins are sold out» and last world where «Ben won’t come and muffins are sold out».

(13)

CHAPTER 1. THE WORLD OF EPISTEMIC LOGIC Definition 1.3.1 (Model of language MLk). Given a countable set of atomic propositions P and a finite set of agents A, a Kripke model is a structure M=⌦S, {Ra}a2A, VP↵, where

S is non empty set of possible worlds (also called set of states). RaA✓ SxS is an accessibility relation for every agent a.

VP : P! 2S is a valuation function that for every p 2 P yelds the set

VP(p)✓ S of states in which p is true.

A pointed Kripke model (M, p) is a Kripke model with a designated point p in the set of states of M.

Definition 1.3.2 (Truth condition of epistemic formula). Given an epistemic model M =⌦S, R, V↵ we define that a formula ' is true in world s of model M, s |= ', as follows:

M, s |= p iff s 2 V(p)

M, s |= (' ^ ) iff M, s |= ' and M, s |= M, s |= ¬' iff not M, s |= '

M, s |= Ka' iff for all t such that Rast, M, t |= '

1.4 Accessibility Relations

In definition 1.3.1, an epistemic model was presented, in which RaA is a

binary accessibility relation on A, that expresses an agent’s uncertainty about a current state of affairs. The following definition introduces some properties of accessibility relations [Meyer and Van Der Hoek, 2004]:

Definition 1.4.1. Let S be the set of states of a Kripke model and R ✓ SxS an accessibility relation.

R is reflexive if 8s 2 S : (s, s) 2 R

R is transitive if 8s, t, u 2 S : (s, t) 2 R & (t, u) 2 R ) (s, u) 2 R R is symmetrical if 8s, t 2 S : (s, t) 2 R ) (t, s) 2 R

R is euclidean if 8s, t, u 2 S : (s, t) 2 R & (s, u) 2 R ) (t, u) 2 R

R is reflexive and euclidean, if world s is accessible to worlds t and u, so that t and u are accessible to each other.

(14)

2

Implementation

This chapter describes implementations of the definitions of knowledge for the gossip protocols described in [van Eijck, 2015]. The first section is devoted to supporting functions that are either required in the implementations of the eight definitions (which can be found in subsequent sections) or are otherwise used for testing purposes. The implementation of supporting functions that make it possible to generate different graphs for testing purposes is presented in Appendix B.

1 module GossipsDefinitions where

2

3 import Data.List

2.1 Graphs and Sequence of calls

In their study, [Van Ditmarsch et al., 2015] represent a graph G with secrets and numbers as a triple (A, N, S), where A is a set of agents. N ✓ A2

and S ✓ A2 are relations on A, where Nxy expresses that x knows a phone

number of y and Sxy expresses that x knows a secret of y. The type Table represents an implementation of the graph G in a form of a list with tuples, where the first Agent stands for an agent, and the second part contains a tuple with lists of numbers and secrets. The type Seq stands for a sequence of calls, a record list of calls that can be performed, where first agent calls the second. All agents are represented as integers, with a type int.

5 type Agent = Int

6 type Table = [(Agent, ( [Agent] , [Agent]) ) ] 7 type Seq = [(Agent, Agent) ]

(15)

CHAPTER 2. IMPLEMENTATION The following function checks whether a call is possible, that is: if agent x has the number of agent y, yet does not have agent y’s secret, then the function yields true:

14 possible : : (Agent, Agent) ! Table ! Bool 15 possible (x,y) table = case lookup x table of

16 Nothing ! False

17 Just ( numbersX, secretX) ! elem y numbersX &&not (elem y secretX)

The following function generates a list of possible calls for the current graph and uses a support function agents to create a list of all agents:

19 possibleCalls : : Table ! [(Agent, Agent) ]

20 possibleCalls t = [ (agent , number) | agent (agents t) ,

21 number (agents t) ,

22 agent /= number,

23 possible (agent , number) t ]

11 agents : : Table ! [Agent] 12 agents = map fst

The following function checks if a sequence of calls can be performed:

25 isPossibleSequence : : Seq ! Table ! Bool 26 isPossibleSequence [ ] table =True

27 isPossibleSequence (x: xs) table = 28 isPossibleSequence xs table && 29 possible x ( calls xs table)

The merge function combines two sorted lists:

31 merge : : Ord x ) [x] ! [x] ! [x] 32 merge [ ] ys = ys

33 merge xs [ ] = xs 34 merge (x: xs) (y: ys)

35 | x == y = x: merge xs ys

36 | x < y =x: merge xs (y: ys)

37 | y < x =y: merge (x: xs) ys

This function serves to merge a list of currently held numbers with numbers that have been obtained during a call. It is also used with lists of secrets; merging a list of currently known secrets with secrets obtained during a call. In the following function agent x calls agent y, after which existing and exchanged information are merged:

41 call (x,y) table =

42 i f not (possible (x,y) table ) then table

43 else 44 let

45 Just (xNumbers, xSecrets) =lookup x table 46 Just (yNumbers, ySecrets) =lookup y table 47 newSecrets = merge xSecrets ySecrets 48 newNumbers = merge xNumbers yNumbers

(16)

CHAPTER 2. IMPLEMENTATION

49 newTable = table \\ [(x,(xNumbers, xSecrets)) ,

50 (y,(yNumbers, ySecrets)) ]

51 in

52 ( (insert (x,(newNumbers, newSecrets)))

53 ( insert (y,(newNumbers, newSecrets))) ) newTable

In order to make a sequence of calls, a function calls is implemented. This function takes a list of possible calls in a graph, where agent x calls agent y. The list starts with the most recently preformed call and a new graphs is constructed by recursion and the usage of call function:

57 calls [ ] table = table

58 calls ((x,y) : rest ) table = call (x,y) ( calls rest table)

2.2 Synchronous definitions

To refine the definition of knowledge for gossip protocols, we distinguish between synchronous and asynchronous communication. This section focuses on four definitions of knowledge with synchronous communication. In the synchronous model of communication, two agents periodically exchange secrets and phone-numbers. Synchronous representation [van Eijck, 2015] introduces for each agent a 2 A (where A is a list of all agents) a projection function ⇡a: SA ! RA:

⇡a(✏) = ✏

⇡a( ; xy) = ⇡a

( ); xy if a=x or a=y ⇡a( );⇤ otherwise

The projection function replaces all calls in that a doesn’t participate in with blanks (⇤). For example, for a call sequence of length of 3, with a last performed call in which agent 1 calls agent 2 and agent 1 has not participated in any earlier calls we get the next projection function for agent 1: ⇤; ⇤; (1, 2). In synchronous communication, agent 1 knows how many calls have been made before his turn and can distinguish who initiated the call: (1,2) or (2,1). In the Haskell implementation blanks are represented by empty lists; a calling record is a list of phone call lists possibly containing empty lists. The first tuple in the calling list represents the last call. The implementation of this projection function in Haskell is given below:

64 projection : : Agent ! Seq ! [ [Agent] ] 65 projection a [ ] = [ ]

66 projection a ((x,y) : rest )

67 | a == x | | a ==y = [x,y ] : projection a rest

(17)

CHAPTER 2. IMPLEMENTATION Example 2.2.1. Consider a following calling record:

SA= {(2, 3), (3, 4), (4, 1), (2, 4), (1, 3)}

For agent 1, the project function is a list where all calls that a doesn’t participate in are replaced by empty lists and calls where a participates are transformed from tuples to lists:

Gossip protocol knowledge definitions for synchronous communication can be categorized in four groups :

synchronous, merge before inspection, memory-less;

synchronous, merge before inspection, state-based memory; synchronous, inspect before merging, memory-less;

synchronous, inspect before merging, state-based memory

The difference between memory-less agent and agent with state-based memory is that in the former case the agent has no memory of previous calls whereas in the latter case the agent retains knowledge of previous calls. The next four sections will focus on for their implementations.

2.2.1 Definition 1

Definition 1 is an equivalence relation designed for a memory-less agent with synchronous communication, in which the update of information occurs before the inspection.

Definition 2.2.1 (Definition 1: Synchronous, merge-inspect, memory-less). Let ⇠a be the relation on GAxSA given by:

((A, N, S), ) ⇠a ((A, N0, S0), ⌧)

iff

⇡a( ) = ⇡a(⌧) ^ Na= N0⌧a^ Sa = S0⌧a

Consider next two graphs, where nodes 1,2,3 are agents and the arrows show who can call who:

Graph a has a sequence of calls {(2,1),(2,3)} and graph b has sequence {(1,2),(2,3)}. According to definition 1 the accessibility relation of these graphs for agent 3 holds. Since the inspection of knowledge happens after

(18)

CHAPTER 2. IMPLEMENTATION 1 2 3 (a) graph a 1 2 3 (b) graph b

the call, and the agent has no memory of previous calls, we compare the final knowledge of an agent after a sequence of calls has been performed in both worlds. In both cases it is equivalent. To test this in Haskell, we define two graphs and call sequences, where the list in a Haskell implementation is a reversed list of the original version.

340 graphA, graphB : : Table

341 graphA = [(1 ,([1] ,[1]) ) ,(2 ,([1 ,2 ,3] ,[2]) ) ,(3 ,([2 ,3] ,[3]) ) ] 342 graphB = [(1 ,([1 ,2] ,[1]) ) ,(2 ,([2 ,3] ,[2]) ) ,(3 ,([2 ,3] ,[3]) ) ] 343

344 seqA, seqB : : Seq 345 seqA = [(2 ,3) ,(2 ,1) ] 346 seqB = [(2 ,3) ,(1 ,2) ]

The function isPossibleSequence tests if those call sequences are pos-sible for two graphs. The calls function performs calls. The knowledge of agent 3 in both cases is equivalent. The implementation of this definition in Haskell is simple, synchronicity of those calls for agent a are compared, numbers and secrets of the agent in both worlds are looked up and compared to see if the secrets and numbers are equivalent in both worlds.

73 rel1 a (table1 , seq1) (table2 , seq2) = 74 let

75 Just (numbers1, secrets1 ) =lookup a ( calls seq1 table1) 76 Just (numbers2, secrets2 ) =lookup a ( calls seq2 table2) 77 in

78 projection a seq1 == projection a seq2 && 79 secrets1 == secrets2 &&

80 numbers1 == numbers2

(19)

CHAPTER 2. IMPLEMENTATION

2.2.2 Definition 2

A variant of the previous definition is the case where the agent retains earlier learning stages [van Eijck, 2015].

Definition 2.2.2 (Definition 2: Synchronous, merge-inspect, stage memory). Let ⇠a be the relation on GAxSA given by:

((A, N, S), ✏) ⇠a ((A, N0, S0), ✏)

iff

Na = Na0 ^ Sa= Sa0.

((A, N, S), ; xy) ⇠a((A, N0, S0), ⌧; uv)

iff

((A, N, S), ) ⇠a ((A, N0, S0), ⌧)

and one of the following holds: a /2 x, y, u, v xy= ay = uvand Na = N0⌧ a, Sa = S 0 a, xy= xa = uvand Na = N0⌧ a, Sa = S 0 a.

Definition 2 differs from definition 1 in that the agent accumulates knowledge from previous calls. Whereas in definition 1 the agent had no memory of previous calls, in definition 2, with state-based memory, the agent possesses a call history. The implementation features a base case with empty sequence calls, in which the secrets and numbers of an agent in both worlds are com-pared, and a main case in which, during the look-up of secrets and numbers of agent a, a distinction is made between both worlds depending on whether the agent a is a caller or a call recipient. State-based memory is implemented by calling the relation recursively. To implement the merge before inspect

(20)

CHAPTER 2. IMPLEMENTATION

scenario, knowledge of agent x (the caller) and knowledge of agent y (the call recipient) are united and thereafter compared. Projection functions of the sequence calls in both worlds are compared to check synchronicity of those communications. The implementation also covers a case in which sequence calls are asynchronous; this automatically yields false.

84 rel2 : : Agent ! (Table, Seq ) ! (Table, Seq ) ! Bool 85 rel2 a (table1 , [ ] ) (table2 , [ ] ) =

86 let

87 Just (numbers1, secrets1 ) =lookup a table1 88 Just (numbers2, secrets2 ) =lookup a table2 89 in

90 secrets1 == secrets2 && 91 numbers1 == numbers2

92 rel2 a (table1 , (x1,y1) : seq1) (table2 , (x2,y2) : seq2) = 93 let

94 Just (numbers1x, secrets1x) =lookup x1 ( calls seq1 table1) 95 Just (numbers2x, secrets2x) =lookup x2 ( calls seq2 table2) 96 Just (numbers1y, secrets1y) =lookup y1 ( calls seq1 table1) 97 Just (numbers2y, secrets2y) =lookup y2 ( calls seq2 table2) 98 in

99 projection a seq1 == projection a seq2 && 100 rel2 a (table1 , seq1) (table2 , seq2) && 101 or [notElem a [x1, y1, x2 , y2] ,

102 (and [a == x1, a == x2, y1 == y2,

103 merge numbers1x numbers1y == merge numbers2x numbers2y,

104 merge secrets1x secrets1y == merge secrets2x secrets2y ]) ,

105 (and [a == y1, a == y2, x1 == x2,

106 merge numbers1x numbers1y == merge numbers2x numbers2y,

107 merge secrets1x secrets1y == merge secrets2x secrets2y ])

108 ]

109 rel2 a _ _ = False

2.2.3 Definition 3

This definition, as definition 1, is synchronous and memory-less, but inspec-tion happens before the merge.

Definition 2.2.3 (Definition 3: Synchronous, inspect-merge, memory-less). Let ⇠a be the relation on GAxSA given by:

((A, N, S), ✏) ⇠a ((A, N0, S0), ✏)

iff

(21)

CHAPTER 2. IMPLEMENTATION and for 6= ✏, ⌧ 6= ✏:

((A, N, S), ) ⇠a ((A, N0, S0), ⌧)

iff

⇡a( ) = ⇡a(⌧)

and if = 0; ax, ⌧ = ⌧0; axor = 0; xa, ⌧ = ⌧0; xa, then:

Na0 = N0⌧a0, Nx0 = N0⌧x0, Sa0 = S0⌧a0, Sx0 = S0⌧x0 .

The implementation of definition 3 is similar to implementation of defi-nition 2. The difference is that it is a memory-less communication and the agent doesn’t retain any memory of previous calls, therefore recursion of this relation is not required. Another important difference is that the inspection happens before the merge, leading to comparison of numbers and secrets before the update of information is performed.

114 rel3 : : Agent ! (Table, Seq ) ! (Table, Seq ) ! Bool 115 rel3 a (table1 , [ ] ) (table2 , [ ] ) =

116 let

117 Just (numbers1, secrets1 ) = lookup a table1 118 Just (numbers2, secrets2 ) = lookup a table2 119 in

120 secrets1 == secrets2 && 121 numbers1 == numbers2

122 rel3 a (table1 , ((x1,y1) : seq1)) (table2 , ((x2,y2) : seq2)) = 123 let

124 Just (numbers1x, secrets1x) =lookup x1 ( calls seq1 table1) 125 Just (numbers2x, secrets2x) =lookup x2 ( calls seq2 table2) 126 Just (numbers1y, secrets1y) =lookup y1 ( calls seq1 table1) 127 Just (numbers2y, secrets2y) =lookup y2 ( calls seq2 table2) 128 in

129 projection a seq1 == projection a seq2 && 130 i f

131 and [a == x1, a == x2, y1 == y2] | | 132 and [a == y1, a == y2, x1 == x2] 133 then

134 [numbers1x, numbers1y, secrets1x , secrets1y ] == 135 [numbers2x, numbers2y, secrets2x , secrets2y ]

136 else i f

137 notElem a [x1,y1,y2,x2]

138 then

139 rel3 a (table1 , seq1) (table2 , seq2)

140 else False

(22)

CHAPTER 2. IMPLEMENTATION 2.2.4 Definition 4

The last definition for synchronous communication has stage memory, as in definition 2, and inspection happens before the merge, as in definition 3. Definition 2.2.4 (Definition 4: Synchronous, inspect-merge, stage memory). Let ⇠a be the relation on GAxSA given by:

((A, N, S), ✏) ⇠a ((A, N0, S0), ✏) iff Na = Na0 ^ Sa = Sa0. and for 6= ✏, ⌧ 6= ✏: ((A, N, S), ) ⇠a((A, N0, S0), ⌧) iff ⇡a( ) = ⇡a(⌧)

and if = 0; xy, ⌧ = ⌧0; uv with a /2 {x, y, u, v} then

((A, N, S), 0) ⇠a ((A, N0, S0), ⌧0),

and if = 0; ax, ⌧ = ⌧0; axor = 0; xa, ⌧ = ⌧0; xa, then:

((A, N, S), 0) ⇠a ((A, N0, S0), ⌧0), N 0 a = N0⌧ 0 a , S 0 a = S0⌧ 0 a , S 0 x = S0⌧ 0 x .

The implementation of this relation is similar to the implementation of definition 2, with a difference in the order of inspect and merge. In this case inspection happens before the merge of knowledge, therefore numbers and secrets are compared directly.

145 rel4 : : Agent ! (Table, Seq ) ! (Table, Seq ) ! Bool 146 rel4 a (table1 , [ ] ) (table2 , [ ] ) =

147 let

148 Just (numbers1, secrets1 ) =lookup a table1 149 Just (numbers2, secrets2 ) =lookup a table2 150 in

151 secrets1 == secrets2 && 152 numbers1 == numbers2

153 rel4 a (table1 , ((x1,y1) : seq1)) (table2 , ((x2,y2) : seq2)) = 154 let

155 Just (numbers1x, secrets1x) =lookup x1 ( calls seq1 table1) 156 Just (numbers2x, secrets2x) =lookup x2 ( calls seq2 table2) 157 Just (numbers1y, secrets1y) =lookup y1 ( calls seq1 table1)

(23)

CHAPTER 2. IMPLEMENTATION

159 in

160 projection a seq1 == projection a seq2 && 161 rel4 a (table1 , seq1) (table2 , seq2) && 162 or [notElem a [x1, y1, x2 , y2] ,

163 (and [a == x1, a == x2, y1 == y2,

164 [numbers1x, numbers1y, secrets1x , secrets1y ] ==

165 [numbers2x, numbers2y, secrets2x , secrets2y ] ] ) ,

166 (and [a == y1, a == y2, x1 == x2,

167 [numbers1x, numbers1y, secrets1x , secrets1y ] ==

168 [numbers2x, numbers2y, secrets2x , secrets2y ] ] ) 169 ]

170 rel4 a _ _ = False

2.3 Asynchronous definitions

In this section, four definitions with asynchronous communications are defined and implemented. The asynchronous communication model doesn’t assume periodic behaviour. In such models, an agent has no idea if any calls were made before the present, or how many.

The next four definitions for asynchronous communication require a different projection function: ⇧a : SA! SA. It differs from the projection function

for synchronous communication in that all other calls in which agent a is not participating are just excluded instead of being replaced by blanks.

⇧a(✏) = ✏

⇧a( ; xy) =

⇧a( ); xy if a=x or a=y

⇧a( ) otherwise

To implement this function in Haskell, a sequence list is checked out recursively. Whenever a call with agent a is found it is added to the new list. In a composition (x,y):rest, (x, y) is the last call in the sequence.

175 asyn_projection : : Agent ! Seq ! Seq 176 asyn_projection a [ ] = [ ]

177 asyn_projection a ((x,y) : rest )

178 | a == x | | a ==y = (x,y) : asyn_projection a rest

179 | otherwise = asyn_projection a rest

The output for the example 2.2.1, but this time with asynchronous function yields:

(24)

CHAPTER 2. IMPLEMENTATION 2.3.1 Definition 5

Definition 5 is an equivalence relation designed for a memory-less agent with asynchronous communication, where the merge happens before the inspect. Definition 2.3.1 (Definition 5: Asynchronous, merge-inspect, memory-less). Let ⇠a be the relation on GAxSA given by:

((A, N, S), ) ⇠a((A, N0, S0), ⌧)

iff

⇧a( ) = ⇧a(⌧) ^ Na = N0⌧a^ Sa = S0⌧a

The implementation of this definition in Haskell is similar to the im-plementation of definition 1. The project function ⇧a ascertains whether

agent a participates in one of the calls in both worlds. Numbers and secrets of the agent are looked up in both worlds and compared to see if they are equivalent in both worlds.

183 rel5 : : Agent ! (Table, Seq ) ! (Table, Seq ) ! Bool 184 rel5 a (table1 , seq1) (table2 , seq2) =

185 let

186 Just (numbers1, secrets1 ) =lookup a ( calls seq1 table1) 187 Just (numbers2, secrets2 ) =lookup a ( calls seq2 table2) 188 in

189 asyn_projection a seq1 == asyn_projection a seq2 && 190 secrets1 == secrets2 &&

191 numbers1 == numbers2

2.3.2 Definition 6

A variation of definition 5 is a definition of knowledge where inspection takes place before the merge of new obtained information.

Definition 2.3.2 (Definition 6: Asynchronous, inspect-merge, memory-less). Let ⇠a be the relation on GAxSA given by:

((A, N, S), ✏) ⇠a ((A, N0, S0), ✏)

iff

Na = Na0 ^ Sa = Sa0.

If a /2 {x, y} then:

(25)

CHAPTER 2. IMPLEMENTATION iff

((A, N, S), ) ⇠a((A, N0, S0), ⌧; xy)

iff

((A, N, S), ) ⇠a((A, N0, S0), ⌧).

((A, N, S), ; ax) ⇠a ((A, N0, S0), ⌧; ax)

iff

((A, N, S), ; xa) ⇠a ((A, N0, S0), ⌧; xa)

iff

Na = N0⌧a, Sa= S0⌧a, Nx = N0⌧x, Sx = S0⌧x .

This definition can be implemented by using four patterns:

The first pattern uses two empty sequence calls in which secrets and numbers of two graphs are compared.

The second and third patterns are cases where a sequence of calls on one side has calls in a queue and on the other side the queue is empty. For this purpose a non-empty list of call sequence is examined for the participation of agent a. The fourth pattern uses sequence calls that are not empty. In this pattern we search for a call in which agent a participates, and within that call the numbers and the secrets of the callers and call recipients are compared.

197 rel6 : : Agent ! (Table, Seq ) ! (Table, Seq ) ! Bool 198 rel6 a (table1 , [ ] ) (table2 , [ ] ) =

199 let

200 Just (numbers1, secrets1 ) = lookup a table1 201 Just (numbers2, secrets2 ) = lookup a table2 202 in

203 secrets1 == secrets2 && 204 numbers1 == numbers2

205 rel6 a (table1 , (x1,y1) : seq1) (table2 , [ ] ) 206 | elem a [x1,y1] = False

207 | otherwise = rel6 a (table1 , seq1) (table2 , [ ] )

208 rel6 a (table1 , [ ] ) (table2 , (x2,y2) : seq2) 209 | elem a [x2,y2] = False

210 | otherwise = rel6 a (table1 , [ ] ) (table2 , seq2)

211 rel6 a (table1 , (x1,y1) : seq1) (table2 , (x2,y2) : seq2) = 212 let

213 Just (numbers1x, secrets1x) =lookup x1 ( calls seq1 table1) 214 Just (numbers2x, secrets2x) =lookup x2 ( calls seq2 table2) 215 Just (numbers1y, secrets1y) =lookup y1 ( calls seq1 table1) 216 Just (numbers2y, secrets2y) =lookup y2 ( calls seq2 table2)

(26)

CHAPTER 2. IMPLEMENTATION

217 in 218 i f

219 and [a == x1, a == x2, y1 == y2] | | 220 and [a == y1, a == y2, x1 == x2] 221 then

222 [numbers1x, numbers1y, secrets1x , secrets1y ] == 223 [numbers2x, numbers2y, secrets2x , secrets2y ]

224 else i f

225 elem a [x1,y1] &&notElem a [x2,y2] 226 then

227 rel6 a (table1 , (x1,y1) : seq1) (table2 , seq2)

228 else i f

229 elem a [x2,y2] &&notElem a [x1,y1] 230 then

231 rel6 a (table1 , seq1) (table2 , (x2,y2) : seq2)

232 else i f

233 notElem a [x1,y1,y2,x2]

234 then

235 rel8 a (table1 , seq1) (table2 , seq2)

236 else False

2.3.3 Definition 7

Another variation of an asynchronous definition of knowledge is where the agent retains the memory of previous calls.

Definition 2.3.3 (Definition 7: Asynchronous, merge-inspect, stage mem-ory). Let ⇠a be the relation on GAxSA given by:

((A, N, S), ✏) ⇠a ((A, N0, S0), ✏)

iff

Na = Na0 ^ Sa = Sa0.

If a /2 {x, y} then:

((A, N, S), ; xy) ⇠a ((A, N0, S0), ⌧)

iff

((A, N, S), ) ⇠a ((A, N0, S0), ⌧; xy)

iff

((A, N, S), ) ⇠a ((A, N0, S0), ⌧).

(27)

CHAPTER 2. IMPLEMENTATION iff

((A, N, S), ; xa) ⇠a ((A, N0, S0), ⌧; xa)

iff

((A, N, S), ) ⇠a((A, N0, S0), ⌧), Na = N0⌧a, Sa = S0⌧a.

This definition differs in implementation from the previous one in two aspects. First, state-based memory is implemented by calling the relation function recursively in a main pattern. Second, to implement the merge-inspect variation, numbers and secrets are exchanged between the caller and the recipient and the updated knowledge is compared.

240 rel7 : : Agent ! (Table, Seq ) ! (Table, Seq ) ! Bool 241 rel7 a (table1 , [ ] ) (table2 , [ ] ) =

242 let

243 Just (numbers1, secrets1 ) = lookup a table1 244 Just (numbers2, secrets2 ) = lookup a table2 245 in

246 secrets1 == secrets2 && 247 numbers1 == numbers2

248 rel7 a (table1 , (x1,y1) : seq1) (table2 , [ ] ) 249 | elem a [x1,y1] = False

250 | otherwise = rel7 a (table1 , seq1) (table2 , [ ] )

251 rel7 a (table1 , [ ] ) (table2 , (x2,y2) : seq2) 252 | elem a [x2,y2] = False

253 | otherwise = rel7 a (table1 , [ ] ) (table2 , seq2)

254 rel7 a (table1 , (x1,y1) : seq1) (table2 , (x2,y2) : seq2) = 255 let

256 Just (numbers1x, secrets1x) =lookup x1 ( calls seq1 table1) 257 Just (numbers2x, secrets2x) =lookup x2 ( calls seq2 table2) 258 Just (numbers1y, secrets1y) =lookup y1 ( calls seq1 table1) 259 Just (numbers2y, secrets2y) =lookup y2 ( calls seq2 table2) 260 in

261 i f

262 and [a == x1, a == x2, y1 == y2] | | 263 and [a == y1, a == y2, x1 == x2] 264 then

265 rel7 a (table1 , seq1) (table2 , seq2) &&

266 merge numbers1x numbers1y == merge numbers2x numbers2y && 267 merge secrets1x secrets1y == merge secrets2x secrets2y

268 else i f

269 elem a [x1,y1] &&notElem a [x2,y2] 270 then

271 rel7 a (table1 , (x1,y1) : seq1) (table2 , seq2)

272 else i f

273 elem a [x2,y2] &&notElem a [x1,y1] 274 then

275 rel7 a (table1 , seq1) (table2 , (x2,y2) : seq2)

276 else i f

(28)

CHAPTER 2. IMPLEMENTATION

278 then

279 rel7 a (table1 , seq1) (table2 , seq2)

280 else False

2.3.4 Definition 8

The last variation is for an agent who retains the memory of previous calls who applies the inspect before merge pattern.

Definition 2.3.4 (Definition 8: Asynchronous, inspect-merge, stage mem-ory). Let ⇠a be the relation on GAxSA given by:

((A, N, S), ✏) ⇠a ((A, N0, S0), ✏)

iff

Na = Na0 ^ Sa = Sa0.

If a /2 {x, y} then:

((A, N, S), ; xy) ⇠a ((A, N0, S0), ⌧)

iff

((A, N, S), ) ⇠a ((A, N0, S0), ⌧; xy)

iff

((A, N, S), ) ⇠a ((A, N0, S0), ⌧).

((A, N, S), ; ax) ⇠a((A, N0, S0), ⌧; ax)

iff

((A, N, S), ; xa) ⇠a((A, N0, S0), ⌧; xa)

iff

((A, N, S), ) ⇠a((A, N0, S0), ⌧)

and

Na = N0⌧a, Sa = S0⌧a, Nx = N0⌧x, Sx = S0⌧x

The only difference with the implementation of definition 6 is that in the second pattern, the relation is called recursively to implement a stage memory:

(29)

CHAPTER 2. IMPLEMENTATION

284 rel8 : : Agent ! (Table, Seq ) ! (Table, Seq ) ! Bool 285 rel8 a (table1 , [ ] ) (table2 , [ ] ) =

286 let

287 Just (numbers1, secrets1 ) = lookup a table1 288 Just (numbers2, secrets2 ) = lookup a table2 289 in

290 secrets1 == secrets2 && 291 numbers1 == numbers2

292 rel8 a (table1 , (x1,y1) : seq1) (table2 , [ ] ) 293 | elem a [x1,y1] = False

294 | otherwise = rel7 a (table1 , seq1) (table2 , [ ] )

295 rel8 a (table1 , [ ] ) (table2 , (x2,y2) : seq2) 296 | elem a [x2,y2] = False

297 | otherwise = rel7 a (table1 , [ ] ) (table2 , seq2)

298 rel8 a (table1 , (x1,y1) : seq1) (table2 , (x2,y2) : seq2) = 299 let

300 Just (numbers1x, secrets1x) =lookup x1 ( calls seq1 table1) 301 Just (numbers2x, secrets2x) =lookup x2 ( calls seq2 table2) 302 Just (numbers1y, secrets1y) =lookup y1 ( calls seq1 table1) 303 Just (numbers2y, secrets2y) =lookup y2 ( calls seq2 table2) 304 in

305 i f

306 and [a == x1, a == x2, y1 == y2] | | 307 and [a == y1, a == y2, x1 == x2] 308 then

309 rel8 a (table1 , seq1) (table2 , seq2) &&

310 [numbers1x, numbers1y, secrets1x , secrets1y ] == 311 [numbers2x, numbers2y, secrets2x , secrets2y ]

312 else i f

313 elem a [x1,y1] &&notElem a [x2,y2] 314 then

315 rel8 a (table1 , (x1,y1) : seq1) (table2 , seq2)

316 else i f

317 elem a [x2,y2] &&notElem a [x1,y1] 318 then

319 rel8 a (table1 , seq1) (table2 , (x2,y2) : seq2)

320 else i f

321 notElem a [x1,y1,y2,x2]

322 then

323 rel8 a (table1 , seq1) (table2 , seq2)

(30)

3

Results

In this chapter the results of the experiments are presented. Three tests are conducted that show the existence of differences within definitions of knowledge for gossip protocols.

3.1 Synchronous vs Asynchronous communication

This section compares eight definitions of knowledge to show differences between synchronicity and asynchronicity in communication.

Example 3.1.1. Consider the next two graphs, before sequences of calls have been made:

1 2 3 4 (a) graph1 1 2 3 4 (b) graph2

In one case the call sequence {(2,3)} will be performed, whereas in the other no calls will be. First we define graphs and call sequences in Haskell:

349 graph1, graph2 : : Table

350 graph1 = [(1 ,([1 ,4] ,[1]) ) ,(2 ,([2 ,3] ,[2]) ) ,(3 ,([1 ,3] ,[3]) ) ,(4 ,([3 ,4] ,[4]) ) ] 351 graph2 = [(1 ,([1 ,4] ,[1]) ) ,(2 ,([2 ,3] ,[2]) ) ,(3 ,([1 ,3] ,[3]) ) ,(4 ,([2 ,4] ,[4]) ) ]

(31)

CHAPTER 3. RESULTS

353 seq1 , seq2 : : Seq 354 seq1 = [(2 ,3) ] 355 seq2 = [ ]

To make sure that those call sequences are possible for both graphs we test them by using the isPossibleSequence function. The calls function shows graphs that result from calling the sequences. The final knowledge of agent 1 in both worlds is equivalent:

The following function is implemented to test all of the relations at once:

328 testDefinitions : : Agent ! Table ! Seq ! Table ! Seq ! [Bool] 329 testDefinitions agent table1 seq1 table2 seq2 =

330 [ rel1 agent (table1 , seq1) (table2 , seq2) , 331 rel2 agent (table1 , seq1) (table2 , seq2) , 332 rel3 agent (table1 , seq1) (table2 , seq2) , 333 rel4 agent (table1 , seq1) (table2 , seq2) , 334 rel5 agent (table1 , seq1) (table2 , seq2) , 335 rel6 agent (table1 , seq1) (table2 , seq2) , 336 rel7 agent (table1 , seq1) (table2 , seq2) , 337 rel8 agent (table1 , seq1) (table2 , seq2) ]

Tests of equivalence on accessibility relations for agent 1 in those graphs yield false for definitions that are classified as synchronous:

3.2 Merge before and after inspection

This section compares eight definitions of knowledge to show differences between the updated knowledge of an agent after a call has been performed and the agent’s knowledge just before information has been exchanged. Example 3.2.1. Consider the next two graphs before the calling sequences are made. The call sequence for both graphs is the same: {(2,3), (3,1)}:

(32)

CHAPTER 3. RESULTS 1 2 3 (a) graph3 1 2 3 (b) graph4

Once all calls have been made, agent3 knows in both cases all the secrets and numbers. To test this we define graph3 and graph4 and a sequence of calls seq34 in Haskell:

358 graph3, graph4 : : Table

359 graph3 = [(1 ,([1 ,3] ,[1]) ) ,(2 ,([2 ,3] ,[2]) ) ,(3 ,([1 ,3] ,[3]) ) ] 360 graph4 = [(1 ,([1] ,[1]) ) ,(2 ,([2 ,3] ,[2]) ) ,(3 ,([1 ,3] ,[3]) ) ] 361

362 seq34 : : Seq

363 seq34 = [(3 ,1) ,(2 ,3) ]

The final knowledge of agent 3 in both worlds is equivalent:

After testing this example with every equivalence relation we get the next result, that definitions of knowledge where inspection happens before the exchange of information yield false:

3.3 Memory-less vs. State-based memory

This section compares eight definitions of knowledge to show a difference between the definitions of knowledge for memory-less agents and agents that retain the memory of previous calls.

(33)

CHAPTER 3. RESULTS 1 2 3 4 (a) graph5 1 2 3 4 (b) graph6

The call sequence {(1,4), (2,3), (1,3)} will be applied to graph5, and {(1,4), (3,2), (1,3)} to graph6. First we define the graphs and reversed call sequences in Haskell:

367 graph5, graph6 : : Table

368 graph5 = [(1 ,([1 ,3 ,4] ,[1]) ) ,(2 ,([2 ,3] ,[2]) ) ,(3 ,([3] ,[3]) ) , (4 ,([4] ,[4]) ) ] 369 graph6 = [(1 ,([1 ,4] ,[1]) ) ,(2 ,([2] ,[2]) ) ,(3 ,([2 ,3] ,[3]) ) , (4 ,([3 ,4] ,[4]) ) ] 370

371 seq5 , seq6 : : Seq

372 seq5 = [(1 ,3) ,(2 ,3) ,(1 ,4) ] 373 seq6 = [(1 ,3) ,(3 ,2) ,(1 ,4) ]

Thereafter, we control whether sequences are possible for those graphs. After the call sequences have been performed in both worlds agent 1 knows all the secrets and numbers.

The comparison of the accessibility relations of the graphs for agent 1, shows the difference between memory-less and state-based memory classifications. In the definitions of knowledge where an agent retains his memory of previous calls, agent 1 can see the difference between two worlds:

(34)

CHAPTER 3. RESULTS

3.4 Evaluation

The three experiments show that there is a significant difference in the eight definitions of knowledge for gossip protocols.

The proposed definitions in [van Eijck, 2015] possess three properties. All these properties influence the knowledge of an agent. In the table below, we can view once again how every definition of knowledge is classified:

Classification Def1 Def2 Def3 Def4 Def5 Def6 Def7 Def8

Synchronous p p p p Asynchronous p p p p Merge-Inspect p p p p Inspect-Merge p p p p Memory-less p p p p Stage memory p p p p

Table 3.1: Classification per definition of knowledge for gossip protocols In the table 3.2 we can see the results of all experiments per definition. In experiment 3.1.1, in one world there was a call made in which agent1 didn’t participate. In another world there were no calls made. In both cases agent1 didn’t learn any new secrets or numbers. However, his knowledge differed, depending on whether the communication was synchronous or asynchronous. With asynchronous communication the agent couldn’t distinguish between two worlds: were there any calls made or not? Experiment 3.2.1 showed the difference in knowledge for agent 3 with inspection applied before or after the exchange of information. The last experiment 3.3.1 considered a case where agent 1 participated in two calls to examine if the knowledge of that agent is the same, depending on whether he still remembers his previous actions or not.

Experiment Rel1 Rel2 Rel3 Rel4 Rel5 Rel6 Rel7 Rel8 3.1.1 False False False False True True True True 3.2.1 True True False False True False True False 3.3.1 True False True False True True False False

(35)

CHAPTER 3. RESULTS Definitions 1 and 5 define the knowledge of agent in a broad sense, he simply knows what secrets and numbers he has obtained so far. Needless to say, it would be strange if an agent had no memory over his previous action. Definitions 1,3,5 and 6 define the knowledge of memory-less agent. The agent has no memory of previous actions, however he does keep a track of periodicity of communication in definitions 1 and 3. In definitions 1, 2, 5 and 7 the knowledge of agent a in two worlds is compared after the call has been made and information subsequently exchanged. It seems like agent a can’t distinguish between his own information and information obtained from a person with whom he spoke on a phone. In definitions 3,4,6 and 8 it is the other way around, there is a separation between the agent’s own knowledge and that of the person to whom he talks.

The definitions that have been classified as asynchronous give a certain freedom. If we consider a synchronous communication between agents in which one of the calls fails, then agent a wouldn’t know that and would think that communication was still properly functioning between the two agents. This assumption would be based on a false premise. Hence, definitions with an asynchronous communication describe the knowledge of an agent far better, he can’t distinguish between two worlds in which one has a call between two agents and another one in which there are no calls. Those two worlds are equivalent at that moment for the agent.

As was stated before all of those definition of knowledge are different, and in our opinion, definition 8 is probably the closest for defining the knowledge of an agent. It is aimed at asynchronous communication, the agent remembers who he talked to and what information he obtained.

(36)

4

Conclusion

In this thesis we studied eight definitions of knowledge proposed in

[van Eijck, 2015] for epistemic gossip protocols, where every definition is represented by an accessibility relation.

We implemented those accessibility relations in Haskell and ran three experiments.

The experiments aimed to show that definitions of knowledge differ from one other. In the first experiment we showed differences in the knowledge of agent a in two worlds, one with synchronous and one with asynchronous communications between the agents. The second experiment showed the difference of an agent’s knowledge depending on when it is updated, before or after the information exchange. In the third experiment we showed differences in the knowledge of an agent with a memory of previous calls and of an agent who had no memory of previous actions.

Finally, we presented an overview of the results in the table 3.2. At the start of this study two research questions were formulated:

How do the proposed definitions of knowledge for gossip protocols differ from one other?

What does each definition say about the knowledge of an agent? From our research we can conclude that every definition is unique de-pending on what set of properties it includes. The difference in the length of call sequences or the difference in what order the call is carried out with the participation of the agent a, don’t affect the knowledge of the agent a in definitions 5,6,7 and 8. The agent is ignorant about any calls that don’t include him. These definitions have been classified as asynchronous. In

(37)

CHAPTER 4. CONCLUSION definitions 1,2,3 and 4, with synchronous communication, the agent can rely on a periodic behaviour of calls, however in case of the failure of one of the calls, the agent’s knowledge will be based on false premises: the call took place.

Definition 1 defines the knowledge of an agent from the perspective of synchronous communication and in definition 5 does so from the perspective of asynchronous communication. The knowledge of the agent in both cases is very limited, as he doesn’t keep track of his previous actions and doesn’t distinguish between his own information and the information he obtained.

Definitions 2 (synchronous) and 7 (asynchronous) define the knowledge of an agent that has memory of his previous actions, but as in definitions 1 and 5 doesn’t distinguish between his own information and the information he obtained.

Definitions 4 (synchronous) and 8 (asynchronous) define the knowledge of an agent with the memory of his actions and these definitions go further in distinguishing between information already known and the information received at a particular moment.

The agent in definitions 3 (synchronous) and 6 (asynchronous) doesn’t have memory of his previous calls but can distinguish between information he already has and information he receives at a particular moment.

The results justify our claim that different definitions of knowledge lead to different knowledge states in the agent and furthermore that those eight definitions are not identical.

(38)
(39)

References

[Agrawal et al., 1997] Agrawal, D., El Abbadi, A., and Steinke, R. C. (1997).

Epidemic algorithms in replicated databases. In Proceedings of the sixteenth ACM SIGACT-SIGMOD-SIGART symposium on Principles of database systems, pages 161–172. ACM.

[Attamah et al., 2014] Attamah, M., van Ditmarsch, H., Grossi, D., and van der Hoek, W. (2014). Knowledge and gossip. Proceedings of 21st ECAI, pages 21–26.

[Baker and Shostak, 1972] Baker, B. and Shostak, R. (1972). Gossips and telephones. Discrete Mathematics, 2:191–193.

[Burmester et al., 2007] Burmester, M., Van Le, T., and Yasinsac, A. (2007). Adaptive gossip protocols: Managing security and redundancy in dense ad hoc networks. Ad Hoc Networks, 5(3):313–323.

[Hedetniemi et al., 1988] Hedetniemi, S. M., Hedetniemi, S. T., and Liest-man, A. L. (1988). A survey of gossiping and broadcasting in communica-tion networks. Networks, 18(4):319–349.

[Hintikka, 1962] Hintikka, J. (1962). Knowledge and belief: an introduc-tion to the logic of the two nointroduc-tions. Cornell University Press Ithaca. [Hurkens, 2000] Hurkens, C. A. (2000). Spreading gossip efficiently. Nieuw

Archief voor Wiskunde, 1:208–210.

[Kripke, 1963] Kripke, S. A. (1963). Semantical considerations on modal logic.

[Meyer and Van Der Hoek, 2004] Meyer, J.-J. C. and Van Der Hoek, W. (2004). Epistemic logic for AI and computer science, volume 41. Cambridge University Press.

[Tijdeman, 1971] Tijdeman, R. (1971). On a telephone problem. Nieuw Archief voor Wiskunde, 3:188–192.

(40)

REFERENCES

[van Ditmarsch et al., 2007] van Ditmarsch, H., van der Hoek, W., and Kooi, B. P. (2007). Dynamic epistemic logic, volume 337. Springer Science & Business Media.

[Van Ditmarsch et al., 2015] Van Ditmarsch, H., van Eijck, J., Pardo, P., Ramezanian, R., and Schwarzentruber, F. (June 8, 2015). Dynamic Gossip.

(41)

A

Appendix A. List of Symbols

Symbol Interpretation

:= is assigned to

|= satisfies; makes...true ⇠ an equivalence relation

✏ the empty sequence

a2 S ais an element of the set S a /2 S ais not an element of the set S Ka Knowledge modality for agent a

A✓ B the set A is a subset of the set B |A| cardinality of A

AxB Catesian product of A and B An Cartesian product of n copies of A aRb the element a is related to the element b ¬p negation of the proposition p

p ^ q conjunction of the propositions p and q P(A) the power set of the set A

(42)

B

Appendix B. Implementation of

graph generator

This appendix is devoted to the implementation of a graph generator, which is used for the fast generation of tables for test cases.

1 module GraphGenerator where

2

3 import Data.List

Types for agents, graphs and relations have been defined.

5 type Agent = Integer

6 type Table = [(Agent, ( [Agent] , [Agent]) ) ] 7 type Rel = [(Agent,Agent) ]

The following functions have been implemented to create a power set of a relation. The relation is a Cartesian product of set A.

9 powerList : : [a] ! [ [ a ] ] 10 powerList [ ] = [ [ ] ]

11 powerList (x: xs) = (powerList xs) ++ (map (x:) (powerList xs)) 12

13 allRels : : Agent ! [Rel]

14 allRels n = powerList [(x,y) | x [ 1 . .n] , y [ 1 . .n] ]

The reflexive function is implemented to check if all elements in the relation are reflexive:

16 reflexive : : Agent ! Rel ! Bool

17 reflexive n rel = all ( x ! elem (x,x) rel ) [ 1 . .n]

The following functions are implemented to convert the relation to functions and to tables (graph representation):

(43)

APPENDIX B. APPENDIX B. IMPLEMENTATION OF GRAPH GENERATOR

20 rel2function n rel k = [ i | i [ 1 . .n] , elem (k, i ) rel ] 21

22 rel2table : : Agent ! Rel ! Table

23 rel2table n rel =map ( x ! (x, (rel2function n rel x, [x] ))) [ 1 . .n]

The allRefRels function filters only reflexive relations (so that every agent knows his own secret). The allTables function builds all possible tables for n agents.

25 allReflRels : : Agent ! [Rel]

26 allReflRels n = f i l t e r ( reflexive n) ( allRels n) 27

28 allTables : : Agent ! [Table]

29 allTables n =map ( rel2table n) ( allReflRels n)

The last three functions present an organized representation of those tables:

31 showTable : : Table ! String

32 showTable table =show table ++ " n" 33

34 displayTables : : [Table] ! IO ()

35 displayTables table = sequence_ [putStr (showTable t) | t table ] 36

37 displayAllTables : : Agent ! IO()

38 displayAllTables n = displayTables $ allTables n

For example, if we want to generate all possible graphs for two agents, where both agents know their own secrets, we call function displayAllTables2:

Formula

In this section we derive a formula for a power set that consists of reflexive subsets.

Let A denote a set of all agents. The cardinality of set A is written as |A|= n, where n is the number of agents in A. The Cartesian product of the set A with itself is the set of all possible ordered pairs and can be denoted as AxA = A2. The cardinality of |A2|= n2.

Let A = {1, 2}, then A2 = {(1, 1), (1, 2), (2, 1), (2, 2)}. To create a power set

where every subset includes at least all the reflexive pairs, we need first to extract them from AxA:

Let A2

ref = {(1, 1), (2, 2)} and A2rest = {(1, 2), (2, 1)}. The cardinality of

A2

(44)

APPENDIX B. APPENDIX B. IMPLEMENTATION OF GRAPH GENERATOR

the difference between A2 and A2

ref. Therefore:

|A2rest|= |A2|- |A2ref|= n2- n

The next step is to create a power set of A2 rest.

A2rest= {{}, {(1, 2)}, {(2, 1)}, {(1, 2), (2, 1)}}

The union of the set A2

ref with every subset of the power set P(A2rest)will

create a power set, in which all subsets have reflexive relations: Pref(A2) = P(A2rest)xA2ref

Where Pref(A2)is:

{{(1, 1), (2, 2)}, {(1, 1), (2, 1), (2, 2)}, {(1, 1), (1, 2), (2, 2)}, {(1, 1), (1, 2), (2, 1), (2, 2)}} The cardinality of the power set P(A) = 2A= 2n. Let |P

ref(A2)|denote the

cardinality of new power set, then:

|Pref(A2)| = |P(A2rest)|⇤ 1 = 2(n

2-n)

The formula can be verified for sets with more elements in it:

Referenties

GERELATEERDE DOCUMENTEN

Strategic philanthropy describes business activities that create social benefits for the society and economic benefits for the company simultaneously?. Presently, to

In deze Annex zijn verschillende begrippen niet opgenomen, waaronder ‘Acceptance Test, Parties, Call Attempt, Call set-up, End User Connection, End User, Circuit Terminating

When exponential smoothing is used, demand is forecasted by averaging all the past periods of actual demand and by weighing more recent data to give greater influence

Het opvallende verspreidingspatroon met clusters van larven direct benedenstrooms van (potentiële) paaiplaatsen doet vermoeden dat de larven gedurende de jaren dat zij in

Jan Konst stelt dat zelf aan de orde aan het einde van zijn betoog, waarin hij vertelt dat door zijn eigen speurwerk zijn lec- tuur op een ‘selffulfilling prophecy’ is

Het kapitaal van de WTKG is echter voor een belangrijk deel opgebouwd door het (nog) niet verschijnen van nummers van CR, zodat dit begrote tekort redelijk

If you are not the Current Maintainer of the Work, you may distribute a Derived Work provided the following conditions are met for every com- ponent of the Work unless that

 TREATMENT FAILURE: ‘A patient who was initially smear-positive and who remained smear- positive at month 5 or later during treatment’ (WHO 2009).  DEFAULTED: ‘A patient