Open Access
This article is

- freely available
- re-usable

*Information*
**2019**,
*10*(11),
340;
https://doi.org/10.3390/info10110340

Article

Approximate Completed Trace Equivalence of ILAHSs Based on SAS Solving

^{1}

Chengdu Institute of Computer Application, Chinese Academy of Sciences, Chengdu 610041, China

^{2}

University of Chinese Academy of Sciences, Beijing 100049, China

^{3}

Guangxi Key Laboratory of Hybrid Computation and IC Design Analysis, Guangxi University for Nationalities, Nanning 530006, China

^{4}

School of Computer Software, Henan University, Kaifeng 475001, China

^{*}

Author to whom correspondence should be addressed.

Received: 6 September 2019 / Accepted: 23 October 2019 / Published: 1 November 2019

## Abstract

**:**

The ILAHS (inhomogeneous linear algebraic hybrid system) is a kind of classic hybrid system. For the purpose of optimizing the design of ILAHS, one important strategy is to introduce equivalence to reduce the states. Recent advances in the hybrid system indicate that approximate trace equivalence can further simplify the design of ILAHS. To address this issue, the paper first introduces the trajectory metric ${d}_{trj}$ for measuring the deviation of two hybrid systems’ behaviors. Given a deviation $\epsilon \ge 0$, the original ILAHS of ${\mathcal{H}}_{1}$ can be transformed to the approximate ILAHS of ${\mathcal{H}}_{2}$, then in trace equivalence semantics, ${\mathcal{H}}_{2}$ is further reduced to ${\mathcal{H}}_{3}$ with the same functions, and hence ${\mathcal{H}}_{1}$ is $\epsilon $-approximate trace equivalent to ${\mathcal{H}}_{3}$. In particular, $\epsilon =0$ is a traditional trace equivalence. We implement an approach based on RealRootClassification to determine the approximation between the ILAHSs. The paper also shows that the existing approaches are only special cases of our method. Finally, we illustrate the effectiveness and practicality of our method on an example.

Keywords:

approximate equivalence; hybrid system; inhomogeneous linear algebraic hybrid systems; RealRootClassification## 1. Introduction

In the real world, there exist many systems exhibiting a hybrid discrete–continuous behavior, and the notion of hybrid automaton [1] was introduced to model these hybrid systems. For example, embedded systems are often modeled as hybrid systems due to their involvement of both digital control software and analog plants, which physical process is often specified in the form of differential equations. Infinite states (or state explosion) due to the continuous behavior of the system are among the most challenging problems in verifying hybrid systems. In the traditional functional analysis domain, an efficient classical technique to tackle state explosion is equivalence [2,3]. In brief, the systems with the same functional behaviors are called equivalence. Functional equivalence simplifies the system by removing the duplicate branches. The papers by Glabbeek [2,3] proposed fourteen kinds of linear time-branching time equivalence relations, and the completed trace equivalence is a basic state-space equivalence relation, which can be used to further reduce the states of hybrid systems [4,5].

However, traditional equivalence techniques are based on absolute precision, which only gives the answer “yes” or “no”, not how much simulation. There is an example that illustrates that it is meaningful to introduce the deviation analysis to equivalence. Considering a microwave oven, if the microwave oven is required to heat to 100 ${}^{\circ}$C within 60 s but does so within 60.5 s (this is very common in life), and if a 0.5 s deviation is allowable, then the two systems are equivalent, or the two states can be merged. Otherwise, the two systems are not equivalent, or the two states cannot be merged. Especially in safety-critical cases, any deviation greater than zero seconds can be viewed as the presence of a bug. In reality, the parameters of hybrid systems are obtained by all kinds of measurements, which generally have a small number of errors. Since errors are inevitable, approximation analysis between the original system and the approximate system is very significant for the given permission precision.

In order to achieve this goal, this paper proceeds by defining two types of metrics, state metric ${d}_{sta}$ and trajectory metric ${d}_{trj}$, to check how much a hybrid system ${\mathcal{H}}_{1}$ conforms to another hybrid system ${\mathcal{H}}_{2}$. The ${d}_{sta}$ measures the distance of the states, while the ${d}_{trj}$ specifies the deviation of the system behaviors. Given a deviation $\epsilon \ge 0$, the original ILAHS of ${\mathcal{H}}_{1}$ can be transformed to the approximate ILAHS of ${\mathcal{H}}_{2}$. Then in trace equivalence semantics, ${\mathcal{H}}_{2}$ is further reduced to ${\mathcal{H}}_{3}$ with the same functions, and hence ${\mathcal{H}}_{1}$ is $\epsilon $-approximate trace equivalent to ${\mathcal{H}}_{3}$. In particular, $\epsilon =0$ is a traditional trace equivalence. At last, the decision problem that ${\mathcal{H}}_{1}$ is $\epsilon $-approximate to ${\mathcal{H}}_{2}$ can be reduced to semi-algebraic system solving (SAS solving) [6,7,8,9,10,11].

There are several choices for metrics, such as bisimulation metrics [12,13], Lyapunov-like functions [13], directed metrics [14], and pseudo-ultrametrics [15], most of which are required to satisfy intricate properties of simulation or bisimulation relations. In contrast, state metric ${d}_{sta}$ and trajectory metric ${d}_{trj}$ in this paper are based on Euclidean distance, which is an intuitive metric.

In this paper, we focus on a specific class of hybrid systems, namely, inhomogeneous linear algebraic hybrid systems (ILAHSs for short). It is well known that the most important analysis question for hybrid systems is the problem of reachability, which is computationally hard and undecidable for the general case and intractable even for the simplest subclasses [1]. So it is doomed to be impossible to find a universal approach for this question without any simplifications or restrictions. ILAHSs, which are ubiquitous in reality, are a kind of classical hybrid systems with some simplifications.

Note that our approximation technology differs from those proposed in the papers [16,17,18,19,20], which aim to construct an approximately reachable set. Most of the differential equations of hybrid systems, as we all know, cannot be solved analytically, and, therefore, the exact reachable set cannot be computed symbolically, so many papers developed a variety of methods that over-approximate or under-approximate the reachable set using varieties of set representations such as polyhedra [21], zonotopes [22], level sets, or ellipsoids [23]. Our approximation technology is, however, to identify the approximate behavior equivalence among the hybrid systems. So far, there exist few papers focused on the approximation analysis of the ILAHS’ behavior equivalence [4,5,24]. Unfortunately, their methods are based on Matrix Jordan Standard Type, which only apply to special cases and cannot deal with the infinite trajectory condition, whereas our method can solve this problem.

The main contributions of this paper are as follows. First, we propose a new method for identifying equivalence, which applies to more general ILAHS. Second, not only is the finite trajectory condition defined, but the infinite trajectory condition is also defined. Third, compared to existing approaches, our method is based on Euclidean distance, which is an intuitive metric.

The remainder of this paper is organized as follows. Section 2 recalls the preliminaries of our method, including hybrid system, inhomogeneous linear algebraic hybrid systems, SAS, and so on. We define the approximate completed trace equivalence of ILAHS in Section 3. Section 4 presents a case study. Conclusions are given in Section 5.

## 2. Preliminaries

In this section, we recall some concepts used throughout the paper. We first clarify some notation conventions. We use bold uppercase letters such as $\mathit{A}$ to denote matrices and ${\mathit{A}}^{T},\tilde{\mathit{A}}$ denote the transpose and approximate matrix of $\mathit{A}$, respectively. We use $\overrightarrow{b}=({b}_{1},\dots ,{b}_{n})$ to denote vectors. We denote $({\widehat{x}}_{1},{\widehat{x}}_{2},\dots ,{\widehat{x}}_{n})$ as an assignment of variables $\overrightarrow{x}=({x}_{1},\dots ,{x}_{n})$.

Hybrid automata, first proposed by Rajeev Alur et al. [25], are a mathematical model to describe a system containing continuous and discrete components. Many other models for hybrid systems can be found in [26,27,28,29]. In this paper, we adopt the model proposed in [1] as our modeling framework. A hybrid system can then be defined as:

**Definition**

**1**

(Hybrid System)

