**3. Paraconsistent Logics – Equations and Algorithms**

Aristotelian or classic logics are called so due to its origin being attributed to Aristotle and his disciples, and its foundations are supported by strict binary principles which can be con‐ cisely described by: principle of identity, principle of bivalency, principle of non-contradic‐ tion and principle of the excluded middle. Basically, all current technology is built based on the principles of the classic logics. However, due to its binary foundations, it cannot be ap‐ plied or cannot offer satisfactory responses in some real situations such those where incom‐ pleteness and contradiction are expressed.

In order to overcome these difficulties and fulfill the need of satisfactorily model certain con‐ ditions of the real world, several logics, which reject some of the classic principles or which accept certain conditions not included in the classic logics, have appeared recently. The spe‐ cial logics are called non-classic and among them there is the paraconsistent logic (PL) which has the main property of being capable of accepting contradiction in its foundations.

#### **3.1. Paraconsistent Annotated logics - PAL**

**2.2. Expert Systems Based on Paraconsistent logics**

banks such as the one of an electric power system.

[5][9][10].

34 Advances in Expert Systems

system.

These problems found in classical projects lead to the conclusion that the algorithms based on the concepts of non-classic logics may show a better efficiency in the design of expert sys‐ tems dedicated to the analysis and treatment of uncertain data originated in complex data‐

Based on these considerations we introduce in this paper a paraconsistent expert system (PES) with algorithms based on the theoretical concepts of the Paraconsistent logics (PL) which is a non-classic logics whose main basic theoretical features is, under certain condi‐ tions, to accept contradicting values so that the conflict does not invalidate the conclusions

The paraconsistent expert system (PES) introduced in this work has the role of performing the analysis of the information coming from the electric power system in the sector of ener‐ gy sub-transmission treating possible contradictions in the information signals. Through the analysis of values of voltage and electric current and the consideration of the states of con‐ nection or disconnection of the electric keys in the substations, PES informs about the risk conditions of overload and about the different configuration topologies of the electric power

When a failure, that triggers the interruption of the transmission of energy, happens, PES informs the operators of the sub-transmission system how to proceed with the actions for the restoring in an optimized way. Given the real-time monitoring, the analysis that PES performs is based on data before the occurrence of the failure, which allows PES to indicate the best and most efficient sequence of connecting electric keys in the interrupted section. The actions indicated by PES take into consideration the restrictions of load, technical and

Aristotelian or classic logics are called so due to its origin being attributed to Aristotle and his disciples, and its foundations are supported by strict binary principles which can be con‐ cisely described by: principle of identity, principle of bivalency, principle of non-contradic‐ tion and principle of the excluded middle. Basically, all current technology is built based on the principles of the classic logics. However, due to its binary foundations, it cannot be ap‐ plied or cannot offer satisfactory responses in some real situations such those where incom‐

In order to overcome these difficulties and fulfill the need of satisfactorily model certain con‐ ditions of the real world, several logics, which reject some of the classic principles or which accept certain conditions not included in the classic logics, have appeared recently. The spe‐ cial logics are called non-classic and among them there is the paraconsistent logic (PL) which

has the main property of being capable of accepting contradiction in its foundations.

safety norms due to the conditions imposed to that particular situation.

**3. Paraconsistent Logics – Equations and Algorithms**

pleteness and contradiction are expressed.

Among the several families of paraconsistent logics there is the logics called paraconsistent annotated logics (PAL) [5] which belongs to the class of evidential logics and allows analysis of signals represented by annotations [5][9][11]. In its representation each annotation µ be‐ longs to a finite lattice τ which assigns values to its corresponding propositional formula *P*.

For the PAL each evidence degree µ from its representing lattice, whose value varies from 0 and 1 in a closed interval of real numbers, assigned to the proposition *P* a logical state repre‐ sented on the vertexes. By means of a special logical operator, the interpretations on the lat‐ tice of the PAL allow the creation of equations which provide algorithms for the paraconsistent analysis with evidence degrees extracted from real physical systems.

