Package net.sf.tweety.lp.asp.syntax
Class AggregateElement
- java.lang.Object
-
- net.sf.tweety.lp.asp.syntax.ASPElement
-
- net.sf.tweety.lp.asp.syntax.AggregateElement
-
- All Implemented Interfaces:
net.sf.tweety.commons.Formula,net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula,net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure,net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
public class AggregateElement extends ASPElement
This class models an aggregate element, meaning a set of terms and a set of naf literals (= literals or default negated literals). One or more aggregate elements form an aggregate or aggregate atom.- Author:
- Anna Gessler
- See Also:
AggregateAtom
-
-
Constructor Summary
Constructors Constructor Description AggregateElement(List<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> l, List<ASPBodyElement> r)Creates a new Aggregate Element with the given list of terms and the given list of naf literals.AggregateElement(AggregateElement other)Copy-Constructor
-
Method Summary
Modifier and Type Method Description AggregateElementclone()AggregateElementexchange(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)Set<ASPAtom>getAtoms()List<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>getLeft()Returns the left part of the Aggregate element.SortedSet<ASPLiteral>getLiterals()Set<net.sf.tweety.logics.commons.syntax.Predicate>getPredicates()List<ASPBodyElement>getRight()Returns the right part of the Aggregate element.net.sf.tweety.logics.fol.syntax.FolSignaturegetSignature()Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>getTerms()<C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>
Set<C>getTerms(Class<C> cls)booleanisLiteral()AggregateElementsubstitute(Map<? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> map)AggregateElementsubstitute(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v)StringtoString()-
Methods inherited from class net.sf.tweety.lp.asp.syntax.ASPElement
containsTermsOfType, getPredicateCls, isGround, isWellFormed
-
-
-
-
Constructor Detail
-
AggregateElement
public AggregateElement(List<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> l, List<ASPBodyElement> r)
Creates a new Aggregate Element with the given list of terms and the given list of naf literals.- Parameters:
l- a list of termsr- a list of body elements
-
AggregateElement
public AggregateElement(AggregateElement other)
Copy-Constructor- Parameters:
other- another AggregateElement
-
-
Method Detail
-
isLiteral
public boolean isLiteral()
-
getTerms
public Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getTerms()
-
getTerms
public <C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> Set<C> getTerms(Class<C> cls)
-
getPredicates
public Set<net.sf.tweety.logics.commons.syntax.Predicate> getPredicates()
- Specified by:
getPredicatesin interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Specified by:
getPredicatesin classASPElement
-
getAtoms
public Set<ASPAtom> getAtoms()
- Specified by:
getAtomsin interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Specified by:
getAtomsin classASPElement
-
substitute
public AggregateElement substitute(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v)
- Specified by:
substitutein interfacenet.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula- Specified by:
substitutein classASPElement
-
getSignature
public net.sf.tweety.logics.fol.syntax.FolSignature getSignature()
- Specified by:
getSignaturein interfacenet.sf.tweety.commons.Formula- Specified by:
getSignaturein classASPElement
-
clone
public AggregateElement clone()
- Specified by:
clonein interfacenet.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula- Specified by:
clonein interfacenet.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula- Specified by:
clonein classASPElement
-
getLeft
public List<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getLeft()
Returns the left part of the Aggregate element.- Returns:
- list of terms
-
getRight
public List<ASPBodyElement> getRight()
Returns the right part of the Aggregate element.- Returns:
- list of naf literals (= literals or default negated literals)
-
substitute
public AggregateElement substitute(Map<? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> map) throws IllegalArgumentException
- Specified by:
substitutein interfacenet.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula- Overrides:
substitutein classASPElement- Throws:
IllegalArgumentException
-
exchange
public AggregateElement exchange(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t) throws IllegalArgumentException
- Specified by:
exchangein interfacenet.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula- Overrides:
exchangein classASPElement- Throws:
IllegalArgumentException
-
getLiterals
public SortedSet<ASPLiteral> getLiterals()
-
-