QuickTopic (SM) free message boards QuickTopic (SM) free message boards
Skip to Messages
  Sign In to access your topic list  |New Topic |My Topics|Profile
Upgrade to Pro   Customize, show pictures, add an intro, and more:   QuickTopic Pro...and check out QuickThreadSM
Topic: CSE 130 Homework #9 and Final
Views: 2421, Unique: 779 
Subscribers: 1
What's
this?
Printer-Friendly Page
Subscribe to get & post, or stop messages by email Subscribe
All messages            72-87 of 87  56-71 >>
About these ads
Who | When
Messagessort recent-top   
Post a new message
 
Fox Harrell  72
03-15-2004 05:24 AM PT (US)
Amir:

Maybe you have done all this already but:

Of course read chapter 1 in the book.

Also check here:
http://www-cse.ucsd.edu/users/goguen/papers/compl.html
and here:
http://www-cse.ucsd.edu/users/goguen/courses/130/s1.html

Finally, review your lecture notes from the first week of class.

You don't need to know anything about the theory of evolution in biology. Just the evolution of programming languages.
Mickey  73
03-15-2004 01:44 PM PT (US)
In "Notes on Chapter 11", there is an example of using "not" together with "!(cut)".

not(X) :- X, !, fail.
not(X).

not(fly(penguin)). // #1

not(fly(X)). // #2

so how do these work? What does "succeed" in the sentence "the first caluse for not will try to make fly(penguin) succeed" mean? Why does #2 produce incorrect results?
Sean O'RourkePerson was signed in when posted  74
03-15-2004 02:39 PM PT (US)
Mickey - this is how "not()" is (or can be) implemented. To see how it works, and to gain a much better understanding of how prolog works, I encourage you to try tracing through the search tree in both the "X is true" and "X is false" cases. Remember: prolog tries rules from top to bottom, and satisfies subgoals from left to right.
TayboPowar  75
03-15-2004 03:50 PM PT (US)
In the posted solutions for the midterm, problem 1, the definition of layout is given as "determine locations for storage." The other feasible solution is "determine the sizes for storage needed." Shouldn't it be the latter? I thought allocation is when you actually assign memory, and layout is when you just see "how it looks" in some abstract place in memory, more or less.

Thanks for the clarification.
Yongbo  76
03-15-2004 04:20 PM PT (US)
 fn : ('a * 'b -> 'b) -> 'a list -> 'b -> 'b

What does the above function type mean?
Fox Harrell  77
03-15-2004 04:31 PM PT (US)
Taybo:

Your answer is not correct. Think of it this way:

Would you draw the array layout differenly for integers vs reals (which take up more space in memory)? For allocation you actually need to know the sizes of array elements. Sethi says "the layout of the array determines the machine address of an element A[i] relative to the address of the first item." "The machine address" has to do with location, not size. Locations can be described using relative addresses.
Fox Harrell  78
03-15-2004 04:36 PM PT (US)
Yongbo:

You should figure it out as an exercise. Use the type precedence rules on page 313 of Sethi.
alex  79
03-15-2004 06:32 PM PT (US)
Thanks, Sean. Once again, your intelligence and devilish good looks have kept me from dropping this class in frustration.
alex  80
03-15-2004 06:38 PM PT (US)
You too, Fox.
Hard Final  81
03-15-2004 10:46 PM PT (US)
That final sucked! It was 50 points all on Prolog and ML, which wasn't very representative of the course. I hope the curve is low and grading scale adjusted differently than 50% final!
 
Messages 82-85 deleted by topic administrator 07-22-2006 09:28 AM
Riley  86
07-22-2006 01:05 AM PT (US)
Pretty nice discussion, want to see much more on it! :) Congrats on your work. Sorry I wont get to see you at worlds. famvir and shingles webpage devoted to famvir and shingles. spironolactone weight loss webpage devoted to spironolactone weight loss.
   87
07-22-2006 01:05 AM PT (US)
Deleted by topic administrator 07-22-2006 07:22 AM
RSS link What's this?
All messages            72-87 of 87  56-71 >>
QuickTopicSM message boards
Over 200,000 topics served
Learn more Frequently asked questions  Acknowledgements
What they're saying about QuickTopic
 Questions, comments, or suggestions? Contact Us
Read our use policy before beginning. We value your privacy; please read our privacy statement.
Copyright ©1999-2008 Internicity Inc. All rights reserved.