#### **3.2. Paraconsistent Annotated logics with Annotation of two values - PAL2v**

The paraconsistent annotated logics with annotation of two values (PAL2v) is an extension of the PAL and to each propositional formula *P* is assigned an annotation given by two evi‐ dence degrees as follows:

An evidence degree (µ) which is favorable to proposition *P* and an evidence degree (λ) which is unfavorable to proposition *P*.

The annotation composed by two evidence degrees (µ,λ) gives proposition *P* a connotation of paraconsistent logical state ετ which can be identified on the extreme vertices of the lattice: in‐ consistent (⊤), true (t), false (F) or indeterminate (⊥ ) [9]. That being so, in the representation of the PAL2v, a paraconsistent logical signal is represented by proposition *P* and its annotation, which is composed by two evidence degrees, such that: *P*(µ,λ) with µ, λ ⊂ [0,1] ∈ℜ.

#### **3.3. The Equations of PAL2v**

The PAL2v can be studied with the unitary square of the Cartesian plane (USCP) as shown in Figure 2 where, through linear transformations, values on the two representing axes of a lattice similar to the one associated with the PAL2v.

**Figure 2.** Lattice of four Vertexes.

Doing so, we can write paraconsistent equations on the lattice in which terminologies and conventions are established [5] around paraconsistent logical states attributed to proposition *P*. After the expansion actions with intensity 2, rotation of 45o with respect to the origin and translation along the vertical axis, the linear transformation is defined by:

$$\mathbf{T(X,Y)=(x-y, \quad x+y-1)}\tag{1}$$

**3.4. The Paraconsistent States Logic ετ**

where: ετ is the Paraconsistent logical state.

Degree DCR can be obtained as follows:

For DC >0 we compute:

For DC <0 we compute:

tent logical state ετ by:

where:

where: DC = *f* (µ,λ)and Dct= *f* (µ,λ)

DCRis the real Certainty Degree (6) or (7).

the PAL2v [3], such that:

or

Since the linear transformation T(X,Y) shown in (1) is expressed with evidence Degrees µ and λ, from (2), (3) and (1) we can represent a Paraconsistent logical state ετ into Lattice τ of

Electric Power System Operation Decision Support by Expert System Built with Paraconsistent Annotated Logic

( ) ( C ct )

Since the Paraconsistent logical state ετ can be anywhere in the lattice τ, the real Certainty

=(µ−λ,µ+λ−1) (4)

http://dx.doi.org/10.5772/51379

37

μ,λ = D , D (5)

2 2 D 1 (1 | D |) D CR =- - + C ct (6)

2 2 D (1 | D |) D 1 CR =- + - C ct (7)

<sup>2</sup> (8)

*ετ*(µ,λ)

et

DC is the Certainty Degree obtained from the evidence Degrees µ and λ.

Dct is the Contradiction Degree obtained from the evidence Degrees µ and λ.

For DC=0 we consider the undefined Paraconsistent logical state with: DCR *=*0.

µER(µ,λ)is the resulting evidence Degree in function of µ and λ.

We compute the resulting evidence Degree which expresses the intensity of the Paraconsis‐

µER(µ,λ)= DCR <sup>+</sup> <sup>1</sup>

According to the language of the PAL2v we have:

*x* = µ is the Favorable evidence Degree

*y* = λ is the Unfavorable evidence Degree.

**Figure 3.** a) Unitary Square in the Cartesian Plane (USCP). (b) Lattice κ with another system of coordinates with values.

The first coordinate of the transformation (1) is called *Certainty Degree* DC.

$$\mathbf{D}\_{\mathbb{C}} = \mu - \lambda \tag{2}$$

The first coordinate is a real number in the closed interval [-1,+1]. The x-axis is called "*axis of the certainty degrees*".

The second coordinate of the transformation (1) is called *Contradiction Degree* Dct.

$$\mathbf{D}\_{\rm ct} = \boldsymbol{\mu} + \lambda - \mathbf{1} \tag{3}$$

