Toward heterogeneous specifications Linking institutions with each other . . . various maps between institutions. . . Andrzej Tarlecki: Abstract Specificiation Theory, 2009 - 253 -
✗ ✎ ✔ ✍ ☞ ✖ INS Institution morphism: µ : I − → I ′ ✌ ✬ ✩ ✬ ✩ ✕ ✤ ✜ ✤ ✜ ☛ ✟ ☛ ✟ µ ✡ ✠ ✡ ✠ Sen ′ Sen ✣ ✢ ✛ ✣ ✢ µ ( ϕ ′ ) • ϕ ′ • ✫ ✪ ✫ ✪ ❇ ✂ ❇ ✂ ❇ ✂ ❇ ✂ ❇ ✂ ❇ ✂ ✓ ✏ ✓ ✏ ❇ ✂ ❇ ✂ ❇ ✂ ❇ ✂ µ ✒ ❇ ✂ ✑ ✒ ❇ ✂ ✑ Sign ′ • • µ (Σ) Sign Σ ✲ ✂ ❇ ✂ ❇ ✂ ❇ ✂ ❇ ✂ ❇ ✂ ❇ ✬ ✩ ✬ ✩ ✤ ✜ ✤ ✜ ✂ ❇ ✂ ❇ ☛ ✟ ☛ ✟ ✂ ❇ ✂ ❇ ✂ ❇ ✂ ❇ ✡ ✠ ✡ ✠ µ • • µ ( M ) M Mod ′ Mod ✣ ✢ ✲ ✣ ✢ ✫ ✪ ✫ ✪ with the satisfaction condition lurking again: = ′ ϕ ′ M | = µ ( ϕ ) iff µ ( M ) | Andrzej Tarlecki: Abstract Specificiation Theory, 2009 - 254 -
✗ ✎ ✍ ✖ ✔ ☞ co INS Institution comorphism: ρ : I − → I ′ ✬ ✩ ✬ ✩ ✌ ✤ ✜ ✤ ✜ ✕ ☛ ✟ ☛ ✟ ρ ✡ ✠ ✡ ✠ Sen ′ Sen ✣ ✢ ✲ ✣ ✢ ϕ • • ρ ( ϕ ) ✫ ✪ ✫ ✪ ❇ ✂ ❇ ✂ ❇ ✂ ❇ ✂ ❇ ✂ ❇ ✂ ✓ ✏ ✓ ✏ ❇ ✂ ❇ ✂ ❇ ✂ ❇ ✂ ρ ✒ ❇ ✂ ✑ ✒ ❇ ✂ ✑ Sign ′ • • Σ ′ Sign Σ ✲ ✂ ❇ ✂ ❇ ✂ ❇ ✂ ❇ ✂ ❇ ✂ ❇ ✬ ✩ ✬ ✩ ✤ ✜ ✤ ✜ ✂ ❇ ✂ ❇ ☛ ✟ ☛ ✟ ✂ ❇ ✂ ❇ ✂ ❇ ✂ ❇ ✡ ✠ ✡ ✠ ρ ρ ( M ′ ) • • M ′ Mod ′ Mod ✣ ✢ ✛ ✣ ✢ ✫ ✪ ✫ ✪ with the satisfaction condition lurking again: = ϕ iff M ′ | = ′ ρ ( ϕ ) ρ ( M ′ ) | Andrzej Tarlecki: Abstract Specificiation Theory, 2009 - 255 -
Moving between institutions: a taxonomy of maps − Sen ′ Sen ′ Sen ← Sen morphisms µ semi-morphisms µ → Sign ′ → Sign ′ Sign − Sign − → Mod ′ → Mod ′ Mod − Mod − → Sen ′ Sen ′ Sen − Sen comorphisms ρ semi-comorphisms ρ → Sign ′ → Sign ′ Sign − Sign − − Mod ′ − Mod ′ Mod ← Mod ← → Sen ′ Sen − forward morphisms → Sign ′ Sign − ★ ✥ → Mod ′ Mod − ✤ ✜ − Sen ′ Sen ← forward comorphisms → Sign ′ plus theoroidal versions, Sign − − Mod ′ Mod ← ✣ ✢ plus weak versions, plus . . . ✧ ✦ Andrzej Tarlecki: Abstract Specificiation Theory, 2009 - 256 -
Mastering the diversity ☛ ✟ ☛ ✟ Morphism Span of comorphisms ✡ ✠ ✡ ✠ Set Set ✻ ✻ ✻ ✻ ✻ Sen ′ = ✲ α α Sen ′ • Sen ′ Sen Sen ✛ ✛ ✻ Φ Φ = Φ ✲ Sign ( op ) Sign ′ ( op ) Sign ( op ) Sign ( op ) Sign ′ ( op ) ✲ ✛ Φ op ❄ β β ✲ = Mod ′ • Mod ′ Mod Mod ✲ ✛ ☛ ✟ ☛ ✟ Mod ′ ❄ ❄ ❄ ❄ ❄ ✡ ✠ ✡ ✠ Cat Cat Andrzej Tarlecki: Abstract Specificiation Theory, 2009 - 257 -
Heterogeneous logical environments A collection of institutions linked by (forward) (semi-) (co-) morphisms A collection of institutions A diagram HIE in the category co INS linked by comorphisms (of institutions and institution comorphisms) EXAMPLES: • a dozen of logics, one for each kind of UML diagrams • the Hets family of institutions • Mossakowski’s diagram of algebraic and other institutions • . . . Andrzej Tarlecki: Abstract Specificiation Theory, 2009 - 258 -
Given a heterogeneous environment of institutions HIE Heterogeneous specifications • Move to a universal institution UI (encode institutions in HIE using comorphisms into UI , compatible with maps within HIE ; then work in UI ) • Focused heterogeneous specifications (specifications that reside in an institution, but may involve specifications from other institutions in HIE ) • Distributed heterogeneous specifications (specification diagrams over HIE ) Andrzej Tarlecki: Abstract Specificiation Theory, 2009 - 259 -
Focused heterogeneous specifications Translation: introduces new structure to specification models, following s n n o o an institution comorphism ρ : I → I ′ ; for any I -specification SP , i i t t a u c t fi i t Also along institution morphisms ρ ( SP ) i s c n e i p e s l is an I ′ -specification with Sig [ ρ ( SP )] = ρ ( Sig [ SP ]) and g r o n f i Mod [ ρ ( SP )] = { M ′ ∈ | Mod ′ ( ρ ( Sig [ SP ]) | | ρ ( M ′ ) ∈ Mod [ SP ] } . s s a a n g i Hiding: hides extra structure of specification models, following an n h i t h institution morphism µ : I ′ → I ; for any I ′ -specification SP ′ , i t w y r e v e SP ′ µ Also w.r.t. institution comorphisms : y l l a i is an I -specification with Sig [ SP ′ µ ] = µ ( Sig [ SP ′ ]) and t n e s Mod [ SP ′ µ ] = { µ ( M ′ ) | M ′ ∈ Mod [ SP ′ ] } . s E Andrzej Tarlecki: Abstract Specificiation Theory, 2009 - 260 -
Heterogeneous specification (co)morphisms Heterogeneous specification (co)morphism from (simpler) I -specification SP to (richer) I ′ -specification SP ′ � ρ, σ ′ � : SP → SP ′ where ρ : I → I ′ is an institution comorphism, and σ ′ : ρ ( Sig [ SP ]) → Sig [ SP ′ ] is an I ′ -signature morphism such that for all M ′ ∈ Mod [ SP ′ ] , ρ ( M ′ σ ′ ) ∈ Mod [ SP ] This yields a category co HSPEC of heterogeneous specifications over HIE . ✞ ☎ ✝ ✆ . . . Grothendieck construction. . . Andrzej Tarlecki: Abstract Specificiation Theory, 2009 - 261 -
Distributed heterogeneous specifications • A distributed heterogeneous specification HSP is a diagram of heterogeneous specifications in co HSPEC , HSP : J → co HSPEC . Notation: − for i ∈ |J | , HSP i is the specification HSP ( i ) − for e : i → j in J , HSP e = � ρ e , σ e � : HSP i → HSP j is the heterogeneous specification morphism HSP ( e ) . • A distributed heterogeneous model of HSP is a family M = � M i � i ∈|J | of models compatible with HSP . That is, such that − for i ∈ |J | , M i ∈ Mod [ HSP i ] HSP is (globally) consistent − for e : i → j in J , M i = ρ e ( M j σ e ) . if it has a (distributed) model Andrzej Tarlecki: Abstract Specificiation Theory, 2009 - 262 -
Implementing distributed specifications To implement HSP : J → co HSPEC by HSP ′ : J ′ → co HSPEC , provide: • a covering function f : |J | → |J ′ | , and • a distributed constructor κ = � κ i : Mod [ HSP ′ ☛ f ( i ) ] → Mod [ HSP i ] � i ∈|J | . ✟ ✡ ✠ ô HSP ′ So that for each i ∈ |J | , we have HSP i f ( i ) . κ i THEN: ö HSP ′ HSP � κ, f � if for each distributed heterogeneous model M ′ = � M ′ i ′ � i ′ ∈|J ′ | of HSP ′ , κ f ( M ′ ) = � κ i ( M ′ f ( i ) ) � i ∈|J | is a distributed heterogeneous model of HSP . ✤ ✜ STRUCTURE MAY CHANGE! INSTITUTIONS MAY CHANGE! ✣ ✢ WE NEED TO ARRIVE AT A SINGLE “IMPLEMENTATION” INSTITUTION Andrzej Tarlecki: Abstract Specificiation Theory, 2009 - 263 -
“Natural” implementations of distributed specifications For any HSP : J → co HSPEC and HSP ′ : J ′ → co HSPEC , given Fact: • a functor F : J → J ′ • a natural transformation τ : HSP → F ; HSP ′ with τ i = � ρ i , σ i � : HSP i → HSP ′ F ( i ) for i ∈ |J | we have ö HSP ′ HSP � κ, f � where • f = | F | : |J | → |J ′ | σ i ) : Mod [ HSP ′ • κ = � ρ i ( F ( i ) ] → Mod [ HSP i ] � i ∈|J | Andrzej Tarlecki: Abstract Specificiation Theory, 2009 - 264 -
Understanding (distributed) UML specifications UML specifications consist of a number of diagrams of various kinds, each forming a specification in a different logic. NECESSARY TASKS: • Build the heterogeneous logical environment of UML. • Give a meaning to UML heterogeneous distributed specifications in such an environment. Andrzej Tarlecki: Abstract Specificiation Theory, 2009 - 265 -
(Some) UML diagram logics Institution of Static Structures ISS (class diagrams) with: • signatures that name classes, attributes, methods and associations typed as expected, • sentences that essentially are class diagrams, • models that are sets of states and interpret attributes and methods as functions and associations as relations. Institution of Interaction IINT (interaction diagrams) with: • signatures that name classes and messages (typed by classes), • sentences that essentially are interaction diagrams • models that for each interpretation of class names as sets of object instances and messages as sets of message instances, and for each valuation of variables, yield sets of permitted and forbidden traces, respectively. Andrzej Tarlecki: Abstract Specificiation Theory, 2009 - 266 -
Recommend
More recommend