Preprint
Article

This version is not peer-reviewed.

Observational Refinement of Hybrid Systems: A Sound and Compositional Proof Rule with Automated Verification Conditions

Submitted:

26 November 2026

Posted:

30 November 2026

You are already at the latest version

Abstract
Stepwise refinement is a key technique for developing safety-critical hybrid systems, but each step must be verified with little effort. This paper presents a refinement verification method for hybrid systems based on Milner’s notion of observability. Systems are specified as hybrid modules whose behaviours are sequences of phases; local variables are unobservable, and refinement is inclusion of observable trajectories. We give a proof rule based on refinement mappings that relates concrete and abstract states, the derivatives of their variables, and their discrete transitions, and that matches internal concrete transitions with abstract stuttering steps. We prove that the rule is sound, preserves the time structure and hence divergence, and is compositional with respect to parallel composition. We extend it with inductive invariants and history variables, characterise it as a special case of timed forward simulations, and show that it is incomplete without prophecy variables. All premises are pointwise quantifier-free formulas; for linear hybrid modules they belong to linear real arithmetic and are decided automatically. A prototype verifies four case studies, including the water-level monitor benchmark and a tank with nonlinear outflow, detects seven seeded faults with concrete counterexamples, and shows that compositional checking avoids the exponential growth of monolithic checking.
Keywords: 
;  ;  ;  ;  ;  ;  ;  ;  

MSC:  68Q60; 03B70; 93C30; 68Q85

1. Introduction

Hybrid systems are digital real-time systems embedded in analog environments [1,2]. Many of them, such as automotive, avionic and building-automation controllers, operate in safety-critical situations, so their correctness has to be guaranteed by formal specification and verification. The basic behaviour of a hybrid system is a sequence of phases  [3,4]: within a phase the state evolves continuously according to a control law, typically given by differential equations or inclusions, until a discrete transition separates it from the next phase.
Representative specification languages and computational models for hybrid systems include phase transition systems [3,4], hybrid automata [5,6,7] and hybrid I/O automata [8,9]. Phase transition systems come with deductive rules for safety and liveness properties; hybrid automata extend timed automata so that temporal properties can be checked algorithmically; hybrid I/O automata come with simulation-based proof methods.
Industrial systems are, however, rarely designed in one step. They are developed by stepwise refinement : an abstract specification that states what the system must do is successively replaced by more concrete specifications that state how it is done, for instance by splitting a control mode into several sub-modes, by replacing an abstract timer by a concrete counter, or by tightening the admissible range of a continuous dynamics. Each step must be checked, so that every observable behaviour of the concrete specification is also a behaviour of the abstract one. For this check to be routine, a refinement method must handle three issues that are specific to hybrid systems.
  • Hidden state. Abstract and concrete specifications usually use different local variables (modes, timers, counters). Refinement must therefore be defined in terms of what can be observed, in the sense of Milner’s observational view of concurrent processes [10].
  • Stuttering and continuous evolution. A concrete internal step, for example switching between two sub-modes, may correspond to no abstract step at all, and concrete continuous evolution has to be matched by abstract continuous evolution, which involves derivatives of the mapped variables.
  • Composition and automation. Hybrid systems consist of many parallel components, so refining one component must not require re-verifying the others, and the remaining proof obligations should be decidable by off-the-shelf tools.
Contributions. We develop a refinement verification method for hybrid systems that addresses these issues.
  • We introduce hybrid modules , a specification language in the style of phase transition systems that distinguishes observable and local variables and labels transitions with synchronisation actions (Section 3). Refinement is defined as inclusion of the sets of observable trajectories , a notion that is invariant under stuttering (Section 4).
  • We give a proof rule based on refinement mappings  [11] from concrete to abstract states. Continuous behaviour is handled by a flow derivative of the mapping, stuttering by matching internal concrete transitions with an abstract idle step, and unreachable states are excluded by a phase-invariant context . We prove that the rule is sound and that the abstract computation it constructs has exactly the same phase boundaries as the concrete one, so divergence of time is preserved (Theorem 1).
  • We extend the rule with inductive invariants, whose flow condition is a pointwise differential-invariant check, and with history variables (Theorem 2). We characterise Ref as the functional, phase-preserving special case of timed forward simulations in the style of hybrid I/O automata (Propositions 4 and 5), and we show that it remains incomplete without prophecy variables (Proposition 2).
  • We prove that the rule is compositional with respect to parallel composition with synchronisation (Theorem 3 and Corollary 1).
  • All premises of the rule are pointwise, quantifier-free first-order formulas over states, derivatives and successor states. For linear hybrid modules they are formulas of linear real arithmetic and are therefore decidable. We implement verification-condition generation together with an exact decision procedure and SMT-LIB 2 [12] export. We evaluate it on an air-conditioning controller with a one-to-one and a many-to-one refinement and a family of composed systems, on the water-level monitor benchmark [6], and on a tank with nonlinear (Torricelli) outflow that refines a rectangular abstraction, with seven seeded faults (Section 6, Section 7 and Section 8).
The rest of the paper is organised as follows. Section 2 discusses related work. Section 3 defines hybrid modules and their parallel composition. Section 4 defines observational refinement, presents the proof rule, proves its soundness, extends it with invariants and history variables, and relates it to simulations. Section 5 proves compositionality. Section 6 applies the method to four case studies. Section 7 describes the automation and Section 8 the experimental evaluation. Section 9 discusses limitations and Section 10 concludes. Appendix A lists the complete models.

3. Hybrid Modules

This section introduces a specification language that can express what is observable in a hybrid system. A hybrid system consists of parallel processes, each described by a hybrid module. We first define states and phases, then hybrid modules and their computations, and finally parallel composition.

3.1. States, Phases and Regular Functions

Let V be a finite set of system variables . Each variable x has a type type ( x ) ⊆ R that is either R (a continuous variable) or a finite set (a discrete variable; Booleans and enumerated modes are encoded by integers). A state is a type-consistent interpretation σ : V → R , i.e., σ ( x ) ∈ type ( x ) , and Σ V denotes the set of states. For W ⊆ V , σ | W is the restriction of σ to W . We use a primed copy V ′ = { x ′ ∣ x ∈ V } for successor states and a dotted copy V ˙ = { x ˙ ∣ x ∈ V } for derivatives. An assertion is a first-order formula of real arithmetic; we write ρ ( σ ) , ρ ( σ , σ ˙ ) and ρ ( σ , σ ′ ) for the evaluation of an assertion over V , over V ∪ V ˙ and over V ∪ V ′ , where σ ˙ ∈ R V is a valuation of the derivatives.
Time is modelled by the non-negative reals R ≥ 0 . An interval is a set I = [ a , b ) = { t ∣ a ≤ t < b } with 0 ≤ a < b ≤ ∞ .
Definition 1  
(Regular functions). A function g : [ a , b ) → R is regular if it is continuous and there are finitely many points a = t 0 < t 1 < … < t k = b such that, for every j < k , g is continuously differentiable on the open interval ( t j , t j + 1 ) and its derivative has finite one-sided limits at t j and, if t j + 1 < ∞ , at t j + 1 .
A regular function g has a right derivative g ˙ + ( t ) , also written D + g ( t ) , at every t ∈ [ a , b ) (at t j it equals the right limit of g ′ , by the mean value theorem). If b < ∞ , the limit lim t ↑ b g ( t ) exists, because g ′ is bounded near b . Regular functions are piecewise smooth in the sense of [3], with the additional requirement that they are continuous: in our setting, every discontinuity of a variable is caused by a discrete transition.
Lemma 1.
(a)
If f = ( f 1 , … , f n ) is a tuple of regular functions on I and h : R n → R is continuously differentiable, then h ∘ f is regular and D + ( h ∘ f ) ( t ) = ∇ h ( f ( t ) ) · f ˙ + ( t ) for all t ∈ I .
(b)
A regular function with values in a finite set is constant.
(c)
A regular function whose right derivative is a constant k on [ a , b ) satisfies g ( t ) = g ( a ) + k ( t − a ) .
(d)
A regular function whose right derivative is non-positive on [ a , b ) is non-increasing.
Proof. (a) Take a common refinement of the partitions of the f i . On each open piece, h ∘ f is continuously differentiable with derivative ∇ h ( f ) · f ′ , which has one-sided limits because ∇ h is continuous and f ′ has one-sided limits. At every point, the chain rule for one-sided derivatives applies because h is differentiable and f is right-differentiable. (b) A continuous function from an interval to a finite subset of R is constant, by connectedness. (c) On every piece ( t j , t j + 1 ) , g ′ = k , so g is affine with slope k there; continuity glues the pieces together. (d) On every piece ( t j , t j + 1 ) , g ′ ≤ 0 , so g is non-increasing there by the mean value theorem; continuity at the points t j yields the claim on [ a , b ) .    □
Definition 2  
(Phases). A phase over V is a pair P = 〈 I , f 〉 of an interval I = [ a , b ) and a family f = { f x } x ∈ V of regular functions f x : I → type ( x ) . The phase assigns the state f ( t ) ∈ Σ V to every t ∈ I . We write start ( P ) = f ( a ) and, if b < ∞ , end ( P ) = lim t ↑ b f ( t ) , and f ˙ + ( t ) ∈ R V for the vector of right derivatives.
By Lemma 1(b), discrete variables are constant during a phase.

3.2. Hybrid Modules and Their Computations

Definition 3 
(Hybrid module). A hybrid module is a tuple M = ( V , L , Φ , Θ , T , Act ) , where:
  • V is a finite set of typed system variables;
  • L ⊆ V is the set of local variables, which cannot be observed from outside the module; O = V ∖ L is the set of observable variables;
  • Φ is a finite set of phase invariants . Each φ ∈ Φ is given by a flow assertion ρ φ ( V , V ˙ ) and a state invariant inv φ ( V ) such that ρ φ ( σ , σ ˙ ) → inv φ ( σ ) is valid (for instance, the projection ∃ V ˙ . ρ φ );
  • Θ is an assertion over V, the initial condition ;
  • T is a finite set of transitions ; each τ ∈ T is given by a transition assertion ρ τ ( V , V ′ ) and a label lab ( τ ) ∈ Act ∪ { ε } ;
  • Act is a finite set of synchronisation actions ; ε ∉ Act marks internal transitions.
The idle transition τ idle has ρ τ idle = ⋀ x ∈ V x ′ = x and label ε, and we write T ^ = T ∪ { τ idle } .
In all our examples, ρ φ has the form inv φ ( V ) ∧ flow φ ( V ˙ ) , where flow φ mentions only derivatives and is satisfiable, so that inv φ is exactly the projection of ρ φ . A state σ is φ-admissible if ρ φ ( σ , σ ˙ ) holds for some σ ˙ .
Definition 4  
(Computation). Let P = 〈 I , f 〉 be a phase and φ ∈ Φ . P is a φ -phase if ρ φ ( f ( t ) , f ˙ + ( t ) ) holds for all t ∈ I . A computation of M is a finite or infinite sequence of phases P i = 〈 [ a i , a i + 1 ) , f i 〉 , i = 0 , 1 , … , with a 0 = 0 , together with, for every i such that P i + 1 exists, a finite transition burst , i.e., a sequence of states end ( P i ) = σ 0 , σ 1 , … , σ m = start ( P i + 1 ) with m ≥ 1 , such that:
(C1)
Initiality: Θ ( start ( P 0 ) ) holds;
(C2)
Continuous behaviour: every P i is a φ-phase for some φ ∈ Φ ;
(C3)
Discrete behaviour: in every burst, for every 1 ≤ j ≤ m there is τ ∈ T ^ with ρ τ ( σ j − 1 , σ j ) , and every intermediate state σ j , 0 < j < m , is φ-admissible for some φ ∈ Φ ;
(C4)
Divergence: if the sequence is finite, its last phase has an unbounded interval; if it is infinite, a i → ∞ .
Comp ( M ) denotes the set of computations of M.
Transition bursts allow several components of a parallel system to switch at the same time instant while every phase has positive duration. Condition (C4) rules out Zeno behaviour: time diverges in every computation.
Example 1  
(Abstract air-conditioning controller). The module TEMP A in Figure 1 specifies an air-conditioning controller. Its observable variables are the room temperature θ ∈ R , the compressor command a c ∈ { 0 , 1 } and the door status d ∈ { 0 , 1 } (1 means open). Its local variables are the mode π ∈ { 0 , 1 } (COOLandHOT) and a clock z ∈ R . InCOOLthe compressor is off and the room warms up with rate θ ˙ ∈ [ 0 , 2 ] . If the door is closed and θ ≥ 26 , the controller may switch the compressor on (transition on ). InHOTthe room temperature changes with rate θ ˙ ∈ [ − 5 , 1 ] , and the invariant z ≤ 10 requires every cooling episode to end within 10 time units, either by off (when θ ≤ 24 ) or by the door being opened. The invariant ofCOOLbounds the temperature by 26 while the door is closed and by 35 while it is open; since the environment may also keep the temperature constant ( θ ˙ = 0 ), these bounds never force time to stop. The transitions open , close 1 and close 2 synchronise with a door (Example 2); when the door is closed in a hot room ( θ ≥ 26 ), cooling starts immediately. Formally, TEMP A = ( V , L , Φ , Θ , T , Act ) with V = { θ , a c , d , π , z } , L = { π , z } , Act = { open , close } , Θ ≡ π = 0 ∧ a c = 0 ∧ d = 0 ∧ z = 0 ∧ 20 ≤ θ ≤ 26 , and, for instance,
ρ HOT ≡ π = 1 ∧ a c = 1 ∧ d = 0 ∧ z ≤ 10 ∧ z ˙ = 1 ∧ − 5 ≤ θ ˙ ≤ 1 ∧ π ˙ = a c ˙ = d ˙ = 0 , ρ on ≡ π = 0 ∧ d = 0 ∧ θ ≥ 26 ∧ π ′ = 1 ∧ a c ′ = 1 ∧ z ′ = 0 ∧ θ ′ = θ ∧ d ′ = d .
The complete module is listed in Appendix A.

3.3. Parallel Composition

As in process algebra [10,32], modules synchronise on common actions and interleave on all other transitions.
Definition 5  
(Parallel composition). Let M k = ( V k , L k , Φ k , Θ k , T k , Act k ) , k = 1 , 2 , be hybrid modules whose shared variables have the same types and whose local variables are private: L 1 ∩ V 2 = L 2 ∩ V 1 = ∅ . Their parallel composition is M 1 ‖ M 2 = ( V , L , Φ , Θ , T , Act ) with
  • V = V 1 ∪ V 2 , L = L 1 ∪ L 2 , Act = Act 1 ∪ Act 2 (hence O = O 1 ∪ O 2 and V 1 ∩ V 2 ⊆ O 1 ∩ O 2 );
  • Φ = { φ 1 ⊗ φ 2 ∣ φ k ∈ Φ k } with ρ φ 1 ⊗ φ 2 = ρ φ 1 ∧ ρ φ 2 and inv φ 1 ⊗ φ 2 = inv φ 1 ∧ inv φ 2 ;
  • Θ = Θ 1 ∧ Θ 2 ;
  • T consists of
    (a)
    τ 1 ⊗ τ 2 for τ k ∈ T k with lab ( τ 1 ) = lab ( τ 2 ) ∈ Act 1 ∩ Act 2 (synchronisation);
    (b)
    τ 1 ⊗ τ idle 2 for τ 1 ∈ T 1 with lab ( τ 1 ) ∉ Act 2 , and τ idle 1 ⊗ τ 2 for τ 2 ∈ T 2 with lab ( τ 2 ) ∉ Act 1 (interleaving),
    where ρ τ 1 ⊗ τ 2 = ρ τ 1 ∧ ρ τ 2 , τ idle k is the idle transition of M k , and the label is that of the non-idle component.
Because an interleaved transition of M 1 leaves all variables of M 2 unchanged, a shared variable can only be modified by a synchronising transition. This is the communication discipline of the door example below. Up to the names of phases and transitions, ‖ is commutative and associative, and the computations of the composition do not depend on the order in which the modules are composed.
Example 2  
(Door). The module DOOR in Figure 1 has the observable variable d (shared with the controller) and a local clock w. A door stays open for at most 30 time units. The composition TEMP A ‖ DOOR has four phase invariants. Its transitions are the internal transitions on ⊗ τ idle and off ⊗ τ idle and the synchronised transitions open ⊗ open , close 1 ⊗ close and close 2 ⊗ close .

4. Observational Refinement

4.1. Refinement as Inclusion of Observable Trajectories

Following Milner’s view that two processes should be compared on their observable behaviour [10], we compare hybrid modules on their observable variables only.
Definition 6  
(Observable trajectory). The observable trajectory of a computation Π = ( P i ) i of M is the function obs ( Π ) : R ≥ 0 → Σ O with obs ( Π ) ( t ) = f i ( t ) | O for t ∈ [ a i , a i + 1 ) . It is well defined by (C4). We write Obs ( M ) = { obs ( Π ) ∣ Π ∈ Comp ( M ) } .
Definition 7  
(Refinement). A module M C refines a module M A , written M C ⊑ M A , if they have the same observable variables with the same types and Obs ( M C ) ⊆ Obs ( M A ) .
Remark 1  
(Observability and stuttering). Local variables and the states inside a transition burst are invisible in obs ( Π ) , just as internal actions are invisible in observational equivalence. Splitting a phase into two phases connected by τ idle , or inserting internal transitions that do not change observable variables, does not change the observable trajectory, so refinement is insensitive to stuttering. On the other hand, obs ( Π ) records when observable changes occur, so refinement preserves timing exactly. Every property of observable trajectories, whether a safety or a liveness property, that holds for all elements of Obs ( M A ) also holds for M C if M C ⊑ M A .
Proposition 1.  
⊑ is reflexive and transitive.
Proof. 
Set inclusion is reflexive and transitive.    □

4.2. Refinement Mappings and the Proof Rule

Refinement is a property of infinite sets of trajectories, so it cannot be checked directly. As in [11], we reduce it to local conditions by means of a mapping from concrete to abstract states.
Definition 8  
(Refinement mapping). Let M C and M A have the same observable variables O. A refinement mapping is a function α : Σ V C → R V A with α ( σ ) ( x ) = σ ( x ) for every x ∈ O . It is admissible if there is a function D α : Σ V C × R V C → R V A , the flow derivative of α, with D α ( σ , σ ˙ ) ( x ) = σ ˙ ( x ) for x ∈ O , such that for every φ ∈ Φ C and every φ-phase 〈 [ a , b ) , f 〉 of M C :
(A1)
every component of α ∘ f is regular;
(A2)
D + ( α ∘ f ) ( t ) = D α ( f ( t ) , f ˙ + ( t ) ) for all t ∈ [ a , b ) ;
(A3)
if b < ∞ , then lim t ↑ b α ( f ( t ) ) = α ( lim t ↑ b f ( t ) ) .
For an assertion ρ over V A ∪ V ˙ A ∪ V ′ A we write ρ [ α ] for the assertion over V C ∪ V ˙ C ∪ V ′ C defined by ρ [ α ] ( σ , σ ˙ , σ ′ ) ≡ ρ ( α ( σ ) , D α ( σ , σ ˙ ) , α ( σ ′ ) ) .
The following lemma gives a syntactic sufficient condition for admissibility that covers the mappings used in practice: case distinctions on discrete variables, such as modes, combined with smooth expressions over continuous variables.
Lemma 2  
(Piecewise smooth mappings are admissible). Let D ⊆ V C be the set of discrete variables of M C , and let α be a refinement mapping. Suppose that for every abstract local variable x ∈ L A and every δ ∈ Σ D there is a continuously differentiable function g x , δ : R V C ∖ D → R such that α ( σ ) ( x ) = g x , σ | D ( σ | V C ∖ D ) . Then α is admissible with D α ( σ , σ ˙ ) ( x ) = σ ˙ ( x ) for x ∈ O and
D α ( σ , σ ˙ ) ( x ) = ∇ g x , σ | D ( σ | V C ∖ D ) · σ ˙ | V C ∖ D for x ∈ L A .
In particular, if every g x , δ is affine, then D α is linear in σ ˙ .
Proof. 
Let 〈 [ a , b ) , f 〉 be a phase. For x ∈ O , ( α ∘ f ) x = f x , so (A1)–(A3) hold trivially. For x ∈ L A : by Lemma 1(b), f | D is constant, say equal to δ , so α ( f ( t ) ) ( x ) = g x , δ ( f ( t ) | V C ∖ D ) for all t . Lemma 1(a) gives (A1) and (A2) with the stated D α . Since g x , δ is continuous and lim t ↑ b f ( t ) | D = δ , (A3) also holds.    □
Transitions take place at the boundaries of phases, so their source states lie in the closure of some phase invariant and their target states satisfy some phase invariant. The rule exploits this through the phase-invariant context of M C :
Ctx C ( σ , σ ′ ) ≡ σ ∈ cl ⋃ φ ∈ Φ C [ [ inv φ ] ] ∧ σ ′ ∈ ⋃ φ ∈ Φ C [ [ inv φ ] ] ,
where [ [ inv φ ] ] ⊆ R V C is the set of states satisfying inv φ and cl is topological closure. Any weaker assertion can be used instead. In particular, if inv φ is a negation-free combination of atoms e < 0 , e ≤ 0 and e = 0 with continuous e , then replacing every strict inequality by a non-strict one yields an assertion whose solution set contains the closure. This is what our implementation does.
Definition 9 (Proof ruleRef)Let M C and M A have the same observable variables (with the same types) and the same action sets, let α be an admissible refinement mapping, and let h : Φ C → Φ A be a function (the phase correspondence ). The rule Ref has the following premises, which must hold for all σ , σ ′ ∈ Σ V C and σ ˙ ∈ R V C :
(R0)
Typing: α ( σ ) ∈ Σ V A .
(R1)
Initiality: Θ C ( σ ) → Θ A [ α ] ( σ ) .
(R2)
Phases: for every φ ∈ Φ C : ρ φ ( σ , σ ˙ ) → ρ h ( φ ) [ α ] ( σ , σ ˙ ) .
(R3)
Transitions: for every τ ∈ T C with ℓ = lab ( τ ) :
Ctx C ( σ , σ ′ ) ∧ ρ τ ( σ , σ ′ ) → ⋁ υ ∈ T A , lab ( υ ) = ℓ ρ υ [ α ] ( σ , σ ′ ) ∨ ℓ = ε ∧ α ( σ ) = α ( σ ′ ) .
Its conclusion is M C ⊑ M A .
Premise (R2) states that the concrete phase invariant, including its derivative constraints, implies the corresponding abstract phase invariant, where abstract variables are replaced by their images under α and abstract derivatives by their images under D α . Premise (R3) is label-respecting : a synchronising concrete transition must be matched by an abstract transition with the same action, whereas an internal concrete transition may also be matched by abstract stuttering, i.e., by an abstract idle step. All premises are pointwise first-order formulas without quantification over time or trajectories.
Theorem 1  
(Soundness and preservation of the time structure). Assume the premises of Ref . For every computation Π = ( 〈 I i , f i 〉 ) i of M C with bursts ( σ j i ) j , the sequence α ( Π ) = ( 〈 I i , α ∘ f i 〉 ) i with bursts ( α ( σ j i ) ) j is a computation of M A , and obs ( α ( Π ) ) = obs ( Π ) . Consequently M C ⊑ M A . Moreover, α ( Π ) has exactly the same phase intervals as Π; in particular, it is divergent and has the same number of phases and the same burst lengths.
Proof. 
Write g i = α ∘ f i and I i = [ a i , a i + 1 ) .
Phases are well formed. By (A1), every component of g i is regular. By (R0), g i ( t ) is a type-consistent abstract state for every t . So 〈 I i , g i 〉 is a phase over V A .
(C1). The first abstract phase starts in α ( start ( P 0 ) ) . Since Θ C ( start ( P 0 ) ) holds, (R1) gives Θ A ( α ( start ( P 0 ) ) ) .
(C2). Let P i be a φ -phase. For every t ∈ I i , ρ φ ( f i ( t ) , f ˙ i + ( t ) ) holds, so by (R2), ρ h ( φ ) ( α ( f i ( t ) ) , D α ( f i ( t ) , f ˙ i + ( t ) ) ) holds. By (A2) this is ρ h ( φ ) ( g i ( t ) , g ˙ i + ( t ) ) , so 〈 I i , g i 〉 is an h ( φ ) -phase.
(C3). Consider the burst σ 0 , … , σ m between P i and P i + 1 ; then a i + 1 < ∞ . By (A3), end ( 〈 I i , g i 〉 ) = lim t ↑ a i + 1 α ( f i ( t ) ) = α ( end ( P i ) ) = α ( σ 0 ) , and start ( 〈 I i + 1 , g i + 1 〉 ) = α ( σ m ) . Fix 1 ≤ j ≤ m and a concrete transition τ ∈ T ^ C with ρ τ ( σ j − 1 , σ j ) . If τ = τ idle , then σ j − 1 = σ j and hence α ( σ j − 1 ) = α ( σ j ) , which is an abstract idle step. Otherwise τ ∈ T C , and we show that Ctx C ( σ j − 1 , σ j ) holds. If j = 1 , then σ 0 = lim t ↑ a i + 1 f i ( t ) is a limit of states satisfying inv φ (because ρ φ → inv φ ), so it lies in the closure. If j > 1 , then σ j − 1 is φ -admissible for some φ by (C3) and hence satisfies inv φ . If j < m , the same argument applies to σ j ; if j = m , then σ m = start ( P i + 1 ) satisfies the invariant of the phase P i + 1 . Hence (R3) applies and yields either an abstract transition υ with ρ υ ( α ( σ j − 1 ) , α ( σ j ) ) or α ( σ j − 1 ) = α ( σ j ) , i.e., an abstract idle step. It remains to show that every intermediate abstract state α ( σ j ) , 0 < j < m , is admissible for some abstract phase invariant. By (C3), there are φ ∈ Φ C and σ ˙ with ρ φ ( σ j , σ ˙ ) . By (R2), ρ h ( φ ) ( α ( σ j ) , D α ( σ j , σ ˙ ) ) holds, so α ( σ j ) is h ( φ ) -admissible.
(C4). The phase intervals of α ( Π ) are those of Π .
Observations. Since α ( σ ) | O = σ | O , we have g i ( t ) | O = f i ( t ) | O for all t , so obs ( α ( Π ) ) = obs ( Π ) . Hence every element of Obs ( M C ) belongs to Obs ( M A ) .    □
Remark 2  
(Stuttering). In (R3) , internal concrete transitions may be matched by abstract stuttering. This is necessary whenever the concrete module introduces internal steps that are invisible at the abstract level; in Section 6, splitting the abstract modeHOTintoHOTandVHOTintroduces such a step. Stuttering requires the abstract image of the state, including abstract local variables, to be unchanged, so the mapping must be chosen so that it is continuous across the internal step. Synchronising transitions are never matched by stuttering. Otherwise the environment could synchronise with a concrete transition that has no abstract counterpart, and compositionality (Section 5) would fail.
Remark 3  
(Divergence, Zeno behaviour and vacuity). By Theorem 1, the abstract computation that witnesses a concrete computation has the same time structure, so refinement neither creates nor hides Zeno behaviour. Refinement is nevertheless an inclusion of behaviours: a concrete module that is time-blocking , i.e., that has a finite computation prefix that cannot be extended to a divergent computation, or that has no computation at all, may refine an abstract module only because it has too few behaviours. Refinement should therefore be complemented by a non-blocking (receptiveness) argument for the concrete module [9,19]. For our case study this is Proposition 6.
Remark 4  
(Role of the phase-invariant context). Without Ctx C , premise (R3) would also have to hold for pairs of states that can never occur at a phase boundary. In the many-to-one refinement of Section 6, the transition escalate fromHOTtoVHOTdoes not mention the compressor command in its guard. Without the context, our tool reports a spurious counterexample in which the source state has π = 1 and a c = 0 , a state that violates the invariant ofHOT. The context excludes such states without requiring the user to strengthen guards or to supply auxiliary invariants.
Proposition 2  
(Incompleteness). There are modules M C ⊑ M A for which no admissible refinement mapping and no phase correspondence satisfy (R0) – (R3).
Proof. 
Let M A have variables x , b ∈ { 0 , 1 } and y ∈ R with L A = { b , y } , initial condition x = 0 ∧ y = 0 (so b is chosen nondeterministically), a single phase invariant ψ with ρ ψ ≡ y ˙ = 1 ∧ ( b = 1 ∧ x = 0 ) → y ≤ 1 , and a single internal transition with ρ ≡ b = 1 ∧ x = 0 ∧ y = 1 ∧ x ′ = 1 ∧ b ′ = b ∧ y ′ = y . Let M C have variables x ∈ { 0 , 1 } and y ∈ R with L C = { y } , initial condition x = 0 ∧ y = 0 , a single phase invariant φ with ρ φ ≡ y ˙ = 1 , and a single internal transition with ρ ≡ x = 0 ∧ y = 1 ∧ x ′ = 1 ∧ y ′ = y . In both modules y equals the current time as long as no transition occurs, and the transition can only fire at time 1. Both modules have exactly two observable trajectories: x ≡ 0 , and x = 0 on [ 0 , 1 ) with x = 1 afterwards. M A decides at time 0 which of them it produces (via b ), whereas M C decides at time 1. Hence M C ⊑ M A .
Assume an admissible α and premises (R0)–(R3); necessarily h ( φ ) = ψ . Consider the φ -phase f ( t ) = ( x = 0 , y = t ) on [ 0 , ∞ ) and g = α ∘ f . By (R2) and (A2), g is a ψ -phase, so its b -component is constant, say β (Lemma 1(b)), and its y -component has right derivative 1. By (R1) applied to f ( 0 ) , the y -component of g ( 0 ) is 0, so by Lemma 1(c), g ( t ) = ( x = 0 , b = β , y = t ) . The concrete transition from σ = f ( 1 ) = ( 0 , 1 ) to σ ′ = ( 1 , 1 ) satisfies Ctx C (the invariant of φ is true ). By (R3), either the abstract transition holds for ( α ( σ ) , α ( σ ′ ) ) , which requires β = 1 , or α ( σ ) = α ( σ ′ ) , which is impossible because α preserves x . Hence β = 1 . But then g ( 2 ) = ( x = 0 , b = 1 , y = 2 ) violates ρ ψ , although ρ φ ( f ( 2 ) , f ˙ + ( 2 ) ) holds, which contradicts (R2).    □
As shown by Abadi and Lamport [11], completeness can be recovered by adding auxiliary variables. In the example above, a prophecy variable that predicts at time 0 whether the transition will fire suffices. The next subsection integrates the other kind of auxiliary variable, history variables, together with inductive invariants; prophecy variables are left for future work (Section 9).

4.3. Inductive Invariants and History Variables

The premises of Ref must hold for all states, including states that never occur in a computation. The phase-invariant context excludes some of them, but relational facts such as “the level has risen by exactly x since the clock was reset” are not expressed by any single phase invariant. Conversely, an abstract local variable may record information about the past that is not determined by the current concrete state. Both problems are classical in refinement proofs [11,17]. We solve them by inductive invariants and history variables.
Definition 10  
(Inductive invariant). An assertion I ≡ ⋀ k ( γ k → e k ⋈ k 0 ) over V C , where each γ k is a conjunction of constraints on discrete variables, each e k is a continuously differentiable function of the continuous variables and ⋈ k ∈ { ≤ , = } , is an inductive invariant of M C if, for all σ , σ ′ ∈ Σ V C and σ ˙ ∈ R V C :
(I1)
Θ C ( σ ) → I ( σ ) ;
(I2)
for every τ ∈ T C : Ctx C ( σ , σ ′ ) ∧ I ( σ ) ∧ ρ τ ( σ , σ ′ ) → I ( σ ′ ) ;
(I3)
for every φ ∈ Φ C and every k: ρ φ ( σ , σ ˙ ) ∧ γ k ( σ ) → ∇ e k ( σ ) · σ ˙ ⋈ k 0 .
Premise (I3) is the simplest form of a differential invariant [26]: it requires the derivative of e k along every admissible flow to be non-positive (or zero), which is again a pointwise condition. For linear e k and linear modules, (I1)–(I3) are formulas of linear real arithmetic.
Lemma 3  
(Invariance). If I satisfies (I1)–(I3), then every state of every computation of M C satisfies I. This includes all states f i ( t ) of phases, all limits end ( P i ) and all states of transition bursts.
Proof. 
By induction along the computation. start ( P 0 ) satisfies I by (I1). Let P i = 〈 [ a , b ) , f 〉 be a φ -phase whose initial state satisfies I , and fix a conjunct k . The discrete variables are constant on P i (Lemma 1(b)), so γ k is either false throughout P i , in which case there is nothing to show, or true throughout. In the latter case, g = e k ∘ f is regular with D + g ( t ) = ∇ e k ( f ( t ) ) · f ˙ + ( t ) (Lemma 1(a)), which is ≤ 0 (or = 0 ) by (I3). By Lemma 1(d) (or (c) with k = 0 ), g ( t ) ≤ g ( a ) ≤ 0 (or g ( t ) = g ( a ) = 0 ) for all t ∈ [ a , b ) . Since e k is continuous and γ k is constant, the limit end ( P i ) also satisfies the conjunct. In a burst σ 0 , … , σ m , σ 0 = end ( P i ) satisfies I . An idle step preserves I trivially. For a step by τ ∈ T C , Ctx C ( σ j − 1 , σ j ) holds as shown in the proof of Theorem 1, so (I2) gives I ( σ j ) . In particular, start ( P i + 1 ) = σ m satisfies I .    □
Definition 11  
(History extension). Let M = ( V , L , Φ , Θ , T , Act ) be a module and h ∉ V a fresh variable with type type ( h ) . Given an expression e 0 over V and, for every τ ∈ T , an expression e τ over V ∪ V ′ ∪ { h } , both with values in type ( h ) , the history extension M h has variables V ∪ { h } , local variables L ∪ { h } , initial condition Θ ∧ h = e 0 , phase invariants ρ φ ∧ h ˙ = 0 (with the same state invariants), and transitions ρ τ ∧ h ′ = e τ with the same labels.
Proposition 3.  
Obs ( M h ) = Obs ( M ) . In particular, M ⊑ M h and M h ⊑ M .
Proof. (⊆) Removing h from a computation of M h yields a computation of M : every constraint of M is a conjunct of the corresponding constraint of M h , and the idle transition of M h restricted to V is that of M . (⊇) Let Π be a computation of M . We add h as follows. In P 0 , h has the constant value e 0 ( start ( P 0 ) ) . In a burst σ 0 , … , σ m , choose for every step a transition τ j ∈ T ^ that witnesses (C3), and set h j = e τ j ( σ j − 1 , σ j , h j − 1 ) if τ j ∈ T and h j = h j − 1 if τ j = τ idle . The next phase keeps the constant value h m . Constant functions are regular with derivative 0, so all phases satisfy ρ φ ∧ h ˙ = 0 ; intermediate burst states remain admissible (with h ˙ = 0 ); and the observable trajectory is unchanged.    □
Theorem 2 (Refwith invariants and history variables)Let M h C be M C or a history extension of it (possibly with several history variables), let I be an inductive invariant of M h C , and let α be an admissible refinement mapping from M h C to M A . Suppose that (R0) and (R1) hold, that (R2) holds with hypothesis ρ φ ( σ , σ ˙ ) ∧ I ( σ ) , and that (R3) holds with hypothesis Ctx C ( σ , σ ′ ) ∧ I ( σ ) ∧ I ( σ ′ ) ∧ ρ τ ( σ , σ ′ ) . Then M C ⊑ M A .
Proof. 
By Lemma 3, every state that occurs in a computation of M h C satisfies I . In the proof of Theorem 1, the premises (R2) and (R3) are applied only to such states: to f i ( t ) , to pairs of consecutive burst states and to intermediate burst states. Hence the strengthened hypotheses are available, and the proof yields M h C ⊑ M A . By Proposition 3, Obs ( M C ) = Obs ( M h C ) , so M C ⊑ M A .    □
An inductive invariant of M 1 C that mentions only variables of M 1 C is also an inductive invariant of M 1 C ‖ M 2 , because every composite phase and every composite transition implies the corresponding constraint of M 1 C or leaves V 1 C unchanged. Hence Theorem 3 and Corollary 1 carry over to Theorem 2.
Example 3  
(A refinement that needs a history variable). The abstract module H A has the observable variable x ∈ { 0 , 1 } and a local flag b ∈ { 0 , 1 } , initially x = b = 0 , a single phase invariant x ˙ = b ˙ = 0 , and two internal transitions: jump ( x = 0 ∧ b = 0 ∧ x ′ = 1 ∧ b ′ = 1 ) and back ( x = 1 ∧ x ′ = 0 ∧ b ′ = b ). Thus x may change from 0 to 1 at most once. The concrete module H C has the observable x and a local clock y with y ˙ = 1 , initially x = y = 0 , and the transitions jump ( x = 0 ∧ y < 1 ∧ x ′ = 1 ∧ y ′ = y ) and back ( x = 1 ∧ y ≥ 2 ∧ x ′ = 0 ∧ y ′ = y ). In H C , x can jump only before time 1 and return only after time 2, so it also jumps at most once, and H C ⊑ H A .
No admissible refinement mapping satisfies (R0) – (R3) . Along the φ-phases f ( t ) = ( x = 0 , y = t ) on [ 0 , ∞ ) and f ′ ( t ) = ( x = 1 , y = t ) on [ 1 2 , ∞ ) , the b-component of α is constant (Lemma 1(b)), say β and β ′ . Premise (R3) for jump from ( 0 , 1 2 ) to ( 1 , 1 2 ) forces β = 0 and β ′ = 1 (the stuttering alternative is impossible because x changes). Premise (R3) for back from ( 1 , 2 ) to ( 0 , 2 ) forces α ( 0 , 2 ) ( b ) = α ( 1 , 2 ) ( b ) , i.e., β = β ′ , which is a contradiction. With the history variable h ∈ { 0 , 1 } , e 0 = 0 , e jump = 1 and e back = h , the mapping α ( σ ) ( b ) = σ ( h ) and the inductive invariant I ≡ ( h = 1 ∧ x = 0 ) → 2 − y ≤ 0 satisfy the premises of Theorem 2. Our tool verifies all ten VCs (Section 8). Without I, the VC of jump fails with the unreachable source state h = 1 , x = 0 , y = 0 .

4.4. Relation to Simulation Relations

