Class SpecialFormula
java.lang.Object
org.tweetyproject.logics.pl.syntax.PlFormula
org.tweetyproject.logics.pl.syntax.SpecialFormula
- All Implemented Interfaces:
Formula,ClassicalFormula,Conjunctable,Disjunctable,Invertable,ProbabilityAware,SimpleLogicalFormula
- Direct Known Subclasses:
Contradiction,Tautology
This class captures the common functionalities of the special
formulas tautology and contradiction.
- Author:
- Matthias Thimm
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method collapses all associative operations appearing in this term, e.g.getAtoms()Processes the set of all atoms which appear in this formulaReturns all literals, i.e.Processes the set of all predicates which appear in this formulaintReturns the number of occurrences of the given proposition within this formulareplace(Proposition p, PlFormula f, int i) Replaces the ith instance of the proposition p by f.toCnf()This method returns this formula in conjunctive normal form (CNF).toNnf()This method returns this formula in negation normal form (NNF).trim()Removes duplicates (identical formulas) from conjunctions and disjunctions and removes duplicate negations.Methods inherited from class org.tweetyproject.logics.pl.syntax.PlFormula
clone, combineWithAnd, combineWithOr, complement, equals, getModels, getModels, getPredicateCls, getPrimeImplicants, getSignature, getUniformProbability, hashCode, isClause, isConjunctiveClause, isLiteral, resolvableWith, resolveWith, toBlakeCanonicalForm, toDnf
-
Constructor Details
-
SpecialFormula
public SpecialFormula()
-
-
Method Details
-
collapseAssociativeFormulas
Description copied from class:PlFormulaThis method collapses all associative operations appearing in this term, e.g. every a||(b||c) becomes a||b||c.- Specified by:
collapseAssociativeFormulasin classPlFormula- Returns:
- the collapsed formula.
-
getPredicates
Description copied from interface:SimpleLogicalFormulaProcesses the set of all predicates which appear in this formula- Specified by:
getPredicatesin interfaceSimpleLogicalFormula- Specified by:
getPredicatesin classPlFormula- Returns:
- all predicates that appear in this formula
-
toNnf
Description copied from class:PlFormulaThis method returns this formula in negation normal form (NNF). A formula is in NNF iff negations occur only directly in front of a proposition. -
getAtoms
Description copied from interface:SimpleLogicalFormulaProcesses the set of all atoms which appear in this formula- Specified by:
getAtomsin interfaceSimpleLogicalFormula- Specified by:
getAtomsin classPlFormula- Returns:
- The set of all atoms
-
getLiterals
Description copied from class:PlFormulaReturns all literals, i.e. all formulas of the form "a" or "!a" where "a" is a proposition, that appear in this formula.- Specified by:
getLiteralsin classPlFormula- Returns:
- all literals appearing in this formula.
-
toCnf
Description copied from class:PlFormulaThis method returns this formula in conjunctive normal form (CNF). A formula is in CNF iff it is a conjunction of disjunctions and in NNF. The CNF generated by this method is not necessarily minimal. -
numberOfOccurrences
Description copied from class:PlFormulaReturns the number of occurrences of the given proposition within this formula- Specified by:
numberOfOccurrencesin classPlFormula- Parameters:
p- some proposition- Returns:
- the number of occurrences of the given proposition within this formula
-
replace
Description copied from class:PlFormulaReplaces the ith instance of the proposition p by f. -
trim
Description copied from class:PlFormulaRemoves duplicates (identical formulas) from conjunctions and disjunctions and removes duplicate negations. Simplifies equivalences and implications with equivalent formulas (A=>A, A<=>A) to tautologies.
-