0% found this document useful (0 votes)
29 views2 pages

Quiz 2

Students are instructed to prepare for a quiz by putting away books and papers, removing hats or turning brim backwards, having their name and student ID written on a piece of paper, keeping their eyes on their own paper, and turning in their paper when finished. The quiz will last 10 minutes and papers are to be turned in on the first pass of the instructor's aisle.

Uploaded by

api-3812391
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views2 pages

Quiz 2

Students are instructed to prepare for a quiz by putting away books and papers, removing hats or turning brim backwards, having their name and student ID written on a piece of paper, keeping their eyes on their own paper, and turning in their paper when finished. The quiz will last 10 minutes and papers are to be turned in on the first pass of the instructor's aisle.

Uploaded by

api-3812391
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Quiz!

• Books and papers put away


• Hats off or brims turned backwards
• Piece of paper out
- Name and Student ID on it
• Your work is your own
- Eyes on your own paper
- Protect your own paper
- Turn your paper over when you’re done
• You have 10 minutes
• Turn in papers on first pass by your aisle
Quiz 2 – Type Checking
Suppose Oberon had an Enumerated Set type that can be a set of any finite
atomic type (BOOLEANS and ranges of INTEGER):
VAR smallIntSet: SET OF 1..10;
VAR boolSet1, boolSet2: SET OF BOOLEAN;
BEGIN
smallIntSet := smallIntSet ++ 5;(* insert 5 into set *)
boolSet1 := boolSet1 ++ boolSet2; (* union two sets *)
END
Based on the the Expression Compatibility table for the SET type, below,
write a “complete” Oberon type checking testcase for the SET type.
Operator | first operand second operand result type
------------------------------------------------------------------------------------
++ -- ** | SET OF T T SET OF T
| T SET OF T SET OF T
| SET OF T SET OF T SET OF T

Hint: Expanding this table to include erroneous types (the illegal cases) will
help you derive a complete testcase.
Hint: You may use symmetries (e.g., commutativity) to reduce the number of
cases you write down, but you must note the symmetries in your answer.

You might also like