Hybrid I/O automata establish implementation relations by simulation relations, in which a concrete trajectory or step is matched by an abstract execution fragment with the same external behaviour [9]. The following definition adapts this idea to our setting.
Definition 12  
(Timed forward simulation). A relation R ⊆ Σ V C × Σ V A such that σ | O = u | O whenever R ( σ , u ) is a timed forward simulation from M C to M A if:
(S1)
for every σ with Θ C ( σ ) there is u with Θ A ( u ) and R ( σ , u ) ;
(S2)
for every φ-phase P = 〈 [ a , b ) , f 〉 of M C and every u with R ( f ( a ) , u ) , there is an abstract fragment over [ a , b ) starting in u, i.e., a finite sequence of phases of M A over consecutive intervals partitioning [ a , b ) , connected by transition bursts and satisfying (C2) and (C3), whose observable trajectory coincides with f | O and, if b < ∞ , whose limit u ′ at b satisfies R ( end ( P ) , u ′ ) ;
(S3)
for every τ ∈ T C , all σ , σ ′ such that σ lies in the closure of ⋃ φ [ [ inv φ ] ] , σ ′ is admissible for some φ ∈ Φ C and ρ τ ( σ , σ ′ ) holds, and every u with R ( σ , u ) , there is a possibly empty sequence of abstract steps u = u 0 , u 1 , … , u k by transitions in T ^ A such that u 1 , … , u k are admissible for some abstract phase invariant and R ( σ ′ , u k ) .
Proposition 4.  
If there is a timed forward simulation from M C to M A , then M C ⊑ M A .
Proof. 
Let Π be a computation of M C . Choose u for start ( P 0 ) by (S1). Inductively, given u with R ( start ( P i ) , u ) , (S2) yields an abstract fragment over the interval of P i with the same observable trajectory and, if P i is not the last phase, a limit u ′ with R ( end ( P i ) , u ′ ) . For the burst σ 0 , … , σ m after P i , idle steps keep the related state, and every step by τ ∈ T C satisfies the hypothesis of (S3): σ j − 1 lies in the closure of the invariants (as in the proof of Theorem 1), and σ j is admissible, either by (C3) or because it is the initial state of the φ -phase P i + 1 . Concatenating the abstract steps given by (S3), and inserting an abstract idle step if no step is produced, yields an abstract burst from u ′ to a state related to start ( P i + 1 ) . Concatenating fragments and bursts gives a sequence of abstract phases and bursts that satisfies (C1)–(C3), covers the same intervals as Π (so it satisfies (C4)) and has the same observable trajectory.    □
Proposition 5.
(a)
If α satisfies the premises ofRef, then the graph R α = { ( σ , α ( σ ) ) } is a timed forward simulation in which every concrete phase is matched by exactly one abstract phase on the same interval and every concrete step by at most one abstract step.
(b)
There are modules M C and M A with a timed forward simulation from M C to M A for whichReffails for every admissible refinement mapping and every phase correspondence.
Proof. (a) (S1) follows from (R1). For (S2), the single phase 〈 [ a , b ) , α ∘ f 〉 is an h ( φ ) -phase by (R2) and (A1)–(A2), has the same observable trajectory, and its limit is α ( end ( P ) ) by (A3). For (S3), (R3) yields one abstract step or, for internal transitions, α ( σ ) = α ( σ ′ ) ( k = 0 ); α ( σ ′ ) is admissible by (R2), as in the proof of Theorem 1. (b) Let M A have the observable y ∈ R , a local mode q ∈ { 0 , 1 } , phase invariants q = 0 ∧ y ˙ = 0 and q = 1 ∧ y ˙ = 1 (with q ˙ = 0 ), an internal transition q ′ = 1 − q ∧ y ′ = y , and Θ A ≡ y = 0 . Let M C have the observable y , the single phase invariant y ˙ = 0 ∨ y ˙ = 1 , no transitions and Θ C ≡ y = 0 . The relation R = { ( σ , u ) ∣ σ ( y ) = u ( y ) } is a timed forward simulation: on each of the finitely many pieces of a concrete phase, y ′ is continuous with values in { 0 , 1 } and hence constant, so the phase is matched by abstract phases in the corresponding modes, connected by internal transitions at the break points; (S1) is immediate and (S3) is vacuous. However, (R2) fails for both possible values of h ( φ ) : for every σ , both σ ˙ ( y ) = 0 and σ ˙ ( y ) = 1 satisfy ρ φ , whereas D α maps y ˙ to itself and each abstract phase admits only one of the two rates.    □
Proposition 5 makes the relationship to simulation-based methods precise. Ref is the special case of timed forward simulations that are functional, match phases one to one, and match steps by at most one step. This restriction is what makes all obligations pointwise and decidable for linear modules. General simulations quantify over trajectories and fragments in (S2), and in general this cannot be reduced to first-order conditions on states and derivatives. The example in (b) suggests a further extension, splitting concrete phases at the points where the abstract mode changes, which we leave for future work.

5. Compositionality

Hybrid systems are composed of many processes, so it is important that one process can be refined without re-verifying its environment. The following theorem shows that the premises of Ref are preserved under parallel composition with an arbitrary environment.
Theorem 3  
(Compositionality). Let M 1 C , M 1 A and M 2 be hybrid modules such that M 1 C ‖ M 2 and M 1 A ‖ M 2 are defined, O ( M 1 C ) = O ( M 1 A ) and Act ( M 1 C ) = Act ( M 1 A ) . Let α 1 be an admissible refinement mapping and h 1 a phase correspondence such that (R0) – (R3) hold for ( M 1 C , M 1 A , α 1 , h 1 ) . Define α = α 1 ⊎ id V 2 , i.e., α ( σ ) ( x ) = α 1 ( σ | V 1 C ) ( x ) for x ∈ V 1 A and α ( σ ) ( x ) = σ ( x ) for x ∈ V 2 , and h ( φ 1 ⊗ φ 2 ) = h 1 ( φ 1 ) ⊗ φ 2 . Then α is an admissible refinement mapping and (R0) – (R3) hold for ( M 1 C ‖ M 2 , M 1 A ‖ M 2 , α , h ) . Consequently, M 1 C ‖ M 2 ⊑ M 1 A ‖ M 2 .
Proof. 
Well-definedness. Since local variables are private, V 1 A ∩ V 2 ⊆ O ( M 1 A ) = O ( M 1 C ) , and α 1 is the identity on observable variables, so the two clauses defining α agree on V 1 A ∩ V 2 . The observable variables of both compositions are O ( M 1 C ) ∪ O ( M 2 ) , and α is the identity on them.
Admissibility. Let D α ( σ , σ ˙ ) = D α 1 ( σ | V 1 C , σ ˙ | V 1 C ) ⊎ σ ˙ | V 2 . A ( φ 1 ⊗ φ 2 ) -phase of M 1 C ‖ M 2 restricted to V 1 C is a φ 1 -phase of M 1 C , so (A1)–(A3) for the V 1 A -components follow from the admissibility of α 1 , and they hold trivially for the identity components.
(R0) , (R1). The abstract types and initial conditions are conjunctions of those of M 1 A , which hold by (R0) and (R1) for M 1 , and those of M 2 , on which α is the identity.
(R2). ρ φ 1 ∧ ρ φ 2 implies ρ h 1 ( φ 1 ) [ α 1 ] ∧ ρ φ 2 by (R2) for M 1 , and ρ φ 2 [ α ] = ρ φ 2 because α and D α are the identity on V 2 and V ˙ 2 .
(R3). First, Ctx of the composition implies Ctx of M 1 C for the restrictions of the states to V 1 C . Write A φ 1 = { σ ∣ inv φ 1 ( σ | V 1 C ) } and B φ 2 = { σ ∣ inv φ 2 ( σ | V 2 ) } . Closure commutes with finite unions and satisfies cl ( A ∩ B ) ⊆ cl ( A ) , so cl ⋃ φ 1 , φ 2 A φ 1 ∩ B φ 2 ⊆ ⋃ φ 1 cl ( A φ 1 ) ; and since A φ 1 is a cylinder over the coordinates V 1 C , a state lies in cl ( A φ 1 ) iff its restriction to V 1 C lies in the closure of [ [ inv φ 1 ] ] . The second conjunct of Ctx is treated in the same way, without closures. We distinguish the three kinds of composite transitions.
(a)
τ 1 ⊗ τ 2 with ℓ = lab ( τ 1 ) = lab ( τ 2 ) ∈ Act 1 ∩ Act 2 . Since ℓ ≠ ε , (R3) for M 1 yields υ 1 ∈ T 1 A with lab ( υ 1 ) = ℓ and ρ υ 1 [ α 1 ] . Since Act ( M 1 A ) = Act ( M 1 C ) , υ 1 ⊗ τ 2 is a transition of M 1 A ‖ M 2 with label ℓ , and ρ υ 1 [ α ] ∧ ρ τ 2 = ρ υ 1 ⊗ τ 2 [ α ] .
(b)
τ 1 ⊗ τ idle 2 with ℓ = lab ( τ 1 ) ∉ Act 2 . If (R3) for M 1 yields υ 1 with label ℓ , then υ 1 ⊗ τ idle 2 is an abstract composite transition with label ℓ , because ℓ ∉ Act 2 . If it yields ℓ = ε and α 1 ( σ | V 1 C ) = α 1 ( σ ′ | V 1 C ) , then together with ρ τ idle 2 (all variables of V 2 unchanged) we obtain α ( σ ) = α ( σ ′ ) , an abstract idle step.
(c)
τ idle 1 ⊗ τ 2 with ℓ = lab ( τ 2 ) ∉ Act 1 . Since ρ τ idle 1 leaves V 1 C unchanged, α 1 ( σ | V 1 C ) = α 1 ( σ ′ | V 1 C ) , i.e., ρ τ idle A , 1 [ α 1 ] holds for the idle transition τ idle A , 1 of M 1 A . Together with ρ τ 2 = ρ τ 2 [ α ] , this is ρ τ idle A , 1 ⊗ τ 2 [ α ] , and τ idle A , 1 ⊗ τ 2 is an abstract composite transition with label ℓ , because ℓ ∉ Act ( M 1 A ) = Act 1 .
Theorem 1 now yields M 1 C ‖ M 2 ⊑ M 1 A ‖ M 2 .    □
Corollary 1.  
IfRefestablishes M 1 C ⊑ M 1 A and M 2 C ⊑ M 2 A , the side conditions of Theorem 3 hold for both components, and all compositions involved are defined, then M 1 C ‖ M 2 C ⊑ M 1 A ‖ M 2 A . By induction, this extends to any finite number of components.
Proof. 
By Theorem 3, M 1 C ‖ M 2 C ⊑ M 1 A ‖ M 2 C . By Theorem 3 applied to M 2 (using the commutativity of ‖), M 1 A ‖ M 2 C ⊑ M 1 A ‖ M 2 A . Transitivity (Proposition 1) concludes the proof.    □
Theorem 3 is a statement about the premises of the rule, which is stronger than a statement about the refinement relation: the composed refinement is again established by Ref, so further refinement steps can be composed in the same way. Theorem 3 relies on two design decisions. Labelled transitions are never matched by stuttering (Remark 2), and local variables are private.

6. Case Studies

This section applies the method to four case studies. The first two refine the controller TEMP A of Example 1: one replaces an abstract local variable by a different concrete one without changing the control structure (one-to-one), and the other splits an abstract mode into two concrete modes (many-to-one). The third is the water-level monitor, a standard benchmark for hybrid automata [6], whose refinement requires an inductive invariant. The fourth is a tank with nonlinear dynamics that refines a rectangular abstraction. All verification conditions were discharged automatically (Section 8); here we show the key ones by hand.

6.1. One-to-One Refinement: Replacing a Clock by a Count-Down Timer

The module TEMP B is identical to TEMP A , except that the clock z is replaced by a count-down timer r with r ˙ = − 1 . The timer is set to 10 whenever z is reset to 0, the initial condition contains r = 10 , and the invariant z ≤ 10 of HOT becomes r ≥ 0 . The refinement mapping is the identity on θ , a c , d , π and maps the abstract clock to
α B ( σ ) ( z ) = 10 − σ ( r ) , D α B ( σ , σ ˙ ) ( z ) = − σ ˙ ( r ) .
By Lemma 2, α B is admissible. With h = id , premise (R2) for HOT reads
π = 1 ∧ a c = 1 ∧ d = 0 ∧ r ≥ 0 ∧ r ˙ = − 1 ∧ … → π = 1 ∧ a c = 1 ∧ d = 0 ∧ 10 − r ≤ 10 ∧ − r ˙ = 1 ∧ … ,
which is valid, and premise (R3) for on requires r ′ = 10 → 10 − r ′ = 0 . In this example, abstract and concrete transitions correspond one to one, and the derivative substitution z ˙ ↦ − r ˙ is the only non-trivial ingredient.

6.2. Many-to-One Refinement: Splitting a Mode

In TEMP C (Figure 2), the abstract mode HOT is split into HOT (normal cooling, θ ˙ ∈ [ − 1 , 1 ] ) and VHOT (high-power cooling, θ ˙ ∈ [ − 5 , − 4 ] ). The concrete controller first cools normally for at most 5 time units. If the room has not cooled down by then, the internal transition escalate switches to VHOT and resets the concrete clock c . VHOT is again left within 5 time units. The abstract deadline z ≤ 10 is thus implemented by two concrete deadlines. The refinement mapping is defined by cases on the concrete mode:
α C ( σ ) ( π A ) = 1 if σ ( π ) = 2 , σ ( π ) otherwise , α C ( σ ) ( z ) = σ ( c ) + 5 if σ ( π ) = 2 , σ ( c ) otherwise ,
with D α C ( σ , σ ˙ ) ( z ) = σ ˙ ( c ) and D α C ( σ , σ ˙ ) ( π A ) = 0 . The mapping is piecewise affine with case distinctions on the discrete variable π , so it is admissible by Lemma 2. The phase correspondence maps COOL to COOL and both HOT and VHOT to HOT.
Phases. For VHOT, premise (R2) instantiated with the case π = 2 of α C reads
π = 2 ∧ a c = 1 ∧ d = 0 ∧ c ≤ 5 ∧ c ˙ = 1 ∧ − 5 ≤ θ ˙ ≤ − 4 → 1 = 1 ∧ a c = 1 ∧ d = 0 ∧ c + 5 ≤ 10 ∧ c ˙ = 1 ∧ − 5 ≤ θ ˙ ≤ 1 ,
where the abstract derivative constraint z ˙ = 1 became c ˙ = 1 through D α C . The rate interval of VHOT is contained in that of the abstract mode, and the concrete deadline c ≤ 5 in VHOT implies the abstract deadline z ≤ 10 , because z = c + 5 in VHOT.
Stuttering. The internal transition escalate has no abstract counterpart. Its premise (R3) is discharged by the stuttering disjunct: with the cases π = 1 for the source state and π ′ = 2 for the target state,
Ctx C ∧ π = 1 ∧ c = 5 ∧ π ′ = 2 ∧ a c ′ = 1 ∧ c ′ = 0 ∧ θ ′ = θ ∧ d ′ = d → 1 = 1 ∧ c = c ′ + 5 ∧ a c = a c ′ ∧ θ = θ ′ ∧ d = d ′ .
The conjunct a c = a c ′ follows only from the context: the source state lies in the closure of the invariant of HOT, which contains a c = 1 . The offset + 5 in α C is what makes the abstract clock continuous across the concrete reset of c . Figure 3 illustrates this.

6.3. Composition and Divergence

