A Declarative Semantics for P2P Systems

. This paper investigates the problem of data integration among Peer-to-Peer (P2P) deductive databases and presents a declarative semantics that generalizes previous proposals in the literature. Basically, by following the classical approach, the objective of a generic peer, joining a P2P system, is to enrich its knowledge by importing as much knowledge as possible while preventing inconsistency anomalies. This basic idea is extended in the present paper by allowing each peer to select between two diﬀerent settings. It can either declare its local database to be sound but not complete, or declare it to be unsound. In the ﬁrst case the peer considers its own knowledge more trustable than the knowledge imported from the rest of the system i.e. it gives preference to its knowledge with respect to the knowledge that can be imported from other peers. In the second case the peer considers its own knowledge as trustable as the knowledge that can be imported from the rest of the system i.e. it does not give any preference to its knowledge with respect to the knowledge that can be imported from other peers.


Introduction
The interaction and cooperation of peers in a P2P system allows to perform the important task of data integration.Data integration is one of the most fundamental processes in intelligent systems, from individuals to societies.In traditional data integration systems queries are submitted through a central mediated schema.Data is stored locally in each source and the two main formalisms managing the mapping between the mediated schema and the local sources are the global-as-view (GAV) and the local-as-view (LAV) approach [26].The main drawbacks of traditional integration systems are due to the lack of flexibility: i) the centralized mediated schema, that controls and manages the interaction among distributed sources, must be defined looking at the global system; ii) the insertion of a new source or the modification of an existing one may cause a violation of the mappings to the mediated schema.Divergent or conflicting concepts were selected by hierarchical authorities or by (democratically) applying the majority criteria.In a P2P system, ideally, there is no selection, but integration of the valuable contributions of every participant.Generally, peers can both provide or consume data and the only information a peer participating in a P2P system has is about neighbors, i.e. information about the peers that are reachable and can provide data of interest.More specifically, each peer joining a P2P system exhibits a set of mapping rules, i.e. a set of semantic correspondences to a set of peers which are already part of the system (neighbors).Thus, in a P2P system the entry of a new source, peer, is extremely simple as it just requires the definition of the mapping rules.By using mapping rules as soon as it enters the system a peer can participate and access all data available in its neighborhood, and through its neighborhood it becomes accessible to all the other peers in the system.The possibility for the users for sharing knowledge from a large number of informative sources, have enabled the development of new methods for data integration easily usable for processing distributed and autonomous data.Due to this, there have been several proposals which consider the integration of information and the computation of queries in an open ended network of distributed peers [3,6,9,8,20] as well as the problem of schema mediation [24,27,25], query answering and query optimization in P2P environments [1,29,18].Many of the approaches proposed in the literature investigate the data integration problem in a P2P system by considering each peer as initially consistent, therefore the introduction of inconsistency is just relied to the operation of importing data from other peers.These approaches assume, following the basic classical idea of data integration, that for each peer it is preferable to import as much knowledge as possible.In this paper we follow the proposal in [11][12][13][14]16] in which a different interpretation of mapping rules, that allows importing from other peers only tuples not violating integrity constraints, has been proposed.This new interpretation of mapping rules has led to the proposal of a semantics for a P2P system defined in terms of Preferred Weak Models.Under this semantics only facts not making the local databases inconsistent can be imported, and the preferred weak models are the consistent scenarios in which peers import maximal sets of facts not violating the integrity constraints.Therefore, the preferred weak model semantics follows the classical strategy of importing as much knowledge as possible, but limiting this to the maximal subset that do not generate inconsistencies.The following example, introduces the idea of importing in each peer maximal sets of atoms not violating integrity constraints.
r(a) q(X),q(Y),X=Y t q(X),q(Y),X =Y Example 1.Consider the P2P system depicted in Figure 1 consisting of three peers P 1 , P 2 and P 3 where -P 3 contains two atoms: r(a) and r(b), -P 2 imports data from P 3 using the (mapping) rule q(X) ← r(X) 1 .Moreover imported atoms must satisfy the constraint ← q(X), q(Y ), X = Y stating that the relation q may contain at most one tuple, and -P 1 imports data from P 2 , using the (mapping) rule p(X) ← q(X).P 1 also contains the rules s ← p(X) stating that s is true if the relation p contains at least one tuple, and t ← p(X), p(Y ), X = Y , stating that t is true if the relation p contains at least two distinct tuples.
The intuition is that, with r(a) and r(b) being true in P 3 , either q(a) or q(b) could be imported in P 2 (but not both, otherwise the integrity constraint is violated) and, consequently, only one tuple is imported in the relation p of peer P 1 .Note that whatever is the derivation in P 2 , s is derived in P 1 while t is not derived.Therefore, the atoms s and t are, respectively, true and false in P 1 .2 With the preferred weak model semantics in [11][12][13][14]16], each peer gives preference to local data with respect to data imported from the neighborhood.Therefore the basic assumption in this semantics is that each peer is sound, but not complete.
In this paper, we extend the framework in [11][12][13][14]16].In a more general setting each peer joining the system can either (i) assume its local database to be sound, but not complete; in this case the peer considers its own knowledge more trustable than the knowledge imported from the rest of the system i.e. it gives preference to its knowledge with respect to the knowledge that can be imported other peers or (ii) assume its local knowledge to be unsound; in this case the peer considers its own knowledge as trustable as the knowledge imported from the rest of the system i.e. it does not give any preference to its knowledge with respect to the knowledge that can be imported from from other peers.Let's now introduce another example, that will be used as a running example in the rest of the paper.
Example 2. Consider the P2P system PS depicted in Figure 2. P 2 contains the fact q(b), whereas P 1 contains the fact s(a), the mapping rule p(X) ← q(X), the constraint ← r(X), r(Y ), X = Y and the standard rules r(X) ← p(X) and r(X) ← s(X).
if P 1 considers its own knowledge more trustable than the knowledge imported from P 2 (that is it gives preference to its knowledge with respect to the knowledge that can be imported from P 2 ), then the fact p(b) cannot be imported in P 1 , as it indirectly violates its integrity constraint.More specifically, p(b) cannot be imported in P 1 due to the presence of the local fact s(a).if P 1 considers its own knowledge as trustable as the knowledge imported from P 2 (that is if it does not give any preference to its knowledge with respect to the knowledge that can be imported from P 2 ), then two possible scenarios are possible: a first one in wich no atom is imported from P 2 , and a second one in wich q(b) is imported from P 2 and s(a) is removed from P 1 .
In this paper we generalize the definition of P2P system in order to capture previous behavior and allow the possibility for each peer to declare either that its local knowledge is preferred with respect to the knowledge that can be imported from other peers (sound peer), or that it does not give any preference to its local knowledge with respect to the knowledge that can be extracted from the rest of the system (unsound peer).An unsound P2P system is a p2P system in which at least one peer is unsound.The semantics of an unsound P2P system is captured by the weak model semantics of a correspondent standard P2P system obtained by splitting each unsound peer into two peers.
Organization.Preliminaries are reported in Section 2. Section 3 introduces the syntax used for modeling a P2P system and reviews the Preferred Weak Model semantics, proposed in [11,12].Section 4 proposes a generalization of a P2P system so that each peer can declare either its preference to its own knowledge, or give no preference to its own knowledge with respect to imported knowledge.Section 5 provides results on the computational complexity of computing preferred weak models and answers to queries Related work is discussed in Section 6. Conclusions are drawn in Section 7.

Background
We assume there are finite sets of predicate symbols, constants and variables.A term is either a constant or a variable.An atom is of the form p(t 1 , . . ., t n ) where p is a predicate symbol and t 1 , . . ., t n are terms.A literal is either an atom A or its negation not A. A rule is of the form H ← B, where H is an atom (head of the rule) and B is a conjunction of literals (body of the rule).A program P is a finite set of rules.P is said to be positive if it is negation free.The definition of a predicate p consists of all rules having p in the head.A ground rule with empty body is a fact.A rule with empty head is a constraint.It is assumed that programs are safe, i.e. variables appearing in the head or in negated body literals are range restricted as they appear in some positive body literal.The ground instantiation of a program P, denoted by ground(P) is built by replacing variables with constants in all possible ways.An interpretation is a set of ground atoms.The truth value of ground atoms, literals and rules with respect to an interpretation M is as follows: where A is an atom, L 1 , . . ., L n are literals and true > f alse.An interpretation M is a model for a program P, if all rules in ground(P) are true w.r.t.M .A model M is said to be minimal if there is no model N such that N ⊂ M .We denote the set of minimal models of a program P with MM(P).
Given an interpretation M and a predicate symbol g, M [g] denotes the set of g-tuples in M .The semantics of a positive program P is given by its unique minimal model which can be computed by applying the immediate consequence operator T P until the fixpoint is reached ( T ∞ P (∅) ).The semantics of a program with negation P is given by the set of its stable models, denoted as SM(P).An interpretation M is a stable model (or answer set) of P if M is the unique minimal model of the positive program P M , where P M is obtained from ground(P) by (i) removing all rules r such that there exists a negative literal not A in the body of r and A is in M and (ii) removing all negative literals from the remaining rules [22].It is well known that stable models are minimal models (i.e.SM(P) ⊆ MM(P)) and that for negation free programs, minimal and stable model semantics coincide (i.e.SM(P) = MM(P)).

P2P Systems: Syntax and Semantics
This section introduces the syntax used for modeling a P2P system and reviews the Preferred Weak Model semantics, proposed in [11,12], in which a special interpretation of mapping rules is introduced.

Syntax
A (peer) predicate symbol is a pair i : p, where i is a peer identifier and p is a predicate symbol.A (peer) atom is of the form i : A, where i is a peer identifier and A is a standard atom.A (peer) literal is a peer atom i : A or its negation not i : A. A conjunction i : A 1 , . . ., i : A m , not i : A m+1 , . . ., not i : A n , φ, where φ is a conjunction of built-in atoms2 , will be also denoted as i : B, with B equals to A 1 , . . ., A m , not A m+1 , . . ., not A n , φ.A (peer) rule can be of one of the following three types: .n]IC i .In the rest of this paper, with a little abuse of notation, PS will be also denoted both with the tuple D, LP, MP, IC and the set D ∪ LP ∪ MP ∪ IC; moreover whenever the peer is understood, the peer identifier will be omitted.

Semantics
This section reviews the Preferred Weak Model semantics for P2P systems [11,12] which is based on a special interpretation of mapping rules.Observe that for each peer P i = D i , LP i , MP i , IC i , the set D i ∪ LP i is a positive normal program, thus it admits just one minimal model that represents the local knowledge of P i .In this paper it is assumed that each peer is locally consistent, i.e. its local knowledge satisfies IC i (i.e.D i ∪ LP i |= IC i ).Therefore, inconsistencies may be introduced just when the peer imports data from other peers.The intuitive meaning of a mapping rule i : H ← j : B ∈ MP i is that if the body conjunction j : B is true in the source peer P j the atom i : H can be imported in P i only if it does not imply (directly or indirectly) the violation of some integrity constraint in IC i .The following example will clarify the meaning of mapping rules.
Example 3. Consider the P2P system in Fig. 2. If the fact p(b) is imported in P 1 , the fact r(b) will be derived.As r(a) is already true in P 1 , because it is derived from s(a), the integrity constraint is violated.Therefore, p(b) cannot be imported in P 1 as it indirectly violates an integrity constraint.
Before formally presenting the preferred weak model semantics, some notation is introduced.Given a mapping rule r = H ← B, the corresponding standard logic rule H ← B will be denoted as St(r).Analogously, given a set of mapping rules MP, St(MP) = {St(r) | r ∈ MP} and given a P2P system Given an interpretation M , an atom H and a conjunction of atoms B: Therefore, if the body is true, the head of a standard rule must be true, whereas the head of a mapping rule could be true.Intuitively, a weak model M of a P2P system PS is an interpretation that satisfies all standard rules, mapping rules and constraints of PS and such that each atom H ∈ M [MP] (i.e. each mapping atom) is supported from a mapping rule H ← B whose body B is satisfied by M .A preferred weak model is a weak model that contains a subset of mapping atoms.This concept is justified by the assumption that it is preferable to import in each peer as much knowledge as possible.
, where PS M is the program obtained from ground(PS) by removing all mapping rules whose head is false w.r.t.M .Given two weak models M and N , M is said to preferable to N , and is denoted as Moreover, if M N and N M , then M = N .A weak model M is said to be preferred if there is no weak model N such that N = M .The set of weak models for a P2P system PS will be denoted by WM(PS), whereas the set of preferred weak models will be denoted by PWM(PS). 2 The next theorem shows that P2P systems always admit maximal weak models.
Proof.Let us consider a set M such that {M } = MM(D ∪ LP ∪ IC), that is the minimal model of a P2P system obtained from PS by deleting all mapping rules.As PS is initially consistent, such a model exists.Moreover, as M does not contain any mapping atoms, all the ground mapping rules have to be deleted from ground(PS) in order to obtain St(PS M ).It follows that St(PS M ) = ground(D∪ LP ∪ IC) and {M } = MM(St(PS M )).This means that M is a weak model for PS.As there is at least a weak model, then PWM(PS) = ∅. 2 Observe that in the previous definition St(PS M ) is a positive normal program, thus it admits just one minimal model.Moreover, note that the definition of weak model presents interesting analogies with the definition of stable model.p(X),p(Y),X =Y p(X) q(X) q(a) q(b) P P 1 Fig. 3.The system PS Example 4. Consider the P2P system PS in Fig. 3. P 2 contains the facts q(a) and q(b), whereas P 1 contains the mapping rule p(X) ← q(X) and the constraint ← p(X), p(Y ), X = Y .The weak models of the system are M 0 = {q(a), q(b)}, M 1 = {q(a), q(b), p(a)} and M 2 = {q(a), q(b), p(b)}, whereas the preferred weak models are M 1 and M 2 as they import the maximal set of atoms from P 2 . 2 We conclude this section showing how a classical problem can be expressed using the preferred weak model semantics.
Example 5. Three-colorability.We are given two peers P 1 , containing a set of nodes, defined by a unary relation node, and a set of colors, defined by the unary predicate color, and P 2 , containing the mapping rule colored(X, C) ← 1 : node(X), 1 : color(C) and the integrity constraints stating, respectively, that a node cannot be colored with two different colors and two connected nodes cannot be colored with the same color.The mapping rule states that the node x can be colored with the color c, only if in doing this no constraint is violated, that is if the node x is colored with a unique color and there is no adjacent node colored with the same color.Each preferred weak model computes a maximal subgraph which is three-colorable.2 An alternative characterization of the preferred weak model semantics, called Preferred Stable Model semantics, based on the rewriting of mapping rules into prioritized rules [28] has been proposed in [11,12].

