Evaluating Prolog

6 views
Skip to first unread message

Trevor Burbidge

unread,
Dec 6, 2012, 11:08:36 PM12/6/12
to byu-cs-330...@googlegroups.com
For some of these functions would pointing you toward the code be good enough since lots are only one line? Which functions would need actual test cases?

Jay McCarthy

unread,
Dec 6, 2012, 11:12:37 PM12/6/12
to BYU CS 330 Fall 2012
The only ones that can be justified with no test cases are _, =var, and =find-all, provided their code is perfect.

Everything else should be tested with either =find-some in a test or a sequence of show w/ next

All the ones with things you might not think of (like the occurs check) are listed in the question and they should have test cases that show those things. If a student doesn't have a test case for something (like the occurs check), but does have the right code, and try to explain (in words) why it works (i.e. not just point at the line), then if their explanation is good, accept it. If you think it is good and I don't, then I'll update your peer grade later.

Jay


On Thu, Dec 6, 2012 at 9:08 PM, Trevor Burbidge <tbu...@gmail.com> wrote:
For some of these functions would pointing you toward the code be good enough since lots are only one line? Which functions would need actual test cases?

--
 
 



--
Jay McCarthy <j...@cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

Jay McCarthy

unread,
Dec 6, 2012, 11:15:51 PM12/6/12
to BYU CS 330 Fall 2012
Also, if someone does =and and =or correct, but doesn't do short-circuiting in either. Given them a no on =and then a yes on =or

Jay McCarthy

unread,
Dec 6, 2012, 11:22:42 PM12/6/12
to BYU CS 330 Fall 2012
Be Tee Dub, if you don't understand any of the reasons you got 0 on a question, I was pretty deliberate in filling my version (+ the video) with lots of test cases, showing how it fails and then how to fix the code

Jay McCarthy

unread,
Dec 6, 2012, 11:25:20 PM12/6/12
to BYU CS 330 Fall 2012
Also, if people treat continuations as functions with no arguments rather than with one, it's not a big deal.

Jay McCarthy

unread,
Dec 6, 2012, 11:37:45 PM12/6/12
to BYU CS 330 Fall 2012
Also, if people don't use =and2 in =and (etc), that's fine if they still do it correct. If you can't understand the code, because it's too crazy, that's their responsibility not yours. (Although, of course, respect their test cases.)
Reply all
Reply to author
Forward
0 new messages