fmidue / logic-tasks

0 stars 1 forks source link

logic-tasks Haskell CI

Mapping from Autotool to relevant modules in this repository

in Autotool inventory (on https://autotool.fmi.uni-due.de) Direct Quiz Autotool module (in collection/src) logic-tasks module(s)
Aussagenlogik/Syntax/LogicComposeFormula x Logic.Syntax.ComposeFormula LogicTasks.Syntax.ComposeFormula, Tasks.ComposeFormula.Quiz
Aussagenlogik/Syntax/LogicDecomposeFormula x Logic.Syntax.DecomposeFormula LogicTasks.Syntax.DecomposeFormula, Tasks.DecomposeFormula.Quiz
Aussagenlogik/Syntax/LogicInvalidCnfs x Logic.Syntax.LegalCnf LogicTasks.Syntax.IllegalCnfs, Tasks.LegalCNF.Quiz
Aussagenlogik/Syntax/LogicInvalidFormulas x Logic.Syntax.LegalFormula LogicTasks.Syntax.IllegalFormulas, Tasks.LegalProposition.Quiz
Aussagenlogik/Syntax/LogicRemoveBrackets x Logic.Syntax.SimplestFormula LogicTasks.Syntax.SimplestFormula, Tasks.SuperfluousBrackets.Quiz
Aussagenlogik/Syntax/LogicSubformulas x Logic.Syntax.SubFormula LogicTasks.Syntax.SubTreeSet, Tasks.SubTree.Quiz
Aussagenlogik/Syntax/LogicTreeToFormula x Logic.Syntax.TreeToFormula LogicTasks.Syntax.TreeToFormula, Tasks.TreeToFormula.Quiz
Aussagenlogik/Semantik/Wahrheitstabellen/TruthTableFillGaps x x Logic.Semantics.FillGaps LogicTasks.Semantics.Fill
Aussagenlogik/Semantik/Wahrheitstabellen/TruthTableChooseForFormula x x Logic.Semantics.ChooseTable LogicTasks.Semantics.Pick
Aussagenlogik/Semantik/Wahrheitstabellen/TruthTableFindMistakes x x Logic.Semantics.FindMistakes LogicTasks.Semantics.Decide
Aussagenlogik/Semantik/Wahrheitstabellen/TruthTableMaxterm x x Logic.Semantics.MaxTerm LogicTasks.Semantics.Max
Aussagenlogik/Semantik/Wahrheitstabellen/TruthTableMinTerm x x Logic.Semantics.MinTerm LogicTasks.Semantics.Min
Aussagenlogik/Semantik/Resolution/LogicResolutionStep x x Logic.Semantics.ResolutionStep LogicTasks.Semantics.Step
Aussagenlogik/Semantik/Resolution/LogicResolutionComplete x x Logic.Semantics.ResolutionFull LogicTasks.Semantics.Resolve
Aussagenlogik/Semantik/Resolution/PrologResolutionStep x x Logic.Semantics.ResolutionStepProlog LogicTasks.Semantics.Prolog

Testing a module

You can use the testModule function in order to test a module. A sample call looks like this:

$ stack repl
ghci> testModule (Just AutoLeijen) German (genFillInst dFillConf) LogicTasks.Semantics.Fill.description LogicTasks.Semantics.Fill.partialGrade LogicTasks.Semantics.Fill.completeGrade parser

This specific call tests the Fill module (found in src/LogicTasks/Semantics/Fill.hs). The output looks like this:

Betrachten Sie die folgende Formel:>>>> <F = (¬A ∨ ¬B) ∧ (A ∨ B) ∧ (B ∨ ¬C) ∧ (A ∨ B ∨ D)> <<<<

Füllen Sie in der zugehörigen Wahrheitstafel alle Lücken mit einem passenden Wahrheitswert (Wahr oder Falsch).>>>> <A | B | C | D | F
--|---|---|---|--
0 | 0 | 0 | 0 | 0
0 | 0 | 0 | 1 | -
0 | 0 | 1 | 0 | 0
0 | 0 | 1 | 1 | 0
0 | 1 | 0 | 0 | 1
0 | 1 | 0 | 1 | -
0 | 1 | 1 | 0 | 1
0 | 1 | 1 | 1 | -
1 | 0 | 0 | 0 | -
1 | 0 | 0 | 1 | 1
1 | 0 | 1 | 0 | 0
1 | 0 | 1 | 1 | -
1 | 1 | 0 | 0 | 0
1 | 1 | 0 | 1 | 0
1 | 1 | 1 | 0 | -
1 | 1 | 1 | 1 | 0

> <<<<

Geben Sie als Lösung eine Liste der fehlenden Wahrheitswerte an, wobei das erste Element der Liste der ersten Lücke von oben entspricht, das zweite Element der zweiten Lücke, etc.
Die Eingabe der Werte kann binär (0 = falsch, 1 = wahr), ausgeschrieben (falsch, wahr) oder als Kurzform (f, w) erfolgen.
>>>>Ein Lösungsversuch im Fall von vier Lücken könnte beispielsweise so aussehen: <[0,1,1,1]> <<<<

Just ()
[0,1,1,1,0,1]
---- Input ----
[TruthValue {truth = False},TruthValue {truth = True},TruthValue {truth = True},TruthValue {truth = True},TruthValue {truth = False},TruthValue {truth = True}]
---- Prettified Input ----
[False
,True
,True
,True
,False
,True]
---- Partial ----
Lösung hat korrekte Länge?
>>>> <Ja.> <<<<

Just ()
---- Complete ----
Lösung ist korrekt?
>>>> <Nein.> <<<<

>>>>Die Lösung beinhaltet 1 Fehler.<<<<
Nothing

In more detail: