**1. Introduction**

*Hajek*, in 1998, introduced *BL*-algebra in order to provide a general framework for formalizing statements of a fuzzy nature [1]. *BL*-algebra is the algebraic structure arising from the continuous triangular norms, and it has certain logical axioms similarly to Boolean algebras or *MV*-algebras from classical logic or Lukasiewicz logic, respectively. In addition, every *MV*-algebra is a *BL*-algebra, whereas the converse is not always true. Thus, the class of *MV*-algebra is a subset of the class of *BL*-algebra, and this is the main reason that we selected *BL*-algebra to investigate the code generated by it. Moreover, *Hajeck* showed that every *BL*-algebra with an involutory complement is *MV*-algebra.

In the twentieth century, there is a problem in engineering about the transmutation of information. Shannon [2] in 1948 and Hamming [3] in 1950 provided some frameworks to solve the problem. Their idea was developed and, as a consequence, the electronic information could be transmitted throughout the noisy channel and stored by minimum errors, and coding theory was born. Because the electronic information is a string of zeros and ones, it uses a finite field as the alphabet set. Thus, coding theory can use different areas of mathematics such as linear algebra, finite geometry, lattices, and combinatorics, especially when the alphabet set is generalized to different types of fields. Coding theory can be viewed not only as a part of computer science and engineering but also as a part of pure mathematics, as the mathematicians were interested in the fundamental aspects of this concept.

Application of coding theory in ordered algebraic structures was initiated by Jun and Song in 2011 [4]. They introduced the notion of BCK-valued functions and established binary block codes by using the notion of BCK-valued functions. After that, in 2014, Borumand et al. [5] and in 2015, Flaut [6] presented some relationships between *BCK*-algebras and the related binary block codes. They proved that every *BCK*-algebra determines a binary block code. Gilani [7] studied some properties of the codes generated by *BCK*-functions in an arbitrary *BCK*-algebras. Details about the fundamental relations in an arbitrary *BCK*-algebra and related generated code, namely *BCK*-code, was investigated by Bordbar in [8]. During the last few years, binary block codes generated by different

**Citation:** Bordbar, H. The Structure of the Block Code Generated by a *BL*-Algebra. *Mathematics* **2022**, *10*, 692. https://doi.org/10.3390/ math10050692

Academic Editor: Patrick Solé

Received: 27 January 2022 Accepted: 21 February 2022 Published: 23 February 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

types of ordered algebraic structures were studied, for instance, codewords in a binary block code generated by a *UP*-valued function investigated by Chinram and Iampan in 2021 [9], and in 2015, Mostafa et al. [10] applied coding theory to *KU*-algebras and gave some connection between binary block codes and *KU*-algebras.

In this paper, we investigate the code generated by a *BL*-algebra. Our motivation is to study the properties of a code generated by one ordered algebraic structure. We begin with a discussion of the ordered algebraic structure known as *BL*-algebra as it is an extended algebraic structure and has some other ordered structures as its subsets, such as *MV*-algebra. Moreover, by using the order in a *BL*-algebra, we define a new order in a generated code and give the code an algebraic ordered structure. The defined order among the codewords can be useful in decoding and will be our future work. For our goal, in Section 3 we define a *BL*-function on an arbitrary nonempty set *P* based on *BL*-algebra *L* and by using the *BL*-function, *l*-functions of it and *l*-subsets of *P* for *l* ∈ *L* are investigated. In addition, properties of *BL*-function and its *l*-functions and *l*-subsets of *P* that we need for generated code are considered. In Section 4, a binary equivalence relation ≈ defines on a *BL*-algebra *L*, and by using this relation and *BL*-function, the code *C* based on *L* is generated. Finally, we study an order among the codewords of *C* that gives the code *C* an ordered algebraic structure. In Theorem 3, we show that the *BL*-algebra *L* with its order and the code *C* based on *L* with respect to defined order have the same structures.

## **2. Preliminaries**

A *BL-algebra* is a structure L := (*L*, ∧, ∨, , →, 0, 1) such that (*L*, ∧, ∨, 0, 1) is a bounded lattice, (*L*, , 1) is an abelian monoid, i.e., is commutative and associative, and the following conditions hold for all *x*, *y*, *z* ∈ *L*:

(BL1) *x* 1 = *x*, (BL2) *x y* ≤ *z* if and only if *x* ≤ *y* → *z*, (BL3) *x* ∧ *y* = *x* (*x* → *y*), (BL4) (*x* → *y*) ∨ (*y* → *x*) = 1. Every *BL*-algebra L satisfies the following assertions

$$\mathbf{x} = \mathbf{1} \to \mathbf{x}, \; \mathbf{x} \to \mathbf{x} = \mathbf{1}, \; \mathbf{x} \to \mathbf{1} = \mathbf{1}, \tag{1}$$

$$
\propto \le y \Leftrightarrow \mathfrak{x} \to \mathfrak{y} = 1,\tag{2}
$$

$$
\infty \le y \to \infty,\tag{3}
$$

$$\mathbf{x} \to (y \to z) = y \to (\mathbf{x} \to z), \tag{4}$$

$$\mathbf{x} \le y \implies z \to \mathbf{x} \le z \to y, \ y \to z \le \mathbf{x} \to z \tag{5}$$

for all *x*, *y*, *z* ∈ *L*.

For more information about *BL*-algebra, please refer to [1,11].

The alphabets used in coding theory are finite fields with *q* elements, *GF*(*q*). We say that a code is *q* − *ary* if its codewords are defined over the *q* − *ary* alphabet *GF*(*q*). The most commonly used alphabets are binary fields, *GF*(2*m*). This article focuses on codes with the familiar alphabet *GF*(2), which are known as *binary codes*.

Let *c* be a codeword. Then the *Hamming weight w*(*c*) of a codeword *c* is the number of nonzero components in the codeword. The *Hamming distance* between two codewords *d*(*c*1, *c*2) is the number of places in which the codewords *c*<sup>1</sup> and *c*<sup>2</sup> differ. In other words, *d*(*c*1, *c*2) is the Hamming weight of the vector *c*<sup>1</sup> − *c*2, representing the component-wise difference of the vectors *c*<sup>1</sup> and *c*2. The minimum (Hamming) distance of a code *C* is the minimum distance between any two codewords in the code *C*, that is,

$$d(\mathbb{C}) = \min \{ d(\mathfrak{x}, \mathfrak{y}) \mid \mathfrak{x} \neq \mathfrak{y}, \mathfrak{x}, \mathfrak{y} \in \mathbb{C} \}.$$

The notation (*n*, *M*, *d*) is used to represent a code with code length *n*, a total of *M* codewords, and minimum distance *d*. One of the major goals of coding theory is to develop codes that strike a balance between having small *n* (for fast transmission of messages), large *M* (to enable transmission of a wide variety of messages), and large *d* (to detect many errors).

## **3.** *BL***-Functions on a Nonempty Set** *P*

In this section, the notions of *BL*-functions on a nonempty set *P* based on a *BL*-algebra *L*, *l*-functions, and *l*-subsets of *P* for an arbitrary element *l* ∈ *L*, will be introduced. Some of the properties connected with *l*-subsets of *P* and *l*-functions of a *BL*-function will be investigated. Throughout this section, unless stated otherwise, L := (*L*, ∧, ∨, , →, 0, 1) denotes a *BL*-algebra. In addition, in this paper, we use the set *L* for our definitions as a *BL*-algebra L = (*L*, ∧, ∨, , →, 0, 1).

**Definition 1.** *Let P be a nonempty set and L be a BL-algebra. A mapping φ* : *P* → *L is called a BL*-function *on P based on L and denoted by φL. If there is no confusion of L, we use φ instead of φL. Moreover, for a BL-function φ on P and l* ∈ *L, define φ<sup>l</sup>* : *P* → {0, 1} *for each p* ∈ *P as follows:*

$$\phi\_l(p) = \begin{cases} 1, & \text{if and only if} \quad \phi(p) \to l = 1, \\ 0, & \text{otherwise.} \end{cases} \tag{6}$$

*The function φ<sup>l</sup> is called a l-function of φ.*

**Definition 2.** *Let P be a nonempty set and L be a BL-algebra. For a BL-function φ* : *P* → *L on P and each l* ∈ *L, the set Pl defined by*

$$P\_l := \{ p \in P \mid \phi(p) \to l = 1 \},\tag{7}$$

*is called a l-subset of P.*

**Example 1.** *Let L* = {0, *a*, *b*, 1} *be a set with the following Cayley tables:*


*Then* L = (*L*, ∧, ∨, , →, 0, 1) *is a BL-algebra (see [12]), where x* ∧ *y* = min{*x*, *y*} *and x* ∨ *y* = max{*x*, *y*}.

*(1) For a set P* = {*p*1, *p*2, *p*3}*, the function φ* : *P* → *L defined by*

$$
\phi(p\_1) = a, \phi(p\_2) = b \text{ and } \phi(p\_3) = 1,
$$

*is a BL-function on P, and the l-subsets of P for each l* ∈ *L are as follows:*

$$P\_0 = \bigcirc, P\_a = \{p\_1\}, \; P\_b = \{p\_1, p\_2\} \; and \; P\_1 = P.$$

*In addition, for each l* ∈ *L, the l-functions of φ are as shown in the following table:*


*(2) Let Q* = {*q*1, *q*2, *q*3, *q*4} *and define the function ψ* : *Q* → *L by*

$$
\psi(q\_1) = a, \psi(q\_2) = b, \psi(q\_3) = 1 \text{ and } \psi(q\_4) = 0.
$$

*Then ψ is a BL-function on Q. For each l* ∈ *L, the l-subsets of Q are as follows:*

$$Q\_0 = \{q\_4\}, \ Q\_a = \{q\_1, q\_4\}, \ Q\_b = \{q\_1, q\_2, q\_4\} \text{ and } \ Q\_1 = Q.$$

*In addition, the l-functions of ψ for each l* ∈ *L are as shown in the following table:*


The following proposition shows the relationship between *BL*-function *φ<sup>L</sup>* on *P* and its *l*-functions and *l*-subsets of *P* for *l* ∈ *L*.

**Proposition 1.** *Let φ* : *P* → *L be a BL-function on a nonempty set P based on L, where L is a BL-algebra. Then the function φ can be described by its l-functions and l-subsets of P, for l* ∈ *L, as the infimum of the following sets:*

$$(\forall p \in P)(\phi(p) = \inf\{l \in L \mid p \in P\_l\}),\tag{8}$$

*in other words,*

$$(\forall p \in P)(\phi(p) = \inf\{l \in L \mid \phi\_l(p) = 1\}).\tag{9}$$

**Proof.** Let *p* ∈ *P* be an arbitrary element and *φ*(*p*) = *l*. Then using (1),

$$
\phi(p) \to l = l \to l = 1.
$$

Thus *φl*(*p*) = 1, which means that *p* ∈ *Pl*. Assume that *p* ∈ *Pl* , for *l* ∈ *L*. Then 1 = *φ*(*p*) → *l* = *l* → *l* . By using (2), we conclude that *l* ≤ *l* . Because *l* ∈ {*l* ∈ *L* | *p* ∈ *Pl*}, it follows that

$$\phi(p) = \inf\{l \in L \mid p \in P\_l\}.$$

The equality (9) is a direct conclusion of (6) and (7).

**Corollary 1.** *For a BL-algebra L, if φ* : *P* → *L is a BL-function on P based on L, then for p* ∈ *P,*

$$\phi(p) = \inf \{ \phi\_l(p) \hookrightarrow l \mid l \in L \},$$

*where*

$$
\phi\_l(p) \hookrightarrow l = \begin{cases} \begin{array}{c} l \\ 1 \end{array} \text{if } p \in P\_{l\prime} \\\
\text{otherwise.} \end{cases}
$$

**Proposition 2.** *Let L be a BL-algebra and φ* : *P* → *L be a BL-function on a nonempty set P based on L. Then for elements l*1, *l*<sup>2</sup> ∈ *L we have the following assertion,*

$$l\_1 \le l\_2 \implies P\_{l\_1} \subseteq P\_{l\_2} \tag{10}$$

**Proof.** Assume that *l*1, *l*<sup>2</sup> ∈ *L* are arbitrary elements such that *l*<sup>1</sup> ≤ *l*2. Hence *l*<sup>1</sup> → *l*<sup>2</sup> = 1. Moreover let *x* ∈ *Pl*<sup>1</sup> . Then *φ*(*x*) → *l*<sup>1</sup> = 1, which means that *φ*(*x*) ≤ *l*1. By using (5) we have

$$l\_1 \to l\_2 \le \phi(\mathfrak{x}) \to l\_2.$$

Thus using (1), we conclude that

$$(l\_1 \to l\_2) \to (\phi(\mathbf{x}) \to l\_2) = 1 \to (\phi(\mathbf{x}) \to l\_2) = \phi(\mathbf{x}) \to l\_2 = 1.$$

Therefore, *x* ∈ *Pl*<sup>2</sup> , that is *Pl*<sup>1</sup> ⊆ *Pl*<sup>2</sup> .

**Theorem 1.** *Let φ* : *P* → *L be a BL-function on P. Then*

$$\begin{aligned} \text{(i)} \quad & \left(\forall p\_1, p\_2 \in P\right) \Big(\phi(p\_1) \neq \phi(p\_2) \iff P\_{\phi(p\_1)} \neq P\_{\phi(p\_2)}\right). \\ \text{(ii)} \quad & \left(\forall l \in L\right) \big(\forall p \in P\big) \Big(p \in P\_l \iff P\_{\phi(p)} \subseteq P\_l\Big). \end{aligned}$$

**Proof.** For *BL*-function *φ* : *P* → *L*, let *p*1, *p*<sup>2</sup> ∈ *P* be such that *Pφ*(*p*1) = *Pφ*(*p*2). Moreover, suppose that *φ*(*p*1) = *φ*(*p*2). If *x* ∈ *Pφ*(*p*1), then

$$
\phi(\mathfrak{x}) \to \phi(p\_1) = \phi(\mathfrak{x}) \to \phi(p\_2) = 1,
$$

which means that *x* ∈ *Pφ*(*p*2). Thus *Pφ*(*p*1) ⊆ *Pφ*(*p*2). Similarly, *Pφ*(*p*2) ⊆ *Pφ*(*p*1), and this is a contradiction. Therefore, for all *p*1, *p*<sup>2</sup> ∈ *P*, if *Pφ*(*p*1) = *Pφ*(*p*2), then *φ*(*p*1) = *φ*(*p*2). This proves the (⇐).

In order to prove (⇒), suppose that *p*1, *p*<sup>2</sup> ∈ *P* such that *φ*(*p*1) = *φ*(*p*2). Then clearly *φ*(*p*1) → *φ*(*p*2) = 1 or *φ*(*p*2) → *φ*(*p*1) = 1. Hence,

$$\begin{aligned} P\_{\phi(p\_1)} &= \{ \mathbf{x} \in P \mid \phi(\mathbf{x}) \to \phi(p\_1) = 1 \} \\ &\neq \{ \mathbf{x} \in P \mid \phi(\mathbf{x}) \to \phi(p\_2) = 1 \} \\ &= P\_{\phi(p\_2)} .\end{aligned}$$

Therefore, *Pφ*(*p*1) = *Pφ*(*p*2).

(ii) Let *l* ∈ *L* and *p* ∈ *P* be such that *p* ∈ *Pl*. Then *φ*(*p*) → *l* = 1, and using Proposition 2,

$$P\_{\phi(p)} \subseteq P\_{\mathcal{I}}.$$

Conversely, suppose that *Pφ*(*p*) ⊆ *Pl* for *l* ∈ *L* and *p* ∈ *P*. Because *φ*(*p*) → *φ*(*p*) = 1, we conclude that *p* ∈ *Pφ*(*p*). Therefore, *p* ∈ *Pl* and the proof is complete.

Theorem 1 part (ii) shows that the converse of Proposition 2 is true. Thus, we have the following corollary.

**Corollary 2.** *Let φ* : *P* → *L be a BL-function on a nonempty set P based on L, where L is a BL-algebra. Then*

$$(\forall p\_1, p\_2 \in A) \Big(\phi(p\_1) \to \phi(p\_2) = 1 \iff P\_{\phi(p\_1)} \subseteq P\_{\phi(p\_2)}\Big). \tag{11}$$

**Proposition 3.** *Let φ* : *P* → *L be a BL-function on a nonempty set P and M* ⊆ *L. Put*

$$
\alpha = \inf \{ m \mid m \in M \}.
$$

*Then*

$$P\_{\mathfrak{a}} = \cap \{ P\_{\mathfrak{m}} \mid m \in M \} \tag{12}$$

**Proof.** Note that there exists the infimum of *M* in *L* for any *M* ⊆ *L*. Thus, for the infimum element *α* of *M* we have

$$\begin{aligned} \mathfrak{x} &\in P\_{\mathfrak{A}} \Leftrightarrow \phi(\mathfrak{x}) \to \mathfrak{a} = 1 \\ &\Leftrightarrow (\forall m \in M) (\phi(\mathfrak{x}) \to m = 1) \\ &\Leftrightarrow (\forall m \in M) (\mathfrak{x} \in P\_{m}) \\ &\Leftrightarrow \mathfrak{x} \in \cap \{P\_{m} \mid m \in M\}. \end{aligned}$$

For a *BL*-algebra *L* and a *BL*-function *φ* : *P* → *L* on a nonempty set *P*, define the sets *PL* and *φ<sup>L</sup>* as follows:

$$P\_L := \{ P\_l \mid l \in L \}, \\ \phi\_L := \{ \phi\_l \mid l \in L \}.$$

Then we have the following corollary.

**Corollary 3.** *If φ* : *P* → *L is a BL-function on a nonempty set P, then*


**Proposition 4.** *Let φ* : *P* → *L be a BL-function on a nonempty set P. Then P is represented by the union of Pl for l* ∈ *L, that is,*

$$P = \cup \{ P\_l \mid l \in L \}. \tag{13}$$

**Proof.** Obviously, ∪{*Pl* | *l* ∈ *L*} ⊆ *P*. Let *p* ∈ *P* and *l* ∈ *L* be such that *φ*(*p*) = *l*. Then by using the definition of *l*-subset of *P*, we have *p* ∈ *Pl*. Thus,

$$p \in \cup \{P\_l \mid l \in L\}\_{\prime\prime}$$

which means that *P* ⊆ ∪{*Pl* | *l* ∈ *L*}. Therefore, *P* = ∪{*Pl* | *l* ∈ *L*}.

**Proposition 5.** *Let φ* : *P* → *L be a BL-function on a nonempty set P and p* ∈ *P. Then*

$$
\cap \{ P\_I \mid p \in P\_I \} \in P\_L. \tag{14}
$$

**Proof.** Remember that by using (6) and (7), we conclude that for any *p* ∈ *P*,

$$p \in P\_l \iff \phi\_l(p) = 1.$$

It follows from Proposition 3 that

$$\{p \cap \{P\_l \mid p \in P\_l\} = \cap \{P\_l \mid \phi\_l(p) = 1\} = P\_{\inf\{l \mid p \in P\_l\}} \in P\_l.\}$$

Let *φ* : *P* → *L* be a *BL*-function on a nonempty set *P* and ≈ be a binary relation on *L* defined by

$$(\forall l\_1, l\_2 \in L) \left(l\_1 \approx l\_2 \iff P\_{l\_1} = P\_{l\_2}\right). \tag{15}$$

The binary relation ≈ is an equivalence relation on *L*. Moreover, for an arbitrary element *l* ∈ *L*, define the sets *φ*(*P*) and {*l*}≤ as follows:

$$\phi(P) := \{ l \in L \mid \phi(p) = l \text{ for some } p \in P \}$$

$$\{l\}\_{\leq} := \{\mathfrak{x} \in L \mid \mathfrak{x} \leq l\} = \{\mathfrak{x} \in L \mid \mathfrak{x} \to l = 1\}.$$

The relationships between an equivalence relation ≈ and the sets *φ*(*P*) and {*l*}≤ are described in the following theorem.

**Theorem 2.** *For a BL-function φ* : *P* → *L on a nonempty set P and the elements l*1, *l*<sup>2</sup> ∈ *L, we have the following assertion:*

$$l\_1 \approx l\_2 \iff \phi(P) \cap \{l\_1\}\_{\leq} = \phi(P) \cap \{l\_2\}\_{\leq}.\tag{16}$$

**Proof.** Suppose that *l*1, *l*<sup>2</sup> ∈ *L*. Then

$$\begin{array}{rcl} l\_1 \approx l\_2 &\iff & P\_{l\_1} = P\_{l\_2} \\ &\iff & (\forall p \in P) \,(\phi(p) \to l\_1 = 1 \iff \phi(p) \to l\_2 = 1) \\ &\iff & \{p \in P \mid \phi(p) \in \{l\_1\}\_{\le}\} = \{p \in P \mid \phi(p) \in \{l\_2\}\_{\le}\} \\ &\iff & \phi(P) \cap \{l\_1\}\_{\le} = \phi(P) \cap \{l\_2\}\_{\le}. \end{array}$$

#### **4. Code Generated by a** *BL***-Algebra**

The relation ≈ on *L* that is defined in (15) is an equivalence relation on *L*. Thus, it provides the partition of *L*. For any *l* ∈ *L*, let [*l*] denotes an equivalence class containing *l*, which means that

$$[l] := \{ k \in L \mid l \approx k \}.$$

In what follows, a binary block code of length *n* will be made from an arbitrary finite *BL*-algebra. In this method *n* is a natural number; this helps us to generate a binary block code of the desired length *n*.

For *n* ∈ N, let *P* = {*p*1, *p*2, ... , *pn*} and *L* be a finite *BL*-algebra. Every *BL*-function *φ* : *P* → *L* on *P* determines a binary block code *C* of length *n* in the following way:

Let *l* ∈ *L*. Then for [*l*] the correspondence codeword is *cl* = *c*1*c*<sup>2</sup> ··· *cn* such that for 1 ≤ *i* ≤ *n*

$$c\_i = \phi\_l(p\_i) \tag{17}$$

where *pi* ∈ *P*. We called *C* a *BL-code* based on *L* and denoted by *CL*. If there is no confusion of *L*, we use *C* instead of *CL*.

During our study of block code generated by an arbitrary *BL*-algebra, three parameters are important. The first parameter is the code length *n*. In the *BL*-code based on *L*, we can make a code of the desired length *n*. This can be helpful as we can choose the length in different situations. The second parameter that we consider is the total number of codewords. In this kind of code, the total number of codewords is equal to the total number of distinct equivalence classes of ≈ relation. The third parameter is the distance between pairs of codewords in a code. In the following examples, these notations will be explained much more.

**Example 2.** *Let L* = {0, *a*, *b*, 1} *be a set with Cayley tables as follows:*


*Then* L := (*L*, ∧, ∨, , →, 0, 1) *is a BL-algebra. For a set P* = {*p*1, *p*2, *p*3, *p*4}, *let φ* : *P* → *L be a BL-function on P given by*

$$\phi(p\_1) = a,\ \phi(p\_2) = 0,\ \phi(p\_3) = 1 \ and \ \phi(p\_4) = b$$

*Then the l-subsets of P are*