The second coordinate is a real number in the closed interval [-1,+1]. The y-axis is called *"axis of the contradiction degrees"*.

#### **3.4. The Paraconsistent States Logic ετ**

Since the linear transformation T(X,Y) shown in (1) is expressed with evidence Degrees µ and λ, from (2), (3) and (1) we can represent a Paraconsistent logical state ετ into Lattice τ of the PAL2v [3], such that:

$$
\varepsilon\_{\tau\_{\tau}(\mu,\lambda)} = (\mu - \lambda, \ \mu + \lambda - 1) \tag{4}
$$

or

Doing so, we can write paraconsistent equations on the lattice in which terminologies and conventions are established [5] around paraconsistent logical states attributed to proposition *P*. After the expansion actions with intensity 2, rotation of 45o with respect to the origin and

**Figure 3.** a) Unitary Square in the Cartesian Plane (USCP). (b) Lattice κ with another system of coordinates with values.

The first coordinate is a real number in the closed interval [-1,+1]. The x-axis is called "*axis of*

The second coordinate is a real number in the closed interval [-1,+1]. The y-axis is called

The second coordinate of the transformation (1) is called *Contradiction Degree* Dct.

The first coordinate of the transformation (1) is called *Certainty Degree* DC.

T(X,Y)=(*x* − *y*, *x* + *y* −1) (1)

DC =µ−λ (2)

Dct=µ+λ−1 (3)

translation along the vertical axis, the linear transformation is defined by:

According to the language of the PAL2v we have:

*x* = µ is the Favorable evidence Degree

36 Advances in Expert Systems

*the certainty degrees*".

*"axis of the contradiction degrees"*.

*y* = λ is the Unfavorable evidence Degree.

$$\mathcal{L}\_{\tau(\mu\lambda)} = \left(\mathbf{D}\_{\text{C}}, \mathbf{D}\_{\text{ct}}\right) \tag{5}$$

where: ετ is the Paraconsistent logical state.

DC is the Certainty Degree obtained from the evidence Degrees µ and λ.

Dct is the Contradiction Degree obtained from the evidence Degrees µ and λ.

Since the Paraconsistent logical state ετ can be anywhere in the lattice τ, the real Certainty Degree DCR can be obtained as follows: For DC >0 we compute:

$$\mathbf{D}\_{\rm CR} = \mathbf{l} - \sqrt{\mathbf{(l} - \left| \mathbf{D}\_{\rm C} \right|)^{2} + \mathbf{D}\_{\rm ct}^{\prime}} \tag{6}$$

For DC <0 we compute:

$$\mathbf{D}\_{\rm CR} = \sqrt{\mathbf{(l-|D\_{\rm C}|)}^2 + \mathbf{D}\_{\rm ct}{}^2} - \mathbf{l} \tag{7}$$

where: DC = *f* (µ,λ)and Dct= *f* (µ,λ)

For DC=0 we consider the undefined Paraconsistent logical state with: DCR *=*0.

We compute the resulting evidence Degree which expresses the intensity of the Paraconsis‐ tent logical state ετ by:

$$
\mu\_{\rm ER(\mu,\lambda)} = \frac{\mathcal{D}\_{\rm CR} + 1}{2} \tag{8}
$$

where:

µER(µ,λ)is the resulting evidence Degree in function of µ and λ.

DCRis the real Certainty Degree (6) or (7).

dence in relation to the proposition in analyses must be normalized and all the processing

Electric Power System Operation Decision Support by Expert System Built with Paraconsistent Annotated Logic

http://dx.doi.org/10.5772/51379

39

This process for modelling the evidence degrees with linear variation can be made in its

**Figure 5.** Graphical representation of the extraction of the Evidence Degree Algorithm - with characteristics of directly

max *Value* = .................... (9)

min *Value* = ...................... (10)

.......................... *ValueQuantities X* = (11)

*3.5.2. Algorithm for Modelling/extraction of Evidence Degrees (Inputs of the PAL2v Algorithm)*

*Obs: In real Physical System this value is obtained from measurements in sources of information.*

