


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Instructions:
This test is 4 pages in length.
You have 75 minutes to complete and turn in this test.
Short-answer questions include a guideline for how many sentences to write. Respond in complete English sentences.
This test is closed books, notes, papers, friends, neighbors, etc.
Use the backs of pages in this test packet for scratch work. If you write more than a final answer in the area next to a question, circle your final answer.
Write and sign the following: โI pledge my Honor that I have not cheated, and will not cheat, on this test.โ
Signed: ______________________________________________
What are first-class functions? [1-2 sentences]
b) Rewrite your example from Part (a) into an equivalent program that does not violate the value restriction.
b) What type does filter have?
a) Define inference rules for greater-than and less-than judgments over natural numbers. The judgment forms are: N 1 >N 2 and N 1 <N 2. Recall that N 1 and N 2 , being natural numbers, adhere to our definition of natural numbers (N nat), as discussed in class.
b) Using your definitions of greater-than and less-than, prove that for all natural numbers N 1 and N 2 : (N 1 >N 2 ) if and only if (N 2 <N 1 ).
c) Prove that your less-than operator is transitive , i.e., for all natural numbers N 1 , N 2 , and N 3 : if N 1 <N 2 and N 2 <N 3 then N 1 <N 3.