# A Neural-Symbolic Approach to Extract Trust Patterns in IoT Scenarios
## 4 A T-Pattern Model Overview
For example, if the directed link between trust issues \(\delta_{1}\) and \(\delta_{2}\) has an associated weight \(w=0.65\), this indicates that the confidence in \(\delta_{2}\) is 65% of the confidence assigned to \(\delta_{1}\). We also define a _global_ T-pattern as a tuple \(\tau=\langle N_{\Delta},o_{1},o_{1},\Lambda\rangle\), representing a single smart IoT object evaluated by the entire group \(\Lambda\), where \(\Lambda\subseteq O\). The weight \(w\), in this case, reflects the collective perception of the relationship between trust issues \(\delta_{1}\) and \(\delta_{2}\) regarding smart object \(o\), and it is computed similarly to Equation (2): \(\phi_{o,o,\Lambda}(\delta_{1})=w\cdot\phi_{o,o,\Lambda}(\delta_{2})\). To manage a P2P T-pattern for a generic link \(l=\langle\delta_{1},\delta_{2},\Lambda,w\rangle\) within the network \(N_{\Delta}\), we apply the following three rules:  
* **Derivation rule (DR)**. It computes \(\phi_{o_{1},o_{2},\Lambda}(\delta_{1})\) as \(w\cdot\phi_{o_{1},o_{2},\Lambda}(\delta_{2})\). It is denoted as follows: \[\delta_{1}\overset{w}{\rightarrow}\delta_{2}\] (3)
* \(v\)**-Assignment rule (VR)**. It assigns a value \(v\in[1,5]\cup\{null\}\) to the confidence \(\gamma_{\delta_{1},\delta_{2},\Lambda}(o)\). It is denoted as follows: \[v\to o\] (4)  
Figure 1: An example of a simple TPN with two smart IoT objects (i.e., \(o_{1}\) and \(o_{2}\)) considering expertise (X), honesty (H), reliability (R), and security (S) trust issues. * \(w\)**-Assignment (ZR)**. It joins a value \(c\in[0,1]\) to the value \(w\) of a link \(l\). It is denoted as follows: \[c\to w\] (5) These three rules can be automatically applied to both P2P and global T-pattern:
* When, due to Equation (3) or other updates, the confidence \(\phi_{o_{1},o_{2},\Lambda}(\delta)\) (or, respectively, \(\phi_{o,\rho,\Lambda}(\delta)\)) for a trust issue \(\delta\) is updated, then Equation (2) is applied to each link originating from \(\delta\) represented in \(N_{\Delta}\) and is propagated to the other nodes linked to the updated nodes, excluding \(\delta\). * For each link \(l=\langle\delta,\delta^{*},\Lambda,w\rangle\) directed towards \(\delta^{*}\), Equation (5) is automatically applied, updating \(w\) to \(c\), which is calculated as the ratio \(\frac{\phi_{o_{1},o_{2},\Lambda}(\delta)}{\phi_{o_{1},o_{2},\Lambda}(\delta^{*})}\). * Each time the weight \(w\) of a link \(l\) is updated by Equation (5), then Equation (2) is automatically applied to the link's destination node and is propagated to other nodes linked to the updated nodes, excluding the origin node of link \(l\). This procedure can be synthetically described by the pseudo-code shown in Algorithm 1. ```
for all trust issue \(\delta\)do if\(\phi_{o_{1},o_{2},\Lambda}(\delta)\) OR \(\phi_{o,\Lambda}(\delta)\) is updated then for all link \(l\) originating from \(\delta\in N_{\Delta}\)do  Apply and propagate Equation (2) endfor for all link \(l=\langle\delta,\delta^{*},\Lambda,w\rangle\) directed towards \(\delta^{*}\)do  Apply Equation (5) automatically endfor for all link \(l\)do  if weight \(w\) of \(l\) is updated by Equation (5) then  Apply and propagate Equation (2) automatically endif endfor endfor
```  
**Algorithm 1** Trust propagation algorithm  
In such a way, the T-pattern model can be applied to a large variety of scenarios, from more simple to more complex or adversarial ones (e.g., untrustworthy devices or sudden changes in behavior). Finally, we define a _T-Pattern Network_ (TPN) as a tuple \(\langle O,G,\Phi,\Lambda,T\rangle\), where \(O\) is the set of smart IoT objects, \(G\) represents groups (i.e., \(G=\langle\Lambda_{1},\Lambda_{2},\ldots,\Lambda_{n}\rangle\)), \(\Phi\) maps each confidence \(\phi_{o_{1},o_{2},\Lambda}\) to a value in \([1,5]\cup null\), \(\Lambda\) is the set of trust issues, and \(T\) is the set of T-pattern on \(\Delta\), ensuring that no two T-patterns in \(T\) are associated with the same triplet \((o_{1},o_{2},\Lambda)\).