vicramgon / logicus / LogicUS.FOL.NormalForms

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

Defined types


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

It represents the universal (all) and existencial (exists) cuantifier 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 cuantifier

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 Cuantifier, LogicUS.FOL.SyntaxSemantics.FormulaFOL, Graph LogicUS.FOL.SyntaxSemantics.FormulaFOL ( Basics.Bool, List Cuantifier ) )

It transforms a FOL Formula into one equivalent Prenex Form. It gives the list of cuantifiers 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

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

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

Skolem Form

extractHeaderCuantifiers : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> ( List Cuantifier, LogicUS.FOL.SyntaxSemantics.FormulaFOL )

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

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

It gives the Skolem functions correspondence of a list of cuantifiers

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

It calculates the Skolem Form of a Formula

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

It calculates the Skolem Forms of the formulas of a set

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