Package net.sf.tweety.lp.nlp.syntax
Class NLPNot
- java.lang.Object
- 
- net.sf.tweety.logics.commons.syntax.RelationalFormula
- 
- net.sf.tweety.logics.fol.syntax.FolFormula
- 
- net.sf.tweety.lp.nlp.syntax.NLPNot
 
 
 
- 
- All Implemented Interfaces:
- Formula,- ClassicalFormula,- ComplexLogicalFormula,- Conjunctable,- Disjunctable,- Invertable,- LogicStructure,- ProbabilityAware,- QuantifiedFormula,- SimpleLogicalFormula
 
 public class NLPNot extends FolFormula A default negation of a first order formula, nested logic programs only allow not quantified formulas. The NLPNot wraps a FOLFormula and checks that this formula does not contain quantifiers, the functionality is delegated to the used inner formula instance.- Author:
- Tim Janus
 
- 
- 
Constructor SummaryConstructors Constructor Description NLPNot(FolFormula inner)Ctor: Creates a new default not for nested logic programs by using the given FOL formula as inner formula.
 - 
Method SummaryModifier and Type Method Description NLPNotclone()Creates a deep copy of this formulaNLPNotcollapseAssociativeFormulas()This method collapses all associative operations appearing in this term, e.g.booleancontainsQuantifier()Checks whether this formula contains any quantification.booleanequals(java.lang.Object other)java.util.Set<FolAtom>getAtoms()Processes the set of all atoms which appear in this formulajava.util.Set<Functor>getFunctors()java.util.Set<? extends Predicate>getPredicates()Processes the set of all predicates which appear in this formulajava.util.Set<Term<?>>getTerms()<C extends Term<?>>
 java.util.Set<C>getTerms(java.lang.Class<C> cls)Processes the set containing all terms of type C.java.util.Set<Variable>getUnboundVariables()inthashCode()booleanisClosed()Checks whether this formula is closed, i.e.booleanisClosed(java.util.Set<Variable> boundVariables)Checks whether this formula is closed, i.e.booleanisDnf()Checks whether this formula is in disjunctive normal form.booleanisLiteral()booleanisWellBound()Checks whether this formula is well-bound, i.e.booleanisWellBound(java.util.Set<Variable> boundVariables)Checks whether this formula is well-bound, i.e.NLPNotsubstitute(Term<?> v, Term<?> t)Substitutes all occurrences of term "v" in this formula by term "t" and returns the new formula.FolFormulatoNnf()Makes the negation normal form of this formula.java.lang.StringtoString()- 
Methods inherited from class net.sf.tweety.logics.fol.syntax.FolFormulacombineWithAnd, combineWithOr, complement, getQuantifierVariables, getSignature, getUniformProbability, toDnf
 - 
Methods inherited from class net.sf.tweety.logics.commons.syntax.RelationalFormulaallGroundInstances, allSubstitutions, containsTermsOfType, exchange, getFormula, getPredicateCls, getSatisfactionRatio, isGround, isWellFormed, substitute
 
- 
 
- 
- 
- 
Constructor Detail- 
NLPNotpublic NLPNot(FolFormula inner) Ctor: Creates a new default not for nested logic programs by using the given FOL formula as inner formula.- Parameters:
- inner- The FOL formula used as inner formula.
 
 
- 
 - 
Method Detail- 
getPredicatespublic java.util.Set<? extends Predicate> getPredicates() Description copied from interface:SimpleLogicalFormulaProcesses the set of all predicates which appear in this formula- Returns:
- all predicates that appear in this formula
 
 - 
isLiteralpublic boolean isLiteral() - Returns:
- true if the formula represents a literal in the language or false otherwise
 
 - 
getUnboundVariablespublic java.util.Set<Variable> getUnboundVariables() - Returns:
- a set of of unbound variables
 
 - 
containsQuantifierpublic boolean containsQuantifier() Description copied from interface:QuantifiedFormulaChecks whether this formula contains any quantification.- Returns:
- "true" if this formula contains a quantification.
 
 - 
isWellBoundpublic boolean isWellBound() Description copied from interface:QuantifiedFormulaChecks 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.
 
 - 
isWellBoundpublic boolean isWellBound(java.util.Set<Variable> boundVariables) Description copied from interface:QuantifiedFormulaChecks 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.
 
 - 
isClosedpublic boolean isClosed() Description copied from interface:QuantifiedFormulaChecks 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.
 
 - 
isClosedpublic boolean isClosed(java.util.Set<Variable> boundVariables) Description copied from interface:QuantifiedFormulaChecks 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.
 
 - 
getTermspublic java.util.Set<Term<?>> getTerms() - Returns:
- a set containing all terms of this logical structure
 
 - 
getTermspublic <C extends Term<?>> java.util.Set<C> getTerms(java.lang.Class<C> cls) Description copied from interface:LogicStructureProcesses 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
 
 - 
toNnfpublic FolFormula toNnf() Description copied from class:FolFormulaMakes the negation normal form of this formula.- Specified by:
- toNnfin class- FolFormula
- Returns:
- the NNF of this formula
 
 - 
collapseAssociativeFormulaspublic NLPNot collapseAssociativeFormulas() Description copied from class:FolFormulaThis method collapses all associative operations appearing in this term, e.g. every a||(b||c) becomes a||b||c.- Specified by:
- collapseAssociativeFormulasin class- FolFormula
- Returns:
- the collapsed formula.
 
 - 
isDnfpublic boolean isDnf() Description copied from class:FolFormulaChecks whether this formula is in disjunctive normal form.- Specified by:
- isDnfin class- FolFormula
- Returns:
- "true" iff this formula is in disjunctive normal form.
 
 - 
substitutepublic NLPNot substitute(Term<?> v, Term<?> t) throws java.lang.IllegalArgumentException Description copied from class:RelationalFormulaSubstitutes 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:
- substitutein interface- ComplexLogicalFormula
- Specified by:
- substitutein class- FolFormula
- Parameters:
- v- the term to be substituted.
- t- the term to substitute.
- Returns:
- a formula where every occurrence of "v" is replaced by "t".
- Throws:
- java.lang.IllegalArgumentException- if "v" and "t" are of different sorts (NOTE: this exception is only thrown when "v" actually appears in this formula).
 
 - 
clonepublic NLPNot clone() Description copied from interface:SimpleLogicalFormulaCreates a deep copy of this formula- Specified by:
- clonein interface- ComplexLogicalFormula
- Specified by:
- clonein interface- SimpleLogicalFormula
- Specified by:
- clonein class- FolFormula
- Returns:
- the cloned formula
 
 - 
getAtomspublic java.util.Set<FolAtom> getAtoms() Description copied from interface:SimpleLogicalFormulaProcesses the set of all atoms which appear in this formula- Specified by:
- getAtomsin interface- SimpleLogicalFormula
- Specified by:
- getAtomsin class- RelationalFormula
- Returns:
- all atoms that appear in this formula.
 
 - 
getFunctorspublic java.util.Set<Functor> getFunctors() - Specified by:
- getFunctorsin class- RelationalFormula
- Returns:
- all functors that appear in this formula.
 
 - 
toStringpublic java.lang.String toString() - Specified by:
- toStringin class- RelationalFormula
 
 - 
equalspublic boolean equals(java.lang.Object other) - Specified by:
- equalsin interface- SimpleLogicalFormula
- Overrides:
- equalsin class- java.lang.Object
 
 - 
hashCodepublic int hashCode() - Specified by:
- hashCodein interface- SimpleLogicalFormula
- Overrides:
- hashCodein class- java.lang.Object
 
 
- 
 
-