A more general framework
In previous section we introduced the Preferred Weak Model semantics for P2P systems [11,12] that assumes that the knowledge of each peer of a P2P system is sound, but not complete, that is each peer (implicitly) prefers its local knowledge with respect to the knowledge that can be imported from the rest of the system.Mapping rules are therefore used to enrich the local knowledge only if imported atoms do not cause inconsistencies.
In this section we generalize the definition of P2P system so that each peer can declare either its preference to its own knowledge (sound peer), or give no preference to its own knowledge with respect to imported knowledge (unsound peer).A sound peer trusts its knowledge more than the knowledge of the rest of the system, whereas an unsound peer trusts its knowledge as much as the knowledge that can be extracted from other peers.
We first provides the a definition of P2P system that generalizes Definition 1 by introducing a new type of peers -the unsound peers -giving the same priority to local data and to imported data.
Definition 3.An unsound P2P system UPS is a pair (PS, U), where PS = {P 1 , . . ., P n } is a (standard) P2P system and U ⊆ PS.Peers in U are called unsound peers. 2 The semantics of an unsound P2P system UPS is captured by the weak model semantics of a correspondent standard P2P system obtained from UPS by splitting each unsound peer P i into two peers.The idea is to move the local database D i from P i to the new peer and to introduce in P i a set of mapping rules able to import only portions of D i that do not violate its integrity constraits.
Definition 4. Let UPS = (PS, U) an unsound P2P system, where PS = {P 1 , . . ., P n }, and P i = D i , LP i , MP i , IC i a peer in U.Then, Split(P i ) is the set containing the following peers: - The preferred weak models of UPS are obtained from those of Split(UPS) by removing each atom i : p(X) such that i > n. 2 In previous definition, the peer P i is redefined by deleting its local database D i and inserting mapping rules allowing to import tuples into old base relations (which now are mapping relations) from an auxiliary peer P (i+n) .Observe that Split(UPS) is a standard P2P system for which a preferred weak model semantics is adopted.
Example 6.Let us continue our discussion about the P2P system PS presented in Example 2.
-Assuming that PS is a sound P2P system, then P 1 trusts its own data more than the data that can be imported from P 2 .Therefore it will not import the fact p(b) because it would violate its integrity constraint.The preferred weak models of PS is: -Assuming that PS is an unsound P2P system and P 1 is an unsound peer, Split(PS) contains the following peers (for the sake of presentation we omit indexes for peers P 1 and P 2 ): In this case, P 1 does not give any preference to its knowledge with respect to the knowledge that can be imported from P and two possible scenarios are possible: a first one in which no atom is imported from P 2 and s(a) is imported from P 3 -corresponding to the preferred weak model M 1 = {q(b), s(a), r(a)}, and a second one in which q(b) is imported from P 2 and s(a) is not imported from P 3 (this is equivalent to delete s(a) from P 1 )corresponding to the preferred weak model }. Observe that the auxiliary atom 3 : s(a) does not occur in the preferred weak models M 1 and M 2 . 2

