Class FolAtom
java.lang.Object
org.tweetyproject.logics.commons.syntax.RelationalFormula
org.tweetyproject.logics.fol.syntax.FolFormula
org.tweetyproject.logics.fol.syntax.FolAtom
- All Implemented Interfaces:
- Formula,- Atom,- ClassicalFormula,- ComplexLogicalFormula,- Conjunctable,- Disjunctable,- Invertable,- LogicStructure,- ProbabilityAware,- QuantifiedFormula,- SimpleLogicalFormula
An atom in first-order logic, i.e. a predicate and a list of argument terms.
- Author:
- Matthias Thimm
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.tweetyproject.logics.commons.syntax.interfaces.AtomAtom.AtomImpl, Atom.RETURN_SET_PREDICATE
- 
Constructor SummaryConstructorsConstructorDescriptionFolAtom()Default-Ctor: Creates new empty FOL-AtomCreates a new atom with the given predicate and initializes an empty argument list.Creates a new atom with the given predicate and list of termsconstructs FolAtom
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddArgument(Term<?> term) Appends the given argument to this atom's arguments and returns itself.clone()Creates a deep copy of this formulaThis method collapses all associative operations appearing in this term, e.g.booleanChecks whether this formula contains any quantification.booleangetAtoms()Processes the set of all atoms which appear in this formulagetName()Returns the predicate of this atomProcesses the set of all predicates which appear in this formulagetTerms()Processes the set containing all terms of type C.inthashCode()booleanisClosed()Checks whether this formula is closed, i.e.booleanChecks whether this formula is closed, i.e.booleanChecks whether this atom is complete, i.e.booleanisDnf()Checks whether this formula is in disjunctive normal form.booleanbooleanChecks whether this formula is well-bound, i.e.booleanisWellBound(Set<Variable> boundVariables) Checks whether this formula is well-bound, i.e.setPredicate(Predicate newer) Changes the predicate of the atom.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.toString()Methods inherited from class org.tweetyproject.logics.fol.syntax.FolFormulacombineWithAnd, combineWithOr, complement, getQuantifierVariables, getSignature, getUniformProbability, toDnfMethods inherited from class org.tweetyproject.logics.commons.syntax.RelationalFormulaallGroundInstances, allSubstitutions, containsTermsOfType, exchange, getFormula, getPredicateCls, getSatisfactionRatio, isGround, isWellFormed, substituteMethods inherited from interface org.tweetyproject.commons.FormulagetSignatureMethods inherited from interface org.tweetyproject.logics.commons.syntax.interfaces.SimpleLogicalFormulagetPredicateCls
- 
Constructor Details- 
FolAtompublic FolAtom()Default-Ctor: Creates new empty FOL-Atom
- 
FolAtomCreates a new atom with the given predicate and initializes an empty argument list.- Parameters:
- predicate- the predicate of the atom.
 
- 
FolAtomconstructs FolAtom- Parameters:
- predicate- predicate
- terms- terms
 
- 
FolAtomCreates a new atom with the given predicate and list of terms- Parameters:
- predicate- the predicate of the atom
- arguments- the arguments (terms) of the atom
 
- 
FolAtom- Parameters:
- other- another Atom
 
 
- 
- 
Method Details- 
addArgumentAppends the given argument to this atom's arguments and returns itself.- Specified by:
- addArgumentin interface- Atom
- Parameters:
- term- an argument to be added
- Throws:
- IllegalArgumentException- if the given term does not correspond to the expected sort or the argument list is complete.
 
- 
substituteDescription 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:
- IllegalArgumentException- if "v" and "t" are of different sorts (NOTE: this exception is only thrown when "v" actually appears in this formula).
 
- 
getAtomsDescription 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.
 
- 
isCompletepublic boolean isComplete()Checks whether this atom is complete, i.e. whether every argument is set.- Specified by:
- isCompletein interface- Atom
- Returns:
- "true" if the atom is complete.
 