The rooms of a building can be modelled by renamed copies TEMP i C and TEMP i A ( i = 1 , … , N ) with variables θ i , a c i , π i , c i or z i , sharing the door variable d and the actions open and close . Local variables are private, observable variables and action sets coincide, and the door is the same at both levels. By Corollary 1, the single check TEMP C ⊑ TEMP A therefore establishes
TEMP 1 C ‖ … ‖ TEMP N C ‖ DOOR ⊑ TEMP 1 A ‖ … ‖ TEMP N A ‖ DOOR
for every N ≥ 1 . Following Remark 3, we complement this with a non-blocking argument.
The proof of non-blocking uses the following bounds on the reachable states of a room.
Lemma 4.  
Let S N = ( TEMP 1 C ‖ … ‖ TEMP N C ) ‖ DOOR . In every finite sequence of phases and bursts of S N that satisfies (C1)–(C3), every state that occurs (including phase limits and burst states) satisfies, for every room i:
(a)
if π i = 0 , then θ i ≤ 35 , and θ i ≤ 26 if moreover d = 0 ;
(b)
if π i = 1 , then d = 0 , c i ≤ 5 and θ i − c i ≤ 35 ;
(c)
if π i = 2 , then d = 0 , c i ≤ 5 and θ i + 4 c i ≤ 40 .
Proof. 
All phase invariants of S N consist of non-strict inequalities and equalities, so they are closed, and every state of a phase, every phase limit and every intermediate burst state satisfies the state invariant of some phase invariant. This gives (a) and the first two conjuncts of (b) and (c). The remaining conjuncts form the assertion I ≡ ⋀ i ( π i = 1 → θ i − c i − 35 ≤ 0 ) ∧ ( π i = 2 → θ i + 4 c i − 40 ≤ 0 ) , and we show that I is an inductive invariant (Definition 10); Lemma 3 then concludes. (I1) holds because initially π i = 0 . (I3): in HOT, θ ˙ i − c ˙ i ≤ 1 − 1 = 0 ; in VHOT, θ ˙ i + 4 c ˙ i ≤ − 4 + 4 = 0 . (I2): a transition that does not change π i either leaves θ i , c i unchanged (interleaving with the idle step of room i , or the transitions open and close of room i that keep it in COOL) and preserves the conjuncts of room i . Room i enters HOT only by on or close 2 , from COOL with θ i ≤ 35 by (a) (applied to the source state, which lies in the closed state invariant of COOL) and with c i ′ = 0 , so θ i ′ − c i ′ ≤ 35 . It enters VHOT only by escalate , from HOT with c i = 5 and θ i ≤ 40 and with c i ′ = 0 , so θ i ′ + 4 c i ′ ≤ 40 . The tool also confirms (I1)–(I3) for N = 1 .    □
Proposition 6  
(Non-blocking). Every finite sequence of phases and bursts of S N that satisfies (C1)–(C3) and whose last phase has a bounded interval can be extended to a computation of S N , i.e., to one that also satisfies (C4).
Proof. 
Let the prefix end with a phase on [ a k , T ) and let σ be its limit at T . By Lemma 4, σ satisfies (a)–(c). We extend the prefix in three stages. Every stage consists of phases of positive length in which the flows are fixed as follows: θ ˙ i = 0 for rooms in COOL and HOT, θ ˙ i = − 4 for rooms in VHOT, c ˙ i = 1 and w ˙ = 1 . Stages are separated by transition bursts. If no transition is due at an instant, the burst consists of a single idle step. In every burst, the transitions due at that instant are taken one after the other. Each intermediate state is admissible because every room is in a mode whose state invariant holds and all flow constraints are satisfiable.
Stage 1 (door open). If d = 1 , then every room is in COOL by (b) and (c). Let time pass for 30 − w ≥ 0 time units (no phase if w = 30 ). With θ ˙ i = 0 , the invariants ( θ i ≤ 26 ∨ d = 1 ) ∧ θ i ≤ 35 of COOL and w ≤ 30 of OPEN are maintained, the latter as a non-strict bound reached only in the limit. Then take the synchronised transition close , in which every room takes close 1 if θ i ≤ 26 and close 2 otherwise. The target states satisfy the invariants of CLOSED, of COOL (because θ i ≤ 26 after close 1 ), and of HOT (because d = 0 and c i = 0 after close 2 ).
Stage 2 (door closed). Now d = 0 . Rooms in COOL satisfy θ i ≤ 26 by (a) and stay in COOL; the transition on is never taken. A room in HOT is due when c i = 5 , and a room in VHOT is due when θ i ≤ 24 . At every instant at which some room is due, we take a burst in which every due room in HOT takes escalate and every due room in VHOT takes off 2 ; a room that escalates and is then immediately due in VHOT takes off 2 in the same burst. Since every room changes its mode at most twice, each burst is finite. Between bursts, time passes until the next instant at which a room becomes due. This instant is strictly later, because right after a burst every room in HOT has c i < 5 and every room in VHOT has θ i > 24 . We check that the invariants are maintained. A room in HOT has c i ≤ 5 until it is due. A room in VHOT satisfies θ i ≤ 40 − 4 c i by (c), and θ i decreases at rate 4 while c i increases at rate 1, so θ i ≤ 24 holds at the latest when c i = 4 ; hence it becomes due while c i ≤ 4 < 5 . The targets of escalate ( c i = 0 ) and of off 2 ( θ i ≤ 24 ≤ 26 , d = 0 ) satisfy the invariants of VHOT and COOL. Every room in HOT becomes due within 5 time units, and every room in VHOT within 4 time units after entering it. Hence after at most 9 time units of stage 2, all rooms are in COOL, and stage 2 consists of finitely many phases and bursts.
Stage 3. All rooms are in COOL with d = 0 and θ i ≤ 26 , and the door is in CLOSED. A final phase on an unbounded interval with θ ˙ i = 0 , c ˙ i = 1 and w ˙ = 1 satisfies all invariants forever.
The extended sequence satisfies (C1)–(C3), and it satisfies (C4) because it ends with a phase on an unbounded interval.    □
Proposition 6 shows that the refinement in this case study is not vacuous. By Theorem 1, every computation of S N is mapped to a divergent abstract computation with the same phase boundaries.

6.4. A Standard Benchmark: The Water-Level Monitor

The water-level monitor of Alur et al. [6] controls the water level y in a tank by switching a pump on and off. A monitor senses the level, but the pump reacts to a switching signal only after a delay of 2 time units, which is measured by a clock x . The concrete module WLM C (Table 2) has four modes π ∈ { 0 , 1 , 2 , 3 } . In modes 0 and 1 the pump is on and the level rises with y ˙ = 1 ; in modes 2 and 3 it is off and the level falls with y ˙ = − 2 . When the level reaches 10 in mode 0, the monitor sends the switch-off signal and resets x (mode 1); after 2 time units the pump is off (mode 2). Symmetrically, the switch-on signal is sent at level 5 (mode 3) and takes effect 2 time units later. Initially y = 1 and π = 0 . The observable variable is y ; x and π are local.
The abstract specification WLM A only states that the level rises or falls at the given rates, that the direction changes from rising to falling only at a level of at least 10 and from falling to rising only at a level of at most 5, and that the level never exceeds 12 while rising and never drops below 1 while falling. It is easy to see, and our tool confirms with the inductive invariant ( m = 0 → 1 − y ≤ 0 ) ∧ ( m = 1 → y − 12 ≤ 0 ) , that every abstract computation keeps the level within [ 1 , 12 ] . This is the classical safety requirement of the benchmark [6], which therefore holds for every module that refines WLM A (Remark 1).
The refinement mapping is α ( σ ) ( m ) = 0 if σ ( π ) ∈ { 0 , 1 } and 1 otherwise, so the signal-delay modes 1 and 3 are merged with the pump modes. The transitions t 01 and t 23 are matched by stuttering, and t 12 and t 30 by down and up . Without further information, the premises fail: in mode 1 the phase invariant does not bound y , so (R2) cannot establish y ≤ 12 , and the source state of t 12 is not known to satisfy y ≥ 10 . The missing information is the relation between the level and the clock, which is captured by the inductive invariant
I WLM ≡ ( π = 1 → y − x − 10 = 0 ) ∧ ( π = 3 → y + 2 x − 5 = 0 ) .
Condition (I3) holds because y ˙ − x ˙ = 1 − 1 = 0 in mode 1 and y ˙ + 2 x ˙ = − 2 + 2 = 0 in mode 3, and (I2) holds because t 01 sets y = 10 , x = 0 and t 23 sets y = 5 , x = 0 . With I WLM , (R2) for mode 1 follows from y = 10 + x ≤ 12 , (R3) for t 12 from y = 10 + 2 = 12 ≥ 10 , and symmetrically for modes 3 and t 30 ( y = 5 − 2 x ≥ 1 and y = 1 ≤ 5 ). By Theorem 2, WLM C ⊑ WLM A , and hence 1 ≤ y ≤ 12 holds in every computation of the water-level monitor.

6.5. Nonlinear Dynamics: A Tank with Torricelli Outflow

The last case study shows how Ref justifies a rectangular abstraction of nonlinear dynamics. In the concrete tank TANK N , the outflow through an opening at the bottom follows Torricelli’s law and is proportional to y , where y is the water level. In mode FILL ( π = 0 ) a pump adds a constant inflow, so y ˙ = 4 − y ; in mode DRAIN ( π = 1 ), y ˙ = − y . Both modes have the state invariant 2 ≤ y ≤ 10 . The controller switches to DRAIN when y ≥ 9 and back to FILL when y ≤ 3 , and initially π = 0 and 2 ≤ y ≤ 4 . The abstract module TANK R is identical except that its flows are rectangular: 0.8 ≤ y ˙ ≤ 2.6 in FILL and − 3.2 ≤ y ˙ ≤ − 1.4 in DRAIN. Rectangular automata are amenable to algorithmic analysis [38,39,42], so properties established for TANK R carry over to the nonlinear tank once TANK N ⊑ TANK R is shown.
With the identity mapping, all premises except (R2) involve only guards, resets and state invariants and are in linear real arithmetic. Premise (R2) involves the square root. We encode y by a fresh variable s with s ≥ 0 ∧ s 2 = y , so that, e.g., the flow of FILL becomes ∃ s . ( s ≥ 0 ∧ s 2 = y ∧ y ˙ = 4 − s ) . The existential quantifier occurs in the hypothesis of the implication and therefore becomes universal, and (R2) for FILL reads
2 ≤ y ≤ 10 ∧ s ≥ 0 ∧ s 2 = y ∧ y ˙ = 4 − s → 2 ≤ y ≤ 10 ∧ 0.8 ≤ y ˙ ≤ 2.6 ,
a formula of nonlinear real arithmetic. It is valid: s 2 ≥ 2 > 1.96 = 1 . 4 2 and s 2 ≤ 10 < 10.24 = 3 . 2 2 give 1.4 < s < 3.2 , hence 0.8 < y ˙ < 2.6 . The premise for DRAIN follows from the same bounds on s . A dense numerical sweep confirms that the concrete rates range over [ 0.8377 , 2.5858 ] and [ − 3.1623 , − 1.4142 ] . If the abstract lower bound of FILL is tightened to 0.9 (fault M7), (R2) fails with y = 10 , s = 10 , y ˙ ≈ 0.838 . The argument never refers to solutions of the differential equation y ˙ = 4 − y .

7. Automated Verification

7.1. Verification Conditions

Given M C , M A , a refinement mapping α and the action labels, the premises of Ref are turned into a finite set of verification conditions (VCs), each of which is a closed universally quantified formula of real arithmetic.
  • Structural checks: O C = O A with equal types, Act C = Act A , α is the identity on O and defines every abstract local variable.
  • Admissibility (A): α is given as a list of cases ( γ k , { x ↦ e k , x } x ∈ L A ) , where the guards γ k are conjunctions over discrete variables and the e k , x are affine expressions. The VCs check that the guards cover the type domain of the discrete variables and are pairwise disjoint; Lemma 2 then guarantees admissibility. As a sanity check of the model, the tool also verifies that every concrete phase invariant forces the derivative of the guard variables to be 0.
  • Invariants (I1)–(I3): if the user supplies an invariant I (Definition 10) with linear e k , one VC per transition and one per pair of phase invariant and conjunct are generated, and I and its primed copy are added to the hypotheses of (R2) and (R3) (Theorem 2). History variables are added to M C by a syntactic transformation (Definition 11).
  • (R0) and (R1) :   Dom C → Dom A [ α ] and Dom C ∧ Θ C → Θ A [ α ] , where Dom is the type constraint ⋀ x discrete ⋁ v ∈ type ( x ) x = v .
  • (R2) : for every φ ∈ Φ C , the tool searches for an abstract phase ψ such that Dom C ∧ ρ φ → ρ ψ [ α ] is valid, and reports a counterexample for the last candidate if none exists. The user can also fix h .
  • (R3) : for every τ ∈ T C , the VC is Dom C ∧ Dom ′ C ∧ Ctx ¯ C ∧ ρ τ → ⋁ υ ρ υ [ α ] ( ∨ ρ τ idle [ α ] ) , where Ctx ¯ C replaces the closure by the relaxation of strict inequalities (Section 4) and the idle disjunct is present only for internal τ .
