
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

#include<stdio.h> char *s="%cinclude<stdio.h>%cchar *s=%c%s%c;%cmain(){printf(s,35,10,34,s,34,10,10);}%c"; main(){printf(s,35,10,34,s,34,10,10);}
Note that the decimal numbers 10, 34, and 35 represent the ASCII char- acters newline, double quote, and sharp sign. Write a āquineā (a self-printing program) for another programming lan- guage.
P 7 ā Ī»x.
1 , if x = 0 x Ā· P (x ā 1), otherwise.
(Note: In this example Ī» is being used as a generic notation for anonymous functions. This is not an official Ī»-calculus program.) Adapt this fixed-point construction to your favorite programming lan- guage. Use this construction and the fixed-point version of the recursion theorem presented in class to justify that the factorial function is defin- able in your favorite programming language. (This should be the same language you previously showed was an acceptable programming system.) Pay careful attention to when you are generating and/or transforming a program and when you are executing the program. Note that your solution will not directly define the factorial function, but it will prove that, as a consequence of the recursion theorem, the factorial function can be defined in your favorite programming language.