SlideShare a Scribd company logo
1 of 26
Download to read offline
Modeling
Concurrent Computing
並行計算をモデル化する
松下祐介
数理モデル
• 複雑なことを扱うと頭がこんがらがる
• そこで数学の登場
• 数学によってモデルにしよう
(例)
自然法則 ⇒ ニュートン力学、相対性理論、...
計算機 ⇒ チューリングマシン、ラムダ計算、...
経済 ⇒ ゲーム理論のゲーム、...
• 優秀なモデルは単純で美しく、強力であり、そ
して本質を明らかにする
並行計算の数理モデル
• 並行計算はなんだかややこしい
• しかも大規模な並行計算が必要になってきた
• そこで数理モデルの登場
▫ アクターモデル
▫ プロセス計算
▫ ペトリネット
Actor Model
アクターモデル
アクター
• アクターは
▫ 他のアクターにいくつかのメッセ-ジを送る
▫ いくつかの新たなアクターをつくる
▫ メッセージに応じて何かをする
• これらの振る舞いは並行的に実行される
データの取り扱い
• アクターはカプセル化されたオブジェクト
▫ 自分が持っているデータは自分のみが取り扱う
▫ 他のアクターはデータを参照・操作できない
▫ メッセージだけで情報交換を行う
 オブジェクト指向においてメッセージは重要概念
アクターの通信 (1)
• 送信側アクターは
▫ アドレスによって送信先のアクターを指定する
▫ 受信されるのを待たずに次のことをする
• アクターのアドレスの取得方法
▫ 受信したメッセージから取得
▫ 自分が生成したアクターであるので知っている
▫ その他
• 局所性
▫ アドレスを知っている相手にしかメッセージを送
れない
アクターの通信 (2)
• 受信側アクターは
▫ 自分のデータを操作する
▫ 新たなメッセージを送る
▫ 新たなアクターをつくる
• 通信のスケールはいろいろ
▫ プロセス間だったり、ネットワーク間だったり
• メッセージは入れ替わりうる
▫ 送信された順に受信されるとは限らない
短所
• 共有データの扱いが面倒
• 同期を扱えない
長所
• 並行計算を気楽に考えられる
▫ アクターはスレッドを直接扱わなくていい
▫ アクターは内部状態へのロックを考えなくていい
• スケーラビリティー
▫ 問題は小さなアクターに分割していけばよい
▫ プロセッサの数の増減にも対応できる
文献
• アクターモデルについて
http://www.slideshare.net/TakamasaMitsuji/ss-
13626473
Process Calculus
プロセス計算
はじめに
• プロセス計算には様々な種類がある
▫ 一気に全体を見渡すことは難しい
• プロセス代数とも呼ばれる
• プロセス計算を記述するための
CSP (Communicating Sequential Processes)
という言語に基づいて説明していく。
基本 (1)
• プロセスはオブジェクトである
▫ データを持つ
▫ イベントが来たらデータを操作する
• イベント/チャンネルは通信路である
▫ 他への操作 (スイッチオン/オフなど)
▫ 入力 (mouse?xyなど)
▫ 出力 (screen!bitmapなど)
基本 (2)
• プリミティブプロセス
▫ STOP (通信をしない)
▫ SKIP (必ず成功する)
▫ DIV (発散)
• 環境
▫ プロセスたちの外にある世界
• プロセスは再帰的定義が可能
演算 (1)
• プレフィックス a→P
▫ イベントaと通信したあとにプロセスPを行うプロ
セス
• 決定的選択/外部選択 (a→P)□(b→Q)
▫ 環境がaとbのどちらのイベントを起こすか決定
▫ aが起こったらP、bが起こったらQを行う
▫ 同時にaとbを受け取ったらどうなるかは不定
• 非決定的選択/内部選択 (a→P)∏(b→Q)
▫ プロセスがaとbどちらのイベントを起こすか決定
演算 (2)
• インターリーブ/並行合成 P|||Q
▫ PとQが同時並行に動作
• インターフェース並行/共有 P|[{a}]| Q
▫ PとQが同時並行に動作
▫ イベントaを共有する
• 隠蔽 P\{a}
▫ イベントを観測不可能にする
 プロセスの抽象化のため
