Notice: There was a typo in the old version. Here goes the new version: DIRECTIVES FOR PREPARING AND SUBMITTING ASSIGNMENT 3 Marcus V. Santos 1- Introduction ============ Next are some directives that I *strongly* recommend you to follow when submitting your assignments. Please spare some time and read it carefully. First some information on marking: As for your Scheme functions and Prolog predicates, 10% of the marks will be for documentation, 10% for functional/logical programming style, 10% for proper testing, and 70% for correctness. IMPORTANT: if you do not submit the terminal session containing the testing of the main functions/predicates of the assignment, you will receive 0 (zero) marks for that part. for more information on how to test your functions/predicates, see section 3. 2- Preparing your Assignment ========================= You will have to document your code (Scheme and Prolog) as follows: For each Scheme/Prolog function/predicate you will have to specify what is the PURPOSE of the function/predicate, what are the ASSUMPTIONS, and what are AUXILIARY FUNCTIONS CALLED. E.g: Suppose you are asked to implement a Scheme function to append flat lists of integers, and also a Prolog predicate that does the same. Next is the commented Scheme and Prolog codes: ;PURPOSE: This function takes as arguments two lists of integers and ;returns a list which is the input lists appended . ;ASSUMPTIONS: The input lists are not nested ;AUXILIARY FUNCTIONS CALLED: none (define (append L1 L2) (if (null? L1) L2 (cons (car L1) (append (cdr L1) L2)))) Now the documented Prolog code: %PURPOSE: This predicate takes as arguments two lists of integers and %returns in the last argument a list which is the input lists appended . %ASSUMPTIONS: The input lists are not nested %AUXILIARY FUNCTIONS CALLED: none append([], L, L) :- !. append([X|R], L1, [X|R2]) :- append(R, L1, R2). 3- Testing your Functions/Predicares ================================= You will have to run your functions/predicates on test cases and generate two terminal sessions (one for Scheme and another for Prolog), containing the results. If you don't know how to generate a record of a terminal session, type the following command on the UNIX prompt: man script As for preparing your test cases, you should keep in mind that a test case should encompass: - trivial solutions, e.g., stop condition for recursion; - more elaborate cases, i.e., those that are "almost" stop conditions; and - and complex cases, e.g., nested lists (if this is the case), or more elaborate data structures. E.g.: Three test cases for "append" (using Scheme notation): - (append '() '()) - (append '(1 2 3) '()) - (append '(1 2 3) '(3 4 5)) Again, each terminal session will contain the responses Scheme and Prolog return when you test the functions/predicates with your test cases. AGAIN: if you do not submit the terminal session containing the testing of the main functions/predicates of the assignment, you will receive 0 (zero) marks for that part. Next, some general directives on how to prepare the hardcopy. 4 - The Hardcopy (Documented Programs and terminal sessions) ======================================================== General directives to prepair your hardcopy: a- Organize the items sequentially, i.e., according to the assignment b- *Highlight* the number (letter) of the item (e.g., using those fluorescent pens) c- If you are printing "double-side", make sure both sides are properly oriented d- The terminal sessions should be printed and stapled separately, according to directives a-c. e- PUT EVERYTHING IN AN ENVELOPE AND PRINT YOUR NAME AND NUMBER ON IT. Next, some general directives on how to prepare the "softcopy" (electronic submission). 5- The Electronic Copy (Programs, terminal sessions) ================================================= General directives: a- submit 4 files: one with your documented Scheme functions (file name: sch), one with your Scheme terminal session (file name: schts), one with your documented Prolog programs (file name: pro.P), and one with your Prolog terminal session (file name: prots) . a.1- The submit command is: submitcsc326f 3 sch schts pro.P prots b- MAKE SURE THE ONLY UNCOMMENTED THINGS IN YOUR PROGRAMS (SCHEME AND PROLOG) ARE YOUR FUNCTION/PREDICATE DEFINITIONS; OTHER UNCOMMENTED STUFF might prevent me from loading and properly executing your program. ***IF THE PROGRAM RESPECTIVE TO SOME PART OF YOUR ASSIGNMENT CAN NOT BE EXECUTED, I WILL CONSIDER 0 (ZERO) MARKS FOR THAT PART*** c- DO NOT mix program (function/predicate definitions) & terminal session (test cases for that function) Hello everyone, Next are some directives that I *strongly* recommend you to follow when submitting your assignments. Please spare some time and read it carefully. First some information on marking: As for your Scheme functions and Prolog predicates, 10% of the marks will be for documentation, 10% for functional/logical programming style, 10% for proper testing, and 70% for correctness. IMPORTANT: if you do not present the testing of the main functions/predicates of the assignment, you will receive 0 (zero) marks for that part. More information on how to test your function, see section 2. Now some information on how to prepare your assignment: 1- You will have to document your code (Scheme and Prolog) as follows: For each Scheme/Prolog function/predicate you will have to specify what is the PURPOSE of the function/predicate, what are the ASSUMPTIONS, and what are AUXILIARY FUNCTIONS CALLED. E.g: Suppose you are asked to implement a Scheme function to append flat lists of integers, and also a Prolog predicate that does the same. Next is the commented Scheme and Prolog codes: ;PURPOSE: This function takes as arguments two lists of integers and ;returns a list which is the input lists appended . ;ASSUMPTIONS: The input lists are not nested ;AUXILIARY FUNCTIONS CALLED: none (define (append L1 L2) (if (null? L1) L2 (cons (car L1) (append (cdr L1) L2)))) Now the documented Prolog code: %PURPOSE: This predicate takes as arguments two lists of integers and %returns in the last argument a list which is the input lists appended . %ASSUMPTIONS: The input lists are not nested %AUXILIARY FUNCTIONS CALLED: none append([], L, L) :- !. append([X|R], L1, [X|R2]) :- append(R, L1, R2). 2- You will have to run your functions/predicates on test cases and generate two terminal sessions (one for Scheme and another for Prolog), containing the results. How to prepare your test cases. A test case should encompass: - trivial solutions, e.g., stop condition for recursion; - more elaborate cases, i.e., those that are "almost" stop conditions; and - and complex cases, e.g., nested lists (if this is the case), or more elaborate data structures. E.g.: Three test cases for "append" (using Scheme notation): - (append '() '()) - (append '(1 2 3) '()) - (append '(1 2 3) '(3 4 5)) Again, each terminal session will contain the responses Scheme and Prolog return when you test the functions/predicates with your test cases. AGAIN: if you do not present the testing of the main functions/predicates of the assignment, you will receive 0 (zero) marks for that part. Now some general directives on how to prepare the hardcopy and "soft"-copy (electronic submission): General directives: 1- Hard-copy (Documented Programs and terminal sessions) 1.1- Organize the items sequentially, i.e., according to the assignment 1.2- *Highlight* the number (letter) of the item (e.g., using those fluorescent pens) 1.3- If you are printing "double-side", make sure both sides are properly oriented 1.4- The terminal sessions should be printed and stapled separately, according to directives 1.1-1.3 1.5- PUT EVERYTHING IN AN ENVELOPE AND PRINT YOUR NAME AND NUMBER ON IT. 2- Electronic copy (Programs, terminal sessions) 2.1- submit 4 files: one with your documented Scheme functions (file name: sch), one with your Scheme terminal session (file name: schts), one with your documented Prolog programs (file name: pro.P), one with your Scheme terminal session (file name: prots) . 2.1.1- the submit command is: submitcsc326f 3 sch schts pro.P prots 2.2- MAKE SURE THE ONLY UNCOMMENTED THINGS IN YOUR PROGRAMS (SCHEME AND PROLOG) ARE YOUR FUNCTION/PREDICATE DEFINITIONS; OTHER UNCOMMENTED STUFF might prevent me from loading and properly executing your program. ***IF THE PROGRAM RESPECTIVE TO SOME PART OF YOUR ASSIGNMENT CAN NOT BE EXECUTED, I WILL CONSIDER 0 (ZERO) MARKS FOR THAT PART*** 2.4- DO NOT mix program (function/predicate definitions) & terminal session (test cases for that function) 1- Introduction ============ Next are some directives that I *strongly* recommend you to follow when submitting your assignments. Please spare some time and read it carefully. First some information on marking: As for your Scheme functions and Prolog predicates, 10% of the marks will be for documentation, 10% for functional/logical programming style, 10% for proper testing, and 70% for correctness. IMPORTANT: if you do not present the testing of the main functions/predicates of the assignment, you will receive 0 (zero) marks for that part. More information on how to test your function, see section 3. 2- Preparing your Assignment ========================= You will have to document your code (Scheme and Prolog) as follows: For each Scheme/Prolog function/predicate you will have to specify what is the PURPOSE of the function/predicate, what are the ASSUMPTIONS, and what are AUXILIARY FUNCTIONS CALLED. E.g: Suppose you are asked to implement a Scheme function to append flat lists of integers, and also a Prolog predicate that does the same. Next is the commented Scheme and Prolog codes: ;PURPOSE: This function takes as arguments two lists of integers and ;returns a list which is the input lists appended . ;ASSUMPTIONS: The input lists are not nested ;AUXILIARY FUNCTIONS CALLED: none (define (append L1 L2) (if (null? L1) L2 (cons (car L1) (append (cdr L1) L2)))) Now the documented Prolog code: %PURPOSE: This predicate takes as arguments two lists of integers and %returns in the last argument a list which is the input lists appended . %ASSUMPTIONS: The input lists are not nested %AUXILIARY FUNCTIONS CALLED: none append([], L, L) :- !. append([X|R], L1, [X|R2]) :- append(R, L1, R2). 3- Testing your Functions/Predicares ================================= You will have to run your functions/predicates on test cases and generate two terminal sessions (one for Scheme and another for Prolog), containing the results. How to prepare your test cases. A test case should encompass: - trivial solutions, e.g., stop condition for recursion; - more elaborate cases, i.e., those that are "almost" stop conditions; and - and complex cases, e.g., nested lists (if this is the case), or more elaborate data structures. E.g.: Three test cases for "append" (using Scheme notation): - (append '() '()) - (append '(1 2 3) '()) - (append '(1 2 3) '(3 4 5)) Again, each terminal session will contain the responses Scheme and Prolog return when you test the functions/predicates with your test cases. AGAIN: if you do not present the testing of the main functions/predicates of the assignment, you will receive 0 (zero) marks for that part. Next, some general directives on how to prepare the hardcopy. 4 - The Hardcopy (Documented Programs and terminal sessions) ======================================================== General directives to prepair your hardcopy: a- Organize the items sequentially, i.e., according to the assignment b- *Highlight* the number (letter) of the item (e.g., using those fluorescent pens) c- If you are printing "double-side", make sure both sides are properly oriented d- The terminal sessions should be printed and stapled separately, according to directives a-c. e- PUT EVERYTHING IN AN ENVELOPE AND PRINT YOUR NAME AND NUMBER ON IT. Next, some general directives on how to prepare the "softcopy" (electronic submission). 5- The Electronic Copy (Programs, terminal sessions) ================================================= General directives: a- submit 4 files: one with your documented Scheme functions (file name: sch), one with your Scheme terminal session (file name: schts), one with your documented Prolog programs (file name: pro.P), one with your Scheme terminal session (file name: prots) . a.1- the submit command is: submitcsc326f 3 sch schts pro.P prots b- MAKE SURE THE ONLY UNCOMMENTED THINGS IN YOUR PROGRAMS (SCHEME AND PROLOG) ARE YOUR FUNCTION/PREDICATE DEFINITIONS; OTHER UNCOMMENTED STUFF might prevent me from loading and properly executing your program. ***IF THE PROGRAM RESPECTIVE TO SOME PART OF YOUR ASSIGNMENT CAN NOT BE EXECUTED, I WILL CONSIDER 0 (ZERO) MARKS FOR THAT PART*** c- DO NOT mix program (function/predicate definitions) & terminal session (test cases for that function)