Lab3 B - F4

40 views
Skip to first unread message

Elise

unread,
Dec 3, 2018, 11:11:24 AM12/3/18
to 2018 Functional Programming TDA452 / DIT 143
Hello,

We have a problem with the question F4:
Define a property:
prop_SolveSound :: Sudoku -> Property
that says that the function solve is sound. Soundness means that every supposed solution produced by solve actually is a valid solution of the original problem.

First we're not sure we understand the question, do we just check that "solve" output a filled and correct sudoku?
We also wonder what the data type Property should be, as all the other checks used Bool.

Thank you

Thomas Hallgren

unread,
Dec 3, 2018, 11:34:46 AM12/3/18
to Elise, 2018 Functional Programming TDA452 / DIT 143
Hello,

The property in F4 tests that the solve function doesn't return any fake solutions, and you can use isSolutionOf from F3 to define it.

Using Property instead of Bool when you define a property makes it possible to use more functions from the QuickCheck library, e.g. the ==> operator and the forAll function. But if you don't need to use those functions, the type can be Bool. This applies to all the properties you define.

Best regards,
Thomas Hallgren

--
You received this message because you are subscribed to the Google Groups "2018 Functional Programming TDA452 / DIT 143" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chalmers-fp-20...@googlegroups.com.
To post to this group, send email to chalmers...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chalmers-fp-2018/dad7d0c0-d0ca-49af-936d-47d5d7256543%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages