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

SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Danieldanielhu54
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 

Recently uploaded (9)

SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 

Featured

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 HubspotMarius Sescu
 
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 ChatGPTExpeed Software
 
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 EngineeringsPixeldarts
 
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 HealthThinkNow
 
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.pdfmarketingartwork
 
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 2024Neil Kimberley
 
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)contently
 
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 2024Albert Qian
 
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 InsightsKurio // The Social Media Age(ncy)
 
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 2024Search Engine Journal
 
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 summarySpeakerHub
 
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 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 Tessa Mero
 
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 IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
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 managementMindGenius
 
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...RachelPearson36
 

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