Substituting a case-defined α into an abstract assertion yields a disjunction over cases. Since the case guards partition the domain, H → ⋁ k ( γ k ∧ G [ α k ] ) is equivalent to ⋀ k ( H ∧ γ k → G [ α k ] ) . The tool uses the latter form and skips cases whose guard is inconsistent with H . For a composition of n modules, α consists of n independent case groups, and the cases are enumerated per group, which keeps the number of case combinations small whenever H determines the modes. The phase-invariant context of a composition is computed factor by factor, ⋁ φ 1 , φ 2 ( inv φ 1 ∧ inv φ 2 ) ≡ ⋁ φ 1 inv φ 1 ∧ ⋁ φ 2 inv φ 2 , which avoids a disjunction over all product phases.
A hybrid module is linear if all assertions are Boolean combinations of linear (in)equalities over V , V ˙ and V ′ with rational coefficients. This class includes rectangular dynamics such as θ ˙ ∈ [ − 5 , − 4 ] and linear guards, invariants and resets. If both modules are linear and α is piecewise affine, then all VCs are formulas of quantifier-free linear real arithmetic (QF_LRA) after the universal quantifiers are dropped, so their validity is decidable [44,45]. No VC mentions trajectories, time or solutions of differential equations.

7.2. Implementation

We implemented VC generation and an exact decision procedure for QF_LRA in about 1000 lines of Python (standard library only). A VC H → G is valid iff H ∧ ¬ G is unsatisfiable. The procedure enumerates the satisfiable cubes of H by a DPLL-style case split on disjunctions. Each partial cube is pruned by an exact feasibility check, implemented as Gaussian elimination of equalities followed by Fourier–Motzkin elimination over the rationals with exact strictness tracking [44], and equalities of the form x = k are propagated into the remaining disjunctions. For each cube, the tool first tries to show that some disjunct of G (a conjunction of atoms) is entailed atom by atom; if this fails, it searches for a model of the cube together with ¬ G . A model is reconstructed by back-substitution and checked against the original formula, so every reported counterexample is a genuine one. The decision procedure was cross-checked against a linear-programming oracle on 3000 random conjunctions of strict, non-strict and equality constraints and against grid search on 500 random formulas with Boolean structure, with no discrepancies. Every VC is also exported in SMT-LIB 2 format (logic QF_LRA) [12] as an assertion of its negation, so that it can be re-checked independently by SMT solvers such as Z3 [46] or cvc5 [47]; the expected answer is unsat for valid VCs and sat for the failing VCs of the faulty models. Premises that leave linear arithmetic, such as (R2) for the nonlinear tank, are exported in the logic QF_NRA and discharged by Z3’s procedure for nonlinear real arithmetic [48]. All 170 VCs of our experiments were re-checked with Z3 version 4.13.3, and its answers agree with the expected ones in every case; each file is answered in about 9–12 ms of wall-clock time, including process start-up.

8. Evaluation

We address three questions. Q1: Can the refinements of Section 6 be verified fully automatically? Q2: Are faulty refinement steps detected, and are the counterexamples informative? Q3: How does compositional checking (Corollary 1) compare with monolithic checking of the composed system? All experiments were run on an Intel Xeon processor at 2.10 GHz (2 virtual cores, 7 GB of memory) with Python 3.13. We report the median of five runs (three runs for N = 3 and a single run for N = 4 in Table 5).
Q1: Verification of the case studies.Table 3 shows the VCs generated for the four case studies of Section 6 and for Example 3. All of them are valid, and each refinement is verified in at most about 0.13 s by our procedure. In TEMP C ⊑ TEMP A , the tool finds the phase correspondence COOL ↦ COOL , HOT ↦ HOT , VHOT ↦ HOT , matches escalate with abstract stuttering, and matches off 1 and off 2 with the abstract transition off . As an ablation, we removed the phase-invariant context from (R3): TEMP B ⊑ TEMP A is still verified, but for TEMP C the VC of escalate fails with a spurious counterexample whose source state ( π = 1 , a c = 0 ) violates the invariant of HOT.
Inductive invariants and history variables are essential for the last three rows. Without I WLM , four VCs of the water-level monitor fail: (R2) for modes 1 and 3, where the level is unbounded by the phase invariant, and (R3) for t 12 and t 30 , with counterexamples such as π = 1 , x = 2 , y = 6 , a state in which the pump would be switched off below level 10 and which is unreachable. Without the invariant I of Example 3, the VC of jump fails with the unreachable state h = 1 , x = 0 , y = 0 . In both cases the counterexamples point directly to the missing invariant. For the nonlinear tank, Z3 proves both QF_NRA premises (unsat) and finds a model for the seeded fault M7 (sat); Z3 4.13.3 answers each of these three queries in about 11 ms of wall-clock time, including process start-up.
Q2: Fault detection. We seeded six faults into TEMP C and one into the abstraction of the nonlinear tank, each of which breaks the refinement (Table 4). Every fault is detected by exactly one failing VC, which pinpoints the responsible premise and model element, and the counterexample is a concrete witness. For M1, the derivative θ ˙ = − 11 / 2 is allowed in VHOT but lies outside the abstract rate interval [ − 5 , 1 ] . For M2, c = 11 / 2 in VHOT maps to z = 21 / 2 > 10 . For M3, the missing reset maps the source state to z = 5 and the target state to z = 10 , so neither stuttering nor any abstract transition matches. For M4, the concrete controller switches on at θ = 51 / 2 < 26 . For M5, the initial temperature 53 / 2 violates the abstract initial condition. For M6, the compressor is off in a state that is mapped to the abstract mode HOT. For M7, the concrete fill rate 4 − 10 ≈ 0.838 at level 10 violates the tightened abstract bound 0.9 .
Q3: Compositional versus monolithic checking. For N = 1 , … , 4 rooms, we checked ( ‖ i TEMP i C ) ‖ DOOR ⊑ ( ‖ i TEMP i A ) ‖ DOOR monolithically , by applying Ref directly to the composed modules with the mapping ⊎ i α C , i ⊎ id . We compared this with the compositional approach, which checks TEMP C ⊑ TEMP A once and concludes the refinement for every N by Corollary 1. Table 5 and Figure 4 show the results. The number of concrete phase invariants grows as 2 · 3 N , because phases of parallel components are combined, and the synchronised transitions combine the alternatives of all rooms. The monolithic VCs therefore grow exponentially, and so does the time to check them (by a factor of 7.7 to 12.8 per additional room, reaching 192 s for N = 4 ). The compositional check is independent of N . If the rooms were refined differently, it would require one component check per room, i.e., linear effort.
Table 5. Monolithic versus compositional checking for N rooms sharing one door. | Φ | and | T | are the numbers of phase invariants and transitions of the composed concrete and abstract modules.
Table 5. Monolithic versus compositional checking for N rooms sharing one door. | Φ | and | T | are the numbers of phase invariants and transitions of the composed concrete and abstract modules.
Concrete Abstract Monolithic Compositional
N | Φ | | T | | Φ | | T | VCs Time (s) VCs Time (s)
1 6 7 4 5 26 0.215 19 0.121
2 18 13 8 9 78 2.759 19 0.121
3 54 21 16 15 252 24.902 19 0.121
4 162 33 32 25 862 191.613 19 0.121

9. Discussion

Expressiveness and nonlinear dynamics. The automation covers linear modules with piecewise affine refinement mappings and linear invariants completely, and nonlinear premises through SMT solvers for nonlinear real arithmetic. The nonlinear tank (Section 6.5) shows that Ref can justify rectangular abstractions of nonlinear flows without reasoning about solutions of differential equations: (R2) compares concrete and abstract phase invariants pointwise. Abstract phase invariants do not need to be inductive. Refinement only requires the concrete flow to stay within them, which the concrete phase invariant guarantees pointwise. Nonlinear real arithmetic is decidable [49], but its decision procedures are costly.
Comparison with differential refinement logic and KeYmaera X. Differential refinement logic (dRL) [29] extends differential dynamic logic [26] with a refinement operator α ≤ β between hybrid programs, which holds if every state transition of α is also a transition of β . Refinement proofs are carried out in a sequent calculus that also handles nested refinements and nonlinear differential equations. Our notion differs in three respects. First, refinement in our sense compares observable trajectories over time, including the instants of observable changes, whereas dRL compares the input/output relations of programs over a common state space. Second, concrete and abstract modules have different state spaces and are related by a refinement mapping with stuttering, so mode merging and splitting of phases (Section 6) are part of the rule. Third, Ref reduces refinement to a fixed set of quantifier-free first-order VCs, one per premise, phase and transition, which are discharged without user interaction. dRL is more expressive, but its proofs are, in general, interactive. The two approaches are complementary: every VC of Ref is a formula of real arithmetic and can be closed by the quantifier-elimination tactics of KeYmaera X [28], and a dL proof of a differential invariant can replace condition (I3) where our syntactic check does not apply. We did not include a quantitative comparison with KeYmaera X, because the two tools establish different properties for the same models. A fair comparison would first encode observable trajectories as hybrid programs, e.g., by observer variables that record the time of each observable change, so that trace inclusion becomes a transition-relation inclusion. Such an encoding, and the resulting embedding of Ref into dRL, is left for future work.
Towards general nonlinear flows. The nonlinear tank relies on a rectangular abstraction, but the rule itself does not assume linearity. Premises (R0), (R1) and (R3) only involve initial conditions, guards and resets, and (R2) compares phase relations pointwise, with the flow given implicitly as a constraint on ( x , x ˙ ) . For polynomial flows x ˙ = f ( x ) and polynomial refinement mappings, the derivative D α is obtained by the chain rule, and all premises remain in nonlinear real arithmetic, which is decidable [49]. The essential limitation lies in the invariants. Condition (I3) requires the Lie derivative of each invariant term to be non-positive on the phase invariant, which is a special case of a differential invariant [27]. For polynomial terms the same condition yields a VC in QF_NRA. Invariants that are not preserved in this strong sense, such as level sets of conserved quantities, need the more general differential invariants, Darboux polynomials, or barrier certificates [27,50]. Barrier certificates can be synthesised by sum-of-squares programming, which would also allow refinement mappings and invariants to be synthesised from polynomial templates. Flows with transcendental right-hand sides leave the decidable fragment; for them, δ -complete solvers such as dReal [51] would return answers that are sound up to a numerical tolerance.
Functional mappings and completeness.Ref uses a function from concrete to abstract states. Proposition 2 shows that this is incomplete when the abstract module resolves nondeterminism earlier than the concrete one. Example 3 shows a second source of incompleteness, abstract information about the past, which history variables remove (Theorem 2). Prophecy variables [11] or backward simulations [17] would be needed for the first source. Proposition 5 identifies a third restriction: Ref matches every concrete phase by exactly one abstract phase. Splitting concrete phases at points where the abstract mode changes would lift this restriction, but the resulting obligations are no longer pointwise in general. Synthesising refinement mappings and invariants from templates, e.g., piecewise affine mappings and linear invariants with unknown coefficients, is another direction, since in the linear case the resulting constraints are again arithmetic.
Time abstraction. Refinement in our sense preserves the time of every observable change. This is appropriate for refining hybrid specifications into hybrid designs, but not for relating a continuous-time specification to a sampled-data implementation, which needs tolerances or timing slack. Approximate simulations [35] and d L -based approaches such as ModelPlex [30] address that step.
Non-blocking. As discussed in Remark 3, refinement does not imply that the concrete module is non-blocking. For the controller case study, non-blocking was proved by hand (Proposition 6); the inductive invariant on which the proof relies (Lemma 4) is machine-checked. Automating the whole argument, e.g., with reachability tools [42] or a receptiveness game [19], would complement the method.
Threats to validity. The case studies are small, although they include a standard benchmark and are typical for controller refinement, and the experiments were run on a single machine. The reported times for linear VCs were obtained with our own decision procedure rather than with an industrial SMT solver. This procedure uses exact rational arithmetic, checks every counterexample against the original formula, and was cross-checked against an independent oracle. Moreover, all 170 VCs of the experiments (including the failing ones and the monolithic VCs for N = 2 ) were re-checked with Z3 4.13.3, with the expected results; they are provided in SMT-LIB 2 format together with the script used for this comparison. Absolute times would be lower with an optimised SMT solver; the exponential growth of the monolithic VCs is a property of the composed models, not of the solver.

10. Conclusions

This paper presented a refinement verification method for hybrid systems based on Milner’s notion of observability. We introduced hybrid modules, which separate observable and local variables and label transitions with synchronisation actions, and defined refinement as inclusion of observable trajectories, which is insensitive to stuttering. For this notion we gave the proof rule Ref, based on refinement mappings. Its premises relate initial conditions, phase invariants (including derivatives, through the flow derivative of the mapping) and transitions (with stuttering for internal steps and a phase-invariant context). We proved that the rule is sound, that the abstract witness computation has exactly the same time structure as the concrete one, so that divergence is preserved, and that the rule is compositional with respect to parallel composition with synchronisation. We extended the rule with inductive invariants and history variables, characterised it as the functional, phase-preserving special case of timed forward simulations, and proved that it is incomplete without prophecy variables.
All premises are pointwise quantifier-free formulas and can be discharged automatically. For linear modules, piecewise affine mappings and linear invariants they are formulas of linear real arithmetic. Our prototype verified four case studies, including the water-level monitor benchmark and a tank with nonlinear outflow. It detected seven seeded faults with concrete counterexamples, and it showed that compositional checking avoids the exponential growth of monolithic checking of composed systems.
Future work includes prophecy variables and phase splitting for completeness, the synthesis of refinement mappings and invariants, automated non-blocking checks, and approximate refinement for sampled-data implementations.

Funding

This research received no external funding.

Data Availability Statement

The prototype implementation, the models, the scripts that reproduce Table 3, Table 4 and Table 5 and Figure 4, and all generated verification conditions in SMT-LIB 2 format will be made publicly available in an open repository upon acceptance of this article. They are available from the author upon reasonable request during the review process.

Acknowledgments

