This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

11institutetext: Independent Researcher, Barcelona, Spain

Towards Regulated Deep Learning
First step in a Roadmap towards Collaborative Knowledge Evolution

Andrés García-Camino
dragc@duck.com
Abstract

Regulation of Multi-Agent Systems (MAS) and Declarative Electronic Institutions (DEIs) was a multidisciplinary research topic of the past decade involving (Physical and Software) Agents and Law since the beginning, but recently evolved towards News-claimed Robot Lawyer since 2016. One of these first proposals of restricting the behaviour of Software Agents was Electronic Institutions.

However, with the recent reformulation of Artificial Neural Networks (ANNs) as Deep Learning (DL), Security, Privacy, Ethical and Legal issues regarding the use of DL has raised concerns in the Artificial Intelligence (AI) Community. Now that the Regulation of MAS is almost correctly addressed, we propose the Regulation of Artificial Neural Networks as Agent-based Training of a special type of regulated Artificial Neural Network that we call Institutional Neural Network (INN).

The main purpose of this paper is to bring attention to Artificial Teaching (AT) and to give a tentative answer showing a proof-of-concept implementation of Regulated Deep Learning (RDL). This paper introduces the former concept and provides \mathcal{I}, a language previously used to model declaratively and extend Electronic Institutions, as a means to regulate the execution of Artificial Neural Networks and their interactions with Artificial Teachers (ATs).

1 Motivation

Regulation of Multi-Agent Systems (MAS) and Declarative Electronic Institutions (DEIs) [1][2][3] was a multidisciplinary research topic of the past decade involving (Physical and Software) Agents and Law since the beginning, but recently evolved towards News-claimed Robot Lawyer since 2016. One of these first proposals of restricting the behaviour of Software Agents was Electronic Institutions [4] [5] [6].

However, with the recent reformulation of Artificial Neural Networks (ANNs) as Deep Learning (DL) [7], Security, Privacy, Ethical and Legal issues regarding the use of DL has raised concerns in the Artificial Intelligence (AI) Community [8].

Now that the Regulation of MAS is almost correctly addressed, we propose the Regulation of Artificial Neural Networks as Agent-based Training of a special type of regulated Artificial Neural Network that we call Institutional Neural Network (INN).

The main purpose of this paper is to bring attention to Artificial Teaching (AT) and to give a tentative answer showing a proof-of-concept implementation of Regulated Deep Learning (RDL).

This paper introduces the former concept and provides \mathcal{I} [2], a language previously used to model and extend Electronic Institutions[6], as a means to regulate the execution of Artificial Neural Networks and their interactions with Artificial Teachers (ATs).

The structure of this position article is as follows, in section 2 the need of Agent-based Training for DL (ABT4DL) is introduced. In Section 3 the fore-mentioned language is introduced and, Section 3.1 presents some preliminary definitions for this work. The normative language that includes the tentative answer is presented in section 4. Section 5 presents the Semantics of the language and section 6 its Operational Semantics. Some examples of Artificial Neural Network modeling are presented in section 7. And finally, sections 9 and 10 presents some conclusions and possible future work to continue this research, respectively.

2 Agent-based Training for Deep Learning

Current ANNs, and subsequently Deep Learning, proposals are Data-driven: they model an a priori unknown function by processing large amounts of data [7] without automatically controlling the source of this data, neither how one could certify the proper use of the data.

We introduce Agent-based Training for Deep Learning (ABT4DL) as a new paradigm for Automated training of Artificial Neural Networks. However, we envisage that such training should be regulated and mediated, thus, as we propose agents as artificial data providers with an intuitive role of Artificial Teacher (AT), using a Regulated MAS as follows in order to regulate and mediate the behaviour of these Artificial Teachers interacting with Artificial Neural Networks residing in the state-of-affairs of a Declarative Electronic Institution [3].

3 Introducing a Regulation Language

The proposed language in this work is based in Event-Condition-Action (ECA) rules, that perform the specified institutional actions when the given agent events occur and when the prespecified conditions hold. The performance of actions add or remove atomic formulae thus triggering another type of rule: the if-rules, that are standard production rules as usually found in Expert Sytems [9]. Above these two types of rules a new types of rules are placed: ignore-rules, that ignore a set of simultaneous events, force-rules, that generate a set of events on the occurrence of a given set of events satisfying certain conditions, and prevent-rules, that ignore the execution of ECA or if-then rules if certain formulae hold in the current state and another given set of formulae hold in the calculation of the next state.

3.1 Preliminary Definitions

Some basic concepts are now introduced. The building blocks of the language are terms:

Definition 1

A term, denoted as τ\tau, is

  • Any variable x,y,zx,y,z (with or without subscripts) or

  • Any construct fn(τ1,,τn)f^{n}(\tau_{1},\ldots,\tau_{n}), where fnf^{n} is an n-ary function symbol and τ1,,τn\tau_{1},\ldots,\tau_{n} are terms.

Terms f0f^{0} stand for constants and will be denoted as a,b,ca,b,c (with or without subscripts). Numbers and arithmetic functions to build terms are used ; arithmetic functions may appear infix, following their usual conventions. Prolog’s convention [10] is used using strings starting with a capital letter to represent variables and strings starting with a small letter to represent constants. Some examples of terms are 𝑃𝑟𝑖𝑐𝑒\mathit{Price} (a variable) and 𝑠𝑒𝑛𝑑(a,B,Price×1.2)\mathit{send}(a,B,Price\times 1.2) (a function). The definition of atomic formulae is as follows:

Definition 2

An atomic formula, denoted as α\alpha, is any construct pn(τ1,,τn)p^{n}(\tau_{1},\allowbreak\ldots,\allowbreak\tau_{n}), where pnp^{n} is an nn-ary predicate symbol and τ1,,τn\tau_{1},\allowbreak\ldots,\allowbreak\tau_{n} are terms.

When the context makes it clear what nn is, it is dropped. p0p^{0} stands for propositions. Arithmetic relations (e.g., ==, \neq, and so on) are employed as predicate symbols, and these will appear in their usual infix notation. Atomic formulae built with arithmetic relations to represent constraints on variables are used – these atomic formulae have a special status, as it is explained below. The definition of constraints in this work, a subset of atomic formulae is:

Definition 3

A constraint γ\gamma is a binary atomic formula ττ,\tau\vartriangleleft\tau, where {=,,>,,<,}\vartriangleleft\,\in\{=,\neq,>,\geq,<,\leq\}.

Γ={γ1,,γn}\Gamma=\{\gamma_{1},\ldots,\gamma_{n}\} is used as a set of constraints. A state of affairs is a set of atomic formulae, representing (as shown below) the normative positions of agents, observable agent attributes and the state of the environment111It is referred to the state of the environment as the subset of atomic formulae representing observable aspects of the environment in a given point in time..

Definition 4

A state of affairs Δ={α0:Γ0,,αn:Γn}\Delta=\{\alpha_{0}:\Gamma_{0},\ldots,\alpha_{n}:\Gamma_{n}\} is a a finite and possibly empty set of implicitly, universally quantified atomic formulae αi\alpha_{i} restricted by a possibly empty set of constraints Γi\Gamma_{i}, 0in0\leq i\leq n. When the set of constraints is empty, it is written just αi\alpha_{i}.

4 \mathcal{I}: A Language for Institutional Neural Networks

This section introduces a rule language for the regulation and management of concurrent events generated by a population of agents.

Δ0Δ0Ξ10,,Ξn0𝑎𝑔1𝑎𝑔nΔ1Δ1Ξ11,,Ξm1𝑎𝑔1𝑎𝑔m\framebox{$\Delta_{0}$}\Rrightarrow\begin{array}[]{|c|}\hline\cr\vspace*{-2mm}\hfil\\ \framebox{$\Delta_{0}$}\\ \vspace*{-2mm}\hfil\\ \Xi^{0}_{1},\cdots,\Xi^{0}_{n}\\ \hline\cr\lx@intercol\hfil\begin{array}[]{ccc}\updownarrow&&\updownarrow\\ \mathit{ag}_{1}&\hskip 0.56905pt\cdots&\hskip 5.69054pt\mathit{ag}_{n}\end{array}\hfil\lx@intercol\end{array}\stackrel{{\scriptstyle*}}{{\rightsquigarrow}}\framebox{$\Delta_{1}$}\Rrightarrow\begin{array}[]{|c|}\hline\cr\vspace*{-2mm}\hfil\\ \framebox{$\Delta_{1}$}\\ \vspace*{-2mm}\hfil\\ \Xi^{1}_{1},\cdots,\Xi^{1}_{m}\\ \hline\cr\lx@intercol\hfil\begin{array}[]{ccc}\updownarrow&&\updownarrow\\ \mathit{ag}_{1}&\hskip 0.56905pt\cdots&\hskip 5.69054pt\mathit{ag}_{m}\end{array}\hfil\lx@intercol\end{array}\stackrel{{\scriptstyle*}}{{\rightsquigarrow}}\cdots
Figure 1: Semantics as a Sequence of Δ\Delta’s

