logicUSLIB / logicus-fol / LogicUS.FOL.NormalForms

The module provides the tools for expressing formulas in Prenex, Skolem, CNF, DNF.

Defined types


type Quantifier
    = A LogicUS.FOL.SyntaxSemantics.Variable
    | E LogicUS.FOL.SyntaxSemantics.Variable

It represents the universal (all) and existencial (exists) quantifier with the associated variable

Formulas Equivalent Transformations

ffolRemoveAllEquiv : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> LogicUS.FOL.SyntaxSemantics.FormulaFOL

It removes all the equivalences by changing it by the conjuction of the implications

ffolRemoveAllImpl : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> LogicUS.FOL.SyntaxSemantics.FormulaFOL

It removes all the equivalences by changing it by the disjunction of the negation of the antecedent and the consecuent

ffolInteriorizeNeg : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> LogicUS.FOL.SyntaxSemantics.FormulaFOL

It interiorizes negations applying the De Morgan Rule and the rule of negation of the quantifier

ffolInteriorizeDisj : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> LogicUS.FOL.SyntaxSemantics.FormulaFOL

It interiorizes the disjunctions by applying distributive rule

ffolInteriorizeConj : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> LogicUS.FOL.SyntaxSemantics.FormulaFOL

It interiorizes the conjunctions by applying distributive rule

Prenex Form

ffolToPrenex : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> LogicUS.FOL.SyntaxSemantics.FormulaFOL

It transforms a FOL Formula into one equivalent Prenex Form

ffolToPrenex2 : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> ( List Quantifier, LogicUS.FOL.SyntaxSemantics.FormulaFOL, Graph LogicUS.FOL.SyntaxSemantics.FormulaFOL ( Basics.Bool, List Quantifier ) )

It transforms a FOL Formula into one equivalent Prenex Form. It gives the list of quantifiers and the open formula of the Prenex Form. It also gives a Graph with the Prenex form calculus

ffolIsPrenex : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> Basics.Bool

It indicates if a formula is in Prenex Form

ffolApplyQuantifiers : List Quantifier -> LogicUS.FOL.SyntaxSemantics.FormulaFOL -> LogicUS.FOL.SyntaxSemantics.FormulaFOL

It quantifies a formula with the quantifiers given by following the reverse order on applying it (tail to head)

prenexGraphToDOT : Graph LogicUS.FOL.SyntaxSemantics.FormulaFOL ( Basics.Bool, List Quantifier ) -> String

It allows represent the Prenex Calculus Graph as DOT string, which could be rendered by GraphViz

Skolem Form

extractHeaderQuantifiers : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> ( List Quantifier, LogicUS.FOL.SyntaxSemantics.FormulaFOL )

It allows extract all the external quantifiers, especially interesting for applying over Prenex Form Formulas

getSkolemSubs : List Quantifier -> LogicUS.FOL.SyntaxSemantics.Substitution

It gives the Skolem functions correspondence of a list of quantifiers

ffolToSkolem : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> LogicUS.FOL.SyntaxSemantics.FormulaFOL

It calculates the Skolem Form of a Formula, by prenexization plus the introduction of skolem functions

sfolToSkolem : LogicUS.FOL.SyntaxSemantics.SetFOL -> LogicUS.FOL.SyntaxSemantics.SetFOL

It calculates the Skolem Forms of the formulas of a set (by using ffolToSkolem2)

NNF, CNF and DNF

ffolToNNF : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> LogicUS.FOL.SyntaxSemantics.FormulaFOL

It calculates a negative normal form of a formula

ffolToCNF : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> LogicUS.FOL.SyntaxSemantics.FormulaFOL

It calculates a conjuctive normal form of a formula

ffolToDNF : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> LogicUS.FOL.SyntaxSemantics.FormulaFOL

It calculates a disjuntive normal form of a formula

sfolToNNF : LogicUS.FOL.SyntaxSemantics.SetFOL -> LogicUS.FOL.SyntaxSemantics.SetFOL

It calculates negative normal forms of formulas of a set

sfolToCNF : LogicUS.FOL.SyntaxSemantics.SetFOL -> LogicUS.FOL.SyntaxSemantics.SetFOL

It calculates conjuctive normal forms of formulas of a set

sfolToDNF : LogicUS.FOL.SyntaxSemantics.SetFOL -> LogicUS.FOL.SyntaxSemantics.SetFOL

It calculates disjunctive normal forms of formulas of a set