During the preparation of this manuscript, the author used Claude (Anthropic) for the purposes of translating and editing the text, drafting parts of the proofs, and implementing the prototype tool. The author has reviewed and edited the output and takes full responsibility for the content of this publication.

Conflicts of Interest

The author declares no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
CPS cyber-physical system
d L differential dynamic logic
dRL differential refinement logic
HIOA hybrid I/O automata
LRA linear real arithmetic
ODE ordinary differential equation
QF quantifier-free
SMT satisfiability modulo theories
VC verification condition

Appendix A. Complete Models

All discrete variables have derivative 0 in every phase invariant ( π ˙ = a c ˙ = d ˙ = 0 ), which is omitted below. In transitions, variables of the module that are not mentioned keep their values ( x ′ = x ). Phase invariants are written as inv φ ∥ flow φ .
Table A1. The abstract controller TEMP A : V = { θ , a c , d , π , z } , L = { π , z } , type ( π ) = type ( a c ) = type ( d ) = { 0 , 1 } , Act = { open , close } , Θ ≡ π = 0 ∧ a c = 0 ∧ d = 0 ∧ z = 0 ∧ 20 ≤ θ ≤ 26 .
Table A1. The abstract controller TEMP A : V = { θ , a c , d , π , z } , L = { π , z } , type ( π ) = type ( a c ) = type ( d ) = { 0 , 1 } , Act = { open , close } , Θ ≡ π = 0 ∧ a c = 0 ∧ d = 0 ∧ z = 0 ∧ 20 ≤ θ ≤ 26 .
COOL π = 0 ∧ a c = 0 ∧ ( θ ≤ 26 ∨ d = 1 ) ∧ θ ≤ 35 ∥ z ˙ = 1 ∧ 0 ≤ θ ˙ ≤ 2
HOT π = 1 ∧ a c = 1 ∧ d = 0 ∧ z ≤ 10 ∥ z ˙ = 1 ∧ − 5 ≤ θ ˙ ≤ 1
on ( ε ) π = 0 ∧ d = 0 ∧ θ ≥ 26 ∧ π ′ = 1 ∧ a c ′ = 1 ∧ z ′ = 0
off ( ε ) π = 1 ∧ θ ≤ 24 ∧ π ′ = 0 ∧ a c ′ = 0 ∧ z ′ = 0
open ( open ) d = 0 ∧ d ′ = 1 ∧ π ′ = 0 ∧ a c ′ = 0 ∧ z ′ = 0
close 1 ( close ) π = 0 ∧ d = 1 ∧ θ ≤ 26 ∧ d ′ = 0
close 2 ( close ) π = 0 ∧ d = 1 ∧ θ ≥ 26 ∧ d ′ = 0 ∧ π ′ = 1 ∧ a c ′ = 1 ∧ z ′ = 0
TEMP B is obtained from TEMP A by replacing z with r : z ˙ = 1 becomes r ˙ = − 1 , z ≤ 10 becomes r ≥ 0 , every reset z ′ = 0 becomes r ′ = 10 , and z = 0 in Θ becomes r = 10 .
Table A2. The concrete controller TEMP C : V = { θ , a c , d , π , c } , L = { π , c } , type ( π ) = { 0 , 1 , 2 } , type ( a c ) = type ( d ) = { 0 , 1 } , Act = { open , close } , Θ ≡ π = 0 ∧ a c = 0 ∧ d = 0 ∧ c = 0 ∧ 20 ≤ θ ≤ 26 .
Table A2. The concrete controller TEMP C : V = { θ , a c , d , π , c } , L = { π , c } , type ( π ) = { 0 , 1 , 2 } , type ( a c ) = type ( d ) = { 0 , 1 } , Act = { open , close } , Θ ≡ π = 0 ∧ a c = 0 ∧ d = 0 ∧ c = 0 ∧ 20 ≤ θ ≤ 26 .
COOL π = 0 ∧ a c = 0 ∧ ( θ ≤ 26 ∨ d = 1 ) ∧ θ ≤ 35 ∥ c ˙ = 1 ∧ 0 ≤ θ ˙ ≤ 2
HOT π = 1 ∧ a c = 1 ∧ d = 0 ∧ c ≤ 5 ∥ c ˙ = 1 ∧ − 1 ≤ θ ˙ ≤ 1
VHOT π = 2 ∧ a c = 1 ∧ d = 0 ∧ c ≤ 5 ∥ c ˙ = 1 ∧ − 5 ≤ θ ˙ ≤ − 4
on ( ε ) π = 0 ∧ d = 0 ∧ θ ≥ 26 ∧ π ′ = 1 ∧ a c ′ = 1 ∧ c ′ = 0
escalate ( ε ) π = 1 ∧ c = 5 ∧ π ′ = 2 ∧ a c ′ = 1 ∧ c ′ = 0
off 1 ( ε ) π = 1 ∧ θ ≤ 24 ∧ π ′ = 0 ∧ a c ′ = 0 ∧ c ′ = 0
off 2 ( ε ) π = 2 ∧ θ ≤ 24 ∧ π ′ = 0 ∧ a c ′ = 0 ∧ c ′ = 0
open ( open ) d = 0 ∧ d ′ = 1 ∧ π ′ = 0 ∧ a c ′ = 0 ∧ c ′ = 0
close 1 ( close ) π = 0 ∧ d = 1 ∧ θ ≤ 26 ∧ d ′ = 0
close 2 ( close ) π = 0 ∧ d = 1 ∧ θ ≥ 26 ∧ d ′ = 0 ∧ π ′ = 1 ∧ a c ′ = 1 ∧ c ′ = 0
Table A3. The door DOOR : V = { d , w } , L = { w } , type ( d ) = { 0 , 1 } , Act = { open , close } , Θ ≡ d = 0 ∧ w = 0 .
Table A3. The door DOOR : V = { d , w } , L = { w } , type ( d ) = { 0 , 1 } , Act = { open , close } , Θ ≡ d = 0 ∧ w = 0 .
CLOSED d = 0 ∥ w ˙ = 1
OPEN d = 1 ∧ w ≤ 30 ∥ w ˙ = 1
open ( open ) d = 0 ∧ d ′ = 1 ∧ w ′ = 0
close ( close ) d = 1 ∧ d ′ = 0 ∧ w ′ = 0

References

  1. Vaandrager, F.W. Hybrid Systems. In Images of SMC Research 1996; Stichting Mathematisch Centrum: Amsterdam, The Netherlands, 1996; pp. 305–316. [Google Scholar]
  2. Alur, R. Principles of Cyber-Physical Systems; MIT Press: Cambridge, MA, USA, 2015. [Google Scholar]
  3. Maler, O.; Manna, Z.; Pnueli, A. From Timed to Hybrid Systems. In Proceedings of the Real-Time: Theory in Practice, REX Workshop, Berlin/Heidelberg, Germany; Lecture Notes in Computer Science; 1992; Vol. 600, pp. 447–484. [Google Scholar] [CrossRef]
  4. Kesten, Y.; Manna, Z.; Pnueli, A. Verification of Clocked and Hybrid Systems. Acta Inform. 2000, 36, 837–912. [Google Scholar] [CrossRef]
  5. Alur, R.; Courcoubetis, C.; Henzinger, T.A.; Ho, P.H. Hybrid Automata: An Algorithmic Approach to the Specification and Verification of Hybrid Systems. In Proceedings of the Hybrid Systems, Berlin/Heidelberg, Germany, 1993; Lecture Notes in Computer Science. Vol. 736, pp. 209–229. [Google Scholar] [CrossRef] [PubMed]
  6. Alur, R.; Courcoubetis, C.; Halbwachs, N.; Henzinger, T.A.; Ho, P.H.; Nicollin, X.; Olivero, A.; Sifakis, J.; Yovine, S. The Algorithmic Analysis of Hybrid Systems. Theor. Comput. Sci. 1995, 138, 3–34. [Google Scholar] [CrossRef]
  7. Henzinger, T.A. The Theory of Hybrid Automata. In Proceedings of the 11th Annual IEEE Symposium on Logic in Computer Science (LICS 1996), New Brunswick, NJ, USA, 1996; pp. 278–292. [Google Scholar] [CrossRef]
  8. Lynch, N.; Segala, R.; Vaandrager, F.; Weinberg, H.B. Hybrid I/O Automata. In Proceedings of the Hybrid Systems III; Lecture Notes in Computer Science; Berlin/Heidelberg, Germany, 1996; Vol. 1066, pp. 496–510. [Google Scholar] [CrossRef]
  9. Lynch, N.; Segala, R.; Vaandrager, F. Hybrid I/O Automata. Inf. Comput. 2003, 185, 105–157. [Google Scholar] [CrossRef]
  10. Milner, R. Communication and Concurrency; Prentice Hall: Hemel Hempstead, UK, 1989. [Google Scholar]
  11. Abadi, M.; Lamport, L. The Existence of Refinement Mappings. Theor. Comput. Sci. 1991, 82, 253–284. [Google Scholar] [CrossRef]
  12. Barrett, C.; Fontaine, P.; Tinelli, C. The SMT-LIB Standard: Version 2.6; Technical report; Department of Computer Science, The University of Iowa, Iowa City, IA, USA, 2017. [Google Scholar]
  13. Manna, Z.; Pnueli, A. Temporal Verification of Reactive Systems: Safety; Springer: New York, NY, USA, 1995. [Google Scholar]
  14. Bjørner, N.; Manna, Z.; Sipma, H.; Uribe, T. Deductive Verification of Real-Time Systems Using STeP. Theor. Comput. Sci. 2001, 253, 27–60. [Google Scholar] [CrossRef]
  15. Henzinger, T.A.; Manna, Z.; Pnueli, A. Timed Transition Systems. In Proceedings of the Real-Time: Theory in Practice, REX Workshop, Berlin/Heidelberg, Germany; Lecture Notes in Computer Science; 1992; Vol. 600, pp. 226–251. [Google Scholar] [CrossRef]
  16. Lamport, L. The Temporal Logic of Actions. ACM Trans. Program. Lang. Syst. 1994, 16, 872–923. [Google Scholar] [CrossRef]
  17. Lynch, N.; Vaandrager, F. Forward and Backward Simulations: Part I. Untimed Systems. Inf. Comput. 1995, 121, 214–233. [Google Scholar] [CrossRef]
  18. Gawlick, R.; Segala, R.; Søgaard-Andersen, J.; Lynch, N. Liveness in Timed and Untimed Systems. Inf. Comput. 1998, 141, 119–171. [Google Scholar] [CrossRef]
  19. Alur, R.; Henzinger, T.A. Modularity for Timed and Hybrid Systems. In Proceedings of the CONCUR ’97: Concurrency Theory, Berlin/Heidelberg, Germany, 1997; Lecture Notes in Computer Science. Vol. 1243, pp. 74–88. [Google Scholar] [CrossRef] [PubMed]
  20. Back, R.J.; von Wright, J. Refinement Calculus: A Systematic Introduction; Springer: New York, NY, USA, 1998. [Google Scholar]
  21. Rönkkö, M.; Ravn, A.P.; Sere, K. Hybrid Action Systems. Theor. Comput. Sci. 2003, 290, 937–973. [Google Scholar] [CrossRef]
  22. Abrial, J.R. Modeling in Event-B: System and Software Engineering; Cambridge University Press: Cambridge, UK, 2010. [Google Scholar]
  23. Abrial, J.R.; Su, W.; Zhu, H. Formalizing Hybrid Systems with Event-B. In Proceedings of the Abstract State Machines, Alloy, B, VDM, and Z (ABZ 2012), Berlin/Heidelberg, Germany, 2012; Lecture Notes in Computer Science. Vol. 7316, pp. 178–193. [Google Scholar] [CrossRef]
  24. Banach, R.; Butler, M.; Qin, S.; Verma, N.; Zhu, H. Core Hybrid Event-B I: Single Hybrid Event-B Machines. Sci. Comput. Program. 2015, 105, 92–123. [Google Scholar] [CrossRef]
  25. Dupont, G.; Aït-Ameur, Y.; Pantel, M.; Singh, N.K. Proof-Based Approach to Hybrid Systems Development: Dynamic Logic and Event-B. In Proceedings of the Abstract State Machines, Alloy, B, TLA, VDM, and Z (ABZ 2018), Cham, Switzerland, 2018; Lecture Notes in Computer Science. Vol. 10817, pp. 155–170. [Google Scholar] [CrossRef] [PubMed]
  26. Platzer, A. Differential Dynamic Logic for Hybrid Systems. J. Autom. Reason. 2008, 41, 143–189. [Google Scholar] [CrossRef]
  27. Platzer, A. Logical Foundations of Cyber-Physical Systems; Springer: Cham, Switzerland, 2018. [Google Scholar]
  28. Fulton, N.; Mitsch, S.; Quesel, J.D.; Völp, M.; Platzer, A. KeYmaera X: An Axiomatic Tactical Theorem Prover for Hybrid Systems. In Proceedings of the Automated Deduction – CADE-25, Cham, Switzerland, 2015; Lecture Notes in Computer Science. Vol. 9195, pp. 527–538. [Google Scholar] [CrossRef]
  29. Loos, S.M.; Platzer, A. Differential Refinement Logic. In Proceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer Science (LICS 2016), New York, NY, USA, 2016; pp. 505–514. [Google Scholar] [CrossRef]
  30. Mitsch, S.; Platzer, A. ModelPlex: Verified Runtime Validation of Verified Cyber-Physical System Models. Form. Methods Syst. Des. 2016, 49, 33–74. [Google Scholar] [CrossRef]
  31. Liu, J.; Lv, J.; Quan, Z.; Zhan, N.; Zhao, H.; Zhou, C.; Zou, L. A Calculus for Hybrid CSP. In Proceedings of the Programming Languages and Systems (APLAS 2010), Berlin/Heidelberg, Germany, 2010; Lecture Notes in Computer Science. Vol. 6461, pp. 1–15. [Google Scholar]
  32. Hoare, C.A.R. Communicating Sequential Processes; Prentice Hall: Englewood Cliffs, NJ, USA, 1985. [Google Scholar]
  33. Hoare, C.A.R.; He, J. Unifying Theories of Programming; Prentice Hall: London, UK, 1998. [Google Scholar]
  34. Foster, S. Hybrid Relations in Isabelle/UTP. In Proceedings of the Unifying Theories of Programming (UTP 2019), Cham, Switzerland, 2019; Lecture Notes in Computer Science. Vol. 11885, pp. 130–153. [Google Scholar] [CrossRef]
  35. Girard, A.; Pappas, G.J. Approximation Metrics for Discrete and Continuous Systems. IEEE Trans. Autom. Control 2007, 52, 782–798. [Google Scholar] [CrossRef]
  36. Tabuada, P. Verification and Control of Hybrid Systems: A Symbolic Approach; Springer: New York, NY, USA, 2009. [Google Scholar]
  37. Benveniste, A.; Caillaud, B.; Nickovic, D.; Passerone, R.; Raclet, J.B.; Reinkemeier, P.; Sangiovanni-Vincentelli, A.; Damm, W.; Henzinger, T.A.; Larsen, K.G. Contracts for System Design. Found. Trends Electron. Des. Autom. 2018, 12, 124–400. [Google Scholar] [CrossRef]
  38. Puri, A.; Varaiya, P. Decidability of Hybrid Systems with Rectangular Differential Inclusions. In Proceedings of the Computer Aided Verification (CAV ’94), Berlin/Heidelberg, Germany, 1994; Lecture Notes in Computer Science. Vol. 818, pp. 95–104. [Google Scholar] [CrossRef] [PubMed]
  39. Henzinger, T.A.; Kopke, P.W.; Puri, A.; Varaiya, P. What’s Decidable about Hybrid Automata? J. Comput. Syst. Sci. 1998, 57, 94–124. [Google Scholar] [CrossRef]
  40. Lafferriere, G.; Pappas, G.J.; Yovine, S. A New Class of Decidable Hybrid Systems. In Proceedings of the Hybrid Systems: Computation and Control (HSCC ’99), Berlin/Heidelberg, Germany, 1999; Lecture Notes in Computer Science. Vol. 1569, pp. 137–151. [Google Scholar] [CrossRef] [PubMed]
  41. Alur, R.; Dill, D.L. A Theory of Timed Automata. Theor. Comput. Sci. 1994, 126, 183–235. [Google Scholar] [CrossRef]
  42. Frehse, G.; Le Guernic, C.; Donzé, A.; Cotton, S.; Ray, R.; Lebeltel, O.; Ripado, R.; Girard, A.; Dang, T.; Maler, O. SpaceEx: Scalable Verification of Hybrid Systems. In Proceedings of the Computer Aided Verification (CAV 2011), Berlin/Heidelberg, Germany, 2011; Lecture Notes in Computer Science. Vol. 6806, pp. 379–395. [Google Scholar] [CrossRef]
  43. Chen, X.; Ábrahám, E.; Sankaranarayanan, S. Flow*: An Analyzer for Non-linear Hybrid Systems. In Proceedings of the Computer Aided Verification (CAV 2013), Berlin/Heidelberg, Germany, 2013; Lecture Notes in Computer Science. Vol. 8044, pp. 258–263. [Google Scholar] [CrossRef]
  44. Schrijver, A. Theory of Linear and Integer Programming; Wiley: Chichester, UK, 1986. [Google Scholar]
  45. Dutertre, B.; de Moura, L. A Fast Linear-Arithmetic Solver for DPLL(T). In Proceedings of the Computer Aided Verification (CAV 2006), Berlin/Heidelberg, Germany, 2006; Lecture Notes in Computer Science. Vol. 4144, pp. 81–94. [Google Scholar] [CrossRef] [PubMed]
  46. de Moura, L.; Bjørner, N. Z3: An Efficient SMT Solver. In Proceedings of the Tools and Algorithms for the Construction and Analysis of Systems (TACAS 2008), Berlin/Heidelberg, Germany, 2008; Lecture Notes in Computer Science. Vol. 4963, pp. 337–340. [Google Scholar] [CrossRef]
  47. Barbosa, H.; Barrett, C.; Brain, M.; Kremer, G.; Lachnitt, H.; Mann, M.; Mohamed, A.; Mohamed, M.; Niemetz, A.; Nötzli, A.; et al. cvc5: A Versatile and Industrial-Strength SMT Solver. In Proceedings of the Tools and Algorithms for the Construction and Analysis of Systems (TACAS 2022), Cham, Switzerland, 2022; Lecture Notes in Computer Science. Vol. 13243, pp. 415–442. [Google Scholar] [CrossRef]
  48. Jovanović, D.; de Moura, L. Solving Non-linear Arithmetic. In Proceedings of the Automated Reasoning (IJCAR 2012), Berlin/Heidelberg, Germany, 2012; Lecture Notes in Computer Science. Vol. 7364, pp. 339–354. [Google Scholar] [CrossRef]
  49. Tarski, A. A Decision Method for Elementary Algebra and Geometry, 2nd ed.; University of California Press: Berkeley, CA, USA, 1951. [Google Scholar]
  50. Prajna, S.; Jadbabaie, A. Safety Verification of Hybrid Systems Using Barrier Certificates. In Proceedings of the Hybrid Systems: Computation and Control (HSCC 2004), Berlin/Heidelberg, Germany, 2004; Lecture Notes in Computer Science. Vol. 2993, pp. 477–492. [Google Scholar] [CrossRef]
  51. Gao, S.; Kong, S.; Clarke, E.M. dReal: An SMT Solver for Nonlinear Theories over the Reals. In Proceedings of the Automated Deduction – CADE-24, Berlin/Heidelberg, Germany, 2013; Lecture Notes in Computer Science. Vol. 7898, pp. 208–214. [Google Scholar] [CrossRef]
