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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
chiaoi
January 26, 2026
120
0
Share
State machineはTurningの夢を見るか?
chiaoi
January 26, 2026
More Decks by chiaoi
See All by chiaoi
Neptune Analytics SSSP Δ-parameter
chiaoicchi
1
60
RAG入門
chiaoicchi
0
170
私なりのAIエージェントの理解と開発ツールの選び方
chiaoicchi
0
10
Fine-tuning Hands-on
chiaoicchi
0
15
kani
chiaoicchi
0
54
Trn3 UltraServer
chiaoicchi
0
26
DeepRacer cup本戦 ~30秒の切り方~
chiaoicchi
0
26
Featured
See All Featured
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
Building the Perfect Custom Keyboard
takai
2
770
Testing 201, or: Great Expectations
jmmastey
46
8.2k
For a Future-Friendly Web
brad_frost
183
10k
Technical Leadership for Architectural Decision Making
baasie
3
380
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.7k
It's Worth the Effort
3n
188
29k
The Curse of the Amulet
leimatthew05
1
12k
Visualization
eitanlees
151
17k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
180
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
290
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
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は実はすごい構造化言語です。