{'fraction_non_alphanumeric': 0.03477932142519611, 'fraction_numerical': 0.005434268972686892, 'mean_word_length': 4.535704943761444, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Automated Reasoning in Deontic Logic

Deontic logic is a very well researched branch of mathematical logic and philosophy. Various kinds of deontic logics are discussed for different application domains like argumentation theory, legal reasoning, and acts in multi-agent systems. In this paper, we show how standard deontic logic can be stepwise transformed into description logic and DL- clauses, such that it can be processed by Hyper, a high performance theorem prover which uses a hypertableau calculus. Two use cases, one from multi-agent research and one from the development of normative system are investigated.


Introduction
Deontic logic is a very well researched branch of mathematical logic and philosophy. Various kinds of deontic logics are discussed for different application domains like argumentation theory, legal reasoning, and acts in multi-agent systems [11]. Recently there also is growing interest in modelling human reasoning and testing the models with psychological findings. Deontic logic is an obvious tool to this end, because norms and licenses in human societies can be described easily with it. For example in [9] there is a discussion of some of these problems including solutions with the help of deontic logic. There, the focus is on using deontic logic for modelling certain effects, which occur in human reasoning, e.g. the Wason selection task or Byrne's suppression task.
This paper concentrates on automated reasoning in standard deontic logic (SDL). Instead of implementing a reasoning system for this logic directly, we rather rely on existing methods and systems. Taking into account that SDL is just the modal logic K with a seriality axiom, we show that deontic logic can be translated into description logic ALC. The latter can be transformed into so called DL-clauses, which is a special normal form with clauses consisting of implications where the body is, as usual, a conjunction of atoms and the head is a disjunction of literals. These literals can be atoms or existential quantified expressions.
DL-clauses can be decided by the first-order reasoning system Hyper [22], which uses the hypertableau calculus from [4]. In Sections 2 and 3 we shortly depict this workflow, and in Section 4 we demonstrate the use of our technique with the help of two problems from the literature, one from multi-agent research and the other one from testing normative systems. We choose these examples, because they hopefully document the applicability of reasoning of SDL in various areas of AI research.

Deontic Logic as Modal Logic KD
We consider a simple modal logic which consists of propositional logic and the additional modal operators and ♦. Semantics are given as possible world semantics, where the modal operators and ♦ are interpreted as quantifiers over possible worlds. Such a possible world is an assignment, which assigns truth values to the propositional variables. An interpretation connects different possible worlds by a (binary) reachability relation R. The -operator states that a formula has to hold in all reachable worlds. Hence if v and w are worlds, we have Standard deontic logic (SDL) is obtained from the well-known modal logic K by adding the seriality axiom D: In this logic, the -operator is interpreted as 'it is obligatory that' and the ♦ as 'it is permitted that'. The ♦-operator can be defined by the following equivalence: The additional axiom D: P → ♦P in SDL states that, if a formula has to hold in all reachable worlds, then there exists such a world. With the deontic reading of and ♦ this means: Whenever the formula P ought to be, then there exists a world where it holds. In consequence, there is always a world, which is ideal in the sense, that all the norms formulated by 'the ought to be'-operator hold.
SDL can be used in a natural way to describe knowledge about norms or licenses. The use of conditionals for expressing rules which should be considered as norms seems likely, but holds some subtle difficulties. If we want to express that if P then Q is a norm, an obvious solution would be to use which reads it is obligatory that Q holds if P holds. An alternative would be P → Q meaning if P holds, it is obligatory that Q holds. In [21] there is a careful discussion which of these two possibilities should be used for conditional norms. is an auxiliary concept.
The first one has severe disadvantages. The most obvious disadvantage is, that P together with (P → Q) does not imply Q. This is why we prefer the latter method, where the -operator is in the conclusion of the conditional. We will come back to this point in Subsection 4.1 where we consider several formalization variants of the well-known problem of contrary-to-duty-obligations. For a more detailed discussion of such aspects we refer to [10].

Automated Reasoning for Deontic Logic
Deontic logic is the logic of choice when formalizing knowledge about norms like the representation of legal knowledge. However, there are only few automated theorem provers specially dedicated for deontic logic and used by deontic logicians (see [1,3]). Nonetheless, numerous approaches to translate modal logics into (decidable fragments of) first-order predicate logics are stated in the literature. A nice overview including many relevant references is given in [19].
In this paper, we describe how to use the Hyper theorem prover [22] to handle deontic logic knowledge bases. These knowledge bases can be translated efficiently into description logic formulae. Hyper is a theorem prover for firstorder logic with equality. In addition to that, Hyper is a decision procedure for the description logic SHIQ [6].
In Figure 1, we depict the entire workflow from a given SDL knowledge base to the final input into the Hyper theorem prover. In the following, we describe these three steps in more detail.

Transformation from Deontic Logic into ALC
First, we will show how to translate SDL knowledge bases into ALC knowledge bases. An ALC knowledge base consists of a TBox and an ABox. The TBox (terminological box) gives information about concepts occurring in the domain of interest and describes concept hierarchies. The ABox (assertional box) introduces individuals and states, to which concepts the individuals belong and how they are interconnected via relations called roles . The ABox contains assertional knowledge and can be seen as the representation of a state of the world. We do not give the syntax and semantics of ALC here and refer the reader to [2].
There is a strong connection between modal logic and the description logic ALC. As shown in [18], the description logic ALC is a notational variant of the modal logic K n . Therefore any formula given in the modal logic K n can be translated into an ALC concept and vice versa. Since we are only considering a modal logic as opposed to a multimodal logic, we will omit the part of the translation handling the multimodal part of the logic. Mapping ϕ translating from modal logic K formulae to ALC concepts is inductively defined as follows: Note that the mapping ϕ is a one-to-one mapping. Formulae given in SDL can be translated into ALC concepts using the above introduced ϕ mapping. For a normative system consisting of the set of deontic logic formulae N = {F 1 , . . . , F n } the translation is defined as the conjunctive combination of the translation of all deontic logic formulae in N : does not yet contain the translation of the seriality axiom. As shown in [12] the seriality axiom can be translated into the following TBox: with r the atomic role introduced by the mapping ϕ. For our application, the result of the translation of a normative system N and the seriality axiom is an ALC knowledge base Φ(N ) = (T , A), where the TBox T consists of the translation of the seriality axiom and the ABox A = {(ϕ(N ))(a)} for a new individual a. In description logics performing a satisfiability test of a concept C w.r.t. a TBox is usually done by adding a new individual a together with the ABox assertion C(a). For the sake of simplicity, we do this construction already during the transformation of Φ by adding (ϕ(N ))(a) to the ABox.
An advantage of the translation of deontic logic formulae into an ALC knowledge base is the existence of a TBox in ALC. This makes it possible to add further axioms to the TBox. For example we can add certain norms that we want to be satisfied in all reachable worlds into the TBox.

Translation from ALC into DL-Clauses
Next we transform the ALC knowledge base into so called DL-clauses introduced in [15] which represent the input format for the Hyper theorem prover.
DL-clauses are constructed from so called atoms. An atom is of the form b(s), r(s, t), ∃r.b(s) or ∃r.¬b(s) for b an atomic concept and s and t individuals or variables. They are universally quantified implications of the form where the u i are atoms of the form b(s) or r(s, t) and the v j may be arbitrary DL-clause atoms, i.e. including existential quantification, with m, n ≥ 0.
Comparing the syntax of DL-clauses to the syntax of first order logic clauses written as implications, the first obvious difference is the absence of function symbols. The second difference is the fact, that in DL-clauses all atoms are constructed from unary or binary predicates. The most interesting difference however is the fact, that the head of a DL-clause is allowed to contain atoms of the form ∃r.b(s).
The basic idea of the translation of an ALC knowledge base into DL-clauses is that the subsumption in a TBox assertion is interpreted as an implication from the left to the right side. Further concepts are translated to unary and roles to binary predicates. Depending on the structure of the assertion, auxiliary concepts are introduced. For example the TBox axiom d ∃r.b ∀r.c corresponds to the following DL-clause For detailed definitions of both syntax and semantics of DL-clauses and the translation into DL-clauses, we refer the reader to [15]. The translation preserves equivalence, avoids an exponential blowup by using a well-known structural transformation [17] and can be computed in polynomial time. In the following, for an ALC knowledge base K = (T , A), the corresponding set of DL-clauses is denoted by ω(K).

Reasoning Tasks
With the help of Hyper, we can solve several interesting reasoning tasks: -Consistency checking of normative systems: In practice, normative systems can be very large. Therefore it is not easy to see, if a given normative system is consistent. The Hyper theorem prover can be used to check consistency of a normative system N . We first translate N into an ALC knowledge base Φ(N ), then translate Φ(N ) into the set ω(Φ(N )) of DLclauses. Then we can check the consistency of ω(Φ(N )) using Hyper. -Evaluation of normative systems: Given several normative systems, we use Hyper to find out for which normative system guarantees a desired outcome is guaranteed. -Independence checking: Given a normative system N and a formula F representing a norm, we can check whether F is independent from N . If F is independent from N , then F is not a logical consequence of N .
In Section 4, we will give detailed examples for those tasks. Subsection 4.1 gives an example for a consistency check of a normative system and illustrates how the independence of a formula from a normative system can be decided. In Subsection 4.2, we use an example from multi-agent systems to show how to evaluate normative systems.

Applications
The literature on deontic logic deals with numerous small but nonetheless interesting examples. They are mostly used to show typical problems or special features of the logic under consideration (cf. [10]). In Subsection 4.1, we deal with one of these examples. In Subsection 4.2, we formalize a 'real-life' problem from multi-agent research.

Contrary-to-duty Obligations
Let us now consider consistency testing of normative systems and independence checking. As an example, we examine the well-known problem of contrary-to-duty obligations introduced in [8]: (1) a ought not steal.
(3) If a steals, he ought to be punished for stealing. (4) If a does not steal, he ought not be punished for stealing. Table 1 shows three different formalizations of this problem. Those formalizations are well-known from the literature [5,14,13,21]: Consistency Testing of Normative Systems The contrary-to-duty obligation formalized above is a very small example. In practice, normative systems can be rather complex. This makes it difficult to see if a normative system is consistent. We will show how to use the Hyper theorem prover to check the consistency of a given normative system.  Table 2: Translation of the normative system N 1 into ϕ(N 1 ).
As an example, we consider formalization N 1 given in Table 1 which, according to [21], is inconsistent. We will use Hyper to show this inconsistency. For this, we first translate normative system N 1 into an ALC knowledge base Φ(N 1 ). Table 2 shows ϕ(N 1 ).
To perform the satisfiability test, we transform the description logic representation Φ(N 1 ) into a set of DL-clauses ω(Φ(N 1 )). Hyper constructs a hypertableau for ω(Φ(N 1 )). This hypertableau is closed and therefore we can conclude that N 1 is inconsistent.
Independence Checking Normative System N 2 given in Table 1 is consistent. However it has another drawback: The different formulae in this formalization are not independent from another. Formula (3) is a logical consequence of (1), because (s → p) ≡ (¬s ∨ p) (definition of →) which clearly is implied by the (subsuming) formula (1) ¬s. We can use Hyper to show this by transforming the problem into a satisfiability test. For this, we remove formula (3) from N 2 and add its negation ¬ (s → p) to N 2 . If the resulting normative system is inconsistent, we can conclude, that formula (3) is not independent from the other formulae in N 2 .
The problem of independence of formulae given in a normative system is interesting in practice as well. If an existing normative system is extended with some new formulae, it is interesting to know, whether the new formulae are independent from the original normative system. This can be checked automatically using Hyper as described above.
In the same way, we can show, that formula (4) is not independent from N 3 . Note that only this normative system is both consistent and represents all conditionals carefully, i.e. with formulae of the form P → Q (cf. Section 2). Only for this formalization we have: If a steals in the actual world, a will be punished in the corresponding reachable ideal world.

An Example from Multi-agent Systems
In multi-agent systems, there is a relatively new area of research, namely the formalization of 'robot ethics'. It aims at defining formal rules for the behavior of agents and to prove certain properties. As an example consider Asimov's laws, which aim at regulating the relation between robots and humans. In [7] the authors depict a small example of two surgery robots obeying ethical codes concerning their work. These codes are expressed by means of MADL, which is an extension of standard deontic logic with two operators. In [16] an axiomatization of MADL is given. Further it is asserted, that MADL is not essentially different from standard deontic logic. This is why we use SDL to model the example.
Formalization in SDL In our example, there are two robots ag1 and ag2 in a hospital. For sake of simplicity, each robot can perform one specific action: ag1 can terminate a person's life support and ag2 can delay the delivery of pain medication. In [7] four different ethical codes J , J , O and O are considered: -"If ethical code J holds, then robot ag1 ought to take care, that life support is terminated." This is formalized as: -"If ethical code J holds, then code J holds, and robot ag2 ought to take care, that the delivery of pain medication is delayed." This is formalized as: -"If ethical code O holds, then robot ag2 ought to take care, that delivery of pain medication is not delayed." This is formalized as: O → ¬act(ag2 , delay) -"If ethical code O holds, then code O holds, and robot ag1 ought to take care, that life support is not terminated." This is formalized as: Further we give a slightly modified version of the evaluation of the robot's acts given in [7], where (+!!) describes the most and (−!!) the least desired outcome. Note that terms like (+!!) are just propositional atomic formulae here.
we add formulae stating that formulae (1)-(4) hold in all reachable worlds. For example, for (1) we add: Since our example does not include nested modal operators, the formulae of the form (5) are sufficient to spread the evaluation formulae to all reachable worlds.
The normative system N formalizing this example consists of the formalization of the four ethical codes and the formulae for the evaluation of the robots actions.
Reduction to a Satisfiability Test A possible query would be to ask, if the most desirable outcome (+!!) will come to pass, if ethical code O is operative. This query can be translated into a satisfiability test: If is unsatisfiable, then ethical code O ensures outcome (+!!).
Translation into Description Logic As described in Section 3.1, we translate normative system N given in the previous section into an ALC knowledge base Φ(N ) = (T , A). Table 3 shows the result of translating N into ϕ(N ). We further add the following two assertions to the ABox A: ∃r.¬(+!!)(a) Next we translate the knowledge base into DL-clauses and use Hyper to test the satisfiability of the resulting set of DL-clauses. Using further satisfiability tests, we can show, that ethical codes J, J or O are not sufficient to guarantee the most desired outcome (+!!).

Formalization in Description Logic using a TBox
In the formalization given in the previous subsection, we added formulae stating that the evaluation of the agents' actions holds in all worlds, which are reachable in one step, see (5) for an example. In our case it is sufficient to add formulae of the form (5) because the formalization does not include nested modal operators. In general it is desirable to express that those formulae hold in all reachable worlds including worlds reachable in more than one step. However this would mean to either add infinitely many formulae or to use a universal modality, i.e. the reflexivetransitive closure of the respective simple modality.
In description logics we can use a more elegant way to formalize that all worlds are supposed to fulfill certain formulae. Description logic knowledge bases contain a TBox including the terminological knowledge. Every individual is supposed to fulfill the assertions given in the TBox. Hence, we can add the formulae stating the evaluation of the agents' actions into the TBox. For this, we reformulate implication (→) by subsumption ( ). We model the deontic logic formulae given in Table 3

Experiments
We formalized the examples introduced in this section and tested it with the Hyper theorem prover as described above. Since all formalizations are available  in ALC, we used the description logic reasoner Pellet [20] to show the unsatisfiability of the formalizations as well. Table 4 shows the results of our experiments.
In the first column we see the time in seconds the two reasoners needed to show the unsatisfiability of the formalization of the example from multi-agent systems. For Hyper we give two different numbers. The first number is the time Hyper needs to show the unsatisfiability given the set of DL-clauses. In addition to that the second number contains the time needed to transform the ALC knowledge base into DL-clauses. The second column gives the runtimes for the example from multi-agent systems using the formalization with a TBox. And in the last column we present the runtimes for the consistency test of normative system N 1 from the example on contrary-to-duty obligations.
For the examples we considered, the runtimes of Pellet and Hyper are comparable. Further investigation and comparison with other modal and/or description logic reasoning tools is required and subject of future work. In order to use Hyper to perform the satisfiability tests, we first have to translate the examples into DL-clauses. Our experiments show, that this translation is not harmful.

Conclusion
In this paper, we have demonstrated that by means of deontic logic complex normative systems can be formalized easily. These formalizations can be checked effectively with respect to consistency and independence from additional formulae. For normative systems described with deontic logic, there is a one-to-one translation into description logic formulae. These formula can be checked automatically by automated theorem provers, which is in our case Hyper.
We are aware that deontic logic has several limitations. This is why future work aims at using more recent formalisms. For example we want to apply deontic logic in the context of natural-language question-answering systems. There the normative knowledge in large databases often leads to inconsistencies, which motivates us to consider combinations of deontic with defeasible logic.