Logic programming with social features
In everyday life it happens that a person has to reason about what other people think and how they behave, in order to achieve his goals. In other words, an individual may be required to adapt his behaviour by reasoning about the others' mental state…
Authors: Francesco Buccafurri, Gianluca Caminiti
Under c onsider ation for public ation in The ory and Pr actic e of Lo gic Pr o gr amming 1 L o gic Pr o gr amming with So cial F e atur es ∗ FRANCESCO BUCCAFURRI and GIANLUCA CAMINITI DIMET - Unive rsit` a “Me diterr ane a” de gli St udi di R e ggio Calabria via Gr aziel la, lo c . F e o di Vito, 89122 R e ggio Calabria, Italia ( e-mail: bucca@unirc. it, gianluca .caminiti@unir c.it ) submitte d 16 January 2007 ; r evise d 13 Novemb er 2007, 18 April 2008; ac c epte d 21 May 2008 Abstract In everyda y life it happens th at a p erson has to reason ab out what other p eople think and ho w they b ehav e, in order to achieve his goal s. In oth er w ords, an individu al ma y b e requ ired to adapt his behaviour by reasoning about the others’ mental state. In th is pap er w e fo cus on a knowledge represen tation language deriv ed from logic programming whic h b oth supp orts the representa tion of mental states o f individu al comm unities and provides each with the capability o f reaso nin g ab out others’ mental states and acting accordingly . The prop osed semantics is shown to b e translatable in to stable mo del se- mantics of logic p rograms with aggregates. T o app ear in Theory and Practice of Logic Programming (TPLP). KEYWORDS : l ogic programming, stable model seman tics, know ledge representatio n 1 In tro duction In everyday life it happ e ns that a p erso n has to reaso n ab out what other p eople think and how they b ehav e, in order to achieve his goa ls. In other words, an in- dividual may be required to ada pt his behaviour by rea soning ab out the others’ men tal state. This t ypica lly happens in the con text of co op eration and negotiation: for instance, an individual can prop ose his own goals if he knows that they would be acceptable to the o thers. Otherwise he can decide not to make them public. As a consequence , one ca n increa se the success chances of his actions, by having information ab out the other individuals’ knowledge. In t his pap er w e fo cus on a knowledge representation language derived from logic progra mming which both supp or ts the representation of mental states of individ- ual comm unities and pr ovides eac h wit h the capability of reasoning about others’ men tal states and acting a ccordingly . The pro p o sed s emantics is shown to b e tra ns- latable int o stable mo del s emantics of log ic pro grams with aggr e gates. W e g ive the flav or of the prop osal by two introductor y exa mples, wherein we de- scrib e the features of our appr o ach in an infor mal, yet deep fashion. Even thoug h in these exa mples, as well a s else where in the pap er, w e use the term agent to denote ∗ An abridged v ersi on of this paper app ears in (Buccafurri and Cami niti 2005). 2 F. Buc c afurri and G. Caminiti the individual reaso ning, w e r emark that o ur fo cus is basica lly concerning to the knowledge-representation asp ects, with no inten tion to inv estiga te how this reas on- ing layer could b e e xploited in the in tellige n t-a gent contexts. How ever, in Section 8, we relate our work with so me conceptual asp ects belo nging to this resear ch field. Consider now the first exa mple. Example 1 There are four agents which ha ve b een in vited to the sa me wedding part y . These are the desires of the agents: Agen t 1 will go to the party only if at least the ha lf of the total num b er of a g ents (not including himself ) go es there . Agen t 2 po ssibly do es not go to the party , but he tole rates such a n option. In case he go es, then he p ossibly drives the car. Agen t 3 would like to join the pa rty together with Agen t 2 , but he do es no t t r us t on Age n t 2 ’s dr iv ing s k ill. As a co ns equence, he decides to go to the party only if Agen t 2 bo th go es there and do es not wan t to drive the car . Agen t 4 do es not go to the party . Now, assume that some ag ent s ar e less autonomous than the others, i.e. they may decide either to join the pa r ty or not to go at all, p os sibly depending on the other agents’ choice. More ov er some ag ents may not require, yet toler a te so me options . The s tandard approa ch to representing communities by mea ns of lo gic-based agents (Satoh and Y amamoto 2002; Costan tini and T o cchio 2002; De V os et al. 200 5; Alber ti et al. 2004; Subra hmanian et al. 2000) is founded on suitable extensions of logic programming with negation as failur e ( not ) where eac h agent is repr e sented by a single progra m whose intended mo dels (under a suita ble semantics) are the agent’s desires/reque s ts. Although we take this as a starting p oint, it is still not suitable to mo del the ab ov e example b ecause of tw o following issues: 1. There is no natura l repres ent a tio n for tolera ted options, i.e. options which are not requested, but p ossibly acce pted (see Agen t 2 ). 2. A machinery is mis s ing which enables one agent to re a son a bo ut the b ehaviour of other agents (see Agent 1 and Agen t 3 ). In o rder to solve the fir st issue (item 1.) we use an extensio n of standard logic pr o- gramming exploiting the sp ecial predica te okay (), pr eviously introduced in (Bucca furri and Gottlob 2002). Therein a mo del-theoretic sema ntics aimed to repr esent a common a greement in a communit y of a g ents was given. How ever, r epresenting the requests/acceptances of single agen ts in a communit y is not eno ugh. Concerning item 2 ab ove, a social language should also pro vide a mac hinery to mo de l p o s sible in terfere nce among agents’ re a soning (in fact it is just suc h an interference that dis tinguishes the so- cial r easoning fr o m the individual one). T o this aim, we introduce a new co nstruct providing one a gent with the ability to reaso n a b o ut other ag ents’ mental s tate and then to act accor dingly . Progr am rules hav e the form: head ← [ selectio n condition ] { body } , A Know le dge-R epr esentation L anguage with So cial F e atu re s 3 T able 1. The wedding party (Exa mple 1 ) P 1 ( Agent 1 ) : go we dding ← [ n 2 − 1, ] { go we dding } P 2 ( Agent 2 ) : ok ay ( go we dding ) ← ok a y ( drive ) ← go we dding P 3 ( Agent 3 ) : go we dding ← [ Agent 2 ] { go we dding , not drive } P 4 ( Agent 4 ) : empty program where selection condition pr edicates a b out so me so cial co ndition conce r ning either the cardinality of communities o r particular individuals satisfying b o dy . F or instance, consider the following rule, b elo nging to a prog r am representing a given agent A : a ← [ l , h ] { b , no t c } This rule means that agent A will requir e a in ca se a n um b er ν of agents (other than A ) exists such that they requir e or tolerate b , neither require nor tolerate c and it holds that 0 ≤ l ≤ ν ≤ h ≤ n − 1. By default, l = 0 and h = n − 1. The nu mber n is a pa rameter – known b y each agent – repres e nt ing the total n um b er of agen ts (including the a gent A ). This enric hed language is refer red to a s SOcial Logic Pr ogramming (SOLP). The wedd ing party scenario of Exa mple 1 can be represented b y the four SOLP progr ams shown in T able 1, where the prog ram P 4 is empt y since the co rresp onding agent has not any r equest or desire to express. The in tended mo dels repre s ent the mental s tates of each ag ent inside the com- m unity . Concer ning the party , such mo dels ar e the following: M 1 = ∅ , M 2 = { go we dding P 1 , go we dding P 2 , drive P 2 } , and M 3 = { go we dding P 1 , go we dding P 2 , go we dding P 3 } , where the subscript P i (1 ≤ i ≤ n ) references , fo r each atom in a mo del, the program (resp. agent) that ato m is en tailed by . The mo dels resp ectively mean that either ( M 1 ) no ag ent will go to the party , ( M 2 ) only Agen t 1 and Agen t 2 will go and a ls o Age n t 2 will drive the car , or ( M 3 ) all ag ents but Agen t 4 will go to the party . Let us show why the ab ov e models represent the intended meaning of the pro - gram: M 1 is empty in case Agent 2 do es not go to the wedding party (i.e. go we dding is not derived by P 2 ). Indeed, in such a cas e, Agen t 3 will not go to o, since his re- quirements w.r.t. Agent 2 are not sa tisfied. Moreov er, since Ag en t 4 expresses nei- ther requirements nor toler ated options, he do es no t go to the pa rty (observe that such a behaviour is also represented by the mo de ls M 2 and M 3 ). Finally , Agent 1 requires that at lea st one 1 agent (other than himself ) go es to the party . As a conse- quence of the other a gents’ b ehaviour, Agen t 1 will not go. Th us, no agent will go to the pa r ty and M 1 is empt y . The intended meaning of M 2 is that b o th Agent 1 1 Since n 2 − 1 = 1, where n i s the total number of agents, i.e. n =4. 4 F. Buc c afurri and G. Caminiti and Agent 2 will g o to the par ty and Agen t 2 will a lso dr ive the car. In suc h a case Agen t 3 will not go s ince he re q uires that Agent 2 do es no t dr ive the ca r. The mo del M 3 represents the case in which Agen t 2 go es t o the pa rty , but do es not drive the car. Now, since all r equirements o f Agen t 3 are satisfied, then he also will go to the party . Certainly , Agen t 1 will join the other ag e nts, b ecause, in order to go to the par ty , he requires that at least one agent g o es there. The intended mo dels a re referr ed to as so cial mo de ls , since they ex pr ess the results of the interactions among agents. As it will b e analyzed in Section 6, the m ultiplicity of intended mo dels is induced bo th by negation o ccurring in rule b o dies and also directly by the so cial features , th us mak ing the a pproach no n-trivial. Let us informally introduce the most imp orta n t pro pe rties o f the semantics o f the language : • So cial conditions mo del reasoning conditio ned by the b ehaviour of other agents in the co mm unity . In particular, it is po ssible to represe nt collective men tal states, preserving the possibility of iden tifying the b ehaviour o f eac h agent. • It is p oss ible to nest so cia l co nditions, in or der to a pply recurs ively the so cial- conditioned rea soning to a gents’ subsets of the communit y . • Each so c ia l mo del re presents the mental state (i.e. desir es, req uirements, etc.) of every agent in ca se the so cial conditions imp osed by the ag ents ar e enabled. Observe that, in order to meet s uch goa ls, merging all the input SOLP prog rams it is no t enough, since this wa y we lose all informatio n ab o ut the relationship b etw een an atom a nd the pr ogra m (resp. agent) which such a n atom comes from. Therefore, we hav e to find a non-tr iv ial so lution. Our appro ach starts from (Buccafurri and Gottlob 20 0 2), where the Joint Fix- po int Semantics (J FP), that is a sema ntics providing a wa y to reach a compromise (in ter ms o f a common a greement) among a gents mo delled by lo gic prog rams, is prop osed. Therein, ea ch mo del contains atoms representing items b eing common to all the agents. The approa ch prop o s ed her e in o rder to r each a so cial- based conclu- sion is mor e gener al: the ag e nts’ b ehaviour is defined by taking int o ac c o unt so cia l conditions sp ecified by the ag ents themselves. Informally , a so cial condition is an expr e ssion [ selection condition ] { body } , where selection condition can b e o f tw o fo r ms: either (i) ca r dinality-based, or (ii) identit y- based. In the for mer case the ag ent r equires that a num b er of other agents (b ounded by selec tio n co ndition itself ) sa tisfy b o dy . In the latter case, sele c tion condition ident ifies which agent is required to sa tisfy b o dy . Given a program rule including a so cial condition such as head ← [ selection condition ] { body } , t he intuitiv e meaning is that head is derived if the so cial condition is satisfied. An example of cardinality-based condition (case (i) ab ov e) is sho wn in T able 1 by the pro gram P 1 : an in tended mo de l M will include the a tom go we dding P 1 if a set of programs S ′ ⊆ {P 2 , P 3 , P 4 } ex ists such that for ea ch P ∈ S ′ , it results that go we dding P belo ngs to M and a lso it holds th a t the num b er of programs in S ′ satisfies the so cial condition imp osed by the pro gram P 1 , that is | S ′ | ≥ n 2 − 1. An example o f case (ii) (iden tity-based condition) is repres ented by the progra m A Know le dge-R epr esentation L anguage with So cial F e atu re s 5 P 3 , which requests the atom go we dding P 3 to b e part o f a n intended model M if go we dding P 2 belo ngs to M , but the atom dri ve P 2 do es not. Imp or tantly , socia l conditions can b e nested ea ch other , as shown by the nex t example. Example 2 Consider a Peer-to- Peer file- sharing s ystem where a user can s hare his collection of files with other users on the Internet. In order to get better per formance, a file is split in sev eral parts being downloaded separately (possibly e ach part from a different user) 2 . The following SOLP pr ogra m P descr ib e s the behaviour o f an agent (acting o n b ehalf of a given us er) that wants to download every file X being shared by at lea s t a num b er min of users s uch that at least o ne of them owns a complete version o f X (rule r 1 ). Moreov er, the agen t toler ates to share an y file X of his, which is s ha red a lso by at leas t the 33% of the total num b er of user s in the net work and such that among those users, a n um b er o f them (b ounded betw een 20% and 70% o f the total) e x ists having a high bandwidth. In this cas e the agen t tolerates to share, since he is s ure tha t the net w or k tr affic will not be un balanced (rule r 2 ). Obser ve tha t the use of nested so cia l conditions in P is emphasize d by means of program indent a tio n. r 1 : downlo ad ( X ) ← [ min , ] { shar e ( X ) , [1 , ] { not i nc omplete ( X ) } , file ( X ) r 2 : okay ( shar e ( X )) ← [0.33 ∗ n , ] { shar e ( X ) , [0.2 ∗ n , 0.7 ∗ n ] { high bw } } , file ( X ) Now, one could argue that a differ ent c hoice concerning the s election condition could b e done. As a first observ ation we note that the chosen selection conditions play frequently an imp or tant r ole in common- s ense rea s oning. Indeed, it often hap- pens that the b eliefs and the choices o f a n individual dep end on how many people think or act in a cer tain wa y . F or instance, a p er son who needs a new mobile phone is in teres ted in collec ting – from his colleagues o r the In ternet – a num b e r of opin- ions o n a given mo del, in o rder to decide whether he s hould buy it. It occur s a lso that one is interested in the behaviour of a given p ers o n, in order to act or to infer so mething. F or example, tw o people are doing shopping together and do not wan t to buy the same clothes in order not to be dressed the same wa y . So, one of them decides no t to buy a given item, in case it has b een chosen b y his par tner. These short examples show that tw o imp or tant par ameters ac ting in the so cial in- fluence are either (i) the num ber or (ii) the identit y of the p eople inv olved. F or such a reas on, we propo se a simple, clea r-cut, yet genera l mechanism to repre s ent the selection of a so cial condition. As a seco nd observ ation we r emark that this work represents a first step to- wards a thorough s tudy on how to include in a classica l logic-pr o gramming setting the paradigm o f so cial interference, in order to directly repres e nt communit y-ba s ed 2 Among others, KaZaA, EMule and BitT orrent are the m ost p opular Internet P2P file-shar i ng systems exploiting such a feature. 6 F. Buc c afurri and G. Caminiti reasoning . T o this aim, w e fo cus on some suitable s election c o nditions, but w e ar e aw are that other possible c hoices migh t be considered. F rom this pers pe c tive, our work trie s to give some non-trivial contributions to wards what kind of features a knowledge represe nt atio n langua ge s hould include, in order to b e or ie nted to co m- plex scenario s. Anyw ay , as it will b e s hown by exa mples throughout the pap er, the chosen s o cial conditio ns com bined with the p ow er of nesting allow us to represent more articulated selections among age nts. Besides the definition o f the lang uage, of its semantics and the application to Knowledge Represen tation, a no ther co nt ributio n o f the pap e r is the transla tion of SOLP progr ams in to logic pr ograms with aggre g ates 3 . In particular, g iven a set of SOLP progr ams, a s ource-to- source tra nsformation exists which provides as output a single logic progr am with agg regates whose stable mo dels are in one- to-one corres po ndence with the so cial mo dels of the set of SOLP progr ams. The translation to logic progra ms with aggregates giv e us the p ossibility of exploiting existing engines to compute logic prog rams. Moreov er , Section 6 shows th a t our kind o f socia l re a soning is not trivial, since even in the cas e of p ositive prog rams, the sema nt ics of SOLP has a co mputational complexity which is NP- complete. The pap er is organized a s follows: in Sections 2 and 3 we define the notion o f SOLP pro grams and their semantics ( Socia l Semantics ), res pe ctively . In Section 4 we illustra te how a set of SOLP pro g rams, each r epresenting a different agen t, is translated into a single log ic pr ogra m with aggr egates whose stable mo dels describ e the mental s ta tes of the whole ag ent communit y and then w e sho w that such a translation is sound a nd complete. In Section 5 we prove that the So cial Semantics extends the JFP Semantics (Buccafurri and Gottlob 20 02) a nd in Section 6 we study the complexity o f s everal interesting decision problems. Section 7 describ es how this no vel appr oach may be used for knowledge repre s entation by means of several examples . Then, in Section 8 w e discuss related prop os a ls and, finally , we draw our conclusions ans sketc h the future directions of the work. In o rder to improv e the ov erall r eadability , these se ctions are follow ed by App endix A – where we hav e pla ced the pro ofs of the mo s t complicated technical res ults – and by the list of symbols and abbr eviations used throughout the pap er. 2 Synt ax of SOLP Programs In this s ection w e first introduce the notion of so cial co ndition and then we describ e the syntax of SOLP pro g rams. A term is either a v ar iable or a constant. V aria bles are denoted by strings sta rting with upp ercase letters, while those star ting with lower ca se letters denote co ns tants. An atom or positive literal is an expression p ( t 1 , · · · , t n ), where p is a predic a te of arity n a nd t 1 , · · · , t n are terms. A neg ative litera l is the negation as failure (NAF) not a of a g iven atom a . 3 As it will b e shown in Section 4, w e choose th e syn tax of t he non-disj unctiv e f r agmen t of DLP A (Dell’Armi et al. 2003), supp orted by the DL V s ystem (Leone et al. 2002). A Know le dge-R epr esentation L anguage with So cial F e atu re s 7 Definition 1 Given an in teger n > 0, a ( n -) so cial condition s , also r eferred to a s ( n -)SC, is a n expression of the form cond ( s ) pr op e rty ( s ), such that: (1) cond ( s ) is an ex pression [ α ] where α is either (i) a pair o f integers l , h such that 0 ≤ l ≤ h ≤ n − 1, or (ii) a string; (2) pr oper ty ( s ) = c ont e nt ( s ) ∪ sk el ( s ), where conten t ( s ) is a no n- empt y set of literals and sk el ( s ) is a (p ossibly empt y) set of SCs. n -so cial co nditions op erate over a c o llection of n pr o grams r epresenting the agent communit y . Each a gent is modelled b y a pr ogra m (we will formally define la ter in this s ection which kind of pr ogra ms are a llow ed). n re presents the total num b er of agents. In the following, whenever the con text is clear, n is omitted. Concerning item (1) of the ab ov e definition, in case (i), cond ( s ) is referred to as cardinal selection condition , while, in case (ii), c ond ( s ) is referred to as member selection condition . Concerning item (2) of Definition 1, if sk e l ( s ) = ∅ then s is said simple . F or a simple SC s such that content ( s ) is s ing leton, the enclo sing brace s can b e omitted. Finally , given a SC s , the for m ula not s is referred to as the NAF of s . The following are simple SCs extracted from our initial wedding par ty example (see T able 1): Example 3 [ n 2 − 1, ] { go we dding } . Example 4 [ Agen t 2 ] { go we dding , no t drive } . The s o cial c o nditions o cc ur ring in the example regar ding a Peer-to- Peer sys - tem (see Exa mple 2) are not simple. As a further e x ample, consider a SC s = [ l , h ] { a , b , c , [ l 1 , h 1 ] { d , [ l 2 , h 2 ] e } , [ l 3 , h 3 ] f } . O bserve that s is not simple, s ince sk el ( s ) = { [ l 1 , h 1 ] { d , [ l 2 , h 2 ] e } , [ l 3 , h 3 ] f } , mor eov er, conten t ( s ) = { a , b , c } . So cial conditions enable ag ents to sp ecify r equirements ov er either individual or groups within the age nt communit y , b y using mem be r or cardinal s election condi- tions, resp ectively . Mor e ov er, b y nesting so c ial conditions it is p ossible to declare requirements ov er sub-groups o f ag ents, provided that a sup er-gr oup sa tisfying a SC exists. In order to guarantee the correct specificatio ns of nested so cial conditions, the notion of w ell-fo r med so cial condition is introduced next. Given tw o n-SCs s and s ′ such that cond ( s ) = [ l , h ] a nd cond ( s ′ ) = [ l ′ , h ′ ] (0 ≤ l ≤ h ≤ n − 1, 0 ≤ l ′ ≤ h ′ ≤ n − 1), if h ′ ≤ h , then we wr ite cond ( s ′ ) ⊆ cond ( s ). A SC s is well-formed if either (i) s is simple, or (ii) s is not simple, cond ( s ) is a cardinal selection c ondition and ∀ s ′ ∈ s k el ( s ) it holds that either (a) cond ( s ′ ) is a cardinal selection condition, s ′ is a well-formed so cial condition a nd cond ( s ′ ) ⊆ cond ( s ), or (b) cond ( s ′ ) is a member selection condition and s ′ is simple. According to the int uitive explanation o f the ab ov e definition, it results that, bes ides simple SCs, only non- simple SCs with ca rdinal selection conditio n are ca n- didate to be well for med. Indeed, a non- simple SC with member selec tio n conditio n requires some pr op erty on a single target agent, but no further sub- group o f a gents 8 F. Buc c afurri and G. Caminiti could b e sp e cified b y means of SCs p os s ibly nested in it. Anyw ay , a fu r ther pr op- erty is r equired to SCs with cardina l selec tio n conditio n in orde r to be w ell-for med. In particular, given a non-simple SC s (with cardinal selection condition), all the SCs nested in s with ca r dinal condition must not exceed the cardinality constraints expressed b y c ond ( s ). Example 5 The SC s = [1 , 8] { a , [3 , 6 ] { b , [ Agent 2 ] { c , d } }} is w ell-formed. Note that the non- simple SCs s 1 = [ Agen t 3 ] { a , [3 , 6] { b }} and s 2 = [4 , 7] { a , [3 , 9 ] b } are not w ell- formed, b ecause c ond ( s 1 ) is a member selection co ndition and, concer ning s 2 , [3 , 9] b ∈ skel ( s 2 ) and [3 , 9] 6⊆ [4 , 7]. F rom now on, w e consider o nly w ell-fo r med SCs. W e in tro duce no w the notion o f r ule. Our definitio n g eneralizes the notio n of classical logic rule. Definition 2 Given an integer n > 0 , a ( n -) so cia l rule r is a for mula a ← b 1 ∧ · · · ∧ b m ∧ s 1 ∧ · · · ∧ s k ( m ≥ 0 , k ≥ 0), where a is an a tom, each b i (1 ≤ i ≤ m ) is a literal and eac h s j (1 ≤ j ≤ k ) is either a n -SC o r the NAF of a n -SC. Concerning the a bove definition, the atom a is r eferred to as the hea d of r , while the conjunction b 1 ∧ · · · ∧ b m ∧ s 1 ∧ · · · ∧ s k is referred to as the b o dy of r . In cas e a is o f the form okay ( p ), where p is an ato m, then r it is referred to as ( n -) tolerance (so cial) rule . In case k = 0, then a so cia l no n-tolerance rule is r eferred to as classical rule . So cial to lerance rules, i.e. rules with head of the form ok ay ( p ), enco de tolerance ab out the o ccurrence of p . The rule ok ay ( p ) ← body differs from the rule p ← body since the latter pro duce s the der iv a tion of p whene ver b o dy is sa tisfied, thus enco ding something that is r equired under the condition expre ssed b y b o dy . According to the former r ule ( okay ( p ) ← body ), th e truth of b o dy do e s not necessarily imply p , yet its deriv ation is not in cont ra st with the in tended meaning of the rule itself. In this sense, under the condition expres sed by b o dy , p is just tolerated . Given a rule r , we denote by hea d ( r ) (resp. body ( r )) the hea d (re sp. the b o dy) of r . Mo reov er, r is referr ed to as a fact in case the b o dy is empty , while r is referred to as an in tegr ity constraint if the head is missing . Example 6 An exa mple o f non-toler ance so cial r ule is a ← b , c , [1 , 9] { b , c , not g , [1 , 4 ] { d }} , [ P 2 ] { d } . An exa mple o f tolera nce so cia l rule is ok ay ( a ) ← not b , c , [1 , 6] { a , no t f , g } , not [ P 2 ] { d } . Definition 3 A SOLP collection is a set {P 1 , · · · , P n } of SOLP pro grams, where each SO LP progra m is a set of n -so cial rules. A SOLP pro gram is p os itive if no NA F sym b ol not oc c ur s in it. F or th e sak e of presentation we refer, in the following sections, to gro und (i.e., v a riable-fre e) SOLP progra ms – the extension to the ge neral case is straightforw ar d. A Know le dge-R epr esentation L anguage with So cial F e atu re s 9 3 Seman tics of SOLP programs In this section we intro duce the So cia l Semant ics , i.e. the semantics o f a co llection of SOLP pr ogra ms. W e a ssume that the reader is familiar with the basic co ncepts of logic progra mming (Gelfond and Lifschitz 1991; Ba ral 2003). W e start by introducing the notion o f interpretation for a single SO LP prog ram. An in terpretatio n for a ground (SOLP ) 4 progra m P is a s ubset of V ar ( P ), where V ar ( P ) is the set of atoms a ppea ring in P . A p ositive literal a (resp. a nega tive literal not a ) is true w.r.t. an in terpr etation I if a ∈ I (res p. a / ∈ I ); otherwise it is false . A rule is true w.r.t. I if its head is true o r its bo dy is false w.r.t. I . Recall that, for each traditional logic pr ogra m Q , the immediate consequence op erator T Q is a function from 2 V ar ( Q ) to 2 V ar ( Q ) defined as follows. F or each int er pr etation I ⊆ V ar ( Q ), T Q ( I ) consists o f the set of a ll heads o f rules in Q whose b o die s are true w.r.t. I . An interpretation I is a fixp oint of a logic prog ram Q if I is a fixp oint of the asso cia ted transforma tion T Q , i.e ., if T Q ( I ) = I . The set of all fixp oints of Q is denoted by FP ( Q ). Before defining the intended mo dels of our semantics, we need some pr e liminary definitions. Let P be a SO L P program. W e define the autonomous reduction of P , denoted by A ( P ), the progra m obtained from P by re moving all the SCs from the rules in P . The intuitiv e meaning is that in case the pro gram P r epresents the social behaviour o f an agent, then A ( P ) repr esents the b ehaviour o f the sa me agent in case he decides to op erate indep endently o f the other agents. Definition 4 Autonomous immediate consequence oper ator, applied to the SOLP program P Given a SOLP pro gram P and an interpretation I ⊆ V ar ( A ( P )), let TR ( A ( P )) b e the set of tolerance rules in A ( P ) a nd V ar ∗ ( A ( P )) b e the set V ar ( A ( P )) \ { ok ay ( p ) | ok ay ( p ) ∈ V ar ( A ( P )) } ∪ { p | ok ay ( p ) ∈ V ar ( A ( P )) } . The autonomous immediate consequence op erator A T P is the function fro m 2 V ar ∗ ( A ( P )) to 2 V ar ∗ ( A ( P )) , de fined as follows: A T P ( I ) = { head ( r ) | r ∈ A ( P ) \ TR ( A ( P )) ∧ body ( r ) is t r ue w.r.t. I } ∪ { a | head ( r ) = ok ay ( a ) ∧ r ∈ TR ( A ( P )) ∧ ( body ( r ) ∧ a ) is true w.r .t. I } . Observe that A T P , when a pplied to an interpretation I , extends the classical immediate conse quence op erato r T P , by collecting not only hea ds of no n- tolerance rules whose b o dy is true w.r.t. I , but also each a to m a o ccurring as ok ay ( a ) in the head of s ome rule such that b oth a and the rule b o dy ar e true w.r.t. I . Definition 5 An interpretation I fo r a SOLP p r ogram P is an autonomo us fixp oint of P if I is a fixp oint o f the as so ciated transfor mation A T P , i.e. if A T P ( I ) = I . The set of all autonomous fixpo ints of P is deno ted by AFP ( P ). 4 W e insert SOLP i nt o brack ets since the definition is the same as for traditional logic programs. 10 F. Buc c afurri and G. Caminiti Observe that by means of the a utonomous fixp o ints of a given SOLP pro gram P we represent the mental s tates of the corresp onding agent, assuming that ev ery so cial condition in P is not taken into account. Example 7 Consider the following SOLP progr am P : ok ay ( a ) ← b , [1 , ] { c } b ← [2 , 4] { d } It is easy to see that AFP ( P ) = { { b } , { a , b }} , i.e. the interpretations I 1 = { b } and I 2 = { a , b } a re the autonomous fixp oints of P , since it holds that A T P ( I 1 ) = I 1 and A T P ( I 2 ) = I 2 . Definition 6 Given a SOLP c o llection C = {P 1 , · · · , P n } , let P i (1 ≤ i ≤ n ) b e a SOLP progr am of C and L be a set o f a toms. The la b elled version of L w.r.t. P i , denoted by ( L ) P i is the set { a P i | a ∈ L } . Ea ch elemen t of ( L ) P i is referred to as a lab elled atom w.r.t. P i . Example 8 Given a SOLP program P 1 of a SOLP colle c tion C , if L = { a , b , c } , then ( L ) P 1 = { a P 1 , b P 1 , c P 1 } , where the pro gram iden tifier P 1 indicates the a sso ciated SOLP progra m. Now w e introduce the co nc e pt of so c ia l interpretation , dev oted to repr esenting the men tal states o f the co llectivity describ ed by a given SOLP collection and then w e give the definition of truth for both literals and SCs w.r.t. a g iven so cial int er pr etation. T o this aim, the cla ssical notion o f in terpr etation is ex tended b y means of progr am identifi er s introducing a link b etw een ato ms of the interpretation and progra ms of the SOLP collection. Definition 7 Let C = {P 1 , · · · , P n } b e a SOLP collection. A so cial in terpr etation for C is a set ¯ I = ( I 1 ) P 1 ∪ · · · ∪ ( I n ) P n , where I j is an interpretation for P j (1 ≤ j ≤ n ) and ( I j ) P j is the lab elled version of I j w.r.t. P j (see Definition 6). Example 9 Given C = {P 1 , P 2 , P 3 } , I 1 = { a , b , c } , I 2 = { a , d , e } and I 3 = { b , c , d } , where I j is an interpretation for P j (1 ≤ j ≤ 3), then ¯ I = { a P 1 , b P 1 , c P 1 , a P 2 , d P 2 , e P 2 , b P 3 , c P 3 , d P 3 } is a s o cial interpretation fo r C . W e define now the notio n of truth for literals , SCs and so cial rules, resp ectively . Let C = {P 1 , · · · , P n } b e a SOLP collec tio n. Given a so cial in terpr etation ¯ I for C and a p ositive liter al a ∈ S P ∈ C V ar ( P ), a (res p. not a ) is true for P j (1 ≤ j ≤ n ) w.r.t. ¯ I if a P j ∈ ¯ I (r esp. a P j / ∈ ¯ I ); other wise it is false . Because of the r e cursive nature of SCs, b efo r e giving the definition of truth for a SC s , we introduce a w ay to identify s (and also every SC nested in s ) o ccur ring in A Know le dge-R epr esentation L anguage with So cial F e atu re s 11 a given rule r of a SOL P progra m P . T o this a im, we first define a function which returns, for a given SC, its nesting depth. Given a SC s , we define the function depth as follows: depth ( s ) = depth ( s ′ ) + 1 if ∃ s ′ | s ∈ s k el ( s ′ ) 0 otherwise. Given a SOLP pr o gram P , a so cial rule r ∈ P and an in teger n ≥ 0, w e define the s et MSC hP , r , n i = { s | s is a SC o ccurr ing in r ∧ depth ( s ) = n } , i.e. the set in- cluding a ll the SCs having a given depth n and o ccurr ing in a so cia l rule r of a SOLP program P . Obser ve that, in cas e the par ameter n is zer o, then MSC hP , r , 0 i denotes the set of SCs as they app ear in the rule r of P . Example 10 Let a ← [1 , 8] { a , [3 , 6] { b , [ P 2 ] { c , d }}} , [2 , 3] { e , f } b e a rule r in a SOLP program P 1 . Then: MSC hP , r , 0 i = { [1 , 8] { a , [3 , 6] { b , [ P 2 ] { c , d } }} , [2 , 3 ] { e , f } } , MSC hP , r , 1 i = { [3 , 6] { b , [ P 2 ] { c , d } } } , MSC hP , r , 2 i = { [ P 2 ] { c , d } } , MSC hP , r , 3 i = ∅ . Given a SOLP progr am P , we define the set MSC P = S r ∈P MSC hP , r , 0 i . MSC P is the set of all the SCs (with depth 0) o ccurr ing in P . Now we provide the definition o f tr uth of a SC w.r.t. a given s o cial interpretation and, subsequently , the definition of tr uth o f a socia l rule. Definition 8 Let C = {P 1 , · · · , P n } b e a SOLP collec tio n, C ′ ⊆ C and P j ∈ C ′ . Given a so cial int er pr etation ¯ I for C and an n -SC s ∈ MSC P j , we say tha t s is true for P j in C ′ w.r.t. ¯ I if it holds that either: (1) cond ( s ) = [ P k ] ∧ ∃P k ∈ C ′ | ∀ a ∈ conten t ( s ) , a is true for P k w.r.t. ¯ I , or (2) cond ( s ) = [ l , h ] ∧ ∃ D ⊆ C ′ \ {P j } | l ≤ | D | ≤ h ∧ ∀ a ∈ content ( s ) , ∀P ∈ D , a is t r ue for P w.r .t. ¯ I ∧ ∀ s ′ ∈ sk e l ( s ) ∃ D ′ ⊆ D | s ′ is true for P j in D ′ w.r.t. ¯ I , where l , h are int eg ers and P k is a SOLP progra m. If C ′ = C , then we simply sa y t hat s is true f o r P j w.r.t. ¯ I . An n -SC not tr ue for P j (in C ′ ) w.r.t. ¯ I is false for P j (in C ′ ) w.r.t. ¯ I . Finally , the NAF of a n -SC s , no t s , is true (r esp. false ) for P j (in C ′ ) w.r.t. ¯ I if s is false (resp. true) for P j (in C ′ ) w.r.t. ¯ I . Informally , given a SC s included in P j , s is true for P j w.r.t. a s o cial interpretation ¯ I if a single SOLP progr am P k (resp. a set D of SO L P progra ms not including P j ) exists s uch that all the elements in content ( s ) ar e true for P k w.r.t. ¯ I (resp. for every pr o gram P ∈ D w.r.t. ¯ I , and such that every elemen t in sk el ( s ) is true for P j w.r.t. ¯ I ). Observe that the truth of pr oper ty ( s ) is p ossibly defined r ecursively , since s may contain nested SCs . 12 F. Buc c afurri and G. Caminiti Once the notio n of truth of SCs has b een defined, we are able to define the notion of truth of a so cial rule w.r.t. a so cia l in terpr e tation. Let C b e a SOLP collection and P ∈ C . Given a so cial interpretation ¯ I for C a nd a s o cial rule r in P , the head of r is t r ue w.r.t. ¯ I if either (i) ( head ( r ) = a ) ∧ ( a is true for P w.r.t. ¯ I ), or (ii) ( head ( r ) = ok ay ( a )) ∧ ( a is true for P w.r.t. ¯ I ). Moreov er , the bo dy o f r is true w.r.t. ¯ I if eac h element of body ( r ) is true for P w.r.t. ¯ I . Finally , the s o cial rule r is true w.r.t. ¯ I if its hea d is true w.r.t. ¯ I o r its bo dy is false w.r.t. ¯ I . Given a SOLP collection {P 1 , · · · , P n } , w e define the set o f candidate so cial in- terpretations for P 1 , · · · , P n as U ( P 1 , · · · , P n ) = ( F 1 ) P 1 ∪ · · · ∪ ( F n ) P n | F i ∈ AFP ( P i ) ∧ 1 ≤ i ≤ n , where, r ecall, AFP ( P i ) is the se t of autonomous fixpo int s of the SOLP pr ogra m P i (in tro duced in Definition 5) and by ( F i ) P (1 ≤ i ≤ n ) w e denote the labelled version of F i w.r.t. P (see Definition 6). The set U ( P 1 , · · · , P n ) repres ent s all the config urations o btained by combin ing the autonomous (i.e. without co nsidering the so cial conditions ) men tal states of the agents corr e sp onding t o the progr ams P 1 , · · · , P n . Each candidate so cial in terpre- tation is a c a ndidate intended mode l. The in tended mo dels ar e then obtained by enabling the so cial conditions. Now, w e are ready to give the definition o f intended mo del w.r .t. the So cial Semantics. Definition 9 Given a SO LP collection C = {P 1 , · · · , P n } and a socia l int er pretation ¯ I fo r C , let ¯ V b e the set ( V ar ( P 1 )) P 1 ∪ · · · ∪ ( V ar ( P n )) P n and TR ( P i ) b e the set of tolerance rules of P i (1 ≤ i ≤ n ). The so cial immediate consequence oper ator ST C is a function from 2 ¯ V to 2 ¯ V defined as follows: ST C ( ¯ I ) = { a P | P ∈ C ∧ r ∈ P \ TR ( P ) ∧ head ( r ) = a ∧ body ( r ) is true w.r.t ¯ I } ∪ { a P | P ∈ C ∧ r ∈ TR ( P ) ∧ head ( r ) = ok ay ( a ) ∧ a is true for P w.r.t ¯ I ∧ b ody ( r ) is true w.r.t ¯ I } . A candidate so cial interpretation ¯ I ∈ U ( P 1 , · · · , P n ) for C is a so cial mo del o f C if ST C ( ¯ I ) = ¯ I . So cial mo dels are defined as fixpo int s of the op era tor ST C . Given a so cial inter- pretation ¯ I , ST C ( ¯ I ) contains: 1. for each progr a m P in the SOLP collection C , the lab elled versions (w.r.t. P ) of the hea ds of non-tolerance r ules, such that the b o dy is true w.r.t. ¯ I (According to Definition 8, all the SCs included in the b o dy are chec ked w.r.t. the given so cial interpretation ¯ I ). 2. for ea ch prog ram P in the SOLP collection C , the lab elled versions (w.r.t. P ) of the arguments of the pr edicates ok ay o ccurr ing in the heads of tolerance rules, such that b o th the rule b o dy is true w.r .t. ¯ I and the predica te arg ument is true for P w.r.t. ¯ I . A Know le dge-R epr esentation L anguage with So cial F e atu re s 13 Observe that the so cial immediate consequence op era tor ST C works differently from the autonomo us immediate consequenc e op era tor A T P (see Definition 4), since the former exploits a ll the progra ms – and the s o cial conditions included – of a given SOLP collection C , while the latter op erates o nly within a given pro gram P , where the so cial conditions hav e bee n remo ved. Definition 10 Given a SOLP collection {P 1 , · · · , P n } , the So cial Semantics o f P 1 , · · · , P n is the set S OS ( P 1 , · · · , P n ) = { ¯ M | ¯ M ∈ U ( P 1 , · · · , P n ) ∧ ¯ M is a so cia l mo del o f P 1 , · · · , P n } . S OS ( P 1 , · · · , P n ) is the set of all so cial mo dels of P 1 , · · · , P n . Now, we int r o duce an imp ortant prop er t y holding for so cial mo dels, i.e. they ar e suppo rted in the associa ted SOLP co llection. The next definition gives the notion of suppor tness for a so cial mo del. Definition 11 Given a SOLP collection C = {P 1 , · · · , P n } and a so cial mo del M ∈ S OS ( P 1 , · · · , P n ), M is supp orted in C if ∀P ∈ C , ∀ a ∈ V ar ( P 1 ) ∪ · · · ∪ V ar ( P n ) , in case a P ∈ M , then at least one of the following holds : (1) ∃ r | r ∈ P ∧ head ( r ) = a ∧ body ( r ) is true w.r.t. M ; (2) ∃ r | r ∈ P ∧ he ad ( r ) = ok ay ( a ) ∧ a is true for P w.r.t M ∧ body ( r ) is true w.r.t M . The prop erty is stated in the following theo rem. The or em 1 Given a SOLP collection C = {P 1 , · · · , P n } , ∀ M ∈ S O S ( P 1 , · · · , P n ), M is sup- po rted in C . Pr o of By con tradictio n, assume that M ∈ S OS ( P 1 , · · · , P n ) and M is not suppo rted in C . As a consequence, ∃P , ∃ a | P ∈ C ∧ a ∈ [ P ∈ C V ar ( P ) ∧ a P ∈ M a nd b o th the following conditions ho ld: (1) ∀ r ∈ P , it holds that hea d ( r ) = a ⇒ b ody ( r ) is false w.r.t. M ; (2) ∀ r ∈ P , it holds that head ( r ) = ok ay ( a ) ⇒ a is false for P w.r.t. M ∧ body ( r ) is false w.r.t. M . It is easy t o see th a t, according to Definition 9 (page 12), a P 6∈ ST C ( M ). No w, since, a ccording to the h yp othes is , a P ∈ M , it holds that ST C ( M ) 6 = M . Th us M is not a so cial mo del and we hav e reached a contradiction. 14 F. Buc c afurri and G. Caminiti Example 11 Consider the following SOLP collection C = { P 1 , P 2 } : P 1 : a ← b , [ P 2 ] { c } ( r 1 ) P 2 : ← c ( r 2 ) It holds that AFP ( P 1 ) = {{ a , b } , ∅} , AFP ( P 2 ) = {∅} . Th us, there exist tw o candidate so cial interpretations, namely I 1 = { a P 1 , b P 1 } , I 2 = ∅ . Since both body ( r 1 ) and body ( r 2 ) are false w.r.t. I 1 , it holds t hat ST C ( I 1 ) = ∅ . As a consequence, I 1 is not a so cial model of the SOLP collection C . Co nc e r ning the so cial interpretation I 2 it is easy to s e e that ST C ( I 2 ) = ∅ . Hence, I 2 is a so cial mo del of the SOLP collection C . Now, consider a slightly differe nt SO LP collection C ′ = {P ′ 1 , P ′ 2 } : P ′ 1 : a ← b , [ P ′ 2 ] { c } ( r ′ 1 ) P ′ 2 : c ← ( r ′ 2 ) It holds that: A FP ( P ′ 1 ) = {{ a , b } , ∅} , AFP ( P ′ 2 ) = {{ c }} . Thus, we can build the following candidate so cial interpretations: I 1 = { a P ′ 1 , b P ′ 1 , c P ′ 2 } and I 2 = { c P ′ 2 } . Now, since ST C ′ ( I 1 ) = { a P ′ 1 , c P ′ 2 } and { a P ′ 1 , c P ′ 2 } 6 = I 1 , I 1 is not a so cial mo del of the collection C ′ = {P ′ 1 , P ′ 2 } . Fina lly , ST C ′ ( I 2 ) = I 2 , hence I 2 is a so cial mo de l of C ′ . It is easy to see that I 2 is supp orted in C ′ . Now, by means of a complete example, we illus tr ate the no tions introduce d a b ove. Example 12 Three agents are repre s ented by the SO LP collection C = { P 1 , P 2 , P 3 } next: P 1 : go p arty ← [2 , ] { go p arty , [1 , ] { guitar }} P 2 : go p arty ← [ P 3 ] { go p arty } guitar ← not b ad we ather , go p arty P 3 : go p arty ← not b ad we ather The intended meaning of the ab ove SO LP prog rams is the following: agent P 1 go es to the par t y only if there are at lea st other tw o age nts which go there and such that at lea st one of them br ings the guitar with him. Agent P 2 go es to the par ty only if agent P 3 go es to o . Moreov er, in case agent P 2 go es and the weather is not bad, then he thinks it is safe to bring the guitar with him. Finally , agent P 3 go es to the party if there is not evidence o f ba d weather. It is ea sy to see that S OS ( P 1 , P 2 , P 3 ) = { ¯ I } , where ¯ I is the in tended model of the collection C and ¯ I = { go p arty P 1 , go p arty P 2 , guitar P 2 , go p arty P 3 } . Indeed, it holds that AFP ( P 1 ) = {{ go p arty }} , A FP ( P 2 ) = {{ go p arty , guitar }} and AFP ( P 3 ) = { { go p arty }} . Now, note t hat the candidate so cia l interpretation ¯ I is a so cial model of C , since it ho lds that ST C ( ¯ I ) = ¯ I . Finally , it is easy to see that ¯ I is supp orted in C . A Know le dge-R epr esentation L anguage with So cial F e atu re s 15 4 T ranslation to Logic Programming with Aggregates In this sectio n we giv e the tra nslation from SOLP under the So cial Seman tics to logic pr ogramming with a ggreg ates 5 under the Stable Mo del Semantics. W e assume that the reader is familiar with the Stable Mo del Semantics (Gelfond and Lifschitz 1 988). Given a tra ditio nal log ic progra m P , we denote b y SM ( P ) the set of all the stable mo dels of P . F or the sak e of pres ent a tio n, the most complica ted pro ofs are placed in App endix A. Our goa l is the following: given a collectio n o f SOLP pro grams we hav e to g enerate a single LP A progra m whose stable mo dels are in o ne-to-one cor resp ondence with the so cial mo dels o f the co llection. T o this aim we p erfor m the tw o following tas ks: ( a ) we generate a LP A progra m b y means of a suitable transfo rmation of all the SCs o ccur ring in the SOLP pr ogra ms of the collection; ( b ) we obtain another log ic progra m by pro cessing the original SO LP pr ograms in suc h a w ay tha t the SCs are repla ced by suita ble atoms. Finally , w e merge the tw o progra ms obta ined from tasks ( a ) and ( b ) into a single L P A progra m. At the end of the section, we prese nt a comprehensive example (Example 13) descr ibing the whole translation pro ces s. Next we describ e how task ( a ) is per formed. The first step is the translatio n of a single SC and the extension of such a transla tion to all the SCs included in a so c ia l rule, a SOLP pr o gram and a SOLP collection, r e sp ectively . As a r e s ult of task ( a ), a sing le LP A progra m is g enerated which repres ents the transla tio n of the so c ial conditions occur r ing in the SOLP collection. In o rder to hav e fr esh literals that allow us to enco de – in s uch a prog ram – the truth of so cia l conditions, we need a mechanism to generate auxilia r y atoms tha t a re in one-to-one cor resp ondence with the so cial conditions o ccurring in a SOLP prog ram. Definition 12 Given a SOLP pro g ram P , w e define U SC P = S r ∈P S n ≥ 0 MSC hP , r , n i . Moreover, let L ρ and L g be t wo sets o f liter a ls such that b o th (1) V ar ( P ), L ρ , and L g are disjoint sets and (2) | L ρ | = | L g | = | U SC P | . W e define tw o one-to- one mappings: ρ : USC P → L ρ and g : USC P → L g . Observe that, acco r ding to th e definition o f the set MSC hP , r , n i (see page 11), USC P is the set o f all the SCs (at any nesting depth) in P . Th us, given a SC s included in a SOLP progra m P , the mapping ρ (resp. g ), returns the a uxiliary atom ρ ( s ) (resp. th e predicate g ( s )) suc h that it is f re s h, i.e. it do es no t o ccur in P . W e will explain next how ρ ( s ) a nd g ( s ) are exploited by the tr anslation pro cess. The following definition ena bles the translation of a sing le so cial conditio n s of a given progr am P of a SOLP collection C . O bserve that this de finitio n is recursive in order to pro duce the translation of every so cial conditio n nested in s . Such a trans- lation pro duces tw o sets of r ule s that we reference as GU ESS P ( s ) and CHECK P ( s ), resp ectively . Informa lly , the rules in the set GUESS P ( s ) aim a t verifying prop er- ties co ncerning ato ms b elonging to other SO L P pr ogra ms different from P . These 5 W e ch o ose the syn tax of the non-disjunctiv e f ragment of DLP A (Dell’Armi et al. 2003), denoted as LP A in the sequel of the section. The DL V system (Leone et al. 2002) can b e used to compute the so cial mo dels of the SOLP programs. 16 F. Buc c afurri and G. Caminiti prop erties are then chec ked a ccording to the selection condition o f s (i.e. c ond ( s )) by means of the rules included in the s et CHECK P ( s ). In the definition, ρ ( s ) P denotes the a tom ρ la b elled ato m w.r.t. P (see Defini- tion 6) and it is de r ived in case the so cia l condition s is true for P in C w.r .t. a given so cial interpretation. With a little abuse of notation, ( g ( s ))( x ) P denotes the predicate g ( s ) lab elled w.r.t. P , having argument x . Definition 13 Given a SOLP collection SP = {P 1 , · · · , P n } , a n integer j (1 ≤ j ≤ n ), a SOLP progra m P j ∈ S P and a so cia l condition s ∈ U S C P j , we define the SC translation of s a s the LP A progra m Ψ P j ( s ) = GUESS P j ( s ) ∪ C HECK P j ( s ), where both GUESS P j ( s ) = = { ( g ( s ))( k ) P j ← V b ∈ co ntent ( s ) b P k } , if cond ( s ) = [ P k ] ∧ ( 1 ≤ k ≤ n ) , { ( g ( s ))( i ) P j ← V b ∈ co ntent ( s ) b P i ∧ V s ′ ∈ skel ( s ) ρ ( s ′ ) P j | 1 ≤ i 6 = j ≤ n } ∪ S s ′ ∈ skel ( s ) GUESS P j ( s ′ ) , if cond ( s ) = [ l , h ], CHECK P j ( s ) = = { ρ ( s ) P j ← ( g ( s ))( k ) P j } , if cond ( s ) = [ P k ] ∧ (1 ≤ k ≤ n ) , { ρ ( s ) P j ← l ≤ # coun t { K : ( g ( s ))( K ) P j , K 6 = j } ≤ h } ∪ S s ′ ∈ skel ( s ) CHECK P j ( s ′ ) , if cond ( s ) = [ l , h ] and #c ount deno tes a n aggr egate function which r eturns the cardinality o f a se t of literals satisfying some conditions (Dell’Armi et a l. 2003). The rea der may find an instance of application of the ab ov e tra nsformation in the final exa mple (Example 1 3, page 22 ). Now, b y means of the next definitio n, we extend the sco p e of the ab ov e translatio n to a so cia l rule, a SOLP progra m and a SOLP collection. Definition 14 Given a SOL P pr ogra m P , a so cial rule r ∈ P and a SOLP collection {P 1 , · · · , P n } , we define: 1. the SC trans lation o f r as the LP A progra m T P ( r ) = S s ∈ MSC P Ψ P ( s ); 2. the SC trans lation o f P as the LP A progra m W P = S r ∈P T P ( r ); 3. the SC tra ns lation o f the colle c tio n as the LP A progra m C ( P 1 , · · · , P n ) = S 1 ≤ i ≤ n W P i . Observe that given a SO LP prog ram P , for any clas s ical rule r ∈ P , T P ( r ) = ∅ . As a consequence, for any pro gram P with no so cial r ule s , it holds that W P = ∅ . C ( P 1 , · · · , P n ) de no tes the LP A progra m obtained from the pro cess ing of all the SCs included in the SOL P collec tion {P 1 , · · · , P n } . The g eneration of C ( P 1 , · · · , P n ) is the final step of the task ( a ) within the who le tra nslation machinery . Now, we descr ibe task ( b ). W e intro duce a suitable mapping from SO LP pro grams A Know le dge-R epr esentation L anguage with So cial F e atu re s 17 to tra ditional lo gic progra ms 6 , and then we apply such a transfo r mation to each SOLP prog r am in a given SOLP collection. Finally , w e combine the tra ditional logic progra ms so obtained into a sing le progra m. Before introducing the mapping, we nee d a prelimina ry pro cess ing of a ll tolera nce rules in a SOLP progra m. This is done by means of the fo llowing transforma tion: Definition 15 Given a SOLP prog ram P , w e define the SO LP pr ogra m ˆ P = P \ TR ( P ) ∪ { p ← p ∧ body ( r ) | r ∈ TR ( P ) ∧ head ( r ) = ok ay ( p ) } . Note that ˆ P is obtained from P by replacing eac h tolerance rule okay ( p ) ← body with the rule p ← p , body . The next step is giving a mapping from a SOLP prog r am to a traditional lo gic progra m. Definition 16 Let P b e a SO LP prog r am. W e define the prog ram Γ ′ ( ˆ P ) o ver the set o f atoms V ar (Γ ′ ( ˆ P )) = { a P | a ∈ V ar ( A ( ˆ P )) } ∪ { a ′ P | a ∈ V ar ( A ( ˆ P )) } ∪ { sa P | a ∈ V ar ( A ( ˆ P )) } ∪ { f ail P } as Γ ′ ( ˆ P ) = S ′ 1 ( ˆ P ) ∪ S ′ 2 ( ˆ P ) ∪ S ′ 3 ( ˆ P ), where S ′ 1 ( ˆ P ), S ′ 2 ( ˆ P ) and S ′ 3 ( ˆ P ) ar e defined a s follows: S ′ 1 ( ˆ P ) = { a P ← not a ′ P | a ∈ V ar ( A ( ˆ P )) } ∪ { a ′ P ← not a P | a ∈ V ar ( A ( ˆ P )) } , S ′ 2 ( ˆ P ) = { sa P ← b 1 P , · · · , b n P , ρ ( s 1 ) P , · · · , ρ ( s m ) P | a ← b 1 , · · · b n , s 1 , · · · , s m ∈ P } , S ′ 3 ( ˆ P ) = { f ail P ← not f ai l P , sa P , not a P | a ∈ V ar ( A ( ˆ P )) }∪ { f ai l P ← not f ai l P , a P , not sa P | a ∈ V ar ( A ( ˆ P )) } where A () is the autonomous reduction op er ator (see page 9). In words, given a SOLP progr am P , firs t a progr am ˆ P is pro duced (according to Definition 15) such tha t a ll the predicates okay () occur ring in it are suitably translated. Then, according to Definition 16, three sets of standard log ic rules are generated from ˆ P , refer e nced as S ′ 1 ( ˆ P ), S ′ 2 ( ˆ P ) and S ′ 3 ( ˆ P ). Obser ve that atoms o ccur- ring in these sets are la b elled w.t.r. the sour ce pr o gram P in or der not to generate name mismatch in the final mer ging phas e. Infor ma lly , the set S ′ 1 ( ˆ P ) guesses atoms that a r e candidates to be included in a so cial mo del. By means of the rules included in the set S ′ 2 ( ˆ P ), atoms that are supp orted by a so cial rule ar e inferr ed. The atoms denoted b y ρ ( s i ) P (1 ≤ i ≤ m ) are in one-to- o ne co rresp ondence with those gen- erated by W P (see Definition 14) and represent the social co nditions o ccurring in P . Finally , the set S ′ 3 ( ˆ P ) ensures tha t an atom is derived by mea ns of s o me rule in S ′ 2 ( ˆ P ) iff it is also g uessed by some rule in S ′ 1 ( ˆ P ). The next definition intro duces a logic progr am representing the tr anslation of the whole SOLP collection. 6 Note that, di fferently from task ( a ), the l ogic program here generated do not contain aggregates. 18 F. Buc c afurri and G. Caminiti Definition 17 Given a SOLP collection { P 1 , · · · , P n } , we define the pr ogram P ′ u = S 1 ≤ i ≤ n Γ ′ ( ˆ P i ). P ′ u is obtained by com bining the transla tions of all the SOLP prog rams in a given SOLP collection, where the so cia l conditions are r eplaced by ρ -atoms. The generation of P ′ u concludes task ( b ) of the tra nslation pro cess. Then, the prog ram P ′ u is mer g ed with the LP A progra m C ( P 1 , · · · , P n ) – obtained as a result of t a s k ( a ) – in order to enable the so cial conditions (re call that C ( P 1 , · · · , P n ) contains the ρ -atoms as hea ds of rules, t hus allowing the activ a tion of some rule bo dies in P ′ u ). Finally , the so cial mo dels of the SOLP collection {P 1 , · · · , P n } can b e found by computing the stable mo dels of the lo gic pr ogra m P ′ u ∪ C ( P 1 , · · · , P n ). Once w e ha ve describ ed ho w the translatio n mechanism proceeds, w e need to demonstrate that it is so und and complete. T o this a im, we hav e to prove the following results: (1) The ρ -a to ms o ccurring in C ( P 1 , · · · , P n ) a re in one-to-o ne corresp ondence with true SCs for {P 1 , · · · , P n } . (2) A one-to-one corresp ondence exists b etw een the so cial mo dels of P 1 , · · · , P n and the stable mo dels of the LP A progra m P ′ u ∪ C ( P 1 , · · · , P n ). First, w e prove item (1 ) abov e. L emma 1 Given a SOLP collection SP = {P 1 , · · · , P n } , a n integer j (1 ≤ j ≤ n ), a SOLP progra m P j ∈ SP , a so cial in terpreta tion ¯ I for S P a nd a SC s ∈ MSC P j , it holds that s is true for P j w.r.t. ¯ I iff ∃ M ∈ SM ( C ( P 1 , · · · , P n ) ∪ Q ) s.t. ρ ( s ) P j ∈ M , where Q = { a ←| a ∈ ¯ I } . Pr o of See Appendix A. Int uitively , a given so cial in terpre ta tion ¯ I will infer r ule heads in C ( P 1 , · · · , P n ). These are either lab elled ρ -atoms or lab elled g - pr edicates. Lemma 1 states that the ρ -ato ms o ccurring in C ( P 1 , · · · , P n ) ar e in one-to-o ne c o rresp o ndence with true so cial conditions. Now, since those ρ - atoms o ccur a lso in rule b o dies of P ′ u , in order to repla ce the co rresp onding SCs (recall Definitions 16 and 17), they contribute to infer rule heads in P ′ u , w hich represent element s in a so cia l mo del of the collection {P 1 , · · · , P n } . Our inten tion is to compute the so cial mo dels of P 1 , · · · , P n in terms of the s table mo dels of th e logic progr am P ′ u ∪ C ( P 1 , · · · , P n ) 7 . Th us, we must pro ve item (2). T o this aim, let us recall from (Buccafurri and Gottlob 2002) some definitions and results that we shall use later. Definition 18 ( Buc c afurri and Go tt lob 2002 ) Let P b e a tra ditional lo gic pro g ram and M ⊆ V ar ( P ). W e deno te by [ M ] P the set { a P | a ∈ M } ∪ { a ′ P | a ∈ V ar ( P ) \ M } ∪ { sa P | a ∈ M } . 7 This can be efficient ly accomplished by using the DL V system (Leone et al. 2002) A Know le dge-R epr esentation L anguage with So cial F e atu re s 19 Definition 19 ( Buc c afurri and Go tt lob 2002 ) Let P b e a p ositive progra m. W e define the prog ram Γ( P ) over the set of a toms V ar (Γ( P )) = { a P | a ∈ V ar ( P ) } ∪ { a ′ P | a ∈ V ar ( P ) } ∪ { sa P | a ∈ V ar ( P ) } ∪ { f ail P } as the union of the sets of rules S 1 , S 2 and S 3 , defined as follows: S 1 = { a P ← not a ′ P | a ∈ V ar ( P ) } ∪ { a ′ P ← not a P | a ∈ V ar ( P ) } S 2 = { sa P ← b 1 P , · · · , b n P | a ← b 1 , . . . b n ∈ P } S 3 = { f ail P ← not f ai l P , sa P , not a P | a ∈ V ar ( P ) }∪ { f ai l P ← not f ai l P , a P , not sa P | a ∈ V ar ( P ) } . Note that Definition 16 (introducing Γ ′ ) c a n b e view ed as an extensio n of the ab ov e definition, sinc e the former takes in to ac count so cial co nditions, while the latter do es not. In fact, the tr ansformations Γ ′ and Γ pro duce the same result in case of progra ms with no so cia l conditio ns . Pr op osition 1 Given a SOLP progr am P , it holds that Γ ′ ( A ( ˆ P )) = Γ( A ( ˆ P )). Pr o of Since A ( ˆ P ) contains no so cial condition, it is easy to see that, according to Defi- nitions 16 and 1 9 (pages 17 and 19), S ′ 1 ( A ( ˆ P )) = S 1 ( A ( ˆ P )), S ′ 2 ( A ( ˆ P )) = S 2 ( A ( ˆ P )) and S ′ 3 ( A ( ˆ P )) = S 3 ( A ( ˆ P )). As a co nsequence, Γ ′ ( A ( ˆ P )) = Γ( A ( ˆ P )). L emma 2 ( Buc c afurri and Gottlob 2002 ) Let P b e a traditional log ic pro gram. Then SM (Γ( P )) = [ F ∈ FP ( P ) { [ F ] P } . Once we hav e r ecalled the results from (Buccafurr i and Go ttlob 2002), w e in tro - duce some more results that we shall use in o rder to pr ov e item (2). Pr op osition 2 Let P b e a SOLP prog ram. Then FP ( A ( ˆ P )) = AFP ( P ). Pr o of First o bserve that, giv en a SO LP program P , it holds that A ( ˆ P ) = ˆ Q where Q = A ( P ), i.e. the result of the joint applica tion of the tw o op erator s A () and ˆ is inv ariant w.r.t. to the order of applicatio n. In fact, accor ding t o the definitions of bo th A () (see pa ge 9) and ˆ (see Definition 15 on page 17), it is eas y to see that the former opera tes only o n so cia l conditions, while the la tter does not, since it op erates on b oth sta ndard atoms and ok ay predicates . Thus, the tw o op erators hav e disjoint application domains. Hence, the order of applicatio n is no t r elev ant . As a result it holds that, FP ( A ( ˆ P )) = FP ( ˆ Q ) where Q = A ( P ) and, acc o rding to the tra ditional definition of fixp oint of a logic program (page 9 ), FP ( ˆ Q ) = { X | T ˆ Q ( X ) = X ∧ X ∈ 2 V ar ( ˆ Q ) } . Now, a ccording to the definition of the c la ssical immedia te c onsequence o p er ator 20 F. Buc c afurri and G. Caminiti (page 9), T ˆ Q ( X ) = { he ad ( r ) | r ∈ ˆ Q ∧ body ( r ) is true w .r .t. X } , moreov er , a ccord- ing to Definition 15 (page 17), ˆ Q = Q \ TR ( Q ) ∪ { a ← a , body ( r ) | r ∈ TR ( Q ) ∧ head ( r ) = ok ay ( a ) } . As a consequence, T ˆ Q ( X ) = = { he ad ( r ) | r ∈ Q \ TR ( Q ) ∧ body ( r ) is true w.r.t. X } ∪ { a | he ad ( r ) = ok a y ( a ) ∧ r ∈ TR ( Q ) ∧ ( a ∧ body ( r )) is true w.r.t. X } = = A T P ( X ) (see Definition 4, page 9). It is easy to s ee that FP ( A ( ˆ P )) = FP ( ˆ Q ) = { X | T ˆ Q ( X ) = X ∧ X ∈ 2 V ar ( ˆ Q ) } = { X | A T P ( X ) = X ∧ X ∈ 2 V ar ( A ( ˆ P )) } . Now, o bs erve that V ar ( A ( ˆ P )) = V ar ∗ ( A ( P )) (see Definition 4), s ince after the application o f the op erato r ˆ to A ( P ), eac h predicate ok ay ( p ) is replaced by its argument p , and, according to Definition 4, for ea ch predicate okay ( p ) app ear ing in A ( P ), okay ( p ) does not o cc ur in V ar ∗ ( A ( P )), but t he a rgument p do es. As a co nsequence, it holds that { X | A T P ( X ) = X ∧ X ∈ 2 V ar ( A ( ˆ P )) } = { X | A T P ( X ) = X ∧ X ∈ 2 V ar ∗ ( A ( P )) } = AFP ( P ). Now we extend Definition 18 and Lemma 2, g iven in (Buccafurri and Gottlob 20 02), to SOLP progra ms. Definition 20 Let P b e a (SOLP) progr am and M ⊆ V ar ( P ). W e denote by [ M ] P the set { a P | a ∈ M } ∪ { a ′ P | a ∈ V ar ( A ( ˆ P )) \ M } ∪ { sa P | a ∈ M } . Given a (SOLP) progr a m P , the op er a tor [ ] P pro duces a set of auxiliary atoms lab elled w.r.t. P . Those ato ms are used in the translation pr o cess. Observe that the abov e definition extends Definition 18, since in ca se P is a traditio nal logic progra m, then V ar ( A ( ˆ P )) = V ar ( P ) and th us the tw o definitions match. The a bove results are now exploited in order to prove that, by applying the ab ov e op erator [ ] P to the autonomous fixp oints of a giv en SOLP program P , w e obta in the stable mo dels of the transla tion of the a utonomous version of P . L emma 3 Given a SOLP progr am P , it holds that: SM (Γ ′ ( A ( ˆ P ))) = [ F ∈ AFP ( P ) { [ F ] P } . Pr o of By vir tue of Pr op osition 1 (page 19), Γ ′ ( A ( ˆ P )) = Γ( A ( ˆ P )). As a consequence, SM (Γ ′ ( A ( ˆ P ))) = S M (Γ( A ( ˆ P ))). Now, denoting A ( ˆ P ) by Q , by virtue of Lemma 2 (page 19), S M (Γ( Q )) = S F ∈ FP ( Q ) { [ F ] Q } . Acco rding to Definition 18 (page 18), [ F ] Q = { a Q | a ∈ F } ∪ { a ′ Q | a ∈ V ar ( Q ) \ F } ∪ { sa Q | a ∈ F } . Now, r e call that Q = A ( ˆ P ). Q repre s ents the SOLP pro g ram P , after the appli- cation of both op erators ˆ and A (). As a conseq uence, atoms in [ F ] Q are labelled w.r.t. P . Observe that atoms in Γ ′ ( A ( ˆ P )) ar e lab elled w.r .t. P to o. Therefor e, with a little abuse of notatio n, we can write [ F ] Q = { a P | a ∈ F } ∪ { a ′ P | a ∈ A Know le dge-R epr esentation L anguage with So cial F e atu re s 21 V ar ( A ( ˆ P )) \ F } ∪ { sa P | a ∈ F } = [ F ] P , accor ding to Definition 20 (page 20) and since Q is a tra ditional logic progra m. Now, we hav e obtained that SM (Γ( A ( ˆ P ))) = S F ∈ FP ( A ( ˆ P )) { [ F ] P } . Since, by virtue o f Pr op osition 2 (page 19), FP ( A ( ˆ P )) = AFP ( P ), it results that [ F ∈ FP ( A ( ˆ P )) { [ F ] P } = [ F ∈ AFP ( P ) { [ F ] P } . Now w e extend Lemma 3 to a whole SO LP collec tion, but first let us r ecall the following result from (Eiter et al. 19 97). L emma 4 ( Eiter et al. 1 997 ) Let P = P 1 ∪ P 2 be a prog ram such that V ar ( P 1 ) ∩ V ar ( P 2 ) = ∅ . Then SM ( P ) = [ M 1 ∈ SM ( P 1 ) , M 2 ∈ SM ( P 2 ) { M 1 ∪ M 2 } . L emma 5 Given a SOLP collection {P 1 , · · · , P n } , consider the following s ets: (1) P u = S 1 ≤ i ≤ n Γ ′ ( A ( ˆ P i )) , (2) SM ( P u ) , and (3) B = { ( F 1 ) P 1 ∪ ( G 1 ) P 1 } S · · · S { ( F n ) P n ∪ ( G n ) P n } | ∀ i 1 ≤ i ≤ n F i ∈ AFP ( P i ) ∧ ( G i ) P i = [ F i ] P i \ ( F i ) P i . It holds that SM ( P u ) = B . Pr o of F or each i and j such tha t 1 ≤ i 6 = j ≤ n , according to Definition 16 (page 1 7), it holds that V ar (Γ ′ ( A ( ˆ P i ))) ∩ V ar (Γ ′ ( A ( ˆ P j ))) = ∅ . It is easy to see that: SM ( P u ) = SM ( S 1 ≤ i ≤ n Γ ′ ( A ( ˆ P i ))) = (by vir tue of Lemma 4, page 21) = [ M 1 ∈ SM (Γ ′ ( A ( ˆ P 1 ))) , ··· , M n ∈ SM (Γ ′ ( A ( ˆ P n ))) { M 1 ∪ · · · ∪ M n } . Note tha t, for each i (1 ≤ i ≤ n ), M i ∈ SM (Γ ′ ( A ( ˆ P i )) and, by virtue of Le mma 3 (page 20), SM (Γ ′ ( A ( ˆ P i )) = S F ∈ AFP ( P ) { [ F ] P } . Th us, [ M 1 ∈ SM (Γ ′ ( A ( ˆ P 1 ))) , ··· , M n ∈ SM (Γ ′ ( A ( ˆ P n ))) { M 1 ∪ · · · ∪ M n } = = [ F 1 ∈ AFP ( P 1 ) , ··· , F n ∈ AFP ( P n ) { [ F 1 ] P 1 ∪ · · · ∪ [ F n ] P n } . Now, for each i ( 1 ≤ i ≤ n ), let us denote b y ( G i ) P i the s et [ F i ] P i \ ( F i ) P i . It is easy to see that: [ F 1 ∈ AFP ( P 1 ) , ··· , F n ∈ AFP ( P n ) { [ F 1 ] P 1 ∪ · · · ∪ [ F n ] P n } = = [ F 1 ∈ AFP ( P 1 ) , ··· , F n ∈ AFP ( P n ) {{ ( F 1 ) P 1 ∪ ( G 1 ) P 1 } ∪ · · · ∪ { ( F n ) P n ∪ ( G n ) P n }} = = B . 22 F. Buc c afurri and G. Caminiti Before proving item (2) w e need a further definition, intro ducing the notion of a set of ρ -atoms and g -predicates asso ciated, by vir tue of Lemma 1, with the so c ia l conditions true for a given SOLP pro g ram w.r.t. a s o cial interpretation. Definition 21 Given a SOLP collection SP = {P 1 , · · · , P n } , a so cial in terpr etation ¯ I fo r S P , a SOLP pro gram P ∈ SP a nd a SC s ∈ MSC P , let Q = { a ←| a ∈ ¯ I } . W e define the set SA T P ¯ I ( s ) = = h | h = head ( r ) , r ∈ Ψ P ( s ) ∧ ( ∃ M ∈ SM ( C ( P 1 , · · · , P n ) ∪ Q ) | h ∈ M ) . Observe that in case s is true for P w.r.t. ¯ I , SA T P ¯ I ( s ) includes the atom ρ ( s ) P and those heads of the rules in Ψ P ( s ) (recall from Definition 13 that Ψ P ( s ) = GUESS P ( s ) ∪ CHECK P ( s )) c o rresp onding to b oth the so cial conditio n s and the SCs nested in s . Finally , we are ready to prov e item (2). The next theorem states that a one- to- one co rresp ondenc e exists b etw een the so cial mo dels in S O S ( P 1 , · · · , P n ) and the stable mo dels of the LP A progra m P ′ u ∪ C ( P 1 , · · · , P n ). The or em 2 Given a SOLP collection SP = {P 1 , · · · , P n } , it holds that A = B , where : A = SM ( P ′ u ∪ C ( P 1 , · · · , P n )) and B = { ¯ F ∪ ¯ G ∪ ¯ H | ¯ F = S 1 ≤ i ≤ n ( F i ) P i ∧ F i ∈ AFP ( P i ) ∧ ¯ F ∈ S O S ( P 1 , · · · , P n ) ∧ (1) ¯ G = S 1 ≤ i ≤ n ( G i ) P i ∧ ( G i ) P i = [ F i ] P i \ ( F i ) P i ∧ (2) ¯ H = S 1 ≤ i ≤ n ( H i ) P i ∧ ( H i ) P i = S s ∈ MSC P i SA T P i ¯ F ( s ) } . (3) Pr o of See Appendix A. As a result o f the ab ove theorem, each s ta ble model X o f the progr am P ′ u ∪ C ( P 1 , · · · , P n ) may b e partitioned in thr ee sets: ¯ F (representin g the corresp onding so cial mo del of the SOLP co llection), ¯ G and ¯ H (eac h including auxiliary liter - als needed by the transla tio n). Th us, it is p ossible to find the so cia l mo dels o f P 1 , · · · , P n by a p ost-pro ces sing of the stable mo dels of P ′ u ∪ C ( P 1 , · · · , P n ), which drops the sets ¯ G and ¯ H . Example 13 Before closing the section, we present the following log ic progra m P = P ′ u ∪ C ( P 1 , · · · , P 4 ) resulting from the trans lation of the SOLP collection {P 1 , · · · , P 4 } presented in Example 1 (see Section 1, T able 1). A Know le dge-R epr esentation L anguage with So cial F e atu re s 23 r 1 : go we dding P 1 ← n ot go we dding ′ P 1 r 2 : go we dding ′ P 1 ← n ot go we dding P 1 r 3 : s go we dding P 1 ← ρ 1 1 P 1 r 4 : fail P 1 ← n ot fail P 1 , s go we dding P 1 , not go we dding P 1 r 5 : fail P 1 ← n ot fail P 1 , go we dding P 1 , not s go we dding P 1 r 6 : go we dding P 2 ← n ot go we dding ′ P 2 r 7 : go we dding ′ P 2 ← n ot go we dding P 2 r 8 : drive P 2 ← n ot drive ′ P 2 r 9 : drive ′ P 2 ← n ot drive P 2 r 10 : s go we dding P 2 ← go we dding P 2 r 11 : s drive P 2 ← drive P 2 , go we dding P 2 r 12 : fail P 2 ← n ot fail P 2 , s go we dding P 2 , not go we dding P 2 r 13 : fail P 2 ← n ot fail P 2 , go we dding P 2 , not s go we dding P 2 r 14 : fail P 2 ← n ot fail P 2 , s drive P 2 , not drive P 2 r 15 : fail P 2 ← n ot fail P 2 , drive P 2 , not s drive P 2 r 16 : go we dding P 3 ← n ot go we dding ′ P 3 r 17 : go we dding ′ P 3 ← n ot go we dding P 3 r 18 : s go we dding P 3 ← ρ 1 1 P 3 r 19 : fail P 3 ← n ot fail P 3 , s go we dding P 3 , not go we dding P 3 r 20 : fail P 3 ← n ot fail P 3 , go we dding P 3 , not s go we dding P 3 r 21 : g 1 1(2) P 1 ← go we dding P 2 r 22 : g 1 1(3) P 1 ← go we dding P 3 r 23 : ρ 1 1 P 1 ← 1 ≤ # c ount { K : g 1 1( K ) P 1 , K <> 1 } ≤ 3 r 24 : g 1 1(2) P 3 ← go we dding P 2 , not drive P 2 r 25 : ρ 1 1 P 3 ← g 1 1(2) P 3 Observe that, acc o rding to Definition 16, Γ ′ ( ˆ P 1 ) = S ′ 1 ( ˆ P 1 ) ∪ S ′ 2 ( ˆ P 1 ) ∪ S ′ 3 ( ˆ P 1 ), where S ′ 1 ( ˆ P 1 ) = { r 1 , r 2 } , S ′ 2 ( ˆ P 1 ) = { r 3 } and S ′ 3 ( ˆ P 1 ) = { r 4 , r 5 } . Concerning the SOL P progra m P 2 , Γ ′ ( ˆ P 2 ) = S ′ 1 ( ˆ P 2 ) ∪ S ′ 2 ( ˆ P 2 ) ∪ S ′ 3 ( ˆ P 2 ), where S ′ 1 ( ˆ P 2 ) = { r 6 , r 7 , r 8 , r 9 } , S ′ 2 ( ˆ P 2 ) = { r 10 , r 11 } and S ′ 3 ( ˆ P 2 ) = { r 12 , r 13 , r 14 , r 15 } . Γ ′ ( ˆ P 3 ) = S ′ 1 ( ˆ P 3 ) ∪ S ′ 2 ( ˆ P 3 ) ∪ S ′ 3 ( ˆ P 3 ), w he r e S ′ 1 ( ˆ P 3 ) = { r 16 , r 17 } , S ′ 2 ( ˆ P 3 ) = { r 18 } a nd S ′ 3 ( ˆ P 3 ) = { r 19 , r 20 } . Finally , Γ ′ ( ˆ P 4 ) = ∅ since P 4 is empt y . Rec a ll that P ′ u = Γ ′ ( ˆ P 1 ) ∪ Γ ′ ( ˆ P 2 ) ∪ Γ ′ ( ˆ P 3 ) ∪ Γ ′ ( ˆ P 4 ) (see Definition 17). Now, accor ding to Definition 14, C ( P 1 , · · · , P 4 ) = { W P 1 ∪ W P 2 ∪ W P 3 ∪ W P 4 } , where W P 1 = { r 21 , r 22 , r 23 } , W P 2 and W P 4 are empty (since P 2 and P 4 do not include any so c ial rule) and, fina lly , W P 3 = { r 24 , r 25 } . It is easy to chec k that the stable mo dels of P corres p o nd, by vir tue of Theorem 2, to the so cial mo dels of the SOLP programs P 1 , · · · , P 4 . 5 So cial Mo dels and Joint Fixpoi n ts In this section we show that the s o cial s emantics extends the JFP s emantics (Bucca furri and Gottlob 2002). Basically , COLP pro grams are lo gic progr ams which also contain tolerance rules (named ok ay rules) that a re rules of the form okay ( p ) ← b o dy ( r ). The semantics of a collection o f COLP progra ms is defined ov er tra ditional progr a ms obtained from the COLP programs by translating ea ch rule of the form okay ( p ) ← b o dy ( r ) into the rule p ← p , b o dy ( r ). The sema nt ics o f a collectio n P 1 , · · · , P n of COLP pro- grams is defined in (Bucc a furri and Gottlob 200 2) in ter ms of joint (i.e., common) fixp o ints (of the immedia te consequence o p erator ) of the logic progra ms obtained from P 1 , · · · , P n by trans forming ok ay rules o cc urring in them (as shown ab ov e). 24 F. Buc c afurri and G. Caminiti First w e need some preliminary definitions and results. W e define a translatio n from COLP programs (Buccafurri and Gottlob 20 02) to SO L P progra ms: Definition 22 Given a COLP progra m P and an integer n ≥ 1, the SOLP translation of P is a SOLP program σ n ( P ) = { σ n ( r ) | r ∈ P } , where σ n ( r ) = head ( r ) ← [ n − 1 , n − 1] head ( r ) , body ( r ) if r is a classical rule, ok ay ( p ) ← [ n − 1 , n − 1] p , b ody ( r ) if r is an ok ay rule. Definition 23 Given a COLP prog ram P , let O K AY ( P ) be the set of all the ok ay rules included in P . W e define ˆ P = P \ O K AY ( P ) ∪ { p ← p , b ody ( r ) | r ∈ OKA Y ( P ) ∧ hea d ( r ) = ok ay ( p ) } . Informally , for any given CO LP pro g ram P , ˆ P is a traditio na l logic prog ram ob- tained fro m P b y replacing the head of ea ch ok ay rule with the argument of the predicate ok ay a nd then adding such an arg umen t to the b o dy of the r ule. L emma 6 Given a COLP prog r am P , then: ∀ n ≥ 1 FP ( ˆ P ) = AFP ( σ n ( P )). Pr o of First, observe that, according to Definition 4 (page 9), all SCs o ccurring in the progra m σ n ( ˆ P ) ar e discarded in order to compute the a utonomous fixp oints. As a consequence, the equiv a lence holds for any v a lue o f the par ameter n . Now, it is easy to see that the pr o of fo llows directly f r o m Definitions 5, 2 2 and 2 3 (see page 9, 24 and 24, resp ectively). L emma 7 Let P 1 , · · · , P n be a set of COLP prog rams and Q 1 , · · · , Q n be SOLP prog r ams such that Q i = σ n ( P i ). Then: S OS ( Q 1 , · · · , Q n ) = { ( F 1 ) Q 1 ∪ · · · ∪ ( F n ) Q n | ∀ i , j 1 ≤ i 6 = j ≤ n , F i = F j } . Pr o of By contradiction let us as s ume that (1) ∃ ¯ M | ¯ M = ( F 1 ) Q 1 ∪ · · · ∪ ( F n ) Q n ∧ ¯ M ∈ S O S ( Q 1 , · · · , Q n ) , and (2) ∃ i , j 1 ≤ i 6 = j ≤ n | F i 6 = F j · Thu s, without lo ss of ge nerality there exists h ∈ F i s.t. h Q i ∈ ( F i ) Q i and h Q j 6∈ ( F j ) Q j . As a conseq uenc e , h Q i ∈ ¯ M and h Q j 6∈ ¯ M . Now, w e have r e a ched a con- tradiction beca us e, acco rding to Definitions 10 and 22 (pages 13 a nd 13), h Q i ∈ ¯ M only if for each k , (1 ≤ k 6 = i ≤ n ), h Q k ∈ ¯ M , thus ¯ M 6∈ S O S ( Q 1 , · · · , Q n ) (contradiction). A Know le dge-R epr esentation L anguage with So cial F e atu re s 25 The next theor em states that the JFP semantics is a sp ecia l ca se of the so cial semantics. JFP ( P 1 , · · · , P n ) denotes the set o f the joint fixp oints o f the collection of COLP progra ms P 1 , · · · , P n . The or em 3 Let P 1 , · · · , P n ( n ≥ 1) be C O LP progr ams and C = { Q 1 , · · · , Q n } b e a collection of SOLP progra ms such that Q i = σ n ( P i ). Then: S OS ( Q 1 , · · · , Q n ) = [ 1 ≤ i ≤ n ( F ) Q i | F ∈ JFP ( P 1 , · · · , P n ) . Pr o of ( ⊇ ). First, we show that ∀ F ∈ JFP ( P 1 , · · · , P n ) , [ 1 ≤ i ≤ n ( F ) Q i ∈ S OS ( Q 1 , · · · , Q n ). By contradiction, let us as s ume that ∃ ¯ M = S 1 ≤ i ≤ n ( F ) Q i | ¯ M 6∈ S O S ( Q 1 , · · · , Q n ). Thu s, there exists an integer j , 1 ≤ j ≤ n , such that either: (1) F 6∈ AFP ( Q j ), or (2) F ∈ AFP ( Q j ) ∧ ST C ( ¯ M ) 6 = ¯ M . In cas e (1), by virtue of Lemma 6 (page 24), F 6∈ FP ( ˆ P j ) which contradicts the hypothesis that F ∈ JFP ( P 1 , · · · , P n ). In c ase (2), it holds that either: ( a ) ∃ h , Q j | Q j ∈ C ∧ h Q j ∈ ¯ M ∧ h Q j 6∈ ST C ( ¯ M ), o r ( b ) ∃ h , Q j | Q j ∈ C ∧ h Q j 6∈ ¯ M ∧ h Q j ∈ ST C ( ¯ M ). If c o ndition ( a ) o ccurs, then, for each rule r ∈ Q j , s.t. head ( r ) = h or head ( r ) = ok ay ( h ), it r esults that body ( r ) is fals e w.r.t. ¯ M , beca use h Q j 6∈ ST C ( ¯ M (recall Definition 9, page 12). Now, since h ∈ F and F ∈ AFP ( Q j ), a ccording to Definition 22 (page 24), it holds that for each rule r ∈ Q j , s.t. head ( r ) = h or head ( r ) = ok ay ( h ), the SC [ n − 1 , n − 1 ] h (in tro duced b y the transformation σ ) is false for Q j w.r.t. ¯ M . Thu s, acco rding to Definition 8 (page 11), there exists k (1 ≤ k 6 = j ≤ n ) s.t. h Q k 6∈ ¯ M . No w, we hav e obtained that h Q j ∈ ¯ M and h Q k 6∈ ¯ M . Since ¯ M = S 1 ≤ i ≤ n ( F ) Q i and F ∈ JFP ( P 1 , · · · , P n ), by virtue o f Le mma 7 (page 24), w e hav e reached a contradiction. This concludes the pro of in case (2), when condition (a) holds. Consider, now, that condition ( b ) is true in case (2). According to Definit ion 9 (page 12), there exists r ∈ Q j s.t. head ( r ) = h or head ( r ) = ok ay ( h ) and body ( r ) is true w.r.t. ¯ M . As a consequence and according to Definition 22 (pa ge 24), [ n − 1 , n − 1 ] h is true for Q j w.r.t. ¯ M . No w, a c cording to Definition 8 (page 1 1), for each k (1 ≤ k 6 = j ≤ n ), h Q k ∈ ¯ M a nd h Q j 6∈ ¯ M . Since ¯ M = S 1 ≤ i ≤ n ( F ) Q i and F ∈ JFP ( P 1 , · · · , P n ), b y virtue of Lemma 7 (page 24), w e ha ve reached a contradiction. This concludes the pr o of in ca se (2). 26 F. Buc c afurri and G. Caminiti ( ⊆ ). Now we show that ∀ ¯ M ∈ S O S ( Q 1 , · · · , Q n ), it holds that b oth: (1) ¯ M = { S 1 ≤ i ≤ n ( F i ) Q i | ∀ i , j (1 ≤ i 6 = j ≤ n ) , F i = F j } and (2) ∀ i (1 ≤ i ≤ n ) , F i ∈ JFP ( P 1 , · · · , P n ). First observe that, condition (1) follows directly from Lemma 7 (page 24). Now we prov e that condition (2 ) is true. Assume, by co ntradiction, that F 6∈ JFP ( P 1 , · · · , P n ), where F = F 1 = F 2 = · · · = F n (thanks to condition (1)). As a consequence, there exists j (1 ≤ j ≤ n ) s.t. F 6∈ FP ( ˆ P j ) (recall that ) P j is a COLP pro gram. Now, by vir tue of Lemma 6 (page 2 4), F 6∈ AFP ( Q j ), where Q j = σ n ( P j ). Th us, according to Definition 10 (page 13), F Q j 6⊆ ¯ M , be c ause F Q j is not an autonomous fixpoint of Q j . This result contradicts co nditio n (1), which is true, stating that F Q j ⊆ ¯ M . 6 Com plexit y Re sults In this section we introduce some relev ant decis ion proble ms with re sp ect to the So- cial Sema nt ics and discuss their complexity . The analys is is done in ca se o f p ositive progra ms. The extension to the gener al ca se is straightforward. First, we consider the problem of so cial mo del existence for a c ollection of SOLP progra ms. PROBLEM S OS n (so cial mo del existence): Instance: A SOLP collection C = { P 1 , · · · , P n } . Question: Is S OS ( P 1 , · · · , P n ) 6 = ∅ , i.e., do the programs P 1 , . . . , P n hav e an y so cial model? The or em 4 The problem SOS n is NP-complete. Pr o of (1. Members hip) . In order to verify that a set of p os itive SOLP prog rams admits a so cial mo del, it suffices to g ue s s a candidate so cial interpretation ¯ I fo r C and then to chec k that ST C ( ¯ I ) = ¯ I . Since the latter task is feasible in p olynomial time, then the problem SOS n is in NP . (2. Hardness) . O bserve that the problem SOS n generalizes the pro blem JFP (Bucca furri and Gottlob 200 2), which ha s b een proved to NP-co mplete. Indeed, in Definition 22 (page 24) a p o lynomial- time reduction from JFP to S O S n , i.e. σ n ( P ), has be e n introduced. Mor eov er, The- orem 3 (page 25) states that an y instance of the problem JFP can be r e duced to an equiv alent instance of SOS n , i.e . on those instanc e s the both problems ha ve the same answers. Thus, we have pr ov en that the pr oblem SO S n is NP-ha rd. The n the problem SOS n is NP-complete. Indeed, the case of non p ositive prog rams is straightforward: s inc e it is NP- complete to determine whether a single non-positive program ha s a fixpoint, it is easy to see that the same holds for non-positive SOLP pr o grams and a utonomous A Know le dge-R epr esentation L anguage with So cial F e atu re s 27 fixp o ints. Thus, c hecking wheth er a SOLP collection containing at lea st one non- po sitive SO LP prog r am ha s a socia l mo del is trivially NP-ha rd. Moreover, since this pr oblem is easily seen to b e in N P , it is NP- complete. Now, we intro duce several c o mputationally in teres ting decis io n problems a sso ci- ated with the so cia l semantics. Ea ch of them corr esp onds to a computationa l task inv olving labele d atom searc h inside the social mo dels o f a SOL P c o llection. The tra ditional approa ch used for clas sical non- monotonic s e mantics of logic pro- grams, t ypica lly addresses the tw o following problems: ( a ) Sk eptical Reasoning , i.e. deciding whether an atom x o ccurs in all the mo dels of a g iven prog ram P ; ( b ) Credulous Reas oning , i.e. deciding whether an a tom x o ccurs in some mo del of a g iven prog ram P . Since a social mo del is a so cial in terpr e tation, i.e. a s e t of lab eled atoms, we hav e to extend the above problems ( a ) and ( b ) by intro ducing a further sea r ch dimension, expressing the so cia lity degree of the a gents repr esented b y the SOLP collection. Mor e informally , we a re als o interested in ho w many SOLP prog rams a given atom – o ccurr ing as a lab eled atom in a so cia l mo del – is entailed by . As a consequence, given a collectio n C = {P 1 , · · · , P n } of SOLP programs, a so cial model ¯ M of P 1 , · · · , P n and an atom x , we distinguis h t w o cas es. E ither: (1) for each P in C , ∀ i (1 ≤ i ≤ n ), x P i ∈ ¯ M , or (2) for some P in C , ∃ i | 1 ≤ i ≤ n ∧ x P i ∈ ¯ M . In words, in case (1) the agents cor resp onding to the SOLP collection C exhibit a grea ter so cia lity degree – since all of them choo s e the atom x inside the so cial mo del ¯ M – t han in case (2), where at least one agent is required to choose x and th us we obse r ve a more individual a g ent b ehaviour. By combinin g the problems (a) and (b) with the traditiona l reasoning tasks (1) and (2), we obtain the following four decision pr oblems relev ant to the socia l semantics: 1. PR OB L EM SS - SOS n (so cially skeptical r easoning): Instance: A SOLP collection C = { P 1 , · · · , P n } and an a tom x . Question: Does it ho ld that, for ea ch ¯ M ∈ S O S ( P 1 , · · · , P n ), { x P 1 , · · · , x P n } ⊆ ¯ M , i.e. ∀ i (1 ≤ i ≤ n ) , x P i ∈ ¯ M ? In case the answer to such a problem is p os itive, then it ho lds that all the agents alwa ys (i.e., in each s o cial model) choose x , since x P o ccurs in ¯ M , for each so cia l mo del ¯ M and for ea ch SOLP pro gram P . F or instance, this kind o f rea s oning could be applied by the governmen t of a given country in order to know if a ll citizens, mo delled as a collection of SOLP prog rams, pay taxes. 2. PR OB L EM IS - SOS n (individually skeptical r easoning): Instance: A SOLP collection C = { P 1 , · · · , P n } and an a tom x . Question: Does it hold that, for ea ch ¯ M ∈ S O S ( P 1 , · · · , P n ), ∃ i | 1 ≤ i ≤ n ∧ x P i ∈ ¯ M ? 28 F. Buc c afurri and G. Caminiti In cas e the a nswer to such a pr oblem is positive, then it holds that always (i.e., in every so cial mo del) there is a t least an a gent choosing x , since x P o ccurs in ¯ M , for ea ch so cial mo del ¯ M and for some SOLP progra m P . This kind of reaso ning is useful, for instance, to test if a given actio n, r epresented by x , is alwa ys p erformed by at lea st one agent, no matter the a gent is. F or example, consider a family (mo delled as a SO L P co llection) sharing a car. The ab ove kind of reasoning could b e used in order to c heck whe ther so meone gets gasoline each time the ca r is used. 3. PR OB L EM SC - S OS n (so cially credulous rea soning): Instance: A SOLP collection C = { P 1 , · · · , P n } and an a tom x . Question: Does it hold that, there exists ¯ M ∈ S O S ( P 1 , · · · , P n ), such that for each i (1 ≤ i ≤ n ), x P i ∈ ¯ M , i.e. { x P 1 , · · · , x P n } ⊆ ¯ M ? In cas e the answer to such a problem is positive, then at least one so cial model exists wherea s all the agents choose x , since x P o ccurs in ¯ M , for so me so cial mo del ¯ M and for each SOLP program P . As a consequence, a common agreement on x by the agents may be reached a t least in one case (i.e. in one so cial mo del). F or instance, this kind of reasoning could be applied in order to c heck whether some c hance exists that the Europ ean Council of Ministers (modelled a s a SOLP collection) unanimously acce pts a country as a new member of the Europ ean Union. 4. PR OB L EM IC - S OS n (individually credulous reaso ning): Instance: A SOLP collection C = { P 1 , · · · , P n } and an a tom x . Question: Does it hold that, there exist ¯ M and j such that (i) ¯ M ∈ S O S ( P 1 , · · · , P n ) and (ii) it holds that 1 ≤ j ≤ n ∧ x P j ∈ ¯ M ? In cas e the answ er to suc h a problem is positive, then it holds that at least one so cial mo del exists wherea s at least one agent chooses x , since x P o ccurs in ¯ M , for so me so cial mo del ¯ M and for some SOLP pr ogram P . In such a case, a lthough there is no common ag reement on x by the ag ents, it holds that x is chosen by some o f them, at lea st once (i.e. in one s o cial mo del). F or exa mple, the ab ove reasoning could b e used by a company in order to c heck whether a given product is ne ver b ought by a gro up of po tent ial customers (repr esented by SOLP prog rams). The computatio nal co mplexity of the above problems is stated by the following theorems. The or em 5 The problem SS - SOS n is coNP-complete. Pr o of It suffices to prov e tha t the complementary problem of SS - SO S n is NP-complete. Such a problem may b e describ ed a s follows: Instance: A SOLP collection C = { P 1 , · · · , P n } and an a tom x . Question: Does it hold that there exis t ¯ M and j such that (i) ¯ M ∈ S O S ( P 1 , · · · , P n ) and (ii) 1 ≤ j ≤ n ∧ x P j 6∈ ¯ M ? A Know le dge-R epr esentation L anguage with So cial F e atu re s 29 (1. Member s hip) . W e need to guess a candidate social in terpretatio n ¯ M for C and, then, to verify that: (i) ¯ M ∈ S O S ( P 1 , · · · , P n ), and (ii) ∃ j | 1 ≤ j ≤ n ∧ x P j 6∈ ¯ M . V erifying the ab ove items is feasible in p olynomial time. Thus, the complementary problem of SS - SOS n is in NP . (2. Hardness) . Now we prove that a reduction from the NP-complete problem SOS n to the complementary problem of SS - SOS n is feasible in p olynomia l time. Consider an atom x such that, for each i (1 ≤ i ≤ n ), x 6∈ V ar ( P i ). It is easy to see that S OS ( P 1 , · · · , P n ) 6 = ∅ iff there exists ¯ M ∈ S O S ( P 1 , · · · , P n ) suc h that { x P 1 , · · · , x P n } 6⊆ ¯ M . Mo reov er, in ca se { x P 1 , · · · , x P n } 6⊆ ¯ M , it results that ∃ j | 1 ≤ j ≤ n ∧ x P j 6∈ ¯ M . Thus, SOS n is p olynomially reducible to the complementary problem of SS - SOS n . The or em 6 The problem IS - SOS n is coNP-complete. Pr o of It suffices to prov e that the complementary pr oblem of IS - SOS n is NP-complete. Such a problem may b e describ ed a s follows: Instance: A SOLP collection C = { P 1 , · · · , P n } and an a tom x . Question: Does it ho ld that there exists ¯ M ∈ S O S ( P 1 , · · · , P n ) such that ∀ j (1 ≤ j ≤ n ) , x P j 6∈ ¯ M , i.e. { x P 1 , · · · , x P n } 6⊆ ¯ M ? (1. Member s hip) . W e need to guess a candidate social in terpretatio n ¯ M for C and, then, to verify that: (i) ¯ M ∈ S O S ( P 1 , · · · , P n ), and (ii) { x P 1 , · · · , x P n } 6⊆ ¯ M . V erifying the ab ove items is feasible in p olynomial time. Thus, the complementary problem of IS - SOS n is in NP . (2. Hardness) . Now we prove that a reduction from the NP-complete problem SOS n to the complementary problem of IS - SOS n is feasible in polynomial time. Consider an atom x such that, for each i (1 ≤ i ≤ n ), x 6∈ V ar ( P i ). It is easy to see that S OS ( P 1 , · · · , P n ) 6 = ∅ iff there exists ¯ M ∈ S O S ( P 1 , · · · , P n ) suc h that { x P 1 , · · · , x P n } 6⊆ ¯ M . Th us, SO S n is p oly no mially reducible to the complementary problem of IS - SOS n . The or em 7 The problem SC - SOS n is NP-complete. 30 F. Buc c afurri and G. Caminiti Pr o of (1. Mem b ership) . W e need to g uess a c andidate so cial in terpretation ¯ M for C and, then, to verify that: (i) ¯ M ∈ S O S ( P 1 , · · · , P n ), and (ii) { x P 1 , · · · , x P n } ⊆ ¯ M . V erifying the ab ov e items is feasible in poly nomial time. T hus, the problem SC - SOS n is in NP . (2. Hardness) . Now we prove that a reduction from the NP-complete problem SOS n exists and it is feasible in polyno mial time. co nsider the SOLP co llection C ′ = { τ ( P 1 ) , · · · , τ ( P n ) } , where, for ea ch i (1 ≤ i ≤ n ), τ ( P i ) is a SOL P program obtained from P i as follows: τ ( P i ) = P i ∪ { x ←} , where it holds that, for each i (1 ≤ i ≤ n ), x 6∈ V ar ( P i ). It is ea s y to see that S O S ( P 1 , · · · , P n ) 6 = ∅ iff for each ¯ M ∈ S OS ( P 1 , · · · , P n ), there exists ¯ M ′ ∈ S OS ( τ ( P 1 ) , · · · , τ ( P n )) suc h t hat ¯ M ′ = ¯ M ∪ { x P 1 , · · · , x P n } . Thus, SOS n is poly- nomially reducible to SC - SOS n . The or em 8 The problem IC - SOS n is NP-complete. Pr o of (1. Mem b ership) . W e need to g uess a c andidate so cial in terpretation ¯ M for C and, then, to verify that: (i) ¯ M ∈ S O S ( P 1 , · · · , P n ), and (ii) ∃ j | 1 ≤ j ≤ n ∧ x P j ∈ ¯ M . V erifying the ab ov e items is fea sible in p olynomia l time. Thus, the pr oblem IC - SOS n is in NP . (2. Hardness) . Now we prove that a reduction from the NP-complete problem SOS n exists and it is feasible in polyno mial time. co nsider the SOLP co llection C ′ = { τ ( P 1 ) , · · · , τ ( P n ) } , where, for ea ch i (1 ≤ i ≤ n ), τ ( P i ) is a SOL P program obtained from P i as follows: τ ( P i ) = P i ∪ { x ←} , where it holds that, for each i (1 ≤ i ≤ n ), x 6∈ V ar ( P i ). It is ea s y to see that S O S ( P 1 , · · · , P n ) 6 = ∅ iff for each ¯ M ∈ S OS ( P 1 , · · · , P n ), there exists ¯ M ′ ∈ S OS ( τ ( P 1 ) , · · · , τ ( P n )) such that ¯ M ′ = ¯ M ∪{ x P 1 , · · · , x P n } . Moreover, since { x P 1 , · · · , x P n } ⊆ ¯ M ′ , there exists j (1 ≤ j ≤ n ) suc h that x P j ∈ ¯ M ′ . Thus, SOS n is p olyno- mially reducible to IC - SOS n . 7 Knowledge Represen tation with SOLP programs In this section, w e pro vide in teresting examples sho wing the capabilit y o f our lan- guage of representing common knowledge. A Know le dge-R epr esentation L anguage with So cial F e atu re s 31 Example 14 ( Se ating ) W e must arra nge a sea ting for a num ber n of agents (repr esenting, for instance, peo ple invited to the w edding par ty introduced in Example 1), with m tables a nd a maximum of c chairs p er table. Agents who like e ach other should s it at the sa me table; ag ents who dislik e each other s ho uld not sit a t the same table. Moreover, an agent can express some r equirements w.r.t. the n umber and the identit y of other agents sitting at the same table. Assume that the I -th a gent is represented b y a predicate a gent ( I ) and his knowledge bas e is enclosed in a single SOLP prog ram. Each progr am will include both a set of co mmo n rules enco ding the problem and the agent’s own requirements. The predicate like ( A ) (resp. dislike ( A )) means that the ag e nt A is desired (resp. not t o le r ated) a t the same table. table ( T ) represents a table (1 ≤ T ≤ m ) and at ( T ) ex presses the des ire to sit at table T . F or ins ta nce, the pr ogra m P 1 (whic h is asso ciated with the a gent 1 ) could b e written as follows: r 1 : agent (1) ← r 2 : ← at ( T 1) , at ( T 2) , T 1 <> T 2 r 3 : at ( T ) ← [ c , ] { at ( T ) , agent ( P ) } , like ( P ) , table ( T ) r 4 : ← at ( T ) , [1 , ] { at ( T ) , agent ( P ) } , di slike ( P ) r 5 : ← l ike ( P ) , dislike ( P ) r 6 : like (2) ← r 7 : dislike (3) ← r 8 : okay ( l ike (4)) ← r 9 : ← at ( T ) , [3 , ] { at ( T ) } where the r ule s from r 1 - r 5 are co mmon to all the progr ams (of course, the a rgument of the predicate agent () in r 1 is suited to the enclosing prog ram) a nd the rules r 6 - r 9 express the agent’s own requirements. In detail, the r ule r 2 states that any ag ent cannot be seated at more than one table, the rule r 3 means tha t agent 1 sits at a particular table T if at least c agen ts he likes are seating at that table ( c is a given constant). The rule r 4 states that it is forbidden that agent 1 shares a table with at least one or more agents he dislikes. The r ule r 5 provides consistency for the predic a tes like and dislike , while e xamples of s uch pr e dic a tes are rep orted in rules r 6 and r 7 . The rule r 8 is us e d to declare that agent 1 tolera tes age n t 4, i.e. agent 4 p os sibly shares a table with agent 1, a nd finally the r ule r 9 means that the ag ent 1 do es not w ant to share a table with 3 agents or more. Obse rve tha t while the r ule r 3 generates possible seating arr angements, the rules r 2 , r 4 and r 9 discard those which are not a llow ed. Example 15 ( R o om arr angement ) Consider a house having m ro o ms. W e hav e to distribute some ob jects (i.e. furniture and appliances) over the ro o ms in such a w ay that w e do not exceed the maximum nu mber o f ob jects, say c , allow ed p er room. Cons tr aints ab out the colo r and/or the type of o b jects sharing the sa me ro o m can be introduced. W e assume that each ob ject is represe nted by a single program e nco ding both the prop erties and the constraints we wan t to meet. Consider the following program: 32 F. Buc c afurri and G. Caminiti r 1 : name ( cupb o ar d ) ← r 2 : typ e ( f urnitur e ) ← r 3 : c olor ( yel low ) ← r 4 : ← at ( R 1) , at ( R 2) , R 1 <> R 2 r 5 : at ( R ) ← [ , 2] { at ( R ) , typ e ( applianc e ) , c olor ( yel low ) , [1 , 1] { name ( fridge ) }} , r o om ( R ) r 6 : at ( R ) ← [ , c − 3] { at ( R ) , typ e ( furnitur e ) } , r o om ( R ) r 7 : ← at ( R ) , [1 , ] { at ( R ) , c olor ( gr e en ) } where the prope r ties of the current o b ject are enco ded as predicates representing the name (fridge, cupbo ard, table, . . . ), the t yp e (furniture or appliance), the c olor and so on (see rules r 1 - r 3 ). In par ticula r, the rule r 4 states that an ob ject may not be in mo re than one r o om, while by mea ns of the r ule r 5 , we allow no more than tw o yello w appliances to sha re the ro om with the cupbo ard, pr ovided that one of them is a fridge. The r ule r 6 means tha t we wan t the cupboard to b e in the same r o om with an y o ther piece s of fur niture, but no more than c − 3, whe r e c (represent ing the maximum num ber of ob jects p er ro om) is given. Finally , the rule r 7 states tha t the cupb o ard cannot share the ro om with any g reen ob ject. Example 16 ( FPGA D esign ) In this ex a mple, w e represent an extended v ersio n o f a well-known problem be- longing to the setting of FP GA (Field Prog rammable Gate Arrays) des ign, namely placement . FPGAs ar e gener ic, pr ogramma ble digital devices providing, in a single system, a wa y for digital designers to access thousands or millio ns of logic gates arrang ed in m ultilevel str uctur es, referr ed to as modules , and to program them as desired b y the end user. Placement consists in determining th e mo dule p os itions within the design area accor ding to given constr aints. Consider a team of n electronic engineers, jointly working on a co mmon FP GA design. Each of them is resp onsible for placing a g iven n umber of mo dules inside the c hip design area, which is r epresented by a sq uare grid of cells. In particular, each designer must meet a num b er of constraints conce r ning either (re s p. bo th) his own mo dules or (r esp. and) the modules of o ther designers. Moreover, the total chip area which is o ccupied by the m o dules m ust either match a giv en v a lue or be less than a given v a lue. This s etting c a n b e enco de d by a collection of SOLP prog rams 8 C = { Q 1 , · · · , Q n , P } , where for each i (1 ≤ i ≤ n ), Q i describ es desig ner i ’s r equirements, and P represents an agent aimed to find a dmissible solutions to the placemen t problem. Such so lutions a re included into the so cial mo dels of the SOLP c o llection C . In the following parag r aphs we descr ib e such progr a ms in detail. W e assume that each mo dule is rectang ular-shap ed and it is describ ed by a predicate mo d ( M , X , Y ), where M is an iden tifier and X (re sp. Y ) is the ho rizontal (resp. vertical) mo dule size mea sured in grid cells . First, we describ e the progra m Q i (corresp o nding to rules r 1 - r 28 ), enco ding desig ne r i ’s pla cement constraints. 8 Observe that, according to the impl ementation of the language that relies on DL V (Leone et al. 2002; Dell’Armi et al. 2003), individual pr ograms of our SOLP collect ion adopt the syntax of DL V, allowing b oth built-in predicates and standard aggregate functions. A Know le dge-R epr esentation L anguage with So cial F e atu re s 33 W e distinguish among hard and so ft constraints, r esp ectively . Hard c o nstraints are common to each pr o gram Q i (1 ≤ i ≤ n ) and descr ibe the placement pro blem. Soft constr aints r epresent b o th requiremen ts o f a single designer o n his o wn mod- ule’s proper ties and requirements o n the pro p erties of modules owned by a nother designer. Hard Constraints. The following rules enco de the placement pr oblem: r 1 : grid ( n , n ) ← r 2 : ← pl ac e ( B , X , Y ) , unplac e d ( B , X , Y ) r 3 : plac e ( B , X , Y ) ← n ot unplac e d ( B , X , Y ) , mo d ( B , , ) , # int ( X ) , # int ( Y ) , X < XG , Y < YG , grid ( XG , YG ) r 4 : unplac e d ( B , X , Y ) ← not plac e ( B , X , Y ) , mo d ( B , , ) , # int ( X ) , # int ( Y ) , X < XG , Y < YG , grid ( XG , YG ) r 5 : ← pl ac e ( B , X , Y ) , mo d ( B , XB , YB ) , grid ( XG , YG ) , XT > XG , +( X , XB , XT ) r 6 : ← pl ac e ( B , X , Y ) , mo d ( B , XB , YB ) , grid ( XG , YG ) , YT > YG , +( Y , YB , YT ) r 7 : ← # c ount { B : plac e ( B , , ) , mo d ( B , , ) , B = B 1 } = 0 , mo d ( B 1 , , ) r 8 : ← pl ac e ( B , X , Y ) , plac e ( B , X 1 , Y 1) , X < > X 1 r 9 : ← pl ac e ( B , X , Y ) , plac e ( B , X 1 , Y 1) , Y <> Y 1 r 10 : ← c el l ( B , X , Y ) , c el l ( B 1 , X , Y ) , B <> B 1 r 11 : c el l ( B , X , Y ) ← mo d ( B , XB , YB ) , plac e ( B , X 1 , Y 1) , # i nt ( X ) , # int ( Y ) , X 1 ≤ X , X < SX , +( X 1 , XB , SX ) , Y 1 ≤ Y , Y < SY , +( Y 1 , YB , SY ) r 12 : ← c el l ( B , X , Y ) , [1 , ] { c el l ( B 1 , X 1 , Y 1) } , X = X 1 , Y = Y 1 First, the g r id sizes are decla red (rule r 1 ) and then, after candidate mo dule po sitions are g uessed ( rule s r 2 - r 4 ), sev er a l require ment s are c heck ed: (i) a module cannot be placed outside the chip desig n area (rules r 5 , r 6 ); (ii) a ll mo dules must b e placed (rule r 7 ); ( iii ) e a ch mo dule can not b e placed more than once (rules r 8 , r 9 ); ( iv ) mo dules owned b y the same designer canno t o verlap (rule r 10 ). By means of rule r 11 the pr edicate c el l ( B , X , Y ) is true if mo dule B cov ers the grid cell at co ordinates X , Y . Finally , the intended meaning of the so cial rule r 12 is to av oid ov erlapping o f mo dules owned b y different designers. Soft Constr aints. The following rules desc r ib e exa mples of c o nstraints that de- signer i can sp ecify on his own mo dule’s prop erties, i.e. setting either the absolute mo dule po sition (rule r 13 ) or that relative to other mo dules (rules r 14 - r 17 ). F or instance, rules r 14 and r 15 sp ecify that both mo dules 1 and 3 must be placed ( a ) on the sa me row (r epresented by the co ordina te Y), and ( b ) such that mo dule 1 is on the left of module 3. Finally , r ules r 16 and r 17 require that m o dule 1 is placed either 0 or 1 cell far from mo dule 3. Note that the predicate plac e ( B , X , Y ) sets the uppe r -left corner co or dinates o f mo dule B to X , Y . r 13 : plac e (1 , 3 , 4) ← r 14 : ← plac e (1 , X , Y ) , plac e (3 , X 1 , Y 1) , Y <> Y 1 r 15 : ← plac e (1 , X , Y ) , plac e (3 , X 1 , Y 1) , X ≥ X 1 r 16 : ← plac e (1 , X , Y ) , plac e (3 , X 1 , Y 1) , # int ( X ) , mo d (1 , XB , YB ) , +( X , XM , X 1) , +( XB , D , XM ) , D < 0 r 17 : ← plac e (1 , X , Y ) , plac e (3 , X 1 , Y 1) , # int ( X ) , mo d (1 , XB , YB ) , +( X , XM , X 1) , +( XB , D , XM ) , D > 1 34 F. Buc c afurri and G. Caminiti In addition, it is p o s sible to enco de, by mea ns of so cial rules, the dep endence of designer i ’s module properties f r o m those of other desig ners. F or instance, given an in teger d , b y means of the following rules designer i requir e s that module 4 is placed on the sa me row (rule r 18 ) as designer j ’s mo dule 1 and such that a dis tance of exactly d cells exists b etw een them (rules r 19 , r 20 ). r 18 : ← plac e (4 , X 4 , Y 4) , [ Q j ] { plac e (1 , X 1 , Y 1) } , Y 4 <> Y 1 · r 19 : ← plac e (4 , X 4 , Y 4) , [ Q j ] { plac e (1 , X 1 , Y 1) } , D <> d , + ( X 4 , XM , X 1) , X 4 ≤ X 1 , +( XB 4 , D , X M ) , mo d (4 , XB 4 , YB 4) r 20 : ← plac e (4 , X 4 , Y 4) , [ Q j ] { plac e (1 , X 1 , Y 1) } , D <> d , + ( X 1 , XM , X 4) , X 1 ≤ X 4 , +( XB 1 , D , X M ) , mo d (1 , XB 1 , YB 1) In order to ensure that all mo dules a re prop erly s pa ced, rules r 21 - r 24 (resp. rules r 25 - r 28 ) require that mo dules owned by des ig ner i (resp. owned by designers i a nd j such that j 6 = i ) are m utually spaced b y at lea s t k cells, wher e k is a g iven integer constant. r 21 : ← c el l ( B , X , Y ) , c el l ( B 1 , X 1 , Y 1) , B <> B 1 , # int ( D ) , + ( X , D , X 1) , D < k r 22 : ← c el l ( B , X , Y ) , c el l ( B 1 , X 1 , Y 1) , B <> B 1 , # int ( D ) , + ( X 1 , D , X ) , D < k r 23 : ← c el l ( B , X , Y ) , c el l ( B 1 , X 1 , Y 1) , B <> B 1 , # int ( D ) , + ( Y , D , Y 1) , D < k r 24 : ← c el l ( B , X , Y ) , c el l ( B 1 , X 1 , Y 1) , B <> B 1 , # int ( D ) , + ( Y 1 , D , Y ) , D < k r 25 : ← c el l ( B , X , Y ) , [1 , ] { c el l ( B 1 , X 1 , Y 1) } , # i nt ( D ) , +( X , D , X 1) , D < k r 26 : ← c el l ( B , X , Y ) , [1 , ] { c el l ( B 1 , X 1 , Y 1) } , # i nt ( D ) , +( X 1 , D , X ) , D < k r 27 : ← c el l ( B , X , Y ) , [1 , ] { c el l ( B 1 , X 1 , Y 1) } , # i nt ( D ) , +( Y , D , Y 1) , D < k r 28 : ← c el l ( B , X , Y ) , [1 , ] { c el l ( B 1 , X 1 , Y 1) } , # i nt ( D ) , +( Y 1 , D , Y ) , D < k Now w e describ e the SOLP pr ogra m P (rules r 29 - r 38 ), repres entin g a n agent which collects fro m the designer s admissible solutions to the pla cement problem. Moreov er , by means o f additio nal r ules ( r 39 - r 40 ), P p ossibly require s tha t the plac e - men t lay out area either is less than o r matches a given v a lue. r 29 : p c el l ( X , Y ) ← [1 , ] { c el l ( , X 1 , Y 1) } , X = X 1 , Y = Y 1 r 30 : exists x lt ( W ) ← p c el l ( W , ) , p c el l ( W 1 , ) , W 1 < W r 31 : lowest x ( X ) ← p c el l ( X , ) , not exists x lt ( X ) r 32 : exists y lt ( W ) ← p c el l ( , W ) , p c el l ( , W 1) , W 1 < W r 33 : lowest y ( Y ) ← p c el l ( , Y ) , n ot exists y lt ( Y ) r 34 : exists x ht ( W ) ← p c el l ( W , ) , p c el l ( W 1 , ) , W 1 > W r 35 : highest x ( X ) ← p c el l ( , X , ) , not exists x ht ( X ) r 36 : exists y ht ( W ) ← p c el l ( , W ) , p c el l ( , W 1) , W 1 > W r 37 : h i ghest y ( Y ) ← p c el l ( , Y ) , n ot exists y ht ( Y ) r 38 : design ar e a ( A ) ← ∗ ( B , H , A ) , +( X 1 , B , X 2) , +( Y 1 , H , Y 2) , lowest x ( X 1) , highest x ( X 2) , lowest y ( Y 1) , highest y ( Y 2) So cial rule r 29 collects admissible solutions to the placement pro blem. The r ules from r 30 to r 37 are used to represent the smallest r ectangle enclosing a ll the placed mo dules. Then, the actual design area is computed by r ule r 38 . In case an an upp er b ound b to b e satisfied (r esp. an exact v alue s to b e ma tched) is given, then the following r ule r 39 (resp. r 40 ) may b e added: r 39 : ← design ar e a ( A ) , A > b (resp. r 40 : ← design ar e a ( A ) , A <> s ) A Know le dge-R epr esentation L anguage with So cial F e atu re s 35 Example 17 ( Contextual Re asoning ) It is interesting to obs erve tha t SOLP pro grams can r epresent a for m of Contextual Reasoning (Ghidini and Giunchiglia 20 01). Although man y definitions o f the notion o f con text exist in the Artificial Intel- ligence literature (McCarthy 1 9 93; Ghidini and Giunchiglia 20 0 1; Br ´ ezillon 199 9), we can informally say that a con text is an environmen t (i.e. a set of facts and the logic rules to p erform inference with) in which the r easoning takes place. In particular, in (Ghidini and Giunchiglia 20 01) tw o key principles of c o ntextual reasoning are stated: lo cality (the rea soning ta sk uses only a subset of the to- tal knowledge a v ailable) and compa tibilit y (a dditional constr a ints among different contexts may b e sp ecified to dec lare those which are mutually compa tible). Under this p ersp ective, w e are int er ested in r epresenting this feature o f commo n- sense reasoning, that is, giv en a problem to be solved, (i) bounding the reasoning to the knowledge which is str ictly needed, the so- c a lled context of the problem, and (ii), in ca se the o riginal context is not suitable to rea ch a so lution, ena bling the use of new information provided by o ther contexts. It is interesting to note that SO L P pro grams ar e well-suited to re pr esent co ntexts, since ea ch of them enables reasoning which ta kes place b oth lo ca lly , i.e. at the level of the progra m k nowledge base, and at the level of the other pro grams’ k nowledge bases. Thus, it is easy to mo del r easoning which inv olves s everal different contexts. F or ins tance, consider a SOLP pr o gram P 0 (representing the context of the agent A 0 ) including a so cial rule of the form action ← [ P 1 ] b 1 , · · · , [ P n ] b n meaning that the a gent A 0 infers the term action if each term b i (1 ≤ i ≤ n ) is inferred by the corresp onding age nt A i , i.e . b i is par t of an autonomous fixp o int o f P i . This wa y , the notion of lo cality is rea lized by r epresenting each different context in a sepa rate SOL P pr ogra m, and the compa tibilit y principle is pursued by suitably using SCs where mem b er s election conditions identif y con texts. As an example, consider the well-known “Thr ee Wise Men Puzzle”, first intro- duced in (Konolig e 1984). A king wishes t o determine which of h is three wise men is the wisest. H e arranges them in a circle so that they can see and hear each other and tells th em th at he will put a white or a black sp ot on each of t h eir foreheads but that at least one sp ot will b e white. He then rep eatedly asks them, “Do you kn ow the colour of your sp ot?”. Wh at do they answ er? W e r epresent by means of SOLP prog rams a s lightly simpler version of the puzzle, where only t wo wise men are inv olved: 36 F. Buc c afurri and G. Caminiti r 1 : c olor ( white ) ← r 2 : c olor ( black ) ← King (ag e n t K ) r 3 : wise man (1..2) ← r 4 : put sp ot ( A , black ) ← n ot put sp ot ( A , white ) , wise man ( A ) r 5 : put sp ot ( A , white ) ← not put sp ot ( A , black ) , wise man ( A ) r 6 : ← # c ount { S : put sp ot ( S , black ) } = N , # c ount { A : wise man ( A ) } = N , # int ( N ) r 7 : ask question (1) ← r 8 : ask question ( T 2) ← ask question ( T 1) , # suc c ( T 1 , T 2) , # int ( T 1) , # int ( T 2) not [1 , ] { answer ( white , T 1) , answer ( black , T 1) } , Wise man 1 (agent W 1 ) r 9 : for ehe ad ( C ) ← [ K ] { put sp ot (1 , C ) } , c olor ( C ) r 10 : answer ( white , 1) ← [ K ] { ask question (1) } , [ W 2] { for ehe ad ( black ) } r 11 : answer ( black , 1) ← [ K ] { ask question (1) } , [ W 2] { for ehe ad ( whi te ) , answer ( white , 1) } r 12 : answer ( white , 2) ← [ K ] { ask question (2) } , [ W 2] { for ehe ad ( whi te ) , not answer ( white , 1) , not answer ( black , 1) } Rules r 1 - r 2 are commo n to each SOLP progr am. Suc h rules set the admissible sp ot co lors. Rules r 3 - r 8 represent the king . Rule r 3 sets the num b er of wise men (t wo in this ca s e). By means o f rules r 4 - r 5 , the king non-deterministically puts a sp ot on ea ch wise man’s for ehead. Rule r 6 represents the king’s statement “At least one spot is white”. The king asks the question f or the first time (rule r 7 ) and, after he has asked the questio n, if no agent gives an answer, then he asks the question a gain (rule r 8 ). Rule r 9 is used to store into the predicate for ehe ad the information ab out the colo r of the corresp onding wise man’s sp ot. O bserve that since ea ch wise man cannot look at his o wn forehea d, then the predicate for ehe ad is further referenced in SCs only . Rules r 10 − r 11 represent the case of exactly one white sp ot: after the firs t time the king asks the question, if the first wise man sees a blac k spo t on the other wise man’s for ehead, then h e concludes that his s po t is white (rule r 10 ). Otherwise, if the second wise man b oth has a white sp o t on his forehead and he answers “white”, then the firs t wise man can conclude that the other wis e man has seen a blac k s po t o n his forehead. Thus, the first wise man answers “black”. Finally , rule r 12 represents the case of tw o white sp ots . In such a case, after the first question, no wise man can conclude anythin g ab o ut the colo r of his own spot. After the se c ond time the king asks the question, each wise man can answer “white” in case he sees a white sp ot a nd the other wise man has not answered the pr evious king’s question. The correctness o f suc h a statement can b e prov ed by contradiction: if a wise man had a black spo t on his forehead, then the other wise man would hav e seen it and, thus, he a lso would hav e answered “white” after the first king’s question. The SOLP progr am representing the s e cond wise man (pro gram W 2) is ea s ily obtained fr o m W 1 b y exchanging the r ole o f the tw o wise men, i.e. by replacing each o ccurrence of the pr ogra m identifier W 2 by W 1. F or the sake of the simplicit y we have co nsidered a simple scenario, i.e. t wo wise A Know le dge-R epr esentation L anguage with So cial F e atu re s 37 men. It is p ossible to extend the r e asoning enco ded in the ab ov e prog rams, in o rder to write a genera l progr am for n wise men, by ex plo iting the nesting feature of the so cial conditions in such a wa y tha t reasoning o n b oth the conten t and the temp ora l sequence of the wise men’s statements is enable d. 8 Related W ork Contextual R e asoning - As po int ed out in Sectio n 7, a r elationship exis ts b etw een our work a nd ( Ghidini a nd Giun chiglia 2001), wher e th e Lo cal Model Seman tics (LMS) is prop osed to reason ab out contexts. A survey cov ering the us e of contexts in ma n y fields o f Artificia l Intelligence can be fo und in (Br´ ezillon 199 9). An approach concerning con textual reas oning and agent-based systems can b e found in (De Sae ger and Shimo jima 20 06). In (McCarth y 1993), th e author discusses the notion of con text in Artificial In- telligence in order t o solve the problem of genera lity , that is every lo gic theo ry is v a lid within the bo unds of a definite co ntext and it is p ossible to des ign a mo re general context where such a theo ry is not v alid anymore. Other a pproaches hav e be e n prop os e d in (Buv aˇ c and Mason 199 3) and (Ghidini and Giunchiglia 20 01). Moreov er , thes e tw o works are compare d in (Serafini and Bouquet 200 4). In the fo r- mer work, the a uthors introduce the Prop ositiona l Lo g ic of Co ntext , a mo dal lo gic aiming at formalizing McCarthy’s ideas. An appr oach which is more closely related to o urs is prop ose d in (Ghidini and Giunchiglia 20 01), where the authors consider a set of logic la nguages, each repre senting a differen t context, and a suitable semantics is us ed to select a mong sets of lo cal models, i.e. mo dels p er ta ining to a sing le languag e, those which satisfy a given compatibility condition. Mo reov er, a pro o f-theoretical framework for contextual reasoning , called Multi-Context Systems , is introduced where the no tions of lo cality and c o mpatibil- it y a re resp ectively ca ptured by inference r ules , whose scop e is the s ingle languag e, and bridge rules establishing relatio nships amo ng different langua ges. Observe that, in the previous section, w e hav e shown that such a machinery can b e repre s ented by so cial rules where the b o dy includes only member- selection- condition-based SCs, each co r resp onding to a different co ntext to b e included in to the reasoning task. As a consequence, w e argue that socia l rules are more gener al than br idge rules, since the former pr ovide a ls o (p ossibly nested) ca rdinal-selectio n- condition-based SCs. Since our w or k is not aimed to rea s on on cont exts, a dir ect compariso n with (Ghidini and Giunchiglia 2 0 01) cannot b e done, although some corres p o ndences may b e found b etw een the mo del-theor etical formalizatio ns of b o th the Lo cal Mo del Sema nt ics a nd the So cial Semantics. In particular , we feel that the latter could b e easily adapted to fully enable contextual reaso ning inside logic progra mming. This is left for future work. L o gic-b ase d Multi-A gent Systems - A related approa ch, where the sema ntics of a collection of ab ductive lo gic ag e nts is given in terms o f the stability o f their interac- tion can b e found in (Bracciali et al. 2004) whe r e the a uthors define the semantics of a multi-agen t system v ia a definit io n o f stability on the set of all a ctions p er - 38 F. Buc c afurri and G. Caminiti formed by all agents in the system, p ossibly arising from their co mmu nica tion and int er a ction via observ ation. According to the authors, a set of actions committed by different agents is stable if, a ssuming that an “ oracle” could feed each of the agents with all the ac tio ns in the s e t p er fo rmed by the other a g ents, each agent would do exactly what is in the set. W e b elieve that such a ma chinery is similar to our fixpo int-based approach since we gues s ca ndidate so cial interpretations and select those whic h a re c o mpatible with the SCs of the SOLP co llection. In our work we fo cused on the formaliza tion of the semantics, assuming a p erfect communication among the age nt s in such a way that ea ch agent is able to know the men tal sta te o f the others. Using a different appr oach from ours, in (Satoh and Y amamoto 2002), in order to face the p ossible incompleteness o f information due to comm unication failures o r delays in a multi-agent system, a default hypothesis is used a s a tentativ e answer a nd the computation contin ues un til a reply is received whic h contradicts with the default. Another interesting work is the MINER V A agent architecture (Leite et al. 200 2), based on dynamic logic prog ramming (Alferes et a l. 2000). MINE R V A is a mo dula r architecture, wher e every ag ent is comp ose d of spe c ialized sub- agents that ex ecute sp ecial tasks , e.g ., rea ctivity , planning, scheduling, b elief r evision, ac tio n execution. A common in terna l knowledge base, represented a s one or mor e Multi-dimensiona l Dynamic Logic Pr ogra ms (MDLP) (Alferes et al. 2002), is concur rently manipu- lated by its sp ecialized sub-ag ents. The MDLPs may enco de ob ject-level knowledge, or knowledge ab out goals , plans, inten tions, etc. The DALI pro ject (Costantini a nd T occhio 2002) is a co mplete multi-agent plat- form en tirely written in P rolog . A D ALI pro gram res ults in a n agent which is capable of r eactive and proactive behaviour, triggered by several kinds of even ts. The semant ics of a D ALI prog ram is defined in terms of another prog ram, where reactive and proactive rules ar e reinterpreted as standard Horn Clause rules . Laima (De V os et al. 2005) ag e n ts are r epresented as Or dered Choice Logic Pr o- grams (OCLP) (De V os 20 0 3) for mo delling their knowledge and reasoning capa- bilities. Co mm unicatio n b etw een the agents is regulated b y uni-directio nal channels transp orting information based on their ans wer s e ts. IMP A CT (Subrahmania n et al. 20 00) is a n a gent platform where prog rams may be used to specify what an ag ent is either obliged to do, may do, or cannot do o n the basis of deon tic oper ators o f p ermiss ion, obligation a nd prohibition. IMP ACT is gro unded on a solid semantic fra mework based on the concept of feasible s tatus set, which descr ibe s a set of actions dictated by a n agent progr am that is consistent with the obligatio ns and res trictions on the agent itself. Agent pr ogra ms define int egr ity constra ints, whic h must b e s atisfied in order to provide a feasible status set. The a doption o f a logic prog ramming based formalism, and the use of integrity constraints to define a feasible status set, g ua rantee a gents to b ehave in a wa y that some desired prop erties hold. So cieties Of ComputeeS (SOCS) (Alb erti et al. 200 4) is a pro ject that was funded by Eur op ean Union. The idea is to pro vide a computational log ic mo del for the description, analysis and verification of glo bal and o p en societies o f het er ogeneous computees . The computee mo del is pro po sed as a full-fledg ed agent mo del, based A Know le dge-R epr esentation L anguage with So cial F e atu re s 39 on extended logic programming, allo wing to define and study properties that can be enforced by its o p erational mo del. Since our approa ch r elies on the g eneral notion of so cial b ehaviour, it is of cour se int er e sting to illustrate ho w this concept is dealt with in the rela ted field of intelli- gent age nt s, in order to make evident that – even in s uch co ntext – this notion takes an impo rtant role. Indeed, b eside autonomy , intelligen t agents (W ooldr idge and Jennings 19 95; W oo ldr idge 2 000) may b e required to hav e so cial ability . The mea ning of this con- cept is t wo-fold: (1) the pr e sence of a co mmo n la ng uage for co mmun ica tion, a nd (2) the capability of reasoning on the conten t o f communication acts. Concerning item (1), KQML (Mayfield and Finin 1995), and FIP A ACL (Cos t et al. 2001), bo th based on the sp eech act theory (Cohen a nd L e vesque 1990), r epresent the main ef- forts done in the last years. The state-o f-the-art literatur e on item (2) is repr esented by (W ooldr idge 2000; v an der Hoek and W o oldrige 20 03; Ma scardi et al. 2004). So- cial ability allows thus the agent individuals to have b eliefs , desires and in ten tions (BDI) (Rao and Geor geff 1995; Ra o 1996) a s a r esult of b oth the m utual comm u- nication and the consequent individual r easoning. 9 Conclus ions and F uture W ork In this pap er we hav e prop os ed a new languag e , So cial Logic Pro gramming (SOLP ), which e xtends Compromise Logic Pr ogra mming and enables s o cial b ehaviour among a co mm unity o f individua ls whose rea soning is r epresented by logic prog r ams. A rich set o f examples shows that the langua ge has very nice capa bilities of repres ent- ing such a kind of knowledge. Moreover, we have g iven a translatio n from SOLP to logic progr amming with aggre g ates and discussed the co mputational complexity of several decision pro ble ms related to the so cial semantics. Basically , the present pap er gives the theoretica l core for a multi-agent oriented softw are environment, including suitable sp ecialized features , like information hid- ing, sp eech-act mechanisms, s e c urity and so on. Howev er, these is sues ar e int er esting directions of our future work. F or insta nce, infor ma tion hiding can be implemen ted as follows. Given a SOLP collection C , w e mak e the following a ssumption: by default eac h agen t canno t see int o other agen ts’ mind, that is all a toms in each SOLP progr am are view ed only by the pro gram itself, i.e. they are priv a te. In or der to make some atom public we could a dd a suffix, sa y P , to suc h an ato m, i.e. a is meant as priv ate, while aP is meant as the public version o f a . Then, by means of a suitable modifica tion of our translation ma chinery , any so cia l conditio n can be ac tiv ated only on public a toms. An a gent communication machinery can be co nceived that relies on the ab ov e feature. In case an ag ent wants to send a messag e to another agent, then the for mer could make public a suitable set of atoms in such a wa y that they a re visible only to the latter. This appr oach could b e easily extended to the scena rio where one ag e nt wan ts to s end a message to either a group of agents or to the whole c ommunit y . Another feature we intend to include into future ex tens io ns of SOLP is the rep- resentation of ev olv ing agent mental states . W e believe that a collection of SOLP progra ms could be easily managed by some existing logic fr a mework which is tai- 40 F. Buc c afurri and G. Caminiti lored to program up date or b elief revision tas ks, such a s, for instance, Dynamic Logic Prog ramming (DLP) (Alferes et al. 200 0). The r esulting system sho uld work in a cyclic fashion: (i) socia l models of the SOLP collection are computed, (ii) b y exploiting DLP , the SOLP pro grams within the collectio n a re po s sibly up dated according to the in tended evolution of agent beliefs and inten tions, (iii) the cycle restarts. Starting from the basic appr oach pr op osed in Section 7 (Example 16), an- other int er esting issue to investigate is the capability of the langua g e, in the ge ne r al case, of r epresenting co o p erative a pproaches to solving c ombinatorial optimization problems, p ossibly by introducing so me suitable extensions. Finally , we plan to enhance the languag e o f SOLP by a dding b o th classic al nega- tion and rule-head disjunction. W e exp ect the former to b e ea sy to implemen t, while the in tegra tion of la tter re q uires some pr eliminary study , as the in tro duction of disjunction in lo gic prog r amming alwa ys results in a growth o f the languag e expressivity tow ards higher levels in the computatio na l complexity hierar ch y . References Alber ti, M. , Che sani, F. , Ga v anelli, M. , Lamma, E. , M ello, P. , and Torr oni, P. 2004. The SOCS Computational Logic Approach to the Sp ecification and Verification of Agent Societies. In Global Computing . LNCS. S pringer, 314–339. Alferes, J. J. , Leite, J. A. , Pereira, L. M. , Przymusinska, H. , and Przymusin ski, T. C. 2000. Dynamic Up dates of Non-m on otonic Know ledge Bases. J. Log. Pro- gram. 45, 1-3, 43–70. Alferes, J. J. , Leite, J. A. , Pereira, L. M. , Przymusinska, H. , and Przymusin ski, T. C. 2002. A Language for Multi-dimensional Up dates. Electr. Notes Theor. Comput. Sci. 70, 5. Baral, C. 2003. Knowledge Representation, Reasoning and D eclarativ e Problem Solving . Cam bridge Universit y Press. Bracciali, A . , Mancare lla, P. , St a thi s, K. , and Toni, F. 2004. On mo delling multi- agen t systems d eclaratively . In D AL T , J. Leite, A. Omicini, P . T orroni, and P . Y olum, Eds. Lectu re N otes in Comput er Science, vol. 3476. Springer, 53–68. Br ´ ezillon, P. 1999. Context in problem solving: A surve y . The K now ledge Engineering Review 14, 1, 1–34. Buccafurri, F. and Camin i ti, G. 2005. A Social Semantics for Multi-A gent Systems. In Proc. of 8th International Conference, LPNMR 2005, Diaman te, Italy , C. Baral, G. Greco, N. Leo ne, and G. T erracina, Eds. LNAI, vol. 36 62. S p ringer-V erlag, Berli n Heidelb erg, 317–329. Buccafurri, F. and Gottlob, G . 2002. Multiagent Compromises, Joint Fixp oints, and Stable Mo dels . LN CS and LN AI, vol. 2407. S pringer. Buv a ˇ c, S. and Ma son, I . 1993. Prop ositional logic of context. In Pro c. of the Eleven th National Conference on Artificial Intelligence , R. Fikes and W. Lehnert, Ed s. A merican Association for Art ifi cial Intellige nce, AAAI Press, Menlo Pa rk, Califo rnia, 4 12–419. Cohen, P. R. an d Levesque, H. 1990. Rational interactio n a s the basis for co mmuni- cation. In I nten tions in Comm un ication . MIT Press. Cost, R . S. , Finin, T. , and Labrou, Y. 2001. Co ordinating Agents Using ACL Conv er- sations. In Coordination of Internet Agents: Models, T ec hnologies, and Applications . 183–196 . A Know le dge-R epr esentation L anguage with So cial F e atu re s 41 Cost antini , S. and Tocchio, A. 2002. A Logic Programming Language for Multi-agen t Systems. In Proc. of the Europ ean Conf. on Lo gics in Artificial Intellig ence, (JELIA 2002) . LN CS. S pringer, 1–13. De Saeger, S. and Shimojima, A. 2006. Contextual Reasoning in Agent Systems. In Proc. of Computational Logic in Multi-Agent Systems (CLIMA-VI I ), H akodate, Japan . De Vos, M . 2003. An Ordered Choice L ogic Programming Front-end for Answer Set Solvers . In Pro c. of Int. Joint Conf. Join t Co nference o n Declarative Programming, (APPIA-GULP-PRODE) . LN CS. Springer, 362–373. De Vos, M. , Crick, T. , P adget, J. , Brain, M. , Cliffe, O. , and Needham , J. 2005. LAIMA: A Multi-agen t Platform U sing Ord ered Choice Logic Programming. In Proc. of the Int. W orkshop Declarativ e Agen t Languages and T echnologies, (DAL T 2005) . LNCS. Sprin ger, 72–88. Dell ’Armi , T. , F aber, W. , Ielp a, G. , Leone, N. , and Pfeifer, G. 2003. Aggregate F unctions in Disjunctive Logic Programming: Semantics, Complexity , and Implementa- tion in DL V. I n IJCAI- 03, Proc. of the 18th Int. Join t Conf. on Artificial Intelligence . 847–852 . Eiter, T. , Gottlob, G. , and Ma nnila, H. 1997. Disjunctive Datalog. A CM T ransac- tions on D atabase Sy stems 22, 3, 364–418. Gelfond, M . and Lifschi tz , V. 1988. The Stable Mo del Semantics for Logic Program- ming. In 5th Conf. on Logic Programming . MIT Press, 1070– 1080. Gelfond, M. an d Li fschi tz, V. 1991. Clas sical negation in logic programs and disjunc- tive databases. New Generation Comput. 9, 3/4, 365–386. Ghidini , C. and Giunchig li a, F. 2001. Lo cal Mo dels Semantics, or Contextual Reason- ing = Locality + Compatibility . Artif. Intell. 127, 2, 221–259. Ko nolige, K. 1984. A Ded uction Mo del of Belief and its Logics. Ph.D. th esis, Stanford Universit y CA. Leite, J. A. , A lferes, J. J. , and Pereira, L. M. 2002. MINER V A: A D ynamic Logic Programming A gent Architecture. In Pro c. of A T AL- 2001 . LN AI. Springer, 141–157. Leone, N . , Pfei fer, G. , F a ber, W. , Eiter, T. , G ottlob, G . , Perri , S. , and Scar- cello, F. 2002. The DL V Sy stem for Knowl edge Representation and R easoning. ArXiv Computer Science e-prints , 11004 –+. Mascardi, V. , Mar telli, M. , and Sterling, L. 2004. Logic-based specification lan- guages for in telligent softw are agen ts. T PLP 4, 4, 429–494. Ma yfi eld, J., L. Y. and Fini n, T . 1995. Ev aluation of kqml as an agent communication language. In Pro ceedin gs of the 2nd In ternational W orkshop on Agen t Theories, Ar- chitectures, and Languages (A T AL’95) , M. J. P . W o oldridge, M. and M. T ambe, Eds. Number 1037 in LNAI. Sp ringer-V erlag, 347–360. McCar thy , J. 1993. N otes on f ormalizing contexts. In Proceedings of the Thirteenth International Joint Conference on Artificial Intelligence , R. Ba jcsy , Ed. Morgan Kauf- mann, San Mateo, California, 555–560. Rao, A. S. 1996. AgentSpeak(L): BDI Agents Sp eak Out in a Logical Computable Language. In A gents Breaking Awa y , W. V an de V elde and J. W. Perram, Eds. Numb er 1038 in LN AI. SpringerV erlag, 42–55. Rao, A. S. and Georgeff, M. 1995. Bdi agen ts: from theory to p ractice. In Pro ceedings of the 1st International Conference on Multi Agent Systems (ICMAS’95) , V. Lesser, Ed. AAAI Press, 312–319. Sa toh, K. and Y amam oto, K. 2002. S p eculative computation w ith multi-ag ent b elief revision. In AAMAS . ACM , 897–90 4. Serafini, L. a n d Bouquet, P. 2004. Comparing formal theories of context in ai. Artif. Intell. 155, 1- 2, 41–67. 42 F. Buc c afurri and G. Caminiti Subrahmanian , V. , Bona tti, P. , Di x , J. , Ei te r, T . , Kraus, S. , Ozcan , F. , and Ross, R. 2000. Heterogeneous Agent Sy stems . MIT Press/AAAI Press, Cambridge, MA, US A. v an der Hoek, W. and Wooldrige, W . 2003. T o wards a logic of rational agency . Logic Journal of th e IGPL 11, 2, 135–159. Woo ldrid g e, M. 2000. Reasoning ab out Rational Agents . Intelligen t R ob ots a nd Au- tonomous A gents. MIT Press, Cam bridge, Massach usetts. Woo ldrid g e, M. and Jennings, N. R . 1995. I ntell igent Agents: Theory and Practice. The Knowledge Engineering Review 2, 10, 115–152. App endix A In order to improve t he ov era ll readability of the pap er, a num b er of lemma and theorem pro ofs hav e been m oved to th is section. L emma 1 (see pag e 18) Given a SOLP collectio n S P = {P 1 , · · · , P n } , an in teger j (1 ≤ j ≤ n ), a SO LP progra m P j ∈ SP , a so cial interpretation ¯ I for SP and a SC s ∈ MSC P j , it holds that s is true for P j w.r.t. ¯ I iff ∃ M ∈ SM ( C ( P 1 , · · · , P n ) ∪ Q ) s.t. ρ ( s ) P j ∈ M , where Q = { a ←| a ∈ ¯ I } . Pr o of Before starting with the proof, let us denote the set of a ll the SCs occur r ing in s (plus the SC s itself ) by N ( s ), and the LP A progra m C ( P 1 , · · · , P n ) by ¯ C . ( ⇒ ). W e hav e to prov e that if s is tr ue for P j w.r.t. ¯ I , then there e xists a stable mo del M of the log ic progr am ¯ C ∪ Q s .t. the atom ρ ( s ) P j , c orresp o nding to s by means of the translation, is included in M . W e pro ceed b y induction on the maximum nesting depth (see pag e 3) of the SCs in N ( s ), d = max s ′ ∈ N ( s ) { depth ( s ′ ) } ( d ≥ 0). ( Basis ). In case d = 0, then N ( s ) = { s } and depth ( s ) = 0 (reca ll the definition o f the function depth on pa ge 3). Since | N ( s ) | = 1, s is a s imple SC, i.e. ske l ( s ) = ∅ . Now, assume by contradiction that s is true for P j w.r.t. ¯ I and that for each M ∈ SM ( ¯ C ∪ Q ) , ρ ( s ) P j 6∈ M . Observe now that it may o ccur either the following cases: (1) c ond ( s ) = [ P k ](1 ≤ k ≤ n ), o r (2) c ond ( s ) = [ l , h ]. In case (1), a ccording to Definition 13 (pa g e 16), there exists a set S = { r 1 , r 2 } ⊆ ¯ C ∪ Q such that: r 1 : ρ ( s ) P j ← ( g ( s ))( k ) P j r 2 : ( g ( s ))( k ) P j ← V b ∈ content ( s ) b P k and for each r ∈ ( ¯ C ∪ Q ) \ S , he ad ( r ) 6 = r 1 ∧ he ad ( r ) 6 = r 2 . Since we hav e assumed that ρ ( s ) P j 6∈ M , it is easy to see tha t bo th b o dy ( r 1 ) and b o dy ( r 2 ) a re fa ls e w.r.t. M . Moreov er , it holds that for each M ∈ SM ( ¯ C ∪ Q ), ¯ I ⊆ M , a s Q = { a ←| a ∈ ¯ I } . As a cons e quence, b o dy ( r 2 ) is false w.r.t. ¯ I . Since the elements o ccurr ing in b o dy ( r 2 ) ar e lab eled literals, we hav e proven that c ond ( s ) = [ P k ] and that the co ndition ∀ a ∈ c ontent ( s ) , a is true for P k w.r.t. ¯ I do es not hold. Such a result, according to Definition 8 (page 11), contradicts the hypothesis that s is true for P j w.r.t. ¯ I and, therefo r e, co ncludes the pro of of the basis o f the induction, in cas e (1). A Know le dge-R epr esentation L anguage with So cial F e atu re s 43 In case (2), since skel ( s ) = ∅ , acco rding to Definition 13 (pag e 16), there ex is ts a set of rules S = { r 1 } ∪ { s i | 1 ≤ i 6 = j ≤ n } ⊆ ( ¯ C ∪ Q ) s uch that: r 1 : ρ ( s ) P j ← l ≤ # count { K : ( g ( s ))( K ) P j , K 6 = j } ≤ h s i : ( g ( s ))( i ) P j ← V b ∈ content ( s ) b P i (1 ≤ i 6 = j ≤ n ). Moreov er , for each r ∈ ( ¯ C ∪ Q ) \ S and for each t ∈ S , he ad ( r ) 6 = he ad ( t ). Now, since ρ ( s ) P j 6∈ M , b o dy ( r 1 ) is false w.r.t. M . Since b o dy ( r 1 ) = l ≤ # coun t { K : ( g ( s ))( K ) P j , K 6 = j } ≤ h , ac cording to the definitio n of aggr egate functions (Dell’Armi et al. 2003), for ea ch D ⊆ { i | 1 ≤ i 6 = j ≤ n } ( l ≤ | D | ≤ h ), there exists k s.t. 1 ≤ k 6 = j ≤ n and ( g ( s ))( k ) P j is false w.r.t. M . Thus, there exists a rule s k ∈ ¯ C ∪ Q s.t. s k : ( g ( s ))( k ) P j ← V b ∈ co ntent ( s ) b P k and he ad ( s k ) is false w.r .t. M . Since ∀ r ∈ ( ¯ C ∪ Q ) \ { s k } , he ad ( r ) 6 = he ad (( s k ), b o dy ( s k ) is false w.r .t. M , i.e. V b ∈ co ntent ( s ) b P k is false w.r.t. M . Now, since ¯ I ⊆ M , V b ∈ co ntent ( s ) b P k is false w.r.t. ¯ I . Thu s, we hav e prov en that for each s e t D ⊆ { i | 1 ≤ i 6 = j ≤ n } s.t. l ≤ | D | ≤ h , there exists some k ∈ D and so me x ∈ content ( s ) s.t. x is fals e for P k w.r.t. ¯ I . This result, according to item (2) of Definition 8 (page 11), contradicts the hypothes is that s is tr ue for P k w.r.t. ¯ I . Now we ha ve concluded the pro of of o f the basis o f the induction. ( Induction ). Assume that the statement holds for max s ′ ∈ N ( s ) { depth ( s ′ ) } = d > 0 and consider the case max s ′ ∈ N ( s ) { depth ( s ′ ) } = d + 1. First, observe that s is not simple, b eca use skel ( s ) 6 = ∅ . Since s is well-formed, c ond ( s ) = [ l , h ]. Th us, accor ding to Definition 13 (pa ge 1 6), ther e exis ts a set o f rules S = { r 1 } ∪ { s i | 1 ≤ i 6 = j ≤ n } ⊆ ( ¯ C ∪ Q ) s.t.: r 1 : ρ ( s ) P j ← l ≤ # count { K : ( g ( s ))( K ) P j , K 6 = j } ≤ h s i : ( g ( s ))( i ) P j ← V b ∈ content ( s ) b P i ∧ V s ′ ∈ skel ( s ) ρ ( s ′ ) P j (1 ≤ i 6 = j ≤ n ) Now, observe that: (1) F or each s ′ ∈ skel ( s ), max σ ∈ N ( s ′ ) { depth ( σ ) } = d , and (2) Since s is true for P k w.r.t. ¯ I , according to Definition 8 (page 1 1), for each s ′ ∈ skel ( s ), s ′ is true for P j w.r.t. ¯ I . On the basis of the ab ove obser v a tions and the induction h yp othesis, it holds that fo r each s ′ ∈ skel ( s ), ρ ( s ′ ) P j ∈ M . Since s is true for P j w.r.t. ¯ I and cond ( s ) = [ l , h ], acco rding to Definition 8 (page 11) there exists D ⊆ SP \ {P j } s.t. l ≤ | D | ≤ h and ∀ a ∈ content ( s ) , ∀P ∈ D , a is true for P w.r .t. ¯ I . Thu s, it holds that, for ea ch 1 ≤ i ≤ n suc h that b oth i 6 = j and P i ∈ D , V b ∈ co ntent ( s ) b P i ∧ V s ′ ∈ skel ( s ) ρ ( s ′ ) P j is tr ue w.r .t. M , as ¯ I ⊆ M . Since M is a stable mo del of ¯ C ∪ Q , according to the definition of the set S (giv en at the b eginning of the par t ( Induction )), fo r each i s .t. 1 ≤ i 6 = j ≤ n and s.t. P i ∈ D , ( g ( s ))( i ) P j is true w.r.t. M . Since l ≤ | D | ≤ h , there exists a set o f literals D ′ = { ( g ( s ))( i ) P j | 1 ≤ i 6 = j ≤ n } s.t. l ≤ | D ′ | ≤ h and s.t. for each element d ∈ D ′ , d is true w.r .t. M . Now, a c c ording to th e definitio n of aggrega te functions (Dell’Armi e t al. 2003), b o dy ( r 1 ) is true w.r.t. M and, since M is a sta ble mo del of ¯ C ∪ Q , he ad ( r 1 ) is true 44 F. Buc c afurri and G. Caminiti w.r.t. M , i.e. ρ ( s ) P j is true w.r.t. M . Such a r esult concludes the only-if par t ( ⇒ ) of the pro of. ( ⇐ ). W e hav e to prov e that if ∃ M ∈ SM ( ¯ C ∪ Q ) | ρ ( s ) P j ∈ M , then s is true for P j w.r.t. ¯ I . W e pro ceed by induction on the maxim um nesting depth o f the elements in N ( s ), d = max s ′ ∈ N ( s ) { depth ( s ′ ) } ( d ≥ 0). ( Basis ). In case d = 0, then N ( s ) = { s } and depth ( s ) = 0 . Since | N ( s ) | = 1 , s is a s imple SC, i.e. skel ( s ) = ∅ . Observe now that it may o ccur either the following cases: (1) c ond ( s ) = [ P k ](1 ≤ k ≤ n ), o r (2) c ond ( s ) = [ l , h ]. In case (1), according to Definition 13 (pa g e 16), there ex ist tw o rules in ¯ C ∪ Q of the form: r 1 : ρ ( s ) P j ← ( g ( s ))( k ) P j r 2 : ( g ( s ))( k ) P j ← V b ∈ content ( s ) b P k and such that ∀ r ∈ ( ¯ C ∪ Q ) \ { r 1 , r 2 } , he ad ( r ) 6 = he ad ( r 1 ) ∧ he ad ( r ) 6 = he ad ( r 2 ). As a consequence, since ρ ( s ) P j ∈ M , b o dy ( r 1 ) is true w.r.t. M . No w, since M is a stable mo de l of ¯ C ∪ Q , b o dy ( r 2 ) is true w.r.t. M . Now, obse rve that acc o rding to Definitions 1 2 and 13 (see pages 15 and 1 6), for each b ∈ c ont ent ( s ), b P k 6∈ ( M \ ¯ I ), because M \ ¯ I includes only litera ls that are auxiliary to the tra nslation. As a cons equence, b o dy ( r 2 ) is true w.r.t. ¯ I , i.e. for each b ∈ c ontent ( s ), b is true for P k w.r.t. ¯ I . Now, we hav e prov en that c ond ( s ) = [ P k ](1 ≤ k ≤ n ) and there exists P k ∈ S P s.t. for each a ∈ c ontent ( s ), a is true for P k w.r.t. ¯ I , th us, s is true for P k w.r.t. ¯ I . This concludes the pro of of the basis of the induction, in ca se (1). In case (2), since skel ( s ) = ∅ , acco rding to Definition 13 (pag e 16), there ex is ts a set of rules S = { r 1 } ∪ { s i | 1 ≤ i 6 = j ≤ n } ⊆ ( ¯ C ∪ Q ) s uch that: r 1 : ρ ( s ) P j ← l ≤ # count { K : ( g ( s ))( K ) P j , K 6 = j } ≤ h s i : ( g ( s ))( i ) P j ← V b ∈ content ( s ) b P i (1 ≤ i 6 = j ≤ n ). Moreov er , for each r ∈ ( ¯ C ∪ Q ) \ S and for each t ∈ S , he ad ( r ) 6 = he ad ( t ). Since M is a stable m o del of ¯ C ∪ Q and ρ ( s ) P j ∈ M , b o dy ( r 1 ) is true w.r.t. M . According to the definition of agg regate functions (Dell’Armi et a l. 2003), there exists a set of integers D s.t. l ≤ | D | ≤ h , for each i , i 6 = j and P i ∈ SP and, finally , for each i ∈ D , ( g ( s ))( i ) P j is true w.r.t. M . As a cons e quence, there exists a s et of r ules D ′ = { s i | i ∈ D ∧ he ad ( s i ) = ( g ( s ))( i ) P j } ⊆ S \ { r 1 } s.t. for each rule s i ∈ D ′ , b o dy ( s i ) is true w.r.t. M . Since ¯ I ⊆ M , it holds that for ea ch s i ∈ D ′ , b o dy ( s i ) is tr ue w.r.t. ¯ I . Now, observ e that l ≤ | D ′ | = | D | ≤ h and that, a ccording to Definition 13 (page 16), for each s i ∈ D , b o dy ( s i ) = V b ∈ co ntent ( s ) b P i . W e have obtained that ther e exis ts a set D s.t. l ≤ | D | ≤ h , for each i ∈ D , i 6 = j a nd P i ∈ SP . Fin a lly , it holds that for eac h b ∈ c ontent ( s ) a nd for each i ∈ D , b is true for P i w.r.t. ¯ I . Now, it res ults that there exists a set ∆ = {P i | i ∈ D ∧ P i ∈ SP } s.t. ∆ ⊆ SP \ {P j } , l ≤ | D elta | = | D | ≤ h and for each b ∈ c ontent ( s ), and for each P ∈ ∆, b is true for P i w.r.t. ¯ I . According to Definition 8 (page 11), we hav e pr oven tha t s is true for P j w.r.t. ¯ I . Such a re s ult concludes the pro of of the basis of the induction. ( Induction ). Assume that the statement holds fo r max s ′ ∈ N ( s ) { depth ( s ′ ) } = d > 0. and consider the case max s ′ ∈ N ( s ) { depth ( s ′ ) } = d + 1. First, observe that s is not A Know le dge-R epr esentation L anguage with So cial F e atu re s 45 simple. Since s is well-formed, c ond ( s ) = [ l , h ]. Thus, a ccording to Definition 13 (page 16), there exists a set of rules S = { r 1 } ∪ { s i | 1 ≤ i 6 = j ≤ n } ⊆ ( ¯ C ∪ Q ) s.t.: r 1 : ρ ( s ) P j ← l ≤ # count { K : ( g ( s ))( K ) P j , K 6 = j } ≤ h s i : ( g ( s ))( i ) P j ← V b ∈ content ( s ) b P i ∧ V s ′ ∈ skel ( s ) ρ ( s ′ ) P j (1 ≤ i 6 = j ≤ n ) Moreov er , for each r ∈ ( ¯ C ∪ Q ) \ S and for each t ∈ S , he ad ( r ) 6 = he ad ( t ). Now, obser ve that, since ρ ( s ) P j ∈ M and M is a stable mo del of ¯ C ∪ Q , a ccording to the definition of aggr egate functions (Dell’Armi et a l. 2003), there exists a set ∆ ′ ⊆ { ( g ( s ))( i ) P j | 1 ≤ i 6 = j ≤ n } s.t. l ≤ | ∆ ′ | ≤ h and ∀ x ∈ ∆ ′ , x is true w.r.t. M . Th us, there exists ∆ ′′ ⊆ S \ { r 1 } s.t. l ≤ | ∆ ′′ | = | ∆ ′ | = | ∆ | ≤ h and s.t. for each s i ∈ ∆ ′′ , he ad ( s i ) is true w.r.t. M . Since M is a stable mo del of ¯ C ∪ Q , for each s i ∈ ∆ ′′ , b o dy ( s i ) is true w.r.t. M . Now, no te that for each i s.t. s i ∈ ∆ ′′ , b o dy ( s i ) = V b ∈ co ntent ( s ) b P i ∧ V s ′ ∈ skel ( s ) ρ ( s ′ ) P j . Thu s, for each i s.t. s i ∈ ∆ ′′ , V b ∈ co ntent ( s ) b P i is true w.r.t. M and V s ′ ∈ skel ( s ) ρ ( s ′ ) P j is true w.r.t. M . Now, since ¯ I ⊆ M and according to Definition 13 (pag e 16), for each i s.t. s i ∈ ∆ ′′ , V b ∈ co ntent ( s ) b P i is true w.r.t. ¯ I . Since f o r eac h i s.t. s i ∈ ∆ ′′ , b P i is a literal labelled w.r.t. P i , it is easy to see that for each i s.t. s i ∈ ∆ ′′ and for each b ∈ conte n t ( s ), b is true for P i w.r.t. ¯ I . Moreov er, by induction h yp othesis, f o r each s ′ ∈ skel ( s ), s ′ is true for P j w.r.t. ¯ I . Thu s, w e have obtained that c ond ( s ) = [ l , h ] and there ex is ts a set D ⊆ { i | 1 ≤ i 6 = j ≤ n } s.t. l ≤ | D | ≤ h and for ea ch i ∈ D s.t. P i ∈ S P and for each a ∈ c ontent ( s ), it holds that a is true w.r .t. P and fo r each s ′ ∈ s kel ( s ), s ′ is true for P j w.r.t. ¯ I . According to Definition 8 (page 11), we have prov en that s is true for P j w.r.t. ¯ I . This concludes the pr o of of the lemma. The or em 2 (see page 22) Given a SOLP collection SP = {P 1 , · · · , P n } , it holds that A = B , where : A = SM ( P ′ u ∪ C ( P 1 , · · · , P n )) and B = { ¯ F ∪ ¯ G ∪ ¯ H | ¯ F = S 1 ≤ i ≤ n ( F i ) P i ∧ F i ∈ AFP ( P i ) ∧ ¯ F ∈ S O S ( P 1 , · · · , P n ) ∧ (1) ¯ G = S 1 ≤ i ≤ n ( G i ) P i ∧ ( G i ) P i = [ F i ] P i \ ( F i ) P i ∧ (2) ¯ H = S 1 ≤ i ≤ n ( H i ) P i ∧ ( H i ) P i = S s ∈ MSC P i SA T P i ¯ F ( s ) } . (3) Pr o of Before starting with the pro of, let us denote C ( P 1 , · · · , P n ) by ¯ C . ( ⊆ ). B y contradiction, assume that ∀ X ∈ A , X 6∈ B . O bserve that, according to Definitions 14, 17 and 20 (see pages 16, 18 and 20, respectively), it holds that X = ¯ F ∪ ¯ G ∪ ¯ H suc h that ¯ F ∩ ¯ G = ∅ , ¯ G ∩ ¯ H = ∅ , ¯ F ∩ ¯ H = ∅ . Thus, we pr ov e that either condition (1), (2), or (3) is false. W e consider each condition separately . Condition (1). In case condition (1) is false, it holds that ¯ F 6∈ S O S ( P 1 , · · · , P n ). It follows that either: ( a ) ∃ i | ( F i ) P i ⊆ ¯ F ∧ F i 6∈ AFP ( P i ), or 46 F. Buc c afurri and G. Caminiti ( b ) ∃ i , r | ( F i ) P i ⊆ ¯ F ∧ F i ∈ AFP ( P i ) ∧ r ∈ P i ∧ ST C ( ¯ F ) 6 = ¯ F . In case ( a ), by virtue of Lemma 5 (page 21), it holds that ( F i ) P i 6⊆ SM ( P u ). As a co nsequence, it is eas y to s ee that ( F i ) P i 6⊆ SM ( P ′ u ∪ ¯ C ). Since ( F i ) P i ∈ X , then we hav e thus reached a contradiction. If item ( b ) o c curs, it holds that either: ( b 1 ) ∃ a , P i | P i ∈ C ∧ a P i ∈ ¯ F ∧ a P i 6∈ ST C ( ¯ F ), o r ( b 2 ) ∃ a , P i | P i ∈ C ∧ a P i 6∈ ¯ F ∧ a P i ∈ ST C ( ¯ F ). In c ase ( b 1 ), bo th the following conditions are true: (i) ∀ r ∈ P i , body ( r ) is true w.r.t. ¯ F ⇒ head ( r ) 6 = a , and (ii) ∀ r ∈ P i , body ( r ) is true w.r.t. ¯ F ∧ a is true for P j w.r.t. ¯ F ⇒ head ( r ) 6 = ok ay ( a ). In cas e (i) of item ( b 1 ), it holds that, according to Definitions 15 and 16 (pa ges 17 a nd 17), for each r ′ ∈ S ′ 2 ( ˆ P i ), s.t. body ( r ′ ) is true w.r.t. X , it results that head ( r ′ ) 6 = sa P i . Thus, sa P i 6∈ X . As a co nsequence, acc o rding to t he definition of S ′ 3 ( ˆ P i ) (see Definition 16, page 17), it holds that a P i 6∈ X . Since the hypo thesis requires that a P i ∈ ¯ F and ¯ F ⊆ X , we hav e reached a contradiction. Consider no w cas e (ii) of item ( b 1 ). It holds tha t, accor ding to Definitions 15 and 16 (pag es 17 and 1 7), for each r ′ ∈ S ′ 2 ( ˆ P i ) s.t. a P i ∧ body ( r ′ ) is true w.r .t. X , it re s ults that head ( r ′ ) 6 = sa P i . Thus, sa P i 6∈ X . Acco rding to the definition of S ′ 3 ( ˆ P i ), it holds that a P i 6∈ X . Since the hyp o thesis requires that a P i ∈ ¯ F a nd ¯ F ⊆ X , we ha ve reac hed a cont r a diction. This concludes the part of the pro of concerning item ( b 1) above. Consider now item ( b 2 ). In this case a t least one of the following co nditions holds: (i) ∃ r ∈ P i | b ody ( r ) is true w.r .t. ¯ F ∧ a is tr ue for P j w.r.t. ¯ F ∧ hea d ( r ) = ok ay ( a ), (ii) ∃ r ∈ P i | body ( r ) is true w.r.t. ¯ F ∧ head ( r ) = a . If case (i) of item ( b 2 ) o ccurs, it holds that a P i ∈ ¯ F . No w, the contradiction is th us rea ched, since according to the hypothesis, a P i 6∈ ¯ F . Consider now cas e (ii) of item ( b 2 ). L et r b e of the form a ← b 1 , · · · b ν , s 1 , · · · , s m (w e do not los e in genera lity b ecause r is any s o cial rule). Accor ding to Definitions 15 and 16 (pages 17 and 17), there ex ists a rule r ′ ∈ S ′ 2 ( ˆ P i ) s uch that r ′ has the for m sa P i ← b 1 P i , · · · , b ν P i , ρ ( s 1 ) P i , · · · ρ ( s m ) P i . Now, since body ( r ) is true w.r.t. ¯ F and on the basis of results of Le mma 1 (page 18), it ho lds that body ( r ′ ) is true w.r.t. X and head ( r ′ ) = sa P i . According to the definition of S ′ 3 ( ˆ P i ) (see Definition 16, page 17), since a P i 6∈ X , then it holds that sa P i 6∈ X . Thus, body ( r ′ ) is true w.r.t. X and head ( r ′ ) is fals e w.r.t. X . As a consequence, there exists a rule r ′ in P ′ u ∪ ¯ C such that r ′ is false w.r .t. the mo del X ( X ∈ SM ( P ′ u ∪ ¯ C )) which is a con tradiction. The proof o f condition (1) is thus concluded. Let us prov e now condition (2). A Know le dge-R epr esentation L anguage with So cial F e atu re s 47 Condition (2). In case condition (2 ) is false, ther e exists i s.t. ( G i ) P i 6 = [ F i ] P i \ ( F i ) P i . Thus, ( F i ) P i ∪ ( G i ) P i 6 = [ F i ] P i and then, accor ding to Definition 2 0 (pag e 20), ( F i ) P i ∪ ( G i ) P i 6⊆ S F ∈ AFP ( P i ) { [ F ] P i } . Now, by vir tue o f Lemmas 3 and 5 (pages 20 and 21), ( F i ) P i ∪ ( G i ) P i 6⊆ SM ( P u ) (r ecall that P u = S 1 ≤ i ≤ n Γ ′ ( A ( ˆ P i ))). Accord- ing to D efinitions 14, 16 and 17 (see page s 16, 1 7 and 18, resp ectively), it is easy to see that ( F i ) P i ∪ ( G i ) P i 6⊆ SM ( P ′ u ∪ ¯ C ). Since ( F i ) P i ∪ ( G i ) P i ∈ X , we ha ve reached a contradiction. Consider now the last case. Condition (3). If condition (3) is false, then there e xists i such that H i P i is not equal to S s ∈ MSC P i SA T P i ¯ F ( s ). Thus, it holds that either: ( a ) ∃ h ∈ ( H i ) P i | h 6∈ S s ∈ MSC P i SA T P i ¯ F ( s ), or ( b ) ∃ h ∈ S s ∈ MSC P i SA T P i ¯ F ( s ) | h 6∈ ( H i ) P i . In case ( a ), according to Definition 21 (page 22), since h 6∈ S s ∈ MSC P i SA T P i ¯ F ( s ), it ho lds that ∀ M ∈ SM ( ¯ C ∪ Q ) s.t. Q = { a ←| a ∈ ¯ F } , it r esults that h 6∈ M . As a consequence, acco rding to Definition 1 7 (page 1 8), we have that ∀ M ∈ SM ( P ′ u ∪ ¯ C ), h 6∈ M . Now, w e hav e reached a contradiction. In c ase ( b ), acco r ding to Definition 21 (page 2 2), h is either an auxiliary ρ - atom or a g -predicate and it holds that h 6∈ ( H i ) P i . Since ¯ H = S 1 ≤ k ≤ n ( H k ) P k , and h is lab eled w.r.t. P i , h 6∈ ¯ H . Now we hav e reached a con tra diction, b eca use h ∈ X \ ¯ H = ¯ F ∪ ¯ G and ¯ F ∪ ¯ G do es not include, according to conditions (1) and (2 ) of the theorem statemen t, either ρ -atoms or g -predica tes. ( ⊇ ). By contradiction, ass ume that ∀ X ∈ B , X = ¯ F ∪ ¯ G ∪ ¯ H and b oth c onditions (1), (2) and (3) of the theorem statement ho ld and fur ther X 6∈ A (r ecall that A = SM ( P ′ u ∪ ¯ C )). As a co nsequence, either: ( a ) ∃ r ∈ P ′ u ∪ ¯ C | r is false w.r.t. X , i.e. head ( r ) is false w.r .t. X and b ody ( r ) is true w.r.t. X , or ( b ) ∃ X ′ ⊂ X | ∀ r ∈ P ′ u ∪ ¯ C , r is true w.r .t. X ′ . In case ( a ), acc o rding to Definition 16 (pag e 17), there exist P i , r ′ s.t. P i ∈ SP , r ′ ∈ P i , r ′ is a so cia l r ule a ← b 1 , · · · b ν , s 1 , · · · , s m and r , according to the definition of S ′ 2 ( ˆ P i ), has the form sa P i ← b 1 P i , · · · , b ν P i , ρ ( s 1 ) P i , · · · ρ ( s m ) P i . Now, since body ( r ) is true w.r .t. X and X = ¯ F ∪ ¯ G ∪ ¯ H , for each k (1 ≤ k ≤ ν ), b k P i is true w.r.t. ¯ F . Therefore, for each k (1 ≤ k ≤ ν ), b is true for P i w.r.t. ¯ F . By virtue o f Lemma 1 (pag e 18), for each l (1 ≤ l ≤ m ), s l is true for P i w.r.t. ¯ F . Thu s, it holds tha t body ( r ′ ) is true w.r.t. ¯ F . Moreover, according to the definit io n of S ′ 3 ( P i ) (see Definition 16, page 17), head ( r ′ ) is false w.r.t. ¯ F , since h ead ( r ) is false w.r.t. ¯ F . As a consequence, the social r ule r ′ ∈ P i is fals e w.r.t. ¯ F . Ther e fo re, ¯ F is not a so cial model of P 1 , · · · , P n . Now, w e have r eached a contradiction. In c ase ( b ), at least one of the following co nditions holds, either: 48 F. Buc c afurri and G. Caminiti ( α ) ( X \ X ′ ) ∩ ¯ F 6 = ∅ , or ( β ) ( X \ X ′ ) ∩ ¯ G 6 = ∅ , or ( γ ) ( X \ X ′ ) ∩ ¯ H 6 = ∅ . If condition ( α ) occ ur s, accor ding to b o th the hypothesis a nd Definition 16 (page 17), then there exist P i , r , a s.t P i ∈ SP , r ∈ S ′ 1 ( P i ) , a P i ∈ ( X \ X ′ ) ∩ ¯ F , and r has the for m a ′ P i ← not a P i . Now, since a P i ∈ ( X \ X ′ ) ∩ ¯ F , it holds that a P i ∈ X and a ′ P i 6∈ X (otherwis e, ac c o rding to r , X w ould no t be a mo del of P ′ u ∪ ¯ C ). Now, since X ′ ⊆ X , it holds that a ′ P i 6∈ X ′ . Ther efore, there exists a so cial rule r ∈ P ′ u ∪ ¯ C s.t. r is false w.r.t. X ′ . As a consequenc e , X ′ is not a mo del of P ′ u ∪ ¯ C and we hav e reached a contradiction. This co nc ludes the pr o of of case ( b ), condition ( α ). In case ( b ), if condition ( β ) holds, then according to b oth the hypothesis a nd Definition 16 (page 17), either: (i) There exist P i , r , a ′ s.t. P i ∈ SP , r ∈ S ′ 1 ( P i ), a ′ P i ∈ ( X \ X ′ ) ∩ ¯ G and r has the form a P i ← not a ′ P i , or (ii) There exist P i , r , a s.t. P i ∈ S P , r ∈ S ′ 3 ( P i ), a P i ∈ ¯ X , sa P i ∈ ( X \ X ′ ) ∩ ¯ G and r has the for m fail P i ← not fail P i , a P i , not sa P i . If item (i) is true, then r is false w.r.t. X ′ , since a ′ P i 6∈ X ′ and a P i 6∈ X ′ . Th us, X ′ is not a mo del of P ′ u ∪ ¯ C and w e hav e reached a contradiction. If item (ii) holds, then r is false w.r.t. X ′ , since, according to the h ypo thesis, sa P i ∈ X . Ther efore, a P i ∈ X . As a result, sa P i 6∈ X ′ and a P i ∈ X ′ . Thus, X ′ is not a mo del of of P ′ u ∪ ¯ C and we hav e reached a contradiction. This concludes the pro of of case ( b ), condition ( β ). No w we give the pro of when condition ( γ ) holds. In cas e ( b ), if condition ( γ ) holds, then there exist P i , h s.t. P i ∈ S P and h P i ∈ ( X \ X ′ ) ∩ ¯ H . Since X ′ is a mo del of P ′ u ∪ ¯ C , according to D efinitions 12 and 21 (pages 15 and 22), there exists some a P i in ¯ F ∪ ¯ G s.t. a P i ∈ ( X \ X ′ ). Therefore, either condition ( α ) or condition ( β ) of case ( b ) o ccurs and it is easy to see that we have reached a contradiction. Now we hav e concluded the pro o f of the theore m. List of Sym b ol s and Abbreviations [ ] P Op erator that pro duces a s e t of auxiliary atoms lab elled w.r.t. P and used in the transla tion pro cess Γ ′ () The mapping fro m SOLP pro grams to traditional log ic pr ogra ms ˆ P A logic program o btained from P a fter a r e writing of the toler- ance rules o ccurring in it LP A The non-disjunctive fragment of logic progr amming with agg re- gates supp orted by the DL V sy stem S OS ( P 1 , · · · , P n ) The set of all so cial mo dels of P 1 , · · · , P n U ( P 1 , · · · , P n ) The set of all the p o s sible co mbin a tio ns o f autono mous fixp oints of the SOLP progra ms P 1 , · · · , P n OK AY ( P ) The set of ok ay r ules of the COLP progr am P Ψ P ( s ) The translatio n of a sing le SC s o f a SOLP program P A Know le dge-R epr esentation L anguage with So cial F e atu re s 49 ρ ( s ) , g ( s ) A toms and pr edicates asso ciated with the so cia l conditio n s σ n ( P ) The trans lation o f a COLP program P into a SOLP prog ram A () The autonomous reduction op erato r AFP ( P ) The set o f all autonomous fixpo ints of P C ( P 1 , · · · , P n ) The LP A progra m resulting fr o m the transla tio n of a ll the SCs included in the SOLP collectio n {P 1 , · · · , P n } FP ( P ) The set of all fixp oints of P IC - SOS n The decision problem “individually cre dulous reasoning ” IS - SOS n The decision problem “individually skeptical reasoning” JFP ( P 1 , · · · , P n ) The set o f the joint fixp oints of the CO LP prog rams P 1 , · · · , P n MSC P The set of all the SCs (with depth 0) o c c urring in P MSC hP , r , n i The set of all the SCs ha ving a given depth n and o ccurr ing in a so cial rule r of a SOLP pr ogram P P ′ u The tra ditional prog ram resulting from the tra ns lation of all the SOLP progra ms in a SOLP collection, where the SCs are re- placed b y ρ -atoms SA T A set of ρ -atoms and g -pre dic a tes asso c iated with the so cial conditions true fo r a given SOLP progra m w.r.t. a s o cial inter- pretation SC - SOS n The decision problem “so c ia lly cr edulous reaso ning ” SM ( P ) The set of all the stable mo dels of P SOS n The decision problem “so c ia l mo del e x istence” SS - SOS n The decision problem “so c ia lly skeptical reasoning ” ST C () The s o cial immediate co nsequence o p e rator, applied to the SOLP collection C T P ( r ) The translatio n of the SCs included in a so cial rule r of P T P () The immediate co nsequence op er a tor, applied to the progr am P TR ( P ) The set of tolerance rules in the pro g ram P USC P The set of all the SCs (at any nesting dept h) in P V ar ( P ) The set of atoms app earing in P W P The translatio n of the SCs included in P ( n -)SC ( n - )So cial Condition COLP COmpro mis e Logic Pr ogramming JFP Joint Fixp oint Sema nt ics NAF Negation As F ailure SOLP SOcial Log ic Pr ogra mming
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment