Interface Atom
-
- All Superinterfaces:
Formula
,SimpleLogicalFormula
- All Known Implementing Classes:
AlwaysQuery
,ASPAtom
,ASPLiteral
,FolAtom
,HoldsQuery
,LdoArgument
,NecessarilyQuery
,Proposition
,QueryProposition
,StrictNegation
public interface Atom extends SimpleLogicalFormula
An atomic language construct, linked to its predicate- Author:
- Tim Janus
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Atom.AtomImpl
Gives common implementations for methods shared among atoms of different types.static class
Atom.RETURN_SET_PREDICATE
An enum containing the different return values of the setPredicate() method of Atom.
-
Method Summary
Modifier and Type Method Description void
addArgument(Term<?> arg)
Adds an argument to the atom's argument listjava.util.List<? extends Term<?>>
getArguments()
java.lang.String
getName()
Predicate
getPredicate()
boolean
isComplete()
Atom.RETURN_SET_PREDICATE
setPredicate(Predicate predicate)
Changes the predicate of the atom.-
Methods inherited from interface net.sf.tweety.commons.Formula
getSignature
-
Methods inherited from interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
clone, equals, getAtoms, getPredicateCls, getPredicates, hashCode, isLiteral
-
-
-
-
Method Detail
-
getName
java.lang.String getName()
- Returns:
- the name of the predicate
-
getPredicate
Predicate getPredicate()
- Returns:
- the predicate of the atom
-
setPredicate
Atom.RETURN_SET_PREDICATE setPredicate(Predicate predicate)
Changes 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.- Parameters:
predicate
- some predicate- Returns:
- Depends on the cases described above: 1. RSP_SUCCESS 2. RSP_INCOMPLETE 3. RSP_TRUNCATED 4. RSP_CLEARED
-
addArgument
void addArgument(Term<?> arg) throws LanguageException
Adds an argument to the atom's argument list- Parameters:
arg
- The next argument- Throws:
LanguageException
- If the language does not support arguments for their constructs.
-
getArguments
java.util.List<? extends Term<?>> getArguments()
- Returns:
- A list containing all the arguments of this specific atom
-
isComplete
boolean isComplete()
- Returns:
- true if the size of the argument list is equal to the arity of the predicate
-
-