Figure 1 depicts the computational model used: n initial state of affairs Δ0\Delta_{0} (possibly empty) is offered (represented by “\Rrightarrow”) to a set of agents (ag1,,agnag_{1},\cdots,ag_{n}). These agents can add their speech acts (Ξ10,,Ξn0\Xi^{0}_{1},\cdots,\Xi^{0}_{n}) to the state of affairs (via “\updownarrow”). Ξit\Xi^{t}_{i} is the (possibly empty) set of speech acts added by agent ii at state of affairs Δt\Delta_{t}. After an established amount of time, an exhaustive application of rules is performed(denoted by “\stackrel{{\scriptstyle*}}{{\rightsquigarrow}}”) to the modified state, yielding a new state of affairs Δ1\Delta_{1}. This new state will, in its turn, be offered to the agents for them to add their utterances, and the same process will go on.

One goal of the \mathcal{I} language is to specify the effects of concurrent events and this is achieved with Event-Condition-Action (ECA) rules. Intuitively, an ECA-rule means that whenever the events occur and the conditions hold then the actions are applied. These actions consist of the addition and removal of atomic formulae from the state of affairs. ECA-rules are checked in parallel and they are executed only once without chaining.

If-rules are similar to rules in standard production systems, if the conditions hold then the actions are applied. They are implemented with a forward chaining mechanism: they are executed sequentially until no new formula is added or removed.

Ignore-rules are used for ignoring events when the conditions hold in order to avoid unwanted behaviour. Similarly, prevent-rules are used for preventing some conditions to hold in the given situations. In order to prevent unwanted states, events causing such unwanted states are ignored. Force-rules generate events and execute actions as consequence of other events and conditions.

Sanctions over unwanted events can be carried out with ECA-rules. For instance, they can decrease the credit of one agent by 10 if she generates a certain event.

ECA-Rule::=𝐨𝐧 set_of_events 𝐢𝐟 conditions 𝐝𝐨 actionsif-Rule::=𝐢𝐟 conditions 𝐝𝐨 actionsignore-Rule::=𝐢𝐠𝐧𝐨𝐫𝐞 set_of_events 𝐢𝐟 conditionsprevent-Rule::=𝐩𝐫𝐞𝐯𝐞𝐧𝐭 conditions 𝐢𝐟 conditionsforce-Rule::=𝐟𝐨𝐫𝐜𝐞 set_of_events 𝐨𝐧 set_of_events𝐢𝐟 conditions 𝐝𝐨 actionsset_of_events::=events|events::=atomic_formula,events|atomic_formulaconditions::=conditions & conditions|not(conditions)|𝚜𝚊𝚝(set_of_constraints)|constr_formula|𝚜𝚎𝚝𝚎𝚚(set_of_constraints,set_of_constraints)|constraintset_of_constraints|𝚝𝚒𝚖𝚎(number)|𝚝𝚛𝚞𝚎constr_formula::=atomic_formulae|atomic_formulae:set_of_constraints𝑎𝑐𝑡𝑖𝑜𝑛𝑠::=action,actions|actionaction::=add(constr_formula)|del(constr_formula)\begin{array}[]{rcl}\mbox{$ECA$-$Rule$}&::=&\mbox{$\mathsf{\mathbf{on}}$ }set\_of\_events\mbox{ $\mathsf{\mathbf{if}}$ }conditions\mbox{ $\mathsf{\mathbf{do}}$ }actions\\ \mbox{$if$-$Rule$}&::=&\mbox{$\mathsf{\mathbf{if}}$ }conditions\mbox{ $\mathsf{\mathbf{do}}$ }actions\\ \mbox{$ignore$-$Rule$}&::=&\mbox{$\mathsf{\mathbf{ignore}}$ }set\_of\_events\mbox{ $\mathsf{\mathbf{if}}$ }conditions\\ \mbox{$prevent$-$Rule$}&::=&\mbox{$\mathsf{\mathbf{prevent}}$ }conditions\mbox{ $\mathsf{\mathbf{if}}$ }conditions\\ \mbox{$force$-$Rule$}&::=&\mbox{$\mathsf{\mathbf{force}}$ }set\_of\_events\mbox{ $\mathsf{\mathbf{on}}$ }set\_of\_events\\ &&\mbox{$\mathsf{\mathbf{if}}$ }conditions\mbox{ $\mathsf{\mathbf{do}}$ }actions\\ set\_of\_events&::=&events\,|\,\emptyset\\ events&::=&atomic\_formula,events\,|\,atomic\_formula\\ conditions&::=&conditions\mbox{\tt{\hskip 4.2679pt\&\hskip 4.2679pt}}conditions\,|\,\mbox{\tt{not}}(conditions)\\ &\,|&\mathtt{sat}(set\_of\_constraints)\,|\,constr\_formula\\ &\,|&\mathtt{seteq}(set\_of\_constraints,set\_of\_constraints)\\ &\,|&constraint\in set\_of\_constraints\\ &\,|&{\tt time}(number)\,|\,\mathtt{true}\\ constr\_formula&::=&atomic\_formulae\\ &\,|&atomic\_formulae:set\_of\_constraints\\ \mathit{actions}&::=&action\mbox{\tt{,}}actions\,|\,action\\ action&::=&\mbox{\tt{add}}(constr\_formula)\,|\,\mbox{\tt{del}}(constr\_formula)\end{array}

Figure 2: Grammar for \mathcal{I}

Figure 2 shows the grammar for \mathcal{I}, i.e. the syntax of the five type of rules proposed: ECA-rules, if-rules, ignore-rules, prevent-rules and force-rules.

ECA rules specify the effect of a set of events, i.e. a set of atomic formulae, if the conditions hold. This effect is specified by means of a sequence of actions namely addition and removal of constrained formulae. A constrained formulae is an atomic formula that may be followed by a set of arithmetical constraints using the syntax presented in Def. 3. Furthermore, by conditionsconditions is meant one or more possibly negated conditions. Then, a condition may be a constrained formula, the 𝚜𝚊𝚝\mathtt{sat} predicate that checks that a set of constraints is satisfiable, the seteq predicate that checks if two sets are equal, the 𝚝𝚒𝚖𝚎{\tt time} predicate that checks current time or the true constant that always hold.

If-rules specify the logical consequence if the conditions hold by means of a sequence of actions. Ignore-rules specify the set of events that should be ignored if the conditions hold. Similarly, prevent-rules specify the conditions that should not hold if some conditions hold. Finally, force-rules specify a set of new events that are generated on the occurrence of a set of events and the satisfaction of a sequence of conditions. Furthermore, it also specifies a sequence of actions to perform if the rule is triggered.

An extra kind of rule, called expectation-rules, and shown in Fig. 3, that generate and remove expectations of events might be added. If the expectation fails to be fulfilled then some sanctioning or corrective actions are performed.

expectationexpectation-RuleRule ::=\displaystyle::= 𝐞𝐱𝐩𝐞𝐜𝐭𝐞𝐝 event 𝐨𝐧 set_of_events 𝐢𝐟 conditions\displaystyle\mbox{$\mathsf{\mathbf{expected}}$ }event\mbox{ $\mathsf{\mathbf{on}}$ }set\_of\_events\mbox{ $\mathsf{\mathbf{if}}$ }conditions
 𝐟𝐮𝐥𝐟𝐢𝐥𝐥𝐞𝐝-𝐢𝐟 conditions 𝐯𝐢𝐨𝐥𝐚𝐭𝐞𝐝-𝐢𝐟 conditions′′\displaystyle\!\!\mbox{ $\mathsf{\mathbf{fulfilled}}$-$\mathsf{\mathbf{if}}$ }conditions^{\prime}\mbox{ $\mathsf{\mathbf{violated}}$-$\mathsf{\mathbf{if}}$ }conditions^{\prime\prime}
 𝐬𝐚𝐧𝐜𝐭𝐢𝐨𝐧-𝐝𝐨 actions\displaystyle\!\!\mbox{ $\mathsf{\mathbf{sanction}}$-$\mathsf{\mathbf{do}}$ }actions
Figure 3: Expectation Rule

However, each expectation rule are equivalent to the following rules:

𝐨𝐧 set_of_events 𝐢𝐟 conditions 𝐝𝐨 add(exp(event))\displaystyle\mbox{$\mathsf{\mathbf{on}}$ }set\_of\_events\mbox{ $\mathsf{\mathbf{if}}$ }conditions\mbox{ $\mathsf{\mathbf{do}}$ }\mbox{\tt{add}}(exp(event)) (1)
𝐢𝐟 exp(event)conditions 𝐝𝐨 del(exp(event))\displaystyle\mbox{$\mathsf{\mathbf{if}}$ }exp(event)\wedge conditions^{\prime}\mbox{ $\mathsf{\mathbf{do}}$ }\mbox{\tt{del}}(exp(event)) (2)
𝐢𝐟 exp(event)conditions′′ 𝐝𝐨 del(exp(event)),actions\displaystyle\mbox{$\mathsf{\mathbf{if}}$ }exp(event)\wedge conditions^{\prime\prime}\mbox{ $\mathsf{\mathbf{do}}$ }\mbox{\tt{del}}(exp(event))\mbox{\tt{,}}actions (3)
Figure 4: Expectation rule semantics expressed with 3 rules

In Fig. 4, Rule 1 and 2 respectively adds and removes an expectation whenever the events have occurred and the conditions hold. Rule 3 cancels the unfulfilled expectation and sanctions an agent for the unfulfilled expectation by executing the given actionsactions whenever some conditionsconditions hold.

5 Semantics

Instead of basing the \mathcal{I} language on the standard deontic notions, two types of prohibitions and two types of obligations are included. In the language, ECA-rules determine what is possible to perform, i.e. they establish the effects (including sanctions) in the institution after performing certain (possibly concurrent) events. ECA-rules can be seen as conditional count-as rules: the given events count as the execution of the actions in the ECA-rule if the conditions hold and the event is not explicitly prohibited. As for the notion of permission, all the events are permitted if not explicitly prohibited. The notion of an event being prohibited may be expressed depending on whether that event has to be ignored or not. If not otherwise expressed, events are not ignored. Likewise, the notion of a state being prohibited may be specified depending on whether that state has to be prevented or not. By default, states are not prevented. Obligations are differentiated in two types: expectations, which an agent may not fulfill, and forced (or obligatory) events, which the system takes as institutional events even they are not actually performed by the agents.

Each set of ECA-rules generates a labelled transition system 𝒮,,\langle\mathcal{S},\mathcal{E},\mathcal{R}\rangle where 𝒮\mathcal{S} is a set of states, each state in 𝒮\mathcal{S} is a set of atomic formulae, \mathcal{E} is a set of events, and \mathcal{R} is a 𝒮×2×𝒮\mathcal{S}\times 2^{\mathcal{E}}\times\mathcal{S} relationship indicating that whenever a set of events occur in the former state, then there is a transition to the subsequent state.

Ignore-rules avoid executing any transition that contains in its labelling the events that appear in any ignore-rule. For instance, having a rule 𝐢𝐠𝐧𝐨𝐫𝐞 α1 𝐢𝐟 true\mbox{$\mathsf{\mathbf{ignore}}$ }\alpha_{1}\allowbreak\mbox{ $\mathsf{\mathbf{if}}$ }true would avoid executing the transitions labelled as {α1}\{\alpha_{1}\}, {α1,α2}\{\alpha_{1},\alpha_{2}\} and {α1,α2,α3}\{\alpha_{1},\alpha_{2},\alpha_{3}\}. However, having a rule 𝐢𝐠𝐧𝐨𝐫𝐞 α1,α2 𝐢𝐟 true\mbox{$\mathsf{\mathbf{ignore}}$ }\alpha_{1},\alpha_{2}\mbox{ $\mathsf{\mathbf{if}}$ }true would avoid executing {α1,α2}\{\alpha_{1},\alpha_{2}\} and {α1,α2,α3}\{\alpha_{1},\alpha_{2},\alpha_{3}\} but not {α1}\{\alpha_{1}\}.

Prevent-rules ignore all the actions in an ECA-rule if it brings the given formulae about. For example, suppose that we have

𝐩𝐫𝐞𝐯𝐞𝐧𝐭 q1 𝐢𝐟 true\mbox{$\mathsf{\mathbf{prevent}}$ }q_{1}\mbox{ $\mathsf{\mathbf{if}}$ }true

along with ECA-rules 4, 5 and 6 below. After the occurrence of events α1\alpha_{1} and α2\alpha_{2} and since q1q_{1} is an effect of event α2\alpha_{2}, all the actions in ECA-rule 5 would be ignored obtaining a new state where pp and rr hold but neither q1q_{1} nor q2q_{2}.

𝐨𝐧 α1 𝐢𝐟 true 𝐝𝐨 add(p)\displaystyle\mbox{$\mathsf{\mathbf{on}}$ }\alpha_{1}\mbox{ $\mathsf{\mathbf{if}}$ }true\mbox{ $\mathsf{\mathbf{do}}$ }\mbox{\tt{add}}(p) (4)
𝐨𝐧 α2 𝐢𝐟 true 𝐝𝐨 add(q1),add(q2)\displaystyle\mbox{$\mathsf{\mathbf{on}}$ }\alpha_{2}\mbox{ $\mathsf{\mathbf{if}}$ }true\mbox{ $\mathsf{\mathbf{do}}$ }\mbox{\tt{add}}(q_{1})\mbox{\tt{,}}\mbox{\tt{add}}(q_{2}) (5)
𝐨𝐧 α1,α2 𝐢𝐟 true 𝐝𝐨 add(r)\displaystyle\mbox{$\mathsf{\mathbf{on}}$ }\alpha_{1},\alpha_{2}\mbox{ $\mathsf{\mathbf{if}}$ }true\mbox{ $\mathsf{\mathbf{do}}$ }\mbox{\tt{add}}(r) (6)

Force-rules generate events during the execution of the transition system. However, the effects of such events are still specified by ECA-rules and subject to prevent and ignore-rules.

6 Operational Semantics

As shown in figure 1, the semantics of rules are presented as a relationship between states of affairs: rules map an existing state of affairs to a new state of affairs. This section defines this relationship. The definitions below rely on the concept of substitution, that is, the set of values for variables in a computation [10, 11]:

Definition 5

A substitution σ={x0/τ0,,xn/τn}\sigma=\{x_{0}/\tau_{0},\ldots,x_{n}/\tau_{n}\} is a finite and possibly empty set of pairs xi/τix_{i}/\tau_{i}, 0in0\leq i\leq n.

Definition 6

The application of a substitution to an atomic formulae α\alpha possibly restricted by a set of constraints {γ0,,γm}\{\gamma_{0},\ldots,\gamma_{m}\} is as follows:

  1. 1.

    cσ=cc\cdot\sigma=c for a constant cc;

  2. 2.

    xσ=τσx\cdot\sigma=\tau\cdot\sigma if x/τσx/\tau\in\sigma; otherwise xσ=xx\cdot\sigma=x;

  3. 3.

    pn(τ0,,τn)σ=pn(τ0σ,,τnσ)p^{n}(\tau_{0},\ldots,\tau_{n})\cdot\sigma=p^{n}(\tau_{0}\cdot\sigma,\ldots,\tau_{n}\cdot\sigma);

  4. 4.

    pn(τ0,,τn):{γ0,,γm}σ=pn(τ0σ,,τnσ):{γ0σ,,γmσ}p^{n}(\tau_{0},\ldots,\tau_{n}):\{\gamma_{0},\ldots,\gamma_{m}\}\cdot\sigma=p^{n}(\tau_{0}\cdot\sigma,\ldots,\tau_{n}\cdot\sigma):\{\gamma_{0}\cdot\sigma,\ldots,\gamma_{m}\cdot\sigma\}.

Definition 7

The application of a substitution to a sequence is the sequence of the application of the substitution to each element: α1,,αnσ=α1σ,,αnσ\langle\alpha_{1},\ldots,\alpha_{n}\rangle\cdot\sigma=\langle\alpha_{1}\cdot\sigma,\ldots,\alpha_{n}\cdot\sigma\rangle

The semantics of the conditions are now defined, that is, when a condition holds:

Definition 8

Relation 𝐬l(Δ,C,σ)\mathbf{s}_{l}(\Delta,C,\sigma) holds between state Δ\Delta, a condition CC in an 𝐢𝐟\mathsf{\mathbf{if}} clause and a substitution σ\sigma depending on the format of the condition:

  1. 1.

    𝐬l(Δ,C & C,σ)\mathbf{s}_{l}(\Delta,C\,\mbox{\tt{\hskip 4.2679pt\&\hskip 4.2679pt}}\,C^{\prime},\sigma) holds iff 𝐬l(Δ,C,σ)\mathbf{s}_{l}(\Delta,C,\sigma^{\prime}) and 𝐬l(Δ,Cσ,σ′′)\mathbf{s}_{l}(\Delta,\allowbreak C^{\prime}\cdot\sigma^{\prime},\sigma^{\prime\prime}) hold and σ=σσ′′\sigma=\sigma^{\prime}\cup\sigma^{\prime\prime}.

  2. 2.

    𝐬l(Δ,not(C),σ)\mathbf{s}_{l}(\Delta,\mbox{\tt{not}}(C),\sigma) holds iff 𝐬l(Δ,C,σ)\mathbf{s}_{l}(\Delta,C,\sigma) does not hold.

  3. 3.

    𝐬l(Δ,𝚜𝚎𝚝𝚎𝚚(L,L2),σ)\mathbf{s}_{l}(\Delta,{\tt seteq}(L,L2),\sigma) holds iff LL2L\subseteq L2, L2LL2\subseteq L and |L|=|L2||L|=|L2|.

  4. 4.

    𝐬l(Δ,𝚜𝚊𝚝(constraints),σ)\mathbf{s}_{l}(\Delta,\mathtt{sat}(constraints),\sigma) holds iff
    𝑠𝑎𝑡𝑖𝑠𝑓𝑖𝑎𝑏𝑙𝑒(constraintsσ)\mathit{satisfiable}(constraints\cdot\sigma) hold.

  5. 5.

    𝐬l(Δ,γΓ,σ)\mathbf{s}_{l}(\Delta,\gamma\in\Gamma,\sigma) holds iff (γσ)(Γσ)(\gamma\cdot\sigma)\in(\Gamma\cdot\sigma).

  6. 6.

    𝐬l(Δ,𝚝𝚒𝚖𝚎(T),σ)\mathbf{s}_{l}(\Delta,\mathtt{time}(T),\sigma) holds iff current time is TT.

  7. 7.

    𝐬l(Δ,𝚝𝚛𝚞𝚎,σ)\mathbf{s}_{l}(\Delta,{\tt true},\sigma) always holds.

  8. 8.

    𝐬l(Δ,constr_formula,σ)\mathbf{s}_{l}(\Delta,constr\_formula,\sigma) holds iff
    constr_formulaσΔconstr\_formula\cdot\sigma\in\Delta.

Case 1 depicts the semantics of atomic formulae and how their individual substitutions are combined to provide the semantics for a conjunction. Case 2 introduces negation by failure. Case 3 compares if two lists have the same elements possibly in different order. Case 4 checks if a set of constraints is satisfiable. Case 5 checks if a constraint belongs to a set of constraints. Case 6 checks if TT is current time. Case 7 gives semantics to the keyword true. Case 8 holds when an possibly constrained, atomic formulae constr_formulaconstr\_formula is part of the state of affairs.

The semantics of the actions of a rule are now defined:

Definition 9

Relation 𝐬r(Δ,A,Δ)\mathbf{s}_{r}(\Delta,A,\Delta^{\prime}) mapping a state Δ\Delta, the action section of a rule and a new state Δ\Delta^{\prime} is defined as:

  1. 1.

    𝐬r(Δ,(A,As),Δ)\mathbf{s}_{r}(\Delta,(A\mbox{\tt{,}}As),\Delta^{\prime}) holds iff both 𝐬r(Δ,A,Δ1)\mathbf{s}_{r}(\Delta,A,\allowbreak\Delta_{1}) and 𝐬r(Δ1,As,Δ)\mathbf{s}_{r}(\Delta_{1},\allowbreak As,\allowbreak\Delta^{\prime}) hold.

  2. 2.

    𝐬r(Δ,add(constr_formula),Δ)\mathbf{s}_{r}(\Delta,\mbox{\tt{add}}(constr\_formula),\Delta^{\prime}) holds iff

    1. (a)

      constr_formulaΔconstr\_formula\not\in\Delta and Δ=Δ{constr_formula}\Delta^{\prime}=\Delta\cup\{constr\_formula\} or;

    2. (b)

      Δ=Δ\Delta^{\prime}=\Delta.

  3. 3.

    𝐬r(Δ,del(constr_formula),Δ)\mathbf{s}_{r}(\Delta,\mbox{\tt{del}}(constr\_formula),\Delta^{\prime}) holds iff

    1. (a)

      constr_formulaΔconstr\_formula\in\Delta and Δ=Δ{constr_formula}\Delta^{\prime}=\Delta\setminus\{constr\_formula\} or;

    2. (b)

      Δ=Δ\Delta^{\prime}=\Delta.

Case 1 decomposes a conjunction and builds the new state by merging the partial states of each update. Case 2 and 3 cater respectively for the insertion and removal of atomic formulae α\alpha.

Relation checkprvcheck_{prv} checks if there is no prevent-rule that has been violated, i.e., it is not the case that all the conditions of any prevent-rule hold in the state of affairs Δ\Delta^{\prime}. It checks whether Δ\Delta^{\prime} contain all the conditions of each prevent-rule or not, if Δ\Delta also contain the given conditions.

Definition 10

Relation checkprv(Δ,Δ,PrvRules)check_{prv}(\Delta,\Delta^{\prime},PrvRules) mapping Δ\Delta, the state before applying updates, Δ\Delta^{\prime}, the state after applying updates, and a sequence PrvRulesPrvRules of prevent-rules, holds iff an empty set is the largest set of conditions CC such that:

p=𝐩𝐫𝐞𝐯𝐞𝐧𝐭 C 𝐢𝐟 C,pPrvRules,and𝐬l(Δ,C),𝐬l(Δ,C)hold\begin{array}[]{lll}p=\mbox{$\mathsf{\mathbf{prevent}}$ }C\mbox{ $\mathsf{\mathbf{if}}$ }C^{\prime},p\in PrvRules,\\ and\ \mathbf{s}_{l}(\Delta,C^{\prime}),\mathbf{s}_{l}(\Delta^{\prime},C)\ hold\end{array}
Definition 11

fire(Δ,PrvRules,𝐢𝐟 C 𝐝𝐨 A,Δ)fire(\Delta,\ PrvRules,\ \mbox{$\mathsf{\mathbf{if}}$ }C\mbox{ $\mathsf{\mathbf{do}}$ }A,\ \Delta^{\prime}), relation mapping a state Δ\Delta, a sequence PrvRulesPrvRules of prevent-rules, an if-rule and a new state Δ\Delta^{\prime} holds iff fired(C,A)fired(C,A) starts to hold, 𝐬r(Δ,A,Δ)\mathbf{s}_{r}(\Delta,A,\Delta^{\prime}) and
checkprv(Δ,Δ,PrvRules)check_{prv}(\Delta,\Delta^{\prime},PrvRules) hold.

Relation can_firecan\_fire checks whether the conditions of a given if-rule hold and the rule after applying substitution σ\sigma has not been already fired.

Definition 12

Relation can_fire(Δ,𝐢𝐟 C 𝐝𝐨 A,σ)can\_fire(\Delta,\ \mbox{$\mathsf{\mathbf{if}}$ }C\mbox{ $\mathsf{\mathbf{do}}$ }A,\ \sigma) mapping a state Δ\Delta an if-rule and a substitution σ\sigma holds iff 𝐬l(Δ,C,σ)\mathbf{s}_{l}(\Delta,C,\sigma) holds and fired(Cσ,Aσ)fired(C\cdot\sigma,A\cdot\sigma) does not hold.

Relation resolveresolve determines the rule that will be fired by selecting the first rule in the list.

Definition 13

