Find Jobs
Hire Freelancers

compiler in while language using WIDE IDE

$25-30 USD

Zamknięte
Opublikowano ponad 15 lat temu

$25-30 USD

Płatne przy odbiorze
1- Let s : N ! N? be the successor function on natural numbers defined as follows: s(n) = n + 1. Note that s does always terminate. Let the following WHILE program P be given: read X Y:= cons nil X write Y Define an encoding c such that [[P]]WHILE implements s via c. Explain what conditions your c needs to fulfill and show that those conditions actually hold (Note that this is quite easy in this case). 2- Let W0 be the following sublanguage of WHILE: W0 contains all WHILE programs that use variable 0 as output variable. Write a compiler [login to view URL] from WHILE to W0. This compiler takes a WHILE program (in list notation) as input and returns a WHILE program (in list notation) that behaves identically but uses variable 0 as output variable. [Note that this is an extremely simple compiler which does not require complex tree traversal.] 3- Write a compiler [login to view URL] which translates WHILE programs into I-programs, ie WHILE programs that only use one variable, namely var 0. Your program should call the following auxiliary functions: While2l [login to view URL] , Number [login to view URL] , and [login to view URL] which is attached. Your compiler only needs to traverse commands (once you hit an expression you can call While2l [login to view URL]). Your compiler should not have more than about 70 lines of code (not counting comments). Note that such non-trivial programs which call other non-trivial programs may take some time in WIDE to compile (on my old machine about a minute or so). Don’t forget to test your compiler on several input programs. Add comments to your program where useful.
Identyfikator projektu: 3361739

Informację o projekcie

Zdalny projekt
Aktywny 15 lat temu

Szukasz sposobu na zarobienie pieniędzy?

Korzyści ze składania ofert na Freelancer.com

Ustal budżet i ramy czasowe
Otrzymuj wynagrodzenie za swoją pracę
Przedstaw swoją propozycję
Rejestracja i składanie ofert jest bezpłatne

O kliencie

Flaga UNITED KINGDOM
United Kingdom
4,6
2
Członek od lis 4, 2008

Weryfikacja Klienta

Dziękujemy! Przesłaliśmy Ci e-mailem link do odebrania darmowego bonusu.
Coś poszło nie tak podczas wysyłania wiadomości e-mail. Proszę spróbować ponownie.
Zarejestrowani Użytkownicy Całkowita Liczba Opublikowanych Projektów
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Wczytywanie podglądu
Udzielono pozwolenia na Geolokalizację.
Twoja sesja logowania wygasła i zostałeś wylogowany. Proszę, zalogować się ponownie.