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?

コンビネータ論理: 抽象化の演習問題2.19, 2.22, 2.25

0
Posted at

コンビネータ論理の抽象化(abstraction)についての演習問題をいくつか解いてみる。

参考図書は
https://amzn.to/3F1l7iV

Lambda-Calculus and Combinators:An Introduction PDF

定義 2.18(抽象化)

(a)$\ [x].M\equiv {\bf K}M$ if $x\notin FV(M)$
(b)$\ [x].x\equiv {\bf I}$
(c)$\ [x].Ux\equiv U$ if $ x\notin FV(U)$
(f)$\ [x].UV\equiv {\bf S}([x].U)([x].V)$もし(a)も(c)も適用できない場合。

例 2.19 [x].xy

$[x].xy \equiv {\bf S}([x].x)([x].y)\quad$ by 2.18(f)
$\quad\equiv{\bf SI}({\bf K}y)\quad$ by 2.18(b) and (a).
$y$は自由変数。
検証
${\bf SI}({\bf K}y)x$
$\quad\triangleright\ {\bf I}x({\bf K}yx)
\ \triangleright\ x(y)
\ \triangleright\ xy\quad\square$

演習問題 2.22*

問題(i)

$[x].u(vx)\equiv{\bf S}([x].u)([x].vx)$
$\quad\equiv{\bf S}({\bf K}u)v\quad$by 2.18(a) and (c)
検証
${\bf S}({\bf K}u)vx$
$\quad\triangleright\ {\bf K}ux(vx)
\ \triangleright\ u(vx)\quad\square$

問題(ii)

$[x].x({\bf S}y)\equiv{\bf S}([x].x)([x].{\bf S}y)\quad$by 2.18(f)
$\quad\equiv{\bf SI}({\bf K}({\bf S}y))\quad$ by 2.18(b) and (a)
検証
${\bf SI}({\bf K}({\bf S}y))x$
$\quad\triangleright\ {\bf I}x({\bf K}({\bf S}y)x)
\ \triangleright\ x({\bf S}y)\quad\square$

問題(iii)

$[x].uxxv\equiv{\bf S}([x].uxx)([x].v)\quad$ by 2.18(f)
$\quad\equiv{\bf S}({\bf S}([x].ux)([x].x))({\bf K}v)\quad$ by 2.18 (f) and (a)
$\quad\equiv{\bf S}({\bf S}u{\bf I})({\bf K}v)\quad$ by 2.18(c) and (b)
検証
${\bf S}({\bf S}u{\bf I})({\bf K}v)x
\ \triangleright\ ({\bf S}u{\bf I})x(({\bf K}v)x)$
$\quad\triangleright\ ux({\bf I}x)(v)$
$\quad\triangleright\ uxxv\quad\square$

例 2.25

(a)
$[x,y].x\equiv[x].([y].x)$
$\quad\equiv[x].({\bf K}x)\quad$ by 2.18(a)
$\quad\equiv{\bf K}\quad$ by 2.18(c)

(b)
$[x,y,z].xz(yz)\equiv[x].([y].([z].xz(yz)))$
$\quad\equiv[x].([y].({\bf S}([z].xz)([z].yz)))$
$\quad\equiv[x].([y].({\bf S}([z].xz)([z].yz)))$
$\quad\equiv[x].([y].(\underline{{\bf S}x}y))\quad$ by 2.18(c) and (c)
$\quad\equiv[x].({\bf S}x)\quad$ by 2.18(c)
$\quad\equiv{\bf S}\quad$ by 2.18(c) $\quad\square$

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?