*3.5.2.1. Present the Maximum boundary-value to form the Discourse Universe.*

*3.5.2.2. Present the Minimum boundary-value to form the Discourse Universe.*

*3.5.2.3. Present the Value Measured of the Physical Quantities.*

simpler form with the algorithm that will be described in the next section [13-15].

will be done in real closed interval between 0 and 1 [9].

proportional variation.

**Figure 4.** Representation of a Paraconsistent Logical State in to Lattice.

#### **3.5. Algorithms of the Paraconsistent Logics**

With the considerations here presented we can compute values using the equations ob‐ tained from the analysis and interpretations of the paraconsistent logics PAL2v where a par‐ aconsistent analysis system receives information signals in the form of values of evidence degrees which vary from 0 to 1.

Through the algorithms, a paraconsistent analysis system can be built and it is capable of offering a satisfactory response from information extracted from the databank of uncertain knowledge. In this work we use 3 types of algorithms based on the PAL2v according to the following descriptions.

#### *3.5.1. Evidence Degree Extracting Algorithm*

The paraconsistent system for treatment of uncertainties may be used in many fields of knowledge where incomplete or contradictory information will receive an adequate treat‐ ment through the equations of the PAL2v. For this, the signals which will represent the evi‐ dence in relation to the proposition in analyses must be normalized and all the processing will be done in real closed interval between 0 and 1 [9].

This process for modelling the evidence degrees with linear variation can be made in its simpler form with the algorithm that will be described in the next section [13-15].

**Figure 5.** Graphical representation of the extraction of the Evidence Degree Algorithm - with characteristics of directly proportional variation.

*3.5.2. Algorithm for Modelling/extraction of Evidence Degrees (Inputs of the PAL2v Algorithm)*

*3.5.2.1. Present the Maximum boundary-value to form the Discourse Universe.*

$$Value\_{\text{max}} = \dots = \dots = \dots \dots \dots \tag{9}$$

*3.5.2.2. Present the Minimum boundary-value to form the Discourse Universe.*

$$Value\_{\text{min}} = \dots = \dots = \dots \dots \dots \tag{10}$$

*3.5.2.3. Present the Value Measured of the Physical Quantities.*

**Figure 4.** Representation of a Paraconsistent Logical State in to Lattice.

With the considerations here presented we can compute values using the equations ob‐ tained from the analysis and interpretations of the paraconsistent logics PAL2v where a par‐ aconsistent analysis system receives information signals in the form of values of evidence

Through the algorithms, a paraconsistent analysis system can be built and it is capable of offering a satisfactory response from information extracted from the databank of uncertain knowledge. In this work we use 3 types of algorithms based on the PAL2v according to the

The paraconsistent system for treatment of uncertainties may be used in many fields of knowledge where incomplete or contradictory information will receive an adequate treat‐ ment through the equations of the PAL2v. For this, the signals which will represent the evi‐

**3.5. Algorithms of the Paraconsistent Logics**

*3.5.1. Evidence Degree Extracting Algorithm*

degrees which vary from 0 to 1.

following descriptions.

38 Advances in Expert Systems

$$\text{Value}\_{\text{Quantities},X} = \dots = \dots = \dots \dots \dots \dots \tag{11}$$

*Obs: In real Physical System this value is obtained from measurements in sources of information.*

*3.5.2.4. Calculate the Favorable Evidence Degree μ through the equations:*

( ) [ ] min max min min max max min , 1 0 *Quantities X Quantities X <sup>x</sup> Quantities X Quantities X Value Value Value Value if Value Value Value if Value Value if Value Value* m ì <sup>ï</sup> - <sup>ï</sup> <sup>ï</sup> <sup>Î</sup> <sup>=</sup> <sup>í</sup> <sup>ï</sup> <sup>³</sup> <sup>ï</sup> <sup>ï</sup> £ <sup>î</sup> (12)

*3.5.2.5. Calculate the Unfavorable Evidence Degree λ by Complement of the Favorable Evidence Degree.*

