このブログは、旧・はてなダイアリー「檜山正幸のキマイラ飼育記 メモ編」(http://d.hatena.ne.jp/m-hiyama-memo/)のデータを移行・保存したものであり、今後(2019年1月以降)更新の予定はありません。

今後の更新は、新しいブログ http://m-hiyama-memo.hatenablog.com/ で行います。

スパイダーグラフのジャンクション 暫定案


  1. idA : A→A
  2. literalx : void→sngleton(x)
  3. literalvoid = idvoid : void→void
  4. discA : A→void
  5. copyA : A→A×A
  6. tupleA,B : A, B→A×B
  7. detupleA,B : A×B→A, B
  8. chooseA : A→A, A
  9. mergeA,B : A, B→A∪B
  10. branchA,B : A+B→A, B

以下に描画用のソース。

// -*- coding: utf-8 -*-
// This is junctions.caty

[

// id

 gv:node --shape=point --style=invis idin,
 gv:node --shape=point --style=invis idout,

 gv:edge --label=A idin idout,


// literal l

 gv:node --shape=point --style=invis lin,
 gv:node --shape=point --style=invis lout,

 gv:edge --label=x --dir=both --arrowtail=dot lin lout,

// void v

 gv:node --shape=point --style=invis vin,
 gv:node --shape=point --style=invis vout,

 gv:edge --label="" --dir=both --arrowtail=dot --arrowhead=dot --style=dotted vin vout,

// discharger d

 gv:node --shape=point --style=invis din,
 gv:node --shape=point --style=invis dout,

 gv:edge --label="A" --dir=both --arrowhead=dot --arrowtail=inv --style=dotted din dout,

// copy  c
 gv:node --shape=point --style=invis cin,
 gv:node --shape=point --style=invis cout1,
 gv:node --shape=point --style=invis cout2,

 gv:node --shape=point --width=0.3 --style=filled --fillcolor=brown copy,

 gv:edge --label=A cin copy,
 gv:edge --label=A copy cout1,
 gv:edge --label=A copy cout2,


// tuple t

 gv:node --shape=point --style=invis tin1,
 gv:node --shape=point --style=invis tin2,
 gv:node --shape=point --style=invis tout,

 gv:node --label="*" --shape=diamond --style=filled --fillcolor=brown tuple,

 gv:edge --label=A tin1 tuple,
 gv:edge --label=B tin2 tuple,

 gv:edge --label="[A, B]" tuple tout,

// detuple dt

 gv:node --shape=point --style=invis dtin,
 gv:node --shape=point --style=invis dtout1,
 gv:node --shape=point --style=invis dtout2,

 gv:node --label=" " --shape=diamond --style=filled --fillcolor=brown dt, 

 gv:edge --label="[A, B]" dtin dt,
 gv:edge --label=A dt dtout1,
 gv:edge --label=B dt dtout2,

// nd branch nd

 gv:node --shape=point --style=invis ndin,
 gv:node --shape=point --style=invis ndout1,
 gv:node --shape=point --style=invis ndout2,

 gv:node --label="" --shape=point --width=0.3 --style=filled --fillcolor=white nd, 

 gv:edge --label=A nd ndout1,
 gv:edge --label=A nd ndout2, 
 gv:edge --label=A ndin nd,

// merge m

 gv:node --shape=point --style=invis min1,
 gv:node --shape=point --style=invis min2,
 gv:node --shape=point --style=invis mout,

 gv:node --label="" --shape=point --width=0 --style=invis merge, 
 gv:edge --label=A min1 merge,
 gv:edge --label=B min2 merge,
 gv:edge --label="A, B" merge mout,

// cond branch cb

 gv:node --shape=point --style=invis cbin,
 gv:node --shape=point --style=invis cbout1,
 gv:node --shape=point --style=invis cbout2,

 gv:node --label=" " --shape=diamond --style=filled --fillcolor=white cb, 

 gv:edge --label="A|B" cbin cb,
 gv:edge --label=A cb cbout1,
 gv:edge --label=B cb cbout2, 

] | gv:graph --label=junctions --rankdir=TB --bgcolor=gainsboro