$$P\_0 = \{p\_2\}, P\_a = \{p\_1, p\_2\}, \; P\_b = \{p\_1, p\_2, p\_4\} \; and \; P\_1 = P.$$

*In addition, the l-functions of φ are*


*Clearly, we have four different equivalence classes, which are* [0], [*a*], [*b*], *and* [1]*. Thus the total number of codewords is* 4 (*M* = 4)*. By using (17), we conclude that*

 $c\_0 = 0100$ ,  $c\_a = 1100$ ,  $c\_b = 1101$ ,  $c\_1 = 1111$ .

*Thus the binary block code C of length n* = 4 *and* 4 *codewords is C* = {0100, 1100, 1101, 1111}*. Besides, the minimum distance of C is* 1 *(d*(*C*) = 1*). It is clear that the code C is not a linear code because* 0000 /∈ *C*.

Let *cl* = *l*1*l*<sup>2</sup> ··· *ln* and *ck* = *k*1*k*<sup>2</sup> ··· *kn* be two codewords belonging to a binary blockcode *C* of length *n*. Define an order relationship ! on the set of codewords belonging to a binary block-code *C* of length *n* as follows:

$$c\_l \preceq c\_k \Leftrightarrow l\_l \le k\_l \text{ for } i = 1, 2, \dots, n. \tag{18}$$

By using (2) for the *BL*-algebra *L* and (18) for the *BL*-code *C* based on *L*, we conclude that the graphs of *L* concerning the order ≤ and the code *C* with respect to the order ! have the same structures. For instance, in Example 2, we have

Therefore, we can have the following theorem.

**Theorem 3.** *Let* L := (*L*, ∧, ∨, , →, 0, 1) *be a finite BL-algebra and* |*L*| = *n, where n* ∈ N*. Then L determines a block-code C of length n (namely BL-code) such that the graph of L with respect to its order* ≤ *and the graph of BL-code C with respect to the order* ! *have the same structure.*

**Proof.** Let L := (*L*, ∧, ∨, , →, 0, 1) be a finite *BL*-algebra and *L* = {*l*1, *l*2, ··· , *ln*}. Moreover, suppose that *P* = *L*. Then *P* is a nonempty set and *φ* : *L* → *L* defined by *φ*(*li*) = *li*, for 1 ≤ *i* ≤ *n* is a *BL*-function on *L* based on *L*. Suppose that *<sup>L</sup>* <sup>≈</sup> be a set of all equivalence classes of the elements of *L* regarding the equivalence relation ≈ defined in (15). That is,

$$\frac{L}{\approx} = \{ [l] \mid l \in L \}.$$

Define the mapping *ψ* : *<sup>L</sup>* <sup>≈</sup> −→ *C* by