$$
\lambda\_{(x)} = 1 - \mu\_{(x)} \tag{13}
$$

λ = unfavorable Evidence Degree, where: λ = 1 – µ<sup>2</sup>

µ2 is a favorable Evidence Degree of information source 2.

**Figure 6.** Finite Lattice of PAL2v and Symbol of the Paraconsistent Analyzer Node - PAN.

*4. Calculate the distance d of the Paraconsistent logical state into Lattice.*

*1. Enter with the input values.*

µ \*/ favorable evidence Degree 0 ≤ µ ≤ 1

*2. Calculate the Contradiction Degree.*

*3. Calculate the Certainty Degree.*

*5. Compute the output signal.*

λ \*/ unfavorable evidence Degree 0 ≤ λ ≤ 1

A lattice description uses the values obtained by the equation results in the Paraconsistent Analyzer Node Algorithm [3][13][14] that can be written in a reduced form, as follows:

Electric Power System Operation Decision Support by Expert System Built with Paraconsistent Annotated Logic

http://dx.doi.org/10.5772/51379

41

2 2

Dct=µ + λ−1 (14)

D<sup>C</sup> =µ−λ (15)

C ct *d* =- + (1 | D |) D (16)

*3.5.2.6. Provide the outputs.*

*For information source* 1: *Do*: *μ* =*μ*(*x*)

*For information source* 2: *Do*: *λ* =*λ*(*x*)

*3.5.2.7. End.*

Depending on the proposition to be analyzed and on the physical properties of the quanti‐ ties from which the evidences are extracted, the variation between the maximum and mini‐ mum values at the extraction of the evidence degrees can be different such as: linear and inversely proportional characteristic, exponential characteristic, logarithmic characteristic, etc. In these cases, the equations of item 3.5.2.4 are modified according to the mathematical equation of the variables which express the characteristic line or curves used in the dis‐ course universe.

#### *3.5.3. Algorithm of paraconsistent analysis*

The main PAL2v Algorithm used in paraconsistent analyses is the PAN- Paraconsistent An‐ alyzer Node. In an Intelligent system that works with Paraconsistent Logic some PANs are linked forming uncertainty analysis networks (PANnet) for signal information treatments [14][15][16].

#### *3.5.3.1. Paraconsistent Analysis Node - PAN*

The element capable of treating a signal that is composed of one degree of favorable evi‐ dence and another of unfavorable evidence (µ1a, µ2a), and provide in its output a Resulting Evidence Degree, is called basic Paraconsistent Analysis Node (PANb).

Figure 6(b) shows the representation of a PANb with two inputs of evidence degree:

µ1 = favorable Evidence Degree of information source 1.

λ = unfavorable Evidence Degree, where: λ = 1 – µ<sup>2</sup>

*3.5.2.4. Calculate the Favorable Evidence Degree μ through the equations:*

<sup>ï</sup> <sup>Î</sup> <sup>=</sup> <sup>í</sup> <sup>ï</sup> <sup>³</sup> <sup>ï</sup> <sup>ï</sup> £ <sup>î</sup>

*Quantities X <sup>x</sup>*

m

40 Advances in Expert Systems

*3.5.2.6. Provide the outputs.*

*3.5.2.7. End.*

course universe.

[14][15][16].

*For information source* 1: *Do*: *μ* =*μ*(*x*)

*For information source* 2: *Do*: *λ* =*λ*(*x*)

*3.5.3. Algorithm of paraconsistent analysis*

*3.5.3.1. Paraconsistent Analysis Node - PAN*

*Quantities X*

ì <sup>ï</sup> - <sup>ï</sup>

*Value Value Value Value*

1 0

( ) [ ]

*Quantities X Quantities X*

*3.5.2.5. Calculate the Unfavorable Evidence Degree λ by Complement of the Favorable Evidence Degree.*

Depending on the proposition to be analyzed and on the physical properties of the quanti‐ ties from which the evidences are extracted, the variation between the maximum and mini‐ mum values at the extraction of the evidence degrees can be different such as: linear and inversely proportional characteristic, exponential characteristic, logarithmic characteristic, etc. In these cases, the equations of item 3.5.2.4 are modified according to the mathematical equation of the variables which express the characteristic line or curves used in the dis‐

