Class LdoArgument
- java.lang.Object
-
- net.sf.tweety.arg.dung.ldo.syntax.LdoFormula
-
- net.sf.tweety.arg.dung.ldo.syntax.LdoArgument
-
- All Implemented Interfaces:
java.lang.Comparable<LdoArgument>,Formula,Atom,ClassicalFormula,Conjunctable,Disjunctable,Invertable,ProbabilityAware,SimpleLogicalFormula
public class LdoArgument extends LdoFormula implements Atom, java.lang.Comparable<LdoArgument>
This class represents an argument in ldo.- Author:
- Matthias Thimm, Tim Janus
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.sf.tweety.logics.commons.syntax.interfaces.Atom
Atom.AtomImpl, Atom.RETURN_SET_PREDICATE
-
-
Field Summary
Fields Modifier and Type Field Description private PlPredicatepredicateThe name of the proposition
-
Constructor Summary
Constructors Constructor Description LdoArgument()Default-Ctor for dynamic instantiationLdoArgument(java.lang.String name)Creates a new proposition of the given name.LdoArgument(LdoArgument other)
-
Method Summary
Modifier and Type Method Description voidaddArgument(Term<?> arg)Adds an argument to the atom's argument listLdoArgumentclone()Creates a deep copy of this formulaintcompareTo(LdoArgument o)booleanequals(java.lang.Object obj)ArgumentgetArgument()Returns an argument representation (in Dung-style) of this LdoArgument.java.util.List<? extends Term<?>>getArguments()java.util.Set<LdoArgument>getAtoms()Processes the set of all atoms which appear in this formulajava.util.Set<LdoFormula>getLiterals()Returns all literals, i.e.java.lang.StringgetName()PlPredicategetPredicate()java.util.Set<PlPredicate>getPredicates()Processes the set of all predicates which appear in this formulaDungSignaturegetSignature()Returns the signature of the language of this formula.inthashCode()booleanisComplete()booleanisLiteral()Atom.RETURN_SET_PREDICATEsetPredicate(Predicate predicate)Changes the predicate of the atom.java.lang.StringtoString()-
Methods inherited from class net.sf.tweety.arg.dung.ldo.syntax.LdoFormula
combineWithAnd, combineWithOr, complement, getDividers, getPredicateCls, getUniformProbability
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
getPredicateCls
-
-
-
-
Field Detail
-
predicate
private PlPredicate predicate
The name of the proposition
-
-
Constructor Detail
-
LdoArgument
public LdoArgument()
Default-Ctor for dynamic instantiation
-
LdoArgument
public LdoArgument(java.lang.String name)
Creates a new proposition of the given name.- Parameters:
name- the name of the proposition.
-
LdoArgument
public LdoArgument(LdoArgument other)
-
-
Method Detail
-
getArgument
public Argument getArgument()
Returns an argument representation (in Dung-style) of this LdoArgument.- Returns:
- an argument representation (in Dung-style) of this LdoArgument.
-
getName
public java.lang.String getName()
-
getPredicate
public PlPredicate getPredicate()
- Specified by:
getPredicatein interfaceAtom- Returns:
- the predicate of the atom
-
getPredicates
public java.util.Set<PlPredicate> getPredicates()
Description copied from interface:SimpleLogicalFormulaProcesses the set of all predicates which appear in this formula- Specified by:
getPredicatesin interfaceSimpleLogicalFormula- Specified by:
getPredicatesin classLdoFormula- Returns:
- all predicates that appear in this formula
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getSignature
public DungSignature getSignature()
Description copied from interface:FormulaReturns the signature of the language of this formula.- Specified by:
getSignaturein interfaceFormula- Overrides:
getSignaturein classLdoFormula- Returns:
- the signature of the language of this formula.
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceSimpleLogicalFormula- Specified by:
hashCodein classLdoFormula
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin interfaceSimpleLogicalFormula- Specified by:
equalsin classLdoFormula
-
clone
public LdoArgument clone()
Description copied from interface:SimpleLogicalFormulaCreates a deep copy of this formula- Specified by:
clonein interfaceSimpleLogicalFormula- Specified by:
clonein classLdoFormula- Returns:
- the cloned formula
-
addArgument
public void addArgument(Term<?> arg)
Description copied from interface:AtomAdds an argument to the atom's argument list- Specified by:
addArgumentin interfaceAtom- Parameters:
arg- The next argument
-
getArguments
public java.util.List<? extends Term<?>> getArguments()
- Specified by:
getArgumentsin interfaceAtom- Returns:
- A list containing all the arguments of this specific atom
-
isComplete
public boolean isComplete()
- Specified by:
isCompletein interfaceAtom- Returns:
- true if the size of the argument list is equal to the arity of the predicate
-
getAtoms
public java.util.Set<LdoArgument> getAtoms()
Description copied from interface:SimpleLogicalFormulaProcesses the set of all atoms which appear in this formula- Specified by:
getAtomsin interfaceSimpleLogicalFormula- Specified by:
getAtomsin classLdoFormula- Returns:
- The set of all atoms
-
isLiteral
public boolean isLiteral()
- Specified by:
isLiteralin interfaceSimpleLogicalFormula- Overrides:
isLiteralin classLdoFormula- Returns:
- true if the formula represents a literal in the language or false otherwise
-
getLiterals
public java.util.Set<LdoFormula> getLiterals()
Description copied from class:LdoFormulaReturns 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 classLdoFormula- Returns:
- all literals appearing in this formula.
-
setPredicate
public Atom.RETURN_SET_PREDICATE setPredicate(Predicate predicate)
Description 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 interfaceAtom- Parameters:
predicate- some predicate- Returns:
- Depends on the cases described above: 1. RSP_SUCCESS 2. RSP_INCOMPLETE 3. RSP_TRUNCATED 4. RSP_CLEARED
-
compareTo
public int compareTo(LdoArgument o)
- Specified by:
compareToin interfacejava.lang.Comparable<LdoArgument>
-
-