0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

ラムダ計算:再帰関数

Last updated at Posted at 2025-01-19

再帰関数に考える前に以下のラムダ関数$\textbf{Y}$について考えてみる。

$$\textbf{Y}\equiv(\lambda y.(\lambda x.y(xx))(\lambda x.y(xx)))$$

関数$R$に$\textbf{Y}$を適用すると
$$\textbf{Y}R\equiv(\lambda x.R(xx))(\lambda x.R(xx))$$

となるが、更にreduceを続けると、
$\textbf{Y}R
\rightarrow R(\lambda x.R(xx))(\lambda x.R(xx))
\rightarrow R(\textbf{Y}R)$つまり
$$\textbf{Y}R\rightarrow R(\textbf{Y}R)$$

となる。これは関数$R$が第一変数として再帰呼び出し$\textbf{Y}R$で評価されている。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?