Class SpecialFormula
java.lang.Object
org.tweetyproject.logics.commons.syntax.RelationalFormula
org.tweetyproject.logics.fol.syntax.FolFormula
org.tweetyproject.logics.fol.syntax.SpecialFormula
- All Implemented Interfaces:
Formula
,ClassicalFormula
,ComplexLogicalFormula
,Conjunctable
,Disjunctable
,Invertable
,LogicStructure
,ProbabilityAware
,QuantifiedFormula
,SimpleLogicalFormula
- Direct Known Subclasses:
Contradiction
,Tautology
This class captures the common functionalities of the special
formulas tautology and contradiction.
- Author:
- Matthias Thimm
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThis method collapses all associative operations appearing in this term, e.g.boolean
Checks whether this formula contains any quantification.getAtoms()
Processes the set of all atoms which appear in this formulaReturn conjunctionsReturn disjunctionProcesses the set of all predicates which appear in this formulaReturn formulasgetTerms()
Processes the set containing all terms of type C.boolean
isClosed()
Checks whether this formula is closed, i.e.boolean
Checks whether this formula is closed, i.e.boolean
isDnf()
Checks whether this formula is in disjunctive normal form.boolean
boolean
Checks whether this formula is well-bound, i.e.boolean
isWellBound
(Set<Variable> boundVariables) Checks whether this formula is well-bound, i.e.substitute
(Term<?> v, Term<?> t) Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.toNnf()
Makes the negation normal form of this formula.Methods inherited from class org.tweetyproject.logics.fol.syntax.FolFormula
clone, combineWithAnd, combineWithOr, complement, getQuantifierVariables, getSignature, getUniformProbability, toDnf
Methods inherited from class org.tweetyproject.logics.commons.syntax.RelationalFormula
allGroundInstances, allSubstitutions, containsTermsOfType, exchange, getFormula, getPredicateCls, getSatisfactionRatio, isGround, isWellFormed, substitute, toString
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.tweetyproject.logics.commons.syntax.interfaces.SimpleLogicalFormula
equals, hashCode
-
Constructor Details
-
SpecialFormula
public SpecialFormula()Default Constructor
-
-
Method Details
-
containsQuantifier
public boolean containsQuantifier()Description copied from interface:QuantifiedFormula
Checks whether this formula contains any quantification.- Returns:
- "true" if this formula contains a quantification.
-
getTerms
-
getTerms
Description copied from interface:LogicStructure
Processes the set containing all terms of type C. This method uses the equals method of the given Class and therefore does not add terms which are sub classes of type C to the set.- Type Parameters:
C
- the type of terms- Parameters:
cls
- The Class structure containing type information about the searched term- Returns:
- A set containing all terms of type C of this logical structure
-
getAtoms
Description copied from interface:SimpleLogicalFormula
Processes the set of all atoms which appear in this formula- Specified by:
getAtoms
in interfaceSimpleLogicalFormula
- Specified by:
getAtoms
in classRelationalFormula
- Returns:
- all atoms that appear in this formula.
-
getPredicates
Description copied from interface:SimpleLogicalFormula
Processes the set of all predicates which appear in this formula- Returns:
- all predicates that appear in this formula
-
isClosed
public boolean isClosed()Description copied from interface:QuantifiedFormula
Checks whether this formula is closed, i.e. whether every variables occurring in the formula is bound by a quantifier.- Returns:
- "true" if this formula is closed, "false" otherwise.
-
isClosed
Description copied from interface:QuantifiedFormula
Checks whether this formula is closed, i.e. whether every variables occurring in the formula is bound by a quantifier. Every variable in "boundVariables" is already assumed to be bound.- Parameters:
boundVariables
- the variables assumed to be bound.- Returns:
- "true" if this formula is closed wrt. "boundVariables", "false" otherwise.
-
isWellBound
public boolean isWellBound()Description copied from interface:QuantifiedFormula
Checks whether this formula is well-bound, i.e. whether no variable bound by a quantifier is again bound by another quantifier within the first quantifier's range.- Returns:
- "true" if this formula is well-bound, "false" otherwise.
-
isWellBound
Description copied from interface:QuantifiedFormula
Checks whether this formula is well-bound, i.e. whether no variable bound by a quantifier is again bound by another quantifier within the first quantifier range. Every variable in "boundVariables" is assumed to be bound already.- Parameters:
boundVariables
- the variables assumed to be bound.- Returns:
- "true" if this formula is well-bound, "false" otherwise.
-
isLiteral
public boolean isLiteral()- Returns:
- true if the formula represents a literal in the language or false otherwise
-
substitute
Description copied from class:RelationalFormula
Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula. NOTE: if "v" is a variable and bound to a quantifier then "v" is not substituted in that quantifiers inner formula.- Specified by:
substitute
in interfaceComplexLogicalFormula
- Specified by:
substitute
in classFolFormula
- Parameters:
v
- the term to be substituted.t
- the term to substitute.- Returns:
- a formula where every occurrence of "v" is replaced by "t".
-
getUnboundVariables
-
getFunctors
- Specified by:
getFunctors
in classRelationalFormula
- Returns:
- all functors that appear in this formula.
-
getQuantifiedFormulas
-
getDisjunctions
-
getConjunctions
-
isDnf
public boolean isDnf()Description copied from class:FolFormula
Checks whether this formula is in disjunctive normal form.- Specified by:
isDnf
in classFolFormula
- Returns:
- "true" iff this formula is in disjunctive normal form.
-
toNnf
Description copied from class:FolFormula
Makes the negation normal form of this formula.- Specified by:
toNnf
in classFolFormula
- Returns:
- the NNF of this formula
-
collapseAssociativeFormulas
Description copied from class:FolFormula
This method collapses all associative operations appearing in this term, e.g. every a||(b||c) becomes a||b||c.- Specified by:
collapseAssociativeFormulas
in classFolFormula
- Returns:
- the collapsed formula.
-