verifying switched system stability with logic
TRANSCRIPT
Verifying Switched System Stability With LogicYong Kiam Tan
Carnegie Mellon University
Pittsburgh, PA, USA
Stefan Mitsch
Carnegie Mellon University
Pittsburgh, PA, USA
Andrรฉ Platzer
Carnegie Mellon University
Pittsburgh, PA, USA
ABSTRACTSwitched systems are known to exhibit subtle (in)stability behav-
iors requiring system designers to carefully analyze the stability
of closed-loop systems that arise from their proposed switching
control laws. This paper presents a formal approach for verifying
switched system stability that blends classical ideas from the con-
trols and verification literature using differential dynamic logic (dL),a logic for deductive verification of hybrid systems. From controls,
we use standard stability notions for various classes of switching
mechanisms and their corresponding Lyapunov function-based
analysis techniques. From verification, we use dLโs ability to verify
quantified properties of hybrid systems and dL models of switched
systems as looping hybrid programs whose stability can be for-
mally specified and proven by finding appropriate loop invariants,i.e., properties that are preserved across each loop iteration. This
blend of ideas enables a trustworthy implementation of switched
system stability verification in the KeYmaera X prover based on dL.For standard classes of switching mechanisms, the implementation
provides fully automated stability proofs, including searching for
suitable Lyapunov functions. Moreover, the generality of the deduc-
tive approach also enables verification of switching control laws
that require non-standard stability arguments through the design of
loop invariants that suitably express specific intuitions behind those
control laws. This flexibility is demonstrated on three case studies:
a model for longitudinal flight control by Branicky, an automatic
cruise controller, and Brockettโs nonholonomic integrator.
CCS CONCEPTSโข Theory of computation โ Logic and verification; Timedand hybrid models; โข Computing methodologies โ Computa-tional control theory; โข Computer systems organization โ Em-bedded systems.
KEYWORDSswitched system stability, loop invariants, differential dynamic logic
1 INTRODUCTIONSwitched systems provide a powerful mathematical paradigm for
the design and analysis of discontinuous (or nondifferentiable) con-
trol mechanisms [10, 22, 28, 44]. Examples of such mechanisms
include: bang-bang controllers that switch between on/off modes;
gain schedulers that switch between a family of locally valid linear
controllers; and supervisory control, where a supervisor switches
between candidate controllers based on logical criteria [22, 28].
However, switched systems are known to exhibit subtle (in)stability
behaviors, e.g., switching between stable subsystems can lead to
instability [22], so it is important for system designers to adequately
justify the stability of their proposed switching designs. Verification
and validation are complementary approaches for such justifica-
tions: validation approaches, such as system simulations or lab
experiments, allow designers to check that their models and con-
trollers conform to real world behavior; verification approaches
yield formal mathematical proofs that the stability properties hold
for all possible switching decisions everywhere in the modelโs infi-
nite state space, not just for finitely-many simulated trajectories.
This paper presents a logic-based, deductive approach for veri-
fying switched system stability under various classes of switching
mechanisms. The key insight is that control-theoretic stability ar-
guments for switching control can be formally justified by blending
techniques from discrete program verification with continuous dif-
ferential equations analysis using differential dynamic logic (dL),a logic for deductive verification of hybrid systems [33, 34]. In-
tuitively, switched systems are modeled in dL as looping hybridprograms [46], as in the following snippet ({ยท}โ denotes repetition):
{ ๐ข := ๐๐ก๐๐ (๐ฅ); // switching controller (discrete dynamics)
๐ฅ โฒ = ๐๐ข (๐ฅ) // actuate decision (continuous dynamics)
}โ@invariant( ... ) // switching loop with invariant annotation
Accordingly, switched system stability is formally specified in dLas first-order quantified safety properties of such loops (Section 2.2),
and these safety properties can then be proved rigorously by com-
bining fundamental ideas from verification and control, namely:
i) identification of loop invariants (@invariant above), i.e., proper-
ties of the (discrete) loop that are preserved across all executions
of the loop body, ii) compositional verification for separately ana-
lyzing the discrete and continuous dynamics of the loop body, and
iii) Lyapunov functions, i.e., auxiliary energy functions that enable
stability analysis for the continuous dynamics.
Section 3 identifies key loop invariants underlying stability ar-
guments for various classes of switching mechanisms and derives
sound stability proof rules for those mechanisms. Crucially, these
syntactic derivations are built from dLโs sound foundations for hy-
brid program reasoning [33, 34], without the need to introduce
new mathematical concepts such as non-classical weak solutions or
nondifferentiable Lyapunov functions [9, 16]. Section 4 uses these
derivations to implement support for switched systems in the KeY-
maera X prover based on dL [12], including a modeling interface
for switched systems, automatic search for Lyapunov function can-
didates, and sound verification of switched system stability spec-
ifications. Notably, the implementation requires no extensions toKeYmaera Xโs soundness-critical core and thereby directly inherits
all of KeYmaera Xโs correctness guarantees [12, 25]. This trustwor-
thiness is necessary for computer-aided verification of complex,
controlled switching designs, where the number of correctness con-
ditions on their Lyapunov functions scales quadratically with the
number of switching modes (Section 3.2), making pen-and-paper
arX
iv:2
111.
0192
8v1
[ee
ss.S
Y]
2 N
ov 2
021
Yong Kiam Tan, Stefan Mitsch, and Andrรฉ Platzer
proofs error-prone or infeasible. Section 5 further applies the deduc-
tive approach on three case studies, chosen because each require
subtle twists to standard switched system stability arguments:
โข Longitudinal flight control [4]: This model is parametric (5
parameters, 2 state variables) and its stability justification
due to Branicky [4] uses a โnoncustomaryโ Lyapunov func-
tion [10], whose correctness requires intricate arithmetic
reasoning. The proof is enabled through the use of ghostswitching where virtual switching modes are introduced for
the sake of the stability analysis, similar to the use of ghost
variables in program verification [30, 34, 35].
โข Automatic cruise control [29]: This hybrid automaton switches
between several operating modes, e.g., standard/emergency
braking, accelerating, and PI control, based on specific guard
conditions. Lyapunov function candidates can be numeri-
cally generated [26], but must be corrected for soundness.
โข Brockettโs nonholonomic integrator [7]: A large class of con-
trol systems can be transformed to the nonholonomic in-
tegrator but this system is not stabilizable by continuous
feedback [7, 22]. Instead, the system must be initially con-
trolled into a suitable region where a stabilizing control law
can be applied. The stability argument must show that the
initial control mode does not destabilize the system.
These case studies are verified semi-automatically in KeYmaera X,
with user guidance to design and prove modified loop invariants
that suitably capture the specific intuitions behind their respective
control laws. The flexibility and generality of this paperโs deductive
approach enables suchmodifications while ensuring that the overall
stability argument remains valid. In fact, these modified stability
proofs enjoy exactly the same, strong correctness guarantees thanks
to their formalization within the uniform dL logical foundations.
All proofs are in the appendix.
2 BACKGROUNDThis section briefly recalls switched systems and their hybrid pro-
gram models introduced by Tan and Platzer [46]. The section then
explains how stability for these models can be formally specified
and verified using differential dynamic logic (dL) [33, 34].
2.1 Switched Systems as Hybrid Programs2.1.1 Hybrid Programs. The language of hybrid programs is gen-erated by the following grammar, where ๐ฅ is a variable, ๐ is a dLterm, and ๐ is a formula of first-order real arithmetic [33, 34].
๐ผ, ๐ฝ ::= ๐ฅ โฒ = ๐ (๐ฅ) &๐ | ๐ฅ := ๐ | ?๐ | ๐ผ ; ๐ฝ | ๐ผ โช ๐ฝ | ๐ผโ
Continuous dynamics are modeled using systems of ordinary
differential equations (ODEs) ๐ฅ โฒ = ๐ (๐ฅ) &๐ evolving within do-
main ๐ ; the ODE is written as ๐ฅ โฒ = ๐ (๐ฅ) when there is no domain
constraint, i.e., ๐ โก true. Discrete dynamics are modeled using
assignments (๐ฅ := ๐ assigns the value of term ๐ to ๐ฅ) and tests (?๐
checks whether condition ๐ is true in the current state). The pro-
gram combinators are used to piece together sub-programs to form
programs with hybrid dynamics; the combinators are: sequential
composition (๐ผ ; ๐ฝ runs ๐ผ followed by ๐ฝ), nondeterministic choice
(๐ผ โช ๐ฝ runs ๐ผ or ๐ฝ nondeterministically), and nondeterministic
repetition (๐ผโ repeats ๐ผ for any number of iterations).
Throughout this paper, ๐ฅ = (๐ฅ1, . . . , ๐ฅ๐) denotes the vector
of continuous state variables for the system under consideration.
Other variables are used for program auxiliaries, e.g., to describe
memory and timing components of switching controllers.
2.1.2 Switched systems. A switched system is described by a finite
family P of ODEs ๐ฅ โฒ = ๐๐ (๐ฅ), ๐ โ P and a set of switching signals๐ : [0,โ) โ P that prescribe the ODE ๐ฅ โฒ = ๐๐ (๐ก ) (๐ฅ) to follow
at time ๐ก along the systemโs evolution. Tan and Platzer [46] use
hybrid programs as formal models for various classes of switching
mechanisms; one example is arbitrary switching [22], where the
system is allowed to follow any switching signal, i.e., it switches
arbitrarily (at any time) between the ODEs ๐ฅ โฒ = ๐๐ (๐ฅ), ๐ โ P. This
can be used to model real world systems whose switching behavior
is uncontrolled or a priori unknown. Arbitrary switching is modeled
by the hybrid program ๐ผarb [46, Proposition 1]:
๐ผarb โก( โ๐โP
๐ฅ โฒ = ๐๐ (๐ฅ))โ
(1)
The behavior of program ๐ผarb is analogous to a computer simula-
tion of arbitrary switching: on each iteration, the program makes a
(discrete) nondeterministic choice of switching decision
โ๐โP
(ยท)
to select an ODE ๐ฅ โฒ = ๐๐ (๐ฅ) which it then follows continuously for
some duration before repeating the simulation loop.
The hybrid programs language can be used to model various
other classes of switching mechanisms [22, 46], including general
controlled switching, as illustrated in Section 1, where a (discrete)
control law ๐ข := ๐๐ก๐๐ (๐ฅ) decides the ODE ๐ฅ โฒ = ๐๐ข (๐ฅ) to switch to
on each loop iteration. Stability for these models is explained next.
2.2 Stability as Quantified Loop SafetyThis paper studies uniform global pre-asymptotic stability (UGpAS)
for switched systems [16, 17, 22], defined as follows:
Definition 1 (UGpAS [16, 17]). Let ฮฆ(๐ฅ) denote the set of all
(domain-obeying) solutions1 ๐ : [0,๐๐ ] โ R๐ for a switched
system from state ๐ฅ โ R๐ . The origin 0 โ R๐ is:
โข uniformly globally pre-asymptotically stable if the sys-tem is uniformly stable and uniformly globally pre-attractive,
โข uniformly stable if, for all Y > 0, there exists ๐ฟ > 0 such
that from all initial states ๐ฅ โ R๐ with โฅ๐ฅ โฅ < ๐ฟ , all solutions
๐ โ ฮฆ(๐ฅ) satisfy โฅ๐ (๐ก)โฅ < Y for all times 0 โค ๐ก โค ๐๐ , and
โข uniformly globally pre-attractive if, for all Y > 0, ๐ฟ > 0,
there exists ๐ โฅ 0 such that from all initial states ๐ฅ โ R๐with โฅ๐ฅ โฅ < ๐ฟ , all solutions ๐ โ ฮฆ(๐ฅ) satisfy โฅ๐ (๐ก)โฅ < Y for
all times ๐ โค ๐ก โค ๐๐ .
The UGpAS definition can be understood intuitively for a system
with a switching control mechanism:
โข stability means the mechanism keeps the system close to the
origin if the system is initially perturbed close to the origin,
โข global pre-attractivity means the mechanism drives the sys-
tem to the origin asymptotically as ๐ก โ โ, and
โข uniform means the stability and pre-attractivity properties
are independent of both the nondeterminism in the switching
1A formal construction of the (right-maximal) solution ๐ for a given switching signal
๐ is available elsewhere [46, Appendix A].
Verifying Switched System Stability With Logic
mechanism (e.g., arbitrary switching) and the choice of initial
states satisfying โฅ๐ฅ โฅ < ๐ฟ ; for brevity in subsequent sections,
โuniformโ is elided when describing stability properties.
Remark 1. Switched systems whose solutions are all uniformly
bounded in time, i.e., there exists ๐๐ such that for all solutions ๐ ,
๐๐ โค ๐๐ , are trivially pre-attractive. Goebel et al. [16, 17] intro-
duce the notion of pre-attractivity as opposed to attractivity for
hybrid systems because it separates considerations about whether
a hybrid systemโs solutions are complete, i.e., solutions exist forall (forward) time, from conditions for stability and attractivity.
Indeed, it is common in the hybrid and switched systems literature
to either ignore incomplete solutions or assume the models under
consideration only have complete solutions [22, 26, 49]. Instead of
predicating proofs on these hypotheses, this paper formalizes the
(weaker) notion of UGpAS for switched systems directly.
The definition of UGpAS nests alternating quantification over
real numbers with temporal quantification over the solutions ๐ of
switched systems. This combination of quantifiers can be expressed
formally using the formula language of dL [33, 34], whose grammar
is shown below, โผ โ {=,โ , โฅ, >, โค, <} is a comparison operator
between dL terms ๐, ๐ and ๐ผ is a hybrid program:
๐,๐ ::= ๐ โผ ๐ | ๐ โง๐ | ๐ โจ๐ | ยฌ๐ | โ๐ฃ ๐ | โ๐ฃ ๐ | [๐ผ]๐ | โจ๐ผโฉ๐This grammar extends the first-order language of real arithmetic
(FOLR) with the box ([๐ผ]๐) and diamond (โจ๐ผโฉ๐) modality formulas
which express that all or some runs of hybrid program ๐ผ satisfy
postcondition ๐ , respectively. Real arithmetic FOLR is decidable by
quantifier elimination [47] and serves as a useful base specification
language. Various specifications are equivalently definable in FOLR,
e.g., Euclidean norm bounds โฅ๐ฅ โฅ โผ Ydefโก โฅ๐ฅ โฅ2 โผ Y2 (for Y โฅ 0) and
topological operations such as the boundary ๐๐ and closure ๐ of
the set characterized by formula ๐ [3].
The box modality formula [๐ผ]๐ expresses safety properties ๐ of
program ๐ผ that must hold along all of its executions [34]. When ๐ผ
models a switched system, the box modality quantifies (uniformly)
over all times for all solutions arising from the switching mecha-
nism. Accordingly, UGpAS for switched systems is formally speci-
fied by nesting the box modality with the first-order quantifiers.
Lemma 2 (UGpAS in differential dynamic logic). The origin0 โ R๐ for a switched system modeled by program ๐ผ is UGpAS iff thedL formula UGpAS(๐ผ) is valid. Variables Y, ๐ฟ,๐ , ๐ก are fresh in ๐ผ :
UGpAS(๐ผ) โก UStab(๐ผ) โง UGpAttr(๐ผ)UStab(๐ผ) โก โY>0โ๐ฟ>0โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ [๐ผ] โฅ๐ฅ โฅ < Y
)UGpAttr(๐ผ) โก โY>0โ๐ฟ>0โ๐โฅ0โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ
[๐ก := 0;๐ผ, ๐ก โฒ = 1] (๐ก โฅ ๐ โ โฅ๐ฅ โฅ < Y))
Here, UStab(๐ผ) and UGpAttr(๐ผ) characterize stability and globalpre-attractivity of ๐ผ , respectively. In UGpAttr(๐ผ), ๐ผ, ๐ก โฒ = 1 denotesthe hybrid program obtained from ๐ผ by augmenting its continuousdynamics so that variable ๐ก tracks the progression of time.
Formulas UStab(๐ผ) and UGpAttr(๐ผ) syntactically formalize in
dL the corresponding quantifiers in Def. 1. In UGpAttr(๐ผ), the freshclock variable ๐ก is initialized to 0 and syntactically tracks the pro-
gression of time along switched system solutions. The program
๐ผ, ๐ก โฒ = 1 can, e.g., be constructed by adding a clock ODE ๐ก โฒ = 1 to
all ODEs in the switched system model ๐ผ . Accordingly, the post-
condition ๐ก โฅ ๐ โ โฅ๐ฅ โฅ < Y expresses that the system state norm is
bounded by Y after๐ time units along any switching trajectory, as re-
quired in Def. 1. Various other stability notions are of interest in the
continuous and hybrid systems literature [13, 17, 22, 29, 36, 44, 45].
These variations can also be formally specified in dL [45] but are
left out of scope for this paper.
2.3 Proof CalculusThe dL proof calculus enables formal, deductive verification of
UGpAS stability specifications through compositional reasoning
principles for hybrid programs [33, 34] and a complete axiomatiza-
tion for ODE invariants [35]. For example, an important syntactic
tool for differential equations reasoning is the Lie derivative of term
๐ along ODE ๐ฅ โฒ = ๐ (๐ฅ), defined as L๐(๐) def
= โ๐ ยท ๐ . The soundcalculation and manipulation of Lie derivatives is enabled in dLthrough the use of syntactic differentials [33].
All proofs are presented in a classical sequent calculus with the
usual rules for manipulating logical connectives and sequents. The
semantics of sequent ฮ โข ๐ is equivalent to the formula (โง๐ โฮ๐ ) โ๐ and a sequent is valid iff its corresponding formula is valid. The
key (derived) dL proof rule used in this paper is:
loop
ฮ โข Inv Inv โข [๐ผ] Inv Inv โข ๐
ฮ โข [๐ผโ]๐
The loop rule says that, in order to prove validity of the conclu-
sion (below the rule bar), it suffices to prove the three premises
(above the rule bar), respectively from left to right: i) the initial
assumptions ฮ imply Inv, ii) Inv is preserved across the loop body ๐ผ ,i.e., Inv is a loop invariant for ๐ผโ, and iii) Inv implies the postcondi-
tion ๐ . The identification of loop invariants Inv is crucial for formal
proofs of UGpAS, as illustrated by the following deductive proof
skeleton for stability (a similar skeleton is used for pre-attractivity):
Deductionxloop
.
.
.
ฮ โข Inv
ฮ1 โข ๐1 ยท ยท ยท ฮ๐ โข ๐๐
.
.
.
(hybrid program
reasoning for ๐ผ
)Inv โข [๐ผ] Inv
.
.
.
Inv โข โฅ๐ฅ โฅ < Y
ฮ โข [๐ผโ] โฅ๐ฅ โฅ < Y
.
.
.
(logic/arithmetic
reasoning for ฮ
)โข UStab(๐ผโ)
Proofs proceed upwards by deduction, where each reasoning step
is justified by sound dL axioms and rules of inference, e.g., the loop
rule. The skeleton above syntactically derives a proof rule that
reduces a stability proof for ๐ผโ to proofs of the top-most premises,
ฮ1 โข ๐1 ยท ยท ยท ฮ๐ โข ๐๐ , which corresponding to required logical
and arithmetical conditions on Lyapunov functions for various
switching mechanisms. The loop invariant step (highlighted in red)
crucially ties together these conditions on Lyapunov functions and
hybrid program reasoning for switched systems.
Yong Kiam Tan, Stefan Mitsch, and Andrรฉ Platzer
Y
๐ฟ
0
๐<๐
L๐๐(๐ ) โค0
Y
๐ฟ
0
๐<๐(bounded)
๐ โฅ๐โ๐<๐ +๐๐ก๐<๐
Figure 1: Loop invariants for UGpAS (arbitrary switching),stability (left) and pre-attractivity (right). Switching trajec-tories are illustrated by alternating black and green arrows.
3 LOOP INVARIANTS FOR SWITCHEDSYSTEM STABILITY
This section identifies loop invariants for proving UGpAS under
various classes of switching mechanisms with Lyapunov func-
tions [5, 21, 22]; relevant mathematical arguments are presented
briefly, see AppendixA for more details. Throughout the section,
loop invariants are progressively tweaked to account for new design
insights behind increasingly complex switching mechanisms.
3.1 Arbitrary and State-Dependent Switching3.1.1 Arbitrary Switching. Stability for the arbitrary switching
model ๐ผarb from (1) can be verified by finding a so-called com-mon Lyapunov function ๐ for all of the ODEs ๐ฅ โฒ = ๐๐ (๐ฅ), ๐ โ Psatisfying the following arithmetical conditions [22, 44]:
i) ๐ (0) = 0 and ๐ (๐ฅ) > 0 for all โฅ๐ฅ โฅ > 0,
ii) ๐ is radially unbounded, i.e., for all ๐, there exists ๐พ > 0 such
that โฅ๐ฅ โฅ < ๐พ for all ๐ (๐ฅ) โค ๐, and
iii) for each ODE ๐ฅ โฒ = ๐๐ (๐ฅ), ๐ โ P, the Lie derivative L๐๐(๐ )
satisfies: L๐๐(๐ ) (0) = 0 and L
๐๐(๐ ) (๐ฅ) < 0 for all โฅ๐ฅ โฅ > 0.
Conditions i)โiii) are generalizations of well-known conditions
for stability of ODEs [8, 21] to arbitrary switching. Intuitively, con-
ditions i) and iii) ensure that๐ acts as an auxiliary energy function
whose value decreases asymptotically to zero (at the origin) along
all switching trajectories of the system; the radial unboundedness
condition ii) ensures that this argument applies to all system states
for global pre-attractivity [21]. Correctness of these conditions can
be proved in dL using loop invariants, see Fig. 1 (explained below).
Stability. The specification UStab(๐ผarb) requires that all trajec-tories of ๐ผarb stay in the grey ball โฅ๐ฅ โฅ < Y, starting from a chosen
ball โฅ๐ฅ โฅ < ๐ฟ , see Fig. 1 (left). Condition i) guarantees that theball โฅ๐ฅ โฅ < Y contains a sublevel set of the Lyapunov function
satisfying ๐ < ๐ (dashed blue curve) and this sublevel set con-
tains a smaller ball โฅ๐ฅ โฅ < ๐ฟ [8, 21]. Condition iii) shows that thissublevel set is invariant for each ODE ๐ฅ โฒ = ๐๐ (๐ฅ), ๐ โ P because
L๐๐(๐ ) (๐ฅ) โค 0, as illustrated by the dashed black and green arrows
for two different switching choices ๐ โ P both locally pointing
inwards on the boundary of the sublevel set. Thus, the formula
Inv๐ โก โฅ๐ฅ โฅ < Y โง๐ <๐ , which characterizes the blue sublevel set,
is an invariant for all possible switching choices in the loop body of
๐ผarb, which makes Inv๐ a suitable loop invariant for UStab(๐ผarb).
Pre-attractivity. The specification UGpAttr(๐ผarb) requires thatall trajectories of ๐ผarb stay in the grey ball โฅ๐ฅ โฅ < Y after a chosen
time ๐ , starting from the initial ball โฅ๐ฅ โฅ < ๐ฟ , see Fig. 1 (right).
The ball โฅ๐ฅ โฅ < ๐ฟ is compact, i.e., contained in a sublevel set sat-
isfying ๐ < ๐ for some๐ > 0 (outer dashed blue curve); this
sublevel set is bounded by condition ii). Like the stability argu-
ment, condition i) guarantees that there is a sublevel set ๐ < ๐
(inner dashed blue curve) contained in the ball โฅ๐ฅ โฅ < Y, and con-
dition iii) shows that both sublevel sets characterized by ๐ < ๐
and ๐ < ๐ are invariants for every ODE in the loop body of ๐ผarb.
The set characterized by formula ๐ โฅ ๐ โง๐ โค๐ is compact and
bounded away from the origin, which implies by condition iii) thatthere is a uniform bound ๐ < 0 on this set, where for each ODE
๐ฅ โฒ = ๐๐ (๐ฅ), ๐ โ P, L๐๐(๐ ) (๐ฅ) โค ๐ . Thus, the value of Lyapunov
function ๐ decreases at rate ๐ , regardless of switching choices in
the loop body of ๐ผarb, as long as it has not entered๐ < ๐ . The loop
invariant for UGpAttr(๐ผarb) syntactically expresses this intuition:
Inv๐ โก ๐ <๐ โง (๐ โฅ ๐ โ ๐ <๐ + ๐๐ก). For a sufficiently large
choice of ๐ with๐ + ๐๐ โค ๐ , trajectories at time ๐ก โฅ ๐ satisfy
๐ < ๐ so they are contained in the โฅ๐ฅ โฅ < Y ball.
The loop invariants identified above enable derivation of a for-
mal dL stability proof rule for ๐ผarb (deferred to a more general
version in Corollary 3 below). In fact, since arbitrary switching is
the most permissive form of switching [22], UGpAS for any switch-
ing mechanism can be soundly justified using the loop invariants
above in case a suitable common Lyapunov function can be found.
3.1.2 State-dependent Switching. The state-dependent switchingmechanism [22] constrains arbitrary switching by allowing execu-
tion of (and switching to) an ODE ๐ฅ โฒ = ๐๐ (๐ฅ), ๐ โ P only when
the system state is in domain ๐๐ . This is modeled by the hybrid
program ๐ผstate โก( โ
๐โP ๐ฅ โฒ = ๐๐ (๐ฅ) &๐๐
)โ[46, Proposition 2],
where arbitrary switching ๐ผarb corresponds to the special case with
๐๐ โก true for all ๐ โ P.
The same loop invariants for ๐ผarb are used for ๐ผstate to derive
the following proof rule. For brevity, premises of all derived stability
proof rules are implicitly conjunctively quantified over ๐ โ P.
Corollary 3 (UGpAS for state-dependent switching, CLF).
The following proof rule for common Lyapunov function๐ with threestacked premises is derivable in dL.
CLF
โข ๐ (0) = 0 โง โ๐ฅ (โฅ๐ฅ โฅ > 0 โ ๐ (๐ฅ) > 0)โข โ๐ โ๐พ โ๐ฅ (๐ (๐ฅ) โค ๐ โ โฅ๐ฅ โฅ โค ๐พ)โข L
๐๐(๐ ) (0) = 0 โง โ๐ฅ (โฅ๐ฅ โฅ > 0 โง๐๐ โ L
๐๐(๐ ) (๐ฅ) < 0)
โข UGpAS(๐ผstate)
Corollary 3 syntactically derives a slight generalization of condi-
tions i)โiii) from Section 3.1.1 for ๐ผstate, where the Lie derivatives
L๐๐(๐ ) (๐ฅ) for each ๐ โ P are required to be negative on their re-
spective domain closures2 ๐๐ . This generalization is justified by the
same loop invariants in Section 3.1.1 because the ODE invariance
properties are only required to hold in their respective domains.
2The topological closure๐ of domain๐ is needed for soundness of a technical com-
pactness argument used in the pre-attractivity proof, see AppendixA for details.
Verifying Switched System Stability With Logic
๐ : ๐ฅโฒ1=โ4.6๐ฅ
1+5.5๐ฅ
2,๐ฅโฒ2=โ5.5๐ฅ
1+4.4๐ฅ
2&๐ฅ
1๐ฅ2โฅ0
๐: ๐ฅโฒ1=4.4๐ฅ
1+5.5๐ฅ
2,๐ฅโฒ2=โ5.5๐ฅ
1โ4.6๐ฅ
2&๐ฅ
1๐ฅ2โค0
-0.2 -0.1 0.1 0.2 x1
-0.15
-0.1
-0.05
0.05
0.1
0.15
x2
๐๐=๐ฅ21โ1.65๐ฅ
1๐ฅ2+๐ฅ2
2
๐๐=๐ฅ21+1.65๐ฅ
1๐ฅ2+๐ฅ2
2
0 2 4 6 t
0.005
0.01
0.015
0.02
0.025
V
Figure 2: A switching trajectory for Example 7 from Sec-tion 4.2 with state-dependent switching (left) and the valueof two Lyapunov functions along that trajectory (right).Solid lines indicate the active Lyapunov function at time ๐ก .Two sublevel sets ๐๐ ,๐๐ < ๐ = 0.012 are shown dashed onthe left withinwhich the switching trajectory is respectivelytrapped at any given time.
The domain asymmetry in ๐ผstate suggests another way of gener-
alizing the stability arguments, namely, through the use of multipleLyapunov functions, where a (possibly) different Lyapunov function๐๐ is associated to each ๐ โ P [5]. Here, the function๐๐ is responsi-
ble for justifying stability within domain๐๐ , i.e., its value decreases
along system trajectories whenever the system is within ๐๐ , as il-
lustrated in Fig. 2. Constraints on these functions are obtained by
modifying the loop invariants to account for this intuition.
Stability. The stability loop invariant is modified by case split-
ting disjunctively on the domains ๐๐ , ๐ โ P, and requiring that
the sublevel set characterized by ๐๐ < ๐ is invariant within its
respective domain: Inv๐ โก โฅ๐ฅ โฅ < Yโงโจ๐โP
(๐๐ โง๐๐ <๐
). Similar
to Section 3.1.1, the bound๐ is chosen so that each sublevel set
characterized by ๐๐ <๐ is contained in the ball โฅ๐ฅ โฅ < Y.
Pre-attractivity. The pre-attractivity loop invariant is similarly
modified by disjunctively requiring that ๐๐ decreases along system
trajectories when the system is in their respective domains ๐๐ :
Inv๐ โก โจ๐โP
(๐๐ โง ๐๐ < ๐ โง (๐๐ โฅ ๐ โ ๐๐ < ๐ + ๐๐ก)
).
The constants ๐ ,๐ ,๐,๐ are chosen as appropriate lower or upper
bounds for all the Lyapunov functions (see proof of Corollary 4).
Arithmetical conditions for the Lyapunov functions ๐๐ , ๐ โ Pare derived from the modified invariants in the following rule.
Corollary 4 (UGpAS for state-dependent switching, MLF).
The following proof rule for multiple Lyapunov functions ๐๐ , ๐ โ Pwith four stacked premises is derivable in dL.
MLF
โข ๐๐ (0) = 0 โง โ๐ฅ (โฅ๐ฅ โฅ > 0 โ ๐๐ (๐ฅ) > 0)โข โ๐ โ๐พ โ๐ฅ (๐๐ (๐ฅ) โค ๐ โ โฅ๐ฅ โฅ โค ๐พ)โข L
๐๐(๐๐ ) (0)=0 โง โ๐ฅ (โฅ๐ฅ โฅ>0 โง๐๐ โ L
๐๐(๐๐ ) (๐ฅ)<0)
โข โง๐โP
(๐๐ โง๐๐ โ ๐๐ = ๐๐
)โข UGpAS(๐ผstate)
The top three premises of Corollary 4 are similar to those of Corol-
lary 3, but are now required to hold for each Lyapunov function
๐๐ , ๐ โ P separately. The (new) bottom premise corresponds to a
compatibility condition between the Lyapunov functions arising
from the loop invariants. For example, consider the stability loop
invariant (similarly for pre-attractivity) and suppose the system
currently satisfies disjunct๐๐ โง๐๐ < ๐ค with๐๐ justifying stability
in domain๐๐ . If the system switches to the ODE ๐ฅ โฒ = ๐๐ (๐ฅ) withindomain ๐๐ , then Lyapunov function ๐๐ becomes the active Lya-
punov function which must satisfy๐๐ < ๐ค to preserve the stability
loop invariant. The premise ๐๐ โง ๐๐ โ ๐๐ = ๐๐ says that the
Lyapunov functions ๐๐ ,๐๐ are equal whenever such a switch is
possible (in either direction), i.e., when their domains overlap.
3.2 Controlled SwitchingThis section turns to controlled switching models [46], where an ex-
plicit controller program is responsible for making logical switching
decisions between the ODEs ๐ฅ โฒ = ๐๐ (๐ฅ), ๐ โ P. This is in contrast
to earlier models ๐ผarb, ๐ผstate which exhibit autonomous switching,i.e., without an explicit control logic [6, 22]. General controlled
switching is modeled by the hybrid program ๐ผctrl:
๐ผctrl โก ๐ผ๐โ
initialization
;
(switching controller
โ๐ผ๐ข ;
๐ผ๐ (plant, actuate decision)๏ธท ๏ธธ๏ธธ ๏ธทโ๐โP
(?๐ข = ๐;๐ฅ โฒ = ๐๐ (๐ฅ,๐ฆ), ๐ฆโฒ = ๐๐ (๐ฅ,๐ฆ) &๐๐
) )โThe model ๐ผctrl uses three subprograms: ๐ผ๐ initializes the sys-
tem, then ๐ผ๐ข (modeling the switching controller) and ๐ผ๐ (modeling
the continuous plant dynamics) are run in a switching loop. The
discrete programs ๐ผ๐ , ๐ผ๐ข decide on values for the control output
๐ข = ๐, ๐ โ P and the program ๐ผ๐ responds to this output by evolv-
ing the corresponding ODE ๐ฅ โฒ = ๐๐ (๐ฅ,๐ฆ), ๐ฆโฒ = ๐๐ (๐ฅ,๐ฆ) &๐๐ . The
programs ๐ผ๐ , ๐ผ๐ข must not modify the system state variables ๐ฅ , but
they may modify other auxiliaries, including auxiliary continuousstate variables ๐ฆ used to model timers or integral terms used in con-
trollers, see Section 5.2. This control-plant loop is a typical structure
for hybrid systems modeled in dL [32, 34], e.g., the controller ๐ผ๐ขbelow models the discrete switching logic present in hybrid au-
tomata [6, 18, 32] (without jumps in the system state):
๐ผ๐ข โกโ๐โP
(?๐ข = ๐;
โ๐โP
(?๐บ๐,๐ ;๐ ๐,๐ ;๐ข :=๐
) )๐ ๐,๐ โก ๐ฆ1 := ๐1;๐ฆ2 := ๐2; . . . ;๐ฆ๐ := ๐๐
(2)
For each mode ๐ โ P, the switching controller may decide to
transition to mode ๐ โ P. This transition can only be taken if the
guard formula ๐บ๐,๐ is true in the current state3; if the transition is
taken, the reset map ๐ ๐,๐ sets the values of auxiliary state variables
๐ฆ1, . . . , ๐ฆ๐ respectively to the value of terms ๐1, . . . , ๐๐ .
Stability analysis for controlled switching proceeds by identify-
ing suitable loop invariants Inv for ๐ผctrl. A powerful proof tech-
nique applied here is compositional reasoning [32, 34] which sepa-
rately analyses the discrete (๐ผ๐ , ๐ผ๐ข ) and continuous (๐ผ๐ ) dynamics,
and then lifts those results to the full hybrid dynamics. This idea is
exemplified by the following derived variation of the loop rule:
loopT
ฮ โข [๐ผ๐ ]Inv Inv โข [๐ผ๐ข ]Inv Inv โข [๐ผ๐ ]Inv Inv โข ๐
ฮ โข [๐ผ๐ ; (๐ผ๐ข ;๐ผ๐ )โ]๐
3The controller can allow trivial self-transitions with๐บ๐,๐ โก true.
Yong Kiam Tan, Stefan Mitsch, and Andrรฉ Platzer
The premises of rule loopT say that system initialization ๐ผ๐ puts
the system in a state satisfying the invariant Inv, and that Inv is
compositionally preserved by both the discrete switching logic ๐ผ๐ขand the continuous dynamics ๐ผ๐ . This rule is applied to analyze
stability for two important special instances of ๐ผctrl next.
3.2.1 Guarded State-dependent Switching. The instance ๐ผguard cor-responds to the automata controller from (2) with ๐ผ๐ โก
โ๐โP ๐ข := ๐
and guard formulas ๐บ๐,๐ . It does not use auxiliaries ๐ฆ nor the reset
map ๐ ๐,๐ . This model adds hysteresis [19] to the state-dependent
switching model from Section 3.1.2, so that switching decisions
at each ๐บ๐,๐ depend explicitly on the current discrete mode ๐ข in
addition to the continuous state. This design change is reflected in
the loop invariants and in the corresponding proof rule below.
Stability. The stability loop invariant ismodified (cf. Section 3.1.2)
to case split on the possible discrete modes ๐ข = ๐ rather than the
ODE domains: Inv๐ โก โฅ๐ฅ โฅ < Y โงโจ๐โP
(๐ข = ๐ โง๐๐ <๐
).
Pre-attractivity. The pre-attractivity loop invariant is modified
similarly: Inv๐ โก โจ๐โP
(๐ข=๐โง๐๐<๐ โง (๐๐ โฅ ๐ โ ๐๐ <๐ +๐๐ก)
).
Corollary 5 (UGpAS for guarded state-dependent switch-
ing, MLF). The following proof rule for multiple Lyapunov functions๐๐ , ๐ โ P with four stacked premises is derivable in dL.
MLF๐บ
โข ๐๐ (0) = 0 โง โ๐ฅ (โฅ๐ฅ โฅ > 0 โ ๐๐ (๐ฅ) > 0)โข โ๐ โ๐พ โ๐ฅ (๐๐ (๐ฅ) โค ๐ โ โฅ๐ฅ โฅ โค ๐พ)โข L
๐๐(๐๐ ) (0)=0 โง โ๐ฅ (โฅ๐ฅ โฅ>0 โง๐๐ โ L
๐๐(๐๐ ) (๐ฅ)<0)
โข โง๐โP
(๐บ๐,๐ โ ๐๐ โค ๐๐
)โข UGpAS(๐ผguard)
The premises of rule MLF๐บ are identical to those from MLF ex-
cept the bottom premise, which derives from loopT and unfolding
the controller ๐ผ๐ข with dLโs hybrid program axioms, e.g., the fol-
lowing proof skeleton shows the unfolding for the stability loop
invariant Inv๐ corresponding to a switch from mode ๐ to mode ๐:
xUnfold
โข ๐บ๐,๐ โ ๐๐ โค ๐๐๐๐ <๐ โข ๐บ๐,๐ โ ๐๐ <๐
๐ข = ๐ โง๐๐ <๐ โข [?๐บ๐,๐ ;๐ข :=๐] (๐ข = ๐ โง๐๐ <๐ )Inv๐ โข [๐ผ๐ข ]Inv๐
ArithmeticxUnlike rule MLF, the bottom premise of rule MLF๐บ only uses an in-
equality, because the guards ๐บ๐,๐ determine permissible switching.
3.2.2 Time-dependent Switching. The instance ๐ผtime shown below
models time-dependent switching, where the controller ๐ผ๐ข makes
switching decisions based on the time ๐ elapsed in each mode.
๐ผtime โก
๐ผ๐ โก ๐ := 0;
โ๐โP
๐ข := ๐
๐ผ๐ข โกโ๐โP
(?๐ข = ๐;
โ๐โP
(?\๐,๐ โค ๐ ;๐ := 0;๐ข :=๐
) )๐ผ๐ โก
โ๐โP
(?๐ข = ๐;๐ฅ โฒ = ๐๐ (๐ฅ), ๐ โฒ = 1&๐ โค ฮ๐
)The controller ๐ผ๐ข enables switching from mode ๐ to ๐ when a
minimum dwell time 0 โค \๐,๐ โค ๐ has elapsed and resets the timer
whenever such a switch occurs. Conversely, the plant ๐ผ๐ restricts
modes with a maximum dwell time ๐ โค ฮ๐ ,ฮ๐ > 0; an unbounded
dwell time ฮ๐ = โ is represented by the domain constraint true.Dwell time restrictions can be used to stabilize systems that switch
between stable and unstable modes [48]. Intuitively, the system
should stay in stable modes for sufficient duration (\๐,๐ โค ๐) while
it should avoid staying in unstable modes for too long (๐ โค ฮ๐ ).
To reason about stability for ๐ผtime, consider Lyapunov function
conditions L๐๐(๐๐ ) (๐ฅ) โค โ_๐๐๐ , where _๐ is a constant associated
with each mode ๐ โ P. This condition bounds the value of๐๐ along
the solution of ๐ฅ โฒ = ๐๐ (๐ฅ) by either a decaying exponential for
stable modes (_๐ > 0) or a growing exponential for unstable modes
(_๐ โค 0). Let S = {๐ โ P, _๐ > 0} and U = {๐ โ P, _๐ โค 0} bethe indexes of the stable and unstable modes in the loop invariants
below, and let ๐ ( ยท) denote the real exponential function, which is
definable in dL by differential axiomatization [32, 35].
Stability. The stability loop invariant expresses the required ex-
ponential bounds with a case split depending if ๐ โ S or ๐ โ U:
Inv๐ โก ๐ โฅ 0 โง โฅ๐ฅ โฅ < Y โง
ยฉยญยญยญยญยซโจ๐โS
(๐ข = ๐ โง๐๐ <๐๐โ_๐๐
)โจโจ
๐โU
(๐ข = ๐ โง๐๐ <๐๐โ_๐ (๐โฮ๐ ) โง ๐ โค ฮ๐
)ยชยฎยฎยฎยฎยฌFor ๐ โ S, ๐โ_๐๐ is the accumulated decay factor for ๐๐ after
staying in the stable mode for time ๐ . For ๐ โ U, ๐โ_๐ (๐โฮ๐ )is
a buffer factor for the growth of ๐๐ in the unstable mode so that
๐๐ < ๐ still holds at the maximum dwell time ๐ = ฮ๐ . In both
cases, the internal timer variable is non-negative (๐ โฅ 0).
Pre-attractivity. The pre-attractivity loop invariant has similar
exponential decay and growth bounds for each ๐ โ P in the current
mode. In addition, it has an overall exponential decay term ๐โ๐ (๐กโ๐)
for some ๐ > 0, which ensures that the value of ๐๐ tends to 0 as
๐ก โ โ for all switching trajectories; recall ๐ก is the global clock
introduced in the specification of pre-attractivity in Lemma 2.
Inv๐ โก ๐ โฅ 0 โง ๐ก โฅ ๐ โง
ยฉยญยญยญยญยซโจ๐โS
(๐ข = ๐ โง๐๐ <๐๐โ๐ (๐กโ๐)๐โ_๐๐
)โจโจ
๐โU
(๐ข = ๐ โง๐๐ <๐๐โ๐ (๐กโ๐)๐โ_๐ (๐โฮ๐ ) โง ๐ โค ฮ๐
)ยชยฎยฎยฎยฎยฌIntuitively, ๐โ๐ (๐กโ๐) is the accumulated overall decay factor for
๐๐ until the previous switch, which occurred at time ๐ก โ ๐ .
Corollary 6 (UGpAS for time-dependent switching, MLF).
The following proof rule for multiple Lyapunov functions ๐๐ , ๐ โ Pwith five stacked premises is derivable in dL.
MLF๐
โข ๐๐ (0) = 0 โง โ๐ฅ (โฅ๐ฅ โฅ > 0 โ ๐๐ (๐ฅ) > 0)โข โ๐ โ๐พ โ๐ฅ (๐๐ (๐ฅ) โค ๐ โ โฅ๐ฅ โฅ โค ๐พ)โข L
๐๐(๐๐ ) โค โ_๐๐๐
Inv๐ โข [๐ผ๐ข ]Inv๐ Inv๐ โข [๐ผ๐ข ]Inv๐โข UGpAS(๐ผtime)
The two red premises on the bottom row are expanded to arithmeti-cal conditions on ๐๐ in Appendix A.
Verifying Switched System Stability With Logic
The bottom premises of MLF๐ and MLF๐บ exemplify a key benefit
of dL stability reasoning: arithmetical conditions on ๐๐ that arise
from ๐ผ๐ข , Inv๐ , Inv๐ are derived in a correct-by-construction manner
by systematically unfolding the discrete dynamics of ๐ผ๐ข with sound
dL axioms. This is especially important for controlled switching,
where the number of possible transitions scales quadratically with
the number of switching modes.
4 KEYMAERA X IMPLEMENTATIONThis section presents a prototype implementation of switched sys-
tems support in the KeYmaera X prover based on dL [12]. The
implementation consists of โ2700 lines and, crucially, does not re-quire any extension to KeYmaera Xโs existing soundness-critical
core. Accordingly, verification results for switched systems obtained
through this implementation directly inherit the strong correctness
properties guaranteed by KeYmaera Xโs design [12, 25].
4.1 Modeling and Proof InterfaceThe implementation builds on KeYmaera Xโs proof IDE [24] to pro-
vide a convenient interface for modeling switching mechanisms,
as shown in Fig. 3. The interface allows users to express switch-
ing mechanisms intuitively by rendering automaton plots while
abstracting away the underlying hybrid programs. It provide tem-
plates for switched systems following the switching mechanisms of
Section 3: state-dependent, guarded, timed, and general controlled
switching (tabs โAutonomousโ, โTimedโ, โGuardedโ, โGenericโ in
Fig. 3). From these templates, KeYmaera X automatically generates
programs and stability specifications, ensuring that they have the
correct structure. This saves user effort from having to manually
expand switching designs to correctly structured hybrid programs.
Moreover, the generated programs and specifications follow a uni-
form structure that the proof tactics discussed below can rely on.
Figure 3: Screenshot of the KeYmaera X switched systemsmodeling editor: automata input on top-left, rendered au-tomaton top-right, generated hybrid program and specifica-tion(s) in dL at the bottom
Switched systems are represented internally with a common
interface SwitchedSystem which is currently implemented by four
classes: StateDependent๐ผstate, Guarded๐ผguard, Timed๐ผtime, andControlled ๐ผctrl. The SwitchedSystem interface provides defaultstability and pre-attractivity specifications, which can be adapted
Table 1: Available tactics in KeYmaera X for switched sys-tems stability proofs and Lyapunov function generation.
SwitchedSystemCommon Lyap. Multiple Lyap.
Proof Gen. Proof Gen.
StateDependent ๐ผstate โ โ โ โGuarded ๐ผguard โ โ โ โTimed ๐ผtime โ โ โ โ
Controlled ๐ผctrl โ โ โ โ
Table 2: Stability proofs for examples drawn from the lit-erature. The โTimeโ columns indicate time (in seconds) torun the KeYmaera X proofs, ร indicates incomplete proof. Aโ in the โGen.โ column indicates successful Lyapunov func-tion(s) generation, ? indicates that a candidatewas generatedbut with numerical issues, and โ indicates inapplicability.
Example Model Time (Stab.) Time (Attr.) Gen.
1 [5, Ex. 2.1] ๐ผstate 2.6 3.0 โ2 [19, Motiv. ex.] ๐ผstate 2.2 2.3 โ3 [19, Ex. 1] ๐ผstate 3.3 4.1 โ4 [19, Ex. 2 & 3] ๐ผguard 2.8 3.8 ?
5 [38, Ex. 6] ๐ผguard ร ร ?
6 [44, Ex. 2.45] ๐ผarb 19.4 11.1 โ7 [44, Ex. 3.25] ๐ผstate 2.4 2.9 โ8 [44, Ex. 3.49] ๐ผtime 4.4 5.6 โ
9 [48, Ex. 1] ๐ผtime 4.7 5.3 โ
10 [48, Ex. 2] ๐ผtime 256.9 ร โ
by users on the UI if needed. Corollaries 3โ6 are implemented as UG-
pAS proof tactics in KeYmaera Xโs Bellerophon tactic language [11].
These tactics automate all of the reasoning steps underlying sta-
bility proofs for their respective switching mechanisms, so that
users only need to input candidate Lyapunov functions for KeY-
maera X to (attempt to) complete their proofs. Additionally, when
candidates are not provided by the user, the implementation uses
sum-of-squares programming [31, 38] to automatically generate
candidate Lyapunov functions for a subset of switching designs. The
generated candidates are checked for correctness by KeYmaera X
so the generator does not need to be trusted for correctness of the
resulting proofs. Table 1 summarizes the available proof tactics and
Lyapunov function generation for classes of switching mechanisms.
4.2 ExamplesThe implementation is tested on a suite of examples drawn from
the literature [5, 19, 38, 44] featuring various switching mecha-
nisms. These examples have a 2 dimensional state space and switch
between 2modes except Example 6 (3 dimensions, 2modes) and Ex-
ample 4 (2 dimensions, 4modes). Results are summarized in Table 2;
Lyapunov functions from the literature were used (if available) in
cases where generation failed or is inapplicable.
The proof tactics successfully prove most of the examples across
various switching mechanisms. For Example 6, a suitable Lyapunov
function (without numerical errors) could not be found. For the
Yong Kiam Tan, Stefan Mitsch, and Andrรฉ Platzer
time-dependent switching models (Examples 8โ10), KeYmaera X
internally uses verified polynomial Taylor approximations to the ex-
ponential function for decidability of arithmetic [3, 47]. Example 10
requires a high degree approximation (15 terms) and its attractivity
proof could not be completed in reasonable time.
5 CASE STUDIESThis section presents three case studies applying the deductive
verification approach to justify various non-standard stability argu-
ments in KeYmaera X.
5.1 Canonical Max SystemBranicky [4] investigates the longitudinal dynamics of an aircraft
with an elevator controller that mediates between two control ob-
jectives: i) tracking potentially unsafe pilot input and ii) respectingsafety constraints on the aircraftโs angle of attack. Assuming a state
feedback control law, the model is transformed to the following
canonical max system [4, Remark 5], with state variables ๐ฅ,๐ฆ and
parameters ๐, ๐, ๐ , ๐,๐พ satisfying ๐, ๐, ๐ โ ๐ , ๐ โ ๐ > 0 and ๐พ โค 0.
๐ฅ โฒ = ๐ฆ,๐ฆโฒ = โ๐๐ฅ โ ๐๐ฆ +max(๐ ๐ฅ + ๐๐ฆ + ๐พ, 0) (3)
The right-hand side of system (3) is non-differentiable but the
equations can be equivalently rewritten as a family of two ODEs
corresponding to either possibility for themax(๐ ๐ฅ +๐๐ฆ +๐พ, 0) termin the equation for ๐ฆโฒ as follows, where the system follows ODE A
in domain ๐ ๐ฅ + ๐๐ฆ + ๐พ โค 0 and ODE B in domain ๐ ๐ฅ + ๐๐ฆ + ๐พ โฅ 0.
A โก ๐ฅ โฒ = ๐ฆ,๐ฆโฒ = โ๐๐ฅ โ ๐๐ฆ
B โก ๐ฅ โฒ = ๐ฆ,๐ฆโฒ = โ(๐ โ ๐ )๐ฅ โ (๐ โ ๐)๐ฆ + ๐พStability of this parametric system is not directly provable us-
ing standard techniques for state-dependent switching presented
in Section 3.1.2. For example, the ODE A stabilizes the system to
the origin but the ODE B stabilizes to the point (โ ๐พ
๐โ๐ , 0) (awayfrom the origin for ๐พ < 0). Branicky proves global asymptotic
stability of (3) with the following โnoncustomaryโ [10] Lyapunov
function involving a nondifferentiable integrand:
๐ =1
2
๐ฆ2 +โซ ๐ฅ
0
๐b โmax(๐ b + ๐พ, 0)๐b (4)
Instead, the key idea used to prove stability in this paper is ghostswitching: analogous to ghost variables in program verification
which are added for the sake of program proofs [30, 34, 35], ghost
switchingmodes do not change the physical dynamics of the system
but are introduced for the purposes of the stability analysis. Here,
ghost switching between ๐ ๐ฅ + ๐พ โค 0 and ๐ ๐ฅ + ๐พ โฅ 0 is used to
obtain closed form representations for the integral in (4). This yields
an instance of state-dependent switching ๐ผstate with 4 switching
modes and the corresponding stability specification ๐๐ :
A1โก A & ๐ ๐ฅ + ๐๐ฆ + ๐พ โค 0 โง ๐ ๐ฅ + ๐พ โค 0
A2โก A & ๐ ๐ฅ + ๐๐ฆ + ๐พ โค 0 โง ๐ ๐ฅ + ๐พ โฅ 0
B1โก B & ๐ ๐ฅ + ๐๐ฆ + ๐พ โฅ 0 โง ๐ ๐ฅ + ๐พ โค 0
B2โก B & ๐ ๐ฅ + ๐๐ฆ + ๐พ โฅ 0 โง ๐ ๐ฅ + ๐พ โฅ 0
๐ผ๐ โก(A
1โช A
2โช B
1โช B
2
)โ๐๐ โก ๐>0 โง ๐>0 โง ๐โ๐ >0 โง ๐โ๐>0 โง ๐ โ 0 โง ๐พโค0 โ UGpAS(๐ผ๐)
The ghost switching modes enable a multiple Lyapunov function
argument for stability using the following modified closed-form
representations of Branickyโs Lyapunov function (4), with ๐1 =1
2(๐๐๐ฅ2 + 2๐๐ฅ๐ฆ + ๐ฆ2) + ๐
2๐ฅ2 for A
1, B
1and ๐2 =
1
2(๐๐๐ฅ2 + 2๐๐ฅ๐ฆ +
๐ฆ2)+ ๐2๐ฅ2 โ (๐ ๐ฅ+๐พ )2
2๐for A
2, B
2.4The sub-terms highlighted in red
for๐1,๐2 are closed form expressions for
โซ ๐ฅ
0๐b โmax(๐ b +๐พ, 0)๐b
where ๐ b + ๐พ โค 0 and ๐ b + ๐พ โฅ 0 respectively. The Lyapunov
functions ๐1,๐2 are modified from (4) to use a quadratic form with
an additional constant ๐ satisfying constraints 0 < ๐ < ๐, ๐ <
๐ โ ๐, ๐ <(๐โ๐ ) (๐โ๐)๐โ๐ +๐2 , ๐ <
๐ (๐โ๐)๐+๐2 (such a constant always exists
under the assumptions on ๐, ๐, ๐ , ๐). This technical modification
is required to prove UGpAS for ๐ผ๐ directly with the Lyapunov
functions. Branickyโs earlier proof requires LaSalleโs principle [4].
Another challenging aspect of this case study is verification of
the parametric arithmetical conditions for ๐1,๐2, i.e., stability is
verified for all possible parameter values ๐, ๐, ๐ , ๐,๐พ that satisfy
the assumptions in ๐๐ . Such questions are decidable in theory [3,
47], but are difficult for automated solvers in practice (even out of
reach of solvers that require numerically bounded parameters [14]).
KeYmaera X enables a user-aided proof of the required arithmetic
conditions. For example, the Lie derivative of the Lyapunov function
๐1 for B1is given by๐ โฒ
1= โ(๐โ๐)๐ฆ2โ๐๐๐ฅ2 + (๐๐ฅ +๐ฆ) (๐ ๐ฅ +๐๐ฆ +๐พ),
where๐ โฒ1is required to be strictly negative away from the origin for
stability. The arithmetical argument is as follows: if ๐๐ฅ +๐ฆ โค 0, then
by constraint ๐ ๐ฅ + ๐๐ฆ + ๐พ โฅ 0, ๐ โฒ1satisfies ๐ โฒ
1โค โ(๐ โ ๐)๐ฆ2 โ ๐๐๐ฅ2.
Otherwise, ๐๐ฅ + ๐ฆ > 0, then by constraint ๐ ๐ฅ + ๐พ โค 0, ๐ โฒ1satisfies
๐ โฒ1โค โ(๐โ๐โ๐)๐ฆ2โ๐๐๐ฅ2+๐๐๐ฅ๐ฆ. In either case, the RHS bound is a
negative definite quadratic form by the earlier choice of parameter
๐ and therefore, ๐ โฒ1is negative away from the origin.
5.2 Automated Cruise ControlOehlerking [29, Sect. 4.6] verifies the stability of an automatic
cruise controller modeled as a hybrid automaton with 6 operat-
ing modes and 11 transitions between them: normal proportional-
integral (PI) control, acceleration, service braking (2 modes), and
emergency braking (2 modes). Figure 4 shows an abridged version
of the corresponding KeYmaera X model (using ๐ผctrl) with the PI
control mode, where ๐ฃ is the relative velocity to be controlled to
๐ฃ = 0 and ๐ฅ, ๐ก are auxiliary integral and timer variables used in the
controller. Briefly, this controller is designed to use the PI controller
near ๐ฃ = 0 for stability, while its other control modes drive the
system toward ๐ฃ = 0 by accelerating or braking.
Lyapunov function candidates for this model can be successfully
generated using the Stabhyli [26] stability tool for hybrid automata.
However, Stabhyli (with default configurations) outputs a Lyapunov
function candidate for the PI control mode that is numerically un-
sound, see Appendix B for the output and a counterexample; this is
a known issue with Stabhyli for control modes at the origin [26]. For
this case study, the issue is manually resolved by truncating terms
with very small magnitude coefficients in the generated output and
then checking in KeYmaera X that the arithmetical conditions for
the PI mode are satisfied exactly for the truncated candidate.
4An important technical requirement for๐2 to be well-defined is ๐ โ 0. The case with
๐ = 0 is also verified in KeYmaera X but the details are omitted here for brevity. It
does not require ghost switching and uses only๐1 as its common Lyapunov function.
Verifying Switched System Stability With Logic
normalPI("v' = -0.001*x-0.052*v, x' = v, t' = 0& -15 <= v & v <= 15 & -500 <= x & x <= 500")
normalPI -->|"?(13 <= v & v <= 15 &-500 <= x & x <= 500); t := 0;"| sbrakeact
normalPI -->|"?(-15 <= v & v <= -14 &-500 <= x & x <= 500);"| accelerate
... // Other modes
\forall eps ( eps > 0 -> // Abridged stability specification...[ ... // Initialize{ { ... ++ // Transitions for other modes
?mode = normalPI();{ {?13 <= v & v <= 15 & -500 <= x & x <= 500; t := 0;}
mode := sbrakeact(); ++?-15 <= v & v <= -14 & -500 <= x & x <= 500;mode := accelerate(); ++mode := mode; } }
{ ... ++ // Plant ODEs for other modes?mode = normalPI();{ v' = -0.001*x-0.052*v, x' = v, t' = 0 &
-15 <= v & v <= 15 & -500 <= x & x <= 500 } }}*] v^2 < eps^2
Figure 4: Snippets of an automated cruise controller [29]modeled as a (switching) hybrid automaton. Users express the automa-ton within the description language (top left) and KeYmaera X visualizes the automaton on-the-fly (bottom left). The imple-mentation automatically generates the appropriate hybrid program representation and UGpAS specification (right); ++,&,()denote choice, conjunction, and constants in KeYmaera Xโs ASCII syntax respectively.
Further insights from the controller design are used in the UGpAS
proof in KeYmaera X. Briefly, stability only concerns states and
modes that are active near the origin. Hence, the stability argument
and loop invariant only need to mention a single Lyapunov function
for the PI control mode, while choosing ๐ฟ (in Def. 1) sufficiently
small so that none of the other modes can be entered.5Similarly, pre-
attractivity only requires reasoning about asymptotic convergenceto the origin for the PI control mode, hence it suffices to show that
the system leaves all other modes in finite time.
5.3 Brockettโs Nonholonomic IntegratorVerification of stabilizing control laws for Brockettโs nonholonomic
integrator [7] is of significant interest because stability for a large
class of models can be reduced to that of the integrator via co-
ordinate transformations, e.g., Liberzon [22] transforms a unicy-
cle model to the integrator and provides a stabilizing switching
control law corresponding to parking of the unicycle. The non-
holonomic integrator is described by the system of differential
equations ๐ฅ โฒ = ๐ข,๐ฆโฒ = ๐ฃ, ๐งโฒ = ๐ฅ๐ฃ โ ๐ฆ๐ข, with state variables ๐ฅ,๐ฆ, ๐ง
and state feedback control inputs ๐ข = ๐ข (๐ฅ,๐ฆ, ๐ง), ๐ฃ = ๐ฃ (๐ฅ,๐ฆ, ๐ง) (to be
determined below). Notably, this is a classical example of a system
that is not stabilizable by purely continuous feedback control. In-
tuitively, no choice of controls ๐ข, ๐ฃ can produce motion along the
๐ง-axis (๐ฅ = ๐ฆ = 0). Thus, to stabilize the system to the origin, the
controller must first drive the system away from the ๐ง-axis before
switching to a control law that stabilizes the system from states
away from the ๐ง-axis. This intuition can be realized using two differ-
ent switching strategies that are analogous to the event-triggered
and time-triggered CPS design paradigms respectively [34].
5.3.1 Event-triggered Controller. Bloch and Drakunov [2] use the
switching controller ๐ข = โ๐ฅ + ๐๐ฆ sign(๐ง), ๐ฃ = โ๐ฆ โ ๐๐ฅ sign(๐ง) toasymptotically stabilize the integrator in the region
๐2(๐ฅ2+๐ฆ2) โฅ |๐ง |
5In fact, the PI controller equations are exactly those of a linearized pendulum, which
has known Lyapunov functions [21, 45]. It could be interesting to modify Stabhyli to
accept user-provided Lyapunov function hints for certain modes.
for any given constant ๐ > 0. This controller first drives the system
towards the plane ๐ง = 0 and, once it reaches the plane, slides alongthe plane towards the origin. The closed-loop system is modeled
as an instance of state-dependent switching ๐ผstate with 3 modes
depending on the sign of ๐ง and specification ๐๐ :
A โก ๐ฅ โฒ = โ๐ฅ + ๐๐ฆ,๐ฆโฒ = โ๐ฆ โ ๐๐ฅ, ๐งโฒ = โ๐(๐ฅ2 + ๐ฆ2) & ๐ง โฅ 0
B โก ๐ฅ โฒ = โ๐ฅ โ ๐๐ฆ,๐ฆโฒ = โ๐ฆ + ๐๐ฅ, ๐งโฒ = ๐(๐ฅ2 + ๐ฆ2) & ๐ง โค 0
C โก ๐ฅ โฒ = โ๐ฅ,๐ฆโฒ = โ๐ฆ, ๐งโฒ = 0& ๐ง = 0
๐ผ๐ โก(A โช B โช C
)โ๐๐ โก ๐ > 0 โ UStab(๐ผ)โง
โ๐ฟ>0โY>0โ๐โฅ0โ๐ฅ,๐ฆ, ๐ง(โฅ๐ฅ,๐ฆ, ๐งโฅ < ๐ฟ โง ๐
2
(๐ฅ2 + ๐ฆ2) โฅ |๐ง | โ
[๐ก := 0;๐ผ๐ , ๐กโฒ = 1] (๐ก โฅ ๐ โ โฅ๐ฅ,๐ฆ, ๐งโฅ < Y
)The specification ๐๐ is identical to UGpAS except it restricts
pre-attractivity to the applicable region๐2(๐ฅ2 + ๐ฆ2) โฅ |๐ง | for the
controller.6Its verification uses the squared norm ๐ = ๐ฅ2 + ๐ฆ2 + ๐ง2
as a common Lyapunov function. The key modification to the pre-
attractivity proof, cf. Section 3.1, is to use (and verify) the fact that
๐2(๐ฅ2 + ๐ฆ2) โฅ |๐ง | is a loop invariant of ๐ผ๐ . This additional invariant
corresponds to the fact that the controller keeps the system within
its applicable region (if the system is initially within that region).
In fact, ๐ผ๐ can be extended to a globally stabilizing controller,
as modeled by ๐ผ๐ below (if, else branching is supported as an
6The applicable region is equivalently characterized by the real arithmetic for-
mula (๐งโฅ0 โ ๐2(๐ฅ2 + ๐ฆ2) โฅ๐ง) โง (๐งโค0 โ ๐
2(๐ฅ2 + ๐ฆ2) โฅโ๐ง) but this is omitted for
brevity.
Yong Kiam Tan, Stefan Mitsch, and Andrรฉ Platzer
abbreviation in KeYmaera X [34]):
D โก ๐ฅ โฒ = ๐ข,๐ฆโฒ = ๐ฃ, ๐งโฒ = ๐ฅ๐ฃ โ ๐ฆ๐ข &๐
2
(๐ฅ2 + ๐ฆ2) โค |๐ง |
E โก ๐ฅ โฒ = ๐ข,๐ฆโฒ = ๐ฃ, ๐งโฒ = ๐ฅ๐ฃ โ ๐ฆ๐ข &๐
2
(๐ฅ2 + ๐ฆ2) โฅ |๐ง |
๐ผ๐ โก(if
(๐2
(๐ฅ2 + ๐ฆ2) โฅ |๐ง |) {
A โช B โช C
}else
{if((๐ฅ โ ๐ฆ)๐ง โค 0){๐ข := ๐; ๐ฃ := ๐}
else{๐ข :=โ๐; ๐ฃ :=โ๐};{D โช E
} })โIf the system is in the applicable region (outer if branch), then
the previous controller from ๐ผ๐ is used. Otherwise, outside the
applicable region (outer else branch), the system applies a constant
control ๐ > 0 chosen to drive the system into the applicable region.
The pair of ODEs D and E model an event-trigger in dL [34],
where the switching controller is triggered to make its next decision
when the system reaches the switching surface๐2(๐ฅ2 + ๐ฆ2) = |๐ง |.
The specification ๐๐ โก ๐ > 0 โง ๐ > 0 โ UGpAS(๐ผ๐ ) is provedby modifying the loop invariants to account for the initial pe-
riod where the system is outside the applicable region, e.g., the
stability loop invariant Inv๐ โก (ยฌ๐2(๐ฅ2 + ๐ฆ2) โฅ |๐ง | โ |๐ง |<๐ฟ) โง
( ๐2(๐ฅ2 + ๐ฆ2) โฅ |๐ง | โ โฅ๐ฅ,๐ฆ, ๐งโฅ<Y) expresses that the controller keeps
|๐ง | sufficiently small to preserve stability outside the applicable re-
gion.
5.3.2 Time-triggered Controller. The time-triggered switching strat-
egy [34], modeled by ๐ผ๐ below, is similar to that proposed by Liber-
zon [22, Section 4.2]. If the system is on the ๐ง-axis and away from
the origin A , the controller sets an internal stopwatch ๐ and drives
the system away from the axis for maximum duration ๐0 > 0 with
๐ข = ๐ง, ๐ฃ = ๐ง. Otherwise B , the controller drives the system towards
the origin along a parabolic curve of the form๐2(๐ฅ2 + ๐ฆ2) = ๐ง.
๐ผ๐ โก(if(๐ฅ = 0 โง ๐ฆ = 0 โง ๐ง โ 0)
{A ๐ := 0;๐ฅ โฒ = ๐ง,๐ฆโฒ = ๐ง, ๐งโฒ = ๐ฅ๐ง โ ๐ฆ๐ง &๐ โค ๐0
}else
{๐ :=
2๐ง
๐ฅ2 + ๐ฆ2;
B ๐ฅ โฒ = โ๐ฅ + ๐๐ฆ,๐ฆโฒ = โ๐ฆ โ ๐๐ฅ, ๐งโฒ = โ๐(๐ฅ2 + ๐ฆ2)})โ
The specification ๐๐ โก ๐0 > 0 โ UGpAS(๐ผ๐ ) is again proved by
analyzing both cases of the controller in the loop invariants, e.g.,
with the pre-attractivity invariant Inv๐ :(๐ฅ = 0 โง ๐ฆ = 0 โง ๐ง โ 0 โ |๐ง | < ๐ฟ โง ๐ก = 0
)โง(
ยฌ(๐ฅ = 0 โง ๐ฆ = 0 โง ๐ง โ 0) โโฅ๐ฅ,๐ฆ, ๐งโฅ > Y โ โฅ๐ฅ,๐ฆ, ๐งโฅ2 < ๐ฟ2 (2๐ 2
0+ 1) โ Y2 (๐ก โ๐0)
)The left conjunct says the system may start transiently on the
๐ง-axis (away from ๐ง = 0) at time ๐ก = 0. The right conjunct gives ex-
plicit bounds on โฅ๐ฅ,๐ฆ, ๐งโฅ , which, for sufficiently large ๐ก โฅ ๐ implies
that the system enters โฅ๐ฅ,๐ฆ, ๐งโฅ < Y as required for pre-attractivity.
The transient term ๐ฟ2 (2๐ 2
0+ 1) upper bounds the (squared) norm of
the system state after starting on the ๐ง-axis in ball โฅ๐ฅ,๐ฆ, ๐งโฅ < ๐ฟ and
following mode A for the maximum stopwatch duration ๐ = ๐0.
6 RELATEDWORKSwitched Systems. Comprehensive introductions to the analysis
and design of switching control can be found in the literature [10, 22,
44]. An important design consideration (which this paper sidesteps,
cf. Remark 1) is whether a given switched or hybrid system has com-
plete solutions [16, 17, 23, 49]. Justification of such design consider-
ations, and other stability notions of interest for switching designs,
e.g., quadratic, region, or set-based stability [16, 17, 22, 36, 44], can
be done in dL with appropriate formal specifications of the desired
properties from the literature [32, 34, 45, 46]. Another complemen-
tary question is how to design a switching control law that stabilizesa given system. Switching design approaches are often guided by
underlying stability arguments [22, 39, 44]; the loop invariants
from Section 3 are expected to help guide correct-by-construction
synthesis of such controllers.
Stability Analysis and Verification. Corollaries 3โ6 formalize var-
ious Lyapunov function-based stability arguments from the litera-
ture [5, 48] using loop invariants, yielding trustworthy, computer-
checked stability proofs in KeYmaera X [11, 12]. Other computer-
aided approaches for switched system stability analysis are based
on finding Lyapunov functions that satisfy the requisite arith-
metical conditions [20, 26, 29, 38, 41, 42]. Although the search for
such functions can often be done efficiently with numerical tech-
niques [26, 31, 38], various authors have emphasized the need to
check that their outputs satisfy the arithmetical conditions exactly,i.e., without numerical errors compromising the resulting stabil-
ity claims [1, 20, 40] (see, e.g., Section 5.2). This paperโs deductive
approach goes further as it comprehensively verifies all steps ofthe stability argument down to its underlying discrete and contin-
uous reasoning steps [33, 34]. The generality of this approach is
precisely what enables verification of various classes of switching
mechanisms all within a common logical framework (Section 3)
and verification of non-standard stability arguments (Section 5).
Alternative approaches to stability verification are based on ab-
straction [15, 43] and model checking [36].
7 CONCLUSIONThis paper shows how to deductively verify switched system sta-
bility, using dLโs nested quantification over hybrid programs to
specify stability, and dLโs axiomatics to prove those specifications.
Loop invariantsโa classical technique from verificationโare used
to succinctly capture the desired properties of a given switching
design; through deductive proofs, these invariants yield system-
atic, correct-by-construction derivation of the requisite arithmetical
conditions on Lyapunov functions for stability arguments in imple-
mentations. An interesting direction for future work is to use other
Lyapunov function generation techniques [20, 26, 29, 42], whichโ
thanks to the presented approachโdo not have to be trusted since
their results can be checked independently by KeYmaera X. This
would enable fully automated, yet sound and trustworthy verifica-
tion of switched system stability based on dLโs parsimonious hybrid
program reasoning principles.
Verifying Switched System Stability With Logic
ACKNOWLEDGMENTSThis research was sponsored by the AFOSR under grant number
FA9550-16-1-0288. The first author was also supported by A*STAR,
Singapore.
The views and conclusions contained in this document are those
of the authors and should not be interpreted as representing the
official policies, either expressed or implied, of any sponsoring
institution, the U.S. government or any other entity.
REFERENCES[1] Daniele Ahmed, Andrea Peruffo, and Alessandro Abate. 2020. Automated and
Sound Synthesis of Lyapunov Functions with SMT Solvers. In TACAS (LNCS),Armin Biere and David Parker (Eds.), Vol. 12078. Springer, 97โ114. https://doi.
org/10.1007/978-3-030-45190-5_6
[2] Anthony Bloch and Sergey Drakunov. 1996. Stabilization and tracking in the
nonholonomic integrator via sliding modes. Systems & Control Letters 29, 2 (1996),91โ99. https://doi.org/10.1016/S0167-6911(96)00049-7
[3] Jacek Bochnak, Michel Coste, and Marie-Franรงoise Roy. 1998. Real AlgebraicGeometry. Springer, Heidelberg. https://doi.org/10.1007/978-3-662-03718-8
[4] Michael S. Branicky. 1994. Analyzing continuous switching systems: theory and
examples. In ACC, Vol. 3. 3110โ3114. https://doi.org/10.1109/ACC.1994.735143
[5] Michael S. Branicky. 1998. Multiple Lyapunov functions and other analysis
tools for switched and hybrid systems. IEEE Trans. Autom. Control. 43, 4 (1998),475โ482. https://doi.org/10.1109/9.664150
[6] Michael S. Branicky. 2005. Introduction to Hybrid Systems. In Handbook of Net-worked and Embedded Control Systems, Dimitrios Hristu-Varsakelis andWilliam S.
Levine (Eds.). Birkhรคuser, 91โ116. https://doi.org/10.1007/0-8176-4404-0_5
[7] R. W. Brockett. 1983. Asymptotic stability and feedback stabilization. In Differen-tial Geometric Control Theory. Birkhauser, 181โ191.
[8] Carmen Chicone. 2006. Ordinary Differential Equations with Applications, SecondEdition. Springer-Verlag New York. https://doi.org/10.1007/0-387-35794-7
[9] Jorge Cortes. 2008. Discontinuous dynamical systems. IEEE Control SystemsMagazine 28, 3 (2008), 36โ73. https://doi.org/10.1109/MCS.2008.919306
[10] Raymond A. Decarlo, Michael S. Branicky, Stefan Pettersson, and Bengt Lennart-
son. 2000. Perspectives and results on the stability and stabilizability of hybrid
systems. Proc. IEEE 88, 7 (2000), 1069โ1082. https://doi.org/10.1109/5.871309
[11] Nathan Fulton, Stefan Mitsch, Brandon Bohrer, and Andrรฉ Platzer. 2017.
Bellerophon: Tactical Theorem Proving for Hybrid Systems. In ITP (LNCS),Mauricio Ayala-Rincรณn and Cรฉsar A. Muรฑoz (Eds.), Vol. 10499. Springer, 207โ224.
https://doi.org/10.1007/978-3-319-66107-0_14
[12] Nathan Fulton, Stefan Mitsch, Jan-David Quesel, Marcus Vรถlp, and Andrรฉ Platzer.
2015. KeYmaera X: An Axiomatic Tactical Theorem Prover for Hybrid Systems.
In CADE (LNCS), Amy P. Felty and Aart Middeldorp (Eds.), Vol. 9195. Springer,
Cham, 527โ538. https://doi.org/10.1007/978-3-319-21401-6_36
[13] Sicun Gao, James Kapinski, Jyotirmoy V. Deshmukh, Nima Roohi, Armando Solar-
Lezama, Nikos Arรฉchiga, and Soonho Kong. 2019. Numerically-Robust Inductive
Proof Rules for Continuous Dynamical Systems. In CAV (LNCS), Isil Dillig andSerdar Tasiran (Eds.), Vol. 11562. Springer, 137โ154. https://doi.org/10.1007/978-
3-030-25543-5_9
[14] Sicun Gao, Soonho Kong, and Edmund M. Clarke. 2013. dReal: An SMT Solver for
Nonlinear Theories over the Reals. In CADE (LNCS), Maria Paola Bonacina (Ed.),
Vol. 7898. Springer, 208โ214. https://doi.org/10.1007/978-3-642-38574-2_14
[15] Miriam Garcรญa Soto and Pavithra Prabhakar. 2020. Abstraction based verification
of stability of polyhedral switched systems. Nonlinear Analysis: Hybrid Systems36 (2020), 100856. https://doi.org/10.1016/j.nahs.2020.100856
[16] Rafal Goebel, Ricardo G. Sanfelice, and Andrew R. Teel. 2009. Hybrid dynamical
systems. IEEE Control Systems Magazine 29, 2 (2009), 28โ93. https://doi.org/10.
1109/MCS.2008.931718
[17] Rafal Goebel, Ricardo G. Sanfelice, and Andrew R. Teel. 2012. Hybrid DynamicalSystems: Modeling, Stability, and Robustness. Princeton University Press.
[18] Thomas A. Henzinger. 1996. The Theory of Hybrid Automata. In LICS. IEEEComputer Society, 278โ292.
[19] Martin Johansson and Anders Rantzer. 1998. Computation of piecewise quadratic
Lyapunov functions for hybrid systems. IEEE Trans. Autom. Control. 43, 4 (1998),555โ559. https://doi.org/10.1109/9.664157
[20] James Kapinski, Jyotirmoy V. Deshmukh, Sriram Sankaranarayanan, and Nikos
Arรฉchiga. 2014. Simulation-guided Lyapunov analysis for hybrid dynamical
systems. In HSCC, Martin Frรคnzle and John Lygeros (Eds.). ACM, 133โ142. https:
//doi.org/10.1145/2562059.2562139
[21] Hassan K. Khalil. 1992. Nonlinear systems. Macmillan Publishing Company, New
York. xii+564 pages.
[22] Daniel Liberzon. 2003. Switching in Systems and Control. Birkhรคuser. https:
//doi.org/10.1007/978-1-4612-0017-8
[23] John Lygeros, Karl Henrik Johansson, Slobodan N. Simic, Jun Zhang, and
Shankar S. Sastry. 2003. Dynamical properties of hybrid automata. IEEE Trans.Autom. Control. 48, 1 (2003), 2โ17. https://doi.org/10.1109/TAC.2002.806650
[24] Stefan Mitsch and Andrรฉ Platzer. 2016. The KeYmaera X proof IDE: Concepts
on usability in hybrid systems theorem proving. In 3rd Workshop on FormalIntegrated Development Environment (EPTCS), Catherine Dubois, Paolo Masci,
and Dominique Mรฉry (Eds.), Vol. 240. 67โ81. https://doi.org/10.4204/EPTCS.240.5
[25] Stefan Mitsch and Andrรฉ Platzer. 2020. A Retrospective on Developing Hybrid
Systems Provers in the KeYmaera Family - A Tale of Three Provers. In DeductiveSoftware Verification: Future Perspectives - Reflections on the Occasion of 20 Yearsof KeY, Wolfgang Ahrendt, Bernhard Beckert, Richard Bubel, Reiner Hรคhnle, and
Matthias Ulbrich (Eds.). LNCS, Vol. 12345. Springer, 21โ64. https://doi.org/10.
1007/978-3-030-64354-6_2
[26] Eike Mรถhlmann and Oliver E. Theel. 2013. Stabhyli: a tool for automatic stability
verification of non-linear hybrid systems. In HSCC, Calin Belta and Franjo Ivancic(Eds.). ACM, 107โ112. https://doi.org/10.1145/2461328.2461347
[27] Eike Mรถhlmann and Oliver E. Theel. 2021. Stabhyli. https://uol.de/svs/forschung/
avacs/stabhyli [Online; accessed 27-October-2021].
[28] A. S. Morse. 1995. Control Using Logic-Based Switching. In Trends in Control,Alberto Isidori (Ed.). Springer London, London, 69โ113. https://doi.org/10.1007/
978-1-4471-3061-1_4
[29] Jens Oehlerking. 2011. Decomposition of stability proofs for hybrid systems. Ph.D.Dissertation. Carl von Ossietzky University of Oldenburg. https://oops.uni-
oldenburg.de/id/eprint/1375
[30] Susan S. Owicki and David Gries. 1976. Verifying Properties of Parallel Programs:
An Axiomatic Approach. Commun. ACM 19, 5 (1976), 279โ285. https://doi.org/
10.1145/360051.360224
[31] A. Papachristodoulou, J. Anderson, G. Valmorbida, S. Prajna, P. Seiler, P. A.
Parrilo, M. M. Peet, and D. Jagt. 2021. SOSTOOLS: Sum of squares optimizationtoolbox for MATLAB. http://arxiv.org/abs/1310.4716. Available from
https://github.com/oxfordcontrol/SOSTOOLS.[32] Andrรฉ Platzer. 2010. Logical Analysis of Hybrid Systems - Proving Theorems for
Complex Dynamics. Springer. https://doi.org/10.1007/978-3-642-14509-4
[33] Andrรฉ Platzer. 2017. A Complete Uniform Substitution Calculus for Differential
Dynamic Logic. J. Autom. Reasoning 59, 2 (2017), 219โ265. https://doi.org/10.
1007/s10817-016-9385-1
[34] Andrรฉ Platzer. 2018. Logical Foundations of Cyber-Physical Systems. Springer,Cham. https://doi.org/10.1007/978-3-319-63588-0
[35] Andrรฉ Platzer and Yong Kiam Tan. 2020. Differential Equation Invariance Axiom-
atization. J. ACM 67, 1, Article 6 (2020), 66 pages. https://doi.org/10.1145/3380825
[36] Andreas Podelski and Silke Wagner. 2006. Model Checking of Hybrid Systems:
From Reachability Towards Stability. In HSCC (LNCS), Joรฃo P. Hespanha and
Ashish Tiwari (Eds.), Vol. 3927. Springer, 507โ521. https://doi.org/10.1007/
11730637_38
[37] Stephen Prajna, Ali Jadbabaie, and George J. Pappas. 2007. A Framework for
Worst-Case and Stochastic Safety Verification Using Barrier Certificates. IEEETrans. Automat. Contr. 52, 8 (2007), 1415โ1428. https://doi.org/10.1109/TAC.2007.
902736
[38] S. Prajna and A. Papachristodoulou. 2003. Analysis of switched and hybrid
systems - beyond piecewise quadratic methods. In ACC, Vol. 4. 2779โ2784 vol.4.https://doi.org/10.1109/ACC.2003.1243743
[39] Hadi Ravanbakhsh and Sriram Sankaranarayanan. 2015. Counter-Example
Guided Synthesis of control Lyapunov functions for switched systems. In CDC.IEEE, 4232โ4239. https://doi.org/10.1109/CDC.2015.7402879
[40] Pierre Roux, Yuen-Lam Voronin, and Sriram Sankaranarayanan. 2018. Validating
numerical semidefinite programming solvers for polynomial invariants. FormalMethods Syst. Des. 53, 2 (2018), 286โ312. https://doi.org/10.1007/s10703-017-
0302-y
[41] Sriram Sankaranarayanan, Xin Chen, and Erika รbrahรกm. 2013. Lyapunov
Function Synthesis Using Handelman Representations. In NOLCOS, Sophie Tar-bouriech and Miroslav Krstic (Eds.). International Federation of Automatic Con-
trol, 576โ581. https://doi.org/10.3182/20130904-3-FR-2041.00198
[42] Zhikun She and Bai Xue. 2014. Discovering Multiple Lyapunov Functions for
Switched Hybrid Systems. SIAM J. Control. Optim. 52, 5 (2014), 3312โ3340.
https://doi.org/10.1137/130934313
[43] Miriam Garcรญa Soto and Pavithra Prabhakar. 2018. Averist: Algorithmic Verifier
for Stability of Linear Hybrid Systems. In HSCC, Maria Prandini and Jyotirmoy V.
Deshmukh (Eds.). ACM, 259โ264. https://doi.org/10.1145/3178126.3178154
[44] Zhendong Sun and Shuzhi Sam Ge. 2011. Stability Theory of Switched DynamicalSystems. Springer. https://doi.org/10.1007/978-0-85729-256-8
[45] Yong Kiam Tan and Andrรฉ Platzer. 2021. Deductive Stability Proofs for Ordinary
Differential Equations. In TACAS (LNCS), Jan Friso Groote and Kim Guldstrand
Larsen (Eds.), Vol. 12652. Springer, 181โ199. https://doi.org/10.1007/978-3-030-
72013-1_10
[46] Yong KiamTan andAndrรฉ Platzer. 2021. Switched Systems as Hybrid Programs. In
ADHS (IFAC-PapersOnLine), Raphaรซl M. Jungers, Necmiye Ozay, and Alessandro
Abate (Eds.), Vol. 54. Elsevier, 247โ252. https://doi.org/10.1016/j.ifacol.2021.08.506
Yong Kiam Tan, Stefan Mitsch, and Andrรฉ Platzer
[47] Alfred Tarski. 1951. A Decision Method for Elementary Algebra and Geometry.RAND Corporation, Santa Monica, CA.
[48] Guisheng Zhai, Bo Hu, Kazunori Yasuda, and Anthony N. Michel. 2001. Stability
analysis of switched systems with stable and unstable subsystems: An average
dwell time approach. Int. J. Syst. Sci. 32, 8 (2001), 1055โ1061. https://doi.org/10.
1080/00207720116692
[49] Jun Zhang, Karl Henrik Johansson, John Lygeros, and Shankar Sastry. 2001.
Zeno hybrid systems. Int. J. Robust Nonlinear Control. 11, 5 (2001), 435โ451.
https://doi.org/10.1002/rnc.592
A PROOFSThis appendix provides proofs for the results presented in the main
paper. Relevant background for dLโs semantics and axiomatics is
given, expanding on the material in Section 2. Full definitions are
available in the literature [33, 34].
A dL state ๐ : V โ R assigns a real value to each variable in
V . The set of variables V consists of the continuously evolving
state variables ๐ฅ = (๐ฅ1, . . . , ๐ฅ๐) of a switched system model and
additional variables V \ {๐ฅ} used as program auxiliaries for those
models. Following Tan and Platzer [46], dL states are projected on
the state variables ๐ฅ and the (projected) dL states๐ are equivalently
treated as points in R๐ . The semantics of program auxiliaries is as
usual [34]. The axioms and proof rules of dL used in the proofs are
as follows.
[:=] [๐ฅ := ๐]๐ (๐ฅ) โ ๐ (๐) (๐ free for ๐ฅ in ๐ )
[?] [?๐]๐ โ (๐ โ ๐)
[;] [๐ผ ; ๐ฝ]๐ โ [๐ผ] [๐ฝ]๐
[โช] [๐ผ โช ๐ฝ]๐ โ [๐ผ]๐ โง [๐ฝ]๐
[โ] [๐ผโ]๐ โ ๐ โง [๐ผ] [๐ผโ]๐
loop
ฮ โข Inv Inv โข [๐ผ] Inv Inv โข ๐
ฮ โข [๐ผโ]๐
loopT
ฮ โข [๐ผ๐ ]Inv Inv โข [๐ผ๐ข ]Inv Inv โข [๐ผ๐ ]Inv Inv โข ๐
ฮ โข [๐ผ๐ ; (๐ผ๐ข ;๐ผ๐ )โ]๐
G
โข ๐
ฮ โข [๐ผ]๐ M[ยท]๐ โข ๐ ฮ โข [๐ผ]๐
ฮ โข [๐ผ]๐
dIโฝ
ฮ, ๐ โข ๐โฝ๐ ๐ โข L๐ (๐ฅ) (๐)โฅL๐ (๐ฅ) (๐)
ฮ โข [๐ฅ โฒ = ๐ (๐ฅ) &๐]๐โฝ๐ (โฝ is either โฅ or >)
dC
ฮ โข [๐ฅ โฒ = ๐ (๐ฅ) &๐]๐ถ ฮ โข [๐ฅ โฒ = ๐ (๐ฅ) &๐ โง๐ถ]๐ฮ โข [๐ฅ โฒ = ๐ (๐ฅ) &๐]๐
dW
๐ โข ๐
ฮ โข [๐ฅ โฒ = ๐ (๐ฅ) &๐]๐
dbxโฝ
๐ โข L๐ (๐ฅ) (๐) โฅ ๐๐
๐ โฝ 0 โข [๐ฅ โฒ = ๐ (๐ฅ) &๐]๐ โฝ 0
(โฝ is either โฅ or >)
Barr
๐, ๐ = 0 โข L๐ (๐ฅ) (๐) > 0
ฮ, ๐ โฝ 0 โข [๐ฅ โฒ = ๐ (๐ฅ) &๐]๐ โฝ 0
(โฝ is either โฅ or >)
DCC
[๐ฅ โฒ=๐ (๐ฅ) &๐โง๐]๐ โง [๐ฅ โฒ=๐ (๐ฅ) &๐] (ยฌ๐โ[๐ฅ โฒ=๐ (๐ฅ) &๐]ยฌ๐)โ [๐ฅ โฒ=๐ (๐ฅ) &๐] (๐ โ ๐ )
DX [๐ฅ โฒ=๐ (๐ฅ) &๐]๐ โ (๐ โ ๐ โง [๐ฅ โฒ=๐ (๐ฅ) &๐]๐) (๐ฅ โฒ โ ๐,๐)
Axioms [:=], [?], [;], [โช], [โ] unfold box modalities of their re-
spective hybrid programs according to their semantics [33, 34].
These equivalences are especially useful for obtaining correct-by-
construction arithmetical conditions on Lyapunov functions in
derivations and implementations (see Corollaries 5 and 6). The de-
rived loop induction rules loop, loopT are used to prove stability
properties of switched system models with suitably chosen loop
invariants Inv (see Section 3). Rule G is Gรถdel generalization, and
rule M[ยท] is the derived monotonicity rule for box modality post-
conditions; antecedents that have no free variables bound in ๐ผ are
soundly kept across uses of rules loop, loopT, G, M[ยท] [33, 34].The remaining axioms and proof rules are used in dL to reason
about differential equations ๐ฅ โฒ = ๐ (๐ฅ) &๐ [33โ35, 45]. Differential
invariants dIโฝ proves ODE invariance for an inequality ๐ โฝ ๐
if their Lie derivatives satisfy L๐ (๐ฅ) (๐) โฅ L
๐ (๐ฅ) (๐). Differentialcuts dC say that if one can separately prove that formula ๐ถ is al-
ways satisfied along the solution, then ๐ถ may be assumed in the
domain constraint when proving the same for formula ๐ . Differ-
ential weakening dW says that postcondition ๐ is always satisfied
along solutions if it is already implied by the domain constraint.
Rule dbxโฝ is the Darboux inequality proof rule for the invariance
of ๐ โฝ 0, where ๐ is an arbitrary cofactor term [35]. Rule Barr is
a dL rendition of the strict barrier certificates proof rule [37] for
invariance of ๐ โฝ 0. Axiom DCC says that to prove that an impli-
cation ๐ โ ๐ is always true along an ODE, it suffices to prove it
assuming ๐ in the domain if ยฌ๐ is invariant along the ODE [45].
Differential skip DX unfolds the effect of a differential equation on
the initial state in the box modality.
To improve readability in the proofs below, formula and premises
are often abbreviated, e.g., with aโ, 1โ. To avoid confusion, the scope
of these abbreviations always extend to the end of each paragraphlabel, i.e., the abbreviations used in the Stability proofs should not
be confused with those used in the Pre-attractivity proofs.
Proof of Lemma 2. Letฮฆ(๐ฅ) denote the set of all domain-obeying
solutions ๐ : [0,๐๐ ] โ R๐ for a given switched system from state
๐ฅ โ R๐ as in Def. 1. Hybrid program ๐ผ models this switched system
if for any initial state ๐ โ R๐ , the state a is reachable from ๐ , i.e.,
(๐, a) โ [[๐ผ]] , iff a = ๐ (๐) for some ๐ โ ฮฆ(๐) and ๐ โ [0,๐๐ ]. Forthe augmented program๐ผ, ๐ก โฒ = 1, in particular, ๐ก syntactically tracks
the progression of time so that (๐, a) โ [[๐ผ, ๐ก โฒ = 1]] iff a = ๐ (๐) forsome ๐ โ ฮฆ(๐) and ๐ = a (๐ก) โ๐ (๐ก). Tan and Platzer [46] prove the
adequacy of hybrid program models for several switching designs.
The formulas UStab(๐ผ) and UGpAttr(๐ผ) syntactically express
their respective quantifiers from Def. 1, where the box modality [ยท]is used in both formulas to quantify over all reachable states of ๐ผ
(and ๐ผ, ๐ก โฒ = 1), i.e., all times ๐ โ [0,๐๐ ] along all solutions ๐ โ ฮฆ.Thus, the correctness of these specifications follows directly from
the definition of dLโs formula semantics [33, 34]. In UGpAttr(๐ผ),variable ๐ก is set to 0 initially, so the implication ๐ก โฅ ๐ โ . . . in
the postcondition of the box modality further restricts temporal
quantification to all times ๐ (๐ ) โค ๐ โค ๐๐ for ๐ โ ฮฆ(๐), as requiredin the definition of uniform pre-attractivity. โก
Proof of Corollary 3. The proof rule CLF is an instance of
rule MLF from Corollary 4 where the Lyapunov functions for all
modes ๐ โ P are chosen identically with ๐๐ = ๐ . Nevertheless, a
full derivation of CLF is given here because it provides the building
blocks used in later derivations. The stability and pre-attractivity
conjuncts of UGpAS(๐ผstate) are proved separately with โงR:
Verifying Switched System Stability With Logic
โข UStab(๐ผstate) โข UGpAttr(๐ผstate)โงR โข UGpAS(๐ผstate)
Stability. The derivation for stability begins by Skolemizing the
succedent with โR,โR, followed by two arithmetic cuts which are
justified as follows. For any Y > 0, the Lyapunov function๐ attains a
minimum value on the compact set characterized by โฅ๐ฅ โฅ = Y. From
the first (topmost) premise of rule CLF, this minimum is attained
away from the origin so it is positive, which proves the first cut
of formula โ๐ >0 aโ where aโ โก โ๐ฅ (โฅ๐ฅ โฅ = Y โ ๐ โฅ ๐ ). AfterSkolemizing๐ withโL, the premise๐ (0) = 0 implies, by continuity
of dL term semantics [33], that the sublevel set characterized by
๐ <๐ with๐ > 0 (see Fig. 1) contains a sufficiently small ๐ฟ ball
around the origin. This proves the second arithmetic cut with the
formula โ๐ฟ (0 < ๐ฟ โค Y โง bโ) where bโ โก โ๐ฅ (โฅ๐ฅ โฅ < ๐ฟ โ ๐ <๐ ).After both cuts, the antecedent ๐ฟ is used to witness the succedent
by โR.aโ, ๐ฟ โค Y, bโ โข โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ [๐ผstate ] โฅ๐ฅ โฅ < Y
)โR
aโ, 0 < ๐ฟ โค Y, bโ โข โ๐ฟ>0 โ๐ฅ(โฅ๐ฅ โฅ < ๐ฟ โ [๐ผstate ] โฅ๐ฅ โฅ < Y
)cut, R, โL Y>0,๐ >0, aโ โข โ๐ฟ>0 โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ [๐ผstate ] โฅ๐ฅ โฅ < Y
)cut, R, โL Y>0 โข โ๐ฟ>0 โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ [๐ผstate ] โฅ๐ฅ โฅ < Y
)โR,โR โข UStab(๐ผstate)
The derivation continues from the open premise by Skolemiz-
ing with โR, โR and proving the LHS of the implication in bโwith โL, โL. Then, the loop rule is used with the stability loop in-
variant Inv๐ โก โฅ๐ฅ โฅ < Y โง๐ <๐ . This results in three premises, 1โwhich shows that the invariant is implied by the initial antecedent
assumptions, 2โ, the crucial premise, which shows that the invari-
ant Inv๐ is preserved across the loop body of ๐ผstate, and 3โ which
shows that the invariant implies the postcondition. These premises
are shown and proved further below.
1โ 2โ 3โloop
aโ, ๐ฟ โค Y, โฅ๐ฅ โฅ < ๐ฟ,๐ <๐ โข [๐ผstate ] โฅ๐ฅ โฅ < YโL, โL
aโ, ๐ฟ โค Y, bโ, โฅ๐ฅ โฅ < ๐ฟ โข [๐ผstate ] โฅ๐ฅ โฅ < YโR, โR
aโ, ๐ฟ โค Y, bโ โข โ๐ฅ(โฅ๐ฅ โฅ<๐ฟ โ [๐ผstate ] โฅ๐ฅ โฅ < Y
)Premise 1โ proves by R from the antecedents using the inequali-
ties โฅ๐ฅ โฅ < ๐ฟ and ๐ฟ โค Y.
โR๐ฟ โค Y, โฅ๐ฅ โฅ < ๐ฟ,๐ <๐ โข Inv๐
Premise 3โ proves trivially since the postcondition โฅ๐ฅ โฅ < Y is
part of the loop invariant:
โRInv๐ โข โฅ๐ฅ โฅ < Y
The derivation continues from premise 2โ by unfolding the loop
body of ๐ผstate with [โช], โงR. This results in one premise for each
switching choice ๐ โ P, indexed below by ๐ .
aโ, Inv๐ โข [๐ฅโฒ = ๐๐ (๐ฅ) &๐๐ ]Inv๐ [โช], โงR
aโ, Inv๐ โข [โ๐โP ๐ฅโฒ = ๐๐ (๐ฅ) &๐๐ ]Inv๐ Each of these ๐ โ P premises is an ODE invariance question,
which is decidable in dL [35]. The derivation below shows how
to derive arithmetical conditions on ๐ from these premises. The
right conjunct of Inv๐ , ๐ <๐ , is added to the domain constraint
with a dC step; the cut premise is labeled 4โ and proved below. A
subsequent dC step adds โฅ๐ฅ โฅ โ Y to the domain constraint using
the contrapositive of antecedent aโ and the derivation is completed
with rule Barr since the resulting assumptions are contradictory.
โR โฅ๐ฅ โฅ โ Y, โฅ๐ฅ โฅ=Y โข false
Barr โฅ๐ฅ โฅ < Y โข [๐ฅโฒ=๐๐ (๐ฅ) &๐๐ โง๐ <๐ โง โฅ๐ฅ โฅ โ Y ] โฅ๐ฅ โฅ < YdC
aโ, โฅ๐ฅ โฅ < Y โข [๐ฅโฒ=๐๐ (๐ฅ) &๐๐ โง๐ <๐ ] โฅ๐ฅ โฅ < Y 4โdC
aโ, Inv๐ โข [๐ฅโฒ=๐๐ (๐ฅ) &๐๐ ]Inv๐ The derivation from 4โ is completed with a dIโฝ step whose
resulting arithmetic is implied by the bottom premise of rule CLF.
โR ๐๐ โข L
๐๐(๐ ) โค 0
dIโฝ๐ <๐ โข [๐ฅโฒ = ๐๐ (๐ฅ) &๐๐ ]๐ <๐
Pre-attractivity. The derivation for pre-attractivity begins by
Skolemizing ๐ฟ, Y with โR, โR, followed by a series of arithmetic
cuts which are justified stepwise. First, the Lyapunov function ๐ is
bounded above on the ball characterized by โฅ๐ฅ โฅ < ๐ฟ , which justifies
a cut of the formula โ๐ >0 aโ with aโ โก โ๐ฅ(โฅ๐ฅ โฅ < ๐ฟ โ ๐ <๐
).
After Skolemizing the upper bound๐ , note that the set charac-
terized by formula ๐ โค ๐ is compact by radial unboundedness
(middle premise of rule CLF). Therefore, the set characterized by
formula ๐ โค ๐ โง โฅ๐ฅ โฅ โฅ Y is an intersection of a compact and
closed set, which is itself compact. Thus, ๐ attains a minimum
๐ on that set which, by the first (topmost) premise is positive.
This justifies the next arithmetic cut of the formula โ๐>0 bโ with
bโ โก โ๐ฅ (๐ โค๐ โง โฅ๐ฅ โฅ โฅ Y โ ๐ โฅ ๐ ), where ๐ is subsequently
Skolemized with โL. The steps are shown below, with the box
modality in UGpAttr(๐ผstate) temporarily hidden with . . . as it is
not relevant for this part of the derivation.
Y>0,๐ >0, aโ,๐>0, bโ โข โ๐ โฅ0โ๐ฅ(โฅ๐ฅ โฅ < ๐ฟ โ . . .
)cut, R, โL Y>0,๐ >0, aโ โข โ๐ โฅ0โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ . . .
)cut, R, โL Y>0 โข โ๐ โฅ0โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ . . .
)โR,โR โข UGpAttr(๐ผstate)
Intuitively (see Fig. 1) the next arithmetic steps syntactically
determine ๐ โฅ 0 such that the value of ๐ is guaranteed to decrease
from๐ to๐ along all switching trajectories within time๐ . Consider
the set characterized by formula ๐๐ โง๐ โค ๐ โค ๐ , which is the
set of states (before reaching ๐ < ๐ ) where switching to ODE
๐ฅ โฒ = ๐๐ (๐ฅ) &๐๐ , ๐ โ P is possible. From the third (bottom) premise
of rule CLF, L๐๐(๐ ) is negative on the set characterized by the
formula ๐๐ โง๐ โค ๐ โค๐ because conjunct๐ โค ๐ bounds the set
away from the origin as๐ > 0. Using radial unboundedness again,
๐ โค๐ is compact, so the set characterized by ๐๐ โง๐ โค ๐ โค๐ is
an intersection of closed sets and compact sets which is therefore
compact. Accordingly, L๐๐(๐ ) attains a maximum value ๐๐ < 0
on that set, which justifies the following arithmetic cut, where the
bound ๐ < 0 is chosen uniformly across all choices of ๐ , e.g., as the
maximum over all ๐๐ for ๐ โ P:
โ๐<0โง๐โP
โ๐ฅ(๐๐ โง๐ โค ๐ โค๐ โ L
๐๐(๐ ) โค ๐
)๏ธธ ๏ธท๏ธท ๏ธธ
cโ
After Skolemizing ๐ , it suffices to pick ๐ โฅ 0 for the succedent
such that๐ + ๐๐ โค ๐ . Such a ๐ always exists since ๐ < 0.
aโ, bโ, ๐<0, cโ,๐ + ๐๐ โค ๐ โข โ๐ฅ(โฅ๐ฅ โฅ < ๐ฟ โ . . .
)โR Y>0,๐ >0, aโ,๐>0, bโ, ๐<0, cโ โข โ๐ โฅ0โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ . . .
)cut, R, โL Y>0,๐ >0, aโ,๐>0, bโ โข โ๐ โฅ0โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ . . .
)
Yong Kiam Tan, Stefan Mitsch, and Andrรฉ Platzer
The derivation continues by Skolemizing with โR,โR and prov-
ing the LHS of the implication in aโ with โL,โL. The assignment
๐ก := 0 is unfolded with axioms [;], [:=], then the loop rule is used
with the pre-attractivity loop invariant Inv๐ โก ๐ <๐ โง (๐ โฅ ๐ โ๐ <๐ +๐๐ก). Similar to the stability derivation, this results in three
premises, where the crucial premise 2โ requires showing that Inv๐is preserved across the loop body, while the other premises are
labeled 1โ and 3โ (all three premises are shown further below).
1โ 2โ 3โloop ๐<๐, bโ, ๐<0, cโ,๐ + ๐๐ โค ๐ , ๐ก=0 โข [๐ผstate, ๐ก
โฒ = 1] . . .[;], [:=] ๐<๐, bโ, ๐<0, cโ,๐ + ๐๐ โค ๐ โข [๐ก := 0;๐ผstate, ๐ก
โฒ = 1] . . .โL,โL
aโ, bโ, ๐<0, cโ,๐ + ๐๐ โค ๐ , โฅ๐ฅ โฅ<๐ฟ โข [๐ก := 0;๐ผstate, ๐กโฒ = 1] . . .
โR, โRaโ, bโ, ๐<0, cโ,๐ + ๐๐ โค ๐ โข โ๐ฅ
(โฅ๐ฅ โฅ<๐ฟ โ . . .
)Premise 1โ proves by R from the antecedents.
โR๐<๐, ๐ก = 0 โข Inv๐
Premise 3โ proves by R from the loop invariant using the fol-
lowing arithmetic argument. Suppose for contradiction that there
is a state satisfying the negation of the postcondition, i.e., assume
the negation ๐ก โฅ ๐ โง โฅ๐ฅ โฅ โฅ Y. Then, using the left conjunct of Inv๐together with โฅ๐ฅ โฅ โฅ Y to prove the LHS of the implication in bโgives assumption ๐ โฅ ๐ . The right conjunct of Inv๐ then yields
the chain of inequalities ๐ < ๐ + ๐๐ก โค ๐ + ๐๐ โค ๐ , which is a
contradiction. The steps are outlined below.
โR๐ โฅ ๐ ,๐<0,๐ + ๐๐ โค ๐ ,๐ <๐ + ๐๐ก, ๐ก โฅ ๐ โข falseR ๐ โฅ ๐ ,๐<0,๐ + ๐๐ โค ๐ , Inv๐, ๐ก โฅ ๐ โข falseR
bโ, ๐<0,๐ + ๐๐ โค ๐ , Inv๐, ๐ก โฅ ๐, โฅ๐ฅ โฅ โฅ Y โข falseR
bโ, ๐<0,๐ + ๐๐ โค ๐ , Inv๐ โข ๐ก โฅ ๐ โ โฅ๐ฅ โฅ < Y
The proof for premise 2โ proceeds by unfolding the loop body
with [โช], โงR, yielding one premise for each switching choice ๐ โ P.
A dC step proves the invariance of the left conjunct ๐ <๐ of Inv๐with dIโฝ (see the stability proof, sublevel sets of ๐ are invariant).
The right conjunct of Inv๐ is the implication abbreviated ๐ผ โก ๐ โฅ๐ โ ๐ <๐ +๐๐ก and this is proved below using axiom DCC, which
results in premises 4โ and 5โ (shown and proved further below).
4โ 5โDCC, โงR
cโ, ๐ผ โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐ก โฒ = 1&๐๐ โง๐ <๐ ]๐ผdC, dIโฝ
cโ, Inv๐ โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐ก โฒ = 1&๐๐ ]Inv๐[โช], โงR
cโ, Inv๐ โข [โ๐โP ๐ฅโฒ = ๐๐ (๐ฅ), ๐ก โฒ = 1&๐๐ ]Inv๐From premise 4โ, the proof is completed with a dIโฝ step using
the quantified assumption cโ and the domain constraint. Note that
the Lie derivative of the RHS๐ + ๐๐ก is ๐ using ๐ก โฒ = 1.
dIโฝ
Rโ
cโ,๐๐ โง๐ <๐ โง๐ โฅ ๐ โข L๐๐(๐ ) โค ๐
cโ, ๐ผ โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐ก โฒ = 1&๐๐ โง๐ <๐ โง๐ โฅ ๐ ]๐ <๐ + ๐๐กFrom premise 5โ, the proof is completed with a generalization G
step followed by dIโฝ to prove the invariance of formula ๐ < ๐
(see the stability proof, sublevel sets of ๐ are invariant). The ODE
in the outer box modality is elided with . . . here.
โdIโฝ ๐<๐ โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐ก โฒ = 1&๐๐ โง๐<๐ ]๐<๐
G, โR โข [. . .] (๐<๐ โ [๐ฅโฒ = ๐๐ (๐ฅ), ๐ก โฒ = 1&๐๐ โง๐<๐ ]๐<๐ ) โก
Proof of Corollary 4. The derivation of rule MLF builds on
the ideas of the derivation of rule CLF so similar proof steps are
explained in less detail here. The derivation starts with an โงR step
for the stability and pre-attractivity conjuncts which are proved
separately below.
โข UStab(๐ผstate) โข UGpAttr(๐ผstate)โงR โข UGpAS(๐ผstate)
Stability. The derivation for stability similarly begins with cut
and Skolemization steps. The difference compared to the deriva-
tion of rule CLF is the cut formulas are now conjunctions over all
possible modes ๐ โ P for the Lyapunov functions ๐๐ . The first cut
is โ๐ >0 aโ with aโ โก โง๐โP โ๐ฅ (โฅ๐ฅ โฅ = Y โ ๐๐ โฅ๐ ), where the
upper bound๐ >0 is chosen to be the maximum of the respective
bounds for each ๐๐ on the compact set characterized by โฅ๐ฅ โฅ = Y.
After Skolemizing ๐ , the second arithmetic cut is the formula
โ๐ฟ (0 < ๐ฟ โค Y โง bโ) with bโ โก โง๐โP โ๐ฅ (โฅ๐ฅ โฅ < ๐ฟ โ ๐๐ <๐ ).
Such a ๐ฟ exists by continuity for each ๐๐ , ๐ โ P since ๐๐ (0) = 0
from the first (topmost) premise of rule MLF. After both cuts, the
antecedent ๐ฟ is used to witness the succedent by โR.aโ, ๐ฟ โค Y, bโ โข โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ [๐ผstate ] โฅ๐ฅ โฅ < Y
)โR
aโ, 0 < ๐ฟ โค Y, bโ โข โ๐ฟ>0 โ๐ฅ(โฅ๐ฅ โฅ < ๐ฟ โ [๐ผstate ] โฅ๐ฅ โฅ < Y
)cut, R, โL Y>0,๐ >0, aโ โข โ๐ฟ>0 โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ [๐ผstate ] โฅ๐ฅ โฅ < Y
)cut, R, โL Y>0 โข โ๐ฟ>0 โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ [๐ผstate ] โฅ๐ฅ โฅ < Y
)โR, โR โข UStab(๐ผstate)The derivation continueswith logical simplification steps, Skolem-
izing the succedent and then proving the LHS of the implications
in antecedent bโ.
โR, โR
โL,โL
aโ, ๐ฟ โค Y, โฅ๐ฅ โฅ < ๐ฟ,โง
๐โP ๐๐ <๐ โข [๐ผstate ] โฅ๐ฅ โฅ < Y
aโ, ๐ฟ โค Y, bโ, โฅ๐ฅ โฅ < ๐ฟ โข [๐ผstate ] โฅ๐ฅ โฅ < Y
aโ, ๐ฟ โค Y, bโ โข โ๐ฅ(โฅ๐ฅ โฅ<๐ฟ โ [๐ผstate ] โฅ๐ฅ โฅ < Y
)Next, a cut, โจL step case splits on whether the switched system
is initially in its domain of definition characterized by formula
๐ โก โจ๐โP ๐๐ . The case where the system is not in its domain is
labeled 0โ, and the proof of this case is deferred to the end. In case
the system is in its domain, the loop rule is used with stability loop
invariant Inv๐ โก โฅ๐ฅ โฅ < Yโงโจ๐โP
(๐๐ โง๐๐ <๐
). This yields three
premises labeled 1โโ 3โ shown and proved further below.
1โ 2โ 3โloop
aโ, ๐ฟ โค Y, โฅ๐ฅ โฅ < ๐ฟ,โง
๐โP ๐๐ <๐,๐ โข [๐ผstate ] โฅ๐ฅ โฅ < Y 0โcut, โจL
aโ, ๐ฟ โค Y, โฅ๐ฅ โฅ < ๐ฟ,โง
๐โP ๐๐ <๐ โข [๐ผstate ] โฅ๐ฅ โฅ < Y
Premise 1โ proves by R from the antecedents using the inequal-
ities โฅ๐ฅ โฅ < ๐ฟ and ๐ฟ โค Y for the left conjunct and propositionally
from antecedents ๐ and
โง๐โP ๐๐ <๐ for the right conjunct.
โR๐ฟ โค Y, โฅ๐ฅ โฅ < ๐ฟ,
โง๐โP ๐๐ <๐,๐ โข Inv๐
Premise 3โ proves trivially since the postcondition โฅ๐ฅ โฅ < Y is
part of the loop invariant:
โRInv๐ โข โฅ๐ฅ โฅ < Y
The derivation continues from premise 2โ by unfolding the loop
body of ๐ผstate with [โช], โงR. Premises are indexed by ๐ โ P in
the derivation. The M[ยท] step propositionally strengthens the post-
condition to its constituent disjunct โฅ๐ฅ โฅ < Y โง ๐๐ < ๐ for the
chosen mode ๐ . Then, DX assumes domain ๐๐ in the antecedent
and a cut step adds the assumption โฅ๐ฅ โฅ < Y โง ๐๐ < ๐ . This cut
corresponds to the last (bottom) premise of rule MLF. It is labeled
4โ and explained below. The rest of the proof after the cut proceeds
Verifying Switched System Stability With Logic
identically to the corresponding derivation for rule CLF using the
respective conjunct for ๐ โ P from aโ. The steps are omitted here.
โaโ, โฅ๐ฅ โฅ<Y โง๐๐<๐ โข [๐ฅโฒ = ๐๐ (๐ฅ) &๐๐ ] ( โฅ๐ฅ โฅ<Y โง๐๐<๐ ) 4โ
cutaโ, Inv๐ ,๐๐ โข [๐ฅโฒ = ๐๐ (๐ฅ) &๐๐ ] ( โฅ๐ฅ โฅ<Y โง๐๐<๐ )
DXaโ, Inv๐ โข [๐ฅโฒ = ๐๐ (๐ฅ) &๐๐ ] ( โฅ๐ฅ โฅ<Y โง๐๐<๐ )
M[ยท]aโ, Inv๐ โข [๐ฅโฒ = ๐๐ (๐ฅ) &๐๐ ]Inv๐
[โช], โงRaโ, Inv๐ โข [โ๐โP ๐ฅโฒ = ๐๐ (๐ฅ) &๐๐ ]Inv๐
The cut premise 4โ is proved by splitting the disjunction in
Inv๐ (indexed by ๐ โ P below). The disjunct corresponding to
mode ๐ proves trivially. For modes ๐ โ ๐ , the derivation yields
a compatibility condition which is proved using the last (bottom)
premise of rule MLF.
โR ๐๐,๐๐ โข ๐๐ โค ๐๐R ๐ โ ๐,๐๐,๐๐ <๐,๐๐ โข ๐๐<๐โจLโจ
๐โP(๐๐ โง๐๐ <๐
),๐๐ โข ๐๐<๐
Inv๐ ,๐๐ โข โฅ๐ฅ โฅ<Y โง๐๐<๐
Returning to premise 0โ, for initial states not in the switched
systemโs domain, i.e., satisfying ยฌ๐ , no continuous motion is pos-
sible within the model. This is proved using the loop invariant
Inv0๐ โก โฅ๐ฅ โฅ < Y โง ยฌ๐ . The first and third premise resulting from
the loop rule are proved trivially (not shown below). For the remain-
ing premise, ยฌ๐ is preserved (trivially) across the loop body after
unfolding it with [โช], โงR and using DX to show that the system is
unable to switch to the ODE with domain ๐๐ .
โยฌ๐,๐๐ โข false
DX ยฌ๐ โข [๐ฅโฒ = ๐๐ (๐ฅ) &๐๐ ]Inv0๐ [โช], โงR Inv0๐ โข [โ๐โP ๐ฅโฒ = ๐๐ (๐ฅ) &๐๐ ]Inv0๐ loop ๐ฟ โค Y, โฅ๐ฅ โฅ < ๐ฟ,ยฌ๐ โข [๐ผstate ] โฅ๐ฅ โฅ < Y
Pre-attractivity. The derivation for pre-attractivity begins with
logical simplification followed by a series of arithmetic cuts. First,
the multiple Lyapunov functions ๐๐ , ๐ โ P are simultaneously
bounded above on the ball characterized by โฅ๐ฅ โฅ < ๐ฟ , with the cut
โ๐ >0 aโ where aโ โก โง๐โP โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ ๐๐ <๐
). The upper
bound๐ is Skolemized, then the next arithmetic cut uses โ๐>0 bโwith bโ โก โง
๐โP โ๐ฅ (๐๐ โค๐ โง โฅ๐ฅ โฅ โฅ Y โ ๐๐ โฅ ๐ ) (using radialunboundedness of all functions๐๐ from the second premise of MLF).
Then,๐ is Skolemized with โL. The steps are shown below, with
the box modality in UGpAttr(๐ผstate) temporarily hidden with . . .
as it is not relevant for this part of the derivation.
Y>0,๐ >0, aโ,๐>0, bโ โข โ๐ โฅ0โ๐ฅ(โฅ๐ฅ โฅ < ๐ฟ โ . . .
)cut, R, โL Y>0,๐ >0, aโ โข โ๐ โฅ0โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ . . .
)cut, R, โL Y>0 โข โ๐ โฅ0โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ . . .
)โR, โR โข UGpAttr(๐ผstate)
Identically to rule CLF, the premises of rule MLF prove that, for
each ๐ โ P, the respective Lie derivatives L๐๐(๐๐ ) are bounded
above by some ๐๐ < 0 on the compact set characterized by formula
๐๐ โง ๐ โค ๐๐ โค ๐ . This justifies the following arithmetic cut,
where the bound ๐ < 0 is chosen to be the maximum over all ๐๐across all switching choices ๐ โ P:
โ๐<0โง๐โP
โ๐ฅ(โ L
๐๐(๐๐ ) โค ๐
)๏ธธ ๏ธท๏ธท ๏ธธ
cโ
The derivation proceeds similarly to rule CLF, picking๐ > 0 such
that๐ + ๐๐ โค ๐ , then unfolding the quantifiers in the succedent.
aโ, bโ, ๐<0, cโ,๐>0,๐ +๐๐ โค๐ , โฅ๐ฅ โฅ<๐ฟ โข . . .โR,โR
aโ, bโ, ๐<0, cโ,๐>0,๐ +๐๐ โค๐ โข โ๐ฅ(โฅ๐ฅ โฅ<๐ฟ โ . . .
)โR Y>0,๐ >0, aโ,๐>0, bโ, ๐<0, cโ โข โ๐ โฅ0. . .
cut, R, โL Y>0,๐ >0, aโ,๐>0, bโ โข โ๐ โฅ0. . .
The LHS in antecedent aโ is proved and the succedent is further
unfolded with [;], [:=]. The antecedents are abbreviated with ฮ โกbโ, ๐<0, cโ,๐ > 0,๐ +๐๐ โค ๐ below. Similar to the stability proof,
the derivation continues with a cut, โจL step that case splits on
whether the switched system is initially in its domain of definition
๐ โก โจ๐โP ๐๐ . The case where the system is not in its domain is
labeled 0โ, and its proof is deferred to the end. In case the system
is in domain ๐ , the loop rule is used with pre-attractivity loop
invariant Inv๐ โก โจ๐โP
(๐๐ โง๐๐ <๐ โง (๐๐ โฅ ๐ โ ๐๐ <๐ +๐๐ก)
).
This results in three premises 1โโ 3โ which are proved below.
1โ 2โ 3โloop ฮ,
โง๐โP ๐๐<๐, ๐ก = 0,๐ โข [๐ผstate, ๐ก
โฒ = 1] . . . 0โcut, โจL ฮ,
โง๐โP ๐๐<๐, ๐ก = 0 โข [๐ผstate, ๐ก
โฒ = 1] . . .[;], [:=] ฮ,
โง๐โP ๐๐<๐ โข [๐ก := 0;๐ผstate, ๐ก
โฒ = 1] . . .โL, โL ฮ, aโ, โฅ๐ฅ โฅ<๐ฟ โข [๐ก := 0;๐ผstate, ๐ก
โฒ = 1] . . .
Premise 1โ proves by R from the antecedents.
โRโง
๐โP ๐๐<๐, ๐ก = 0,๐ โข Inv๐
Premise 3โ proves by R from the loop invariant after using โจLto split the disjuncts of the loop invariant. The disjunct for mode
๐ โ P is abbreviated ๐ โก ๐๐ <๐ โง (๐๐ โฅ ๐ โ ๐๐ <๐ +๐๐ก). Therest of the arithmetic argument is identical to the corresponding
premise for CLF using the conjunct for ๐ in bโ (summarized below).
โR๐๐ โฅ ๐ ,๐<0,๐ + ๐๐ โค ๐ ,๐๐ <๐ + ๐๐ก, ๐ก โฅ ๐ โข falseR ๐๐ โฅ ๐ ,๐<0,๐ + ๐๐ โค ๐ ,๐ , ๐ก โฅ ๐ โข falseR
bโ, ๐<0,๐ + ๐๐ โค ๐ ,๐ , ๐ก โฅ ๐, โฅ๐ฅ โฅ โฅ Y โข falseR
bโ, ๐<0,๐ + ๐๐ โค ๐ ,๐ โข ๐ก โฅ ๐ โ โฅ๐ฅ โฅ < YโจL
bโ, ๐<0,๐ + ๐๐ โค ๐ , Inv๐ โข ๐ก โฅ ๐ โ โฅ๐ฅ โฅ < Y
The derivation from premise 2โ proceeds by unfolding the loop
body with [โช], โงR, DX, yielding one premise for each switching
choice ๐ โ P. The M[ยท] step selects the disjunct ๐ (as defined above
for premise 3โ) in the postcondition corresponding to mode ๐ and
the cut adds this disjunct to the antecedents (the cut premise 4โis shown and proved below). The rest of the proof after the cut is
omitted here as it is identical to the corresponding derivation for
rule CLF using the respective conjunct in cโ.
โ4โ cโ, ๐ โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐ก โฒ = 1&๐๐ ]๐
cutcโ, Inv๐,๐๐ โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐ก โฒ = 1&๐๐ ]๐
M[ยท]cโ, Inv๐,๐๐ โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐ก โฒ = 1&๐๐ ]Inv๐
[โช], โงR, DXcโ, Inv๐ โข [โ๐โP ๐ฅโฒ = ๐๐ (๐ฅ), ๐ก โฒ = 1&๐๐ ]Inv๐
The cut premise 4โ is proved by splitting the disjunction in
Inv๐ with โจL (indexed by ๐ โ P below). For modes ๐ โ ๐ , the
derivation leaves a compatibility condition which proves using the
last (bottom) premise of rule MLF. Note that the rule uses succedent
๐๐ = ๐๐ since a symmetric condition (๐๐ โค ๐๐ ) is obtained when
the roles of modes ๐, ๐ โ P are swapped.
Yong Kiam Tan, Stefan Mitsch, and Andrรฉ Platzer
โR ๐๐,๐๐ โข ๐๐ โค ๐๐R ๐ โ ๐,๐๐ โง๐๐ <๐ โง (๐๐ โฅ ๐ โ ๐๐ <๐ + ๐๐ก ),๐๐ โข ๐ โจLโจ
๐โP(๐๐ โง๐๐ <๐ โง (๐๐ โฅ ๐ โ ๐๐ <๐ + ๐๐ก )
),๐๐ โข ๐
Inv๐,๐๐ โข ๐
Returning to premise 0โ, similar to the case for stability, initial
states satisfying ยฌ๐ have no continuous motion possible so they
are stuck at the initial state (with global clock ๐ก = 0). This is proved
using the loop invariant Inv0๐ โก ๐ก = 0 โง ยฌ๐ . The first and third
premise resulting from the loop rule are proved trivially (not shown
below). For the remaining premise,ยฌ๐ is preserved (trivially) across
the loop body after unfolding it with [โช], โงR and using DX to show
that the system is unable to switch to the ODE with domain ๐๐ .
โยฌ๐,๐๐ โข false
DX ยฌ๐ โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐ก โฒ = 1&๐๐ ]Inv0๐[โช], โงR Inv0๐ โข [โ๐โP ๐ฅโฒ = ๐๐ (๐ฅ), ๐ก โฒ = 1&๐๐ ]Inv0๐loop ๐ > 0, ๐ก = 0,ยฌ๐ โข [๐ผstate, ๐ก
โฒ = 1] (๐ก โฅ ๐ โ โฅ๐ฅ โฅ < Y) โก
Proof of Corollary 5. The derivation of rule MLF๐บ is similar
to MLF, but adapted to the shape of the guarded switching model
๐ผguard and its corresponding loop invariants. The derivation starts
with an โงR step for the stability and pre-attractivity conjuncts
which are proved separately below.
โข UStab(๐ผguard) โข UGpAttr(๐ผguard)โงR โข UGpAS(๐ผguard)
Stability. The derivation for stability proceeds identically to the
derivation for rule MLF until the step before the stability loop
invariant is used. These steps are omitted below with . . . and
the resulting premise has antecedent formula abbreviated aโ โกโง๐โP โ๐ฅ (โฅ๐ฅ โฅ = Y โ ๐๐ โฅ๐ ).
aโ, ๐ฟ โค Y, โฅ๐ฅ โฅ < ๐ฟ,โง
๐โP ๐๐ <๐ โข [๐ผguard ] โฅ๐ฅ โฅ < Y
. . .
โข UStab(๐ผguard)
The derivation continues using the loopT rule with stability loop
invariant Inv๐ โก โฅ๐ฅ โฅ < Y โงโจ๐โP
(๐ข = ๐ โง๐๐ < ๐
). This yields
four premises labeled 1โโ 4โ, shown and proved further below.
1โ 2โ 3โ 4โloopT
aโ, ๐ฟ โค Y, โฅ๐ฅ โฅ < ๐ฟ,โง
๐โP ๐๐ <๐ โข [๐ผguard ] โฅ๐ฅ โฅ < Y
Premise 1โ shows that the system state satisfies the invariant
Inv๐ after running the initialization program ๐ผ๐ โก โ๐โP ๐ข := ๐ .
This is proved by R after unfolding ๐ผ๐ using [โช], [:=].โ
R ๐ฟ โค Y, โฅ๐ฅ โฅ < ๐ฟ,โง
๐โP ๐๐ <๐,๐ข = ๐ โข Inv๐ [โช], [:=] ๐ฟ โค Y, โฅ๐ฅ โฅ < ๐ฟ,
โง๐โP ๐๐ <๐ โข [๐ผ๐ ]Inv๐
Premise 4โ proves trivially since the postcondition โฅ๐ฅ โฅ < Y is
part of the loop invariant.
โRInv๐ โข โฅ๐ฅ โฅ < Y
The derivation from premise 2โ yields correct-by-constructionarithmetical conditions on the Lyapunov functions from unfolding
the guarded switching controller in ๐ผguard, recall
๐ผ๐ข โกโ๐โP
(?๐ข = ๐;
โ๐โP
(?๐บ๐,๐ ;๐ข :=๐
) )
Axiom [โช] unfolds the outer choice
โ๐โP
(ยท), yielding one
premise for each mode ๐ โ P. Then, axioms [;], [?] add the cur-
rent mode ๐ข = ๐ (before switching) to the assumptions. The cut
step propositionally unfolds antecedent loop invariant assumption
Inv๐ to the corresponding disjunct for ๐ข = ๐ . The inner choiceโ๐โP
(ยท)is unfolded next with axioms [โช], [;], [?], yielding one
premise for each possible transition to mode ๐ โ P guarded by
formula ๐บ๐,๐ . The assignment ๐ข := ๐ is unfolded with [:=], so the
succedent simplifies to the disjunct for ๐ข = ๐ in Inv๐ . An arithmetic
simplification step yields the bottom premise of rule MLF๐บ .
โR ๐บ๐,๐ โข ๐๐ โค ๐๐R ๐๐ <๐,๐บ๐,๐ โข ๐๐ <๐[:=] โฅ๐ฅ โฅ < Y,๐๐ <๐,๐บ๐,๐ โข [๐ข :=๐ ]Inv๐
[โช], [;], [?] โฅ๐ฅ โฅ < Y,๐๐ <๐ โข [โ๐โP(?๐บ๐,๐ ;๐ข :=๐
)]Inv๐
cut Inv๐ ,๐ข = ๐ โข [โ๐โP(?๐บ๐,๐ ;๐ข :=๐
)]Inv๐
[;], [?] Inv๐ โข [?๐ข = ๐ ;โ
๐โP(?๐บ๐,๐ ;๐ข :=๐
)]Inv๐
[โช] Inv๐ โข [๐ผ๐ข ]Inv๐
The derivation from premise 3โ unfolds the plant model ๐ผ๐ โกโ๐โP
(?๐ข = ๐;๐ฅ โฒ = ๐๐ (๐ฅ,๐ฆ) &๐๐
). The choice
โ๐โP
(ยท)is unfolded
first with axiom [โช], yielding one premise for each mode ๐ โ P.
Then, axioms [;], [?] adds the mode selected by ๐ผ๐ข to the an-
tecedent, where the antecedent loop invariant assumption Inv๐ issimplified by cut to the disjunct for ๐ข = ๐ . Similarly M[ยท] strength-ens the postcondition to the disjunct for๐ข = ๐ . The rest of the proof
proceeds identically to the corresponding derivation for rule CLF
so it is omitted here.
โaโ, โฅ๐ฅ โฅ<Y,๐๐<๐ โข [๐ฅโฒ = ๐๐ (๐ฅ) &๐๐ ] ( โฅ๐ฅ โฅ<Y โง๐๐<๐ )
M[ยท]aโ, โฅ๐ฅ โฅ<Y,๐๐<๐,๐ข = ๐ โข [๐ฅโฒ = ๐๐ (๐ฅ) &๐๐ ]Inv๐
cutaโ, Inv๐ ,๐ข = ๐ โข [๐ฅโฒ = ๐๐ (๐ฅ) &๐๐ ]Inv๐
[;], [?]aโ, Inv๐ โข [?๐ข = ๐ ;๐ฅโฒ = ๐๐ (๐ฅ, ๐ฆ) &๐๐ ]Inv๐
[โช]aโ, Inv๐ โข [๐ผ๐ ]Inv๐
Pre-attractivity. The derivation for pre-attractivity is also identi-
cal to MLF until the step before the pre-attractivity loop invariant
is used. These steps are omitted below with . . . and the resulting
premise has antecedent formulas abbreviated with:
bโ โกโง๐โP
โ๐ฅ (๐๐ โค๐ โง โฅ๐ฅ โฅ โฅ Y โ ๐๐ โฅ ๐ )
cโ โกโง๐โP
โ๐ฅ(๐๐ โง๐ โค ๐๐ โค๐ โ L
๐๐(๐๐ ) โค ๐
)โง
๐โP ๐๐<๐, bโ, ๐<0, cโ,๐ + ๐๐ โค ๐ , ๐ก = 0 โข [๐ผguard, ๐กโฒ = 1] . . .
. . .
โข UGpAttr(๐ผguard)
The derivation continues using the loopT rulewith pre-attractivity
loop invariant Inv๐ โก โจ๐โP
(๐ข=๐โง๐๐<๐โง(๐๐โฅ๐ โ ๐๐<๐ +๐๐ก)
).
This yields four premises labeled 1โโ 4โ which are shown and
proved further below.
1โ 2โ 3โ 4โloopT
โง๐โP ๐๐<๐, bโ, ๐<0, cโ,๐ +๐๐ โค๐ , ๐ก=0 โข [๐ผguard, ๐ก
โฒ = 1] . . .
Premise 1โ proves the invariant Inv๐ after unfolding the initial-
ization program ๐ผ๐ using [โช], [:=].
Verifying Switched System Stability With Logic
โR โง
๐โP ๐๐<๐, ๐ก=0,๐ข = ๐ โข Inv๐[โช], [:=] โง
๐โP ๐๐<๐, ๐ก=0 โข [๐ผ๐ ]Inv๐
Premise 4โ is proved by R after unfolding the disjuncts of the
loop invariant with โจL (the arithmetical argument is identical to
earlier proofs). The selected disjunct (indexed by ๐) is abbreviated
๐ โก ๐ข=๐ โง๐๐<๐ โง (๐๐โฅ๐ โ ๐๐<๐ +๐๐ก).
โR
bโ, ๐<0,๐ + ๐๐ โค ๐ ,๐ โข ๐ก โฅ ๐ โ โฅ๐ฅ โฅ < YโจL
bโ, ๐<0,๐ + ๐๐ โค ๐ , Inv๐ โข ๐ก โฅ ๐ โ โฅ๐ฅ โฅ < Y
The derivation from premise 2โ unfolds ๐ผ๐ข using dLโs hybridprogram axioms similar to the stability proof, and an arithmetic
simplification step yields the premises of MLF๐บ for guarded mode
switches from ๐ to ๐, ๐, ๐ โ P.
โR ๐บ๐,๐ โข ๐๐ โค ๐๐R ๐ ,๐บ๐,๐ โข ๐๐<๐ โง (๐๐โฅ๐ โ ๐๐<๐ +๐๐ก )[:=] ๐ ,๐บ๐,๐ โข [๐ข :=๐ ]Inv๐
[โช], [;], [?] ๐ โข [โ๐โP(?๐บ๐,๐ ;๐ข :=๐
)]Inv๐
cut Inv๐,๐ข = ๐ โข [โ๐โP(?๐บ๐,๐ ;๐ข :=๐
)]Inv๐
[;], [?] Inv๐ โข [?๐ข = ๐ ;โ
๐โP(?๐บ๐,๐ ;๐ข :=๐
)]Inv๐
[โช] Inv๐ โข [๐ผ๐ข ]Inv๐
The derivation from premise 3โ unfolds the plant model and then
proceeds identically to the corresponding derivation for rule CLF.
โcโ, ๐ โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐ก โฒ = 1&๐๐ ]๐
M[ยท]cโ, ๐ โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐ก โฒ = 1&๐๐ ]Inv๐
cutcโ, Inv๐,๐ข = ๐ โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐ก โฒ = 1&๐๐ ]Inv๐
[;], [?]cโ, Inv๐ โข [?๐ข = ๐ ;๐ฅโฒ=๐๐ (๐ฅ, ๐ฆ), ๐ก โฒ = 1&๐๐ ]Inv๐
[โช]cโ, Inv๐ โข [๐ผ๐ , ๐ก โฒ = 1]Inv๐ โก
Proof of Corollary 6. The derivation of rule MLF๐ departs
more significantly from the derivations of rules CLF, MLF, MLF๐บ .
For this proof, Rexp is used to indicate arithmetic steps that use
properties of the real exponential function. Tools are available for
answering such questions [14] although they are not known to
be decidable; additional explanation is given below for steps that
only require elementary properties of the exponential function. The
proof also shows how to derive arithmetic conditions (arising from
the time-dependent switching controller) in a correct by construc-
tion manner. Recall from that the modes ๐ โ P are partitioned
into two subsets consisting of the stable S = {๐ โ P, _๐ > 0} andunstable U = {๐ โ P, _๐ โค 0} modes. The derivation starts with
an โงR step for the stability and pre-attractivity conjuncts which
are proved separately below.
โข UStab(๐ผtime) โข UGpAttr(๐ผtime)โงR โข UGpAS(๐ผtime)
Stability. The stability derivation begins with cut and Skolem-
ization steps. The first cut is โ๐ >0 aโ with the abbreviation aโ โกโง๐โP โ๐ฅ (โฅ๐ฅ โฅ = Y โ ๐๐ โฅ๐ ), where the upper bound๐ >0 is
chosen to be the maximum of the respective bounds for each ๐๐on the compact set characterized by โฅ๐ฅ โฅ = Y. After Skolemizing
๐ , the second arithmetic cut is the formula โ๐ฟ (0 < ๐ฟ โค Y โง bโ),
where the conjuncts for ๐ โ U use ๐_๐ฮ๐ > 0.
bโ โกโง๐โS
โ๐ฅ (โฅ๐ฅ โฅ < ๐ฟ โ ๐๐ <๐ )
โงโง๐โU
โ๐ฅ (โฅ๐ฅ โฅ < ๐ฟ โ ๐๐ <๐๐_๐ฮ๐ )
Such a ๐ฟ exists by continuity for each ๐๐ , ๐ โ P, ๐๐ (0) = 0 from
the premise of rule MLF๐ . After both cuts, the antecedent ๐ฟ is used
to witness the succedent by โR.aโ, ๐ฟ โค Y, bโ โข โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ [๐ผtime ] โฅ๐ฅ โฅ < Y
)โR
aโ, 0 < ๐ฟ โค Y, bโ โข โ๐ฟ>0 โ๐ฅ(โฅ๐ฅ โฅ < ๐ฟ โ [๐ผtime ] โฅ๐ฅ โฅ < Y
)cut, Rexp , โL Y>0,๐ >0, aโ โข โ๐ฟ>0 โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ [๐ผtime ] โฅ๐ฅ โฅ < Y
)cut, R, โL Y>0 โข โ๐ฟ>0 โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ [๐ผtime ] โฅ๐ฅ โฅ < Y
)โR, โR โข UStab(๐ผtime)
The derivation continues after both cuts similarly to MLF by
unfolding and proving the LHS of the implications in antecedent
bโ. The resulting assumption on the initial state is abbreviated
๐ต โก โง๐โS ๐๐<๐ โง โง
๐โU ๐๐<๐๐_๐ฮ๐. Then, the loopT rule is
used with the following stability loop invariant Inv๐ , which yields
premises 1โโ 4โ shown and proved further below:
Inv๐ โก ๐ โฅ 0 โง โฅ๐ฅ โฅ < Y โง
ยฉยญยญยญยญยซโจ๐โS
(๐ข = ๐ โง๐๐ <๐๐โ_๐๐
)โจโจ
๐โU
(๐ข = ๐ โง๐๐ <๐๐โ_๐ (๐โฮ๐ ) โง ๐ โค ฮ๐
)ยชยฎยฎยฎยฎยฌ1โ 2โ 3โ 4โ
loopTaโ, ๐ฟโคY, โฅ๐ฅ โฅ<๐ฟ, ๐ต โข [๐ผtime ] โฅ๐ฅ โฅ<Y
โL,โLaโ, ๐ฟโคY, bโ, โฅ๐ฅ โฅ<๐ฟ โข [๐ผtime ] โฅ๐ฅ โฅ<Y
โR, โRaโ, ๐ฟโคY, bโ โข โ๐ฅ
(โฅ๐ฅ โฅ<๐ฟ โ [๐ผtime ] โฅ๐ฅ โฅ<Y
)Premise 1โ shows that the system state satisfies the invariant
Inv๐ after initialization with program ๐ผ๐ โก ๐ := 0;
โ๐โP ๐ข := ๐ . This
is proved from ๐ต after unfolding ๐ผ๐ using [โช], [:=] and substituting๐ = 0 in the loop invariant (using ๐0 = 1).
โRexp ๐ฟ โค Y, โฅ๐ฅ โฅ < ๐ฟ, ๐ต, ๐ = 0,๐ข = ๐ โข Inv๐
[โช], [:=] ๐ฟ โค Y, โฅ๐ฅ โฅ < ๐ฟ, ๐ต โข [๐ผ๐ ]Inv๐
Premise 4โ proves trivially since the postcondition โฅ๐ฅ โฅ < Y is
part of the loop invariant.
โRInv๐ โข โฅ๐ฅ โฅ < Y
The derivation from premise 2โ unfolds the switching controller
๐ผ๐ข in ๐ผtime with dLโs hybrid program axioms, recall:
๐ผ๐ข โกโ๐โP
(?๐ข = ๐;
โ๐โP
(?\๐,๐ โค ๐ ;๐ := 0;๐ข :=๐
) )This unfolding yields four possible shapes of premises (abbrevi-
ated as . . . and shown immediately below) for a switch from the
current mode ๐ to mode ๐. In each case, the antecedent assumption
corresponds to the disjunct of Inv๐ for mode ๐ , while the succedent
assumption corresponds to the disjunct for mode ๐ with timer ๐
reset to 0 by the switching controller. The four cases correspond to
Yong Kiam Tan, Stefan Mitsch, and Andrรฉ Platzer
whether ๐ โ S or ๐ โ U and similarly for ๐, as labeled below.
[โช]
[;], [?]
[โช], [;], [?], [:=]. . .
Inv๐ ,๐ข = ๐ โข [โ๐โP(?\๐,๐ โค ๐ ;๐ := 0;๐ข :=๐
)]Inv๐
Inv๐ โข [?๐ข = ๐ ;โ
๐โP(?\๐,๐ โค ๐ ;๐ := 0;๐ข :=๐
)]Inv๐
Inv๐ โข [๐ผ๐ข ]Inv๐
\๐,๐ โค ๐,๐๐ <๐๐โ_๐๐ โข ๐๐ <๐ (๐โS, ๐โS)
\๐,๐ โค ๐,๐๐ <๐๐โ_๐๐ โข ๐๐ <๐๐_๐ฮ๐ (๐โS, ๐โU)
\๐,๐ โค ๐,๐๐ <๐๐โ_๐ (๐โฮ๐ ) , ๐ โค ฮ๐ โข ๐๐ <๐ (๐โU, ๐โS)
\๐,๐ โค ๐,๐๐ <๐๐โ_๐ (๐โฮ๐ ) , ๐ โค ฮ๐ โข ๐๐ <๐๐_๐ฮ๐ (๐โU, ๐โU)
These premises are correct-by-construction and can be handed
to an arithmetic solver directly. They can also be simplified, e.g., for
๐โS, ๐โS, the inequalities can be rearranged to eliminate๐ and ๐ .
The first R step uses transitivity of < . โค, while the second Rexp stepuses ๐_๐\๐,๐ โค ๐_๐๐ whenever _๐ > 0 (since ๐ โ S) and \๐,๐ โค ๐ .
โข ๐๐ โค ๐๐๐_๐\๐,๐
Rexp \๐,๐ โค ๐ โข ๐๐ โค ๐๐๐_๐๐
R \๐,๐ โค ๐,๐๐ <๐๐โ_๐๐ โข ๐๐ <๐
Intuitively, the resulting (simplified) premise says that by choos-
ing sufficiently large dwell time \๐,๐ (for stable mode ๐), one can
offset an increase in value when switching from๐๐ to๐๐ . The proof
of this premise requires Rexp.
The derivation from premise 3โ unfolds the plant model ๐ผ๐ โกโ๐โP
(?๐ข = ๐;๐ฅ โฒ = ๐๐ (๐ฅ), ๐ โฒ = 1&๐ โค ฮ๐
)using dL axioms. There
are two possible shapes of the premises resulting from this unfold-
ing, depending if ๐ โ S or ๐ โ U, these are abbreviated 5โ and 6โrespectively. In either case, the derivation shows that the appropri-
ate upper bound on ๐๐ is preserved for the invariant.
5โ 6โ[;], [?]
aโ, Inv๐ ,๐ข = ๐ โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐โฒ = 1&๐ โค ฮ๐ ]Inv๐ [;], [?]
aโ, Inv๐ โข [?๐ข = ๐ ;๐ฅโฒ = ๐๐ (๐ฅ), ๐โฒ = 1&๐ โค ฮ๐ ]Inv๐ [โช]
aโ, Inv๐ โข [๐ผ๐ ]Inv๐ For premise 5โ, the proof uses dbxโฝ with cofactor โ_๐ , where
the Lie derivative of subterm๐๐โ_๐๐ is (โ_๐ )๐๐โ_๐๐ from ๐ โฒ = 1.
The resulting premise simplifies to the third premise of rule MLF๐ .
โโข L
๐๐(๐๐ ) โคโ_๐๐๐
โข L๐๐(๐๐ )โ(โ_๐ )๐๐โ_๐๐ โคโ_๐ (๐๐โ๐๐โ_๐๐ )
dbxโฝ ๐๐โ๐๐โ_๐๐ < 0 โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐โฒ = 1&๐โคฮ๐ ]๐๐โ๐๐โ_๐๐ < 0
cut, M[ยท] ๐๐ <๐๐โ_๐๐ โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐โฒ = 1&๐โคฮ๐ ]๐๐ <๐๐โ_๐๐
The proof for premise 6โ similarly uses dbxโฝ with cofactor โ_๐ ,yielding the third premise of rule MLF๐ .
โโข L
๐๐(๐๐ ) โค โ_๐๐๐
dbxโฝ๐๐<๐๐โ_๐ (๐โฮ๐ ) โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐โฒ = 1&๐ โค ฮ๐ ]๐๐<๐๐โ_๐ (๐โฮ๐ )
Pre-attractivity. The derivation for pre-attractivity begins with
logical simplification followed by a series of arithmetic cuts. First,
the multiple Lyapunov functions ๐๐ , ๐ โ P are simultaneously
bounded above on the ball characterized by โฅ๐ฅ โฅ < ๐ฟ , with the cut
โ๐ >0 aโ where
aโ โกโง๐โS
โ๐ฅ (โฅ๐ฅ โฅ < ๐ฟ โ ๐๐ <๐ )โง
โงโง๐โU
โ๐ฅ (โฅ๐ฅ โฅ < ๐ฟ โ ๐๐ <๐๐_๐ฮ๐ )
The upper bound๐ is Skolemized, then the next arithmetic cut
usesโ๐>0 bโwith bโ โก โง๐โP โ๐ฅ (๐๐ โค๐ โง โฅ๐ฅ โฅ โฅ Y โ ๐๐ โฅ ๐ ),
where๐ is Skolemized with โL.
Y>0,๐ >0, aโ,๐>0, bโ โข โ๐ โฅ0โ๐ฅ(โฅ๐ฅ โฅ < ๐ฟ โ . . .
)cut, R, โL Y>0,๐ >0, aโ โข โ๐ โฅ0โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ . . .
)cut, R, โL Y>0 โข โ๐ โฅ0โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ . . .
)โR,โR โข UGpAttr(๐ผtime)
The derivation continues by picking ๐ โฅ 0 such that ๐ โก๐ โค๐๐๐๐ โงโง
๐โU๐ โค ๐๐๐๐ ๐โ๐ฮ๐, such a ๐ exists since ๐ > 0. The
quantifiers in the succedent are unfolded and the LHS of the im-
plications in aโ are proved. The resulting antecedent (from aโ)
is abbreviated ๐ต โก โง๐โS ๐๐<๐ โงโง
๐โU ๐๐<๐๐_๐ฮ๐. The loopT
rule is used with the following pre-attractivity loop invariant Inv๐ ,which yields premises 1โโ 4โ shown and proved further below:
Inv๐ โก ๐ โฅ 0 โง ๐ก โฅ ๐ โง
ยฉยญยญยญยญยซโจ๐โS
(๐ข = ๐ โง๐๐ <๐๐โ๐ (๐กโ๐)๐โ_๐๐
)โจโจ
๐โU
(๐ข = ๐ โง๐๐ <๐๐โ๐ (๐กโ๐)๐โ_๐ (๐โฮ๐ ) โง ๐ โค ฮ๐
)ยชยฎยฎยฎยฎยฌ1โ 2โ 3โ 4โ
loopTbโ,๐ โฅ 0, ๐ , ๐ต, ๐ก = 0 โข [๐ผguard, ๐ก
โฒ = 1] . . .โL,โL
aโ, bโ,๐ โฅ 0, ๐ , โฅ๐ฅ โฅ<๐ฟ, ๐ก = 0 โข [๐ผguard, ๐กโฒ = 1] . . .
[;], [:=]aโ, bโ,๐ โฅ 0, ๐ , โฅ๐ฅ โฅ<๐ฟ โข [๐ก := 0;๐ผguard, ๐ก
โฒ = 1] . . .โR,โR
aโ, bโ,๐ โฅ 0, ๐ โข โ๐ฅ(โฅ๐ฅ โฅ < ๐ฟ โ . . .
)โR Y>0,๐ >0, aโ,๐>0, bโ โข โ๐ โฅ0โ๐ฅ
(โฅ๐ฅ โฅ < ๐ฟ โ . . .
)Premise 1โ is proved by unfolding the initialization program ๐ผ๐
This is proved from ๐ต after unfolding ๐ผ๐ using axioms [โช], [:=] andsubstituting ๐ = 0 and ๐ก = 0 in the loop invariant (using ๐0 = 1).
โRexp ๐ต, ๐ก = 0, ๐ = 0,๐ข = ๐ โข Inv๐
[โช], [:=] ๐ต, ๐ก = 0 โข [๐ผ๐ ]Inv๐
Premise 4โ is proved by unfolding the loop invariant with โจL.This yields two possible premise shapes, corresponding to ๐ โ S or
๐ โ U. In both cases, assuming the negation of the succedent proves
the corresponding implication LHS in the antecedent assumption
bโ, which gives๐ < ๐ as an assumption. The remaining arithmetic
argument underlying these premises proceeds by contradicting this
assumption (below).
โโจL, R
bโ, ๐ , Inv๐ โข ๐ก โฅ ๐ โ โฅ๐ฅ โฅ < Y
Verifying Switched System Stability With Logic
For ๐ โ S, the following sequence of inequalities is used (note
that ๐ < _๐ is implied by the later premises):
๐๐ <๐๐โ๐ (๐กโ๐)๐โ_๐๐ (from invariant)
=๐๐โ๐๐ก๐โ๐ (_๐โ๐)
โค๐๐โ๐๐ ๐โ๐ (_๐โ๐) (from ๐ก โฅ ๐, ๐ > 0)
โค ๐๐โ๐ (_๐โ๐) (from ๐ )
โค ๐ (from ๐ < _๐ , ๐ โฅ 0, contradiction)
For ๐ โ U, the following sequence of inequalities is used (note
that ๐ โค ฮ๐ is in the invariant Inv๐ for ๐ โ U):
๐๐ <๐๐โ๐ (๐กโ๐)๐โ_๐ (๐โฮ๐ )(from invariant)
โค๐๐โ๐ (๐กโ๐) (from ๐ โค ฮ๐ , _๐ โค 0)
=๐๐โ๐๐ก๐๐๐
โค๐๐โ๐๐ก๐๐ฮ๐(from ๐ > 0, ๐ โค ฮ๐ )
โค๐๐โ๐๐ ๐๐ฮ๐(from ๐ก โฅ ๐, ๐ > 0)
โค ๐ (from ๐ , contradiction)
The derivation from premise 2โ unfolds the switching controller
๐ผ๐ข in ๐ผtime with dLโs hybrid program axioms. Similar to the deriva-
tion for the stability conjunct, this unfolding yields four possible
shapes of premises (abbreviated as . . . and shown immediately
below) for maintaining the invariant Inv๐ after a switch from the
current mode ๐ to the next mode ๐.
[โช]
[;], [?]
[โช], [;], [?], [:=]. . .
Inv๐,๐ข = ๐ โข [โ๐โP(?\๐,๐ โค ๐ ;๐ := 0;๐ข :=๐
)]Inv๐
Inv๐ โข [?๐ข = ๐ ;โ
๐โP(?\๐,๐ โค ๐ ;๐ := 0;๐ข :=๐
)]Inv๐
Inv๐ โข [๐ผ๐ข ]Inv๐
๐ก โฅ๐, \๐,๐โค๐,๐๐<๐๐โ๐ (๐กโ๐ )๐โ_๐๐ โข๐๐<๐๐โ๐๐ก
(๐โS, ๐โS)
๐ก โฅ๐, \๐,๐โค๐,๐๐<๐๐โ๐ (๐กโ๐ )๐โ_๐๐ โข๐๐<๐๐โ๐๐ก๐_๐ฮ๐
(๐โS, ๐โU)
๐ก โฅ๐, \๐,๐โค๐,๐๐<๐๐โ๐ (๐กโ๐ )๐โ_๐ (๐โฮ๐ ) , ๐โคฮ๐โข๐๐<๐๐โ๐๐ก
(๐โU, ๐โS)
๐ก โฅ๐, \๐,๐โค๐,๐๐<๐๐โ๐ (๐กโ๐ )๐โ_๐ (๐โฮ๐ ) , ๐โคฮ๐โข๐๐<๐๐โ๐๐ก๐_๐ฮ๐
(๐โU, ๐โU)
The derivation from premise 3โ unfolds the plant model ๐ผ๐ . This
results in two possible shapes of premises, depending if ๐ โ S or
๐ โ U, which are abbreviated 5โ and 6โ respectively. In either
case, the key step shows that the appropriate upper bound on ๐๐ is
preserved.
5โ 6โ[;], [?]Inv๐,๐ข = ๐ โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐โฒ = 1, ๐ก โฒ = 1&๐ โค ฮ๐ ]Inv๐[;], [?] Inv๐ โข [?๐ข = ๐ ;๐ฅโฒ = ๐๐ (๐ฅ), ๐โฒ = 1, ๐ก โฒ = 1&๐ โค ฮ๐ ]Inv๐[โช] Inv๐ โข [๐ผ๐ ]Inv๐For premise 5โ, the proof uses dbxโฝ with cofactor โ_๐ , with
abbreviation ๐๐ =๐๐โ๐ (๐กโ๐)๐โ_๐๐ , noting that the Lie derivativeof ๐๐ is โ_๐๐๐ . This yields the third premise of rule MLF๐ .
โโข L
๐๐(๐๐ ) โค โ_๐๐๐
dbxโฝ๐๐<๐๐ โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐โฒ = 1, ๐ก โฒ = 1&๐ โค ฮ๐ ]๐๐<๐๐ The proof for premise 6โ is similar using dbxโฝ with cofactor
โ_๐ , with abbreviation ๐๐ข = ๐๐โ๐ (๐กโ๐)๐โ_๐ (๐โฮ๐ ), noting that
the Lie derivative of ๐๐ is โ_๐๐๐ . This yields the third premise of
rule MLF๐ .
โโข L
๐๐(๐๐ ) โค โ_๐๐๐
dbxโฝ๐๐<๐๐ข โข [๐ฅโฒ = ๐๐ (๐ฅ), ๐โฒ = 1, ๐ก โฒ = 1&๐ โค ฮ๐ ]๐๐<๐๐ข โก
B COUNTEREXAMPLEThe cruise controller automaton from Section 5.2 is taken from
the suite of examples for the Stabhyli tool [26, 27]. Using the de-
fault instructions on a Linux machine, Stabhyli generates a success
message with the following output (newlines added for readability):
...SOSSolution( Problem is solved. (accepted); ......### Lyapunov template for mode normal_PI: \
+V_23*relV^2+V_22*intV^2+V_21*intV*relV \+V_20*relV+V_19*intV
### Lyapunov function for mode normal_PI: \+572572089848357/144115188075855872*intV*relV \+256336575597239/281474976710656*relV^2 \+6008302119812893/4611686018427387904*intV^2 \+5787253314511645/618970019642690137449562112*relV \+5661677770976729/39614081257132168796771975168*intV
...The hybrid system is stable
The generated Lyapunov function candidate ๐ does not exactly
satisfy all of the required arithmetical conditions for the normal PI
mode [26]. For example, one requirement is that it should be non-
negative in the mode invariant โ15โค๐๐๐๐โค15 โง โ500โค๐๐๐ก๐โค500.It can be checked that ๐๐๐ก๐ = โ 1
17179869184, ๐๐๐๐ = 0 is a counterex-
ample, with ๐ = โ3.90488 ร 10โ24
.
A heuristic approach to resolve this numerical issue is to truncate
terms in the candidate๐ with extremely small coefficients and then
check the resulting truncated candidate. This heuristic is applied
for the case study in Section 5.2, where the KeYmaera X proof
succeeded using the truncated candidate together with the rest of
the Lyapunov function candidates generated by Stabhyli (for other
automaton modes).