Quiz Yourself on Thinking in Properties
Solve a short quiz to test your understanding of the concepts of thinking in properties.
Quiz on the concepts of Thinking in Properties
1
The following property uses a model to validate that it works well. However, the property is failing.
prop_set_union() ->
?FORALL({ListA, ListB}, {list(number()), list(number())},
begin
SetA = sets:from_list(ListA),
SetB = sets:from_list(ListB),
ModelUnion = lists:sort(ListA ++ ListB),
lists:sort(sets:to_list(sets:union(SetA, SetB))) =:= ModelUnion
end).
Is the following statement about the code above true or false?
(True or False) “The problem is with the model. Sets don’t generally allow duplicate elements.”
A)
True
B)
False
Question 1 of 30 attempted
Get hands-on with 1400+ tech skills courses.