The interpreter of the Lambda-calculation ( XSLT )

 

lambda.zip - archived directory (35 K). 

About Lambda-calculation look, for example 

John Harrison. Introduction to Functional Programming.

http://www.cl.cam.ac.uk/Teaching/Lectures/funprog-jrh-1996/index.html

http://www.cl.cam.ac.uk/Teaching/Lectures/funprog-jrh

I have 7 examples:

Example 1. iszero one 

(\x. (\y. y ))  

Example 2. succ (succ (succ (succ zero )))

(\s. (\z. (s (s (s (s z ))))))

Example 3. pred zero

(\s. (\z. z ))

Example 4.  pred (add (add one one )one )

(\s. (\z. (s (s z ))))

Example 5. factorial zero

(\s. (\z. (s z )))

Example 6. factorial (add one one )

(\s. (\z. (s (s z ))))

Example 7. factorial (add (add one one )one )

(\s. (\z. (s (s (s (s (s (s z ))))))))

Times of execution of these examples

        saxon         xt   lotusxsl      xalan 
        6.4.3              -j_2_0_0      -j_2_2_D11 

1       1.792      0.480      1.983      3.685
2       2.935      0.831      3.024      5.988
3       3.074      0.861      3.264      6.229
4       8.022      2.413      8.092     15.843
5      12.348      3.605     11.296     19.198
6      ------     27.139     70.592    120.463
7      ------     47.829    129.246    225.174

time - Execution time (seconds) without Preparation time

The examples were carried out on the computer with the processor intel Pentium-3,
500 MHz, 256 MB , Windows 2000.

Alexandr Korlyukov
The professor of the Grodno state university
email -   korlyukov@grsu.grodno.by