vicramgon / logicus / LogicUS.FOL.Resolution

The module provides the tools for aplying the differents resolution strategies to a set of propositional clauses for verifying its unfeasibility.

Resolvents


type alias Resolvent =
{ c1 : LogicUS.FOL.Clauses.ClauseFOL
, c2 : LogicUS.FOL.Clauses.ClauseFOL
, r : LogicUS.FOL.SyntaxSemantics.Substitution
, mgu : LogicUS.FOL.SyntaxSemantics.Substitution
, res : LogicUS.FOL.Clauses.ClauseFOL 
}

It represent the information of the resolvent, the clauses involved, the renames done, the maximum general unifier (mgu) and the result of the resolvent

cfol2SeparationSubst : LogicUS.FOL.Clauses.ClauseFOL -> LogicUS.FOL.Clauses.ClauseFOL -> LogicUS.FOL.SyntaxSemantics.Substitution

It generates the appropriate substitutions for the separation of the clauses

cfol2Separation : LogicUS.FOL.Clauses.ClauseFOL -> LogicUS.FOL.Clauses.ClauseFOL -> ( LogicUS.FOL.Clauses.ClauseFOL, LogicUS.FOL.Clauses.ClauseFOL )

It generates the appropriate substitutions for the separation of the clauses

cfol2ContraryLiterals : LogicUS.FOL.Clauses.ClauseFOL -> LogicUS.FOL.Clauses.ClauseFOL -> List ( LogicUS.FOL.Clauses.ClauseFOLLiteral, LogicUS.FOL.Clauses.ClauseFOLLiteral )

It searches all the pairs of literals from two clauses that have the same predicate and contrary sign

Refutationally Resolution Tableau Algorithm and Strategies


type alias ResolutionTableau =
Graph ( Basics.Bool
, LogicUS.FOL.Clauses.ClauseFOL ) ( LogicUS.FOL.SyntaxSemantics.Substitution
, LogicUS.FOL.SyntaxSemantics.Substitution 
}

It represent the graph structure of the tableau

csfolSCFResolution : List LogicUS.FOL.Clauses.ClauseFOL -> ( Basics.Bool, ResolutionTableau )

It uses resolution algorithm using shorted clause first heuristic for determining the feasibilibity of a set of clauses. It gives the insatisfactibility and a graph with the resolution path to inconsitence. If clause set is feasible then a graph with only initial nodes is returned.

Note: You can render the graph with GraphViz Viewer and resolutionTableauToDOt as we show in the example above.

csfolSCFLinearResolution : List LogicUS.FOL.Clauses.ClauseFOL -> ( Basics.Bool, ResolutionTableau )

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.

Note: You can render the graph with GraphViz Viewer and resolutionTableauToDOT described at the end.

csplSCFPositiveResolution : List LogicUS.FOL.Clauses.ClauseFOL -> ( Basics.Bool, ResolutionTableau )

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.

Note: You can render the graph with GraphViz Viewer and resolutionTableauToDOT described at the end.

csplSCFNegativeResolution : List LogicUS.FOL.Clauses.ClauseFOL -> ( Basics.Bool, ResolutionTableau )

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.

Note: You can render the graph with GraphViz Viewer and resolutionTableauToDOT described at the end.

Resolution Tableau Representation

resolutionTableauToString : ResolutionTableau -> String

Express a Resolution Tableau as a string.

resolutionTableauToDOT : ResolutionTableau -> String

Express a Resolution Tableau as a string in DOT format that is viewable with a GraphViz Render. Note: If you are using elm repl, before introducing the code you must replace \n by \n and \" by " in a simple text editor.