# Architecting an Agent-Based Fault Diagnosis Engine for IEC 61499 Industrial Cyber-Physical Systems
## 3 Architecting the Engine
### Managing Agent Beliefs  
The Process View also details the beliefs an agent forms. These are stored in an in-memory structure that provides a model of the domain the agents operate in [4]. An _atomic belief_ is an opinion about one characteristic of the ICPS or its environment, formed from evidence that the agent holds at a given time. The ability to revise a belief is one of their key skills that allows them to maintain an up-to-date model when situations change or when the weight of evidence alters the agents' perceptions. [PERSON] defines a First-Order Intentional system as one that has beliefs and desires, but no beliefs and desires about its beliefs and desires [82]. This corresponds to the initial BDI concept proposed by [PERSON] [83]. [PERSON] then defines a Second-Order Intentional system as one that has formed beliefs, desires and intentional states about the beliefs and desires of other systems as well as its own. The beliefs formed by each agent in the engine are First-Order. Definition 4 is the primary definition of a belief that all the subsequent beliefs used by the agents are built upon:  
**Definition 4** (Beliefs). : _Every agent ag contains a set of beliefs \(B=\{b_{1},\ldots,b_{n}\}\) such that each belief \(b\in B\) is a tuple \(\langle\triangle,v\rangle\) where:_  
* \(\triangle\) _is a skill that the agent can use and_
* \(v\) _is the veracity of the belief held by the agent about the skill. This may be true, false, or undetermined._  
The veracity \(v\) is defined as the degree to which a concept or unit of information conforms to the truth or known facts [84]. The quantities assigned to \(v\) can range from true, false, or undetermined, supported by numeric values or percentages that indicate how much a behavior is deviating from expected norms. A fault diagnosis is understood to be a summary and evaluation of the set of beliefs held by an agent. When the application is performing nominally, this diagnosis could be a No Fault Found (NFF) belief on the part of the agent. Within the engine, agents can maintain three types of beliefs: _interaction_ beliefs, _system-under-diagnosis (SUD)_ beliefs and _dynamic diagnostics_ beliefs. Interaction beliefs capture an agent's knowledge about an ability they possess to interact with either other agents or the FB application to perform goals. **Definition 5** (Interaction belief). : _A belief \(b=\langle\triangle,v\rangle\) is an interaction belief when \(\triangle\) describes a pair \((ag,\mathcal{S})\), where \(ag\) represents an agent and the \(\mathcal{S}\) is the signature of a method that can be used by that agent to interact with the function block application and other agents._  
An example of a skill is the ability of an agent to communicate with the DPs, open and close control gates, and trigger inputs on an FB of interest. This belief structure models IEC 61499-specific domain knowledge needed to interact with the FB application being diagnosed. Figure 9 shows a set of DPs that an agent has wired between Z_TEMPERATURE and the F_TO_C_CONV. When the agent performs a \(rewire()\) interaction, the DP1 and DP2 FB instances are inserted into the event and data paths. Later, the \(gateClose()\) command isolates this incoming information path from Z_TEMPERATURE so that a \(trigger()\) command can inject test values. These are captured further down the path by DP2 using the \(read()\) command. Note that, if a DP is capturing the input side of a FB, the \(gateClose()\) function must close only the inbound side. Conversely, when the DP is capturing an output, only the outbound data and events should be blocked from being sent onto the next connected FB. While other belief sets are dynamic, the capabilities captured in this first set are static, intrinsic skills since they are core domain-specific abilities of the agent. Hence, the veracity of interaction beliefs is always true unless for some reason the agent is blocked from welding that ability.