PROGRAM LANGUAGE PRIN
PROGRAM LANGUAGE PRIN COP 5555
Popular in Course
Popular in Computer Programming
This 2 page Class Notes was uploaded by Hans Farrell PhD on Friday September 18, 2015. The Class Notes belongs to COP 5555 at University of Florida taught by Staff in Fall. Since its upload, it has received 30 views. For similar materials see /class/206696/cop-5555-university-of-florida in Computer Programming at University of Florida.
Reviews for PROGRAM LANGUAGE PRIN
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 09/18/15
NOTES ON THE MECHANICAL EVALUATION OF APPLICATIVE EXPRESSSION S The substitution mechanism for evaluating applicative expressions is convenient for humans but inconvenient for machines since the arguments involved may be arbitrarily complex Here we introduce a mechanical means for evaluating applicative expressions the CSE Machine It is an abstract machine implemented via software in the PAL compilerinterpreter with the following components C Control contains a sequence of operations S Stack contains operands E Environment Initially PE Updated as evaluation proceeds M Machine The primitive environment PE is assumed to be a collection of objects and operations that behave in accordance with a commonsense set of rules Actually another mechanism is used to specify these com monsense rules it is called the grammatical axiomatization of RPAL s Universe of Discourse In any event one quotlooks up names in the PE eg quotquot39 in return one obtains the quotrealquot object be it an integer a truthvalue or an operation We begin by taking a given RPAL program s strandardized syntax tree and attening it to a quotcontrol structurequot rather than to an applicative expression by a simple preorder tree walk Example Evaluate 2 ab in an environment in which a6 and bl o a Flattened structure 7 neg 7 7 2 7 7 a b This control structure is placed on the Control of the CSE Machine which operates vaguely as follows 1 Remove the rightm ost item from the control 2 If it s a name variable constant primitive operation then lookup the name in the current envi ronm ent and push the result on the stack 3 If it is 7 then pop the stack obtaining the rator pop it again obtaining the rand apply the rator to the rand and push the result 4 Stop if the control is empty the value on the stack is the result In our case recall that a6 and bl We will deal later with how these names get associated with these val LIES PLP Notes The CSE Machine
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'