Figure 1. The abstract controller TEMP A (top) and the door DOOR (bottom). A transition is annotated with its name, its synchronisation action in brackets (omitted for internal transitions), its guard and its updates; variables that are not updated keep their values. The single transition open is enabled in both modes and is therefore drawn twice.
Figure 1. The abstract controller TEMP A (top) and the door DOOR (bottom). A transition is annotated with its name, its synchronisation action in brackets (omitted for internal transitions), its guard and its updates; variables that are not updated keep their values. The single transition open is enabled in both modes and is therefore drawn twice.
Preprints 246486 g001
Figure 2. The concrete controller TEMP C . The abstract mode HOT is split into HOT and VHOT. The transition open is enabled in every mode; only its edge from VHOT is drawn. The transitions close 1 (to COOL) and close 2 (to HOT) are as in Figure 1 with z replaced by c ; they are omitted for readability (see Table A2).
Figure 2. The concrete controller TEMP C . The abstract mode HOT is split into HOT and VHOT. The transition open is enabled in every mode; only its edge from VHOT is drawn. The transitions close 1 (to COOL) and close 2 (to HOT) are as in Figure 1 with z replaced by c ; they are omitted for readability (see Table A2).
Preprints 246486 g002
Figure 3. A concrete computation of TEMP C (bottom: concrete clock c ) and its image under α C (middle: abstract clock z ). The transition on at t = 3 and off 2 at t = 11 correspond to the abstract transitions on and off ; the internal transition escalate at t = 8 corresponds to abstract stuttering, and z stays below the abstract deadline 10.
Figure 3. A concrete computation of TEMP C (bottom: concrete clock c ) and its image under α C (middle: abstract clock z ). The transition on at t = 3 and off 2 at t = 11 correspond to the abstract transitions on and off ; the internal transition escalate at t = 8 corresponds to abstract stuttering, and z stays below the abstract deadline 10.
Preprints 246486 g003
Figure 4. Verification time for N rooms (logarithmic scale; data of Table 5).
Figure 4. Verification time for N rooms (logarithmic scale; data of Table 5).
Preprints 246486 g004
Table 1. Comparison with related refinement frameworks for hybrid systems (qualitative; “trace” means external/observable trace inclusion).
Table 1. Comparison with related refinement frameworks for hybrid systems (qualitative; “trace” means external/observable trace inclusion).
Framework Refinement notion Continuous behaviour in refinement proofs Composition Discharge of obligations
Hybrid I/O automata [9] trace inclusion via simulation relations matching of trajectories by execution fragments composition theorems mostly manual or interactive
Refinement mappings / TLA [11,16] stuttering-invariant trace inclusion discrete or real-time view via composition of specifications manual or interactive
Hybrid action systems [21] predicate-transformer refinement differential actions in the calculus refinement calculus laws calculational
Event-B family [22,24,25] refinement with gluing invariants discretised, pliant events, or d L decomposition proof obligations in a theorem prover
dRL / KeYmaera X [28,29] refinement of hybrid programs (reachability relations) differential invariants, nonlinear ODEs program composition interactive and automated proof
Approximate (bi)simulation [35] metric closeness of traces simulation functions interconnection results numerical / optimisation
This work observable-trajectory inclusion (time-preserving) flow derivative of the mapping; pointwise conditions rule-level compositionality for ‖ automatic (QF linear real arithmetic for linear modules)
Table 2. The water-level monitor WLM C  [6] and its abstract specification WLM A . Transition t i j leads from mode i to mode j ( π ′ = π + 1 mod 4 ); all transitions are internal; unmentioned variables are unchanged; π ˙ = m ˙ = 0 is omitted.
Table 2. The water-level monitor WLM C  [6] and its abstract specification WLM A . Transition t i j leads from mode i to mode j ( π ′ = π + 1 mod 4 ); all transitions are internal; unmentioned variables are unchanged; π ˙ = m ˙ = 0 is omitted.
WLM C : V = { y , x , π } , L = { x , π } , Θ ≡ π = 0 ∧ y = 1 ∧ x = 0
mode 0 π = 0 ∧ y ≤ 10 ∥ y ˙ = 1 ∧ x ˙ = 1
mode 1 π = 1 ∧ x ≤ 2 ∥ y ˙ = 1 ∧ x ˙ = 1
mode 2 π = 2 ∧ y ≥ 5 ∥ y ˙ = − 2 ∧ x ˙ = 1
mode 3 π = 3 ∧ x ≤ 2 ∥ y ˙ = − 2 ∧ x ˙ = 1
t 01 , t 12 , t 23 , t 30 y = 10 ∧ x ′ = 0 ;    x = 2 ;    y = 5 ∧ x ′ = 0 ;    x = 2
WLM A : V = { y , m } , L = { m } , Θ ≡ m = 0 ∧ y = 1
RISE m = 0 ∧ y ≤ 12 ∥ y ˙ = 1
FALL m = 1 ∧ y ≥ 1 ∥ y ˙ = − 2
down , up m = 0 ∧ y ≥ 10 ∧ m ′ = 1 ;    m = 1 ∧ y ≤ 5 ∧ m ′ = 0
Table 3. Verification conditions for the case studies (A: admissibility of α ; I: invariant conditions (I1)–(I3); R0–R3: premises of Ref). Times are medians of five runs of our procedure. For the tank, the two (R2) VCs are in QF_NRA and are discharged by Z3 (Section 6.5).
Table 3. Verification conditions for the case studies (A: admissibility of α ; I: invariant conditions (I1)–(I3); R0–R3: premises of Ref). Times are medians of five runs of our procedure. For the tank, the two (R2) VCs are in QF_NRA and are discharged by Z3 (Section 6.5).
Refinement A I R0 R1 R2 R3 Total All Valid Time (ms)
TEMP B ⊑ TEMP A (one-to-one) 1 – 1 1 2 5 10 yes 66.9
TEMP C ⊑ TEMP A (many-to-one) 7 – 1 1 3 7 19 yes 125.6
WLM C ⊑ WLM A (with I WLM ) 11 13 1 1 4 4 34 yes 37.0
H h C ⊑ H A (history h , invariant I ) 1 4 1 1 1 2 10 yes 17.1
TANK N ⊑ TANK R (nonlinear) 1 – 1 1 2* 2 7 yes 6.7†
* in QF_NRA, checked by Z3. † time of the five linear VCs; the Z3 times are reported in the text.
Table 4. Seeded faults and the failing verification conditions. The counterexamples are shown for the relevant variables only.
Table 4. Seeded faults and the failing verification conditions. The counterexamples are shown for the relevant variables only.
Id Fault Failing VC Counterexample Time (ms)
M1 cooling rate of VHOT widened to [ − 6 , − 4 ] R2, phase VHOT π = 2 , c = 4 , θ ˙ = − 11 / 2 125.6
M2 invariant of VHOT relaxed to c ≤ 6 R2, phase VHOT π = 2 , c = 11 / 2 121.9
M3 escalate does not reset c R3, escalate π = 1 , c = 5 , π ′ = 2 , c ′ = 5 127.0
M4 guard of on weakened to θ ≥ 25 R3, on π = 0 , θ = θ ′ = 51 / 2 , π ′ = 1 121.0
M5 initial range of θ widened to [ 20 , 27 ] R1 θ = 53 / 2 125.0
M6 compressor switched off in VHOT ( a c = 0 ) R2, phase VHOT π = 2 , a c = 0 , c = 4 114.1
M7 TANK R : FILL rate bound 0.8 tightened to 0.9 R2, phase FILL (QF_NRA) y = 10 , s = 10 (Z3) –
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.