Assessment
- Assignment 1: PS format, PDF format,
- Assignment 2: PS format, PDF format,
(Note the correction from the handout in class: an extra proposition has been added to problem 2.)
- Assignment 3: PS format, PDF format
- Assignment 4: PS format, PDF format
- Assignment 5: PS format, PDF format
- Assignment 6: PS format, PDF format
- Assignment 7: PS format, PDF format
(Note: double the weight and double the time.)
- Assignment 8: PS format, PDF format (corrected by deleting a comma in premise 3)
Midterm Exam
- Exam paper: PS format, PDF format, Chess diagram (PS only)
- Answers: 1=a, 2= d, 3= b, 4=c, 4=b, 6=c, 7=c, 8=b, 9=d, 10=a, 11=d, 12=c , 13=b, 14=c, 15=c, 16=a, 17=a, 18=c, 19=c, 20=d
- Average Score 14.8/20, standard deviation= 3.3, Lowest score 7/20, Highest score 20/20
Prolog Assignment
- Requirements: PS format, PDF format
- The program from the requirements: Program 1 . (corrected by adding a ";" to the initial condition line.)
- Here is some code that you might find useful.
XSB code, Iprolog code
This code reads a file and converts it to a list of "tokens".
A token is either an atom corresponding to a maximal sequence of alphanumeric characters from the input,
starting with an alphabetical character, or a non-alphanumeric character. Whitespace is removed.
For example, the input "ab < s8(pa, 22)" is converted to [ab, "<", s8, "(", pa, ",", 2, 2, ")" ].
- A set of testcases, similar to those that will be used to grade your assignmentment, as a ZIP file.
NOTE: the testing code enclosed with these test cases works for XSB, but there appears to be an iprolog bug relating to "==" that
prevents it working there. Here is an alternative version of testingcode.P to use with iprolog.
Note that this version might not catch all errors in your code. In particular, if check(sampleX,particular-assignment,VARIABLE)
succeeds with VARIABLE uninstantiated (rather than instantiated to an assignment), then the error will not be detected.
- A list of frequently asked questions about the assignment
- How to submit your assignment:
Prepare your solution as a single file containing all the code necessary to run your
model checker. This includes the tokenizer code you use, but should exclude the testing
code made available. We will be running some different testing code!
Call the file containing your assignment check.P.
Both XSB and IPROLOG solutions are acceptable.
To help us distinguish between XSB code and IPROLOG code, the first line of
your program should read "%IPROLOG" or "%XSB".
To submit, from the directory containing your assignment, type
"give cs2411 prolog check.P"
- Grading of the assignment : The grading scheme will be as folllows:
- (6 marks) parsing: this section will run some automated tests on your submission to check that
it incorporates an adequate parser for the programming language. To facilitate this, ensure that your
code includes a predicate parse(File) that succeeds if and only if File contains a syntactically correct program.
(This will allow the code of people who only get as far as doing the parser to be graded. You are still required to
have your predicate check behave as described below for credit beyond the parser section.)
- (6 marks) model checking, basic part: this section will test various aspects of the predicate "check": see the "important message" below.
The tests run here will resemble those in the samples and testing code that has already been released, for the cases where the
program is syntactically correct.
- (4 marks) while loops: this will test the predicate "check" for programs containing while loops.
- (4 marks) code inspection : this section will be done by a manual inspection of your code for style and
evidence of effort beyond that which may be reflected in the results of the automated tests. If you did not
quite get some parts to work but you believe you deserve some credit for what you have done, include
a commented (using %) description in your program to explain what you were trying to do and why you should get some credit.
IMPORTANT MESSAGE : In order to facilitate automated grading of your
submission, note the following clarifications of/changes to the requirements.
Running the testcases above is a good way to ensure you are satisfying these requirements. See the README and testingcode.P files enclosed
with the test cases.
- Since there appears to be some inconsistency in iprolog and xsb's handling of pairs (X,Y), the representation of the initial and final assignments I and F in the call check(File,I,O) should be a list of terms of the form
val(Variable,Truthvalue).
- When File contains a syntax error, the call check(File,I,O) should return the single answer I = syntaxerror, O= syntaxerror.
- When File contains a program that does not terminate for
an initial assignment I satisfying the initialcondition, the call
check(File,I,O) should return the answer O = nonterminating.
(This is in addition to the answers that would usually be generated
for the cases where the program terminates but the final state
does not satisfy the final condition.) See sample20 in the testcases.
Remarks on grading of the Prolog Assignment
- Testcases used for assessment of the prolog assignment are
here
- Note that automarking code with a somewhat complex behaviour has
its advantages and disadvantages. It is possible to pass tests
accidentally, not because you have done the work necessary to pass the
test but because your code behaves in ways not anticipated by the test
construction. There appears to have been some of this in this
case. In general, these accidental marks have been left unadjusted.
- The "inspection" marks were used to adjust for cases where
automarking did not reflect the actual effort put into your
submission. If you scored low on automarking but had clearly put in a
lot of effort then you were compensated in the inspection marks.
Conversely, students who passed all or most of the tests but had put
in less effort than others in documenting their code lost some
inspection marks.
Suggestions or bugs report to cs2411@cse.unsw.edu.au
Last Modified: 28 Feb 2000