Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Logic and CS / Girard. Proofs and Types.pdf
Скачиваний:
38
Добавлен:
10.08.2013
Размер:
947.15 Кб
Скачать

92

CHAPTER 11. SYSTEM F

11.5.3Binary trees

We are interested in nite binary trees. For this, we have two functions:

the tree consisting only of its root, so S1 = X;

the construction of a tree from two trees, so S2 = X!X!X.

Bintree

def

=

nil

def

=

couple u v

def

=

X: X!(X!X!X)!X

X: xX : yX!X!X : x

X: xX : yX!X!X : y (u X x y) (v X x y)

def

Iteration on trees is then de ned by It w f t = t W w f when W is a type, w of type W , f of type W !W !W and t of type Bintree. It satis es:

It w f nil w

It w f (couple u v) f (It w f u) (It w f v)

11.5.4Trees of branching type U

There are two functions:

the tree consisting only of its root, so S1 = X;

the construction of a tree from a family (tu)u2U of trees, so S2 = (U!X)!X.

Tree U

def

=

nil

def

=

collect f

def

=

X: X!((U!X)!X)!X

X: xX : y(U!X)!X : x

X: xX : y(U!X)!X : y ( zU : f z X x y)

def

The (trans nite) iteration is de ned by It w h t = t W w h when W is a type, w of type W , f of type (U!W )!W and t of type Bintree. It satis es:

It w h nil w

It w h (collect f) h ( xU : It w h (f x))

Notice that Bintree could be treated as the type of trees with boolean branching type, without substantial alteration.

Соседние файлы в папке Logic and CS