=========== 990324.0740 =========== I'm discovering a problem with the time limits on the exams. It requires that I be on-line 24 hours a day. I like to get some sleep, which can lead to your time allotment expiring before I see your question and post a response. If you find that happening, do your best to answer your own question, and BE SURE TO STATE WHATEVER ASSUMPTIONS YOU MAKE IN YOUR ANSWER. > 1STRC: > This may be just paranoia, but is the word "following" in bold for > any particular reason in 1strc? I emboldened "following" and the parts of the question I wanted you to address to make it easier for you to pick out the parts I wanted you to address. > 1STRC: > It seems that part b should say > ...) | (F (div y 2)))... > ^ Indeed it should be "y". No tricks intended. > 1DENO: > Question 1 Deno ask us to create a for statement but not use any function > calls. Does this also include the semantic function calls provided by the > language and any recursive implementaitons of the for loop? You may use recursion (and, therefore, function calls) in your semantic description of the FOR LOOP. You don't have to represent function calls that would occur in the expressions of the FOR LOOP itself. My objective here was to simplify the kinds of FOR LOOPS you had to consider, not to remove any power of the denotational semantics. > 1STRC: > The question says to consider > explaining my answer in terms of passing arguments by name or by value. > Do you mean for us to just pick one and explain accordingly? Thanks. I meant for call by name and call by value to be available to you for explaining assumptions you need to make in your answer. Their semantics may be helpful (and may not). You may use either freely. =========== 990324.2105 =========== 1APAR > In 1APAR (first problem part I), do you want us to explain what can go > wrong with implementation of IN-OUT params when a) done by reference, and > b) when done by value-result OR what can go wrong with the fact that Ada > allows the implementor to choose either method? > 1APAR is about the problems with letting the implementor choose either method. 1BCMS > In 1BCMS (second problem part I), can we assume the most general > interpretation for "class hierarchies", i.e., exlcuding how it was > implemented in, for example, Ada, C++ or Java? > Yes, you may assume generic class hierarchies. Please be sure to state any assumptions you make that you think are not perfectly clear. 1STRC > In 1STRC (last problem part I), my part a is blank but I think what you > mean to have is the lambda abstraction that shows up on the right hand > side of the bottom of the page printed in three separate lines. > There should be only an entry on the far end of the line marked "a)", a definition of "F" and an entry at the far right end of the line marked "b)" and a definition of "G" and then an entry at the far right end of the line marked "c)" It's the three items at the ends of the lines that I want you to analyze. Here's what you should see, except parts b) and c) had to be broken into two lines each here to fit the column width. On your exam the lines labeled "a)", "b)" and "c)" should be one line each. Notice I fixed the "(F (div x 2))) | 1)" problem in part b), putting a "y" where an "x" used to be, and the 1/0 problem in part a). Note also that "L" stands for "lambda" in the expressions at the right ends of the lines. a) (Lx. 3) (/ 1 0) b) for int y, (F y) = ( (> y 1) -> ((odd y) -> (F (+ (* 3 y) 1)) | (F (div y 2))) | 1) (Lx. (F x)) z c) for G = function which generates an infinite sequence (Lx. (car x)) G 1STRC > > Choose i or ii,: > > Which is intended: > > i: parse part a literally: ((Lx.3) 1) (/ 0) > > ii: or: (Lx.3) (/ 1 0) (with the semantics we conclude) > Oops. You're the first to complain about this. The 1/0 should have been written (/ 1 0), meaning your choice ii.