- 
getUnboundVariables- Specified by:
- getUnboundVariablesin interface- QuantifiedFormula
- Returns:
- a set of of unbound variables
 
- 
getPredicatesDescription copied from interface:SimpleLogicalFormulaProcesses the set of all predicates which appear in this formula- Specified by:
- getPredicatesin interface- SimpleLogicalFormula
- Returns:
- all predicates that appear in this formula
 
- 
getFunctors- Specified by:
- getFunctorsin class- RelationalFormula
- Returns:
- all functors that appear in this formula.
 
- 
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.- Specified by:
- isClosedin interface- QuantifiedFormula
- Returns:
- "true" if this formula is closed, "false" otherwise.
 
- 
isClosedDescription 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.- Specified by:
- isClosedin interface- QuantifiedFormula
- Parameters:
- boundVariables- the variables assumed to be bound.
- Returns:
- "true" if this formula is closed wrt. "boundVariables", "false" otherwise.
 
- 
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.- Specified by:
- isWellBoundin interface- QuantifiedFormula
- Returns:
- "true" if this formula is well-bound, "false" otherwise.
 
- 
isWellBoundDescription 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.- Specified by:
- isWellBoundin interface- QuantifiedFormula
- Parameters:
- boundVariables- the variables assumed to be bound.
- Returns:
- "true" if this formula is well-bound, "false" otherwise.
 
- 
containsQuantifierpublic boolean containsQuantifier()Description copied from interface:QuantifiedFormulaChecks whether this formula contains any quantification.- Specified by:
- containsQuantifierin interface- QuantifiedFormula
- Returns:
- "true" if this formula contains a quantification.
 
- 
getPredicateReturns the predicate of this atom- Specified by:
- getPredicatein interface- Atom
- Returns:
- the predicate of this atom
 
- 
getArguments- Specified by:
- getArgumentsin interface- Atom
- Returns:
- the arguments of this atom.
 
- 
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.
 
- 
isLiteralpublic boolean isLiteral()- Specified by:
- isLiteralin interface- SimpleLogicalFormula
- Returns:
- true if the formula represents a literal in the language or false otherwise
 
- 
toString- Specified by:
- toStringin class- RelationalFormula
 
- 
toNnfDescription copied from class:FolFormulaMakes the negation normal form of this formula.- Specified by:
- toNnfin class- FolFormula
- Returns:
- the NNF of this formula
 
- 
collapseAssociativeFormulasDescription 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.
 
- 
hashCodepublic int hashCode()- Specified by:
- hashCodein interface- SimpleLogicalFormula
- Overrides:
- hashCodein class- Object
 
- 
equals- Specified by:
- equalsin interface- SimpleLogicalFormula
- Overrides:
- equalsin class- Object
 
- 
getTerms- Specified by:
- getTermsin interface- LogicStructure
- Returns:
- a set containing all terms of this logical structure
 
- 
getTermsDescription 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.- Specified by:
- getTermsin interface- LogicStructure
- 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
 
- 
cloneDescription 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
 
- 
setPredicateDescription copied from interface:AtomChanges the predicate of the atom. Given an old Predicate po and a new predicate pn with their list of arguments types at(po) and at(pn) and the arguments of this Atom: arg(this) this method distinguishes between three cases: 1. The predicate only differ in the names, returning RSP_SUCCESS 2. The old predicates argument types is a sub-list of the new argument types then the method returns RSP_INCOMPLETE and the atoms isComplete() method returns false 3. The new predicates argument types is a sub-list of the old argument types then the method returns RSP_TRUNCATED and the arguments of this atom are truncated too and isComplete() returns true. 4. The old and new predicates' argument types differ then the list of arguments of the atom get cleared and isComplete() returns false.- Specified by:
- setPredicatein interface- Atom
- Parameters:
- newer- some predicate
- Returns:
- Depends on the cases described above: 1. RSP_SUCCESS 2. RSP_INCOMPLETE 3. RSP_TRUNCATED 4. RSP_CLEARED
 
- 
getName
 
-