$$
\psi([l\_i]) = c\_{l\_{i'}} \tag{19}
$$

whereby using (17), we have

$$c\_{l\_i} = \phi\_{l\_i}(l\_1)\phi\_{l\_i}(l\_2)\dots\phi\_{l\_i}(l\_n),$$

for 1 ≤ *i* ≤ *n*.

Moreover, let [*li*]=[*lj*], for *i*, *j* ∈ {1, 2, ... , *n*}, and *i* = *j*. Then using (7) and (15), we conclude that

$$\begin{array}{lcl} \left[l\_{i}\right] = \left[l\_{j}\right] & \Leftrightarrow & L\_{l\_{i}} = L\_{l\_{j}}\\ & \Leftrightarrow & \left\{l \in L \mid \phi(l) \to l\_{i} = 1\right\} = \left\{l \in L \mid \phi(l) \to l\_{j} = 1\right\} \\ & \Leftrightarrow & \left\{l \in L \mid \phi\_{l\_{i}}(l) = 1\right\} = \left\{l \in L \mid \phi\_{l\_{j}}(l) = 1\right\} \\ & \Leftrightarrow & \left(\forall l \in L\right) \left(\phi\_{l\_{i}}(l) = 1 \Leftrightarrow \phi\_{l\_{j}}(l) = 1\right) \\ & \Leftrightarrow & \left(\forall l \in L\right) \left(\phi\_{l\_{i}}(l) = 0 \Leftrightarrow \phi\_{l\_{j}}(l) = 0\right) \\ & \Leftrightarrow & c\_{l\_{i}} = c\_{l\_{j}}. \end{array}$$

This means that the function *ψ* in (19) is well defined and the inverse implications show that the function *ψ* is one-to-one.

Now suppose that *li*, *lj* ∈ *L* are such that *li* ≤ *lj*, for 1 ≤ *i*, *j* ≤ *n*. Then Proposition 2 shows that *Lli* ⊆ *Llj* . If *l* ∈ *L* and *l* ∈ *Lli* , then *φli* (*l*) = 1. Because *Lli* ⊆ *Llj* , *l* ∈ *Llj* and *φlj* (*l*) = 1, therefore *φli* (*l*) ≤ *φlj* (*l*). Thus, in this case *cli* ≤ *clj* .

If *l* ∈ *L* and *l* ∈/ *Lli* , then *φli* (*l*) = 0 and we have two opportunities. The first one is *l* ∈ *Llj* , which means that *φlj* (*l*) = 1, and the second one is *l* ∈/ *Llj* , which means that *φlj* (*l*) = 0. In both case, we have *φli* (*l*) ≤ *φlj* (*l*). Hence, *cli* ≤ *clj* . Therefore, if *li* ≤ *lj*, then *ψ*(*li*) ! *ψ*(*lj*), that is, *ψ* preserves the order. Therefore, the figures of (*L*, ≤) and (*C*, !) have the same structures.

**Example 3.** *Let L* = {0, *a*, *b*, *c*, *d*, 1} *be a set with the following Cayley tables.*


*Then* L = (*L*, ∧, ∨, , →, 0, 1) *is a BL-algebra. For a set P* = {*pi* | *i* = 1, 2, ··· , 6}*, let φ* : *P* → *L be a BL-function on a set P given by*

$$
\phi(p\_1) = 0, \ \phi(p\_2) = a, \ \phi(p\_3) = b, \ \phi(p\_4) = c, \ \phi(p\_5) = d, \ and \ \phi(p\_6) = 1.
$$

*Then*


*Thus, using the (17) we have*

*c*<sup>0</sup> = 100000, *ca* = 111010, *cb* = 101000, *cc* = 100110, *cd* = 100010, *c*<sup>1</sup> = 111111.

*Finally, the generated binary block code C based on L is:*

*C* = {100000, 111010, 101000, 100110, 100010, 111111}.

*Moreover, the graph of C using the order (18) is as follows:*

*which is the same with the graph of L and the order (2), that is,*

#### **5. Conclusions**

In this paper, we have studied the code generated by a *BL*-algebra as one of the important classes of ordered algebra. For this goal, the notion of *BL*-function on a nonempty set *P* based on *BL*-algebra *L* was introduced, and for *l* ∈ *L*, *l*-fuctions of a *BL*-fuction and *l*-subsets of *P* were studied. After investigating some results concerning the *BL*-functions, our study has focused on a binary equivalence relation ≈ on *L*, and using this relation we define the code *C* based on *L*. Finally, we have defined an order between the codewords of *C*, which gives the code *C* the ordered structure. Moreover, the graph of *C* with its order and the graph of *L* have the same structures.

The results related to *BL*-code *C* show that, in general, this code is not linear. For our future work, we will concentrate on some conditions that make this binary block code a linear code. Moreover, using the notations and ideas of this article, the order that we defined between the codewords of the code *C* based on *BL*-algebra *L* can help us to find a new algorithm for decoding the ciphertext. In our future research, we focus on this part of the decoding algorithm.

**Author Contributions:** Conceptualization, H.B.; methodology, H.B.; investigation, H.B.; writing original draft preparation, H.B.; writing—review and editing, H.B. All authors have read and agreed to the published version of the manuscript.

**Funding:** No funding.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Conflicts of Interest:** The author declares no conflict of interest.
