[{"name":"LogicUS.PL.DPLL","comment":" The module provides the tools for applying the DPLL algorithm to solve the fesibility of a set of propositional clauses and calculates its models if they exist.\n\n\n# DPLL TABLEAU\n\n@docs DPLLTableau\n\n\n# DPLL Algorithm\n\n@docs dpll, dpllTableauModels\n\n\n# Representation\n\n@docs dpllTableauToString, dpllTableauToDOT\n\n","unions":[],"aliases":[{"name":"DPLLTableau","comment":" Defines the DPLL Tableau type as a Graph whose node labels are pairs of an integer (0: internal node, 1: open leaf, -1: closed leaf) and the set of PL clauses considered in the corresponding node; and a edge label is just the literal which is propagated.\n","args":[],"type":"Graph.Graph ( Basics.Int, List.List LogicUS.PL.NFC.ClausePL ) LogicUS.PL.SintaxSemantics.Literal"}],"values":[{"name":"dpll","comment":" It computes DPLL algorithm given the result and the process as a DPLL Tableau\n\n    cs1 =\n        [ [ Neg (Atom \"r\"), Atom \"p\", Atom \"q\" ], [ Neg (Atom \"p\"), Atom \"r\" ], [ Neg (Atom \"q\"), Atom \"r\" ], [ Neg (Atom \"s\"), Atom \"p\" ], [ Atom \"s\", Atom \"r\", Atom \"t\" ], [ Neg (Atom \"p\") ], [ Neg (Atom \"q\") ], [ Neg (Atom \"t\") ] ]\n\n    t1 =\n        dpll cs1\n\n    cs2 =\n        [ [ Neg (Atom \"r\"), Atom \"p\", Atom \"q\" ], [ Neg (Atom \"p\"), Atom \"r\" ], [ Neg (Atom \"q\"), Atom \"r\" ], [ Neg (Atom \"s\"), Atom \"p\" ], [ Atom \"s\", Atom \"r\", Atom \"t\" ], [ Neg (Atom \"p\") ] ]\n\n    t2 =\n        dpll cs2\n\n","type":"List.List LogicUS.PL.NFC.ClausePL -> LogicUS.PL.DPLL.DPLLTableau"},{"name":"dpllTableauModels","comment":" Gets the Tableau DPLL models. It requires a set of reference symbols that are added to those present in the tableau since in the transformation to clauses some symbols may have disappeared.\n\n    dpllTableauModels [] t1 == []\n\n    dpllTableauModels [] t2 == [ [ \"q\", \"r\" ], [ \"q\", \"r\", \"t\" ], [ \"t\" ] ]\n\n","type":"List.List LogicUS.PL.SintaxSemantics.PSymb -> LogicUS.PL.DPLL.DPLLTableau -> List.List LogicUS.PL.SintaxSemantics.Interpretation"},{"name":"dpllTableauToDOT","comment":" Express a DPLL Tableau as a string in DOT format that is viewable with a GraphViz Render.\n\n**Note:** If you are using elm repl, before introducing the code you must replace _\\\\n_ by _\\\\n_ and _\\\\\"_ by _\"_ in a simple text editor.\n\n    dpllTableauToDOT t1 == \"digraph G {\\n  rankdir=TB\\n  graph []\\n  node [shape=box, color=black]\\n  edge [dir=none, color=blue, fontcolor=blue]\\n\\n  0 -> 1 [label=\\\"¬ p\\\"]\\n  1 -> 2 [label=\\\"¬ s\\\"]\\n  2 -> 3 [label=\\\"¬ q\\\"]\\n  3 -> 4 [label=\\\"¬ r\\\"]\\n  4 -> 5 [label=\\\"t\\\"]\\n\\n  0 [label=\\\"{¬ r, p, q}, {¬ s, p}, {s, r, t}, {¬ p}, {¬ q}, {¬ t}\\\"]\\n  1 [label=\\\"{¬ r, q}, {¬ s}, {s, r, t}, {¬ q}, {¬ t}\\\"]\\n  2 [label=\\\"{¬ r, q}, {r, t}, {¬ q}, {¬ t}\\\"]\\n  3 [label=\\\"{¬ r}, {r, t}, {¬ t}\\\"]\\n  4 [label=\\\"{t}, {¬ t}\\\"]\\n  5 [label=\\\"□\\\"]\\n}\"\n\n    dpllTableauToDOT t2 = \"digraph G {\\n  rankdir=TB\\n  graph []\\n  node [shape=box, color=black]\\n  edge [dir=none, color=blue, fontcolor=blue]\\n\\n  0 -> 1 [label=\\\"¬ p\\\"]\\n  1 -> 2 [label=\\\"¬ s\\\"]\\n  2 -> 3 [label=\\\"r\\\"]\\n  2 -> 5 [label=\\\"¬ r\\\"]\\n  3 -> 4 [label=\\\"q\\\"]\\n  5 -> 6 [label=\\\"¬ q\\\"]\\n  6 -> 7 [label=\\\"t\\\"]\\n\\n  0 [label=\\\"{¬ r, p, q}, {¬ q, r}, {¬ s, p}, {s, r, t}, {¬ p}\\\"]\\n  1 [label=\\\"{¬ r, q}, {¬ q, r}, {¬ s}, {s, r, t}\\\"]\\n  2 [label=\\\"{¬ r, q}, {¬ q, r}, {r, t}\\\"]\\n  3 [label=\\\"{q}\\\"]\\n  4 [label=\\\"◯\\\"]\\n  5 [label=\\\"{¬ q}, {t}\\\"]\\n  6 [label=\\\"{t}\\\"]\\n  7 [label=\\\"◯\\\"]\\n}\"\n\n","type":"LogicUS.PL.DPLL.DPLLTableau -> String.String"},{"name":"dpllTableauToString","comment":" Express a DPLL Tableau as a string.\n\n    dpllTableauToString t1 == \"Graph [Node 0 ({¬ r, p, q}, {¬ s, p}, {s, r, t}, {¬ p}, {¬ q}, {¬ t}), Node 1 ({¬ r, q}, {¬ s}, {s, r, t}, {¬ q}, {¬ t}), Node 2 ({¬ r, q}, {r, t}, {¬ q}, {¬ t}), Node 3 ({¬ r}, {r, t}, {¬ t}), Node 4 ({t}, {¬ t}), Node 5 (□)] [Edge 4->5 (t), Edge 3->4 (¬ r), Edge 2->3 (¬ q), Edge 1->2 (¬ s), Edge 0->1 (¬ p)]\"\n\n    dpllTableauToString t2 == \"Graph [Node 0 ({¬ r, p, q}, {¬ q, r}, {¬ s, p}, {s, r, t}, {¬ p}), Node 1 ({¬ r, q}, {¬ q, r}, {¬ s}, {s, r, t}), Node 2 ({¬ r, q}, {¬ q, r}, {r, t}), Node 3 ({q}), Node 4 (◯), Node 5 ({¬ q}, {t}), Node 6 ({t}), Node 7 (◯)] [Edge 6->7 (t), Edge 5->6 (¬ q), Edge 3->4 (q), Edge 2->5 (¬ r), Edge 2->3 (r), Edge 1->2 (¬ s), Edge 0->1 (¬ p)]\"\n\n","type":"LogicUS.PL.DPLL.DPLLTableau -> String.String"}],"binops":[]},{"name":"LogicUS.PL.NFC","comment":" The module provides the tools for express formulas in their NN, CNF, DNF and Clausal Form.\n\n\n# Normal Forms\n\n@docs fplContainsEquiv, fplRemoveAllEquiv, fplContainsImpl, fplRemoveAllImpl, fplInteriorizeAllNeg, fplInteriorizeAllDisj, fplInteriorizeAllConj, fplToNNF, fplToCNF, fplToDNF\n\n\n# Clauses\n\n@docs ClausePL, ClausePLSet, cplIsPositive, cplIsNegative, cplEqClauses, cplSubsumes, cplIsTautology, csplRemoveEqClauses, csplRemoveTautClauses, csplRemoveSubsumedClauses, cplSymbols, csplSymbols, cplInterpretations, csplInterpretations, cplValuation, csplValuation, cplModels, csplModels, cplIsInsat, csplIsTaut, csplIsSat, cplSetIsInsat\n\n\n# Formulas to Clauses\n\n@docs cplFromCNF, fplToClauses, splToClauses\n\n\n# Clauses Parser\n\n@docs cplReadFromString, cplReadExtraction, cplToInputString\n\n\n# Clauses Representation\n\n@docs cplToString, cplToMathString, csplToString, csplToMathString\n\n","unions":[],"aliases":[{"name":"ClausePL","comment":" It represent a ClausePL as a list of literals.\n\n    c1 : ClausePL\n    c1 =\n        [ Neg (Atom \"p\"), Neg (Atom \"q\"), Atom \"r\" ]\n\n    c2 : ClausePL\n    c2 =\n        [ Neg (Atom \"p\"), Atom \"r\" ]\n\n    c3 : ClausePL\n    c3 =\n        [ Atom \"r\" ]\n\n","args":[],"type":"List.List LogicUS.PL.SintaxSemantics.Literal"},{"name":"ClausePLSet","comment":" It represent a List of ClausePL\n\n    cs : ClausePLSet\n    cs =\n        [ c1, c2, c3 ]\n\n","args":[],"type":"List.List LogicUS.PL.NFC.ClausePL"}],"values":[{"name":"cplEqClauses","comment":" It checks if the clauses are equal, that is, if both have the same elements\n\n    (c1 == List.reverse c1) == False\n\n    cplEqClauses c1 (List.reverse c1) == True\n\n","type":"LogicUS.PL.NFC.ClausePL -> LogicUS.PL.NFC.ClausePL -> Basics.Bool"},{"name":"cplFromCNF","comment":" Express a CNF formula as a Set of clauses. If input is not in CNF form Nothing is returned\n\n    fplToCNF f1 |> cplFromCNF == Just [ [ Atom \"p\" ], [ Neg (Atom \"q\") ], [ Atom \"r\" ], [ Neg (Atom \"p\") ], [ Atom \"q\" ], [ Neg (Atom \"r\") ] ]\n\n    fplToDNF f1 |> cplFromCNF == Nothing\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> Maybe.Maybe LogicUS.PL.NFC.ClausePLSet"},{"name":"cplInterpretations","comment":" It gives all possible interpretations for a clause\n\n    cplInterpretations c1 == [ [], [ \"p\" ], [ \"p\", \"q\" ], [ \"p\", \"q\", \"r\" ], [ \"p\", \"r\" ], [ \"q\" ], [ \"q\", \"r\" ], [ \"r\" ] ]\n\n    cplInterpretation c2 == [ [], [ \"p\" ], [ \"p\", \"r\" ], [ \"r\" ] ]\n\n","type":"LogicUS.PL.NFC.ClausePL -> List.List LogicUS.PL.SintaxSemantics.Interpretation"},{"name":"cplIsInsat","comment":" It checks if a clause is unsatisfible, that is if it is empty.\n\n    cplIsInsat c1 == False\n\n    cplIsInsat c2 == False\n\n    cplIsInsat [] == True\n\n","type":"LogicUS.PL.NFC.ClausePL -> Basics.Bool"},{"name":"cplIsNegative","comment":" Indicates if the clause is enterly negative, this is with all its literals negative\n\n    cplIsNegative c1 == False\n\n    cplIsNegative (List.take 2 c1) == True\n\n","type":"LogicUS.PL.NFC.ClausePL -> Basics.Bool"},{"name":"cplIsPositive","comment":" Indicates if the clause is enterly positive, this is with all its literals positive\n\n    cplIsPositive c1 == False\n\n    cplIsPositive c3 == True\n\n","type":"LogicUS.PL.NFC.ClausePL -> Basics.Bool"},{"name":"cplIsTautology","comment":" Indicates if the clause is a tautology, that is if it contains a literal and its complement.\n\n    cplIsTautology c1 == False\n\n    (cplIsTautology <| c1 ++ [ Atom \"p\" ]) == True\n\n","type":"LogicUS.PL.NFC.ClausePL -> Basics.Bool"},{"name":"cplModels","comment":" It generates all models of a clause by bruteforce, valuating the truth value for each interpretation\n\n    plModels c1 == [ [], [ \"p\" ], [ \"p\", \"q\", \"r\" ], [ \"p\", \"r\" ], [ \"q\" ], [ \"q\", \"r\" ], [ \"r\" ] ]\n\n    cplModels c2 == [ [], [ \"p\", \"r\" ], [ \"r\" ] ]\n\n    cplModels c3 == [ [ \"r\" ] ]\n\n","type":"LogicUS.PL.NFC.ClausePL -> List.List LogicUS.PL.SintaxSemantics.Interpretation"},{"name":"cplReadExtraction","comment":" It extracts the clause readed. If it is Nothing then it returns an empty clause\n\n    (cplReadExtraction << cplReadFromString) \"p_{1}, p_{2}, ¬q_{1}, q_{2}\" == [ Atom \"p_{1}\", Atom \"p_{2}\", Neg (Atom \"q_{1}\"), Atom \"q_{2}\" ]\n\n    (cplReadExtraction << cplReadFromString) \"{p_{1}, p_{2}, ¬q_{1}, q_{2}\" == []\n\n    (cplReadExtraction << cplReadFromString) \"{}\" == []\n\n","type":"( Maybe.Maybe LogicUS.PL.NFC.ClausePL, String.String, String.String ) -> LogicUS.PL.NFC.ClausePL"},{"name":"cplReadFromString","comment":" It reads the formula from a string. It returns a tuple with may be a formula (if it can be read it) and a message of error it it cannot.\n\n    cplReadFromString \"p_{1}, p_{2}, ¬q_{1}, q_{2}\" == ( Just [ Atom \"p_{1}\", Atom \"p_{2}\", Neg (Atom \"q_{1}\"), Atom \"q_{2}\" ], \"\", \"\" )\n\n    cplReadFromString \"{p_{1}, p_{2}, ¬q_{1}, q_{2}}\" == ( Just [ Atom \"p_{1}\", Atom \"p_{2}\", Neg (Atom \"q_{1}\"), Atom \"q_{2}\" ], \"\", \"\" )\n\n    cplReadFromString \"{p_{1}, p_{2}, ¬q_{1}, q_{2}\" == ( Nothing, \"{p_{1}, p_{2}, ¬q_{1}, q_{2}\", \"Error: [{ col = 29, problem = Expecting ',', row = 1 },{ col = 29, problem = Expecting '}', row = 1 }]\" )\n\n    cplReadFromString \"{p_{1}, p_{2}, ¬q_{1}, q_{2}\" == ( Nothing, \"{p_{1}, p_{2}, ¬q_{1}, q_{2}\", \"Error: [{ col = 29, problem = Expecting ',', row = 1 },{ col = 29, problem = Expecting '}', row = 1 }]\" )\n\n    cplReadFromString \"{}\" == ( Just [], \"\", \"\" )\n\n    cplReadFromString \"\" == ( Nothing, \"\", \"Argument is empty\" )\n\n","type":"String.String -> ( Maybe.Maybe LogicUS.PL.NFC.ClausePL, String.String, String.String )"},{"name":"cplSetIsInsat","comment":" It checks if a set of clauses are satisfiable by brute force, calculates its models and verifies that none exist.\n","type":"LogicUS.PL.NFC.ClausePLSet -> Basics.Bool"},{"name":"cplSubsumes","comment":" Indicates if the first clause subsumes the second, that is, if the first is entirely contained in the second.\n\n    cplSubsumes c1 c2 == False\n\n    cplSubsumes c2 c1 == True\n\n","type":"LogicUS.PL.NFC.ClausePL -> LogicUS.PL.NFC.ClausePL -> Basics.Bool"},{"name":"cplSymbols","comment":" It gives the propositional symbols that take place in the clause\n\n    cplSymbols c1 =\n        [ \"p\", \"q\", \"r\" ]\n    cplSymbols c2 =\n        [ \"p\", \"r\" ]\n    cplSymbols c3 =\n        [ \"r\" ]\n\n","type":"LogicUS.PL.NFC.ClausePL -> List.List LogicUS.PL.SintaxSemantics.PSymb"},{"name":"cplToInputString","comment":" It gives the corresponding input syntax of a clause\n\n    cplToInputString c1 == \"¬p,¬q,r\"\n\n    cplToInputString c3 == \"r\"\n\n","type":"LogicUS.PL.NFC.ClausePL -> String.String"},{"name":"cplToMathString","comment":" It generates the Latex string of a ClausePL. The result requires a math enviroment to be displayed.\n\n    cplToMathString c1 == \"\\\\left\\\\lbrace \\\\neg p, \\\\neg q, r\\\\right\\\\rbrace\"\n\n","type":"LogicUS.PL.NFC.ClausePL -> String.String"},{"name":"cplToString","comment":" It generates the String representation of a ClausePL using unicode symbols.\n\n    cplToString c1 == \"{¬ p, ¬ q, r}\"\n\n","type":"LogicUS.PL.NFC.ClausePL -> String.String"},{"name":"cplValuation","comment":" It evaluates the truth value of the clause regarding to a interpretation\n\n    cplValuation c2 [ \"p\", \"r\" ] == True\n\n    cplValuation c2 [] == True\n\n    cplValuation c2 [ \"p\" ] == False\n\n","type":"LogicUS.PL.NFC.ClausePL -> LogicUS.PL.SintaxSemantics.Interpretation -> Basics.Bool"},{"name":"csplInterpretations","comment":" It gives all possible interpretations for a set of clauses\n\n    csplInterpretations cs1 == [ [], [ \"p\" ], [ \"p\", \"q\" ], [ \"p\", \"q\", \"r\" ], [ \"p\", \"r\" ], [ \"q\" ], [ \"q\", \"r\" ], [ \"r\" ] ]\n\n    csplInterpretations [ [ Atom \"p\" ], [ Atom \"q\" ] ] == [ [], [ \"p\" ], [ \"p\", \"q\" ], [ \"q\" ] ]\n\n","type":"LogicUS.PL.NFC.ClausePLSet -> List.List LogicUS.PL.SintaxSemantics.Interpretation"},{"name":"csplIsSat","comment":" It checks if a set of clauses is satisfiable by bruteforce, calculating its models and checking any exists\n\n    csplIsSat cs1 == True\n\n    csplIsSat (cs1 ++ [ Neg (Atom \"r\") ]) == False\n\n","type":"LogicUS.PL.NFC.ClausePLSet -> Basics.Bool"},{"name":"csplIsTaut","comment":" It checks if a set of clauses is a tautology, that is if all clauses are tautologies.\n\n    csplIsTaut cs1 == False\n\n    csplIsTaut (List.map (\\x -> x ++ [ Neg (Atom \"r\") ]) cs1) == True\n\n","type":"LogicUS.PL.NFC.ClausePLSet -> Basics.Bool"},{"name":"csplModels","comment":" It generates all models of a set of clauses by bruteforce, valuating the truth value for each interpretation\n\n    csplModels cs1 == [ [ \"p\", \"q\", \"r\" ], [ \"p\", \"r\" ], [ \"q\", \"r\" ], [ \"r\" ] ]\n\n","type":"LogicUS.PL.NFC.ClausePLSet -> List.List LogicUS.PL.SintaxSemantics.Interpretation"},{"name":"csplRemoveEqClauses","comment":" It removes clauses that are equal from a list of clauses\n\n    cs1 = [c1, c2, c3]\n\n    csplRemoveEqClauses c1 == c1\n\n    csplRemoveEqClauses (cs1 ++ (List.map (List.reverse) cs1)) == c1\n\n","type":"LogicUS.PL.NFC.ClausePLSet -> LogicUS.PL.NFC.ClausePLSet"},{"name":"csplRemoveSubsumedClauses","comment":" It removes clauses that are subsumed by other from the list\n\n    csplRemoveSubsumedClauses cs1 == [ [ Atom \"r\" ] ]\n\n","type":"LogicUS.PL.NFC.ClausePLSet -> LogicUS.PL.NFC.ClausePLSet"},{"name":"csplRemoveTautClauses","comment":" It removes clauses that are tautological clauses\n\n    csplRemoveTautClauses <| List.map (\\x -> x ++ [ Atom \"q\" ]) cs1 == [ [ Neg (Atom \"p\"), Atom \"r\", Atom \"q\" ], [ Atom \"r\", Atom \"q\" ] ]\n\n","type":"LogicUS.PL.NFC.ClausePLSet -> LogicUS.PL.NFC.ClausePLSet"},{"name":"csplSymbols","comment":" It gives the propositional symbols that take place in the clause\n\n    csplSymbols cs1 =\n        [ \"p\", \"q\", \"r\" ]\n\n","type":"LogicUS.PL.NFC.ClausePLSet -> List.List LogicUS.PL.SintaxSemantics.PSymb"},{"name":"csplToMathString","comment":" It generates the Latex string of a Set of Clauses. The result requires a math enviroment to be displayed.\n\n    csplToMathString cs == \"\\\\left\\\\lbrace\\\\left\\\\lbrace \\\\neg p, q\\\\right\\\\rbrace, \\\\, \\\\left\\\\lbrace \\\\neg p, r\\\\right\\\\rbrace, \\\\, \\\\left\\\\lbrace \\\\neg q, r\\\\right\\\\rbrace\\\\right\\\\rbrace\"\n\n","type":"LogicUS.PL.NFC.ClausePLSet -> String.String"},{"name":"csplToString","comment":" It generates the String representation of a Set of Clauses using unicode symbols.\n\n    csplToString cs == \"{{¬ p, q},{¬ p, r},{¬ q, r}}\"\n\n","type":"LogicUS.PL.NFC.ClausePLSet -> String.String"},{"name":"csplValuation","comment":" It evaluates the truth value of a set of clauses regarding to a interpretation\n\n    csplValuation cs1 [ \"r\" ] == True\n\n    csplValuation cs1 [] == False\n\n","type":"LogicUS.PL.NFC.ClausePLSet -> LogicUS.PL.SintaxSemantics.Interpretation -> Basics.Bool"},{"name":"fplContainsEquiv","comment":"\n\n    It checks if the formula contains any equivalence as a part of it.\n\n    f1 = Neg (Equi (Atom \"p\") (Impl (Atom \"q\") (Atom \"r\")))\n    fplContainsEquiv f1 == True\n\n    f2 = Disj (Neg (Conj (Atom \"p\") (Conj (Atom \"q\") (Atom \"r\")))) (Disj (Conj (Atom \"p\") (Atom \"q\")) (Atom \"r\"))\n    fplContainsEquiv f2 == False\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> Basics.Bool"},{"name":"fplContainsImpl","comment":"\n\n    It checks if the formula contains any implication as a part of the formula\n\n    fplContainsImpl f1 == True\n\n    fplContainsImpl f2 == False\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> Basics.Bool"},{"name":"fplInteriorizeAllConj","comment":"\n\n    It interiorizes the disjunctions by applying the OR Distributive law where appropriate.\n\n    f8 = fplInteriorizeAllConj f6\n    f8 == Disj (Conj (Atom \"p\") (Conj (Atom \"q\") (Neg (Atom \"r\")))) (Disj (Conj (Neg (Atom \"q\")) (Neg (Atom \"p\"))) (Conj (Atom \"r\") (Neg (Atom \"p\"))))\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> LogicUS.PL.SintaxSemantics.FormulaPL"},{"name":"fplInteriorizeAllDisj","comment":"\n\n    It interiorizes the disjunctions by applying the AND Distributive law where appropriate.\n\n    f7 = fplInteriorizeAllDisj f6\n    f7 == Conj (Conj (Disj (Atom \"p\") (Disj (Neg (Atom \"q\")) (Atom \"r\"))) (Disj (Atom \"p\") (Neg (Atom \"p\")))) (Conj (Conj (Disj (Atom \"q\") (Disj (Neg (Atom \"q\")) (Atom \"r\"))) (Disj (Atom \"q\") (Neg (Atom \"p\")))) (Conj (Disj (Neg (Atom \"r\")) (Disj (Neg (Atom \"q\")) (Atom \"r\"))) (Disj (Neg (Atom \"r\")) (Neg (Atom \"p\")))))\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> LogicUS.PL.SintaxSemantics.FormulaPL"},{"name":"fplInteriorizeAllNeg","comment":"\n\n    It interiorizes the negations by applying De Morgan's laws where appropriate\n\n    f5 = fplInteriorizeAllNeg f2\n    f5 == Disj (Disj (Neg (Atom \"p\")) (Disj (Neg (Atom \"q\")) (Neg (Atom \"r\")))) (Disj (Conj (Atom \"p\") (Atom \"q\")) (Atom \"r\"))\n\n    f6 = fplInteriorizeAllNeg f4\n    f6 == Disj (Conj (Atom \"p\") (Conj (Atom \"q\") (Neg (Atom \"r\")))) (Conj (Disj (Neg (Atom \"q\")) (Atom \"r\")) (Neg (Atom \"p\")))\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> LogicUS.PL.SintaxSemantics.FormulaPL"},{"name":"fplRemoveAllEquiv","comment":"\n\n    It eliminates all equivalences of a formula by replacing it with the conjunction of the corresponding implications.\n\n    f3 = fplRemoveAllEquiv f1\n    f3 == Neg (Conj (Impl (Atom \"p\") (Impl (Atom \"q\") (Atom \"r\"))) (Impl (Impl (Atom \"q\") (Atom \"r\")) (Atom \"p\")))\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> LogicUS.PL.SintaxSemantics.FormulaPL"},{"name":"fplRemoveAllImpl","comment":"\n\n    It eliminates all implications of a formula by replacing it with the conjunction of the corresponding implications.\n\n    f4 = fplRemoveAllImpl f3\n    f4 == Neg (Conj (Disj (Neg (Atom \"p\")) (Disj (Neg (Atom \"q\")) (Atom \"r\"))) (Disj (Neg (Disj (Neg (Atom \"q\")) (Atom \"r\"))) (Atom \"p\")))\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> LogicUS.PL.SintaxSemantics.FormulaPL"},{"name":"fplToCNF","comment":"\n\n    Express a formula in its Conjuction Normal Form (CNF) that is formed as a conjuction of disjuntive formulas.\n\n     -- Check if f1 is in CNF\n    (f1 == fplToCNF f1) == False\n\n    -- Check if f7 is in CNF\n    (f7 == fplToCNF f7) == True\n\n    -- Calculate CNF for f1\n    f10 = fplToCNF f1\n    f10 == Conj (Conj (Disj (Atom \"p\") (Disj (Neg (Atom \"q\")) (Atom \"r\"))) (Disj (Atom \"p\") (Neg (Atom \"p\")))) (Conj (Conj (Disj (Atom \"q\") (Disj (Neg (Atom \"q\")) (Atom \"r\"))) (Disj (Atom \"q\") (Neg (Atom \"p\")))) (Conj (Disj (Neg (Atom \"r\")) (Disj (Neg (Atom \"q\")) (Atom \"r\"))) (Disj (Neg (Atom \"r\")) (Neg (Atom \"p\")))))\n\n    -- It is equal to f7\n    (f10 == f7) == True\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> LogicUS.PL.SintaxSemantics.FormulaPL"},{"name":"fplToClauses","comment":" Express a formula as a Set of clauses.\nfplToClauses f1 == [[Atom \"p\"],[Neg (Atom \"q\")],[Atom \"r\"],[Neg (Atom \"p\")],[Atom \"q\"],[Neg (Atom \"r\")]]\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> LogicUS.PL.NFC.ClausePLSet"},{"name":"fplToDNF","comment":"\n\n    Express a formula in its Disjunction Normal Form (CNF) that is formed as a conjuction of disjuntive formulas.\n\n    -- Check if f1 is in DNF\n    (f1 == fplToDNF f1) == False\n\n    -- Check if f8 is in DNF\n    (f8 == fplToCNF f8) == True\n\n    -- Calculate CNF for f1\n    f11 = fplToDNF f1\n    f11 == Disj (Conj (Atom \"p\") (Conj (Atom \"q\") (Neg (Atom \"r\")))) (Disj (Conj (Neg (Atom \"q\")) (Neg (Atom \"p\"))) (Conj (Atom \"r\") (Neg (Atom \"p\"))))\n\n    -- It is equal to f8\n    (f11 == f8) == True\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> LogicUS.PL.SintaxSemantics.FormulaPL"},{"name":"fplToNNF","comment":"\n\n    Express a formula in its Negation Normal Form (NNF) that is formed only by literals and the conectives ∧ and/or ∨.\n\n    -- Check if f5 is in NNF\n    (f5 == fplToNNF f5) == True\n\n    -- Check if f1 is in NNF\n    (f1 == fplToNNF f1) == False\n\n    -- Calculate NNF form for f1\n    f9 = fplToNNF f1\n    f9 == Disj (Conj (Atom \"p\") (Conj (Atom \"q\") (Neg (Atom \"r\")))) (Conj (Disj (Neg (Atom \"q\")) (Atom \"r\")) (Neg (Atom \"p\")))\n\n    -- It is equal to f6\n    (f9 == f6) == True\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> LogicUS.PL.SintaxSemantics.FormulaPL"},{"name":"splToClauses","comment":" Express a set of formulas as a Set of clauses.\n\n    fs = List.map (fplReadExtraction << fplReadFromString) [\"p->q\", \"p \\\\/ q -> r\", \"¬p \\\\/ q\"]\n    cs = splToClauses fs\n    cs == [[Neg (Atom \"p\"),Atom \"q\"],[Neg (Atom \"p\"),Atom \"r\"],[Neg (Atom \"q\"),Atom \"r\"]]\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> LogicUS.PL.NFC.ClausePLSet"}],"binops":[]},{"name":"LogicUS.PL.Resolution","comment":" The module provides the tools for aplying the differents resolution strategies to a set of propositional clauses for verifying its unfeasibility.\n\n\n# Types\n\n@docs ResolutionTableau\n\n\n# Resolvents\n\n@docs cplResolventByPSymb, cplAllResolvents, csplAllResolventsByPsymb, csplResolventsByClause, csplAllResolvents\n\n\n# Saturation and Regular Resolution\n\n@docs csplSaturationResolution, csplRegularResolution\n\n\n# Refutationally Complete Resolution Algorithms\n\n@docs csplSCFResolution, csplSCFLinearResolution, csplSCFPositiveResolution, csplSCFNegativeResolution\n\n\n# Non Refutationally Complete Resolution Algorithms\n\n@docs csplSCFUnitaryResolution, csplSCFByEntriesResolution\n\n\n# Resolution Tableau Representation\n\n@docs resolutionTableauToString, resolutionTableauToDOT\n\n","unions":[],"aliases":[{"name":"ResolutionTableau","comment":" Defines the Resolution Tableau type as a Graph whose node labels are pairs of a bool (indicates if the node is in the original clause set (True) or is a deduction (False)) and the clause considered in the corresponding node; and a edge label is just the literal of source node which is considered in the resolvent.\n","args":[],"type":"Graph.Graph ( Basics.Bool, LogicUS.PL.NFC.ClausePL ) LogicUS.PL.SintaxSemantics.Literal"}],"values":[{"name":"cplAllResolvents","comment":" It gets all passible resolvents between two clauses. Note that if several resolvents can be performed then all of them are tautologies.\n\n    cplAllResolvents [ Atom \"p\", Atom \"q\" ] [ Neg (Atom \"p\"), Neg (Atom \"q\") ] = cplAllResolvents  [ Atom \"p\", Atom \"q\" ] [ Neg (Atom \"p\"), (Neg Atom \"q\") ]\n\n    cplAllResolvents [ Atom \"p\", Atom \"q\" ] [ Neg (Atom \"p\"), Atom \"q\" ] == [([Atom \"q\"],Atom \"p\",Neg (Atom \"p\"))]\n\n    cplAllResolvents [ Atom \"p\", Atom \"q\" ] [ Atom \"p\" ] == []\n\n","type":"LogicUS.PL.NFC.ClausePL -> LogicUS.PL.NFC.ClausePL -> List.List ( LogicUS.PL.NFC.ClausePL, LogicUS.PL.SintaxSemantics.Literal, LogicUS.PL.SintaxSemantics.Literal )"},{"name":"cplResolventByPSymb","comment":" It gets the resolvent from two clauses by one literal. If it can be performed then it returns the resolvent and the literal considerated in each clause. If the resolvent does not exist it returns Nothing.\n\n    cplResolventByPSymb [ Atom \"p\", Atom \"q\" ] [ Neg (Atom \"p\"), Atom \"q\" ] \"p\" == Just ( [ Atom \"q\" ], Atom \"p\", Neg (Atom \"p\") )\n\n    cplResolventByPSymb [ Atom \"p\", Atom \"q\" ] [ Neg (Atom \"p\"), Atom \"q\" ] \"q\" == Nothing\n\n","type":"LogicUS.PL.NFC.ClausePL -> LogicUS.PL.NFC.ClausePL -> LogicUS.PL.SintaxSemantics.PSymb -> Maybe.Maybe ( LogicUS.PL.NFC.ClausePL, LogicUS.PL.SintaxSemantics.Literal, LogicUS.PL.SintaxSemantics.Literal )"},{"name":"csplAllResolvents","comment":" It gets all possible resolvents each two clauses of the set, and gives it as a clause set ommitting who are the parents and removing duplicated clauses.\n\n    csplAllResolvents [ [ Atom \"p\", Atom \"q\" ], [ Neg (Atom \"p\"), Neg (Atom \"q\") ], [ Neg (Atom \"p\"), Atom \"q\" ] ]\n        == [ [ Neg (Atom \"q\"), Atom \"q\" ], [ Neg (Atom \"p\"), Atom \"p\" ], [ Atom \"q\" ], [ Neg (Atom \"p\") ] ]\n\n","type":"List.List LogicUS.PL.NFC.ClausePL -> List.List LogicUS.PL.NFC.ClausePL"},{"name":"csplAllResolventsByPsymb","comment":" It gets the resolvents between the clauses of a set by the variable given.\n\n    csplAllResolventsByPsymb [ [ Atom \"p\", Atom \"q\" ], [ Neg (Atom \"p\"), Neg (Atom \"q\") ], [ Neg (Atom \"p\"), Atom \"q\" ] ] \"p\"\n        == [ [ Atom \"q\", Neg (Atom \"q\") ], [ Atom \"q\" ] ]\n\n","type":"List.List LogicUS.PL.NFC.ClausePL -> LogicUS.PL.SintaxSemantics.PSymb -> List.List LogicUS.PL.NFC.ClausePL"},{"name":"csplRegularResolution","comment":" It uses regular resolution algorithm for determining the feasibilibity of a set ot clauses. It gives the insatisfactibility (True:Insat, False:SAT) and the clause set considerated in each step of the algorithm.\n\n    csplRegularResolution [ \"p\", \"q\", \"r\" ] cs\n        == ( True, [ [ [ Neg (Atom \"p\"), Neg (Atom \"q\"), Atom \"r\" ], [ Atom \"q\", Atom \"p\" ], [ Neg (Atom \"r\"), Atom \"p\" ], [ Neg (Atom \"p\"), Atom \"q\" ], [ Neg (Atom \"q\"), Atom \"p\" ], [ Neg (Atom \"p\"), Neg (Atom \"r\") ] ], [ [ Neg (Atom \"q\"), Atom \"q\", Atom \"r\" ], [ Neg (Atom \"q\"), Atom \"r\", Neg (Atom \"r\") ], [ Atom \"q\" ], [ Atom \"q\", Neg (Atom \"r\") ], [ Neg (Atom \"q\"), Atom \"r\" ], [ Atom \"q\", Neg (Atom \"q\") ], [ Neg (Atom \"r\") ], [ Neg (Atom \"q\"), Neg (Atom \"r\") ] ], [ [ Neg (Atom \"r\") ], [ Atom \"r\", Neg (Atom \"r\") ], [ Atom \"r\" ], [ Neg (Atom \"r\") ] ], [ [] ] ] )\n\n","type":"List.List LogicUS.PL.SintaxSemantics.PSymb -> List.List LogicUS.PL.NFC.ClausePL -> ( Basics.Bool, List.List (List.List LogicUS.PL.NFC.ClausePL) )"},{"name":"csplResolventsByClause","comment":" It gets all resolvents of each clause of a set with a clause given. It returns a list of a pair with the index of the formula with which the reference clause is resolved and all the resolvents obtained.\n\n    csplResolventsByClause [ [ Atom \"p\", Atom \"q\" ], [ Neg (Atom \"p\"), Neg (Atom \"q\") ] ] [ Neg (Atom \"p\"), Atom \"q\" ]\n        == [ ( 0, [ ( [ Atom \"q\" ], Neg (Atom \"p\"), Atom \"p\" ) ] ), ( 1, [ ( [ Neg (Atom \"p\") ], Atom \"q\", Neg (Atom \"q\") ) ] ) ]\n\n","type":"List.List LogicUS.PL.NFC.ClausePL -> LogicUS.PL.NFC.ClausePL -> List.List ( Basics.Int, List.List ( LogicUS.PL.NFC.ClausePL, LogicUS.PL.SintaxSemantics.Literal, LogicUS.PL.SintaxSemantics.Literal ) )"},{"name":"csplSCFByEntriesResolution","comment":" It uses resolution by entries algorithm using shortest clause first heuristic for determining the feasibilibity of a set of clauses. It gives the insatisfactibility (True:Insat, False:SAT) and a graph with the resolution path to inconsitence. If clause set is feasible then a graph with only initial nodes is returned.\n\n    res_SCFByEntriesResolution = csplSCFByEntriesResolution cs\n\n    Tuple.first res_SCFByEntriesResolution == False\n\n    res_SCFByEntriesResolution |> Tuple.second |> resolutionTableauToDOT\n        == \"digraph G {\\\\n rankdir=TB\\\\n graph []\\\\n node [shape=box, color=black]\\\\n edge [dir=none, color=blue, fontcolor=blue]\\\\n\\\\n\\\\n\\\\n 1 [label=\"{¬ p, ¬ q, r}\"]\\\\n 2 [label=\"{q, p}\"]\\\\n 3 [label=\"{¬ r, p}\"]\\\\n 4 [label=\"{¬ p, q}\"]\\\\n 5 [label=\"{¬ q, p}\"]\\\\n 6 [label=\"{¬ p, ¬ r}\"]\\\\n\\\\n {rank=same; 1;2;3;4;5;6;}\\\\n}\"\n\nNote: You can render the graph with GraphViz Viewer and _resolutionTableauToDOT_ described at the end.\n\n","type":"List.List LogicUS.PL.NFC.ClausePL -> ( Basics.Bool, Graph.Graph ( Basics.Bool, LogicUS.PL.NFC.ClausePL ) LogicUS.PL.SintaxSemantics.Literal )"},{"name":"csplSCFLinearResolution","comment":" It uses linear resolution algorithm using shortest clause first heuristic for determining the feasibilibity of a set of clauses. It gives the insatisfactibility (True:Insat, False:SAT) and a graph with the resolution path to inconsitence. If clause set is feasible then a graph with only initial nodes is returned.\n\n    res_SCFLinearResolution = csplSCFLinearResolution cs\n\n    Tuple.first res_SCFLinearResolution == True\n\n    res_SCFLinearResolution |> Tuple.second |> resolutionTableauToDOT\n        == \"digraph G {\\n  rankdir=TB\\n  graph []\\n  node [shape=box, color=black]\\n  edge [dir=none, color=blue, fontcolor=blue]\\n\\n  1 -> 8 [label=\\\"p\\\"]\\n  3 -> 8 [label=\\\"¬ p\\\"]\\n  4 -> 9 [label=\\\"¬ q\\\"]\\n  5 -> 10 [label=\\\"¬ p\\\"]\\n  6 -> 11 [label=\\\"r\\\"]\\n  8 -> 9 [label=\\\"q\\\"]\\n  8 -> 12 [label=\\\"q\\\"]\\n  9 -> 10 [label=\\\"p\\\"]\\n  9 -> 13 [label=\\\"p\\\"]\\n  10 -> 11 [label=\\\"¬ r\\\"]\\n  11 -> 12 [label=\\\"¬ q\\\"]\\n  12 -> 13 [label=\\\"¬ p\\\"]\\n\\n  1 [label=\\\"{q, p}\\\"]\\n  3 [label=\\\"{¬ p, q}\\\"]\\n  4 [label=\\\"{¬ q, p}\\\"]\\n  5 [label=\\\"{¬ p, ¬ r}\\\"]\\n  6 [label=\\\"{¬ p, ¬ q, r}\\\"]\\n  8 [label=\\\"{q}\\\"]\\n  9 [label=\\\"{p}\\\"]\\n  10 [label=\\\"{¬ r}\\\"]\\n  11 [label=\\\"{¬ p, ¬ q}\\\"]\\n  12 [label=\\\"{¬ p}\\\"]\\n  13 [label=\\\"□\\\"]\\n  14 [label=\\\"{¬ r, p}\\\"]\\n\\n  {rank=same; 1;3;4;5;6;14;}\\n}\"\n\nNote: You can render the graph with GraphViz Viewer and _resolutionTableauToDOT_ described at the end.\n\n","type":"List.List LogicUS.PL.NFC.ClausePL -> ( Basics.Bool, LogicUS.PL.Resolution.ResolutionTableau )"},{"name":"csplSCFNegativeResolution","comment":" It uses negative resolution algorithm using shortest clause first heuristic for determining the feasibilibity of a set of clauses. It gives the insatisfactibility (True:Insat, False:SAT) and a graph with the resolution path to inconsitence. If clause set is feasible then a graph with only initial nodes is returned.\n\n    res_SCFNegativeResolution = csplSCFNegativeResolution cs\n\n    Tuple.first res_SCFNegativeResolution == True\n\n    res_SCFNegativeResolution |> Tuple.second |> resolutionTableauToDOT\n        == \"digraph G {\\n  rankdir=TB\\n  graph []\\n  node [shape=box, color=black]\\n  edge [dir=none, color=blue, fontcolor=blue]\\n\\n  1 -> 16 [label=\\\"p\\\"]\\n  2 -> 10 [label=\\\"p\\\"]\\n  3 -> 14 [label=\\\"q\\\"]\\n  4 -> 17 [label=\\\"p\\\"]\\n  5 -> 10 [label=\\\"¬ p\\\"]\\n  6 -> 12 [label=\\\"r\\\"]\\n  10 -> 12 [label=\\\"¬ r\\\"]\\n  12 -> 14 [label=\\\"¬ q\\\"]\\n  14 -> 16 [label=\\\"¬ p\\\"]\\n  14 -> 17 [label=\\\"¬ p\\\"]\\n  16 -> 19 [label=\\\"q\\\"]\\n  17 -> 19 [label=\\\"¬ q\\\"]\\n\\n  1 [label=\\\"{q, p}\\\"]\\n  2 [label=\\\"{¬ r, p}\\\"]\\n  3 [label=\\\"{¬ p, q}\\\"]\\n  4 [label=\\\"{¬ q, p}\\\"]\\n  5 [label=\\\"{¬ p, ¬ r}\\\"]\\n  6 [label=\\\"{¬ p, ¬ q, r}\\\"]\\n  10 [label=\\\"{¬ r}\\\"]\\n  12 [label=\\\"{¬ p, ¬ q}\\\"]\\n  14 [label=\\\"{¬ p}\\\"]\\n  16 [label=\\\"{q}\\\"]\\n  17 [label=\\\"{¬ q}\\\"]\\n  19 [label=\\\"□\\\"]\\n\\n  {rank=same; 1;2;3;4;5;6;}\\n}\"\n\nNote: You can render the graph with GraphViz Viewer and _resolutionTableauToDOT_ described at the end.\n\n","type":"List.List LogicUS.PL.NFC.ClausePL -> ( Basics.Bool, Graph.Graph ( Basics.Bool, LogicUS.PL.NFC.ClausePL ) LogicUS.PL.SintaxSemantics.Literal )"},{"name":"csplSCFPositiveResolution","comment":" It uses positive resolution algorithm using shortest clause first heuristic for determining the feasibilibity of a set of clauses. It gives the insatisfactibility (True:Insat, False:SAT) and a graph with the resolution path to inconsitence. If clause set is feasible then a graph with only initial nodes is returned.\n\n    res_SCFPositiveResolution = csplSCFPositiveResolution cs\n\n    Tuple.first res_SCFPositiveResolution == True\n\n    res_SCFPositiveResolution |> Tuple.second |> resolutionTableauToDOT\n        == \"digraph G {\\n  rankdir=TB\\n  graph []\\n  node [shape=box, color=black]\\n  edge [dir=none, color=blue, fontcolor=blue]\\n\\n  1 -> 8 [label=\\\"p\\\"]\\n  1 -> 9 [label=\\\"q\\\"]\\n  3 -> 8 [label=\\\"¬ p\\\"]\\n  4 -> 9 [label=\\\"¬ q\\\"]\\n  5 -> 14 [label=\\\"¬ p\\\"]\\n  6 -> 12 [label=\\\"¬ q\\\"]\\n  8 -> 12 [label=\\\"q\\\"]\\n  9 -> 14 [label=\\\"p\\\"]\\n  9 -> 15 [label=\\\"p\\\"]\\n  12 -> 15 [label=\\\"¬ p\\\"]\\n  14 -> 17 [label=\\\"¬ r\\\"]\\n  15 -> 17 [label=\\\"r\\\"]\\n\\n  1 [label=\\\"{q, p}\\\"]\\n  3 [label=\\\"{¬ p, q}\\\"]\\n  4 [label=\\\"{¬ q, p}\\\"]\\n  5 [label=\\\"{¬ p, ¬ r}\\\"]\\n  6 [label=\\\"{¬ p, ¬ q, r}\\\"]\\n  8 [label=\\\"{q}\\\"]\\n  9 [label=\\\"{p}\\\"]\\n  12 [label=\\\"{¬ p, r}\\\"]\\n  14 [label=\\\"{¬ r}\\\"]\\n  15 [label=\\\"{r}\\\"]\\n  17 [label=\\\"□\\\"]\\n  18 [label=\\\"{¬ r, p}\\\"]\\n\\n  {rank=same; 1;3;4;5;6;18;}\\n}\"\n\nNote: You can render the graph with GraphViz Viewer and _resolutionTableauToDOT_ described at the end.\n\n","type":"List.List LogicUS.PL.NFC.ClausePL -> ( Basics.Bool, Graph.Graph ( Basics.Bool, LogicUS.PL.NFC.ClausePL ) LogicUS.PL.SintaxSemantics.Literal )"},{"name":"csplSCFResolution","comment":" It uses resolution algorithm using shortes clause first heuristic for determining the feasibilibity of a set of clauses. It gives the insatisfactibility (True:Insat, False:SAT) and a graph with the resolution path to inconsitence. If clause set is feasible then a graph with only initial nodes is returned.\n\n    res_SCFResolution = csplSCFResolution cs\n\n    Tuple.first res_SCFResolution == True\n\n    res_SCFResolution |> Tuple.second |> resolutionTableauToDOT\n        == \"digraph G {\\n  rankdir=TB\\n  graph []\\n  node [shape=box, color=black]\\n  edge [dir=none, color=blue, fontcolor=blue]\\n\\n  1 -> 6 [label=\\\"q\\\"]\\n  2 -> 8 [label=\\\"p\\\"]\\n  3 -> 10 [label=\\\"q\\\"]\\n  5 -> 6 [label=\\\"¬ q\\\"]\\n  6 -> 11 [label=\\\"p\\\"]\\n  7 -> 8 [label=\\\"¬ p\\\"]\\n  8 -> 12 [label=\\\"¬ r\\\"]\\n  9 -> 10 [label=\\\"¬ q\\\"]\\n  10 -> 11 [label=\\\"¬ p\\\"]\\n  11 -> 12 [label=\\\"r\\\"]\\n\\n  1 [label=\\\"{q, p}\\\"]\\n  2 [label=\\\"{¬ r, p}\\\"]\\n  3 [label=\\\"{¬ p, q}\\\"]\\n  5 [label=\\\"{¬ q, p}\\\"]\\n  6 [label=\\\"{p}\\\"]\\n  7 [label=\\\"{¬ p, ¬ r}\\\"]\\n  8 [label=\\\"{¬ r}\\\"]\\n  9 [label=\\\"{¬ p, ¬ q, r}\\\"]\\n  10 [label=\\\"{¬ p, r}\\\"]\\n  11 [label=\\\"{r}\\\"]\\n  12 [label=\\\"□\\\"]\\n\\n  {rank=same; 1;2;3;5;7;9;}\\n}\"\n\nNote: You can render the graph with GraphViz Viewer and _resolutionTableauToDOt_ as we show in the example above.\n\n","type":"List.List LogicUS.PL.NFC.ClausePL -> ( Basics.Bool, LogicUS.PL.Resolution.ResolutionTableau )"},{"name":"csplSCFUnitaryResolution","comment":" It uses unitary resolution algorithm using shortest clause first heuristic for determining the feasibilibity of a set of clauses. It gives the insatisfactibility (True:Insat, False:SAT) and a graph with the resolution path to inconsitence. If clause set is feasible then a graph with only initial nodes is returned.\n\n    res_SCFUnitaryResolution = csplSCFUnitaryResolution cs\n\n    Tuple.first res_SCFUnitaryResolution == False\n\n    res_SCFUnitaryResolution |> Tuple.second |> resolutionTableauToDOT\n        == \"digraph G {\\n  rankdir=TB\\n  graph []\\n  node [shape=box, color=black]\\n  edge [dir=none, color=blue, fontcolor=blue]\\n\\n\\n\\n  1 [label=\\\"{¬ p, ¬ q, r}\\\"]\\n  2 [label=\\\"{q, p}\\\"]\\n  3 [label=\\\"{¬ r, p}\\\"]\\n  4 [label=\\\"{¬ p, q}\\\"]\\n  5 [label=\\\"{¬ q, p}\\\"]\\n  6 [label=\\\"{¬ p, ¬ r}\\\"]\\n\\n  {rank=same; 1;2;3;4;5;6;}\\n}\"\n\nNote: You can render the graph with GraphViz Viewer and _resolutionTableauToDOT_ described at the end.\n\n","type":"List.List LogicUS.PL.NFC.ClausePL -> ( Basics.Bool, Graph.Graph ( Basics.Bool, LogicUS.PL.NFC.ClausePL ) LogicUS.PL.SintaxSemantics.Literal )"},{"name":"csplSaturationResolution","comment":" It uses saturation resolution algorithm for determining the feasibilibity of a set ot clauses. It gives the insatisfactibility (True:Insat, False:SAT) and the clause set considerated in each step of the algorithm.\n\n    cs = [[Neg (Atom \"p\"),Neg (Atom \"q\"),Atom \"r\"],[Atom \"q\",Atom \"p\"],[Neg (Atom \"r\"),Atom \"p\"],[Neg (Atom \"p\"),Atom \"q\"],[Neg (Atom \"q\"),Atom \"p\"],[Neg (Atom \"p\"),Neg (Atom \"r\")]]\n\n\n    csplAllResolvents cs\n        == (True,[[[Neg (Atom \"p\"),Neg (Atom \"q\"),Atom \"r\"],[Atom \"q\",Atom \"p\"],[Neg (Atom \"r\"),Atom \"p\"],[Neg (Atom \"p\"),Atom \"q\"],[Neg (Atom \"q\"),Atom \"p\"],[Neg (Atom \"p\"),Neg (Atom \"r\")],[Atom \"p\",Neg (Atom \"p\"),Atom \"r\"],[Atom \"q\",Neg (Atom \"q\"),Atom \"r\"],[Atom \"p\",Neg (Atom \"p\"),Neg (Atom \"q\")],[Neg (Atom \"q\"),Neg (Atom \"r\"),Atom \"r\"],[Neg (Atom \"p\"),Atom \"r\"],[Atom \"q\"],...)\n\n","type":"List.List LogicUS.PL.NFC.ClausePL -> ( Basics.Bool, List.List (List.List LogicUS.PL.NFC.ClausePL) )"},{"name":"resolutionTableauToDOT","comment":" Express a Resolution Tableau as a string in DOT format that is viewable with a GraphViz Render.\n\n**Note:** If you are using elm repl, before introducing the code you must replace _\\\\n_ by _\\\\n_ and _\\\\\"_ by _\"_ in a simple text editor.\n\n","type":"LogicUS.PL.Resolution.ResolutionTableau -> String.String"},{"name":"resolutionTableauToString","comment":" Express a Resolution Tableau as a string.\n","type":"LogicUS.PL.Resolution.ResolutionTableau -> String.String"}],"binops":[]},{"name":"LogicUS.PL.SemanticTableaux","comment":" The module provides the elementary tools for building the semantic tableau of a set of PL formulas.\n\n\n# Definition Types\n\n@docs FormulaPLType, PLSemanticTableau\n\n\n# Formulas types and components\n\n@docs fplType, fplComponents\n\n\n# Semantic Tableau operations\n\n@docs splAllLiterals, splSearchContradiction, splSearchDN, splSearchAlpha, splSearchBeta, splExpandDN, splExpandAlpha, splExpandBeta\n\n\n# Semantic Tableau algorithm and models\n\n@docs semanticTableau, semanticTableauModels\n\n\n# Fuctions for representation\n\n@docs semanticTableauToString, semanticTableauToDOT\n\n","unions":[{"name":"FormulaPLType","comment":"\n\n    It defines the type of a PL formula which can be a *Literal*, *Double Negation*, *Alpha*, *Beta* or *Insat*\n\n","args":[],"cases":[]}],"aliases":[{"name":"PLSemanticTableau","comment":" Defines the PL Semantic Tableau type as a Graph whose node labels are pairs of an integer (0: internal node, 1: open leaf, -1: closed leaf) and the PL set considered in the corresponding node; and the edge labels are defined as pairs of the applied rule (A, B, DN, L, I) and the list of indexes of the formulas on which the rule is applied.\n","args":[],"type":"Graph.Graph ( Basics.Int, LogicUS.PL.SintaxSemantics.SetPL ) ( LogicUS.PL.SemanticTableaux.FormulaPLType, List.List Basics.Int )"}],"values":[{"name":"fplComponents","comment":" It gives the components of a formula for using them in the semantic board (Auxiliar)\n\n    fplComponents f1 == [ Atom \"a\" ]\n\n    fplComponents (Neg f1) == [ Neg (Atom \"a\") ]\n\n    fplComponents (Neg (Neg f1)) == [ Atom \"a\" ]\n\n    fplComponents (Conj f1 f2) == [ Atom \"a\", Atom \"b\" ]\n\n    fplComponents (Disj f1 f2) == [ Atom \"a\", Atom \"b\" ]\n\n    fplComponents (Impl f1 f2) == [ Neg (Atom \"a\"), Atom \"b\" ]\n\n    fplComponents (Equi f1 f2) == [ Impl (Atom \"a\") (Atom \"b\"), Impl (Atom \"b\") (Atom \"a\") ]\n\n    fplComponents (Neg (Conj f1 f2)) == [ Neg (Atom \"a\"), Neg (Atom \"b\") ]\n\n    fplComponents (Neg (Disj f1 f2)) == [ Neg (Atom \"a\"), Neg (Atom \"b\") ]\n\n    fplComponents (Neg (Impl f1 f2)) == [ Atom \"a\", Neg (Atom \"b\") ]\n\n    fplComponents (Neg (Equi f1 f2)) == [ Neg (Impl (Atom \"a\") (Atom \"b\")), Neg (Impl (Atom \"b\") (Atom \"a\")) ]\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> LogicUS.PL.SintaxSemantics.SetPL"},{"name":"fplType","comment":" It gives the type of a PL formula. Atoms and their negations are literals, double negation are typed as DN, conjunction, equivalence are classified as ALPHA, as well as disjunction and implications are classified as BETA. The negation of an alpha formula is a beta and vice versa.\n\n    f1 : FormulaPL\n    f1 = Atom \"a\"\n\n    f2 : FormulaPL\n    f2 = Atom \"b\"\n\n    fplType f1 == L\n    fplType (Neg f1) == L\n    fplType (Neg (Neg f1)) == DN\n    fplType (Conj f1 f2) == A\n    fplType (Disj f1 f2) == B\n    fplType (Impl f1 f2) == B\n    fplType (Equi f1 f2) == A\n    fplType (Neg (Conj f1 f2)) == B\n    fplType (Neg (Disj f1 f2)) == A\n    fplType (Neg (Impl f1 f2)) == A\n    fplType (Neg (Equi f1 f2)) == B\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> LogicUS.PL.SemanticTableaux.FormulaPLType"},{"name":"semanticTableau","comment":" It generates the complete SemanticTableaux as a Graph, which is renderizable with representations methods.\n\n    splSemanticTableau fs4 == Graph (Inner { left = Leaf { key = 0, value = { incoming = Empty, node = { id = 0, label = ( 0, [ Atom \"a\", Neg (Atom \"b\"), Conj (Atom \"a\") (Atom \"b\"), Disj (Atom \"a\") (Atom \"b\"), Neg (Equi (Atom \"a\") (Atom \"b\")) ] ) }, outgoing = Leaf { key = 1, value = ( A, [ 2 ] ) } } }, prefix = { branchingBit = 1, prefixBits = 0 }, right = Leaf { key = 1, value = { incoming = Leaf { key = 0, value = ( A, [ 2 ] ) }, node = { id = 1, label = ( -1, [ Atom \"a\", Neg (Atom \"b\"), Disj (Atom \"a\") (Atom \"b\"), Neg (Equi (Atom \"a\") (Atom \"b\")), Atom \"b\" ] ) }, outgoing = Empty } }, size = 2 })\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> LogicUS.PL.SemanticTableaux.PLSemanticTableau"},{"name":"semanticTableauModels","comment":" It extracts all the models from a semantic tableau.\n\n    splSemanticTableau fs4 |> plSemanticTableauModels == []\n\n    fs5 = [Disj f1 f2, Neg(Equi f1 f2)]\n    splSemanticTableau fs5 |> plSemanticTableauModels == [[\"a\"],[\"b\"]]\n\n","type":"LogicUS.PL.SemanticTableaux.PLSemanticTableau -> List.List LogicUS.PL.SintaxSemantics.Interpretation"},{"name":"semanticTableauToDOT","comment":" It gives a String representation of a Tabbleau using DOT notation, which is renderizable with a GraphViz viewer.\n\n    splSemanticTableau fs4 |> splSemanticTableauToDOT == \"digraph G {\\n  rankdir=TB\\n  graph []\\n  node [shape=box, color=black]\\n  edge [dir=none, color=blue, fontcolor=blue]\\n\\n  0 -> 1 [label=\\\"α (3)\\\"]\\n  1 -> 2 [label=\\\"I (2, 5)\\\"]\\n\\n  0 [label=\\\"{a, ¬ b, ( a ∧ b ), ( a ∨ b ), ¬ ( a ↔ b )}\\\"]\\n  1 [label=\\\"{a, ¬ b, ( a ∨ b ), ¬ ( a ↔ b ), b}\\\"]\\n  2 [label=\\\"×\\\"]\\n}\"\n\n","type":"LogicUS.PL.SemanticTableaux.PLSemanticTableau -> String.String"},{"name":"semanticTableauToString","comment":" It gives the String representation of a tableau.\n\n    splSemanticTableau fs4 |> splSemanticTableauToString == \"Graph [Node 0 ({a, ¬ b, ( a ∧ b ), ( a ∨ b ), ¬ ( a ↔ b )}), Node 1 ({a, ¬ b, ( a ∨ b ), ¬ ( a ↔ b ), b}), Node 2 (×)] [Edge 1->2 (I (2, 5)), Edge 0->1 (α (3))]\"\n\n","type":"LogicUS.PL.SemanticTableaux.PLSemanticTableau -> String.String"},{"name":"splAllLiterals","comment":" It gives if all formulas in a Set of PL formulas are literals.\n\n    fs1  = [f1, Neg f2]\n    fs2 = [f1, Neg f2, Conj f1 f2, Disj f1 f2, Neg (Impl f1 f2), Neg (Equi f1 f2)]\n    splAllLiterals fs1 == True\n    splAllLiterals fs2 == False\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> Basics.Bool"},{"name":"splExpandAlpha","comment":" It gives a set of formulas with changing an Alpha formula by its expansion. If formula is not Alpha the original set is returned.\n\n    splExpandAlpha fs2 (Conj (Atom \"a\") (Atom \"b\")) == [ Atom \"a\", Neg (Atom \"b\"), Disj (Atom \"a\") (Atom \"b\"), Neg (Impl (Atom \"a\") (Atom \"b\")), Neg (Equi (Atom \"a\") (Atom \"b\")), Atom \"b\" ]\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> LogicUS.PL.SintaxSemantics.FormulaPL -> LogicUS.PL.SintaxSemantics.SetPL"},{"name":"splExpandBeta","comment":" It gives a tuple of two sets of formulas with changing a Beta formula by its expansion. If formula is not Beta original set is returned in both sets.\n\n    splExpandBeta fs2 (Disj (Atom \"a\") (Atom \"b\")) == ( [ Atom \"a\", Neg (Atom \"b\"), Conj (Atom \"a\") (Atom \"b\"), Neg (Impl (Atom \"a\") (Atom \"b\")), Neg (Equi (Atom \"a\") (Atom \"b\")) ], [ Atom \"a\", Neg (Atom \"b\"), Conj (Atom \"a\") (Atom \"b\"), Neg (Impl (Atom \"a\") (Atom \"b\")), Neg (Equi (Atom \"a\") (Atom \"b\")), Atom \"b\" ] )\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> LogicUS.PL.SintaxSemantics.FormulaPL -> ( LogicUS.PL.SintaxSemantics.SetPL, LogicUS.PL.SintaxSemantics.SetPL )"},{"name":"splExpandDN","comment":" It gives a set of formulas with changing a DN formula by its expansion. If formula is not DN the original set is returned.\n\n    splExpandDN fs4 (Neg (Neg f2)) == [ Atom \"a\", Neg (Atom \"b\"), Conj (Atom \"a\") (Atom \"b\"), Disj (Atom \"a\") (Atom \"b\"), Atom \"a\", Neg (Equi (Atom \"a\") (Atom \"b\")), Atom \"b\" ]\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> LogicUS.PL.SintaxSemantics.FormulaPL -> LogicUS.PL.SintaxSemantics.SetPL"},{"name":"splSearchAlpha","comment":" It searches an Alpha formula in the set. If it gets it they return a tuple with the index and the formula, if not Nothing is returned\n\n    splSearchAlpha fs1 == Nothing\n\n    splSearchAlpha fs2 == Just ( 2, Conj (Atom \"a\") (Atom \"b\") )\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> Maybe.Maybe ( Basics.Int, LogicUS.PL.SintaxSemantics.FormulaPL )"},{"name":"splSearchBeta","comment":" It searches an Beta formula in the set. If it gets it they return a tuple with the index and the formula, if not Nothing is returned\n\n    splSearchBeta fs1 == Nothing\n\n    splSearchBeta fs2 == Just ( 3, Disj (Atom \"a\") (Atom \"b\") )\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> Maybe.Maybe ( Basics.Int, LogicUS.PL.SintaxSemantics.FormulaPL )"},{"name":"splSearchContradiction","comment":" It gives if one set of PL formulas contains a formula and its negation or contains the Insat formula (the set is unsatisfiable). If it finds them they return the formulas indices in the set (it is actually a list).\n\n    splSearchContradiction fs1 == Nothing\n    splSearchContradiction fs2 == Nothing\n\n    -- If we expand ( Conj f1 f2 ) as [f1, f2] (note that f1 is repeated so we keep only one of its instances)\n    fs3 = [f1, Neg f2, f2, Disj f1 f2, Neg (Impl f1 f2), Neg (Equi f1 f2)]\n    splSearchContradiction fs3 == Just [1,2]\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> Maybe.Maybe (List.List Basics.Int)"},{"name":"splSearchDN","comment":" It searches a DN formula in the set. If it gets it they return a tuple with the index and the formula, if not Nothing is returned\n\n    splSearchDN fs2 == Nothing\n\n    -- If we expand Neg(Impl f1 f2) as [(Neg (Neg f1)), (Neg f2)] (note that (Neg f2) is repeated so we keep only one of its instances)\n    fs4 = [f1, Neg f2, Conj f1 f2, Disj f1 f2, f1, Neg (Equi f1 f2)]\n    splSearchDN fs4 == Just (4, (Atom \"a\"))\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> Maybe.Maybe ( Basics.Int, LogicUS.PL.SintaxSemantics.FormulaPL )"}],"binops":[]},{"name":"LogicUS.PL.SintaxSemantics","comment":" The module provides the elementary tools for working with propositional logic. It allows defining both formulas and sets as well as performing some basic operations on them, such as evaluations regarding interpretations, construction of truth tables, extraction of models and decision of satisfaction, tautology and logical consequence.\n\n\n# Definition Types\n\n@docs PSymb, FormulaPL, Literal, SetPL, Interpretation\n\n\n# Work with PL Formulas\n\n@docs fplIsLiteral, fplIsPositiveLiteral, fplIsNegativeLiteral, fplNegation, fplSymbols, fplFormTree, fplValuation, fplInterpretations, fplModels, fplCountermodels, fplModelsCountermodels, fplTruthTable, fplSatisfiability, fplValidity, fplUnsatisfiability\n\n\n# Work with PL Sets\n\n@docs splSymbols, splValuation, splInterpretations, splModels, splCountermodels, splModelsCountermodels, splTruthTable, splSatisfiability, splUnsatisfiability, logicalConsecuence, logicalConsecuence2\n\n\n# Parsing PL Formulas\n\n@docs fplReadFromString, fplReadExtraction, fplToInputString\n\n\n# Repesentation for PL Formulas\n\n@docs fplToString, fplToMathString, fplTruthTableString, fplTruthTableMathString, fplFormTreeToString, fplFormTreeToDOT\n\n\n# Representation for PL Sets\n\n@docs splToString, splToMathString, splTruthTableString, splTruthTableMathString\n\n\n# Other functions\n\n@docs interpretationsFromSymbolsAndLiterals\n\n","unions":[{"name":"FormulaPL","comment":" It is used to define propositional formulas recursively. It allows defining atoms, negations, conjunctions, disjunctions, implications, equivalences, and unsatisfiable formulas.\n\n    -- Some examples of definition of propositional formulas\n    -- f1 = a → b\n    f1 =\n        Impl (Atom \"a\") (Atom \"b\")\n\n    -- f2 = ¬(a ∧ b) ↔ (¬a ∨ ¬b)\n    f2 =\n        Equi (Neg (Conj (Atom \"a\") (Atom \"b\"))) (Disj (Neg (Atom \"a\")) (Neg (Atom \"b\")))\n\n","args":[],"cases":[["Atom",["LogicUS.PL.SintaxSemantics.PSymb"]],["Neg",["LogicUS.PL.SintaxSemantics.FormulaPL"]],["Conj",["LogicUS.PL.SintaxSemantics.FormulaPL","LogicUS.PL.SintaxSemantics.FormulaPL"]],["Disj",["LogicUS.PL.SintaxSemantics.FormulaPL","LogicUS.PL.SintaxSemantics.FormulaPL"]],["Impl",["LogicUS.PL.SintaxSemantics.FormulaPL","LogicUS.PL.SintaxSemantics.FormulaPL"]],["Equi",["LogicUS.PL.SintaxSemantics.FormulaPL","LogicUS.PL.SintaxSemantics.FormulaPL"]],["Insat",[]]]}],"aliases":[{"name":"Interpretation","comment":" It is used to give a sparse definition of an Interpretation as a list of PSymb. This definition assumed that symbols including in the list are considered True. The rest are considered False.\n\n    -- i1 = {a=0, b=1}\n    i1 =\n        [ \"b\" ]\n\n    -- i2 ={a=1, b=0}\n    i2 =\n        [ \"a\" ]\n\n    -- i3 = {a=1, b=1}\n    i3 =\n        [ \"a\", \"b\" ]\n\n","args":[],"type":"List.List LogicUS.PL.SintaxSemantics.PSymb"},{"name":"Literal","comment":"\n\n    It corresponds to an Atom or a negation of an Atom\n\n","args":[],"type":"LogicUS.PL.SintaxSemantics.FormulaPL"},{"name":"PSymb","comment":" It is used to represent the propositional symbols of the formulas. It is recommended to use lowercase alphabetic characters using \"\\_ {...}\" to indicate subscripts.\n\n    -- Some examples of propositional symbols\n    simpleSymbs : List PSymb\n    simpleSymbs =\n        [ \"a\", \"b\", \"p\", \"q\", \"jhon\", \"marie\" ]\n\n    subindexedSymb : List PSymb\n    subindexedSymb =\n        [ \"a_{1}\", \"p_{2,3}\" ]\n\n","args":[],"type":"String.String"},{"name":"SetPL","comment":" It is used to define sets of propositional formulas.\n\n    -- fs = {a → b, ¬(a ∧ b) ↔ (¬a ∨ ¬b)}\n    fs =\n        [ f1, f2 ]\n\n","args":[],"type":"List.List LogicUS.PL.SintaxSemantics.FormulaPL"}],"values":[{"name":"fplCountermodels","comment":" It gives all countermodels of a formula\n\n    fplCountermodels f1 == [ [ \"a\" ] ]\n\n    fplCountermodels f2 == []\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> List.List LogicUS.PL.SintaxSemantics.Interpretation"},{"name":"fplFormTree","comment":" It gives a Graph.Graph with the form tree of a formula. If you want visualize it you can use formTreeHTML (defined in module Logicus.Base.Repr.SintaxSemantics.HTML) that gives a dot code of the graph. You can visualize it in a online graphviz visualizer or you can create an html file and follow the instructions (defined in Logicus.PL.Repr.Common.GraphViz).\n\n    fplFormTree f1 == Graph.Graph (Inner { left = Inner { left = Leaf { key = 0, value = { incoming = Empty, node = { id = 0, label = Impl (Atom \"a\") (Atom \"b\") }, outgoing = Inner { left = Leaf { key = 1, value = () }, prefix = { branchingBit = 2, prefixBits = 0 }, right = Leaf { key = 2, value = () }, size = 2 } } }, prefix = { branchingBit = 1, prefixBits = 0 }, right = Leaf { key = 1, value = { incoming = Leaf { key = 0, value = () }, node = { id = 1, label = Atom \"a\" }, outgoing = Empty } }, size = 2 }, prefix = { branchingBit = 2, prefixBits = 0 }, right = Leaf { key = 2, value = { incoming = Leaf { key = 0, value = () }, node = { id = 2, label = Atom \"b\" }, outgoing = Empty } }, size = 3 })\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> Graph.Graph LogicUS.PL.SintaxSemantics.FormulaPL ()"},{"name":"fplFormTreeToDOT","comment":" It generates the formation tree of a formula as DOT string. It requires a GraphViz interpreter to be displayed.\n\n    fplFormTreeToDOT <| fplFormTree f3 == \"digraph G {\\n  rankdir=TB\\n  graph []\\n  node [shape=plaintext, color=black]\\n  edge [dir=none]\\n\\n  0 -> 1\\n  0 -> 4\\n  1 -> 2\\n  1 -> 3\\n\\n  0 [label=\\\"( ( p ∨ q ) → r )\\\"]\\n  1 [label=\\\"( p ∨ q )\\\"]\\n  2 [label=\\\"p\\\"]\\n  3 [label=\\\"q\\\"]\\n  4 [label=\\\"r\\\"]\\n}\"\n\n","type":"Graph.Graph LogicUS.PL.SintaxSemantics.FormulaPL () -> String.String"},{"name":"fplFormTreeToString","comment":" It gives the String representation of a formTree.\n\n    fplFormTreeToString <| fplFormTree f3 == \"0 ( ( p ∨ q ) → r )\\n1 ( p ∨ q )\\n2 p\\n3 q\\n4 r\\n#\\n0 1\\n0 4\\n1 2\\n1 3\"\n\n","type":"Graph.Graph LogicUS.PL.SintaxSemantics.FormulaPL () -> String.String"},{"name":"fplInterpretations","comment":" It gives all possible interpretations of a formula.\n\n    fplInterpretations f1 == [ [], [ \"b\" ], [ \"a\" ], [ \"a\", \"b\" ] ]\n\n    fplInterpretations f2 == [ [], [ \"b\" ], [ \"a\" ], [ \"a\", \"b\" ] ]\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> List.List LogicUS.PL.SintaxSemantics.Interpretation"},{"name":"fplIsLiteral","comment":" It checks if a formula is a literal or not.\n\n    fplIsLiteral (Atom \"p\\_{1}\") == True\n    fplIsLiteral (Neg(Atom \"p\\_{1}\")) == True\n    fplIsLiteral (Disj (Atom \"p\\_{1}\") (Atom \"p\\_{2}\")) == False\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> Basics.Bool"},{"name":"fplIsNegativeLiteral","comment":" It checks if a formula is a negative literal or not\n\n    fplIsNegativeLiteral (Atom \"p\\_{1}\") == False\n\n    fplIsNegativeLiteral (Neg(Atom \"p\\_{1}\")) == True\n\n    fplIsNegativeLiteral (Disj (Atom \"p\\_{1}\") (Atom \"p\\_{2}\")) == False\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> Basics.Bool"},{"name":"fplIsPositiveLiteral","comment":" It checks if a formula is a positive literal or not\n\n    fplIsPositiveLiteral (Atom \"p\\_{1}\") == True\n\n    fplIsPositiveLiteral (Neg(Atom \"p\\_{1}\")) == False\n\n    fplIsPositiveLiteral (Disj (Atom \"p\\_{1}\") (Atom \"p\\_{2}\")) == False\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> Basics.Bool"},{"name":"fplModels","comment":" It gives all models of a formula\n\n    fplModels f1 == [ [], [ \"b\" ], [ \"a\", \"b\" ] ]\n\n    fplModels f2 == [ [], [ \"b\" ], [ \"a\" ], [ \"a\", \"b\" ] ]\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> List.List LogicUS.PL.SintaxSemantics.Interpretation"},{"name":"fplModelsCountermodels","comment":" It gives all models and countermodels of a formula as a tuple (models, countermodels).\n\n    fplModelsCountermodels f1 == ( [ [], [ \"b\" ], [ \"a\", \"b\" ] ], [ [ \"a\" ] ] )\n\n    fplModelsCountermodels f2 == ( [ [], [ \"b\" ], [ \"a\" ], [ \"a\", \"b\" ] ], [] )\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> ( List.List LogicUS.PL.SintaxSemantics.Interpretation, List.List LogicUS.PL.SintaxSemantics.Interpretation )"},{"name":"fplNegation","comment":" It gives the negation of a formula.\n\n    fplNegation (Neg f1) == f1\n\n    fplNegation Insat == Insat\n\n    fplNegation f1 = Neg f1\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> LogicUS.PL.SintaxSemantics.FormulaPL"},{"name":"fplReadExtraction","comment":" It extract the formula readed. If it is Nothing it returns Insat\n\n    f3 = fplReadExtraction <| fplReadFromString \"(p \\\\/ q -> r)\"\n    f3 == Impl (Disj (Atom \"p\") (Atom \"q\")) (Atom \"r\")\n    f4 = fplReadExtraction <| fplReadFromString \"(p \\\\/ q <- r)\"\n    f4 == Insat\n\n","type":"( Maybe.Maybe LogicUS.PL.SintaxSemantics.FormulaPL, String.String, String.String ) -> LogicUS.PL.SintaxSemantics.FormulaPL"},{"name":"fplReadFromString","comment":" It reads the formula from a string. It returns a tuple with may be a formula (if it can be read it), the input considerated to parse and a message of error it it is not able to performs the parsing.\n\n    fplReadFromString \"p\" == ( Just (Atom \"p\"), \"p\", \"\" )\n\n    fplReadFromString \"p_{1} /\\\\ p_{2}\" == ( Just (Conj (Atom \"p_{1}\") (Atom \"p_{2}\")), \"(p_{1}/\\\\p_{2})\", \"\" )\n\n    fplReadFromString \"(p \\\\/ q -> r)\" == ( Just (Impl (Disj (Atom \"p\") (Atom \"q\")) (Atom \"r\")), \"((p\\\\/q)->r)\", \"\" )\n\n    fplReadFromString \"p_{1,1} <-> p_{1,2}\" == ( Just (Equi (Atom \"p_{1,1}\") (Atom \"p_{1,2}\")), \"(p_{1,1}<->p_{1,2})\", \"\" )\n\n    fplReadFromString \"_|_\" == ( Just Insat, \"_|_\", \"\" )\n\n    fplReadFromString \"p_1\" == ( Nothing, \"(p_1)\", \"Error: [{ col = 3, problem = ExpectingSymbol ')', row = 1 }]\" )\n\nMessages are not perfect but we're working to improve it.\n\n","type":"String.String -> ( Maybe.Maybe LogicUS.PL.SintaxSemantics.FormulaPL, String.String, String.String )"},{"name":"fplSatisfiability","comment":" It gives if a formula is satisfiable (bruteforce)\n\n    fplSatisfiability f1 == True\n\n    fplSatisfiability f2 == True\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> Basics.Bool"},{"name":"fplSymbols","comment":" It calculates all the symbols that take place in a formula\n\n    fplSymbols f1 == [ \"a\", \"b\" ]\n\n    fplSymbols f2 == [ \"a\", \"b\" ]\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> List.List LogicUS.PL.SintaxSemantics.PSymb"},{"name":"fplToInputString","comment":" It gives the corresponding input syntax of a formula\n\n    fplToInputString f3 == \"((p\\\\/q)->r)\"\n\n    fplToInputString f4 == \"_|_\"\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> String.String"},{"name":"fplToMathString","comment":" It generates the Latex string of a PL formula. The result requires a math enviroment to be displayed.\n\n    fplToMathString f1 == \"\\\\left( a\\\\rightarrow b \\\\right)\"\n\n    fplToMathString f2 == \"\\\\left( \\\\neg \\\\left( a \\\\wedge b \\\\right)\\\\leftrightarrow \\\\left( \\\\neg a \\\\vee \\\\neg b \\\\right) \\\\right)\"\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> String.String"},{"name":"fplToString","comment":" It generates the String representation of a PL formula using unicode symbols.\n\n    fplToString f1 == \"( a → b )\"\n\n    fplToString f2 == \"( ¬ ( a ∧ b ) ↔ ( ¬ a ∨ ¬ b ) )\"\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> String.String"},{"name":"fplTruthTable","comment":" It gives the truth table of a formula as a List(Interpretation, Bool). You cab visualize it as a table using the function fplTruthTableHTML (defined in module Logicus.Base.Repr.SintaxSemantics.HTML) or using fplTruthTableMathString (defined in module Logicus.Base.Repr.SintaxSemantics.Latex) and follow the instructions given in the respective module.\n\n    fplTruthTable f1 == [ ( [], True ), ( [ \"b\" ], True ), ( [ \"a\" ], False ), ( [ \"a\", \"b\" ], True ) ]\n\n    flpTruthTable f2 == [ ( [], True ), ( [ \"b\" ], True ), ( [ \"a\" ], True ), ( [ \"a\", \"b\" ], True ) ]\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> List.List ( LogicUS.PL.SintaxSemantics.Interpretation, Basics.Bool )"},{"name":"fplTruthTableMathString","comment":" It generates the Latex code of a Truth Table of a PL formula. The result requires a math enviroment to be displayed.\n\n    fplTruthTableMathString f1 == \"\\\\begin{array}{c|c|c|}\\n\\mathbf{a} & \\\\mathbf{b} & \\\\mathbf{\\\\left( a\\\\rightarrow b \\\\right)} \\\\\\\\ \\\\hline \\nF & F & T \\\\\\\\ \\nF & T & T \\\\\\\\ \\nT & F & F \\\\\\\\ \\nT & T & T \\\\\\\\ \\\\end{array}\"\n\n    fplTruthTableMathString f2 == \"\\\\begin{array}{c|c|c|}\\n\\n\\\\mathbf{a} & \\\\mathbf{b} & \\\\mathbf{\\\\left( \\\\neg \\\\left( a \\\\wedge b \\\\right)\\\\leftrightarrow \\\\left( \\\\neg a \\\\vee \\\\neg b \\\\right) \\\\right)} \\\\\\\\\\\\hlineF & F & T \\\\\\\\ \\nF & T & T \\\\\\\\ \\nT & F & T \\\\\\\\ \\nT & T & T \\\\\\\\ \\\\end{array}\"\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> String.String"},{"name":"fplTruthTableString","comment":" It generates the Truth Table of a PL formula as a string using CSV format (separated by ';')\n\n    fplTruthTableString f1 == \"a ; b ; ( a → b ) \\nF ; F ; T \\nF ; T ; T \\nT ; F ; F \\nT ; T ; T\"\"\n    fplTruthTableString f2 == \"a ; b ; ( ¬ ( a ∧ b ) ↔ ( ¬ a ∨ ¬ b ) ) \\nF ; F ; T \\nF ; T ; T \\nT ; F ; T \\nT ; T ; T\"\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> String.String"},{"name":"fplUnsatisfiability","comment":" It gives if a formula is unsatisfiable (bruteforce)\n\n    fplUnsatisfiability f1 == False\n\n    fplUnsatisfiability f2 == False\n\n    fplUnsatisfiability Insat == True\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> Basics.Bool"},{"name":"fplValidity","comment":" It gives if a formula is a tautology (bruteforce)\n\n    fplValidity f1 == False\n\n    fplValidity f2 == True\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> Basics.Bool"},{"name":"fplValuation","comment":" It calculates the truth value of a formula regarding to an interpretation.\n\n    fplValuation f1 i1 == True\n\n    fplValuation f1 i2 == False\n\n    fplValuation f2 i3 == True\n\n","type":"LogicUS.PL.SintaxSemantics.FormulaPL -> LogicUS.PL.SintaxSemantics.Interpretation -> Basics.Bool"},{"name":"interpretationsFromSymbolsAndLiterals","comment":" It calculates the list of interpretations from a list of symbols and a list of literals taking each symbol as true if it apears as positive literal,\nas negative if it apears as negative literal and indiferent if it doesn't appear.\n","type":"List.List LogicUS.PL.SintaxSemantics.PSymb -> List.List LogicUS.PL.SintaxSemantics.Literal -> List.List LogicUS.PL.SintaxSemantics.Interpretation"},{"name":"logicalConsecuence","comment":" It gives if a if a formula F is consecuence of a set of formulas S checking if all model of S is also model of F. (bruteforce)\n\n    logicalConsecuence fs (Disj (Neg (Atom \"a\")) (Atom \"b\")) == True\n\n    logicalConsecuence fs Insat == False\n\n    logicalConsecuence [ Insat ] f1 == True -- You can deduce anything of an unsatifiable set.\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> LogicUS.PL.SintaxSemantics.FormulaPL -> Basics.Bool"},{"name":"logicalConsecuence2","comment":" It gives if a if a formula F is consecuence of a set of formulas S checking if S U {F} is unsatisfiable. (bruteforce)\n\n    logicalConsecuence2 fs (Disj (Neg (Atom \"a\")) (Atom \"b\")) == True\n\n    logicalConsecuence2 fs Insat == False\n\n    logicalConsecuence2 [ Insat ] f1 == True -- You can deduce anything of an unsatifiable set.\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> LogicUS.PL.SintaxSemantics.FormulaPL -> Basics.Bool"},{"name":"splCountermodels","comment":" It gives all countermodels of a set of formulas\n\n    splCountermodels fs == [ [ \"a\" ] ]\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> List.List LogicUS.PL.SintaxSemantics.Interpretation"},{"name":"splInterpretations","comment":" It gives all possible interpretations of a set of formulas.\n\n    splInterpretations fs == [ [], [ \"b\" ], [ \"a\" ], [ \"a\", \"b\" ] ]\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> List.List LogicUS.PL.SintaxSemantics.Interpretation"},{"name":"splModels","comment":" It gives all models of a set of formulas\n\n    splModels fs == [ [], [ \"b\" ], [ \"a\", \"b\" ] ]\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> List.List LogicUS.PL.SintaxSemantics.Interpretation"},{"name":"splModelsCountermodels","comment":" It gives all models and countermodels of a set of formulas as a tuple (models, countermodels).\n\n    splModelsCountermodels fs == ( [ [], [ \"b\" ], [ \"a\", \"b\" ] ], [ [ \"a\" ] ] )\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> ( List.List LogicUS.PL.SintaxSemantics.Interpretation, List.List LogicUS.PL.SintaxSemantics.Interpretation )"},{"name":"splSatisfiability","comment":" It gives if a set of formulas is satisfiable (bruteforce)\n\n    splSatisfiability fs == True\n\n    splSatisfiability (fs ++ [ Atom \"a\", Neg (Atom \"b\") ]) == False\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> Basics.Bool"},{"name":"splSymbols","comment":" It calculates all the symbols that take place in a set of formulas\n\n    fplSymbols f2 == [ \"a\", \"b\" ]\n\n","type":"List.List LogicUS.PL.SintaxSemantics.FormulaPL -> List.List LogicUS.PL.SintaxSemantics.PSymb"},{"name":"splToMathString","comment":" It generates the Latex string of a Set of PL formulas. The result requires a math enviroment to be displayed.\n\n    splToMathString [ f1, f2 ] == \"\\\\left\\\\lbrace \\\\left( a\\\\rightarrow b \\\\right), \\\\left( \\\\neg \\\\left( a \\\\wedge b \\\\right)\\\\leftrightarrow \\\\left( \\\\neg a \\\\vee \\\\neg b \\\\right) \\\\right)\\\\right\\\\rbrace\"\n\n","type":"List.List LogicUS.PL.SintaxSemantics.FormulaPL -> String.String"},{"name":"splToString","comment":" It generates the String of Set of PL formulas using unicode symbols.\n\n    splToString [ f1, f2 ] == \"{( a → b ), ( ¬ ( a ∧ b ) ↔ ( ¬ a ∨ ¬ b ) )}\"\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> String.String"},{"name":"splTruthTable","comment":" It gives the truth table of a set of formulas as a List(Interpretation, Bool). You can visualize it as a table using the function splTruthTableHTML (defined in module Logicus.Base.Repr.SintaxSemantics.HTML) or using splTruthTableLatex (defined in module Logicus.Base.Repr.SintaxSemantics.Latex) and follow the instructions given in the respective module.\n\n    splTruthTable fs == [ ( [], True ), ( [ \"b\" ], True ), ( [ \"a\" ], False ), ( [ \"a\", \"b\" ], True ) ]\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> List.List ( LogicUS.PL.SintaxSemantics.Interpretation, Basics.Bool )"},{"name":"splTruthTableMathString","comment":" It generates the Latex code of a Truth Table of Set of PL formulas. The result requires a math enviroment to be displayed.\n\n    splTruthTableMathString [ f1, f2 ] =\n        \"\\\\begin{array}{c|c|c|c|c|}\\\\mathbf{a} & \\\\mathbf{b} & \\\\mathbf{\\\\left( a\\\\rightarrow b \\\\right)} & \\\\mathbf{\\\\left( \\\\neg \\\\left( a \\\\wedge b \\\\right)\\\\leftrightarrow \\\\left( \\\\neg a \\\\vee \\\\neg b \\\\right) \\\\right)} & \\\\mathbf{U} \\\\\\\\ \\\\hlineF & F & T & T & T \\\\\\\\ F & T & T & T & T \\\\\\\\ T & F & F & T & F \\\\\\\\ T & T & T & T & T \\\\\\\\ \\\\end{array}\"\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> String.String"},{"name":"splTruthTableString","comment":" It generates the Truth Table of a set of PL formulas as a string using CSV format.\n\n    splTruthTableString [ f1, f2 ] == \"a ; b ; ( a → b ) ; ( ¬ ( a ∧ b ) ↔ ( ¬ a ∨ ¬ b ) ) ; U \\n0 ; 0 ; T ; T ; T \\n0 ; 1 ; T ; T ; T \\n1 ; 0 ; F ; T ; F \\n1 ; 1 ; T ; T ; T\"\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> String.String"},{"name":"splUnsatisfiability","comment":" It gives if a set of formulas is unsatisfiable (bruteforce)\n\n    splUnsatisfiability fs == False\n\n    splUnatisfiability (fs ++ [ Atom \"a\", Neg (Atom \"b\") ]) == True\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> Basics.Bool"},{"name":"splValuation","comment":" It calculates the truth value of a set of formulas regarding to an interpretation.\n\n    splValuation fs i1 == True\n\n    splValuation fs i2 == False\n\n    splValuation fs i3 == True\n\n","type":"LogicUS.PL.SintaxSemantics.SetPL -> LogicUS.PL.SintaxSemantics.Interpretation -> Basics.Bool"}],"binops":[]}]