A Framework for Contract-Based Reasoning: Motivation and Application Sophie Quinton and Susanne Graf VERIMAG, Universit´ e Joseph Fourier FLACOS, Malta, November 28th, 2008
Outline 1 Introduction 2 A definition of contract-based verification framework 3 One application: a generic sufficient condition for dominance 4 Application to interface Input/Output automata 5 Conclusion and future work 2 / 25
1 Introduction 2 A definition of contract-based verification framework 3 One application: a generic sufficient condition for dominance 4 Application to interface Input/Output automata 5 Conclusion and future work 3 / 25
Introduction Interface (or contract-based) theories A huge number of interface (or contract-based) theories have been developed (Henzinger, Larsen etc.) Specific to a notion of behavior Specific to a notion of interaction between components Our approach What do these theories have in common? The BIP (Behavior, Interaction, Priority) framework clearly separates the notion of behavior from the notion of interaction. BIP allows to represent heterogeneous systems of components, from asynchronous to synchronous systems. We give a definition of contract-based verification framework. 4 / 25
the BIP framework Clearly separates behavior, interaction, priority Behaviors are represented as LTSs or Petri nets Interactions are represented as sets of ports Priorities are a preorder B 2 B 1 B 3 B 1 B 2 B 3 = BIP composition operators are sets of structured connectors which are sets of interactions. Composition is associative and commutative. 5 / 25
1 Introduction 2 A definition of contract-based verification framework 3 One application: a generic sufficient condition for dominance 4 Application to interface Input/Output automata 5 Conclusion and future work 6 / 25
Contract-based verification framework Definition (Contract-based verification framework) A contract-based verification framework is given by a tuple ( B , P , Γ , � . � , θ ), where: B is a set of behaviors ; each behavior B ∈ B has as interface a set of ports denoted P B P = � B ∈B P B Γ is a set of BIP composition operators on subsets of P � . � : Γ × 2 B − → B is a partial function defining a behavior semantics for the composition of behaviors → 2 B×B is a refinement under context θ : B × Γ − 7 / 25
Contract-based verification framework Definition (Contract-based verification framework) A contract-based verification framework is given by a tuple ( B , P , Γ , � . � , θ ), where: B is a set of behaviors ; each behavior B ∈ B has as interface a set of ports denoted P B P = � B ∈B P B Γ is a set of BIP composition operators on subsets of P � . � : Γ × 2 B − → B is a partial function defining a behavior semantics for the composition of behaviors � ( γ, ( B 1 , ... , B n )) � , denoted γ ( B 1 , ... , B n ), is defined iff γ is defined on � n i =1 P B i � . � preserves associativity and commutativity of the BIP composition operators ( γ 3 ( γ 1 , 2 ( B 1 , B 2 ) , B 3 ) = γ 1 ( B 1 , γ 2 , 3 ( B 2 , B 3 )) etc.) → 2 B×B is a refinement under context θ : B × Γ − 7 / 25
Contract-based verification framework Definition (Contract-based verification framework) A contract-based verification framework is given by a tuple ( B , P , Γ , � . � , θ ), where: B is a set of behaviors ; each behavior B ∈ B has as interface a set of ports denoted P B P = � B ∈B P B Γ is a set of BIP composition operators on subsets of P � . � : Γ × 2 B − → B is a partial function defining a behavior semantics for the composition of behaviors → 2 B×B is a refinement under context θ : B × Γ − In the following we suppose given a contract-based verification framework ( B , P , Γ , � . � , θ ). 7 / 25
Refinement under context Definition (Context for an interface) Let P ∈ 2 P be an interface. A context for P is a pair ( E , γ ) where E is such that P ∩ P E = ∅ and γ is a composition operator defined on P ⊔ P E . 8 / 25
Refinement under context Definition (Context for an interface) Let P ∈ 2 P be an interface. A context for P is a pair ( E , γ ) where E is such that P ∩ P E = ∅ and γ is a composition operator defined on P ⊔ P E . E 8 / 25
Refinement under context Definition (Context for an interface) Let P ∈ 2 P be an interface. A context for P is a pair ( E , γ ) where E is such that P ∩ P E = ∅ and γ is a composition operator defined on P ⊔ P E . ��������� ��������� ��������� ��������� ��������� ��������� E ��������� ��������� ��������� ��������� ��������� ��������� ��������� ��������� 8 / 25
Refinement under context Definition (Context for an interface) Let P ∈ 2 P be an interface. A context for P is a pair ( E , γ ) where E is such that P ∩ P E = ∅ and γ is a composition operator defined on P ⊔ P E . ��������� ��������� ��������� ��������� ��������� ��������� E ��������� ��������� ��������� ��������� ��������� ��������� ��������� ��������� Definition (Refinement under context) → 2 B×B is a partial function s.t. A refinement under context θ : B × Γ − For each context ( E , γ ) for an interface P , θ ( E , γ ), denoted ⊑ E ,γ , is a reflexive and transitive binary relation over the set of behaviors with associated set of ports P B . θ is monotonic w.r.t composition as defined on the next slide. 8 / 25
Monotony of refinement under context Definition (Monotony of refinement under context) θ is monotonic w.r.t. composition iff the following holds for any interface P and any context ( E , γ ) for P such that E is of the form γ E ( E 1 , E 2 ). For all B 1 , B 2 behaviors on P : B 1 ⊑ E ,γ B 2 = ⇒ γ 1 ( B 1 , E 1 ) ⊑ E 2 ,γ 2 γ 1 ( B 2 , E 1 ) where γ 1 and γ 2 are calculated from γ and γ E for respectively P ⊔ P E 1 and P ⊔ P E 1 ⊔ P E 2 . 9 / 25
Monotony of refinement under context Definition (Monotony of refinement under context) θ is monotonic w.r.t. composition iff the following holds for any interface P and any context ( E , γ ) for P such that E is of the form γ E ( E 1 , E 2 ). For all B 1 , B 2 behaviors on P : B 1 ⊑ E ,γ B 2 = ⇒ γ 1 ( B 1 , E 1 ) ⊑ E 2 ,γ 2 γ 1 ( B 2 , E 1 ) where γ 1 and γ 2 are calculated from γ and γ E for respectively P ⊔ P E 1 and P ⊔ P E 1 ⊔ P E 2 . �������� �������� ��������� ��������� ��������� ��������� �������� �������� �������� �������� ��������� ��������� E 1 B 2 �������� �������� E 2 ��������� ��������� ��������� ��������� �������� �������� �������� �������� ��������� ��������� ��������� ��������� �������� �������� �������� �������� �������� �������� B 1 9 / 25
Monotony of refinement under context Definition (Monotony of refinement under context) θ is monotonic w.r.t. composition iff the following holds for any interface P and any context ( E , γ ) for P such that E is of the form γ E ( E 1 , E 2 ). For all B 1 , B 2 behaviors on P : B 1 ⊑ E ,γ B 2 = ⇒ γ 1 ( B 1 , E 1 ) ⊑ E 2 ,γ 2 γ 1 ( B 2 , E 1 ) where γ 1 and γ 2 are calculated from γ and γ E for respectively P ⊔ P E 1 and P ⊔ P E 1 ⊔ P E 2 . �������� �������� �������� �������� ��������� ��������� ��������� ��������� �������� �������� �������� �������� �������� �������� �������� �������� ��������� ��������� E 1 E 1 E 2 B 2 �������� �������� E 2 B 2 �������� �������� ��������� ��������� ��������� ��������� �������� �������� �������� �������� �������� �������� �������� �������� ��������� ��������� ��������� ��������� �������� �������� �������� �������� �������� �������� �������� �������� �������� �������� �������� �������� ⇒ = B 1 E 1 B 1 9 / 25
Recommend
More recommend