Package net.sf.tweety.lp.asp.syntax
Class StrictNegation
- java.lang.Object
-
- net.sf.tweety.lp.asp.syntax.ASPElement
-
- net.sf.tweety.lp.asp.syntax.ASPBodyElement
-
- net.sf.tweety.lp.asp.syntax.ASPLiteral
-
- net.sf.tweety.lp.asp.syntax.StrictNegation
-
- All Implemented Interfaces:
Comparable<ASPLiteral>,net.sf.tweety.commons.Formula,net.sf.tweety.logics.commons.syntax.interfaces.Atom,net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula,net.sf.tweety.logics.commons.syntax.interfaces.Invertable,net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure,net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
public class StrictNegation extends ASPLiteral
This class models the strict negation of an atom (as apposed to a NAF negation:DefaultNegation).- Author:
- Tim Janus, Thomas Vengels, Anna Gessler
-
-
Constructor Summary
Constructors Constructor Description StrictNegation(String name)Creates a new negation with the given name.StrictNegation(net.sf.tweety.logics.commons.syntax.Predicate p, List<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> terms)Creates a new negation with the given predicate and terms.StrictNegation(ASPAtom atom)Creates a new negation with the given atom.StrictNegation(StrictNegation other)Copy-Constructor
-
Method Summary
Modifier and Type Method Description voidaddArgument(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> arg)StrictNegationclone()ASPLiteralcloneWithAddedTerm(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> term)Creates a copy of the literal and adds the given term as argument to the end of the argument list.intcompareTo(ASPLiteral o)ASPLiteralcomplement()booleanequals(Object o)List<? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>>getArguments()ASPAtomgetAtom()Set<ASPAtom>getAtoms()SortedSet<ASPLiteral>getLiterals()Returns all literals in this element in form of a SortedSet.StringgetName()net.sf.tweety.logics.commons.syntax.PredicategetPredicate()Set<net.sf.tweety.logics.commons.syntax.Predicate>getPredicates()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)inthashCode()booleanisComplete()net.sf.tweety.logics.commons.syntax.interfaces.Atom.RETURN_SET_PREDICATEsetPredicate(net.sf.tweety.logics.commons.syntax.Predicate predicate)StrictNegationsubstitute(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)StringtoString()-
Methods inherited from class net.sf.tweety.lp.asp.syntax.ASPLiteral
isLiteral
-
Methods inherited from class net.sf.tweety.lp.asp.syntax.ASPElement
containsTermsOfType, exchange, getPredicateCls, isGround, isWellFormed, substitute
-
-
-
-
Constructor Detail
-
StrictNegation
public StrictNegation(ASPAtom atom)
Creates a new negation with the given atom.- Parameters:
atom- an ASP atom
-
StrictNegation
public StrictNegation(net.sf.tweety.logics.commons.syntax.Predicate p, List<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> terms)Creates a new negation with the given predicate and terms.- Parameters:
p- predicate of the negated atomterms- terms of the negated atom
-
StrictNegation
public StrictNegation(StrictNegation other)
Copy-Constructor- Parameters:
other- another StrictNegation
-
StrictNegation
public StrictNegation(String name)
Creates a new negation with the given name.- Parameters:
name- of the negated atom's predicate
-
-
Method Detail
-
getLiterals
public SortedSet<ASPLiteral> getLiterals()
Description copied from class:ASPBodyElementReturns all literals in this element in form of a SortedSet. Literals are atoms or strict negations of atoms.- Specified by:
getLiteralsin classASPBodyElement- Returns:
- all the literals used in the rule element
-
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
-
getSignature
public net.sf.tweety.logics.fol.syntax.FolSignature getSignature()
- Specified by:
getSignaturein interfacenet.sf.tweety.commons.Formula- Specified by:
getSignaturein classASPElement
-
clone
public StrictNegation 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
-
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)
-
getName
public String getName()
-
getPredicate
public net.sf.tweety.logics.commons.syntax.Predicate getPredicate()
-
setPredicate
public net.sf.tweety.logics.commons.syntax.interfaces.Atom.RETURN_SET_PREDICATE setPredicate(net.sf.tweety.logics.commons.syntax.Predicate predicate)
-
addArgument
public void addArgument(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> arg) throws net.sf.tweety.logics.commons.error.LanguageException- Throws:
net.sf.tweety.logics.commons.error.LanguageException
-
getArguments
public List<? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getArguments()
-
isComplete
public boolean isComplete()
-
compareTo
public int compareTo(ASPLiteral o)
-
cloneWithAddedTerm
public ASPLiteral cloneWithAddedTerm(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> term)
Description copied from class:ASPLiteralCreates a copy of the literal and adds the given term as argument to the end of the argument list.- Specified by:
cloneWithAddedTermin classASPLiteral- Parameters:
term- the new argument.- Returns:
- A copy of the literal containing the given term as new argument.
-
getAtom
public ASPAtom getAtom()
- Specified by:
getAtomin classASPLiteral- Returns:
- The atom representing the literal.
-
complement
public ASPLiteral complement()
- Specified by:
complementin interfacenet.sf.tweety.logics.commons.syntax.interfaces.Invertable- Specified by:
complementin classASPLiteral
-
substitute
public StrictNegation substitute(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v, net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t) throws IllegalArgumentException
- Specified by:
substitutein interfacenet.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula- Specified by:
substitutein classASPBodyElement- Throws:
IllegalArgumentException
-
hashCode
public int hashCode()
-
-