Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
State machineはTurningの夢を見るか?
Search
chiaoi
January 26, 2026
0
98
State machineはTurningの夢を見るか?
chiaoi
January 26, 2026
Tweet
Share
More Decks by chiaoi
See All by chiaoi
私なりのAIエージェントの理解と開発ツールの選び方
chiaoicchi
0
1
Fine-tuning Hands-on
chiaoicchi
0
4
kani
chiaoicchi
0
41
Trn3 UltraServer
chiaoicchi
0
8
DeepRacer cup本戦 ~30秒の切り方~
chiaoicchi
0
19
Featured
See All Featured
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
250
Visualization
eitanlees
150
17k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
Code Reviewing Like a Champion
maltzj
527
40k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
110
Joys of Absence: A Defence of Solitary Play
codingconduct
1
290
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
62
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
130
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
200
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
240
Transcript
State machineはTuringの夢を見るか? chiaoi
注意 実務で ”急に” 役に立つことは学べません。
AWS Step Functions は State machine を作る
State Machine A D C B 0 0 0 1
0, 1 1 1 C 文字列を受理するか拒否するか を決定できる機械
文字列 10010 A D C B 0 0 0 1
0, 1 1 1 C
文字列 10010 A D C B 0 0 0 1
0, 1 1 1 C
文字列 10010 A D C B 0 0 0 1
0, 1 1 1 C
文字列 10010 A D C B 0 0 0 1
0, 1 1 1 C
文字列 10010 A D C B 0 0 0 1
0, 1 1 1 C
文字列 10010 A D C B 0 0 0 1
0, 1 1 1 C 受理!
この機械が受理するのはどんな文字列? A D C B 0 0 0 1 0,
1 1 1 C
1で始まって0で終わる文字列 ⇒ 1(0|1)*0 A D C B 0 0 0
1 0, 1 1 1 C
State machineは計算モデル 例えば、「1で始まって0で終わる文字列」を認識できる機械。 State machineで表せるものと正規表現で表せるものは同じ。 AWS Step Functionsで作成できるState machineは、AWS Lambda
Durable Functionsを使って作れる ワークフローとどのような違いがあるんだろう??
クイズ:次のものを記述できる? 次の文字列を認識できる正規表現とプログラミングのコードを考えてみよう! 1で始まって0で終わる文字列
クイズ:次のものを記述できる? 次の文字列を認識できる正規表現とプログラミングのコードを考えてみよう! 1で始まって0で終わる文字列 1(0|1)*0
クイズ:次のものを記述できる? 次の文字列を認識できる正規表現とプログラミングのコードを考えてみよう! 1と0の個数が同じ文字列
クイズ:次のものを記述できる? 次の文字列を認識できる正規表現とプログラミングのコードを考えてみよう! 1と0の個数が同じ文字列 正規表現で書くことができない 補足) Myhill-Nerodeの定理やポンピング の補題から示せます。
言語を認識するモデルの強さ プログラミング言語 チューリングマシン 2カウンタマシン State machine 正規表現 チューリング完全 正規言語
AWS Step Functionsは弱い?? AWS Step Functionsでワークフローを作成するときに書く 「ASL(Amazon States Language)」は、 プログラミング言語より弱いのではないか??
AWS Step Functionsは弱い?? AWS Step Functionsでワークフローを作成するときに書く 「ASL(Amazon States Language)」は、 プログラミング言語より弱いのではないか??
NO!! 同じつよさです!!
ASLとは - Pass - Choice - Wait - Parallel -
Map - Succeed - Fail - Variables - JSONata/(JSONPath) - 埋め込み関数 注)TaskStateを含むとLambdaやSDKが実行できてしまうので 今 回はなしとします。
State machine - Pass - Choice - Wait - Parallel
- Map - Succeed - Fail - Variables - JSONata/(JSONPath) - 埋め込み関数
今回使う機能 - Pass - Choice - Wait - Parallel -
Map - Succeed - Fail - Variables - JSONata/(JSONPath) - 埋め込み関数
2 Counter Machine 必要な操作 - 2つのカウンタを初期化する(最初だけ) - INC(c) : カウンタを
+1 する - DEC(c) : カウンタを -1 する - JZ(c) : ゼロなら分岐する
AWS Step Functionsは2 counter machineを模倣する 必要な操作 - 2つのカウンタを初期化する(最初だけ) → Variables
- INC(c) : カウンタを +1 する → {% c + 1 %} - DEC(c) : カウンタを -1 する → {% c - 1 %} - JZ(c) : ゼロなら分岐する → Choice + {% c == 0 %}
AWS Step Functionsで1と0の個数が同じ文字列を
AWS Step Functionsで1と0の個数が同じ文字列を 手順 - 文字列を前から読んでいき、1ならカウンタAを0な らカウンタBをインクリメント(足す1)する - カウンタAとカウンタBを同時にデクリメント(ひく1)し ていく
- カウンタAとカウンタBが同時に0になったら受理、 そうでないなら拒否
AWS Step Functionsで110100 カウンタA カウンタB 0 0
AWS Step Functionsで110100 カウンタA カウンタB 1 0
AWS Step Functionsで110100 カウンタA カウンタB 2 0
AWS Step Functionsで110100 カウンタA カウンタB 2 1
AWS Step Functionsで110100 カウンタA カウンタB 3 3
AWS Step Functionsで110100 カウンタA カウンタB 2 2
AWS Step Functionsで110100 カウンタA カウンタB 1 1
AWS Step Functionsで110100 カウンタA カウンタB 0 0 ともに0なので受理
まとめ 計算理論から見ると、「AWS Step Functions」「AWS Lambda Durable Functions」の計算能力に差はない。 「ASLはワークフローを作るための言語で、AWS Lambda Durable
Functions よりもできることが少ないので弱い」は計算理論の面から見ると間違い。 二つの違いを調べるためには、並列計算モデルなどのさら に高次な比較が必要です。 ASLは実はすごい構造化言語です。