Podcast
Questions and Answers
Arrays in imperative and object-oriented programming languages can be understood as mappings from type S to type T?
Arrays in imperative and object-oriented programming languages can be understood as mappings from type S to type T?
True
The cardinality of S → T is always equal to #(S) multiplied by #(T)?
The cardinality of S → T is always equal to #(S) multiplied by #(T)?
False
A mapping m : S → T means that every value in set S is mapped to every value in set T?
A mapping m : S → T means that every value in set S is mapped to every value in set T?
False
If m1 = {u → a, v → c} and m2 = {u → c, v → c}, then the image of v under m1 is c?
If m1 = {u → a, v → c} and m2 = {u → c, v → c}, then the image of v under m1 is c?
Signup and view all the answers
In Ada, the index range for arrays may include Float as a primitive (sub)type.
In Ada, the index range for arrays may include Float as a primitive (sub)type.
Signup and view all the answers
The type of a function with a single argument of type S and its result of type T is represented as S → T.
The type of a function with a single argument of type S and its result of type T is represented as S → T.
Signup and view all the answers
The type declaration 'type Pixel is array (Color) of Boolean;' creates an array of Booleans indexed by the elements of 'Color'.
The type declaration 'type Pixel is array (Color) of Boolean;' creates an array of Booleans indexed by the elements of 'Color'.
Signup and view all the answers
"type Xrange is range 0 .. 511;
type Yrange is range 0 .. 255;
type Window is
array (YRange, XRange) of Pixel;"
The cardinality of the 'Window' type, which is an array of 'Pixel', is 8^256 × 512.
"type Xrange is range 0 .. 511; type Yrange is range 0 .. 255; type Window is array (YRange, XRange) of Pixel;" The cardinality of the 'Window' type, which is an array of 'Pixel', is 8^256 × 512.
Signup and view all the answers
In a disjoint union, a value is chosen from one of several different types represented by S + T.
In a disjoint union, a value is chosen from one of several different types represented by S + T.
Signup and view all the answers
What is the cardinality of the type 'Integer-List' defined as nil + cons(Integer × Integer-List)?
What is the cardinality of the type 'Integer-List' defined as nil + cons(Integer × Integer-List)?
Signup and view all the answers
In the context of lists, what does it mean for a list to be heterogeneous?
In the context of lists, what does it mean for a list to be heterogeneous?
Signup and view all the answers
What is the primary characteristic of a recursive type?
What is the primary characteristic of a recursive type?
Signup and view all the answers
In the context of lists, what is the purpose of the tail of a non-empty list?
In the context of lists, what is the purpose of the tail of a non-empty list?
Signup and view all the answers
What differentiates a composite type from a primitive type?
What differentiates a composite type from a primitive type?
Signup and view all the answers
Which of the following best describes the data structure used in the given Java list class declaration?
Which of the following best describes the data structure used in the given Java list class declaration?
Signup and view all the answers
"type IntNode;
type IntList is access IntNode;
type IntNode is record
data: Integer;
tail: IntList;
end record;"
In the given Ada list type declaration, what does the 'access' keyword indicate about the 'IntList'?
"type IntNode; type IntList is access IntNode; type IntNode is record data: Integer; tail: IntList; end record;" In the given Ada list type declaration, what does the 'access' keyword indicate about the 'IntList'?
Signup and view all the answers
What is the fundamental difference between how strings are treated in Haskell and Ada?
What is the fundamental difference between how strings are treated in Haskell and Ada?
Signup and view all the answers
Which programming languages are examples of statically typed languages?
Which programming languages are examples of statically typed languages?
Signup and view all the answers
What is the distinguishing feature of dynamically typed programming languages?
What is the distinguishing feature of dynamically typed programming languages?
Signup and view all the answers