## 3 Physical-Layer Network Coding Based on Block Markov Superposition Transmission
### Iterative Decoding and Computing Algorithm  
In PNC, the CD algorithm maps received superimposed symbols into network-coded signals through a non-bijective mapping process--multiple distinct signal combinations may be mapped to identical network-coded symbols. As critically noted in [34], this inherent many-to-one characteristic of PNC mapping during the uplink phase inevitably leads to loss of network-coding-related information embedded in the received symbols. To overcome this fundamental limitation, we propose the DC algorithm, which performs the computational operation after iterative decoding between two decoders. As shown in Figure 6, a normal graph is utilized to represent the BMST-PNC system, in which edges and vertices denote variables and constraints, respectively. Each edge carries a _message_ representing the probability mass function (PMF) of its associated variable [35]. The vertex \(\overline{\mathbf{C}}\) represents the constraint of RSPC code. The vertex \(\overline{\mathbf{=}}\) enforces equality constraints on connected variables, whereas the vertex \(\overline{\mathbf{+}}\) imposes a linear constraint requiring the sum of connected variables to be  
Figure 6: This is a normal graph for BMST-PNC system with \(L_{1}=L_{2}=3\) and \(m_{1}=m_{2}=2\) setup, in which the PNC mapper iteratively exchanges soft information with two decoders. The vertex \(\boxed{\varphi}\) computes the so-called _extrinsic messages_, sent to one decoder, based on the likelihood functions and the feedback _messages_ from the other decoder. The dual-layer structure exhibits strong flexibility, allowing for code rate and memory adjustment provided that the transmission symbol lengths from both source nodes remain equal. Throughout this paper, QPSK modulation is applied, that is, an RSPC codeword with \(n(n-2)\) bits are mapped to \(\frac{n(n-2)}{2}\) symbols. For brevity, we use \(\mathbf{c}_{r}^{(t)}=(\mathbf{c}_{1,r}^{(t)},\mathbf{c}_{2,r}^{(t)})=(c_{1,2r^{\prime}}^{ (t)},c_{1,2r+1}^{(t)},c_{2,2r^{\prime}}^{(t)},c_{2,2r+1}^{(t)})\in\mathbb{F}_{2}^ {4}\) to represent the coded sequence corresponding to the symbol pair \((x_{1,r}^{(t)},x_{2,r}^{(t)})\), \(0\leq r<\frac{n(n-2)}{2}\). Upon receiving the \(r\)-th superposition symbol \(y_{r}^{(t)}\), the likelihood function corresponding to the symbol pair \((x_{1,r}^{(t)},x_{2,r}^{(t)})\) can be computed by  
\[f\Big{(}y_{r}^{(t)}|x_{1,r}^{(t)},x_{2,r}^{(t)},h_{1,r}^{(t)},h_{2,r}^{(t)} \Big{)}\propto\exp\left(-\frac{\left|y_{r}^{(t)}-h_{1,r}^{(t)}x_{1,r}^{(t)}-h _{2,r}^{(t)}x_{2,r}^{(t)}\right|^{2}}{2\sigma^{2}}\right), \tag{8}\]  
where \(x_{i,r}^{(t)}\in\mathcal{S}\), and \(h_{i,r}^{(t)}\) represents the time-varying channel response from source node \(N_{i}\) to relay node \(N_{R}\), \(i\in\{1,2\}\). For the sake of description, we use \(P_{\mathbf{c}_{r}^{(t)}}^{(+\to\varphi)}(z)\) and \(P_{\mathbf{c}_{r}^{(t)}}^{(\to+)}(z)\), \(z\in\mathbb{F}_{2}\), to denote the a priori message and the extrinsic message via \(\mathbf{c}_{r}^{(t)}\), respectively. The message update algorithm for PNC mapper is detailed in Algorithm 2. ```
Input: Provide \(f\left(y_{r}^{(t)}|x_{1,r}^{(t)},x_{2,r}^{(t)},h_{1,r}^{(t)},h_{2,r}^{(t)}\right)\) and the a priori messages \(P_{\varphi_{\varphi_{\varphi_{\varphi_{\varphi_{\varphi}}}}}}^{(+\to\varphi)}(z)\) as inputs, where \(z\in\mathbb{F}_{2}\) and \(0\leq l\leq 3\); Output: For \(0\leq l\leq 3\), output the extrinsic messages calculated by \[ \begin{split} p_{\varphi_{\varphi_{\varphi_{\varphi_{\varphi_{ \varphi}}}}}^{(\to+)}}^{(\to+)}(z)\propto\sum\limits_{c_{\varphi_{\varphi_{ \varphi}}}^{(l)}=z}f\left(y_{r}^{(t)}|x_{1,r}^{(t)},x_{2,r}^{(t)},h_{1,r}^{(t)},h_{2,r}^{(t)}\right)\prod\limits_{j\to l}^{3}P_{\varphi_{\varphi_{\varphi_{ \varphi}}}^{(l+\to\varphi)}}^{(\to+\varphi)}(c_{r_{\varphi_{\varphi}}}^{(t)}). \end{split} \]
```  
**Algorithm 2**Message update algorithm  
The BMST-RSPC decoder employs an iterative sliding-window decoding algorithm with delay \(d\).