resolve(RuleList,SelectedRuleList)resolve(RuleList,SelectedRuleList), relation mapping a list of if-rules and a selected if-rule list holds iff

  1. 1.

    RuleList=RuleList=\langle\rangle and SelectedRuleList=SelectedRuleList=\langle\rangle; or

  2. 2.

    RuleList=r1,,rnRuleList=\langle r_{1},\cdots,r_{n}\rangle and SelectedRuleList=r1SelectedRuleList=\langle r_{1}\rangle.

Relation select_ruleselect\_rule determines the rule that will be fired by selecting all the rules that can fire and resolving the conflict with relation resolveresolve.

Definition 14

Relation select_rule(Δ,IfRulesList,select\_rule(\Delta,IfRulesList,
SelectedRuleList)SelectedRuleList) mapping a state of affairs Δ\Delta, a list of if-rules and a selected if-rule list holds iff RsRs is the largest set of rules RRsR\in Rs, RsIfRulesListRs\subseteq IfRulesList such that can_fire(Δ,R,σ)can\_fire(\Delta,R,\sigma); resolve(Rs,SR)resolve(Rs,SR) hold and SelectedRuleList=SRσSelectedRuleList=SR\cdot\sigma.

Relation 𝐬if\mathbf{s}_{if} determines the new state of affairs after applying a set of if-rules to a initial state of affairs taking into account a set of prevent-rules.

Definition 15

𝐬if(Δ,IfRules,PrvRules,Δ)\mathbf{s}_{if}(\Delta,IfRules,PrvRules,\Delta^{\prime}), relation mapping a state of affairs Δ\Delta, a list of if-rules, a list of prevent-rules and a new state of affairs holds iff

  1. 1.

    select_rule(Δ,IfRules,R)select\_rule(\Delta,IfRules,R) hold, RR\neq\langle\rangle,
    fire(Δ,PrvRules,R,Δ′′)fire(\Delta,PrvRules,R,\Delta^{\prime\prime}) and
    𝐬if(Δ′′,IfRules,PrvRules,Δ)\mathbf{s}_{if}(\Delta^{\prime\prime},\allowbreak IfRules,PrvRules,\Delta^{\prime}) hold; or

  2. 2.

    select_rule(Δ,IfRules,R)select\_rule(\Delta,IfRules,R) hold, R=R=\langle\rangle; or

  3. 3.

    𝐬if(Δ,IfRules,PrvRules,Δ)\mathbf{s}_{if}(\Delta,IfRules,PrvRules,\Delta^{\prime}) hold.

Relation ignoredignored determines that a set of events which occurred have to be ignored taking into account a list of ignore-rules.

Definition 16

Relation ignored(Δ,Ξ,E,IgnRules)ignored(\Delta,\Xi,E,IgnRules) mapping a state of affairs Δ\Delta, a list Ξ\Xi of events that occurred, a list of events in a ECA-rule and a list of ignore-rules holds iff i=𝐢𝐠𝐧𝐨𝐫𝐞 E 𝐢𝐟 Ci=\mbox{$\mathsf{\mathbf{ignore}}$ }E^{\prime}\mbox{ $\mathsf{\mathbf{if}}$ }C, iIgnRulesi\in IgnRules, EΞE^{\prime}\subseteq\Xi, EEE\cap E^{\prime}\neq\emptyset and 𝐬l(Δ,C)\mathbf{s}_{l}(\Delta,C) holds.

Relation 𝐬r\mathbf{s}^{\prime}_{r} uses 𝐬r\mathbf{s}_{r} first and then 𝐬if\mathbf{s}_{if} in order to activate the forward chaining.

Definition 17

Relation 𝐬r(Δ,IfRules,PrvRules,\mathbf{s}^{\prime}_{r}(\Delta,IfRules,PrvRules,
ActionList,Δ)ActionList,\Delta^{\prime}) mapping a state of affairs Δ\Delta, a list of if-rules, a list of prevent-rules, a list of actions and a new state of affairs holds iff any of the conditions below hold:

  1. 1.

    ActionList=ActionList=\langle\rangle and Δ=Δ\Delta^{\prime}=\Delta; or

  2. 2.

    ActionList=a1,,anActionList=\langle a_{1},\cdots,a_{n}\rangle, 𝐬r(Δ,a1,Δ′′)\mathbf{s}_{r}(\Delta,a_{1},\Delta^{\prime\prime}),
    checkprv(Δ,Δ′′,PrvRules)check_{prv}(\Delta,\Delta^{\prime\prime},PrvRules),
    𝐬if(Δ′′,IfRules,PrvRules,Δ′′′)\mathbf{s}_{if}(\allowbreak\Delta^{\prime\prime},\allowbreak IfRules,PrvRules,\Delta^{\prime\prime\prime}) and
    𝐬r(Δ′′′,IfRules,PrvRules,a2,,an,Δ)\mathbf{s}^{\prime}_{r}(\Delta^{\prime\prime\prime},IfRules,PrvRules,\allowbreak\langle a_{2},\cdots\allowbreak,a_{n}\rangle,\Delta^{\prime})
    hold; or

  3. 3.

    𝐬r(Δ,IfRules,PrvRules,a2,,an,Δ)\mathbf{s}^{\prime}_{r}(\Delta,IfRules,PrvRules,\langle a_{2},\cdots,a_{n}\rangle,\Delta^{\prime}).

Relation 𝐬eca\mathbf{s}_{eca} calculates the new state of affairs Δ\Delta^{\prime} from an initial state Δ\Delta and a set Ξ\Xi of events that occurred applying a list of ECA-rules, if-rules, ignore-rules and prevent-rules.

Definition 18

Relation 𝐬eca(Δ,Ξ,ECARules,\mathbf{s}_{eca}(\Delta,\Xi,ECARules,
IfRules,IgnRules,PrvRules,Δ)IfRules,IgnRules,PrvRules,\allowbreak\Delta^{\prime}) mapping a state of affairs Δ\Delta, a list Ξ\Xi of events that occurred, a list of ECA-rules, a list of if-rules, a list of ignore-rules, a list of prevent-rules, and a new state of affairs holds iff:

  • AsAs is the largest set of actions A=AσA^{\prime}=A\cdot\sigma in an ECA-rule r=𝐨𝐧 E 𝐢𝐟 C 𝐝𝐨 Ar=\mbox{$\mathsf{\mathbf{on}}$ }E\mbox{ $\mathsf{\mathbf{if}}$ }C\allowbreak\mbox{ $\mathsf{\mathbf{do}}$ }A such that:

    • rECARulesr\in ECARules, EσΞE\cdot\sigma^{\prime}\subseteq\Xi, 𝐬l(Δ,C,σ′′)\mathbf{s}_{l}(\Delta,C,\sigma^{\prime\prime}) hold,

    • ignored(Δ,Ξ,E,IgnRules)ignored(\Delta,\Xi,E,IgnRules) does not hold and

    • σ=σσ′′\sigma=\sigma^{\prime}\cup\sigma^{\prime\prime}; and

  • 𝐬r(Δ,IfRules,PrvRules,As,Δ)\mathbf{s}^{\prime}_{r}(\Delta,IfRules,PrvRules,As,\Delta^{\prime}) hold.

Relation 𝐬force\mathbf{s}_{force} calculates the new state of affairs Δ\Delta^{\prime} and the new set Ξ\Xi^{\prime} of occurred events from an initial state Δ\Delta and a set Ξ\Xi of events that occurred applying a list of if-rules, ignore-rules, prevent-rules and force-rules.

Definition 19

Relation 𝐬force(Δ,Ξ,IfRules,\mathbf{s}_{force}(\Delta,\Xi,IfRules,
IgnRules,PrvRules,FrcRules,Ξ,Δ)IgnRules,PrvRules,\allowbreak FrcRules,\Xi^{\prime},\Delta^{\prime}) mapping a state of affairs Δ\Delta, a list Ξ\Xi of events that occurred, a list of if-rules, a list of ignore-rules, a list of prevent-rules, a list of force-rules, a new list of events that occured and a new state of affairs holds iff:

  • EAsEAs is the largest set of tuples FEσ,Aσ\langle FE\cdot\sigma,A\cdot\sigma\rangle of forced events and actions in a force rule fr=𝐟𝐨𝐫𝐜𝐞 FE 𝐨𝐧 E 𝐢𝐟 C 𝐝𝐨 Afr=\mbox{$\mathsf{\mathbf{force}}$ }FE\mbox{ $\mathsf{\mathbf{on}}$ }E\mbox{ $\mathsf{\mathbf{if}}$ }C\allowbreak\mbox{ $\mathsf{\mathbf{do}}$ }A such that

    • frFrcRulesfr\in FrcRules, EσΞE\cdot\sigma^{\prime}\subseteq\Xi, 𝐬l(Δ,C,σ′′)\mathbf{s}_{l}(\Delta,C,\sigma^{\prime\prime}) holds,

    • ignored(Δ,Ξ,E,IgnRules)ignored(\Delta,\Xi,E,\allowbreak IgnRules) does not hold and

    • σ=σσ′′\sigma=\sigma^{\prime}\cup\sigma^{\prime\prime};

  • EsEs is the largest set of forced events EvEv such that Ev,AEAs\langle Ev,A\rangle\in EAs;

  • Ξ=ΞEs\Xi^{\prime}=\Xi\cup Es;

  • AsAs is the largest set of actions AA such that Ev,AEAs\langle Ev,A\rangle\in EAs; and

  • 𝐬r(Δ,IfRules,PrvRules,As,Δ)\mathbf{s}^{\prime}_{r}(\Delta,IfRules,PrvRules,As,\Delta^{\prime}) holds.

