vicramgon/logicus/8.0.0

NOTE: the latest version is 10.1.0

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 8.0.0 found (12 same-name repos checked); no cached copy. Use another version.

Details

LogicUS.FOL.Clauses

The module provides the tools for express formulas in their Clausal Form.

Types

= P ( String, List Int ) (List Term)
| Eq Term Term

It represent An Atom of a clause as a Predicate (P) or as a equality (E)

type alias ClauseFOLLiteral =
( ClauseFOLAtom, Bool )

It represent a literal of a clause as a tuple with the symbol of the literal (string) and the sign of the literal (False:negative literal, True:positive literal).

type alias ClauseFOL =
List ClauseFOLLiteral

It represent a set of clause literals.

type alias ClauseFOLSet =
List ClauseFOL

It represent a set of ClauseFOL

Work with clauses

It gives the variables that appears in a clause atom

cfolVarSymbols : ClauseFOL -> Set Variable

It gives the variables that appears in a clause

cfolAtomSymbol : ClauseFOLAtom -> ( String, List Int )

It gives the symbol of the predicate of the atom ("=" is reserved for equality)

cfolLiteralSymbols : ClauseFOL -> Set ( String, List Int )

It gives the symbols of literals that appears in a clause

It applies a Substitution over a clause atom

cfolApplySubstitution : Substitution -> ClauseFOL -> ClauseFOL

It applies a substitution over a clause

cfolSort : ClauseFOL -> ClauseFOL

It sorts the literals of the clause by alphabetical order.

cfolUnion : ClauseFOL -> ClauseFOL -> ClauseFOL

It calculates the union of two clauses

cfolSubsumes : ClauseFOL -> ClauseFOL -> Bool

Indicates if the first clause subsumes the second, that is, if the first is entirely contained in the second.

cfolIsTautology : ClauseFOL -> Bool

Indicates if the clause is a tautology, that is if it contains a literal and its complement.

cfolIsPositive : ClauseFOL -> Bool

Indicates if the clause is enterly positive, this is with all its literals positive

cfolIsNegative : ClauseFOL -> Bool

Indicates if the clause is enterly negative, this is with all its literals negative

csfolRemoveEqClauses : ClauseFOLSet -> ClauseFOLSet

It removes clauses that are equal from a list of clauses

csfolRemoveTautClauses : ClauseFOLSet -> ClauseFOLSet

It removes clauses that are tautological clauses

csfolRemoveSubsumedClauses : ClauseFOLSet -> ClauseFOLSet

It removes clauses that are subsumed by other from the list

Formulas and Clauses

It converts a ClauseFOLAtom to an Atom (FormulaFOL)

clauseFOLLitToLiteral : ClauseFOLLiteral -> FormulaFOL

It converts a ClauseFOLLiteral to a Literal (FormulaFOL)

cfolFromCNF : FormulaFOL -> Maybe ClauseFOLSet

It pass a CNF formula (opened) to a Set of clausses

ffolToClauses : FormulaFOL -> ClauseFOLSet

Express a formula as a Set of clauses.

sfolToClauses : SetFOL -> ClauseFOLSet

Express a set of formulas as a Set of clauses.

Clauses Parser

cfolReadFromString : String -> ( Maybe ClauseFOL, String, String )

It reads the Cc from a string. It returns a tuple with may be a formula (if it can be read it) and a message of error it it cannot.

cfolReadExtraction : ( Maybe ClauseFOL, String, String ) -> ClauseFOL

It extracts the clause readed. If it is Nothing then it returns an empty clause

cfolToInputString : ClauseFOL -> String

It gives the corresponding input syntax of a clause

Clauses Representation

cfolToString : ClauseFOL -> String

It generates the String representation of a ClauseFOL using unicode symbols.

cfolToMathString : ClauseFOL -> String

It generates the Latex string of a ClauseFOL. The result requires a math enviroment to be displayed.

csfolToString : ClauseFOLSet -> String

It generates the String representation of a Set of Clauses using unicode symbols.

csfolToMathString : ClauseFOLSet -> String

It generates the Latex string of a Set of Clauses. The result requires a math enviroment to be displayed.