Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/vicramgon/logicus is gone (deleted or private); Software Heritage not asked yet (this run's --swh-calls were used up); no fork with tag 4.0.0 found (12 same-name repos checked); no cached copy. Use another version.
The module provides the tools for express formulas in their NN, CNF, DNF.
It checks if the formula contains any disjunction as a part of the formula
fplContainsDisj f1 == False
fplContainsDisj f2 == TrueIt checks if the formula contains any conjunction as a part of the formula
fplContainsConj f1 == False
fplContainsConj f2 == TrueIt eliminates all equivalences of a formula by replacing it with the conjunction of the corresponding implications.
f3 = fplRemoveAllEquiv f1
f3 == Neg (Conj (Impl (Atom "p") (Impl (Atom "q") (Atom "r"))) (Impl (Impl (Atom "q") (Atom "r")) (Atom "p")))It checks if the formula contains any implication as a part of the formula
fplContainsImpl f1 == True
fplContainsImpl f2 == FalseIt eliminates all implications of a formula by replacing it with the conjunction of the corresponding implications.
f4 = fplRemoveAllImpl f3
f4 == Neg (Conj (Disj (Neg (Atom "p")) (Disj (Neg (Atom "q")) (Atom "r"))) (Disj (Neg (Disj (Neg (Atom "q")) (Atom "r"))) (Atom "p")))It interiorizes the disjunctions by applying the AND Distributive law where appropriate.
f7 = fplInteriorizeAllDisj f6
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")))))It interiorizes the conjunctions by applying the OR Distributive law where appropriate.
f8 = fplInteriorizeAllConj f6
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"))))It interiorizes the negations by applying De Morgan's laws where appropriate
f5 = fplInteriorizeAllNeg f2
f5 == Disj (Disj (Neg (Atom "p")) (Disj (Neg (Atom "q")) (Neg (Atom "r")))) (Disj (Conj (Atom "p") (Atom "q")) (Atom "r"))
f6 = fplInteriorizeAllNeg f4
f6 == Disj (Conj (Atom "p") (Conj (Atom "q") (Neg (Atom "r")))) (Conj (Disj (Neg (Atom "q")) (Atom "r")) (Neg (Atom "p")))Express a formula in its Conjuction Normal Form (CNF) that is formed as a conjuction of disjuntive formulas.
-- Check if f1 is in CNF
(f1 == fplToCNF f1) == False
-- Check if f7 is in CNF
(f7 == fplToCNF f7) == True
-- Calculate CNF for f1
f10 = fplToCNF f1
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")))))
-- It is equal to f7
(f10 == f7) == TrueExpress a formula in its Disjunction Normal Form (CNF) that is formed as a conjuction of disjuntive formulas.
-- Check if f1 is in DNF
(f1 == fplToDNF f1) == False
-- Check if f8 is in DNF
(f8 == fplToCNF f8) == True
-- Calculate CNF for f1
f11 = fplToDNF f1
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"))))
-- It is equal to f8
(f11 == f8) == True