Relation 𝐬\mathbf{s}^{*} calculates the new state of affairs Δ\Delta^{\prime} from an initial state Δ\Delta and a set Ξ\Xi of events that occurred applying a list of ECA-rules, if-rules, ignore-rules, prevent-rules and force-rules.

Definition 20

Relation

𝐬(Δ,Ξ,ECARls,IfRls,IgnRls,PrvRls,FrcRls,Δ)\mathbf{s}^{*}(\Delta,\Xi,ECARls,IfRls,IgnRls,PrvRls,FrcRls,\Delta^{\prime})

mapping a state of affairs Δ\Delta, a list Ξ\Xi of events that occurred, a list of ECA-rules, a list of if-rules, a list of ignore-rules, a list of prevent-rules, a list of force-rules and a new state of affairs holds iff:

  • CsCs is the largest set of conditions CC such that fired(C,A)fired(C,A) stop holding;

  • fired(false,false)fired(false,false) starts to hold,

  • 𝐬if(Δ,IfRls,PrvRls,Δ′′)\mathbf{s}_{if}(\Delta,IfRls,PrvRls,\Delta^{\prime\prime}),

  • 𝐬force(Δ′′,Ξ,IfRls,IgnRls,PrvRls,FrcRls,Ξ,Δ′′′)\mathbf{s}_{force}(\Delta^{\prime\prime},\Xi,IfRls,IgnRls,PrvRls,FrcRls,\Xi^{\prime},\\ \Delta^{\prime\prime\prime}) and

  • 𝐬eca(Δ′′′,Ξ,ECARls,IfRls,IgnRls,PrvRls,Δ)\mathbf{s}_{eca}(\Delta^{\prime\prime\prime},\Xi^{\prime},ECARls,\allowbreak IfRls,IgnRls,PrvRls,\Delta^{\prime})
    hold.

7 Modelling Neural Networks with rules

In this section we introduce how to use \mathcal{I} rule-language for modelling Artificial Neural Networks. We start with the more simpler unit of processing in Artificial Neural Networks, i.e. Perceptrons.

We will rely on two special type of events, inputs specified as i(xi,lj)i(x_{i},l_{j}), with the intuitive meaning that an agent provided xix_{i} as the input for layer ljl_{j}; and outputs specified as o(xi,lj)o(x_{i},l_{j}) with the intuitive meaning that xix_{i} is an output for ljl_{j}.

7.1 Modelling Multi-layer Perceptrons as rules

We begin this section presenting an example on how to use the \mathcal{I} language in order to specify a Perceptron:

𝐨𝐧 i(X1,1),i(Xn,1) 𝐢𝐟 prolog(calculate(X1,,Xn,Y)) 𝐝𝐨 add(o(Y,1))\begin{array}[]{lll}&\mbox{$\mathsf{\mathbf{on}}$ }&i(X_{1},1),\cdots\,i(X_{n},1)\\ &\mbox{ $\mathsf{\mathbf{if}}$ }&\mbox{\tt{prolog}}(calculate(X_{1},\cdots,X_{n},Y))\\ &\mbox{ $\mathsf{\mathbf{do}}$ }&\mbox{\tt{add}}(o(Y,1))\end{array} (7)

Figure 5: Example of one layer

In Fig. 5, Rule 7 translates a set of nn inputs, provided by Agents, to one output by means of a calculation implemented in prolog by a calculatecalculate predicate.

For specifying multiple layers of Perceptrons, we envisage several rules (Perceptrons) forward chaining in several activations:

𝐨𝐧 i(X1,1),i(Xn,1) 𝐢𝐟 prolog(calculate(X1,,Xn,Y1)) 𝐝𝐨 add(o(Y1,1))\displaystyle\begin{array}[]{lll}&\mbox{$\mathsf{\mathbf{on}}$ }&i(X_{1},1),\cdots\,i(X_{n},1)\\ &\mbox{ $\mathsf{\mathbf{if}}$ }&\mbox{\tt{prolog}}(calculate(X_{1},\cdots,X_{n},Y_{1}))\\ &\mbox{ $\mathsf{\mathbf{do}}$ }&\mbox{\tt{add}}(o(Y_{1},1))\end{array} (11)
\displaystyle\cdots (12)
𝐨𝐧 i(Xj,1),i(Xk,1) 𝐢𝐟 prolog(calculate(Xj,,Xk,Yi)) 𝐝𝐨 add(o(Yi,1))\displaystyle\begin{array}[]{lll}&\mbox{$\mathsf{\mathbf{on}}$ }&i(X_{j},1),\cdots\,i(X_{k},1)\\ &\mbox{ $\mathsf{\mathbf{if}}$ }&\mbox{\tt{prolog}}(calculate(X_{j},\cdots,X_{k},Y_{i}))\\ &\mbox{ $\mathsf{\mathbf{do}}$ }&\mbox{\tt{add}}(o(Y_{i},1))\end{array} (16)
𝐢𝐟 o(X1,1) &  & o(Xi,1) & prolog(calculate(X1,,Xi,Yi+1)) 𝐝𝐨 add(o(Yi+1,2))\displaystyle\begin{array}[]{lll}&\mbox{$\mathsf{\mathbf{if}}$ }&o(X_{1},1)\mbox{\tt{\hskip 4.2679pt\&\hskip 4.2679pt}}\cdots\mbox{\tt{\hskip 4.2679pt\&\hskip 4.2679pt}}o(X_{i},1)\\ &\mbox{\tt{\hskip 4.2679pt\&\hskip 4.2679pt}}&\mbox{\tt{prolog}}(calculate(X_{1},\cdots,X_{i},Y_{i+1}))\\ &\mbox{ $\mathsf{\mathbf{do}}$ }&\mbox{\tt{add}}(o(Y_{i+1},2))\end{array} (20)
Figure 6: Example of second layer

For space restrictions, we model a basic two-layer Multi-layer Perceptron (MLP) where ii Perceptrons are defined by rules from 1116 in Fig. 6. The last rule gathers the outputs from the previous layer and calculates the final output (of layer 2).

This basic example illustrates expressiveness of \mathcal{I} modelling Artificial Neural Networks. For further uses and examples on regulation with \mathcal{I}, we refer the reader to [3]

8 \mathcal{I^{*}}: Online rule-management extension

Continuing the work from [3], an extension that easily could pop up, when analysing the language and the problems one might want to solve, is the online rule-management, i.e. the possibility of adding and removing rules on runtime. Thus, agents by means of events, and if they are accepted as valid actions, could trigger the institutional rule actions declared previously.

As for the implementation of the extension, rules are defined as dynamicdynamic Prolog clauses, as with the 𝚏𝚒𝚛𝚎𝚍/𝟷\tt fired/1 clause declared as 𝚍𝚢𝚗𝚊𝚖𝚒𝚌\tt dynamic after the initial comments of the code in the Appendix.

We now redefine the actions of adding and deleting open units, i.e. constrained formulae or rules:

Definition 21

