1 Introduction
This thesis aims to study how to relate a symbolic representation of normative
systems in Input/Output logic (I/O) with the computational model of Neural
Networks.
We will be using a Neural-Symbolic paradigm, a Neural-Symbolic Learning
System to be more precise, that combines two different reasoning approaches: using
the symbolic approach to represent the knowledge base and embedding it within
a connectionist reasoning approach. To do this we relied on the methodology
discussed in [2], using this methodology we managed to tackle some significant
limitations of I/O logic.
I/O logic is a powerful tool to specify normative systems but lacks of important
features such as learning capacity and scalability. These properties are pivotal for
modeling complex, dynamic and distributed entities such as normative systems.
The problem that we want to tackle originates from the normative reasoning field
where some of the knowledge needed to obtain the correct solution is not always
explicit. We can take for instance a legislative environment where the judicial
court formulates trials by following the normative code. The problem relies in the
fact that when the judge formulates his trials, he also relies on the tacit part of the
law that is not explicitly represented. This tacit part of the law is due to social
conducts, previous trials made from other judges and other factors that makes the
normative code alone insufficient to formulate a correct trial.
We can use I/O logic to formalize the normative code, but it will not be suf-
ficient to produce the trials like a real judge would have, to address this problem
we should train the ”normative code” in order to make it learn the tacit part of
the law but due to the symbolic nature of I/O logic presents certain limits re-
garding the learning capacity, like the knowledge acquisition bottleneck discussed
in [9]. Such limits are related to the expert systems which consist in the problem
relative to the formalization of the knowledge base and the new rules that result
from machine learning due to the symbolic knowledge representation. Moreover,
the reasoning mechanism designed for I/O lacks of scalability w.r.t the number of
rules that represent a normative code.
4
By using a Neural-Symbolic Learning System we can tackle the knowledge ac-
quisition bottleneck and the other learning problems that affects pure symbolic
systems. In this way a Neural-Symbolic Learning System can be built from an ex-
isting normative code and then trained using instances of past cases like a neural
network, in order to learn the tacit part of the law that has been implicitly used
to make those trials.
Another field where a Neural-Symbolic Learning System could prove useful is in
Agent Communities, in this kind of environment we can suppose a scenario where
a new agent joins an existing community and it is unaware about the regulations
and protocols. By using a Neural-Symbolic Learning System the new agent could,
by observing the other agents belonging to the community, learn the protocols and
regulations ruling the community.
The integration of symbolic logic with neural networks, in this particular
case the integration of I/O logic with neural networks using a Neural-Symbolic
paradigm [2] can overcome the current limits of I/O logic by introducing a massive
parallel computational model and an efficient mechanism to learn from instances.
I/O logic presents a strong (and natural) similarity with neural networks: both
have a separate specification of inputs and outputs.
The standard semantics used for I/O based on classical logic closure [10] is
purely theoretical and does not have a computational counterpart like, for instance,
fixed point semantics for logical programs.
In order to define a mapping between semantics of I/O logic and neural com-
putation, we have identified a fragment of I/O that permits a natural translation
from an I/O knowledge base into a neural network.
We will show that the identified fragment can be reduced to definite programs
[21]. This approach will enable us to employ the algorithms that maps definite
logical programs with neural networks presented in [2].
We will also take into consideration some of the problems that affects Deontic
logic, the Dilemma and the Contrary to Duty. We will discuss how those problems
can be solved by using a Priority-Based ordering between the rules and how this
solution can be transfered from a symbolic approach based on rules to a Neural-
Symbolic Learning System.
5
Here we will summarize what we are going to find in the further sections of this
thesis, in Section 2 we will introduce the concepts that we used for the development
of this thesis like deontic logic, I/O logic and neural networks. In addition we will
also describe the Neural-Symbolic approach and the benefits that this kind of
methodology can bring to the system.
In Section 3 we will describe in details the translation algorithms proposed in
[2] to translate a knowledge base expressed using a symbolic approach, I/O logic
in our case, into a neural network capable to compute the same semantics as the
symbolic paradigm and having the advantages of an enhanced learning capability
and a massive parallel computation.
In Section 4 we will describe the developed application that implements the
translation algorithms described in the previous section. Here we will discuss
about how the the application has been developed, describing the packages used
and how it can be used to build a Neural-Symbolic Learning System starting from
a knowledge base containing a normative code composed by I/O logic rules and
priority-based orderings.
In Section 5 we will present the test case chosen, we have decided to construct a
normative code from the rules that the robots have to follow in order to play in the
RoboCup and the tests made on the neural networks built using the application
developed. We will see some tests that stress the robustness of the network and
other aimed to verify the learning capacity.
At last in the final Section 6 we will discuss about the future works that could
be done to further enhance the contribution of this thesis and the conclusions
achieved.
6
2 State of the Art
Before discussing the research question, we are going to review some topics dis-
cussed in this thesis. First we are going to take an overlook on deontic logic,
describing then a branch of it, the input/output logic. After that, we will intro-
duce the neural networks, describing how they are built and function. In the last
part of this section, we are going to describe what is a neural-symbolic approach.
2.1 Deontic logic
The term deontic comes form the ancient Greek word de´on that can be translated
as: that which is binding or proper and its task is to model the concepts of obliga-
tion and permission. Its origins goes back to ancient Greece but von Wright was
the first to consider obligations and permissions as features of acts [22].
The standard deontic logic makes use of a Kripke-style semantics in order to
give non-classical logics, like deontic logic, a formal semantics that allows to give
a meaning to the sentences of a formal language [17].
In order to model the concepts of obligation and permission, the standard
deontic logic introduces two operators, O and P.
The O operator is used to represent the obligation and can be wrote as: O(α|β),
which means that α is obligatory if β is given. The P operator is written in a similar
way: P(α|β). What differs is that this operator represents a permission, in this
case P(α|β) means: α is permitted if β is given. This notation is not the only
available for the deontic logic, instead of those two binary operators1 it is possible
to use a unary variant of the operators, that instead of the formers, operates only
on a single formula. Using the unary operators, the concepts of obligation and
permission can be represented as follows: β → O(α) for the obligation and β →
P(α) for the permission, by reading the → as if the antecedent is given then the
consequent. In terms of meaning the new representations obtained using the unary
operators, are equivalent to the one we introduced before using a binary version
of the same operators.
We can bind the two operators O and P by the following relationships:
1A binary operator is a logic operator that operates on two formulae, an example can be given
by the logic and: α ∧ β, because it deals on α and β.
7
1. O(α)←→ ¬P(¬α);
2. P(α)←→ ¬O(¬α);
Following those relationships, the oblige can be also defined as: is not possible
to not do something and the permission as: is not mandatory not to do something.
In the latter case we can consider that P(α) ←→P(¬α) because if something is
permitted it must also be permitted to do the opposite. Then we can consider
¬O(¬α)←→ ¬O(α) that means both ¬α and α are not mandatory.
With the relationships introduced it is possible to formally define the denial
in addition to oblige and permission as: O(¬α) or ¬P(α). In this way in deontic
logic we can deny something by forcing not to do something or not permitting to
do something, a useful feature for normative reasoning.
A way to explain how permission and obligation work in deontic logic is with
the possible worlds model [3]. This model is represented with a directed graph and
it works like a finite-state automa. Like for the automa, each node of the graph
represents a state, or a possible worlds for the possible world model, and the
connections between the nodes represents the possible transitions between states
(or possible worlds).
In figure 1 is shown a fragment of an hypothetical possible worlds model, each
possible world is labeled as Ai with i from 0 to n. If we suppose A0 as our starting
world, A1 through An are the worlds reachable from our starting one.
We can assume that in each world there is a set of facts that are considered
true or false for that world, these facts are represented by positive and negative
atoms.
After having described the possible worlds model, we can explain how deontic
logic operation works. Considering the binary form2 of the obligation, O(α|β),
means: if β is present in the atoms of the actual world, for instance we can
consider the world A0, then every reachable world must contain the atom α, in
our case, considering the figure 1, every world from A1 to An must have α in his
atoms set.
For the permission, P(α|β), things are similar because if β is present in the
actual world, then at least a reachable world must contain the atom α, to make
2The unary form β → O(α) would be equivalent.
8
Figure 1: Possible worlds model fragment.
9
an example using figure 1, having A0 as actual world, then at least one reachable
world from A1 to An must have α in his atoms set.
In the denial case O(¬α|β) or ¬P(α|β), always considering the example in
figure 1, if β is present in the actual world A0 then α must not be present in every
reachable worlds from A0.
Using deontic logic operators obligation and permission is possible to define
rules and and norms. By collecting those rules in a set is possible to define a
theory that can be used to verify models. A model is a representation of the
world, a collection of atoms which represents the attributes of the world situation
that we want to model. Given that deontic logic rules can formalize obligations and
permissions, it is possible to adopt the theories built with those rules as normative
codes.
Using theories to reason on world models is useful to find which situations can
comply with a normative code and even find which violations are occur in that
model.
Theories can be used to determine which model are correct and which do not
comply with the normative code that is represented in the theory, obviously this is
true if we are sure that the theory that we are using is correct. However, if we are
not fully confident on the correctness of the theory, trying to verify models and
finding violations of well known situations, which are models that we know how
they should be handled, then it is possible to train the theory in order to learn
how to correctly handle those models and the similar ones.
To show how deontic logic rules can represent real permissions and obligations,
we can consider a simple toy theory3 and the rules capable to model it.
We can consider as an example a little boy (or girl) that goes to school, he has
to do his homeworks every day, though is known that kids hate to do homeworks
and are always willing to play. However we cannot let kids play all the day, but
would be cruel not to allow them to play, so they will be able to play as much as
they want after they finished their homeworks.
Example 1 This simple example can be modeled using two deontic logic rules:
3A toy theory, or everything defined a toy (eg. a toy model) is a case that has no practical
use but simple enough to be used as a clarifying example.
10
1. O(h|dh)
2. P(¬h|p)
Considering the two simple rules in Example 1, we are able to describe the toy
theory described before. The first rule means: if a kid has homeworks to do (h)
then his duty is to do them (dh). The second rule: if a kid does not have any
homeworks to do (¬h) then he can play (p). The difference between the two rules
lies in the consequent, in the first we have an obligation because we want to oblige
the kid to finish his homeworks, instead in the second rule consequent we have a
permission because we want to allow the kid to play but we do not want to force
him to do so.
Having explained how a theory can be modeled using deontic logic rules, we
are going to describe some known problems of this logic: the Dilemma and the
Contrary to Duty.
2.1.1 Dilemma
To explain what is the Dilemma problem we can use a classic example: Sartre’s
soldier’s dilemma. The dilemma is created by conflicting codes of conduct that
someone has to follow, in this example the Sartre’s soldier has the duty to kill his
enemies but, being a man he also has the moral oblige to not to kill.
Example 2 This classic example can be represented using the following deontic
logic rules:
1. O(>4|¬k)
2. O(s|k)
Considering the rules in Example 2, which model Sartre’s soldier’s dilemma, if
applied will give in the result both obligatory (k) and obligatory (¬k), that is both
kill and not to kill, this because the first rule antecedent, always true, will give
4> represents a tautology, something that is always considered true, in this case we assume
that Sartre’s soldier is a man with a moral, so he should never kill and using a tautology in the
antecedent of the rule, always allows to derivate the consequent.
11
the obligatory (¬k) obligation, whereas the second rule, where the antecedent (s)
is complied because applied to a soldier produces obligatory (k). Usually in logic,
contradictions are caused by a faulty formalization of the rules or a wrong model
on which are applied the rules. In this case, more generally every case involving
dilemmas, the contradiction created by the rules should not be viewed as an error
in the rules or the model but it should be viewed as a valid outcome. This because
modeling permissions and obligations of the real world where dilemmas exist, then
it can be considered acceptable to have dilemmas in deontic logic.
Even if we are going to view the dilemma as a valid outcome for the deontic
logic, in the case we want to apply an automatic reasoner to the rules, we should
consider some mechanisms to solve those contradictions in order to remove them
from the outcome. A possible way to solve contradictions caused by dilemmas can
be done by using a priority based ordering between the rules that produces the
dilemma. Prioritizing a rule over another with a criteria allows to generate only
one of the two conflicting way of conduct.
In the Sartre’s soldier’s example we can decide that the rule: a soldier must
kill has the priority over a person must not kill because is more specific than the
latter. In this case Sartre’s soldier that trigger both rules (rule number 1 because
is always activated and number 2 because he is a soldier) will only have the duty
to kill his enemies because the second rule overcomes the first due to the adopted
criteria. However applying the rules over a civilian, only rule number 1 will trigger
and, not being suppressed by the activation of the second rule, generates the moral
oblige to not to kill, that is exactly what is desired.
2.1.2 Contrary to Duty
The contrary to duty [23] is a problem relative to normative reasoning. It intro-
duces into a normative system a way to handle exceptions and situations where
violations occur.
To better explain the contrary to duty we can consider a simple example: let’s
suppose that we are having a beer with a friend, one of the last things we want is
our beer being spilled by our friend, maybe after having waited quite long to get
it. What if unluckily our friend accidentally spills our beer? Do we want to severe
our friendship only for a poured beer? Usually this should not be the case, our
12