fmidue / logic-tasks

0 stars 1 forks source link

minDepth in SynTreeConfig #77

Closed jvoigtlaender closed 8 months ago

jvoigtlaender commented 10 months ago

Additionally to these: https://github.com/fmidue/logic-tasks/blob/1c4fc6e77b883dcf850a5714d0cfef97fcdc9bbb/src/Tasks/SynTree/Config.hs#L25-L29 it would make sense to also introduce minDepth (if only for the purpose of being able as a lecturer to set minDepth == maxDepth and thus mandate a specific depth for all student instances).

In genSynTree, a minDepth-constraint could simply be added to the two suchThats here: https://github.com/fmidue/logic-tasks/blob/1c4fc6e77b883dcf850a5714d0cfef97fcdc9bbb/src/Trees/Generate.hs#L29-L32 and here: https://github.com/fmidue/logic-tasks/blob/1c4fc6e77b883dcf850a5714d0cfef97fcdc9bbb/src/Trees/Generate.hs#L38-L39

(BTW, it probably makes sense on this occasion to refactor genSynTree so that the largely duplicated code in the two branches of if maxConsecutiveNegations /= 0 is de-duplicated.)

In https://github.com/fmidue/logic-tasks/blob/1c4fc6e77b883dcf850a5714d0cfef97fcdc9bbb/src/Tasks/SynTree/Config.hs#L54 a few more checks could be added to check for sanity of the new minDepth setting, probably relative to minNodes, maxNodes and maxDepth.

jvoigtlaender commented 8 months ago

Being addressed in #111.