Modeling ContrarytoDuty with CPnets
Abstract
In a ceterisparibus semantics for deontic logic, a state of affairs where a larger set of prescriptions is respected is preferable to a state of affairs where some of them are violated. Conditional preference nets (CPnets) are a compact formalism to express and analyse ceteris paribus preferences, which nice computational properties. This paper shows how deontic concepts can be captured through conditional preference models. A restricted deontic logic will be defined, and mapped into conditional preference nets. We shall also show how to model contrary to duties obligations in CPnets and how to capture in this formalism the distinction between strong and weak permission.
eontic logic, conditional preference models, ceterisparibus semantics, contrary to duty, strong and weak permission.
1 Introduction
Modelling deontic notions through preferences [12] has the advantage of linking deontic notions to the manifold research on preferences, in multiple disciplines, such as philosophy, mathematics, economics and politics. In recent years, preferences have also been addressed within AI [15, 8, 18] and applications can be found in multiagent systems [19] and recommender systems [17].
We shall model deontic notions through ceterisparibus preferences, namely, conditional preferences for a state of affairs over another state of affairs, all the rest being equal. In particular, we shall focus on the ceterisparibus preference for a proposition over its complement. The idea of ceterisparibus preferences was originally introduced by the philosopher and logician Georg von Wright [23]. It provides the intuition at the basis CPnets [2], a compact formalism which allows for representing preferences and reasoning about them.
Though some contributions have linked deontic concepts to ceteris paribus preferences (see [20]), none has so far focused on CPnets. While the intersection between deontic logic and CPnets is yet unexplored, we think a cooperation among researches from the two fields can be beneficial, and possibly lead to a new workable approach to modelling norms and reason about them.
We shall indeed assume that norms establishing an obligation can be viewed as expressing a social preference for situations in which the obligation is complied with over situations in which it is violated. Similarly, we shall assume that norms establishing liberties (bilateral permissions) express indifference over complementary situations.
We shall discuss two controversial topics in deontic logic, namely contrary to duty obligations and the distinction between strong and weak permissions.
We shall show that a consistent CPnet can be built that captures both an obligation and the prescriptions specifying what should to be done in case the obligation is violated, which may be incompatible with prescriptions on what should be done in case of compliance [4]. We shall illustrate contrary to duties obligations with an amusing example discussed in the literature. However, realistic examples of contrary to duty obligations can be found in various domains, such as in commercial contracts, where repair obligations can be established for delay or nonfulfilment: to inform, compensate the damage, replace defective goods, pay penalties, etc. (for a logical model see [11]. It can also be found in civil liability, where harmful behaviour is met with obligations to repair, mitigate, and pay punitive damages in case of persistence.
We shall also show that a CPnet model can capture concepts of strong and weak permission, a distinction that has been long discussed in deontic logic [22] and even earlier in legal theory, in connection issues concerning the completeness of legal systems [24]. We shall indeed distinguish the case in which an action is positively permitted, through a permissive norm, and the case in which the action is rather unregulated, as no norm, and in particular, no prohibition addresses it.
2 A running example
In this section, we introduce a running example, concerning the presence of cats, dogs, and fences in beach houses (developing the example from [16]). The example is used throughout the paper to explicate new notions when they are introduced.
[Running example] Mary is the mayor of the Cattown, the city of cat lovers. She knows that her community, with few exceptions, dislikes dogs and likes cat. Cattown people also dislike the sight of fences around houses, and generally prefer to be able to move around and visit each other without the obstacle of fences. However, there was a problem with dogs entering other people’s property and causing fear and sometimes harm. Moreover, people are fuzzy about the way in which their town looks, they like that all houses and street furniture are white, as indeed they are. Mary believes that her role consists in defining policies that fit the preferences of her constituency. Thus, she has enacted the following, making them mandatory in Cattown:

dogs are forbidden

people may have a cat or not

if there is dog, then there should be a fence

if there is a fence, it should be white.

if there is no dog, then there should be no fence.
Though most people in her constituency like these policies, some do not. In particular, there a few dog lovers in the city, who did not share the approach to dogs prevailing in Cattown. However, Mary believes that –given the preferences of the majority and the history and peculiar spirit of Cattown– her regulation articulates a social perspective, namely, a view of the community on what it prefers and a view that can justifiably be imposed on all its citizens. If a dog lover has decided to move into Cattown, he should have known what he would find there.
An issue has recently emerged concerning bobcats. It is being debated whether in the absence of a provision prohibiting or allowing bobcats, John is allowed to keep this bobcat in his garden. Mary thinks that he is not, he should have asked for it, while John believes that he is. Can they conflict of opinion be explained away as merely concerning a conceptual misunderstanding (on the notion of a permission)?
3 Deontic language and Contrary to duty
To formally express rules such as those enacted by Mary, a restricted deontic language is sufficient. Here we provide a specification of this language. Let be a countable set of atomic propositions and let , be the corresponding set of literals. Under this assumption, we can identify propositional valuations (or worlds) with maximal consistent conjunctions of literals.
[A restricted norm language]. The language over a set of atoms is defined as follows:

a norm of is any expression having the form or where is a literal in and is a conjunction of such literals

is the set of all norms of and conjunctions of them.
Formulas and have to be read, respectively, “under condition , is obligatory” and “under condition , is permitted.” Note the limitation in our language that does not allow for deontic operators and to be applied to disjunctions.
Unconditional obligation and permission do not need to be added as primitives in the language of the logic as they are definable from conditional obligation and permission. We also do not need a primitive for the bilateral permission, or liberty, which consists in the permission both of a proposition and of its complement.
{definition}
For all :
Using this language and taking into account the previous proposition, we can model obligations and permissions depicted in Example 2. Thus we use the following abbreviations for ”there is a dog”, for ”there is a cat”, for ”there is a fence”, for ”the fence is white”, for ”there is a bobcat”. We can express the norms enacted by Mary as follows:
3.1 Contrary to duty obligations
The norms in our running example include two “contrary to duty” obligations, namely, obligations that are triggered by the violation of another obligation. According to the norm , having a dog, and thus violating norm ) (the prohibition to have dogs), triggers the obligation to have a fence. Similarly, according to the norm , having a fence, and thus violating norm ) (the prohibition to have a fence), triggers the obligation to have it white.
Contrary to duty obligations cannot be captured by standard deontic logic, according to whose semantics a proposition is obligatory if and only if it is true in every perfect (ideal) world, a world in which everything is as it should be. But the world in which a contrary to duty obligation is triggered is subideal one, since in it another obligation is violated, and it remains subideal even if the contrary to duty obligation is complied with. In all perfect worlds in Cattown there are no dogs, and in such worlds there are also no fences in Cattown. So, according to the semantic for standard deontic logic there cannot be an obligation to have fences. Various attempts have been made to capture the idea of contrary to duty (see for instance [21, 3, 10]).
The problem is that a semantics that just distinguishes between ideal and nonideal worlds cannot capture contrary to duty obligations: compliance with a contrary to duty obligation takes us to a world that is better – ceteris paribus – then a world in which the contrary to duty is not complied with, but which is still imperfect. A world with dogs and fences is ceteris paribus better than a world which does not have fences, but the former is still worse than a world in which, ceteris paribus, there are no dogs.
To capture contrary to duty obligations we need a semantics that distinguishes different levels of preferability, so that we can distinguish the imperfect situation in which the main duty is violated, but the contrary to duty obligation is complied, from the even more imperfect situation in which both the main duty and the contrary to duty obligation are violated.
3.2 Strong and weak permissions
Our running example also shows the difference between strong (explicit) and weak (tacit) permissions, an issue much debated within deontic logic. On the one hand, cats are regulated: there is a norm that deals with cats (), by stating that both having and not having cats is allowed. On the other hand, nothing is said about bobcats. In other terms, while the normative system expresses an equal preference for having and not having cats (both are OK), it express no attitude towards bobcats.
This distinction too cannot be captured by the semantics for standard deontic logic, where means that there is at least one perfect world in which is true, in which case is true.
In legal logic, the most popular perspective to distinguish strong and weak permissions is an inferential one. To say that is strongly permitted relative to a normative system means that the normative entails . To say that is weakly permitted means that the normative system under consideration does not entail a corresponding prohibition .
Here we shall provide for a different way to capture the difference between strong and weak permission, based on the distinction between indifference (equal ceterisparibus preference) and incomparability (absence of any preference).
4 CPnets
In order to be able to represent the described scenario, we propose to leverage on existing preference frameworks from AI, namely CPnets. A CPnet [2] is a compact representation of conditional preferences in the ceteris paribus semantics. Conditional preferences describe how the preference of an individual for a specific feature can depend on the choice over some other features. A common example is ”I prefer to drink red wine if meat is served. Otherwise, if fish is served, I prefer to drink white wine, all the rest being equalâ. CPnets and related extensions of the formalism [5, 6] are often on multivalued variables, this means that variables are not strictly boolean. Nevertheless, in this work we assume that all the variables have binary domains. We start by introducing and defining some useful notions.
4.1 CeterisParibus Preferences
We assume a set of variables (also called features or attributes) each one with binary domain, i.e. the domain of each is such that . An instantiation , where , is an assignment of values to . When then we call it a complete assignment or outcome or world, otherwise we call it a partial assignment. The notation returns the value of the variable in the outcome , while returns the value of all the variables but in the outcome .
A preorder is a reflexive and transitive binary relation over the set of all outcomes , which are usually denoted by . In what follows, means that is at least as good/ideal as , means that is equivalent to which is an abbreviation for and . Moreover, means that is better/more ideal than to be an abbreviation of and . Given two possible outcomes , if neither nor are valid, then we say that and are incomparable, denoted with .
We borrow some notations from [2] in order to define ceteris paribus semantics.
[CeterisParibus Preference] Given a set of variables and nonempty sets that partition . Let and , we say that is ceterisparibus at least as good as or better than given if and only if for all
we use ( resp.) as an abbreviation for it (we will omit the subscript when it is clear from the context).
As the preference for over , in the context of , is independent from the values of Y, we may say that is preferentially independent of if otherwise that is said to be conditionally preferentially independent of given the assignment of .
Moreover, from Definition 4.1 we derive the following notation regarding ceterisparibus relation between two outcomes . {definition} Given two outcomes , we say that is ceterisparibus at least as good as or better than relative to , if and only if they differ only in the value of the variable and we abbreviate it with .
Let us refer to Example 2. Mary’s community preferences are over a set of five features, , with the following domains: , , , and . The meaning of variables are the same introduced in Section 3 for atoms: for instance, variable concerns cats, it value is of depending on whether there is a cat or not.
Since has 5 elements, the set of all outcomes contains 32 possible outcomes. For the sake of readability, we do not consider in this section variable and in order to consider a reduced number of outcomes and make the partial orders limited in size. Thus, considering the subset , the set of outcomes are denoted by the complete assignments to considered variables:
The different attitudes of the community can be represented with a set of ceteris paribus preferences. In particular, the negative attitude to dogs is represented by preference for dogsassignments over ceterisparibus dogassignments (i.e. ):
Preference is ceterisparibus (about ) in the sense that it only concerns the comparison between dogassignments and dogassignments that are equal in all the rest (bobcats and fences). These are all pair of outcomes and such that the evaluations of and coincide in all values except for .
Preference for having fences when there are dogs in the house is captured by preferences for fenceassignments over the ceterisparibus fenceassignments, taking only dogassignments into consideration (i.e. ):
Instead, unawareness to bobcats can be modelled through incomparability between bobcatassignments and bobcatassignments, which expresses unfamiliarity to the presence of bobcats, i.e. for all and .
At last, let us consider to have cats and not to have them, this can be represented through the indifference for catassignments over ceteris paribus catassignments (i.e. ). These are all pair of outcomes and where such that is weakly preferable to and viceversa (), that is for instance:
4.2 Incomparability
In the previous section, we introduced the notion of incompatibility. In the ceteris paribus semantics, the notion of incomparability does not allow to differentiate between two different states of affairs: one where two outcomes are incomparable because nothing is said about some values of a feature, and another, where two or more variables are independent and thus preferences are described over the domains of these variables no matter the assignment of the others. Both cases induce a preference graph where some outcomes are incomparable because there does not exist a path between them, i.e. given two incomparable outcomes then , , and . But, while the former case describes a lack of information, possibly because the individual does not know or does not have any information about some features (for instance in our example the lack of information about bobcats), the latter describes a situation where preferences are reported on all the features but not on the combination of them. The lack of dependencies seems to be simpler to fix: the individual already has all the information on the features, thus the incomparability can be avoid by adding a dependency between some of the variables.
[Strong incomparability] Given a preorder , two outcomes are said to be strongly incomparable if they belong to two different components of .
Strong incomparability describes the relation among outcomes of different components; they are incomparable because some information is missing, specifically preferences are not reported for some features. This lack of information can be hard to fix, since it entails a lack of knowledge.
The following definition refers to weakly connected components: a directed graph is said to be weakly connected if the undirected graph resulting from removing the orientation of the edges is connected, i.e. if any pair of vertexes in the undirected graph has a path from to .
[Weak incomparability] Given a preorder , two outcomes are said to be weakly incomparable if they belong to the same weakly connected component of but there does not exist a path from to or viceversa.
Weak incomparability describes a less problematic situation. In this case, preferences are reported but the incomparability is due to some missing dependencies among features. Thus, correcting this kind of incomparability can be quite simple.
4.3 Conditional Preference Networks
Given the above definitions, we can now define conditional preference networks (CPnet).
A CPnet over a set of binary variables is a tuple , where is a directed graph and is a set of conditional preference tables (or CPtables). An edge represents that preferences over depend on the value of .
For each variable a is a set of cpstatements, each one represents an ordering over the specific domain given the assignment to the parents of , e.g. . In its original formulation, each reports strict linear order over the values of the domain of given the partial assignment to . A more recent extension, namely CPnet with indifference [1], takes into account indifference and it also models lack of information through incomparability. In this work we adopt this extension of CPnet. The semantics is connected with the induced preference graph over all the outcomes, that is a complete assignment of values to variables. A directed edge between pair of outcomes , which differ only in the value of one variable, means that . A worsening flip is a change in the value of a variable to a less preferred value according to the cpstatement for that variable.
The semantics of the CPnet with indifference is a preorder over all the outcomes, i.e. a reflexive and transitive binary relation over the set of complete assignment of values to the variables of the CPnet. Thus, for any two outcomes which differs only on the value of one variable we have:

