The category of diagrammatic logics Dominique Duval — partly with Christian Lair University of Grenoble IFIP WG 1.3 meeting — June 3., 2006 1
• Motivation • The category of propagators • Specifications, theories, models • Deduction system • Conclusion 2
A category of logics? From the analysis of some computational effects, it follows that the logic of the language (with the effects: state, exception,. . . ) is different from the logic of the user (where the effects are made explicit). The logic of the language provides the syntax and the deduction system, the logic of the user provides the intended model(s), and the soundness of the language with respect to its denotation relies on some link between both logics. Hence, there is a need for some kind of category of logics 3
An example class Account { int balance () const { } void deposit (int) { } } For the language (“decorated” logic): balance const : void → int , deposit : int → void For the user (logic with a distinguished sort “ state ”): balance : state → int , deposit : int × state → state The sort “ state ” corresponds to the set of states of an object in the class “ Account ”. 4
Several solutions! The institutions [Goguen, Burstall 1992] The diagrammatic logics [Duval, Lair 2002] The aim of this talk is to present the framework of diagrammatic logics. It should be clear from this presentation that it is fairly different from the framework of institutions. 5
Abstract • A propagator is a morphism of limit sketches such that the corresponding underlying functor is full and faithful. • A propagator defines a diagrammatic logic: syntax, models, and a sound deduction system. • Propagators with their morphisms give rise to the category of diagrammatic logics. 6
• Motivation • The category of propagators • Specifications, theories, models • Deduction system • Conclusion 7
� � � Limit sketches ( or projective sketches) [Ehresmann, 1965] A limit sketch is a (directed multi-)graph with: • some (potential) identities X id X f � g � Z • some (potential) composed arrows X Y g.f • some (potential) limits ( or distinguished cones), e.g. (potential) binary products X � � � � � X 1 X 2 A morphism of limit sketches is a graph morphism that preserves (potential) identities, composition and limits. LSketch = the category of limit sketches 8
The realizations of a limit sketch A (set-valued) realization Σ of a limit sketch S is a functor Σ : S → Set . It interprets each point as a set, each arrow as a map, and each potential . . . as an actual . . . A morphism of realizations of S is a natural transformation. Real ( S ) = the category of realizations of S 9
� � A limit sketch for graphs sce S gr : Pt Ar tgt Real ( S gr ) ∼ = Graph 10
� � � � � � � A limit sketch for categories sce 1st � � � � � � S cat : Pt � Ar Cons � � � � � � tgt 2nd comp selId sce . selId = id Pt tgt . selId = id Pt with and and axioms. . . sce . 2nd = tgt . 1st Cons � � � � � 1st 2nd � sce . comp = sce . 1st � tgt . comp = tgt . 2nd Ar Ar � � � � � � � � � sce tgt � � Pt Real ( S cat ) ≃ Cat 11
� � � � Propagators A propagator is a morphism of limit sketches P � S S such that the underlying functor U P is full and faithful U P Real ( S ) Real ( S ) A morphism of propagators is a pair of morphisms of limit sketches such that P 1 S 1 S 1 α = α P 2 � S 2 S 2 Propag = the category of propagators 12
� Ehresmann’s theorem Theorem. For every morphism of limit sketches P � S S the underlying functor U P has a left adjoint, the freely generating functor F P F P � Real ( S ) Real ( S ) U P Corollary. P is a propagator if and only if the counit ε P : F P .U P ⇒ Id is a natural isomorphism 13
� � � � � � � � � � A propagator for graphs This inclusion is not a propagator: ⊆ � S cat S gr A limit sketch for “graphs with partial identities and composition” sce 1st � � � � � � S grComp : with. . . Pt Ar Cons � � � � � � tgt 2nd comp selId Pt ′ Cons ′ The second inclusion is a propagator: ⊆ ⊆ � S grComp � S cat S gr P 14
“Typical” propagators “Typically”, a propagator P : S → S may be such that: • S is a sketch of categories with some properties • S is a sketch of graphs with some “potential” properties • P is the inclusion For instance : cartesian categories (and “product” sketches) complete categories (and limit sketches) cartesian categories (and limit sketches with “exponentials”) also: categories of domains, etc. . . “Non-typical” propagators are fairly interesting: e.g., for “decorated” features. 15
• Motivation • The category of propagators • Specifications, theories, models • Deduction system • Conclusion 16
� A propagator is fixed: P � S S P -specifications = realizations of S P -theories = realizations of S F � Theory ( P ) Spec ( P ) U Hom Spec ( P ) (Σ , U (Θ)) ∼ = Hom Theory ( P ) ( F (Σ) , Θ) = Mod P (Σ , Θ) = the set of models of Σ with values in Θ. 17
� � � Models and morphisms of propagators Given: a morphism of propagators P 1 S 1 S 1 α = α P 2 � S 2 S 2 a P 1 -specification Σ 1 and a P 2 -theory Θ 2 . Proposition. Mod P 1 (Σ 1 , U α (Θ 2 )) ∼ = Mod P 2 ( F α (Σ 1 ) , Θ 2 ) Proof. By adjunction. 18
� � � � � � An example P 1 is the decorated logic for exceptions P 2 is the explicit logic for exceptions Θ 2 = Set 0 v Σ 1 = Σ nat . deco : U N s v � � � � � � � � � e c 0 0 F α (Σ 1 ) = Σ nat . expl : U N s � � � � � � � e � E Mod deco (Σ nat . deco , U α ( Set )) ∼ = Mod expl (Σ nat . expl , Set ) 19
Soundness A morphism of P -specifications σ : Σ → Σ ′ Σ ′ if is an entailment σ : Σ − → � ∼ = → F (Σ ′ ) F ( σ ) : F (Σ) Θ Σ ′ (with respect to Θ) if is a consequence σ : Σ − → �� ∼ = ← Mod(Σ ′ ) Mod( σ, Θ) : Mod(Σ) Theorem. Every diagrammatic logic is sound: Σ ′ then σ : Σ − Θ Σ ′ for each Θ if σ : Σ − → → � �� Proof. Mod P (Σ , Θ) = Hom Theory ( P ) ( F (Σ) , Θ). 20
• Motivation • The category of propagators • Specifications, theories, models • Deduction system • Conclusion 21
Propagators are fractional Theorem. Let P be a morphism of limit sketches. Then P is a propagator if and only if, up to equivalence, P is a fractional morphism, i.e., P consists in adding inverses to arrows. [Hebert, Adamek, Rosick´ y 2001], [Gabriel, Zisman 1967] Remark. A propagator describes a logic. A fractional morphism describes a deduction system. “Up to equivalence”: for a given logic, there may be several deduction systems. 22
� Patterns and pattern matchings A pattern is a point in S . A matching m/τ of a pattern S in a specification Σ is made of a morphism of specifications m : Y ( S ) → Σ S and an entailment τ : Σ → Σ S � Y ( S ) m τ � Σ S Σ | 23
� � � � � � � � Elementary inference rules and inference steps An elementary inference rule is an arrow r = t ◦ s − 1 in S , with s and t in S : s | t � C H B An elementary inference step consists in applying rule r to a matching of H in Σ, it builds a matching of C in Σ: Y ( s ) Y ( t ) Y ( H ) Y ( B ) Y ( C ) | � ������������ = m H m B = ( P O ) m C τ H τ Σ H Σ C Σ | | = | τ C 24
Inference rules and derivations An inference rule is an arrow in S . The derivation with respect to an inference rule is generated from the inference steps. The inference functor is the functor I : S → Cat : I Σ( S ) = the category of matchings of S I Σ( r )( m H /τ H ) = m C /τ C 25
� � An example The rule for substitution in equational logic: f ( x ) ≡ g ( x ) a ( R ) f ( a ) ≡ g ( a ) or r = t ◦ s − 1 : in S eq : in Spec ( P eq ): Y ( H ) Y ( C ) H C � ��� � � � � ������� � / � � � s / � � � � t � � Y ( s ) Y ( t ) � B Y ( B ) where: Y ( H ) = { f ( x ) ≡ g ( x ) , a } (the hypothesis of R ) Y ( B ) = { f ( x ) ≡ g ( x ) , a, f ( a ) ≡ g ( a ) } Y ( C ) = { f ( a ) ≡ g ( a ) } (the conclusion of R ) 26
• Motivation • The category of propagators • Specifications, theories, models • Deduction system • Conclusion 27
Conclusion We have got a category of logics. . . 28
Recommend
More recommend