Query answers and complexity
We consider now the computational complexity of calculating preferred weak models and answers to queries.As a P2P system may admit more than one preferred weak model, the answer to a query is given by considering brave or cautious reasoning (also known as possible and certain semantics).
Definition 5. Given a P2P system PS = {P 1 , . . ., P n } and a ground peer atom A, then A is true under The lemma states that for every P2P system PS an atom is true in some of its preferred weak models if and only if it is true in some of its weak models.
Theorem 2. Let PS be a P2P system, then: 1. Deciding whether an interpretation M is a preferred weak model of PS is coN P complete.2. Deciding whether a preferred weak model for PS exists is in Σ p 2 .
3. Deciding whether an atom A is true in some preferred weak model of PS is Σ p 2 complete.4. Deciding whether an atom A is true in every preferred weak model of PS is Π p 2 complete.

(Membership)
We prove that the complementary problem, that is the problem of checking whether M is not a preferred weak model, is in N P.
We can guess an interpretation N and verify in polynomial time that (i) N is a weak model, that is {N } = MM(St(PS N )), and (ii) either M is not a weak model, that is . Therefore, the original problem is in coN P. (Hardness) We will reduce the SAT problem to the problem of checking whether a weak model is not preferred.Let X be a set of variables and F a CNF formula over X.Then the problem that will be reduced is checking whether the QBF formula (∃X) F is true.
We define a P2P system PS with two peers: P 1 and P 2 .Peer P 1 contains the atoms: 1 : variable(x), for each x ∈ X 1 : truthV alue(true) 1 : truthV alue(f alse) The relation 1 : variable stores the variables in X and the relation 1 : truthV alue stores the truth values true and f alse.Peer P 2 contains the atoms: 2 : variable(x), for each x ∈ X 2 : positive(x, c), for each x ∈ X and clause c in F s.t.x occurs non-negated in c 2 : negated(x, c), for each x ∈ X and clause c in F s.t.x occurs negated in c the mapping rule: 2 : assign(X, V ) ← 1 : variable(X), 1 : truthV alue(V ) stating that the truth value V could be assigned to the variable X, the standard rules: 2 : clause(C) ← 2 : positive(X, C) 2 : clause(C) ← 2 : negated(X, C) 2 : holds(C) ← 2 : positive(X, C), 2 : assign(X, true) 2 : holds(C) ← 2 : negated(X, C), 2 : assign(X, f alse) 2 : assignment ← 2 : assign(X, V ) defining a clause from the occurences of its positive and negated variables (first and second rule), whether a clause holds with a given assignment of values (third and fourth rule) and whether an assignment of values actually exists (fifth rule), and the integrity constraints: ← 2 : assign(X, true), 2 : assign(X, f alse) ← 2 : clause(C), not 2 : holds(C), 2 : assignment ← 2 : variable(X), not 2 : assign(X, true), not 2 : assign(X, f alse), 2 : assignment stating that two different truth values cannot be assigned to the same variable (first constraint), that if there is an assignment then there cannot be an unsatisfied clause (second constraint) and cannot be an unevaluated variable (third constraint).
Let DB the set of atoms in PS, MP the set of mapping rules in PS, LP the set of standard rules in PS and IC the set of integrity constraints in PS.
Let M be the minimal model of DB ∪ LP ∪ IC, that is the model containing no mapping atom.As PS is initially consistent, M is a weak model of PS.
Observe that the integrity constraints in PS are satisfied when no mapping atom is imported in P 2 that is if no assignment of values is performed for the variables in X.If F is not satisfiable, then there is no way to import mapping atoms in P 2 preserving consistency because the second constraint will be violated.In this case M is a preferred weak model.If F is satisfiable there is a weak model N whose set of mapping atoms corresponds to an assignment of values to the variables in X that satisfies F .Clearly, as MP M is not a preferred weak model.Moreover, if M is not a preferred weak model there must be another weak model N whose set of mapping atoms corresponds to an assignment of values to the variables in X that satisfies F .In other words, F is satisfiable if and only if M is not a preferred weak model.2. Let us guess an interpretation M .By (1), deciding whether M is a preferred weak model can be decided by a call to a coN P oracle.3.In [11] has been shown that a PS can be modeled as a disjunction-free (∨ − f ree) prioritized logic programs.For this program deciding whether an atom is true in some preferred stable model is Σ p 2 complete [28].4. In [11] has been shown that a PS can be modeled as a disjunction-free (∨ − f ree) prioritized logic programs.For this program deciding whether an atom is true in every preferred stable model is Π p 2 complete [28]. 2

