You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Exercise 2 and 3
The random set generator is missing
Exercise 6
(@@) :: Eq a => Rel a -> Rel a -> Rel a
(Set r) @@ (Set s) = Set $ nub [ (x,z) | (x,y) <- r, (w,z) <- s, y == w ]
is wrong. Must be
(@@) :: Eq a => Rel a -> Rel a -> Rel a
(Set r) @@ (Set s) = Set $ sort.nub [ (x,z) | (x,y) <- r, (w,z) <- s, y == w ]
This error makes also this definition wrong
trClos :: Ord a => Rel a -> Rel a
trClos set = apprx [foldl1 unionSet (take n rs) | n <- [1..]]
where rs = iterate (set @@) set
apprx (x:y:zs) = if x == y then x else apprx (y:zs)
The call of sort is missing
Exercise 7
The property that the transitive closure is minimal is missing.
This is a nice idea:
-- Define Rel as a Set, to keep using Set operations and to be able to use the above implemented
-- operations.
A pity that sort was forgotten.
The text was updated successfully, but these errors were encountered:
Exercise 2 and 3
The random set generator is missing
Exercise 6
is wrong. Must be
This error makes also this definition wrong
The call of
sort
is missingExercise 7
The property that the transitive closure is minimal is missing.
This is a nice idea:
A pity that
sort
was forgotten.The text was updated successfully, but these errors were encountered: