scieee AI-readable full text Open interactive document viewer

Fuzzy automata as coalgebras

Liu, Ai; Wang, Shun; Barbosa, L. S.; Sun, Meng

Abstract

The coalgebraic method is of great significance to research in process algebra, modal logic, object-oriented design and component-based software engineering. In recent years, fuzzy control has been widely used in many fields, such as handwriting recognition and the control of robots or air conditioners. It is then an interesting topic to analyze the behavior of fuzzy automata from a coalgebraic point of view. This paper models different types of fuzzy automata as coalgebras with a monad structure capturing fuzzy behavior. Based on the coalgebraic models, we can define a notion of fuzzy language and consider several versions of bisimulation for fuzzy automata. A group of combinators is defined to compose fuzzy automata of two branches: state transition and output function. A case study illustrates the coalgebraic models proposed and their composition.

Full text

mathematics Article Fuzzy Automata as Coalgebras Ai Liu 1, Shun Wang 2, Luis Soares Barbosa 3and Meng Sun 2,*   Citation: Liu, A.; Wang, S.; Barbosa, L.S.; Sun, M. Fuzzy Automata as Coalgebras. Mathematics 2021,9, 272. https://doi.org/10.3390/math9030272 Academic Editor: Tadashi Dohi Received: 17 December 2020 Accepted: 25 January 2021 Published: 29 January 2021 Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. Copyright: © 2021 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/). 1Graduate School of Advanced Science and Engineering, Hiroshima University, Hiroshima 739-8511, Japan; [email protected] 2School of Mathematical Sciences, Peking University, Beijing 100871, China; [email protected] 3INL (International Iberian Nanotechnology Laboratory) & INESC TEC, Universidade do Minho, 4704-553 Braga, Portugal; [email protected] *Correspondence: [email protected] Abstract: The coalgebraic method is of great significance to research in process algebra, modal logic, object-oriented design and component-based software engineering. In recent years, fuzzy control has been widely used in many fields, such as handwriting recognition and the control of robots or air conditioners. It is then an interesting topic to analyze the behavior of fuzzy automata from a coalgebraic point of view. This paper models different types of fuzzy automata as coalgebras with a monad structure capturing fuzzy behavior. Based on the coalgebraic models, we can define a notion of fuzzy language and consider several versions of bisimulation for fuzzy automata. A group of combinators is defined to compose fuzzy automata of two branches: state transition and output function. A case study illustrates the coalgebraic models proposed and their composition. Keywords: fuzzy automata; coalgebra; fuzzy language; bisimulation; composition 1. Introduction Control logic plays an important role in component-based programming in deciding a run-time mechanisms and rules of composition. Precise control needs meticulous implementation so that many applications may be expensive and inefficient. To tackle this problem, there is an increasing interest in using fuzzy logic in many new areas. As a very efficient method for handling imprecise properties, fuzzy logic then provides a systematic approach to incorporating approximate reasoning into such systems so that fuzzy implementations are not only cheaper and faster than precise ones, but also more understandable for users [ 1 , 2 ]. Therefore, some devices that profit from the use of vagueness in their overall operation have emerged and the related theory is described in [3]. For instance, the fuzzy principal component analysis method, based on the variance contribution rate of the principal component combined with the fuzzy theory to obtain a reasonable correction weight, is used to refine quantitative and qualitative index data of innovation service capability [ 4 ]. Moreover, this approach makes sense not only at the control level, but also at the test level [5]. Fuzzy control systems incorporate a number of components driven by fuzzy logic [ 6 ]. Most of them are rule-based systems that exchange information through interfaces. Technically, the modeling approach of fuzzy control systems contains three aspects: an input stage, a processing stage and an output stage, whose details are as follows. • The input stage transforms an input into a value. The method is to abstract the relation of an input and its corresponding vague value into a point in a coordinate system, where the horizontal axis stands for the input domain and the vertical axis stands for the vagueness domain. • The processing stage involves inference rules and generates a result for each input, and then combines the results of the rule. In this stage, logical inference rules are used to describe the connection between cause and effect. The rules are of the form Mathematics 2021,9, 272. https://doi.org/10.3390/math9030272 https://www.mdpi.com/journal/mathematics Mathematics 2021,9, 272 2 of 21 If hconditionithen hconclusioni. Such rules provide information for the decision of control variables. • The output stage processes the combined results from the processing stage and converts them to a specific control value. For instance, common techniques for conversion process includes max-min inference, max-membership principle and mean-max membership. Automata theory has a long history in modeling systems and applications which can be realized as a set of states and transitions between them depending on some inputs. Fuzzy finite-state automata (FFA) incorporate fuzziness into the internal state representation and output of these computational systems [ 7 ]. Depending on the non-fuzzy output labels associated with (final) states or transitions, there are different classes of FFA: FFA with final states, FFA without final states, Fuzzy Moore FA and Fuzzy Mealy FA [ 8 ]. There are also works considering fuzzy output maps, such as fuzzy Mealy machines and fuzzy Moore machines [ 9 , 10 ]. Fuzzy automata have been studied from different aspects. In order to study behavior control, a novel method to compute the membership values of the next states of a fuzzy automaton with an averaging function between the membership value of the input, and the membership value of the current state is proposed in [ 11 ]; the behaviors of lattice-valued nondeterministic fuzzy automata are compared through two language equivalence relations which have different discriminating power in [ 12 ]. Categories of deterministic fuzzy automata and fuzzy languages based on a complete residuated lattice with zero divisors are introduced in [ 13 ], a common framework for fuzzy type automata is developed in relationships with morphisms of monads in [ 14 ], and the concept of fuzzy regular language accepted by fuzzy finite automata is purposed in [ 15 ]. Describing systems that behave in the same way in the sense that one system simulates the other and vice versa, several notions of (approximate) bismulation relations are investigated in [16–18]. Along the past two decades, coalgebra has emerged as a well established general framework for the study of the behavior of various kinds of automata [19–21]. There is in particular a generalized determinization construction from automata to coalgebras, including partial Mealy machines, (structured) Moore automata, Rabin probabilistic automata, and pushdown automata [ 22 ]. A survey and hierarchy of probabilistic systems as coalgebras is discussed in [ 23 ]. It connects probabilistic verification with coalgebraic modeling and compares expressiveness of system types by natural transformations between functors. Hybrid automata specifying both discrete and continuous behavior can also be modeled as coalgebras [ 24 ]. A coalgebraic perspective supporting a generic theory of hybrid automata with a rich palette of definitions and results is studied in [ 25 ]. In addition, a coalgebraic semantics framework for quantum systems is developed in [ 26 ]. One obvious advantage of the coalgebraic view is that it induces a simple and intuitive notion of bisimulation between coalgebras, a notion originally stemming from the world of labeled transition systems and process algebra [ 27 – 29 ]. Witnessed by the notion of coalgebra homomorphism, bisimulation on coalgebras can be defined by commutative diagrams and shown to be formally dual to congruence on algebra [30,31]. Moreover, there is a general framework for the study of components as concrete coalgebras and the development of the corresponding calculi [ 32 ]. A recent thesis [ 33 ] proposes a coalgebraic approach to fuzzy automata, which obtains the following results: (a) a coalgebraic definition of the fuzzy language recognized by a fuzzy automaton, (b) the definition of a functor describing the determinization process of a fuzzy automata via a generalization of the powerset construction, (c) a coalgebraic definition of bisimulation on fuzzy automata allowing the construction of a quotient fuzzy automaton. However, it only considers the output as the current membership value for the current state. Moreover, a coalgebraic theory of fuzzy transition systems and their concrete fuzzy bisimulation is studied in [ 34 ]. The authors resort to relational lifting that is one of the most used methods in bisimulation research, leading to an algorithm for testing bisimulation in [ 35 ], and group-by-group fuzzy bisimulation and its corresponding modal logic in [ 36 ]. Nevertheless, the output stage is omitted. To consider different types of fuzzy automata, our main contributions are as follows: Mathematics 2021,9, 272 3 of 21 • Explore the fuzzy-set monad to serve as the basis to a coalgebraic approach; • Provide a coalgebraic framework for different types of fuzzy automata, where the notions of fuzzy language and bisimulation can be addressed; • Define appropriate combinators for composing fuzzy automata from two branches:state transition and output function. Thus, we not only consider fuzzy language respecting the controlling behavior and bisimulation relations for fuzzy automata, but also study the composition mechanism in our coalgebraic framework. This paper is structured as follows. Section 2introduces different types of fuzzy automata. Section 3recalls the definition of the fuzzy-set monad and studies its properties. Section 4defines the coalgebraic models for fuzzy automata, the notion of fuzzy language and considers several versions of bisimulation. Section 5develops a series of combinators for composing fuzzy automata. Section 6discusses a case study. Section 7concludes and raises some topics for future work. 2. Fuzzy Automata In a complex controlled system driven by fuzzy logic, a fuzzy automaton is the basic unit which contains fuzzy processors and input/output interfaces. Considering fuzzy output maps, we focus on three types of fuzzy automata: Fuzzy Moore Automata (FMrA), Fuzzy Mealy Automata (FMlA) and Fuzzy Unified Automata (FUA). FMrA and FMlA are obtained by modifying the definitions of fuzzy Moore machine and fuzzy Mealy machine in [ 8 ]. Unlike the definition of fuzzy Mealy machine in [ 8 ] requiring two functions, one to describe the next state and the other to describe the output, a fuzzy Mealy machine is equipped with one fuzzy function to characterize completely the next state and the output produced in [ 9 ]. For distinction between them, we name the latter one as FUA. For simplicity, initial and final states are ignored for the moment. Definition 1 (Fuzzy Moore Automata (FMrA)) . A fuzzy Moore automaton is a 5-tuple p= (X,I,O,α,e)where •X is a set of states. •I is a set of input symbols. •O is a set of output symbols. •α:X×I→[0, 1]Xis a fuzzy transition function. •e:X→[0, 1]Ois a fuzzy output function. Note that each non-fuzzy output map e0:X→O corresponds to a function e:X→[ 0, 1 ]O such that e(x) = δe0(x), where δk(t) = δ(t−k)and δis the Dirac function. Definition 2 (Fuzzy Mealy Automata (FMlA)) . A fuzzy Mealy automaton is a 5-tuple p= (X,I,O,α,e)where •X,I,O,α:X×I→[0, 1]Xare defined as in FMrA. •e:X×I→[0, 1]Ois a fuzzy input-output function. Note that each non-fuzzy output map e0:X×I→O corresponds to a fuzzy input-output function e:X×I→[0, 1]Owhere e(x,i) = δe0(x,i). Given an FMrA (X , I , O , α , e) , it is easy to construct an FMlA (X , I , O , α , e0) where e0(x , i) = e(x) without loss of information, so we regard it as a subcase of FMlA and concentrate on the study of FMlA as coalgebras. Definition 3 (Fuzzy Unified Automata (FUA)) . A fuzzy unified automaton is a 4-tuple p= (X,I,O,β)where •X,I,O are defined as in FMrA. •β:X×I→[0, 1]X×Ois a fuzzy input-transition-output function. Mathematics 2021,9, 272 4 of 21 In classical methods, two operations F1:[ 0, 1 ]×[ 0, 1 ]→[ 0, 1 ] and F2:[ 0, 1 ]∗→ [ 0, 1 ] should be defined to to define the language accepted by an automaton [ 7 ]. Instead, we intend to define the notion of fuzzy language with the aid of the fuzzy-set monad. 3. Fuzzy-Set Monad 3.1. Fuzzy Set The fuzzy set theory [ 37 ] was developed by Lotfi A. Zadeh in 1965. The main purpose of using fuzzy sets is to deal with vague data under some given properties. For example, consider a finite set of real numbers S⊆R and the property “close to 0”. This property seems ambiguous because there is not an explicit criterion to judge whether objects are closed to 0. We want to ask within what distance we can say “one real number is close to 0”. To make it precise, the one should figure out a function which fits the property. For example, ψS(x) = max{0, 1 −1 m|x|},x∈[−m,m] where m=maxs∈S|s| . This function is called the membership function and indicates that the closer the data s∈S is to 0, the closer the membership value ψS(s) is to 0. Obviouly, data from which the distance to 0 are equal have the same membership value, i.e., ψS(s) = ψS(−s) . However, the selection of membership function is not unique and usually depends on the goal of application. Definition 4 (Residuated Lattice [ 33 ]) . A residuated lattice is an algebra K= (K , ∧ , ∨ , ⊗ , → , 0, 1)with four binary and two nullary operations satisfying: 1(K , ∧ , ∨ , 0, 1 ) is a lattice with the partial order ≤ which is defined by “ x≤y if and only if x∨y=y”. The greatest (least) element is 1(0) that for all x ∈K, x ≤1(x ≥0); 2(K,⊗, 1)is a commutative monoid with the unit element 1; 3 For x,y,z∈K, x ≤y→z if and only if x ⊗y≤z. Especially, if (K , ∧ , ∨ , 0, 1 ) is a complete lattice, then K is called a complete residuated lattice. Residuated lattices are the algebraic structure that characterizes fuzzy components. Example 1. The Boolean algebra (2 , ∧ , ∨ , ¬) is a residuated lattice (2 , ∧0 , ∨0 , ⊗0 , →0 , 0, 1 ) . In this expression, 2={ 0, 1 } is the set of elements. ∧0 , ∨0 correspond to ∧ and ∨ operations in Boolean algebra, respectively. Multiplication ⊗0 is defined as ∧ . The residuate operation →0 comes as x →0y:=¬x∨y. Definition 5 (Fuzzy Subset [ 33 ]) . Given a set X , a fuzzy subset over K of X is a function φ:X→K that assigns to each object x∈X a membership value. The set of all fuzzy subsets of X is denoted by ZK(X) and obviously ZK(X) = KX . In the sequel, we use the shorthand notation Z(X)to represent ZK(X). Note that Zcan be interpreted as an endofunctor on Set where Z(f):KX→KY κ7→ λy._ x∈f−1(y) κ(x) for any f:X→Y. Note that _ x∈X κ(x) = ∨{κ(x)|x∈X}. Mathematics 2021,9, 272 5 of 21 3.2. Properties of Fuzzy-Set Monad The fuzzy-set monad on Set is defined in [ 33 ]. In this section, we will firstly recall the definition and then prove this monad is strong and commutative. Although every monad in Set is strong, we include the explicit contribution to build up intuitions. Definition 6 (The fuzzy-set Monad [ 33 ]) . Fuzzy-set monad Z= (Z , η , µ) over K= (K , ∧ , ∨ , ⊗ , →, 0, 1)satisfies for a set X •η:Id ⇒Zsatisfies that ηX(x)(y) = (1x=y 0otherwise,x,y∈X, •µ:Z2⇒Zsatisfies that µX(Φ) = [ ψ∈Z(X) Φ(ψ)~ψ,Φ∈Z2(X). where ([ i∈I φi)(x) = _ i∈I φi(x)x∈X,φi∈Z(X) and (a~φ)(x) = a⊗φ(x)a∈K,x∈X,φ∈Z(X) Definition 7 (Strong monad [ 21 ]) . A strong monad is a monad T= (T , η , µ) equipped with a left tensorial strength σX,Y:T(X)×Y→T(X×Y) that commutes with the unit and multiplication of the monad: X×Y X ×Y T(X)×Y T(X×Y) id ηX×id ηX×Y σX,Y T2(X)×YT(T(X)×Y)T2(X×Y) T(X)×Y T(X×Y) σT(X),YT(σX,Y) µX×id µX×Y σX,Y Theorem 1. The triple Z= (Z,η,µ)is a strong monad. Proof. Firstly, define a left tensorial strength with components σX,Y:Z(X)×Y→ Z(X×Y)as σX,Y(ψ,y) = λx,λy0.(ψ(x)⊗ηY(y)(y0)) that commute appropriately with trivial projection and associativity isomorphisms for f:X→Zand g:Y→W: Z(X)×1Z(X×1) Z(X) Z(X)×YZ(X×Y) Z(Z)×WZ(Z×W) σX,1 Zπ1 π1 σX,Y Z(f)×gZ(f×g) σZ,W Mathematics 2021,9, 272 6 of 21 (Z(X)×Y)×ZZ(X×Y)×ZZ((X×Y)×Z) Z(X)×(Y×Z)Z(X×(Y×Z)) σX,Y×id σX×Y,Z ∼ =∼ = σX,Y×Z For the unit, σX,Y·(ηX×id)(x,y) ={Definition of ×} σX,Y(ηX(x),y) ={Definition of σ} ⊗ ·(ηX(x)×ηY(y)) ={Definition of η} ηX×Y(x,y). For the multiplication, we have to show that µX×Y·Z(σX,Y)·σZK(X),Y=σX,Y·(µX×id) . For a pair (Φ,y)∈Z2(X)×Y, µX×Y·Z(σX,Y)·σZ(X),Y(Φ,y) ={Definition of σ} µX×Y·Z(σX,Y)(⊗ · (Φ×ηY(y))) ={Definition of Z,σ} µX×Y([ (ψ,y0)∈Z(X)×Y ⊗ · (Φ×ηY(y))(ψ,y0)~ηZ(X×Y)(σX,Y(ψ,y0))) ={⊗ · (f×g)(x,y) = f(x)⊗g(y)} µX×Y([ (ψ,y0)∈Z(X)×Y (Φ(ψ)⊗ηY(y)(y0)) ~ηZ(X×Y)(σX,Y(ψ,y0))) ={Definition of η} µX×Y([ ψ∈Z(X) Φ(ψ)~ηZ(X×Y)(σX,Y(ψ,y))) ={Definition of σ} µX×Y([ ψ∈Z(X) Φ(ψ)~ηZ(X×Y)(⊗ · (ψ×ηY(y)))) ={Definition of µ} [ ψ0∈Z(X×Y) ([ ψ∈Z(X) Φ(ψ)~ηZ(X×Y)(⊗ · (ψ×ηY(y)))(ψ0)) ~ψ0 ={Definition of η} [ ψ∈Z(X) Φ(ψ)~(⊗ · (ψ×ηY(y)) Mathematics 2021,9, 272 7 of 21 For the right side of the equation, σX,Y·(µX×id)(Φ,y) ={Definition of µ} σX,Y([ ψ∈Z(X) Φ(ψ)~ψ,y) ={Definition of σ} ⊗ ·(( [ ψ∈Z(X) Φ(ψ)~ψ)×ηY(y)) ={Distributive law: ⊗ · (∪ifi×g) = ∪i(⊗ · (fi×g)) } [ ψ∈Z(X) ⊗ · (Φ(ψ)~ψ×ηY(y)) ={Constant Φ(ψ)} [ ψ∈Z(X) Φ(ψ)~(⊗ · (ψ×ηY(y)). In the proof of Theorem 1, we defined a left tensorial strength σ with components σX,Y:Z(X)×Y→Z(X×Y)as σX,Y(ψ,y) = ⊗ · (ψ,ηY(y)) = λx,λy0.(ψ(x)⊗ηY(y)(y0)). Of course, a “swapped” tensorial strength σ0 with components σ0 X,Y:X×Z(Y)→ Z(X×Y) can be obtained by applying swapping operation from the left tensorial strength: (X×Z(Y)s −−→ ∼ = Z(Y)×XσY,X −−→ Z(Y×X)Z(s) −−−→ ∼ = Z(X×Y)). where sb=hπ2,π1iis product communicating. Formally, σ0 X,Y=⊗ · (ηX(x)×φ) = λx0.λy.(ηX(x)(x0)⊗φ(y)). With both σX,Y and σ0 X,Y , there are two ways to obtain Z(X)×Z(Y)→Z(X×Y) , as depicted in the following diagram. If the diagram commutes, then Z is commutative with left and right strength natural transformations σX,Y , σ0 X,Y . We use γ:Z(X)×Z(Y)→ Z(X×Y)to denote the composed arrow. Z(X)×Z(Y) Z(X×Z(Y)) Z2(X×Y) Z(X×Y) Z(Z(X)×Y)Z2(X×Y) σX,Z(Y) Z(σ0 X,Y) µX×Y σ0 Z(X),Y Z(σX,Y) µX×Y Theorem 2. The triple (Z,η,µ)is a commutative monad. Mathematics 2021,9, 272 8 of 21 Proof. To show the diagram is commutative, select a pair of membership functions (ψ1,ψ2)∈Z(X)×Z(Y), then µX×Y·Z(σ0 X,Y)·σX,Z(Y)(ψ1,ψ2) ={Definition of σ} µX×Y(Z(σ0 X,Y)(⊗ · (ψ1×ηZ(Y)(ψ2)))) ={Definition of Z} µX×Y([ (x,ψ)∈X×Z(Y) ⊗ · (ψ1×ηZ(Y)(ψ2))(x,ψ)~ηZ(X×Y)(σ0 X,Y(x,ψ))) ={ ⊗ · (f×g)(x,y) = f(x)⊗g(y)} µX×Y([ (x,ψ)∈X×Z(Y) (ψ1(x)⊗ηZ(Y)(ψ2)(ψ)) ~ηZ(X×Y)(σ0 X,Y(x,ψ))) ={Definition of η} µX×Y([ x∈X ψ1(x)~ηZ(X×Y)(σ0 X,Y(x,ψ2))) ={Definition of σ0} µX×Y([ x∈X ψ1(x)~ηZ(X×Y)(⊗ · (ηX(x)×ψ2))) ={Definition of µ} [ ψ0∈Z(X×Y) ([ x∈X ψ1(x)~ηZ(X×Y)(⊗ · (ηX(x)×ψ2))(ψ0)~ψ0) ={Definition of η} [ x∈X (ψ1(x)~(⊗ · (ηX(x)×ψ2))) b={Denotation } f1 For the right side of the equation, µX×Y·Z(σX,Y)·σ0 Z(X),Y(ψ1,ψ2) ={Definition of σ} µX×Y(Z(σX,Y)(⊗ · (ηZ(X)(ψ1)×ψ2))) ={Definition of Z} µX×Y([ (ψ,y)∈Z(X)×Y ⊗ · (ηZ(X)(ψ1)×ψ2)(ψ,y)~ηZ(X×Y)(σX,Y(ψ,y))) ={ ⊗ · (f×g)(x,y) = f(x)⊗g(y)} µX×Y([ (ψ,y)∈Z(X)×Y (ηZ(X)(ψ1)(ψ)⊗ψ2(y)) ~ηZ(X×Y)(σX,Y(ψ,y))) ={Definition of η} µX×Y([ y∈Y ψ2(y)⊗ηZ(X×Y)(σX,Y(ψ1,y))) ={Definition of σ} Mathematics 2021,9, 272 9 of 21 µX×Y([ y∈Y ψ2(y)~ηZ(X×Y)(⊗ · (ψ1×ηY(y)))) ={Definition of µ} [ ψ0∈Z(X×Y) ([ y∈Y ψ2(y)~ηZ(X×Y)(⊗ · (ψ1×ηY(y)))(ψ0)~ψ0) ={Definition of η} [ y∈Y (ψ2(y)~(⊗ · (ψ1×ηY(y)))) b={Denotation } f2 Note that f1(x , y) = ψ1(x)⊗ψ2(y) = ⊗ · (ψ1×ψ2)(x , y) = f2(x , y) . Hence the diagram commutes. 4. Going Coalgebraic 4.1. Coalgebraic Models Since the automata introduced in Section 2are defined over the interval [ 0, 1 ] , we assume the fuzzy-set monad Z= (Z , η , µ) is also defined over some complete residuated lattice ([ 0, 1 ] , min , max , ⊗ , → , 0, 1 ) . The corresponding coalgebraic models are based on the fuzzy-set monad. Example 2 ([ 33 ]) . Note that ([ 0, 1 ] , min , max , 0, 1 ) is a complete lattice. Then there are several ways to construct complete residuated lattices ([0, 1],min,max,⊗,→, 0, 1); namely •Define x⊗y=max(x+y−1, 0) x→y=min(1−x+y, 1) for x , y∈[ 0, 1 ] . Then, ([ 0, 1 ] , min , max , ⊗ , → , 0, 1 ) is a complete residuated lattice corresponding to the standard Lukasiewicz algebra. •Define x⊗y=min(x+y−1, 0) x→y(1if x ≤y y if y <x for x , y∈[ 0, 1 ] . Then, ([ 0, 1 ] , min , max , ⊗ , → , 0, 1 ) is a complete residuated lattice corresponding to the standard G¨ odel algebra. •Define x⊗y=x·y x→y(1if x ≤y y xif y <x for x , y∈[ 0, 1 ] . Then, ([ 0, 1 ] , min , max , ⊗ , → , 0, 1 ) is a complete residuated lattice corresponding to the standard product algebra. Consider the two functors FI,O=Z(− × O)I and Tl,O=Z(−)I×Z(O)I . Given a FMlA (X , I , O , α , e) , the corresponding TI,O -coalgebra is (X , hα , ei:X→Z(X)I×Z(O)I) where f is the curried version of f . Given a FUA (X , I , O , β) , the corresponding FI,O - coalgebra is (X , β:X→Z(X×O)I) . Obviously, there is a natural transformation θ from TI,Oto FI,O: θ(hf,gi)(i) = γ(hf(i),g(i)i) Mathematics 2021,9, 272 16 of 21 Theorem 7. For appropriately typed FMlA p,q,r, pq∼(qp){s,s} pq∼qp{s+,s+} pq∼qp{s++s,s++s} (pq)r∼p(qr){a,a−1} (pq)r∼p(qr){a+,a−1 +} (pq)r∼p(qr){a∗,a−1 ∗} where a∗ is a natural isomorphism from (AB)C to A(BC) and its inverse is denoted by a−1 ∗. Proof. Similar to Theorem 6. The two theorems demonstrate that our combinators are well defined. In the sequel, we compare them with the ones in [ 32 ] up to the natural transformation θ through a theorem and an example. Theorem 8. Given two FMlA p , q with the corresponding coalgebras in (?) , the following equations holds. θ(hαpq,epqi) = θ(hαp,epi)θ(hαq,eqi) θ(hαpq,epqi) = θ(hαp,epi)θ(hαq,eqi) θ(hαpq,epqi) = θ(hαp,epi)θ(hαq,eqi) where  ,  ,  correspond to our combinators in the left side and the ones for composing FI,O - coalgebras in [32] in the right side. Proof. The proof proceeds by pointwise induction. For the first law, if we assume αp(x1,i)(x0 1) = k1,ep(x1,i)(j) = t1 αq(x2,j)(x0 2) = k2,eq(x2,j)(o) = t2 we obtain θ(hαpq,epqi)((x1,x2),i)((x0 1,x0 2),o) =αpq((x1,x2),i)(x0 1,x0 2)⊗epq((x1,x2),i)(o) =(k1⊗k2)⊗(t1⊗t2) =(k1⊗t1)⊗(k2⊗t2) =θ(hαp,epi)(x1,i)(x0 1,o)⊗θ(hαq,eqi)(x2,i)(x0 2,o) =θ(hαp,epi)θ(hαq,eqi) Other laws can be proved similarly. Note that the case for the sequential composition combinator does not always hold. Actually, this depends on the complete residuated lattice used, since the state transition of the first component is considered twice, which can be demonstrated by the following example. Example 6. Recall the standard product algebra in Example 2. Consider two FMlA p= ({x1 , x2} , {a} , {b} , αp , ep) and r= ({y1 , y2} , {b} , {c} , αr , er) where αp(x1 , a)(x2) = 0.4, ep(x1 , a)(b) = 0.5 and αr(y1 , b)(y2) = 0.8, er(y1 , b)(c) = 0.5. Then we can obtain Jp ; rK= (U , hαp;r , ep;ri) where U={(xi , yj)|i , j= 1, 2 } , αp;r((x1 , y1) , a)(x2 , y2) = 0.4 × 0.5 × 0.8 = 0.16 and ep;r((x1,y1),a)(c) = 0.5 ×0.5 =0.25. Therefore θ(hαp;r,ep;ri)((x1,y1),a)((x2,y2),c) = 0.16 ×0.25 =0.04. Mathematics 2021,9, 272 17 of 21 However, θ(hαp , epi)(x1 , a)(x2 , b) = 0.4 × 0.5 = 0.2 and θ(hαr , eri)(x1 , a)(x2 , b) = 0.8 ×0.5 =0.4. Thus, θ(hαp,epi);θ(hαr,eri)((x1,y1),a)((x2,y2),c) = 0.2 ×0.4 =0.08. Oppositely, if we consider the standard G¨ odel algebra, the two values will be both 0.4. 6. Case Study In the sequel, we illustrate the use of fuzzy components by means of a concrete example. For simplicity, we consider an non-fuzzy input-output function and compose components with FI,O-coalgebras. Consider the following example of a steam turbine. II0 × p∆×∆q  pidqTemp pidqPress   (I I)×(I0I0) × (I[0, 1])×(I0[0, 1])× pmq (II0) ×([0, 1] [0, 1])×  pΨ1qpΨ2q (O[0, 1])× Setting (Defuzzification Process) [MIN,MAX] The system is composed of two fuzzification components Temp , Press and a defuzzification component Setting with corresponding membership functions illustrated in Figure 1 . Note that ∆represents the copy operation. (a)Temp (b)Press (c)Setting Figure 1. The graphs of membership functions. In practice, the components Temp and Press execute in parallel. Each one will produce a membership value corresponding to the state and membership function after receiving a Mathematics 2021,9, 272 18 of 21 mode signal. After that, the minimum of the two output values will become the input of Setting . The membership function of the Setting component is determined by the following rules (for simplicity, only whose conditions with temperature COOL are displayed). rule 1 :If temperature is COOL and pressure is WEAK then throttle is P3. rule 2 :If temperature is COOL and pressure is LOW then throttle is P2. rule 3 :If temperature is COOL and pressure is OK then throttle is Z. rule 4 :If temperature is COOL and pressure is STRONG then throttle is N2. rule 5 :If temperature is COOL and pressure is HIGH then throttle is N3. · · · The output functions are considered as non-fuzzy in this example. (i) The coalgebraic semantic of component Temp JTempK= (T,θhαt,eti):T→Z(T×[0, 1])I) is actually an FI,[0,1] -coalgebra. In this model, states are the temperature over T= [T0,T9] , inputs are operation modes over set I = { COLD,COOL,NORMAL,WARM,HOT } that are decided by users. The fuzzy transition function is constant on the temperature and given by αt:T×I→[0, 1]Twith ht,COLDi 7→ φCOL,ht,COOLi 7→ φCOO,ht,NORMALi 7→ φNOR,ht,WARMi 7→ φWAR,ht,HOTi 7→ φHOT for all t∈[T0 , T9]⊆R . The output function et:T×I→[ 0, 1 ] is defined by (t , i)7→ eval(αt(t , i) , t) where eval is an evaluation function. As a concrete example, suppose the fuzzy subset for the NORMAL mode is the function φNOR(t) = max{0, 2 T3−T6 (t−T3+T6 2) + 1}. Then the membership value (output) over state T3+T6 2 under the mode NORMAL is et(T3+T6 2,NORMAL) = eval(φNOR,T3+T6 2) = 1. (ii) Press is a component whose state space P is given by the pressure in the steam turbine and inputs are over the set I0={WEAK,LOW,OK,STRONG,HIGH} , which represent the mode triggered by the users. The output of this component is the membership value corresponding to the current fuzzy state. The dynamics of this component is JPressK= (P,θhαp,epi):P→Z(P×[0, 1])I0) with the transition and output functions defined as αp:P×I0→Z(P): hp,WEAKi 7→ φWEAK,hp,LOWi 7→ φLOW ,hp,OKi 7→ φOK,hp,STRONGi 7→ φSTRONG,hp,HIGHi 7→ φHIGH for p∈Pand op:P×I0→[0, 1]:(p,i0)7→ ev(αp(p,i0),p). (iii) The dynamics of Rule and And components are denoted by pΨ1qand pΨ2qwhere pΨ1q= (1,η(1×O)· hid,Ψ1i:1→Z(1×O)I×I0). In this expression Ois the output set determined by the output function, namely, Ψ1:1×(I×I0)→O Mathematics 2021,9, 272 19 of 21 Ψ1(?,(i,i0)) =                      P3 i=COOL ∧i0=WEAK P2 i0=COOL ∧LOW Zi0=COOL ∧OK N2 i0=COOL ∧STRONG N3 i0=COOL ∧HIGH · · · 1={∗} is the singleton set. The notation pfq is the representation of function f:A→B , which is defined as a coalgebra pfq= (∗ ∈ 1 , cpfq) , where cpfq= 1×Aid×f −−→ 1×Bη(1×B) −−−→ Z(1×B) . The definition of Ψ2 is similar, given a pair of inputs of [0, 1], it outputs the minimum value of the two. (iv) The last component Setting works as follows. Through the channel it interacts with Temp and Press . It receives the mode information and a membership value as the current state. The mode information determines which membership function is accessible for the component. Then the component outputs an area whose boundary consists of the horizontal axis and the graph of the membership function. Formally, this model is represented by a coalgebra JSettingK= (D,θhαs,esi):D→Z(D×P(R2))O×[0,1]) where D= [MIN , MAX] is an interval of real numbers. The output function is defined as es(d , (o , r)) = {(x , y)| 0 ≤y≤min{αs(x , (o , r)) , r} , x∈[MIN , MAX]} . Resorting to centroid defuzzification technique, the output stage processes combine areas and produce a control value, which will participate in the control of the system. 7. Conclusions and Future Work The present work aims at addressing fuzzy automata from a coalgebraic perspective. Our starting point was studying the fuzzy-set monad further. We defined a left tensorial strength and a right tensorial strength, and proved it is a strong and commutative monad. With these properties, we modeled different types of fuzzy automata as coalgebraic models with the same transition structure. Based on these coalgebraic models, we defined the notions of fuzzy language bisimulation between fuzzy automata. Moreover, we developed some compositional combinators for fuzzy Mealy automata of two kinds: state transition and output function and compared it with the classical component calculi in [ 32 ]. Finally, through a case study, we discussed the application of our component calculi. Besides these fundamental results, there are several topics left to explore. One is to define a notion of refinement [ 38 ] of fuzzy automata, to specify an inclusion relation of fuzzy behaviour. Fuzzy automata may involve complex behaviour such as non-deterministic transitions or branched transitions with probability [ 23 , 39 ]. Therefore another topic for future work is to develop more complex versions of fuzzy automata and analyze their behavior and discuss their properties, namely of the suitable notions of bisimulation as in [15,35,36]. Author Contributions: Conceptualization, M.S. and L.S.B.; methodology, A.L. and S.W.; formal analysis, A.L. and S.W.; investigation, A.L.; writing—original draft preparation, A.L. and S.W.; writing—review and editing, M.S. and L.S.B. All authors have read and agreed to the published version of the manuscript. Funding: This work has been supported by the Guangdong Science and Technology Department (Grant No. 2018B010107004) and the National Natural Science Foundation of China under grant No. 61772038, 61532019 and 61272160. L.S.B. was supported by the ERDF—European Regional Development Fund through the Operational Programme for Competitiveness and InternationalisationCOMPETE 2020 Programme and by National Funds through the Portuguese funding agency, FCT, within project KLEE - POCI-01-0145-FEDER-030947. Mathematics 2021,9, 272 20 of 21 Institutional Review Board Statement: Not applicable. Informed Consent Statement: Not applicable. Data Availability Statement: Not applicable. Acknowledgments: This work is also supported by Hiroshima University. Many thanks to the reviewers and editors. Conflicts of Interest: The authors declare no conflict of interest. References 1. Tanaka, K. An Introduction to Fuzzy Logic for Practical Applications; Springer: Berlin/Heidelberg, Germany, 1997. 2. Zadeh, L.A. Soft Computing and Fuzzy Logic. IEEE Softw. 1994,11, 48–56. [CrossRef] 3. Syropoulos, A.; Grammenos, T. Fuzzy Computation; A Modern Introduction to Fuzzy Mathematics; John Wiley & Sons: Hoboken, NJ, USA, 2020; pp. 191–214. [CrossRef] 4. Wu, H.; Gu, X.; Zhen, L. Fuzzy Principal Component Analysis Model on Evaluating Innovation Service Capability. Sci. Program. 2020,2020, 8834901. [CrossRef] 5. Böhme, M.; Pham, V.; Roychoudhury, A. Coverage-Based Greybox Fuzzing as Markov Chain. IEEE Trans. Softw. Eng. 2019 , 45, 489–506. [CrossRef] 6. Simon, D.J. Introduction to Fuzzy Control. In Embedded Systems Programming; Electrical Engineering & Computer Science Faculty Publications: Cambridge, MA, USA, 2003; Volume 16, pp. 55–56. 7. Doostfatemeh, M.; Kremer, S.C. New directions in fuzzy automata. Int. J. Approx. Reason. 2005,38, 175–214. [CrossRef] 8. Chaudhari, S.R.; Desai, A.S. On fuzzy Mealy and Moore machines. Bull. Pure Appl. Math 2010,4, 375–384. 9. Mordeson, J.N.; Nair, P.S. Fuzzy Mealy machines. Kybernetes 1966,25, 18–33. [CrossRef] 10. Li, Y.; Pedrycz, W. The equivalence between fuzzy Mealy and fuzzy Moore machines. Soft Comput. 2006 ,10, 953–959. [CrossRef] 11. Todinca, D.; Sora, I.; Butoianu, D.; Precup, R. A Novel Method to Compute the Membership Value of the States of Fuzzy Automata. In Proceedings of the 2018 IEEE 12th International Symposium on Applied Computational Intelligence and Informatics (SACI), Timisoara, Romania, 17–19 May 2018; pp. 107–112. [CrossRef] 12. Pan, H.; Li, Y.; Cao, Y.; Li, P. Nondeterministic fuzzy automata with membership values in complete residuated lattices. Int. J. Approx. Reason. 2017,82, 22–38. [CrossRef] 13. Tiwari, S.P.; Pal, P. On a category of deterministic fuzzy automata. In 11th Conference of the European Society for Fuzzy Logic and Technology (EUSFLAT 2019); Atlantis Studies in Uncertainty Modelling; Atlantis Press: Paris, France, 2019; Volume 1. [CrossRef] 14. Mockor, J. Monads and a common framework for fuzzy type automata. Int. J. Gen. Syst. 2019,48, 406–442. [CrossRef] 15. Singh, A.K.; Tiwari, S.P. Fuzzy Regular Languages Based on Residuated Lattice. New Math. Nat. Comput. 2020 ,16, 363–376. [CrossRef] 16. Yang, C.; Li, Y. Approximate bisimulations and state reduction of fuzzy automata under fuzzy similarity measures. Fuzzy Sets Syst. 2020,391, 72–95. [CrossRef] 17. Yang, C.; Li, Y. e-Bisimulation Relations for Fuzzy Automata. IEEE Trans. Fuzzy Syst. 2018,26, 2017–2029. [CrossRef] 18. Yang, C.; Li, Y. Approximate bisimulation relations for fuzzy automata. Soft Comput. 2018,22, 4535–4547. [CrossRef] 19. Rutten, J.J.M.M. Automata and coinduction (an exercise in coalgebra). In International Conference on Concurrency Theory, Proceedings of the CONCUR 1998: CONCUR’98 Concurrency Theory, Nice, France, 8–11 September 1998; Springer: Berlin/Heidelberg, Germany, 1998; Volume 1466, pp. 194–218. 20. Rutten, J.J.M.M. Universal coalgebra: A theory of systems. Theor. Comput. Sci. 2000,249, 3–80. [CrossRef] 21. Jacobs, B. Introduction to Coalgebra: Towards Mathematics of States and Observation; Cambridge Tracts in Theoretical Computer Science; Cambridge University Press: Cambridge, UK, 2016; Volume 59. 22. Silva, A.; Bonchi, F.; Bonsangue, M.M.; Rutten, J.J.M.M. Generalizing determinization from automata to coalgebras. Log. Methods Comput. Sci. 2013,9. [CrossRef] 23. Sokolova, A. Coalgebraic Analysis of Probabilistic Systems. Ph.D. Thesis, Technische Universiteit Eindhoven, Eindhoven, The Netherlands, 2005. 24. Neves, R.; Barbosa, L.S. Hybrid Automata as Coalgebras. In International Colloquium on Theoretical Aspects of Computing, Proceedings of the ICTAC 2016: Theoretical Aspects of Computing, Taipei, Taiwan, 24–31 October 2016; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2016; Volume 9965, pp. 385–402. [CrossRef] 25. Neves, R.; Barbosa, L.S. Languages and models for hybrid automata: A coalgebraic perspective. Theor. Comput. Sci. 2018 , 744, 113–142. [CrossRef] 26. Liu, A.; Sun, M. A Coalgebraic Semantics Framework for Quantum Systems. In International Conference on Formal Engineering Methods, Proceedings of the ICFEM 2019: Formal Methods and Software Engineering, Shenzhen, China, 5–9 November 2019; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2019; Volume 11852, pp. 387–402. [CrossRef] 27. Feng, Y.; Duan, R.; Ying, M. Bisimulation for Quantum Processes. ACM Trans. Program. Lang. Syst. 2012,34, 1–43. [CrossRef] 28. Larsen, K.G.; Skou, A. Bisimulation through probabilistic testing. Inf. Comput. 1991,94, 1–28. [CrossRef] Mathematics 2021,9, 272 21 of 21 29. Haghverdi, E.; Tabuada, P.; Pappas, G.J. Bisimulation Relations for Dynamical and Control Systems. Electr. Notes Theor. Comput. Sci. 2002,69, 120–136. [CrossRef] 30. Jacobs, B. Invariants, Bisimulations and the Correctness of Coalgebraic Refinements. In International Conference on Algebraic Methodology and Software Technology, Proceedings of the AMAST 1997: Algebraic Methodology and Software Technology, Sydney, Australia, 13–17 December 1997; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 1997; Volume 1349, pp. 276–291. [CrossRef] 31. Venema, Y. Algebras and coalgebras. In Handbook of Modal Logic; Studies in Logic and Practical Reasoning; Elsevier B.V.: Amsterdam, The Netherlands, 2007; Volume 3, pp. 331–426. [CrossRef] 32. Barbosa, L.S. Components as Coalgebras. Ph.D. Thesis, Universidade do Minho, Braga, Portugal, 2001. 33. Guilherme, R.J.P. A Coalgebraic Approach to Fuzzy Automata. Ph.D. Thesis, Universidade Nova De Lisboa, Lisbon, Portugal, 2016. 34. Wu, H.; Chen, Y. Coalgebras for Fuzzy Transition Systems. Electron. Notes Theor. Comput. Sci. 2014,301, 91–101. [CrossRef] 35. Wu, H.; Chen, Y.; Bu, T.; Deng, Y. Algorithmic and logical characterizations of bisimulations for non-deterministic fuzzy transition systems. Fuzzy Sets Syst. 2018,333, 106–123. [CrossRef] 36. Wu, H.; Chen, T.; Han, T.; Chen, Y. Bisimulations for fuzzy transition systems revisited. Int. J. Approx. Reason. 2018 ,99, 1–11. [CrossRef] 37. Nikravesh, M.; Kacprzyk, J.; Zadeh, L.A. Forging New Frontiers: Fuzzy Pioneers I; University of California: Berkeley, CA, USA, 2007. 38. Meng, S.; Barbosa, L.S. Components as coalgebras: The refinement dimension. Theor. Comput. Sci. 2006 ,351, 276–294. [CrossRef] 39. Narasimha, M.; Cleaveland, R.; Iyer, S.P. The role of observations in probabilistic open systems. Electr. Notes Theor. Comput. Sci. 1999,25, 133–144. [CrossRef]