Related Work
The possibility for the users for sharing knowledge from a large number of informative sources, have enabled the development of new methods for data integration easily usable for processing distributed and autonomous data.The present paper is placed among the works on semantic peer data managment systems.Among the approaches that are related to ours, we mention [24,9,10,20].
In [24] the problem of schema mediation in a Peer Data Management System (PDMS) is investigated.A formalism, P P L, for mediating peer schemas, which uses the GAV and LAV formalism to specify mappings, is proposed.A FOL semantics to the global system is proposed and query answering for a PDMS is defined by extending the notion of certain answer.More specifically, certain answers for a peer are those that are true in every global instance that is consistent with local data.
In [9,10] a new semantics for a P2P system, based on epistemic logic, is proposed.The paper proposes a sound, complete and terminating procedure that returns the certain answers to a query submitted to a peer.The advantage of this framework is that certain answers of fixed conjuntive queries posed on a peer can be computed in polynomial time.
In [20,19,21] a characterization of P2P database systems and a model-theoretic semantics dealing with inconsistent peers is proposed.The basic idea is that if a peer does not have models all (ground) queries submitted to the peer are true (i.e. are true with respect to all models).Thus, if some databases are inconsistent it does not mean that the entire system is inconsistent.The semantics in [20] coincides with the epistemic semantics in [9,10].
Interesting semantics for data exchange systems that offer the possibility of modeling some preference criteria while performing the data integration process has been proposed in [4-6, 14, 15].In [4][5][6] it is proposed a new semantics that allows for a cooperation among pairwise peers that related each other by means of data exchange constraints (i.e.mapping rules) and trust relationships.The decision by a peer on what other data to consider (besides its local data) does not depend only on its data exchange constraints, but also on the trust relationship that it has with other peers.Given a peer P in a P2P system a solution for P is a database instance that respects the exchange constraints and trust relationship P has with its 'immediate neighbors'.Trust relationships are of the form: (P, less, Q) stating that P trusts itself less that Q, and (P, same, Q) stating that P trusts itself the same as Q.This trust relationships are static and are used in the process of collecting data in order to establish preferences in the case of conflicting information.
The introduction of preference criteria among peers is out of the scope of this paper, anyhow we have proposed in recent papers extensions of the maximal weak model semantics that allows to express preferences between peers.More specifically, in [14] it is defined a mechanism that allows to set different degree of reliability for neighbor peers.
Both in [14] and in [4,6] the mechanism is rigid in the sense that the preference among conflicting sets of atoms that a peer can import only depends on the priorities (trust relationship) fixed at design time.To overcome static preferences, in [15] 'dynamic' preferences that allows to select among different scenarios looking at the properties of data provided by the peers is introduced.The work in [15] allows to model concepts like "in the case of conflicting information, it is preferable to import data from the neighbor peer that can provide the maximum number of tuples" without selecting a-priori preferred peers.
The paper introduces a logic programming based framework and a new semantics for P2P deductive databases.The presented semantics generalizes previous proposal in the literature by allowing each peer joining the system to select between two different settings: it can either declare its local database to be sound, but not complete; in this case, if inconsistencies arise it gives preference to its knowledge with respect to the knowledge that can be imported from the rest of the system or declare its local knowledge to be unsound; in this case it does not give any preference to its knowledge with respect to the knowledge that can be imported from other peers.
1. standard rule.It is of the form i : H ← i : B, where i : H is an atom and i : B is a conjunction of atoms and built-in atoms.2. integrity constraint.It is of the form ← i : B, where i : B is a conjunction of literals and built-in atoms.Negation is allowed just in the body of integrity constraints.The concepts of ground rule and fact are similar to those reported in Section 2. The definition of a predicate i : p consists of the set of rules in whose head the predicate symbol i : p occurs.A predicate can be of three different kinds: base predicate, derived predicate and mapping predicate.A base predicate is defined by a set of ground facts; a derived predicate is defined by a set of standard rules and a mapping predicate is defined by a set of mapping rules.An atom i : p(X) is a base atom (resp.derived atom, mapping atom) if i : p is a base predicate (resp.standard predicate, mapping predicate).Given an 3. mapping rule.It is of the form i : H ← j : B, where i : H is an atom, j : B is a conjunction of atoms and built-in atoms and i = j.In the previous rules, i : H is called head while i : B (resp.j : B) is called body.interpretation M , M [D] (resp.M [LP], M [MP]) denotes the subset of base atoms (resp.derived atoms, mapping atoms) in M .Definition 1. P2P System.A peer P i is a tuple D i , LP i , MP i , IC i , where (i) D i is a set of facts (local database); (ii) LP i is a set of standard rules; (iii) MP i is a set of mapping rules and (iv) IC i is a set of constraints over predicates defined by D i , LP i and MP i .A P2P system PS is a set of peers {P 1 , . . ., P n }. 2 Given a P2P system PS = {P 1 , . . ., P n }, where P i = D i , LP i , MP i , IC i , D, LP, MP and IC denote, respectively, the global sets of ground facts, standard rules, mapping rules and integrity constraints, i.e.D = i∈[1..n] D i , LP = i∈[1..n] LP i , MP = i∈[1..n] MP i and IC = i∈[1.