Relation 𝐬r(Δ,A,Δ)\mathbf{s}_{r}(\Delta,A,\Delta^{\prime}) mapping a state Δ\Delta, the action section of a rule and a new state Δ\Delta^{\prime} is defined as:

  1. 1.

    𝐬r(Δ,(A,As),Δ)\mathbf{s}_{r}(\Delta,(A\mbox{\tt{,}}As),\Delta^{\prime}) holds iff both 𝐬r(Δ,A,Δ1)\mathbf{s}_{r}(\Delta,A,\allowbreak\Delta_{1}) and 𝐬r(Δ1,As,Δ)\mathbf{s}_{r}(\Delta_{1},\allowbreak As,\allowbreak\Delta^{\prime}) hold.

  2. 2.

    𝐬r(Δ,add(constr_formula),Δ)\mathbf{s}_{r}(\Delta,\mbox{\tt{add}}(constr\_formula),\Delta^{\prime}) holds iff

    1. (a)

      constr_formulaΔconstr\_formula\not\in\Delta and Δ=Δ{constr_formula}\Delta^{\prime}=\Delta\cup\{constr\_formula\} or;

    2. (b)

      Δ=Δ\Delta^{\prime}=\Delta.

  3. 3.

    𝐬r(Δ,add(rule),Δ)\mathbf{s}_{r}(\Delta,\mbox{\tt{add}}(rule),\Delta^{\prime}) holds iff

    1. (a)

      rulerule does not hold and 𝚊𝚜𝚜𝚎𝚛𝚝(rule){\tt assert}(rule)

    2. (b)

      Δ=Δ\Delta^{\prime}=\Delta.

  4. 4.

    𝐬r(Δ,del(constr_formula),Δ)\mathbf{s}_{r}(\Delta,\mbox{\tt{del}}(constr\_formula),\Delta^{\prime}) holds iff

    1. (a)

      constr_formulaΔconstr\_formula\in\Delta and Δ=Δ{constr_formula}\Delta^{\prime}=\Delta\setminus\{constr\_formula\} or;

    2. (b)

      Δ=Δ\Delta^{\prime}=\Delta.

  5. 5.

    𝐬r(Δ,del(rule),Δ)\mathbf{s}_{r}(\Delta,\mbox{\tt{del}}(rule),\Delta^{\prime}) holds iff

    1. (a)

      rulerule holds and 𝚛𝚎𝚝𝚛𝚊𝚌𝚝(rule){\tt retract}(rule)

    2. (b)

      Δ=Δ\Delta^{\prime}=\Delta.

Case 1 decomposes a conjunction and builds the new state by merging the partial states of each update. Case 2 and 4 cater respectively for the insertion and removal of atomic formulae α\alpha. Finally, Case 3 and 5 formalises respectively the insertion and removal of rule rulerule, following Sictus Prolog capability to add and remove Horn clauses in runtime.

Rules::=𝐫𝐮𝐥𝐞 (constr_formula,[ECA-Rule|if-Rule|ignore-Rule|prevent-Rule|force-Rule])+ECA-Rule::=𝐨𝐧 set_of_events 𝐢𝐟 conditions 𝐝𝐨 actionsif-Rule::=𝐢𝐟 conditions 𝐝𝐨 actionsignore-Rule::=𝐢𝐠𝐧𝐨𝐫𝐞 set_of_events 𝐢𝐟 conditionsprevent-Rule::=𝐩𝐫𝐞𝐯𝐞𝐧𝐭 conditions 𝐢𝐟 conditionsforce-Rule::=𝐟𝐨𝐫𝐜𝐞 set_of_events 𝐨𝐧 set_of_events𝐢𝐟 conditions 𝐝𝐨 actionsset_of_events::=events|events::=atomic_formula,events|atomic_formulaconditions::=conditions & conditions|not(conditions)|𝚜𝚊𝚝(set_of_constraints)|constr_formula|𝚜𝚎𝚝𝚎𝚚(set_of_constraints,set_of_constraints)|constraintset_of_constraints|𝚝𝚒𝚖𝚎(number)|𝚝𝚛𝚞𝚎constr_formula::=atomic_formulae|atomic_formulae:set_of_constraints𝑎𝑐𝑡𝑖𝑜𝑛𝑠::=action,actions|actionopen_unit::=Rulesaction::=add(open_unit)|del(open_unit)\begin{array}[]{rcl}\mbox{$Rules$}&::=&\mbox{$\mathsf{\mathbf{rule}}$ }^{\prime}(^{\prime}constr\_formula,[\mbox{$ECA$-$Rule$}\allowbreak\,|\,\mbox{$if$-$Rule$}\allowbreak\,|\allowbreak\\ &&\mbox{$ignore$-$Rule$}\allowbreak\,|\,\allowbreak\mbox{$prevent$-$Rule$}\allowbreak\,|\,\allowbreak\mbox{$force$-$Rule$}]^{\prime})^{\prime+}\\ \mbox{$ECA$-$Rule$}&::=&\mbox{$\mathsf{\mathbf{on}}$ }set\_of\_events\mbox{ $\mathsf{\mathbf{if}}$ }conditions\mbox{ $\mathsf{\mathbf{do}}$ }actions\\ \mbox{$if$-$Rule$}&::=&\mbox{$\mathsf{\mathbf{if}}$ }conditions\mbox{ $\mathsf{\mathbf{do}}$ }actions\\ \mbox{$ignore$-$Rule$}&::=&\mbox{$\mathsf{\mathbf{ignore}}$ }set\_of\_events\mbox{ $\mathsf{\mathbf{if}}$ }conditions\\ \mbox{$prevent$-$Rule$}&::=&\mbox{$\mathsf{\mathbf{prevent}}$ }conditions\mbox{ $\mathsf{\mathbf{if}}$ }conditions\\ \mbox{$force$-$Rule$}&::=&\mbox{$\mathsf{\mathbf{force}}$ }set\_of\_events\mbox{ $\mathsf{\mathbf{on}}$ }set\_of\_events\\ &&\mbox{$\mathsf{\mathbf{if}}$ }conditions\mbox{ $\mathsf{\mathbf{do}}$ }actions\\ set\_of\_events&::=&events\,|\,\emptyset\\ events&::=&atomic\_formula,events\,|\,atomic\_formula\\ conditions&::=&conditions\mbox{\tt{\hskip 4.2679pt\&\hskip 4.2679pt}}conditions\,|\,\mbox{\tt{not}}(conditions)\\ &\,|&\mathtt{sat}(set\_of\_constraints)\,|\,constr\_formula\\ &\,|&\mathtt{seteq}(set\_of\_constraints,set\_of\_constraints)\\ &\,|&constraint\in set\_of\_constraints\\ &\,|&{\tt time}(number)\,|\,\mathtt{true}\\ constr\_formula&::=&atomic\_formulae\\ &\,|&atomic\_formulae:set\_of\_constraints\\ \mathit{actions}&::=&action\mbox{\tt{,}}actions\,|\,action\\ open\_unit&::=&\mbox{Rules}\\ action&::=&\mbox{\tt{add}}(open\_unit)\,|\,\mbox{\tt{del}}(open\_unit)\end{array}

Figure 7: Grammar for \mathcal{I}^{*}:Adding and Removing Rules

9 Conclusions

This paper poses the open question of how to regulate the computations of Artificial Neural Networks and Deep Learning and tries to open a research path towards Artificial Teaching by means of Agent-based Training for Deep Learning (ABT4DL). This proposal of Collaborative Learning use of Regulated Multi-agent Systems (MAS) for this purpose. I presented my advances along these lines, i.e. a normative language for Regulated MAS that is used to gather a set of concurrent inputs provided by the proposed Training Agents.

The \mathcal{I} language is useful to predict a future state of affairs with an initial state and a sequence of sets of events, that occur and modify the intermediate states of affairs, until the final one is reached. The limitations of the language are determined by the rule engine. These limitations include the inability to plan, i.e. determine the sequence of sets of events that must occur in order to reach a given state of affairs from a given initial state, or post-dicting, i.e. determine the previously unknown facts in a partial initial state given a final state and the sequence of sets of events that may have occurred previously. However, the goal of the language is to regulate a MAS and keep track of its evolution by prediction. Post-diction and planning would be interesting for a language that an agent could use for deciding which action to perform but this is not the aim of this paper.

In this article, how agent behaviour can be regulated with the language proposed is shown, and it is shown that \mathcal{I} has a simple and fixed semantics that avoids normative conflicts. However different options of execution are given by adding extra ignore-rules specifying what normative positions prevail over others, in order to avoid any normative conflict when using deontic notions [3].