**.**A hybrid system $\mathcal{H}:\u2329L,V,\mathcal{T},F,{\ell}_{0},\mathsf{\Theta}\u232a$ consists of the following components:- L: a finite set of locations (or modes).
- V: a set of real-valued system variables. The hybrid state space is denoted by $\mathsf{\Sigma}=L\times {\mathbb{R}}^{\left|V\right|}$, a state is denoted by $(\ell ,\overrightarrow{s})\in \mathsf{\Sigma}$, and $\overrightarrow{s}\in {\mathbb{R}}^{\left|V\right|}$ is a continuous state of the variables over the real numbers.
- $\mathcal{T}\subseteq L\times L\times {2}^{V}\times ({V}^{\prime}\mapsto V)$: a set of discrete transitions. A discrete transition $\tau =\u2329{\ell}_{1},{\ell}_{2},{\rho}_{\tau},{\alpha}_{\tau}\u232a$ consists of the pre- and post-locations of the transition ${\ell}_{1},{\ell}_{2}$, a guard ${\rho}_{\tau}$, which is a boolean function of the variables V, and an action ${\alpha}_{\tau}$, which is an assignment over the variables V and ${V}^{\prime}$. V denotes the current-state variables, and ${V}^{\prime}$ denotes the next-state variables.
- $F:L\mapsto (V\mapsto V)$: continuous evolution, a map that maps each location $\ell \in L$ to a differential rule $F(\ell )$, of the form ${\dot{v}}_{i}={f}_{i}(\overrightarrow{v})$. The differential rule $F(\ell )$ specifies how the system variables evolve at the location ℓ, which is also known as a vector field or a flow field.
- $I:L\mapsto {2}^{V}$: a map that maps each location $\ell \in L$ to a location condition (location invariant) that is an assertion over V.
- ${\ell}_{0}\in L$: the initial location.
- Θ: an assertion specifying the initial condition.

The behaviors of hybrid systems are expressed as trajectories.

**Definition**

**2**

(Trajectory)
such that,

**.**A trajectory of a hybrid system $\mathcal{H}$ is an (in)finite sequence of states $\u2329\ell ,\widehat{\overrightarrow{v}}\u232a\in L\times {\mathbb{R}}^{\left|V\right|}$ of the form
$$\u2329{\ell}_{0},{\widehat{\overrightarrow{v}}}_{0}\u232a,\u2329{\ell}_{1},{\widehat{\overrightarrow{v}}}_{1}\u232a,\u2329{\ell}_{2},{\widehat{\overrightarrow{v}}}_{2}\u232a,\dots ,$$

**Initiation:**${\widehat{\overrightarrow{v}}}_{0}\vDash \mathsf{\Theta}$ specifies an initial state. Furthermore, for each consecutive state pair $\u2329({\ell}_{i},{\widehat{\overrightarrow{v}}}_{i}),({\ell}_{i+1},{\widehat{\overrightarrow{v}}}_{i+1})\u232a$, one of the two evolution conditions below is satisfied:

**Discrete evolution:**There exists a transition $\tau :\u2329{\ell}_{1},{\ell}_{2},{\rho}_{\tau},{\alpha}_{\tau}\u232a\in \mathcal{T}$ such that τ is enabled, i.e., ${\rho}_{\tau}({\widehat{\overrightarrow{v}}}_{i})$ = true and ${\widehat{\overrightarrow{v}}}_{i+1}={\alpha}_{\tau}({\widehat{\overrightarrow{v}}}_{i})$.

**Continuous evolution**: ${\ell}_{i}={\ell}_{i+1}=\ell $, and there exists a time interval $\delta >0$, ${\widehat{\overrightarrow{v}}}_{i}\stackrel{\delta}{\u27f6}{\widehat{\overrightarrow{v}}}_{i+1}$, along with a smooth (continuous and differentiable to all orders) function $g:[0,\delta ]\mapsto {\mathbb{R}}^{\left|V\right|}$ such that g evolves from ${\widehat{\overrightarrow{v}}}_{i}$ to ${\widehat{\overrightarrow{v}}}_{i+1}$ according to the differential rule at location ℓ, while satisfying the location condition $I(\ell )$. Formally,

- 1.
- $g(0)={\widehat{\overrightarrow{v}}}_{i},g(\delta )={\widehat{\overrightarrow{v}}}_{i+1}$ and $\forall t\in [0,\delta ],g(t)\vDash I(\ell )$;
- 2.
- $\forall t\in [0,\delta ],\u2329g(t),\dot{g}(t)\u232a\vDash F(\ell )$.

A state $\u2329\ell ,\widehat{\overrightarrow{v}}\u232a$ is reachable if it appears in some trajectory of $\mathcal{H}$. The set of all reachable states of $\mathcal{H}$ is denoted by Reach($\mathcal{H}$).

With some restrictions, a hybrid system can be specialized into an inhomogeneous linear algebraic hybrid system, which is ubiquitous in reality [4,5,24].

**Definition**

**3**

(Inhomogeneous linear algebraic hybrid system, ILAHS)

**.**ILAHS is a kind of hybrid system with simplifications: for continuous evolution, $F(\ell ):\overrightarrow{{v}^{\prime}}=\mathit{A}\overrightarrow{v}$, where $\overrightarrow{{v}^{\prime}}\stackrel{\delta}{\u27f6}\overrightarrow{v}$.**Example**

**1**

(A thermostat)

**.**Consider a room being heated by a radiator controlled by a thermostat, one of the typical introductory examples of hybrid systems. This system has both a continuous state and two discrete states. The continuous state is the temperature in the room $x\in \mathbb{R}$. The discrete states, $L=\{on,off\}$, reflect whether the radiator is on or off. The evolution of x is governed by a differential equation, while the evolution of L is through jumps. It is very convenient to compactly describe such hybrid systems by mixing the differential equation with the directed graph notation (shown in Figure 1).Computers are used as control systems for a wide variety of industrial and consumer devices. However, the working principle of computers is fundamentally discrete rather than continuous. When the time x is discretized, the general hybrid system (Figure 1) can be turned into an ILAHS(Figure 2), where
The ILAHS’ behaviors are expressed as trajectories. For instance, we assume that $m=15$, ${m}_{on}=20$, $M=32$, ${M}_{off}=30$, $\Delta t=0.1$, $K=0.2$, and $h=5$. If the initial temperature of the room is ${25}^{\circ}$C, then one possible trajectory is as follows (Figure 3):

$$\left\{\begin{array}{c}L=\{on,off\},\hfill \\ V=\left\{x\right\},\hfill \\ \mathcal{T}=\{\u2329on,{\alpha}_{1},off\u232a,\u2329off,{\alpha}_{2},on\u232a\},{\alpha}_{1,2}=\{{x}^{\prime}=x\},\hfill \\ F(on)=\{{x}^{\prime}=(1+K.h.\Delta t)x\},\hfill \\ F(off)=\{{x}^{\prime}=(1-K.\Delta t)x\}.\hfill \end{array}\right.$$

$$\begin{array}{c}\u2329\mathrm{off},25\u232a\to \u2329\mathrm{off},24.5\u232a\to \u2329\mathrm{off},24.01\u232a\to \dots \to \u2329\mathrm{on},15.09\u232a\to \u2329\mathrm{on},16.60\u232a\to \dots \hfill \end{array}$$

**Definition**

**4**

(Metric)

**.**For a set X, a metric on X is a function ${d}_{X}:X\times X\mapsto {\mathbb{R}}^{+}$ such that- 1.
- for all $x,y\in X,{d}_{X}(x,y)=0$ if and only if $x=y$;
- 2.
- ${d}_{X}(x,y)={d}_{X}(y,x)$, for all $x,y\in X$; and
- 3.
- ${d}_{X}(x,z)\le {d}_{X}(x,y)+{d}_{X}(y,z)$ for all $x,y,z\in X$.

Note that the condition (1) expresses that ${d}_{X}(x,y)=0$ implies $x=y$. If ${d}_{X}(x,y)=0$ does not necessarily mean that $x=y$, the metric is called a pseudo-metric [12].

**Definition**

**5**

(Trace Equivalence)

**.**$\delta \in Ac{t}^{\ast}$ is a trace of a process p, if there exists a process q, such that $p\stackrel{\delta}{\u27f6}q$. Let $T(p)$ denote the set of traces of p. Two processes p and q are trace equivalent if $T(p)=T(q)$. In trace semantics, two processes are identified iff they are trace equivalent.Trace semantics is based on the idea that two processes are to be identified if they allow the same set of observations, where an observation simply consists of a sequence of actions performed by the process in succession (Figure 4). More details can be found in the paper [2].

However, $Act$ consists of abstract actions, which are unable to express the exchange details of the data stream. In 2008, Sankaranarayanan et al. [30] defined a hybrid system program model with polynomial equations that took the place of abstract actions and opened up a new method of hybrid system design and verification based on polynomial algebra. For example, the transition ${\ell}_{0}\stackrel{\alpha}{\u27f6}{\ell}_{1}$ with $\alpha \equiv {(x-1)}^{2}+{({x}^{\prime}-2)}^{2}+{({y}^{\prime}-3)}^{2}=0$ indicates the relation $\left\{\u2329({\ell}_{0},{s}_{0}),({\ell}_{1},{s}_{1})\u232a|{s}_{0}=(1,y)\wedge {s}_{1}=(2,3),y\in \mathbb{R}\right\}$, the variable x refers to the current state, and ${x}^{\prime}$ to the next state of a transition.

**Definition**

**6**

(Completed Trace Equivalence)

**.**$\delta \in Ac{t}^{\ast}$ is a completed trace of a process p, if there exists a process q, such that $p\stackrel{\delta}{\u27f6}q$ and $I(q)=\varnothing $. Let $CT(p)$ denote the set of completed traces of p. Two processes p and q are completed trace equivalent if $T(p)=T(q)$ and $CT(p)=CT(q)$. In completed trace semantics, two processes are identified iff they are completed trace equivalent (Figure 5).Obviously, the trace equivalence can be regarded as a simpler version of the completed trace equivalence.

**Definition**

**7**

(Semi-Algebraic System)
where $r\ge 1,l\ge k\ge 0,m\ge 0,\overrightarrow{u}=({u}_{1},\dots ,{u}_{t}),\overrightarrow{x}=({x}_{1},\dots ,{x}_{r})$, and ${p}_{i},{g}_{i},{h}_{i}$ are all in $\mathbb{Q}[\overrightarrow{u},\overrightarrow{x}]\setminus \mathbb{Q}$. An SAS is usually denoted by a quadruple $[\mathbb{P},{\mathbb{G}}_{1},{\mathbb{G}}_{2},\mathbb{H}]$, where $\mathbb{P}=[{p}_{1},\dots ,{p}_{r}],{\mathbb{G}}_{1}=[{g}_{1},\dots ,{g}_{k}],{\mathbb{G}}_{2}=[{g}_{k+1},\dots ,{g}_{l}]$ and $\mathbb{H}=[{h}_{1},\dots ,{h}_{m}]$. An SAS is called parametric if $t\ne 0$, otherwise it is constant.

**.**A semi-algebraic system (SAS for short) is a conjunctive polynomial formula of the following form:
$$\left\{\begin{array}{c}{p}_{1}(\overrightarrow{u},\overrightarrow{x})=0,\dots ,{p}_{r}(\overrightarrow{u},\overrightarrow{x})=0,\hfill \\ {g}_{1}(\overrightarrow{u},\overrightarrow{x})\le 0,\dots ,{g}_{k}(\overrightarrow{u},\overrightarrow{x})\le 0,\hfill \\ {g}_{k+1}(\overrightarrow{u},\overrightarrow{x})>0,\dots ,{g}_{l}(\overrightarrow{u},\overrightarrow{x})>0,\hfill \\ {h}_{1}(\overrightarrow{u},\overrightarrow{x})\ne 0,\dots ,{h}_{m}(\overrightarrow{u},\overrightarrow{x})\ne 0,\hfill \end{array}\right.$$

For $SAS$, what we are concerned about is the real solutions of the equations ($\mathbb{P}$) under the constraints (${\mathbb{G}}_{1},{\mathbb{G}}_{2},\mathbb{H}$). More specifically, assuming S is a constant $SAS$, the interesting questions are how to compute the number of real solutions of S, and if the number is finite, how to compute these real solutions. Assuming S is parametric $SAS$, the interesting problem is the so-called real solution classification, which is to determine the condition on the parameters such that the system has the prescribed number of distinct real solutions, which is possibly infinite.

To address this issue, Yang et al. [6] first defined the key concept of border polynomial(BP), based on which an algorithm is proposed. For more details, please refer to [7,8,9,10,11]. This algorithm has been improved and implemented by Xia as the Maple package DISCOVERER [31]. Since 2009, the main functions of DISCOVERER have been integrated into the RegularChains library of Maple. Since then, the implementation has been improved by Chen et al. [32,33,34]. Thus, the experiment in this paper requires a version of Maple higher than Maple 13.

**Example**

**2.**

Prove that $f\ge 0$ under the constraints $a\ge 0,b\ge 0,c\ge 0,abc-1=0$, i.e.,

$$\left.\begin{array}{c}a\ge 0\hfill \\ b\ge 0\hfill \\ c\ge 0\hfill \\ abc-1=0\hfill \end{array}\right\}\vDash f\ge 0.$$

In other words,
where $f=2{b}^{4}{c}^{4}+2{b}^{3}{c}^{4}a+2{b}^{4}{c}^{3}a+2{a}^{3}{c}^{3}{b}^{2}+2{a}^{4}{c}^{3}b+2{a}^{3}{c}^{4}b+2{a}^{4}{c}^{4}+2{a}^{3}{b}^{4}c+2{a}^{4}{b}^{4}+2{a}^{3}{b}^{3}{c}^{2}+2{a}^{4}{b}^{3}c-3{b}^{5}{c}^{4}{a}_{6}^{3}{b}^{4}{c}^{4}{a}^{4}-3{b}^{5}{c}^{3}{a}^{4}-3{b}^{4}{c}^{3}{a}^{5}-3{b}^{4}{c}^{5}{a}^{3}-3{b}^{3}{c}^{5}{a}^{4}-3{b}^{3}{c}^{4}{a}^{5}.$

$$\left\{\begin{array}{cc}a\ge 0\hfill & \\ b\ge 0\hfill & \\ c\ge 0\hfill & \mathrm{has}\phantom{\rule{4.pt}{0ex}}\mathrm{no}\phantom{\rule{4.pt}{0ex}}\mathrm{solution}\hfill \\ abc-1=0\hfill & \\ f<0\hfill & \end{array}\right.$$

In order to prove (4) with Maple, we first start Maple and load two relative packages of RegularChains as follows.

- > with (RegularChains):
- > with (ParametricSystemTools):
- > with (SemiAlgebraicSetTools):
- Then we define an order of the unknowns:
- > R:= PolynomialRing ([a, b, c]):
- Then, by calling
- >RealRootClassification ([abc-1], [a,b,c], [-f], [ ], 2, 0, R):

we will know at once that the inequality holds.

## 3. $\mathit{\epsilon}$-Approximate Completed Trace Equivalence of ILAHS

In this section, we define $\epsilon $-approximate completed trace equivalence of ILAHS and propose the discriminant conditions based on SAS. Assuming $\mathcal{H}$ is an ILAHS and $\mathfrak{T}$ is a trajectory of $\mathcal{H}$,
${A}_{i}$ is an original (or theoretical) transition matrix, $la{b}_{01}$ is discrete evolution, for simplicity, $la{b}_{01}:{v}_{i}^{\prime}={v}_{i}$, and so on. ${\tilde{A}}_{i}$ is an approximate (or actual) matrix with respect to ${A}_{i}$, so we have another trajectory,
If a given derivation $\epsilon $ is allowable, we aim to check whether two trajectories are identical; if every trajectory of two ILAHSs is identical, the two hybrid systems are identical with respect to derivation $\epsilon $.

$$\u2329{\ell}_{0},{\widehat{\overrightarrow{v}}}_{00}\u232a\stackrel{{A}_{0}}{\u27f6}\u2329{\ell}_{0},{\widehat{\overrightarrow{v}}}_{01}\u232a\stackrel{{A}_{0}}{\u27f6}\cdots \u2329{\ell}_{0},{\widehat{\overrightarrow{v}}}_{0{m}_{0}}\u232a\stackrel{la{b}_{01}}{\u27f6}\u2329{\ell}_{1},{\widehat{\overrightarrow{v}}}_{10}\u232a,\dots ,\stackrel{{A}_{n}}{\u27f6}\u2329{\ell}_{n},{\widehat{\overrightarrow{v}}}_{n0}\u232a,\dots .$$

$$\u2329{\ell}_{0},{\tilde{\widehat{\overrightarrow{v}}}}_{00}\u232a\stackrel{{\tilde{A}}_{0}}{\u27f6}\u2329{\ell}_{0},{\tilde{\widehat{\overrightarrow{v}}}}_{01}\u232a\stackrel{{\tilde{A}}_{0}}{\u27f6}\cdots \u2329{\ell}_{0},{\tilde{\widehat{\overrightarrow{v}}}}_{0{m}_{0}}\u232a\stackrel{la{b}_{01}}{\u27f6}\u2329{\ell}_{1},{\tilde{\widehat{\overrightarrow{v}}}}_{10}\u232a,\dots ,\stackrel{{\tilde{A}}_{n}}{\u27f6}\u2329{\ell}_{n},{\tilde{\widehat{\overrightarrow{v}}}}_{n0}\u232a,\dots .$$

To measure the behavior of the hybrid system, this paper defines two types of metrics based on the Euclidean metric: the state metric ${d}_{sta}$ and the trajectory metric ${d}_{trj}$. ${d}_{sta}$ measures the distance of states, while ${d}_{trj}$ specifies the similarity of two systems’ behaviors.

**Definition**

**8**

(State Metric)
If $l={l}^{\prime}$, ${d}_{sta}\left(\u2329l,\widehat{\overrightarrow{v}}\u232a,\u2329{l}^{\prime},\tilde{\widehat{\overrightarrow{v}}}\u232a\right)$ can be abbreviated as ${d}_{sta}\left(\widehat{\overrightarrow{v}},\tilde{\widehat{\overrightarrow{v}}}\right)$.

**.**State metric ${d}_{sta}$ is Euclidean metric: ${\mathbb{R}}^{n}\times {\mathbb{R}}^{n}\to [0,1]$ such that
$$\begin{array}{cc}\hfill {d}_{sta}\left(\u2329l,\widehat{\overrightarrow{v}}\u232a,\u2329{l}^{\prime},\tilde{\widehat{\overrightarrow{v}}}\u232a\right)& =\left\{\begin{array}{cc}1\hfill & \hfill if\phantom{\rule{1.em}{0ex}}l\ne {l}^{\prime},\\ {d}_{e}\left(\widehat{\overrightarrow{v}},\tilde{\widehat{\overrightarrow{v}}}\right)\hfill & \hfill if\phantom{\rule{1.em}{0ex}}l={l}^{\prime},\end{array}\right.\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& \mathit{where}\phantom{\rule{4.pt}{0ex}}\phantom{\rule{1.em}{0ex}}{d}_{e}\left(\widehat{\overrightarrow{v}},\tilde{\widehat{\overrightarrow{v}}}\right)=\frac{\sqrt{{\displaystyle \sum _{i=1}^{n}}{({\widehat{v}}_{i}-{\tilde{\widehat{v}}}_{i})}^{2}}}{1+\sqrt{{\displaystyle \sum _{i=1}^{n}}{({\widehat{v}}_{i}-{\tilde{\widehat{v}}}_{i})}^{2}}}.\hfill \end{array}$$

**Definition**

**9**

(Trajectory Metric)

**.**Trajectory metric ${d}_{trj}$ is defined as the minimum distance of relevant states, i.e.,
$${d}_{trj}({\mathfrak{T}}_{1},{\mathfrak{T}}_{2})=\begin{array}{c}min\left({d}_{sta}\left(\u2329l,{\widehat{\overrightarrow{v}}}_{i}\u232a,\u2329l,\tilde{{\widehat{\overrightarrow{v}}}_{i}}\u232a\right)\right).\hfill \end{array}$$

**Definition**

**10**

($\epsilon $-Approximate States)

**.**Given a deviation ε, $\u2329l,\widehat{\overrightarrow{v}}\u232a$ is ε-approximate to $\u2329{l}^{\prime},\tilde{\widehat{\overrightarrow{v}}}\u232a$ iff ${d}_{sta}\left(\u2329l,\widehat{\overrightarrow{v}}\u232a,\u2329{l}^{\prime},\tilde{\widehat{\overrightarrow{v}}}\u232a\right)\le \epsilon $.**Definition**

**11**

($\epsilon $-Approximate Trajectories)

**.**Given a deviation ε and two trajectories ${\mathfrak{T}}_{1}$ and ${\mathfrak{T}}_{2}$, ${\mathfrak{T}}_{1}$ is ε-approximate to ${\mathfrak{T}}_{2}$ iff ${d}_{trj}({\mathfrak{T}}_{1},{\mathfrak{T}}_{2})\le \epsilon $.**Definition**

**12**

($\epsilon $-Approximate Completed Trace Equivalence of ILAHS)

**.**Given a deviation ε, if all completed traces of two ILAHSs are ε-approximate trajectories, then the two ILAHSs are ε-approximate completed trace equivalence.In Figure 6, ${\mathcal{H}}_{1}$ is an original ILAHS, given a deviation $\epsilon $, ${\mathcal{H}}_{1}$ and ${\mathcal{H}}_{3}$ are completed trace equivalence, in the semantics of completed trace equivalence, ${\mathcal{H}}_{3}$ is identical to ${\mathcal{H}}_{1}$.

Obviously, ${\mathcal{H}}_{3}$ involves fewer states than ${\mathcal{H}}_{1}$; in other words, by approximate completed trace equivalence, the research on hybrid systems can be simplified.

Since there exist two categories of trajectories in completed trace equivalence (Figure 6), the infinite trajectory ${({a}_{2}{b}_{2}{c}_{2})}^{\ast}$ and the finite trajectory ${a}_{2}$, there are two corresponding decision conditions, the finite trajectory condition and the infinite trajectory condition. For simplicity, assume discrete evolution such as $la{b}_{01}:{v}_{i}^{\prime}={v}_{i}$.

**Definition**

**13**

(Finite Trajectory Condition)
such that

**.**For a finite trajectory ${\mathfrak{T}}_{\mathfrak{1}}$
$$\u2329{\ell}_{0},{\widehat{\overrightarrow{v}}}_{00}\u232a\stackrel{{A}_{0}}{\u27f6}\u2329{\ell}_{0},{\widehat{\overrightarrow{v}}}_{01}\u232a\stackrel{{A}_{0}}{\u27f6}\cdots \u2329{\ell}_{0},{\widehat{\overrightarrow{v}}}_{0{m}_{0}}\u232a\stackrel{la{b}_{01}}{\u27f6}\u2329{\ell}_{1},{\widehat{\overrightarrow{v}}}_{10}\u232a,\dots ,\stackrel{{A}_{n}}{\u27f6}\u2329{\ell}_{n},{\widehat{\overrightarrow{v}}}_{n{m}_{n}}\u232a.$$

$$\left\{\begin{array}{cc}{\widehat{\overrightarrow{v}}}_{00}\hfill & \in \mathsf{\Theta}\hfill \\ \overrightarrow{v}\hfill & ={\widehat{\overrightarrow{v}}}_{00}\hfill \\ \tilde{\overrightarrow{v}}\hfill & ={\widehat{\overrightarrow{v}}}_{00}\hfill \\ {\overrightarrow{v}}^{\prime}\hfill & =({A}_{0}^{{m}_{0}}{A}_{1}^{{m}_{1}}\dots {A}_{i}^{{m}_{i}})\overrightarrow{v}\hfill & \mathit{have}\phantom{\rule{4.pt}{0ex}}\mathit{no}\phantom{\rule{4.pt}{0ex}}\mathit{solution}\phantom{\rule{4.pt}{0ex}}\mathit{for}\phantom{\rule{4.pt}{0ex}}\mathit{every}\phantom{\rule{1.em}{0ex}}0\le i\le n.\hfill \\ {\tilde{\overrightarrow{v}}}^{\prime}\hfill & =({\tilde{A}}_{0}^{{m}_{0}}{\tilde{A}}_{1}^{{m}_{1}}\dots {\tilde{A}}_{i}^{{m}_{i}})\tilde{\overrightarrow{v}}\hfill \\ {d}_{sta}({\overrightarrow{v}}^{\prime},{\tilde{\overrightarrow{v}}}^{\prime})\hfill & >\epsilon \hfill \end{array}\right.$$

The infinite trajectory condition is defined by the inductive method.

**Definition**

**14**

(Infinite Trajectory Condition)
such that
for every $0\le i\le n$, (8) and (9) have no solution.

**.**For an infinite trajectory ${\mathfrak{T}}_{\mathfrak{2}}$
$$\u2329{\ell}_{0},{\widehat{\overrightarrow{v}}}_{00}\u232a\stackrel{{A}_{0}}{\u27f6}\u2329{\ell}_{0},{\widehat{\overrightarrow{v}}}_{01}\u232a\stackrel{{A}_{0}}{\u27f6}\cdots \u2329{\ell}_{0},{\widehat{\overrightarrow{v}}}_{0{m}_{0}}\u232a\stackrel{la{b}_{01}}{\u27f6}\u2329{\ell}_{1},{\widehat{\overrightarrow{v}}}_{10}\u232a,\dots ,\stackrel{{A}_{n}}{\u27f6}\u2329{\ell}_{n},{\widehat{\overrightarrow{v}}}_{n{m}_{n}}\u232a\stackrel{la{b}_{n0}}{\u27f6}\u2329{\ell}_{0},{\widehat{\overrightarrow{v}}}_{{00}^{\prime}}\u232a\stackrel{{A}_{0}}{\u27f6}\cdots ,$$

$$\phantom{\rule{3.33333pt}{0ex}}\phantom{\rule{3.33333pt}{0ex}}\phantom{\rule{3.33333pt}{0ex}}\phantom{\rule{3.33333pt}{0ex}}Initiation:\phantom{\rule{3.33333pt}{0ex}}\phantom{\rule{3.33333pt}{0ex}}\phantom{\rule{3.33333pt}{0ex}}\phantom{\rule{3.33333pt}{0ex}}\left\{\begin{array}{c}\overrightarrow{v},\tilde{\overrightarrow{v}}\in \mathsf{\Theta}\phantom{\rule{2.em}{0ex}}\phantom{\rule{2.em}{0ex}}\phantom{\rule{2.em}{0ex}}\phantom{\rule{2.em}{0ex}}\phantom{\rule{2.em}{0ex}}\phantom{\rule{2.em}{0ex}}\hfill \\ {d}_{sta}(\overrightarrow{v},\tilde{\overrightarrow{v}})>\epsilon \phantom{\rule{2.em}{0ex}}\phantom{\rule{2.em}{0ex}}\phantom{\rule{2.em}{0ex}}\phantom{\rule{2.em}{0ex}}\phantom{\rule{2.em}{0ex}}\phantom{\rule{2.em}{0ex}}\hfill \end{array}\right.$$

$$Consecution:\left\{\begin{array}{cc}{\overrightarrow{v}}^{\prime}\hfill & =({A}_{0}^{{m}_{0}}{A}_{1}^{{m}_{1}}\dots {A}_{i}^{{m}_{i}})\overrightarrow{v}\hfill \\ {\tilde{\overrightarrow{v}}}^{\prime}\hfill & =({\tilde{A}}_{0}^{{m}_{0}}{\tilde{A}}_{1}^{{m}_{1}}\dots {\tilde{A}}_{i}^{{m}_{i}})\tilde{\overrightarrow{v}}\hfill \\ {d}_{sta}({\overrightarrow{v}}^{\prime},{\tilde{\overrightarrow{v}}}^{\prime})\hfill & >\epsilon \hfill \end{array}\right.$$

The condition Initiation shows that the deviation of two states is initially less than $\epsilon $; the condition Consecution shows that deviation less than $\epsilon $ is preserved by the loop.

**Complexity Analysis:**Take (9) for example. Assuming $\overrightarrow{v}=\{{v}_{1},{v}_{2},\dots \phantom{\rule{0.166667em}{0ex}}{v}_{n}\}$, $deg({v}_{i})\le 2,1\le i\le n$, our method consists of three main steps. In the first step, we transform the equations of (9) into triangular sets (i.e., equations in the triangular form) by Ritt–Wu’s method. By [35], the complexity of this step is $\mathcal{O}({(2n)}^{{(2n)}^{\mathcal{O}(1)}}{(2+1)}^{{\mathcal{O}}^{{(2n)}^{3}}})$. The second step is to compute a border polynomial (BP) from the triangularized systems through resultant computation. By [35], the complexity of computing the BP is at most $(2n+2)\mathcal{O}({(2n)}^{6n+2{n}^{2}}{(2+1)}^{2{n}^{3}})$. Finally, we use the PCAD(partial cylindrical algebraic decomposition) algorithm with the BP to obtain the real solution classification; the complexity of this step is at most $\mathcal{O}(2{D}^{{2}^{4n+8}})$, where $D=\mathcal{O}({(2n)}^{4{n}^{2}+8{n}^{3}}{(2+1)}^{4{n}^{3}})$, the highest degree of BP.

**A Special Case:**The approaches proposed in papers [4,5,24] use the Frobenius norm to study approximate equivalence of real-time linear algebraic hybrid automaton. Their approaches can only apply to a class of special matrices. We now prove that their approaches are a special case of our approach.

For ${A}_{j}$ and its approximate matrix ${\tilde{A}}_{j}=A+{\delta}_{{A}_{j}}$, which are $n\times n$ nonsingular matrices, the eigenvalues of matrix A are ${\lambda}_{i}(i=1,\dots ,n)\in \mathbb{R}$, and there exists an orthogonal matrix U:

$$\begin{array}{cc}\hfill \phantom{\rule{1.em}{0ex}}& {A}_{k}={U}^{T}\left[\begin{array}{ccc}{\lambda}_{k1}& \phantom{\rule{1.em}{0ex}}& \ast \\ \phantom{\rule{1.em}{0ex}}& \ddots \\ \phantom{\rule{1.em}{0ex}}& \phantom{\rule{1.em}{0ex}}& {\lambda}_{kn}\end{array}\right]U,\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& {A}_{k}+{\delta}_{{A}_{k}}={U}^{T}\left[\begin{array}{ccc}{\lambda}_{k1}+{\delta}_{{\lambda}_{k1}}& \phantom{\rule{1.em}{0ex}}& \ast \\ \phantom{\rule{1.em}{0ex}}& \ddots \\ \phantom{\rule{1.em}{0ex}}& \phantom{\rule{1.em}{0ex}}& {\lambda}_{kn}+{\delta}_{{\lambda}_{kn}}\end{array}\right]U,\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& {A}_{k}{A}_{k-1}\dots {A}_{1}={U}^{T}\left[\begin{array}{cc}{\lambda}_{11}\dots {\lambda}_{k1}& \ast \\ \phantom{\rule{1.em}{0ex}}& \ddots \\ \phantom{\rule{1.em}{0ex}}& {\lambda}_{1n}\dots {\lambda}_{kn}\end{array}\right]U,\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& ({A}_{k}+{\delta}_{{A}_{k}})({A}_{k-1}+{\delta}_{{A}_{k-1}})\dots ({A}_{1}+{\delta}_{{A}_{1}})={U}^{T}\left[\begin{array}{ccc}({\lambda}_{11}+{\delta}_{{\lambda}_{11}})\dots ({\lambda}_{k1}+{\delta}_{{\lambda}_{k1}})& \phantom{\rule{1.em}{0ex}}& \ast \\ \phantom{\rule{1.em}{0ex}}& \ddots \\ \phantom{\rule{1.em}{0ex}}& \phantom{\rule{1.em}{0ex}}& ({\lambda}_{1n}+{\delta}_{{\lambda}_{1n}})\dots ({\lambda}_{kn}+{\delta}_{{\lambda}_{kn}})\end{array}\right]U,\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& {\delta}_{{A}_{j}}={\tilde{A}}_{j}-{A}_{j},{\parallel {\delta}_{{A}_{j}}\parallel}_{2}={r}_{j}{\parallel {A}_{j}\parallel}_{2},\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& {\delta}_{k}=({A}_{k}+{\delta}_{{A}_{k}})({A}_{k-1}+{\delta}_{{A}_{k-1}})\dots ({A}_{1}+{\delta}_{{A}_{1}})-{A}_{k}{A}_{k-1}\dots {A}_{1}\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& \phantom{\rule{1.em}{0ex}}\le ((1+{r}_{1})\dots (1+{r}_{k})-1){\parallel {A}_{1}\parallel}_{2}\cdots {\parallel {A}_{k}\parallel}_{2}\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& \phantom{\rule{1.em}{0ex}}\le ({e}^{{r}_{1}+{r}_{2}\dots +{r}_{k}}-1){\parallel {A}_{1}\parallel}_{2}{\parallel {A}_{2}\parallel}_{2}\cdots {\parallel {A}_{k}\parallel}_{2}={W}_{k}.\hfill \end{array}$$

Then, for a deviation $\omega $ and $\frac{{W}_{k}}{{\parallel {A}_{k}{A}_{k-1}\dots {A}_{1}\parallel}_{2}}\le \omega $, if ${A}_{k}{A}_{k-1}\dots {A}_{1}$ are $\omega $-approximate to $({A}_{k}+{\delta}_{{A}_{k}})({A}_{k-1}+{\delta}_{{A}_{k-1}})\dots ({A}_{1}+{\delta}_{{A}_{1}})$, $\forall h\in {N}^{+}$ and $1\le h<k$, ${A}_{h}{A}_{h-1}\dots {A}_{1}$ are $\omega $-approximate to $({A}_{h}+{\delta}_{{A}_{h}})({A}_{h-1}+{\delta}_{{A}_{h-1}})\dots ({A}_{1}+{\delta}_{{A}_{1}})$.

**Proof.**

$$\begin{array}{cc}\hfill \because {d}_{sta}^{(k)}({\overrightarrow{v}}^{\prime},{\tilde{\overrightarrow{v}}}^{\prime})& =\parallel ({\tilde{A}}_{1}{\tilde{A}}_{2}\dots {\tilde{A}}_{k}-{A}_{1}{A}_{2}\dots {A}_{k}){\widehat{\overrightarrow{v}}}_{0}{\parallel}_{2}\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& =\parallel {\delta}_{k}{\widehat{\overrightarrow{v}}}_{0}{\parallel}_{2}\le \parallel {\delta}_{k}{\parallel}_{2}\parallel {\widehat{\overrightarrow{v}}}_{0}{\parallel}_{2}\le {W}_{k}{\parallel {\widehat{\overrightarrow{v}}}_{0}\parallel}_{2}\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& \le \omega {\parallel {A}_{k}{A}_{k-1}\dots {A}_{1}\parallel}_{2}{\parallel {\widehat{\overrightarrow{v}}}_{0}\parallel}_{2}=\epsilon ,\hfill \end{array}$$

∴
i.e., for every $1\le h<k$,
in other words, (11) ⊧ (13). □

$$\left\{\begin{array}{cc}{\widehat{\overrightarrow{v}}}_{0}\hfill & \in \mathsf{\Theta}\hfill \\ \overrightarrow{v}\hfill & ={\widehat{\overrightarrow{v}}}_{0}\hfill \\ \tilde{\overrightarrow{v}}\hfill & ={\widehat{\overrightarrow{v}}}_{0}\hfill & \mathrm{has}\phantom{\rule{4.pt}{0ex}}\mathrm{no}\phantom{\rule{4.pt}{0ex}}\mathrm{solution},\hfill \\ {\overrightarrow{v}}^{\prime}\hfill & =({A}_{1}{A}_{2}\dots {A}_{k})\overrightarrow{v}\hfill \\ {\tilde{\overrightarrow{v}}}^{\prime}\hfill & =({\tilde{A}}_{1}{\tilde{A}}_{2}\dots {\tilde{A}}_{k})\tilde{\overrightarrow{v}}\hfill \\ {d}_{sta}^{(k)}({\overrightarrow{v}}^{\prime},{\tilde{\overrightarrow{v}}}^{\prime})\hfill & >\epsilon \hfill \end{array}\right.$$

$$\begin{array}{cc}\hfill and\because {d}_{sta}^{(h)}({\overrightarrow{v}}^{\prime},{\tilde{\overrightarrow{v}}}^{\prime})& =\parallel ({\tilde{A}}_{1}{\tilde{A}}_{2}\dots {\tilde{A}}_{h}-{A}_{1}{A}_{2}\dots {A}_{h}){\widehat{\overrightarrow{v}}}_{0}{\parallel}_{2}\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& =\parallel {\delta}_{h}{\widehat{\overrightarrow{v}}}_{0}{\parallel}_{2}\le \parallel {\delta}_{h}{\parallel}_{2}{\parallel {\widehat{\overrightarrow{v}}}_{0}\parallel}_{2}\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& \le ((1+{r}_{1})(1+{r}_{2})\dots (1+{r}_{h})-1){\parallel {A}_{1}\parallel}_{2}{\parallel {A}_{2}\parallel}_{2}\cdots {\parallel {A}_{h}\parallel}_{2}{\parallel {\widehat{\overrightarrow{v}}}_{0}\parallel}_{2}\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& \le ((1+{r}_{1})(1+{r}_{2})\dots (1+{r}_{h})\dots (1+{r}_{k})-1){\parallel {A}_{1}\parallel}_{2}{\parallel {A}_{2}\parallel}_{2}\cdots {\parallel {A}_{k}\parallel}_{2}{\parallel {\widehat{\overrightarrow{v}}}_{0}\parallel}_{2}\hfill \\ \hfill \phantom{\rule{1.em}{0ex}}& \le {W}_{k}\parallel {\widehat{\overrightarrow{v}}}_{0}{\parallel}_{2}\le \omega {\parallel {A}_{k}{A}_{k-1}\dots {A}_{1}\parallel}_{2}{\parallel {\widehat{\overrightarrow{v}}}_{0}\parallel}_{2}=\epsilon ,\hfill \end{array}$$

$$\left\{\begin{array}{cc}{\widehat{\overrightarrow{v}}}_{0}\hfill & \in \mathsf{\Theta}\hfill \\ \overrightarrow{v}\hfill & ={\widehat{\overrightarrow{v}}}_{0}\hfill \\ \tilde{\overrightarrow{v}}\hfill & ={\widehat{\overrightarrow{v}}}_{0}\hfill & \mathrm{has}\phantom{\rule{4.pt}{0ex}}\mathrm{no}\phantom{\rule{4.pt}{0ex}}\mathrm{solution},\hfill \\ {\overrightarrow{v}}^{\prime}\hfill & =({A}_{1}{A}_{2}\dots {A}_{h})\overrightarrow{v}\hfill \\ {\tilde{\overrightarrow{v}}}^{\prime}\hfill & =({\tilde{A}}_{1}{\tilde{A}}_{2}\dots {\tilde{A}}_{h})\tilde{\overrightarrow{v}}\hfill \\ {d}_{sta}^{(h)}({\overrightarrow{v}}^{\prime},{\tilde{\overrightarrow{v}}}^{\prime})\hfill & >\epsilon \hfill \end{array}\right.$$

## 4. Experiments

In this section, we present an example to demonstrate the application of our method to simplify the ILAHS in approximate completed trace equivalence semantics. Figure 7 is a boiler feed-water control system, which has both continuous and discrete states and can be modeled as a hybrid system. For simplicity, we assume that there exist nine discrete locations that are divided according to the combination of fuel supply (low, high) and outdoor temperature (low, medium, high). $r{s}_{0}$ is the initial location of the system, which does not involve continuous evolution and directly jumps to a different location by ${\tau}_{i}$. The continuous variables $X={({x}_{1},{x}_{2})}^{T}$; ${x}_{1}$ and ${x}_{2}$ stand for water level and water supply, respectively. The fuel supply and outdoor temperature have an effect on ${x}_{1}$ and ${x}_{2}$, and the regulation rules of ${x}_{1}$ and ${x}_{2}$ conform to their respective differential equations at different locations $r{s}_{i}^{\prime}(i=1,\dots ,8)$. The initial state of the system ${X}_{0}={(100,10)}^{T}$, and for ${\tau}_{i}$, the discrete transition program ${\alpha}_{i}:{x}_{1}^{\prime}={x}_{1}\wedge {x}_{2}^{\prime}={x}_{2}$, labeled by $lab$. Assuming the duration time at every location $r{s}_{i}^{\prime}(i=1,\dots ,8)$ is 10 s and the discrete time of continuous evolution is 5 s, Figure 8 is the corresponding ILAHS.

$$\begin{array}{ccc}{f}_{1},{f}_{4}:\hfill & {X}^{\prime}=\left[\begin{array}{cc}\frac{111}{100}& \frac{2}{5}\\ 0& \frac{151}{100}\end{array}\right]X\phantom{\rule{1.em}{0ex}}\phantom{\rule{1.em}{0ex}}{f}_{8},{f}_{5}:\hfill & {X}^{\prime}=\left[\begin{array}{cc}\frac{109}{100}& \frac{2}{5}\\ 0& \frac{149}{100}\end{array}\right]X\hfill \\ {f}_{2}:\hfill & {X}^{\prime}=\left[\begin{array}{cc}\frac{111}{100}& \frac{11}{111}\\ 0& 1\end{array}\right]X\phantom{\rule{1.em}{0ex}}\phantom{\rule{1.em}{0ex}}{f}_{3}:\hfill & {X}^{\prime}=\left[\begin{array}{cc}1& -\frac{51}{151}\\ 0& \frac{100}{151}\end{array}\right]X\hfill \\ {f}_{6}:\hfill & {X}^{\prime}=\left[\begin{array}{cc}\frac{100}{109}& \frac{9}{109}\\ 0& 1\end{array}\right]X\phantom{\rule{1.em}{0ex}}\phantom{\rule{1.em}{0ex}}{f}_{7}:\hfill & {X}^{\prime}=\left[\begin{array}{cc}1& -\frac{49}{149}\\ 0& \frac{100}{149}\end{array}\right]X\hfill \end{array}$$

The original invariant set is

$$\begin{array}{cc}Inv(r{s}_{1}^{\prime}):\hfill & \{(100\le {x}_{1}\le 133.69)\wedge (10\le {x}_{2}\le 22.801)\},\hfill \\ Inv(r{s}_{2}^{\prime}):\hfill & \{(112.801\le {x}_{1}\le 133.69)\wedge ({x}_{2}=22.801)\},\hfill \\ Inv(r{s}_{3}^{\prime}):\hfill & \{(100\le {x}_{1}\le 112.801)\wedge (10\le {x}_{2}\le 22.801)\},\hfill \\ Inv(r{s}_{4}^{\prime}):\hfill & \{(100\le {x}_{1}\le 133.69)\wedge (10\le {x}_{2}\le 22.801)\},\hfill \\ Inv(r{s}_{5}^{\prime}):\hfill & \{(100\le {x}_{1}\le 129.13)\wedge (10\le {x}_{2}\le 22.201)\},\hfill \\ Inv(r{s}_{6}^{\prime}):\hfill & \{(112.801\le {x}_{1}\le 129.13)\wedge ({x}_{2}=22.201)\},\hfill \\ Inv(r{s}_{7}^{\prime}):\hfill & \{(100\le {x}_{1}\le 112.201)\wedge (10\le {x}_{2}\le 22.201)\},\hfill \\ Inv(r{s}_{8}^{\prime}):\hfill & \{(100\le {x}_{1}\le 129.13)\wedge (10\le {x}_{2}\le 22.201)\}.\hfill \end{array}$$

Assume Figure 9 is the approximate ILAHS, where

$$\begin{array}{cc}{\tilde{f}}_{1},{\tilde{f}}_{4},{\tilde{f}}_{5},{\tilde{f}}_{8}:\hfill & {\tilde{X}}^{\prime}=\left[\begin{array}{cc}\frac{11}{10}& \frac{2}{5}\\ 0& \frac{3}{2}\end{array}\right]X,\hfill \\ {\tilde{f}}_{2},{\tilde{f}}_{6}:\hfill & {\tilde{X}}^{\prime}=\left[\begin{array}{cc}\frac{10}{11}& \frac{1}{11}\\ 0& 1\end{array}\right]X,\hfill \\ {\tilde{f}}_{3},{\tilde{f}}_{7}:\hfill & {\tilde{X}}^{\prime}=\left[\begin{array}{cc}1& -\frac{1}{3}\\ 0& \frac{2}{3}\end{array}\right]X.\hfill \end{array}$$

The approximate invariant set is

$$\begin{array}{cc}\tilde{Inv(r{s}_{1}^{\prime})},\tilde{Inv(r{s}_{4}^{\prime})}:\hfill & \{(100\le {x}_{1}\le 131.4)\wedge (10\le {x}_{2}\le 22.5)\},\hfill \\ \tilde{Inv(r{s}_{5}^{\prime})},\tilde{Inv(r{s}_{8}^{\prime})}:\hfill & \{(100\le {x}_{1}\le 131.4)\wedge (10\le {x}_{2}\le 22.5)\},\hfill \\ \tilde{Inv(r{s}_{2}^{\prime})},\tilde{Inv(r{s}_{6}^{\prime})}:\hfill & \{(112.5\le {x}_{1}\le 131.4)\wedge ({x}_{2}=22.5)\},\hfill \\ \tilde{Inv(r{s}_{3}^{\prime})},\tilde{Inv(r{s}_{7}^{\prime})}:\hfill & \{(100\le {x}_{1}\le 112.5)\wedge (10\le {x}_{2}\le 22.5)\}.\hfill \end{array}$$

The approximate discrete transition program is ${\tilde{\alpha}}_{i}:{x}_{1}^{\prime}={x}_{1}\wedge {x}_{2}^{\prime}={x}_{2}$, labeled by $lab$.

Given an error derivation $\epsilon =0.1$, ${\mathcal{H}}_{1}$ is $\epsilon $-approximate completed trace equivalent to ${\mathcal{H}}_{3}$ (Figure 9), i.e., in the semantics of completed trace equivalence, ${\mathcal{H}}_{1}$ is identical to ${\mathcal{H}}_{3}$, which involves fewer states. Therefore, the original hybrid automaton (Figure 7) can be reduced to an equivalent but simpler hybrid automaton (Figure 10), and the design of the hybrid system is optimized with the theory of approximate completed trace equivalence.

## 5. Conclusions

With some restrictions, a general hybrid system can be specialized into an inhomogeneous linear algebraic hybrid system (ILAHS), which is ubiquitous in reality. Since errors are inevitable in engineering technology, it is meaningful to introduce deviation to the analysis of hybrid systems. Given an error derivation, this paper first proposes the theory of approximate completed trace equivalence. Then we come up with a new approach (based on SAS solving) to approximate completed trace equivalence, and the computation complexity is also analyzed. Finally, a case study is presented to illustrate the practicality of our method. Compared to the well-established approaches in this field, our method applies to more general ILAHS. Moreover, this technology is promising for solving parametric approximate completed trace equivalence. We will address this issue in future work.

## Author Contributions

Conceptualization, investigation, supervision, and writing, H.H.; review and editing, J.X.; review, J.W.

## Funding

This work was partly supported by the National Natural Science Foundation of China under Grant No. 61772006, the Science and Technology Program of Guangxi under Grant No. AB17129012, the Science and Technology Major Project of Guangxi under Grant No. AA17204096, the Special Fund for Scientific and Technological Bases and Talents of Guangxi under Grant No. AD16380076, and the Special Fund for Bagui Scholars of Guangxi.

## Conflicts of Interest

We declare that we do not have any commercial or associative interest that represents a conflict of interest in connection with the work submitted.

## References

- Henzinger, T.A. The theory of hybrid automata. In Verification of Digital and Hybrid Systems; Springer: Berlin, Germany, 2000; pp. 265–292. [Google Scholar]
- van Glabbeek, R.J. The linear time-branching time spectrum. In Proceedings of the 1st International Conference on Concurrency Theory (CONCUR ’90), Amsterdam, The Netherlands, 27–30 August 1990; pp. 278–297. [Google Scholar]
- van Glabbeek, R.J. The linear time-branching time spectrum II. In Proceedings of the 4th International Conference on Concurrency Theory (CONCUR’93), Hildesheim, Germany, 23–26 August 1993; pp. 66–81. [Google Scholar]
- Yang, H.; Wu, J.; Zhang, Z.; Liu, Y. Approximate completed trace equivalence of three dimensional t-model nonlinear algebraic hybrid systems. Appl. Math. Inf. Sci.
**2013**, 7, 1693–1697. [Google Scholar] [CrossRef] - Yang, H.; Wu, J.; Zhang, Z. Approximate completed trace equivalence of homogeneous linear algebraic hybrid systems. J. Converg. Inf. Technol.
**2013**, 8, 520–527. [Google Scholar] - Yang, L.; Hou, X.; Xia, B. A complete discrimination system for polynomials. Sci. China Ser. E Technol. Sci.
**1996**, 39, 628–646. [Google Scholar] - Chen, Y.; Xia, B.; Yang, L.; Zhan, N. Generating polynomial invariants with DISCOVERER and QEPCAD. In Formal Methods and Hybrid Real-Time Systems; Springer: Berlin, Germany, 2007; pp. 67–82. [Google Scholar]
- Xia, B.; Yang, L. An algorithm for isolating the real solutions of semi-algebraic systems. J. Symb. Comput.
**2002**, 34, 461–477. [Google Scholar] [CrossRef] - Xia, B.; Zhang, T. Real solution isolation using interval arithmetic. Comput. Math. Appl.
**2006**, 52, 853–860. [Google Scholar] [CrossRef] - Yang, L. Recent advances on determining the number of real roots of parametric polynomials. J. Symb. Comput.
**1999**, 28, 225–242. [Google Scholar] [CrossRef] - Yang, L.; Hou, X.; Xia, B. A complete algorithm for automated discovering of a class of inequality-type theorems. Sci. China Ser. F Inf. Sci.
**2001**, 44, 33–49. [Google Scholar] [CrossRef] - Girard, A.; Zheng, G. Verification of safety and liveness properties of metric transition systems. ACM Trans. Embed. Comput. Syst. (TECS)
**2012**, 11, 1–23. [Google Scholar] [CrossRef] - Girard, A.; Pappas, G.J. Approximation metrics for discrete and continuous systems. IEEE Trans. Autom. Control.
**2007**, 52, 782–798. [Google Scholar] [CrossRef] - Alfaro, L.D.; Faella, M.; Stoelinga, M. Linear and branching system metrics. IEEE Trans. Softw. Eng.
**2008**, 35, 258–273. [Google Scholar] [CrossRef] - Cao, Y.; Sun, S.X.; Wang, H.; Chen, G. A behavioral distance for fuzzy-transition systems. IEEE Trans. Fuzzy Syst.
**2013**, 21, 735–747. [Google Scholar] [CrossRef] - Fan, C.; Kapinski, J.; Jin, X.; Mitra, S. Locally optimal reach set over-approximation for nonlinear systems. In Proceedings of the 2016 International Conference Embedded Software, Pittsburgh, PA, USA, 2–7 October 2016; pp. 1–10. [Google Scholar]
- Kendra, L.; Meeko, O. Finite state approximation for verification of partially observable stochastic hybrid systems. In Proceedings of the 18th International Conference on Hybrid Systems: Computation and Control, Seattle, WA, USA, 14–16 April 2015; pp. 159–168. [Google Scholar]
- Yang, Y.; Wang, Y.; Wu, Q.M.J.; Lin, X.; Liu, M. Progressive learning machine: A new approach for general hybrid system approximation. IEEE Trans. Neural Netw. Learn. Syst.
**2015**, 26, 1855–1874. [Google Scholar] [CrossRef] [PubMed] - Fan, C.; Qi, B.; Mitra, S.; Viswanathan, M.; Duggirala, P.S. Automatic reachability analysis for nonlinear hybrid models with C2E2. In Proceedings of the 28th International Conference Comput. Aided Verification, Toronto, ON, Canada, 17–23 July 2016; pp. 531–538. [Google Scholar]
- Xiang, W.; Tran, H.D.; Johnson, T.T. Output reachable set estimation for switched linear systems and its application in safety verification. IEEE Trans. Autom. Control
**2017**, 62, 5380–5387. [Google Scholar] [CrossRef] - Bemporad, A.; Torrisi, F.D.; Morari, M. Optimization-based verification and stability characterization of piecewise affine and hybrid systems. In Proceedings of the 3rd International Conference on Hybrid Systems: Computation and Control (HSCC 2000), Pittsburgh, PA, USA, 23–25 March 2000; pp. 45–58. [Google Scholar]
- Girard, A. Reachability of uncertain linear systems using zonotopes. In Proceedings of the 8th International Conference on Hybrid Systems: Computation and Control (HSCC 2005), Zurich, Switzerland, 9–11 March 2005; pp. 291–305. [Google Scholar]
- Kurzhanski, A.B.; Varaiya, P. Ellipsoidal techniques for reachability analysis: Internal approximation. Syst. Control Lett.
**2000**, 41, 201–211. [Google Scholar] [CrossRef] - Yang, H. Over approximate flow pipeline volume algorithm for three variables real-time linear algebraic hybrid automaton. In Proceedings of the 7th International Conference on Management, Education, Information and Control (MEICI 2017), Shenyang, China, 15–17 September 2017; Available online: https://download.atlantis-press.com/article/25885913.pdf (accessed on 25 October 2019). [Google Scholar]
- Alur, R.; Courcoubetis, C.; Halbwachs, N.; Henzinger, T.A.; Ho, P.-H. Hybrid Automata: An Algorithmic Approach to the Specification and Verification of Hybrid Systems; Springer: Berlin, Germany, 1993; pp. 209–229. [Google Scholar]
- Alur, R.; Courcoubetis, C.; Halbwachs, N.; Henzinger, T.A.; Ho, P.-H.; Nicollin, X.; Olivero, A.; Sifakis, J.; Yovine, S. The algorithmic analysis of hybrid systems. Theor. Comput. Sci.
**1995**, 138, 3–34. [Google Scholar] [CrossRef] - Maler, O.; Manna, Z.; Pnueli, A. From timed to hybrid systems. In Proceedings of the REX Workshop 1991, Mook, The Netherlands, 3–7 June 1991; pp. 447–484. [Google Scholar]
- Alur, R.; Henzinger, T.A. Modularity for timed and hybrid systems. In Proceedings of the 8th International Conference on Concurrency Theory (CONCUR ’97), Warsaw, Poland, 1–4 July 1997; pp. 74–88. [Google Scholar]
- Lygeros, J.; Tomlin, C.; Sastry, S. Controllers for reachability specifications for hybrid systems. Automatica
**1999**, 35, 349–370. [Google Scholar] [CrossRef] - Sankaranarayanan, S.; Sipma, H.B.; Manna, Z. Constructing invariants for hybrid systems. Form. Methods Syst. Des.
**2008**, 32, 25–55. [Google Scholar] [CrossRef] - Xia, B. Discoverer: A tool for solving semi-algebraic systems. ACM Commun. Comput. Algebra
**2007**, 41, 102–103. [Google Scholar] [CrossRef] - Chen, C.; Davenport, J.H.; Lemaire, F.; Maza, M.M.; Xia, B.; Xiao, R.; Xie, Y. Computing the real solutions of polynomial systems with the regular chains library in maple. ACM Commun. Comput. Algebra
**2011**, 45, 166–168. [Google Scholar] [CrossRef] - Chen, C.; Davenport, J.H.; May, J.P.; Maza, M.M.; Xia, B.; Xiao, R. Triangular decomposition of semi-algebraic systems. J. Symb. Comput.
**2013**, 49, 3–26. [Google Scholar] [CrossRef] - Chen, C.; Davenport, J.H.; Maza, M.M.; Xia, B.; Xiao, R. Computing with semi-algebraic sets: Relaxation techniques and effective boundaries. J. Symb. Comput.
**2013**, 52, 72–96. [Google Scholar] [CrossRef] - Gallo, G.; Mishra, B. Efficient Algorithms and Bounds for Wu-Ritt Characteristic Sets. In Proceedings of the MEGA’90, Livorno, Italy, 17–21 April 1990; pp. 119–142. [Google Scholar]

© 2019 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 (http://creativecommons.org/licenses/by/4.0/).