演算 (3)
• 逐次合成 P; Q
▫ PをしたあとにQをする
• 条件選択 if p then P else Q
▫ pが真ならばPを、偽ならばQを実行する
• タイムアウト P ▷Q
▫ PがタイムアウトしたらQを行う
• 割り込み P△Q
演算 (4)
• 変更 P [[ a←b ]]
▫ プロセスの中のイベントaをイベントbに書き換え
たプロセス
通信 (1)
channel juice
Coin = {10,50,100,500}
channel in:Coin -- コインを入れるところ
VM(n) = if n<120
then in?x → VM(n+x) -- ?で入力
else juice → VM(n-120) --ジュース1本120円
通信 (2)
PERSON = (juice -> SKIP) □
( in!10 -> PERSON -- ! で出力
∏ in!50 -> PERSON
∏ in!100 -> PERSON
∏ in!500 -> PERSON )
SYSTEM = PERSON [|{in,juice}|] VM(0)
さまざまなプロセス計算
• CSP (Communicating Sequential Process)
• CCS (Calculus of Commnicating Systems)
• ACP (Algebra of Communicating Process)
• π計算
• アンビエント計算
動作検証ツール
ツール 理論
FDR CSP
PAT CSP#
mCRL2 ACP
CWB CCS
MWB π計算
LTSA FSP
プロセス計算の形に直すことで機械的に動作を検証できる!
文献
• プロセス代数の基本と関連ツールの紹介
http://staff.aist.go.jp/y-isobe/topse/vic/slides/csp-
isobe-2010-07.pdf
• プロセス代数に基づくモデリング
http://lis2.huie.hokudai.ac.jp/~kurihara/classes/P
rogram/fsp.ppt
http://kussharo.complex.eng.hokudai.ac.jp/~kuri
hara/classes/Program/JTEXT/05JTEXT.pdf
• CSP (Communicating Sequential Processes)
http://d.hatena.ne.jp/ymkwt/
Finale
フィナーレ
フィナーレ
• 先人たちの知恵に学ぼう
▫ モデルの再開発はしたくない
• 確立された数理モデルに基づけば
▫ いろいろなツールを使いやすい
▫ 第三者との共通理解もしやすい
▫ いろいろと便利
• 抽象の世界を楽しもう!

More Related Content

Recently uploaded

2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
ssuserbefd24
 
研究紹介スライド: オフライン強化学習に基づくロボティックスワームの制御器の設計
研究紹介スライド: オフライン強化学習に基づくロボティックスワームの制御器の設計研究紹介スライド: オフライン強化学習に基づくロボティックスワームの制御器の設計
研究紹介スライド: オフライン強化学習に基づくロボティックスワームの制御器の設計
atsushi061452
 

Recently uploaded (11)

20240523_IoTLT_vol111_kitazaki_v1___.pdf
20240523_IoTLT_vol111_kitazaki_v1___.pdf20240523_IoTLT_vol111_kitazaki_v1___.pdf
20240523_IoTLT_vol111_kitazaki_v1___.pdf
 
5/22 第23回 Customer系エンジニア座談会のスライド 公開用 西口瑛一
5/22 第23回 Customer系エンジニア座談会のスライド 公開用 西口瑛一5/22 第23回 Customer系エンジニア座談会のスライド 公開用 西口瑛一
5/22 第23回 Customer系エンジニア座談会のスライド 公開用 西口瑛一
 
論文紹介:ViTPose: Simple Vision Transformer Baselines for Human Pose Estimation
論文紹介:ViTPose: Simple Vision Transformer Baselines for Human Pose Estimation論文紹介:ViTPose: Simple Vision Transformer Baselines for Human Pose Estimation
論文紹介:ViTPose: Simple Vision Transformer Baselines for Human Pose Estimation
 
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
Amazon Cognitoで実装するパスキー (Security-JAWS【第33回】 勉強会)
 
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
2024年5月25日Serverless Meetup大阪 アプリケーションをどこで動かすべきなのか.pptx
 
論文紹介:Deep Occlusion-Aware Instance Segmentation With Overlapping BiLayers
論文紹介:Deep Occlusion-Aware Instance Segmentation With Overlapping BiLayers論文紹介:Deep Occlusion-Aware Instance Segmentation With Overlapping BiLayers
論文紹介:Deep Occlusion-Aware Instance Segmentation With Overlapping BiLayers
 
ロボットマニピュレーションの作業・動作計画 / rosjp_planning_for_robotic_manipulation_20240521
ロボットマニピュレーションの作業・動作計画 / rosjp_planning_for_robotic_manipulation_20240521ロボットマニピュレーションの作業・動作計画 / rosjp_planning_for_robotic_manipulation_20240521
ロボットマニピュレーションの作業・動作計画 / rosjp_planning_for_robotic_manipulation_20240521
 
研究紹介スライド: オフライン強化学習に基づくロボティックスワームの制御器の設計
研究紹介スライド: オフライン強化学習に基づくロボティックスワームの制御器の設計研究紹介スライド: オフライン強化学習に基づくロボティックスワームの制御器の設計
研究紹介スライド: オフライン強化学習に基づくロボティックスワームの制御器の設計
 
部内勉強会(IT用語ざっくり学習) 実施日:2024年5月17日(金) 対象者:営業部社員
部内勉強会(IT用語ざっくり学習) 実施日:2024年5月17日(金) 対象者:営業部社員部内勉強会(IT用語ざっくり学習) 実施日:2024年5月17日(金) 対象者:営業部社員
部内勉強会(IT用語ざっくり学習) 実施日:2024年5月17日(金) 対象者:営業部社員
 
Intranet Development v1.0 (TSG LIVE! 12 LT )
Intranet Development v1.0 (TSG LIVE! 12 LT )Intranet Development v1.0 (TSG LIVE! 12 LT )
Intranet Development v1.0 (TSG LIVE! 12 LT )
 
クラウド時代におけるSREとUPWARDの取組ーUPWARD株式会社 CTO門畑
クラウド時代におけるSREとUPWARDの取組ーUPWARD株式会社 CTO門畑クラウド時代におけるSREとUPWARDの取組ーUPWARD株式会社 CTO門畑
クラウド時代におけるSREとUPWARDの取組ーUPWARD株式会社 CTO門畑
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Modeling Concurrent Computing