The main PAL2v Algorithm used in paraconsistent analyses is the PAN- Paraconsistent An‐ alyzer Node. In an Intelligent system that works with Paraconsistent Logic some PANs are linked forming uncertainty analysis networks (PANnet) for signal information treatments

The element capable of treating a signal that is composed of one degree of favorable evi‐ dence and another of unfavorable evidence (µ1a, µ2a), and provide in its output a Resulting

Figure 6(b) shows the representation of a PANb with two inputs of evidence degree:

Evidence Degree, is called basic Paraconsistent Analysis Node (PANb).

µ1 = favorable Evidence Degree of information source 1.

*if Value Value if Value Value*

min max

,

*λ*(*x*)=1−*μ*(*x*) (13)

(12)

 max min

*if Value Value Value*

 min max min

µ2 is a favorable Evidence Degree of information source 2.

**Figure 6.** Finite Lattice of PAL2v and Symbol of the Paraconsistent Analyzer Node - PAN.

A lattice description uses the values obtained by the equation results in the Paraconsistent Analyzer Node Algorithm [3][13][14] that can be written in a reduced form, as follows:

*1. Enter with the input values.*


$$\mathbf{D}\_{\rm ct} = \mu + \lambda - 1 \tag{14}$$

*3. Calculate the Certainty Degree.*

$$\mathbf{D}\_{\mathbb{C}} = \mu - \lambda \tag{15}$$

*4. Calculate the distance d of the Paraconsistent logical state into Lattice.*

$$d = \sqrt{\left(l - \left|\left|\mathbf{D\_C}\right|\right)^2 + \mathbf{D\_{ct}}\right.^2} \tag{16}$$

*5. Compute the output signal.*

If *d≥*1 Then do S1*=* 0.5: Indefinite logical state and go to the steep 10

Or else go to the next step

*6. Calculate the real Certainty Degree.*

$$\text{If } \begin{array}{c} \text{D}\_{\text{C}} > 0 \end{array} \text{ D}\_{\text{CR}} = (1 - d) \text{ \text{ } }$$

*If* DC< 0 DCR*=* (*d* – 1)

*7. Present the output.*

Do S1 = DCR

*8. Calculate the real Evidence Degree.*

$$
\sigma\_{\rm{ER}} = \frac{D\_{\rm{CR}} + 1}{2} \tag{17}
$$

**Figure 7.** Paraconsistent Algorithm Extractor of Contradiction effects (ParaExtrctr).

The description of the *ParaExtr ctr* Algorithm is shown to proceed.

Gµ= (µA, µB, µC,..., µn ) \*/Evidence Degrees 0 ≤ µ ≤ 1\*/

*6. Make the Paraconsistent analysis among the selected values:*

µR1 = µsel ◊ λsel \*/ where ◊ is a paraconsistent action of the PAN \*/

µmaxA= max (µA, µB, µC,..., µn )

µminA= min (µA, µB, µC,..., µn )

*Degree.*

µmaxA= µsel

*dence Degree.*

*Evidence Degree.*

1 – µminA= λsel

*1. Present n values of Evidence Degrees that it composes the group in study.*

*2. Select the largest value among the Evidence Degrees of the group in study.*

*3. Consider the largest value among the Evidence Degrees of the group in study in favorable Evidence*

Electric Power System Operation Decision Support by Expert System Built with Paraconsistent Annotated Logic

http://dx.doi.org/10.5772/51379

43

*4. Consider the smallest value among the Evidence Degrees of the group in study in favorable Evi‐*

*5. Transform the smallest value among the Evidence Degrees of the group in study in unfavorable*

*9. Present the output.*

Do S1 = µER and S2= Dct

*10. End.*

The Systems with the Paraconsistent Analysis Nodes (PAN) deal with the received signals through algorithms, and present the signals with a real evidence Degree value in the output [3].
