Math::Category
Upcoming SlideShare
Loading in...5
×
 

Math::Category

on

  • 1,548 views

Perlを使って圏論概念をシミュレーション。

Perlを使って圏論概念をシミュレーション。

Statistics

Views

Total Views
1,548
Views on SlideShare
1,468
Embed Views
80

Actions

Likes
1
Downloads
6
Comments
0

1 Embed 80

http://d.hatena.ne.jp 80

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Math::Category Math::Category Presentation Transcript

  • Math::Category id:hiratara 2009-11-21
  • Math::Category (1) ✤ Perl ✤ ✤ ✤
  • Math::Category (2) ✤ ✤ dom, cod, comp ✤ ✤ Hom ✤
  • (1) ✤ ✤ ✤ Morphism interface ✤ source: dom Morphism ✤ target: cod Morphism ✤ composition:
  • (2) ✤ ✤ target source ✤ composition ✤ ✤ ✤
  • (1): SimpleMorphism ✤ 2 1 ✤ simple_morph ‘1’ => ‘2’; ‘1’ ✤ source simple_morph ‘1’ => ‘1’ ‘2’ ✤ target simple_morph ‘2’ => ‘2’ ‘3’ ✤ (simple_morph ‘2’ => ‘3’) . (simple_morph ‘1’ => ‘2’) = (simple_morph ‘1’ => ‘3’)
  • (2): SubroutineMorphism(1) ✤ Perl ✤ Perl ✤ print ✤ sub_morph { $_[0] * 2 } undef ✤ source target sub_morph { @_ } ( ) ✤ ( )
  • (2): SubroutineMorphism(2) ✤ $sub2 . $sub1 $sub1 $sub2 ✤ ✤ ✤
  • (1) ✤ f.(g.h) (f . g) . h f g h ✤ ✤ id ( ) ✤ ✤ f×g: x → ( f(x), g(x) )
  • (2) A×B πA πB C ( f, g ): f, g 2 f g ( f, g ) A πA A×B πB B (f,g) f g (f,g) (g,f)
  • (3): ✤ : bi_morph $morph1, $morph2; (A1, A2) ✤ source target (f, g) (B1, B2) ✤ : op $morph; B ✤ source targe f ✤ op op $morph; $morph A
  • (1) ✤ Functor ✤ ✤ Morphism Morphism ✤ ( )
  • (2) ✤ functor { ... }; ✤ (Morphism OK) ✤ ✤ ( $functor2 . $functor1 )
  • (1): $BI_FUNCTOR ✤ Hom(-, -) ✤ C^op × C Sets ✤ C^op × C ✤ Sets SubroutineMorphism ( Sets )
  • (1) ✤ NaturalTransformation ✤ ✤ (Morphism)
  • (2) ✤ nat { }; ✤ ✤ ✤ ( ) ✤
  • (3) ✤ ✤ $nat2 . $nat1 ✤ $funct . $nat ✤ $nat . $funct
  • (4): FunctorMorphism ✤ ✤ functor_morph nat { F my $id = shift; ... ... return $sum_morph τ }; ✤ source target source G target
  • (2): $YONEDA_EMBEDDING ✤ ✤ C^op Sets^C ✤ Hom(g, -)
  • : CPS (1) ✤ uc CPS
  • : CPS (2) Sets Hom( , -) Hom( , undef) ∈ print uc $fun_morph $cps_uc $cps_uc->(print) ∈ Hom( , -) Hom( , undef)
  • Monad (1) ✤ functor eta mu ✤ eta: I → T, mu: TT → T ✤ ✤ Haskell Monad ✤
  • Monad (2) ✤ 1. $monad->mu . (funct_nat $monad->functor, $monad->eta) $monad->mu . (nat_funct $monad->eta, $monad->functor) T→T ✤ 2. $monad->mu . (funct_nat $monad->functor, $monad->mu) $monad->mu . (nat_funct $monad->mu, $monad->functor) ( TTT → T )
  • Monad (1): $LIST_MONAD ✤ ✤ [v1_1, v1_2, v1_3], [v2_1, v2_2], [v3_1, v3_2, v3_3, v3_4] ✤ map eta [] mu concat
  • Monad (2): $STATE_MONAD ✤ ✤ sub { my @states = @_; .. .. return ¥@values, ¥@new_states } 1 ✤ functor, eta, mu Haskell ( )
  • Monad (3): Maybe ✤ Maybe nothing ✤ ( ) null ✤ List
  • (5): KleisliMorphism ✤ m f: a -> m b b mma mmb mmc mg μc ma mb mc f g ηa ηb ηc a b c
  • (5): KleisliMorphism ✤ m f: a -> m b b mma mmb mmc mg μc ma mb mc f g ηa ηb ηc a b c
  • Kleisli : Maybe (1) ✤ HTML get_number: HTML (<span>3/10</span>) cut_tag: (3/10) parse_number: (3, 10) div: (0.3) ✤ NG
  • Kleisli : Maybe (2) ✤
  • Kleisli : Maybe (2) ✤
  • Kleisli : Maybe (2) ✤ Maybe Kleisli
  • Kleisli : Maybe (2) ✤ Maybe Kleisli
  • ✤ ✤ ✤ ✤ ( ) ✤