Package net.sf.tweety.lp.asp.semantics
Class AnswerSet
- java.lang.Object
-
- net.sf.tweety.commons.AbstractInterpretation<B,S>
-
- net.sf.tweety.commons.InterpretationSet<ASPLiteral,Program,ASPRule>
-
- net.sf.tweety.lp.asp.semantics.AnswerSet
-
- All Implemented Interfaces:
Iterable<ASPLiteral>,Collection<ASPLiteral>,net.sf.tweety.commons.Interpretation<Program,ASPRule>
public class AnswerSet extends net.sf.tweety.commons.InterpretationSet<ASPLiteral,Program,ASPRule>
An answer set is a belief set which only contains literals and represents the deductive belief set of an extended logic program under the answer set semantic.- Author:
- Thomas Vengels, Tim Janus, Anna Gessler
-
-
Constructor Summary
Constructors Constructor Description AnswerSet()Creates a new empty AnswerSet.AnswerSet(Collection<ASPLiteral> lits, int level, int weight)Creates a new empty AnswerSet with the given level and weight.AnswerSet(AnswerSet other)Copy-Constructor
-
Method Summary
-
Methods inherited from class net.sf.tweety.commons.InterpretationSet
add, add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Constructor Detail
-
AnswerSet
public AnswerSet()
Creates a new empty AnswerSet.
-
AnswerSet
public AnswerSet(Collection<ASPLiteral> lits, int level, int weight)
Creates a new empty AnswerSet with the given level and weight.- Parameters:
lits- the literalslevel- the levelweight- the weight
-
AnswerSet
public AnswerSet(AnswerSet other)
Copy-Constructor- Parameters:
other- another answer set
-
-
Method Detail
-
getLiteralsWithName
public Set<ASPLiteral> getLiteralsWithName(String name)
Returns all literals of a given name in the AnswerSet.- Parameters:
name- the name of the literal- Returns:
- set of literals
-
toString
public String toString()
- Overrides:
toStringin classnet.sf.tweety.commons.InterpretationSet<ASPLiteral,Program,ASPRule>
-
satisfies
public boolean satisfies(Program beliefBase) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
satisfies
public boolean satisfies(ASPRule formula) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
-