The main contribution of \mathcal{I} summarised from [3] is the management of sets of events that occur simultaneously and its implementation of norms not following the standard deontic notions, i.e., permissions, prohibitions, and obligations. One example of application would be when a software agent wins a given good in an auction [12]. Two options are envisaged for the payment in that scenario: 1) expect the agent to generate the event of the payment and sanction the agent if the event is not generated before a given deadline; or 2) if the Electronic Institution has control on the agent’s balance, automatically generate an event of payment as if the agent would have generated it. In fact, an obligation (to perform an event) that may be violated is represented as the expectation of the attempts to perform it. However, the enforcement of an obligation (to perform a set of events) that may not be violated is carried out by the middleware by taking these events as having been performed even they have not, denoting them as forced events.

10 Future Work

10.1 Improving Computational Regulations

As mentioned previously, the language has been tested in the Electronic Institutions (EIs) Middleware presented in [6] that runs over JADE [13]. Nonetheless, the author expects to add the language to a newly developed Middleware, as it is capable of give Operational Semantics, i.e run, a Declarative version of EI protocols as it was shown in [3]. The main advantage of a Declarative version is that it might be provided to Software Agents to reason about it using, e.g, a BDI architecture as the one introduced in [14].

10.2 Full-Hybrid Artificial Intelligence

However, using \mathcal{I} as an Programmable Event-based Middle-ware opens new paths of research as it uses Hybrid AI (ı.e. mixes Autonomous Agents and Multi-agents Systems, Machine Learning, and Symbolic Programming). Furthermore, one of the main applications of Hybrid AI is in its own a whole new AI subfield, namely, Artificial Teaching.

10.3 Artificial Teaching

The whole concept of Artificial Teaching is recent, and not properly defined yet. There are some mentions in the literature that I will not cite in order to engage the reader to improve the previous lines and the proposed concepts luckily exposing her results on subsequent articles.

In my humble opinion, in the research path towards General AI there are several Problem-specific milestones to reach in every sub-field of AI; and mimicking Human Intelligence and Evolution, it may seem a natural step forward to add the teaching capability to artificial learners to decrease complexity.

Please imagine a researcher (agent) being in a continuous ”Deep… and deep… and deep… and very deep… Learning” process since the beginning of its existence. To the best of my knowledge, there are very few (human) researchers (honestly, almost none) that self-learned everything on his own, with no interaction with others who may have taught him something, even involuntarily, and this happens almost every day as a Spanish proverb well says.

10.4 Goal Alignment

The research question that this section tries to pose is “How to Cooperate towards Agreements in a flawed Coordination Mechanism?”. A temptative proposal that might try to answer this question would be by proposing a Left-wing and Right-wing parties Cooperation in a Pure Center-wing Goverment. From a Game theoretic point of view is a Prisoner’s Dilemma on Policy-making. Current Democracy is Opinion-based, not arriving to Pure Center Agreements. The problem with current Institutions is that are very polarised in the whole spectra of Opinions and Preferences. Thus, basing Democracy in Facts on Outcomes of Policy-making actions and Learning from the past we should obtain a better Democracy where Equity and Inclusion leads the way towards maximising Social Welfare.

The Fact is there are two Nash Equilibria in the Policy-making Scenario, Left-wing and Right-wing. Then, what is a better option? Drive on the Left or drive on the Right? Thus, in one lane rural paths with no traffic signs, and where two driving directions may occur, who has traffic precedence? Current Democracy is an Opinion Fight without Cooperation. In some cases, the driving problem is easily solved by Precedence Emergence or a Car Crash may occur. Are we all willing to a Society Crash like past Economic Crashes but in a greater extent? Thus, we need to align Goals to drive in the same direction in spite of Heterogeneous Preferences of Self-interested Agents.

10.4.1 Normative Agreements

Our proposal is a progression for Utilitarianism[15] towards Social Utilitarianism as a Social Function Fact-based (Rules on acts)-Utilitarianism; and that, Equitable Institutions are (Social and Inclusive) Agreements, in Nash Equilibrium, on Rules of Act. Absolute Majority discriminates between winners and losers of elections, Less-Discriminatory Majority shoud be the future Goal. Current Democracy is Opinion-based, (Rules on acts)-Utilitarism should be based on Facts, i.e. Fact-Utilitarianism, Rule-Utilitarianism, Act-Utilitarianism and Preference-Utilitarianism and their inter-relationships to have a better understanding of Social Contract Theory, e.g. in which cases an institution is better than other and why; or what is a Helpful Vote. Arrow’s Impossibility Theorem assumes no kind of Utility is used, so the fore-mentioned approach would avoid it, especially for Social Choice Theory. So there a need for Social Utilitarianism, i.e. Social Choice and Social Mechanism Design Theory in tandem that would avoid the limitations of Game Theory, thus starting the new field of Social Game Theory based on (Rules on acts)-Utilitarianism, i.e. a new (Social Contract and Institutions) Theory.

10.5 Collaborative Knowledge Evolution

With this, I want to emphasize the role of (Human and Artificial; Physical and Software) Teachers in Collaborative Learning and (Collaborative) Research, and thus in Collaborative Knowledge Evolution. Luckily, in a future we would be a step closer to General AI, by means of Collaborative Optimisation, achieving thus a full integration and consensus of researchers (and their contributions, either Physical or Software), even they are not collaborating on purpose. And all these thanks to Regulated Middle-wares and Artificial Mediators.

References

  • [1] A. García-Camino, P. Noriega and J.-A. Rodríguez-Aguilar, Implementing Norms in Electronic Institutions, in: Proceedings of 4th International Joint Conference on Autonomous Agents and Multiagent Systems (AAMAS’05), Utrecht, The Nederlands, 2005, pp. 667–673. http://www.iiia.csic.es/~andres/p346-garcia-camino.pdf.
  • [2] A. García-Camino, Ignoring, Forcing and Expecting Concurrent Events in Electronic Institutions, in: COIN III: Coordination, Organization, Institutions and Norms in Agent Systems. Revised Selected Papers from the 2007 Workshop Series, Lecture Notes in Computer Science, Vol. 4870, Springer, 2007, pp. 15–26. pubs/COIN@AAMAS07.pdf.
  • [3] A. García-Camino, Normative regulation of open multi-agent systems, Monografías del IIIA Vol. 35, Consejo Superior de Investigaciones Científicas, 2010.
  • [4] P. Noriega, Agent-Mediated Auctions: The Fishmarket Metaphor, PhD thesis, Universitat Autonoma de Barcelona, 1997, Number 8 in IIIA Monograph Series..
  • [5] J.A. Rodríguez-Aguilar, On the Design and Construction of Agent-mediated Electronic Institutions, PhD thesis, Universitat Autonoma de Barcelona, 2001, Number 14 in IIIA Monograph Series.
  • [6] M. Esteva, Electronic Institutions: from specification to development, PhD thesis, Universitat Politecnica de Catalunya, 2003, Number 19 in IIIA Monograph Series.
  • [7] Y. Lecun, Y. Bengio and G. Hinton, Deep learning, 2015. ISSN 14764687. doi:10.1038/nature14539.
  • [8] V. Dignum, Ethics in artificial intelligence: introduction to the special issue, 2018. ISSN 15728439. doi:10.1007/s10676-018-9450-z.
  • [9] V. Vianu, Rule-Based Languages, Annals of Mathematics and Artificial Intelligence 19(1–2) (1997), 215–259.
  • [10] K.R. Apt, From Logic Programming to Prolog, Prentice-Hall, U.K., 1997.
  • [11] M. Fitting, First-Order Logic and Automated Theorem Proving, Springer-Verlag, New York, U.S.A., 1990.
  • [12] G. Cuní, M. Esteva, P. Garcia, E. Puertas, C. Sierra and T. Solchaga, MASFIT: Multi-Agent System for Fish Trading, in: Procs. of the 16th European Conference on Artificial Intelligence (ECAI 2004), Valencia, Spain, 2004, pp. 710–714.
  • [13] F. Bellifemine, A. Poggi and G. Rimassa, JADE - A FIPA-compliant agent framework, Technical Report, Telecom Italia., 1999, Part of this report has been also published in Proceedings of PAAM’99, London, April 1999, pp.97-108..
  • [14] A. Casali, L. Godo and C. Sierra, Graded BDI Models For Agent Architectures., in: CLIMA V, Lecture Notes in Artificial Intelligence LNAI, Vol. 3487, 2005, pp. 126–143.
  • [15] E.N. Zalta (ed.), The Stanford Encyclopedia of Philosophy, The Metaphysics Research Lab. Philosophy Department, Stanford University.Stanford, CA 94305-4115. ISSN 1095-5054. https://plato.stanford.edu/.