The module provides the elementary tools for building the semantic tableau of a set of FOL formulas.
It defines the type of a PL formula which can be a Literal, Double Negation, Alpha, Beta, Gamma (forall), Delta(exists) Insat or Taut
Graph ( Basics.Int
, TableauNodeItem ) (Maybe TableauEdgeItem
}
Defines the FOL Semantic Tableau type as a Graph whose node labels are pairs of an integer (0: internal node, 1: open leaf, -1: closed leaf) and a TableauNodeItem that contains some information for representation; and the edge labels are defined as TableauEdgeItem although some edges could not have any edge.
{ f : LogicUS.FOL.SyntaxSemantics.FormulaFOL
, t : FormulaFOLType
, u : Basics.Int
, ut : List LogicUS.FOL.SyntaxSemantics.Term
, i : Basics.Int
, ps : List Basics.Int
, ant : Basics.Int
}
Defines the TableauNodeItem that is a record with the following features: 'f' the formula considered, 't' the type of the formula, 'u' the usability degree of the formula, 'ut': a list of terms with wich a gamma formula is solved, 'i':the index of the node (only for print the tableau), 'ps': the premises from which the formula is concluded
{ r : FormulaFOLType
, is : List Basics.Int
, br : Basics.Int
, s : LogicUS.FOL.SyntaxSemantics.Substitution
}
Defines the TableauEdgeItem that is a record with the following features 'r' the rule applied in the deduction, 'id' the set of indices over that the rule is applied, 'br' the identifier of the branch (only used in beta bifurcations), 's' the substitution done over the formula (only in gamma and delta rules).
ffolType : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> FormulaFOLType
It gives the class of a FOL formula. Atoms (predicates) and their negations are literals, double negation are typed as DN, conjunction, equivalence are classified as ALPHA, disjunction and implications are classified as BETA. forall-like formulas are classified as GAMMA and existencial-like ones as DELTA The negation of an alpha formula is a beta and vice versa, and the same happens with forall and exists like ones.
ffolUnquantifiedComponents : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> LogicUS.FOL.SyntaxSemantics.SetFOL
It gives the components of a unquantified formula for using them in the expansion of a semantic board
ffolQuantifiedComponents : LogicUS.FOL.SyntaxSemantics.FormulaFOL -> Maybe ( LogicUS.FOL.SyntaxSemantics.Variable, LogicUS.FOL.SyntaxSemantics.FormulaFOL )
It gives the components of a quantified formula for using them in the expansion of a semantic board
semanticTableau : LogicUS.FOL.SyntaxSemantics.SetFOL -> Basics.Int -> Basics.Int -> FOLSemanticTableau
It performs the Semantic Tableaux algorithm on a set of FOL formulas. As the algorithm can be infinite, you must indicate the maximum depth allowed. Specifically, you must specify the maximum number of times a gamma formula can be used and the absolute limit for the depth of the tree.
semanticTableauIsInsat : FOLSemanticTableau -> Basics.Bool
It check if a tableau has all his branches closed
semanticTableauRUNII : FOLSemanticTableau -> FOLSemanticTableau
It Removes the Useless Nodes In Insatisfiable tableau, that are the nodes that don't participates in the way to lograte the insatifiability.
semanticTableauToString : FOLSemanticTableau -> String
It allows to represent a FOL Semantic Tableau as a string
semanticTableauToDOT : FOLSemanticTableau -> String
It allows to represent a FOL Semantic Tableau as a DOT String rederable by GraphViz