if given

if there is not a cpstatements for given
The partial order induced by the CPnet is denoted as .
The CPnet formalism provides a qualitative compact representation that is useful to represent scenarios similar to the one depicted by the reduced deontic logic introduced in Section 3.
Based on preferences described in Example 2, Figure 1 reports the dependency graph and the CPtables of the CPnet. The CPnet is over the set of variables . Variable does not have a CPtable because the community did not express any preferences about bobcats. Notice the indifference on the values of variable which describes the liberty to have or not to have cats. The strong attitude about dogs induces the strict order over the domain of the variable . Orders over the variable depends on whether or not there is a dog and orders over the variable depends on whether or not there is a fence.
The partial order by the CPnet is reported in Figure 2. The binary relation among outcomes is based on dependencies and preferences reported in the CPtables of the CPnet. For instance, outcomes and are in the same node due to the indifference on the values of the variable all the rest being equal, while because dogassignments are ceterisparibus better than dogassignments.
Notice that the preference graph has two components. Outcomes in the two components differs on the assignment of the variable for which no preferences are expressed, thus each component represent different scenario which differs from the other for the presence of bobcats. As we described in the previous section, this is represented with strong incomparability between outcomes of different components.
5 Deontic Language and CPnets: bridging the gap
A set of obligations and liberties expressed in the restricted language define in Section 3 can be represented using a CPnet, we will call it a prescriptive CPnet. Note that we do not provide for the representation of unilateral permission. In fact we assume that unilateral permissions must be implied either by an obligation (in case the complement is forbidden) or by a liberty (in case the complement is also permitted).
Indeed, the restriction on obligations and liberties where antecedents are conjunctions of literals and consequent is a single literal is compatible with the syntax of CPnet with indifference [1].
5.1 Modeling Deontic Language with CPnets
In this section we define the CPnet that is induced by a given set of prescriptions.
Given a set of statements in and the prescriptive CPnet . In , is a directed graph over a set of variables such that:

for each corresponds a with

each conditional obligation and each liberty , introduce dependencies in . Specifically, for each literal , they introduce a directed edge between and in , thus becomes a parent of

each obligation induces a strict order over given the assignment such that

each conditional liberty induces a weak order over given the assignment such that .
Notice that variables with empty CPtables or partially empty CPtables may exist. These variables will induce incomparability in the preorder.
5.2 Mapping Preference Models with CPnets
In this section we shall provide a ceteris paribus semantics for the deontic language provided above. In the next session, we shall show that this semantics identifies models that correspond to CPnets. The semantics of the deontic language is defined in terms of preference relations on worlds.
[Preference models of ] A preference model of is a preorder on the set U of outcomes.
A set of ceterisparibus conditional obligations and liberties is consistent if it has at least one model, and inconsistent otherwise. A set of ceterisparibus conditional obligations and liberties entails another preference formula , written , if every model of is also a model of . In the following definition, an outcome refers to conjunctions of propositional literals referring to each variable in exactly once, and which are consistent. Thus, for instance refers to valuation of variable . Satisfaction for formulas in the language is defined as follows, where means that the propositional formula is true at the valuation corresponding to the outcome : {definition}[Satisfaction in ] Given a set of norms and a preference model , we say that satisfies , if for each the following hold:
The class of models satisfying a set of norms is denoted with . Among all the possible is the subset of models that refers only to consistent conjunctions of propositional literals in . Then is the preference model such that for each .
As a liberty is a bilateral permission (), we have that
Given the previous definitions we now show that a set of ceterisparibus norms in is expressible with a prescriptive CPnet, this means that the preorder induced by the CPnet is a model which satisfies .
Given a set of norms and the prescriptive CPnet , then . {proof} This is equivalent to prove that for each norm
(1) 
We show how to prove (1) showing how this can be done for obligations. Let start by assuming that , by definition this is equivalent to , thus for for consistency of with :
by definition, this is equivalent to
This proves direction. We show the other way round () by contradiction. Let us assume that , thus but this means that also . But this is a contradiction.
On the basis of the CPnet modellin described above the following propsitions hold. {proposition} A contrary to duty framework is modelled by a consistent CPnet. {proof} The CPnet is reported in Figure 4.
6 Conclusions
Our analysis shows that a set of norms expressed in deontic logic can be translated into a corresponding CPnet without loss of semantics, thus providing a conditional preference network giving a compact representation.
On the contrary, CPnets allow to model differ scenarios and to infer interesting properties and information about the set of norms. The main problems that CPnets allow to tackle are reasoning about the dominance testing and consistency testing. Both of them are in general far from easy. In the first problem we want to decide whether one outcome dominates , i.e. . In the second problem we want to find out whether there is a dominance cycle in the preorder defined by a CPnet, i.e. whether there is an outcome that dominates (is preferred to) itself. In general both dominance and consistency for CPnets can be NPcomplete [2, 9]. But when the CPnet is over a set of binary variables, and its dependency graph is a tree, the dominance testing becomes linear in the number of variables, if it is a polytree than dominance testing becomes polynomial in the number of variables [2]. Moreover, in many scenarios, the presence of cycles in the dependency graph means that the network is inconsistent [7]. Thus, the consistency testing would allow to determine when a set of norms is inconsistent because contradictory while the dominance test allows to test whether a world is better than another. Moreover, in recent studies, preferences represented with compact representation are used in metric spaces in order to define how similar they are [13, 14]. Furthermore, as preference orders are exponential in the number of considered variables, it is of main importance being able to find feasible ways to compute the distance among preferences exploiting the compact representation of such domains.
The results presented here represent just a preliminary exploration of intersection between CPnets and deontic logic, but it can provide a starting point for further research.
References
 (2013) CPnets with indifference. In 2013 51st Annual Allerton Conference on Communication, Control, and Computing (Allerton), pp. 1488–1495. Cited by: §4.3, §5.
 (1999) Reasoning with conditional ceteris paribus preference statements. In Proceedings of the Fifteenth conference on Uncertainty in artificial intelligence, pp. 71–80. Cited by: §1, §4.1, §4, §6.
 (2002) Deontic logic and contrarytoduties. In Handbook of philosophical logic, pp. 265–343. Cited by: §3.1.
 (1957) Perceiving: a philosophical study. Cornell University. Cited by: §1.
 (2013) Updates and uncertainty in CPnets. In Proceedings AUSAI213, Cited by: §4.
 (2015) Reasoning with PCPnets in a multiagent context. In Proceeding AAMAS2015, Cited by: §4.
 (2002) CPnetsreasoning and consistency testing. In In Proceedings of the Eighth International Conference on Principles of Knowledge Representation and Reasoning, Cited by: §6.
 (2011) Preferences in ai: an overview. Elsevier. Cited by: §1.
 (2008) The computational complexity of dominance and consistency in CPnets. Journal of Artificial Intelligence Research 33 (1), pp. 403–432. Cited by: §6.
 (2006) Logic of violations: a gentzen system for reasoningwith contrarytoduty obligations. The Australasian Journal of Logic 4. Cited by: §3.1.
 (2011) Justice delayed is justice denied: logics for a temporal account of reparations and legal compliance.. In CLIMA, J. Leite, P. Torroni, T. Agotnes, G. Boella and L. van der Torre (Eds.), pp. 364–82. Cited by: §1.
 (2007) The structure of values and norms. Cambridge University Press. Cited by: §1.
 (2018) An efficient algorithm to compute distance between lexicographic preference trees.. In IJCAI, pp. 1898–1904. Cited by: §6.
 (2018) On the distance between cpnets. In Proceedings of the 17th International Conference on Autonomous Agents and MultiAgent Systems, pp. 955–963. Cited by: §6.
 (2016) Preferences in artificial intelligence. Annals of Mathematics and Artificial Intelligence 77 (34), pp. 361–401. Cited by: §1.
 (1997) Dyadic deontic logic and contrarytoduty obligations. In Defeasible deontic logic, pp. 223–262. Cited by: §2.
 (2011) Introduction to recommender systems handbook. In Recommender systems handbook, pp. 1–35. Cited by: §1.
 (2011) A short introduction to preferences: between artificial intelligence and social choice. Synthesis Lectures on Artificial Intelligence and Machine Learning 5 (4), pp. 1–102. Cited by: §1.
 (2008) Multiagent systems: algorithmic, gametheoretic, and logical foundations. Cambridge University Press. Cited by: §1.
 (2011) On the two faces of deontics: semantic betterness and syntactic priority. Cited by: §1.
 (1999) Contrarytoduty reasoning with preferencebased dyadic obligations. Annals of Mathematics and Artificial Intelligence 27 (1–4), pp. 49–78. Cited by: §3.1.
 (1963) Norm and action: a logical inquiry. Routledge. Cited by: §1.
 (1963) The logic of preference. Cited by: §1.
 (1903) Lücken im recht. DunckerHumblot. Cited by: §1.