ϵ">]>
Module |
Remark
12. CVIČENIE Z PREDMETU ÚVOD DO DEKLARATÍVNEHO PROGRAMOVANIA http://ii.fmph.uniba.sk/cl/courses/1-AIN-505-udp/0506ls/ex/ex13.cl |
Remark
Dátum: utorok 19. 5. 2006 Odporúčaná verzia CL: 5.81.16 WWW stránka predmetu: http://ii.fmph.uniba.sk/cl/courses/1-AIN-505-udp/0506ls?lang=sk Kontakt na cvičiaceho: mailto:kluka@fmph.uniba.sk |
Remark
Assignment 1. Define the denotation function for numeric terms with variables , which yields the value of the term under the valuation of variables . A valuation of variables is a list such that the value of variable is the -th element of the list . |
Remark
Assignment 2. Programs for the postfix machine are lists of instructions. Define a predicate which holds true for such programs. |
Remark
Operation of the machine. For any programs , , a stack , and a stack frame we have for some . We the say that the execution of program by the postfix machine pushes the value computed by to the top of the stack . The idea of stack frames is to hold the values of variables accessed in by instructions . Note that when such an instruction is executed with a current stack we should have for some and then the value pushed on the top of will be taken from the frame as . |
Remark
Assignment 3. Define a function which simulates the run of the postfix machine for the program and stack . |
Remark
Assignment 4. Define the function which compiles the term into a program, which expects the stack frame in the depth . If for any , , and such that we have then we also have for any |
Query: |
|
Results: |
|