Class 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 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 atom
        terms - 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: ASPBodyElement
        Returns all literals in this element in form of a SortedSet. Literals are atoms or strict negations of atoms.
        Specified by:
        getLiterals in class ASPBodyElement
        Returns:
        all the literals used in the rule element
      • getPredicates

        public Set<net.sf.tweety.logics.commons.syntax.Predicate> getPredicates()
        Specified by:
        getPredicates in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Specified by:
        getPredicates in class ASPElement
      • getAtoms

        public Set<ASPAtom> getAtoms()
        Specified by:
        getAtoms in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Specified by:
        getAtoms in class ASPElement
      • getSignature

        public net.sf.tweety.logics.fol.syntax.FolSignature getSignature()
        Specified by:
        getSignature in interface net.sf.tweety.commons.Formula
        Specified by:
        getSignature in class ASPElement
      • clone

        public StrictNegation clone()
        Specified by:
        clone in interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula
        Specified by:
        clone in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Specified by:
        clone in class ASPElement
      • 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: ASPLiteral
        Creates a copy of the literal and adds the given term as argument to the end of the argument list.
        Specified by:
        cloneWithAddedTerm in class ASPLiteral
        Parameters:
        term - the new argument.
        Returns:
        A copy of the literal containing the given term as new argument.
      • getAtom

        public ASPAtom getAtom()
        Specified by:
        getAtom in class ASPLiteral
        Returns:
        The atom representing the literal.
      • complement

        public ASPLiteral complement()
        Specified by:
        complement in interface net.sf.tweety.logics.commons.syntax.interfaces.Invertable
        Specified by:
        complement in class ASPLiteral
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object o)
        Specified by:
        equals in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Overrides:
        equals in class Object