Class FolAtom

  • All Implemented Interfaces:
    net.sf.tweety.commons.Formula, net.sf.tweety.logics.commons.syntax.interfaces.Atom, net.sf.tweety.logics.commons.syntax.interfaces.ClassicalFormula, net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula, net.sf.tweety.logics.commons.syntax.interfaces.Conjunctable, net.sf.tweety.logics.commons.syntax.interfaces.Disjunctable, net.sf.tweety.logics.commons.syntax.interfaces.Invertable, net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure, net.sf.tweety.logics.commons.syntax.interfaces.ProbabilityAware, net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula, net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula

    public class FolAtom
    extends FolFormula
    implements net.sf.tweety.logics.commons.syntax.interfaces.Atom
    An atom in first-order logic, i.e. a predicate and a list of argument terms.
    Author:
    Matthias Thimm
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface net.sf.tweety.logics.commons.syntax.interfaces.Atom

        net.sf.tweety.logics.commons.syntax.interfaces.Atom.AtomImpl, net.sf.tweety.logics.commons.syntax.interfaces.Atom.RETURN_SET_PREDICATE
    • Constructor Summary

      Constructors 
      Constructor Description
      FolAtom()
      Default-Ctor: Creates new empty FOL-Atom
      FolAtom​(net.sf.tweety.logics.commons.syntax.Predicate predicate)
      Creates a new atom with the given predicate and initializes an empty argument list.
      FolAtom​(net.sf.tweety.logics.commons.syntax.Predicate predicate, List<? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> arguments)
      Creates a new atom with the given predicate and list of terms
      FolAtom​(net.sf.tweety.logics.commons.syntax.Predicate predicate, net.sf.tweety.logics.commons.syntax.interfaces.Term<?>... terms)  
      FolAtom​(FolAtom other)  
    • Constructor Detail

      • FolAtom

        public FolAtom()
        Default-Ctor: Creates new empty FOL-Atom
      • FolAtom

        public FolAtom​(net.sf.tweety.logics.commons.syntax.Predicate predicate)
        Creates a new atom with the given predicate and initializes an empty argument list.
        Parameters:
        predicate - the predicate of the atom.
      • FolAtom

        public FolAtom​(net.sf.tweety.logics.commons.syntax.Predicate predicate,
                       net.sf.tweety.logics.commons.syntax.interfaces.Term<?>... terms)
      • FolAtom

        public FolAtom​(net.sf.tweety.logics.commons.syntax.Predicate predicate,
                       List<? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> arguments)
        Creates a new atom with the given predicate and list of terms
        Parameters:
        predicate - the predicate of the atom
        arguments - the arguments (terms) of the atom
      • FolAtom

        public FolAtom​(FolAtom other)
    • Method Detail

      • addArgument

        public void addArgument​(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> term)
                         throws IllegalArgumentException
        Appends the given argument to this atom's arguments and returns itself.
        Specified by:
        addArgument in interface net.sf.tweety.logics.commons.syntax.interfaces.Atom
        Parameters:
        term - an argument to be added
        Throws:
        IllegalArgumentException - if the given term does not correspond to the expected sort or the argument list is complete.
      • substitute

        public FolAtom substitute​(net.sf.tweety.logics.commons.syntax.interfaces.Term<?> v,
                                  net.sf.tweety.logics.commons.syntax.interfaces.Term<?> t)
                           throws IllegalArgumentException
        Specified by:
        substitute in interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula
        Specified by:
        substitute in class FolFormula
        Throws:
        IllegalArgumentException
      • getAtoms

        public Set<FolAtom> getAtoms()
        Specified by:
        getAtoms in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Specified by:
        getAtoms in class net.sf.tweety.logics.commons.syntax.RelationalFormula
      • isComplete

        public boolean isComplete()
        Checks whether this atom is complete, i.e. whether every argument is set.
        Specified by:
        isComplete in interface net.sf.tweety.logics.commons.syntax.interfaces.Atom
        Returns:
        "true" if the atom is complete.
      • getUnboundVariables

        public Set<net.sf.tweety.logics.commons.syntax.Variable> getUnboundVariables()
        Specified by:
        getUnboundVariables in interface net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
      • getPredicates

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

        public Set<net.sf.tweety.logics.commons.syntax.Functor> getFunctors()
        Specified by:
        getFunctors in class net.sf.tweety.logics.commons.syntax.RelationalFormula
      • isClosed

        public boolean isClosed()
        Specified by:
        isClosed in interface net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
      • isClosed

        public boolean isClosed​(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)
        Specified by:
        isClosed in interface net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
      • isWellBound

        public boolean isWellBound()
        Specified by:
        isWellBound in interface net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
      • isWellBound

        public boolean isWellBound​(Set<net.sf.tweety.logics.commons.syntax.Variable> boundVariables)
        Specified by:
        isWellBound in interface net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
      • containsQuantifier

        public boolean containsQuantifier()
        Specified by:
        containsQuantifier in interface net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
      • getPredicate

        public net.sf.tweety.logics.commons.syntax.Predicate getPredicate()
        Returns the predicate of this atom
        Specified by:
        getPredicate in interface net.sf.tweety.logics.commons.syntax.interfaces.Atom
        Returns:
        the predicate of this atom
      • getArguments

        public List<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getArguments()
        Specified by:
        getArguments in interface net.sf.tweety.logics.commons.syntax.interfaces.Atom
        Returns:
        the arguments of this atom.
      • isDnf

        public boolean isDnf()
        Description copied from class: FolFormula
        Checks whether this formula is in disjunctive normal form.
        Specified by:
        isDnf in class FolFormula
        Returns:
        "true" iff this formula is in disjunctive normal form.
      • isLiteral

        public boolean isLiteral()
        Specified by:
        isLiteral in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
      • toString

        public String toString()
        Specified by:
        toString in class net.sf.tweety.logics.commons.syntax.RelationalFormula
      • toNnf

        public FolFormula toNnf()
        Description copied from class: FolFormula
        Makes the negation normal form of this formula.
        Specified by:
        toNnf in class FolFormula
        Returns:
        the NNF of this formula
      • collapseAssociativeFormulas

        public FolFormula collapseAssociativeFormulas()
        Description copied from class: FolFormula
        This method collapses all associative operations appearing in this term, e.g. every a||(b||c) becomes a||b||c.
        Specified by:
        collapseAssociativeFormulas in class FolFormula
        Returns:
        the collapsed formula.
      • 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 obj)
        Specified by:
        equals in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Overrides:
        equals in class Object
      • getTerms

        public Set<net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> getTerms()
        Specified by:
        getTerms in interface net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure
      • getTerms

        public <C extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> Set<C> getTerms​(Class<C> cls)
        Specified by:
        getTerms in interface net.sf.tweety.logics.commons.syntax.interfaces.LogicStructure
      • clone

        public FolAtom 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 FolFormula
      • setPredicate

        public net.sf.tweety.logics.commons.syntax.interfaces.Atom.RETURN_SET_PREDICATE setPredicate​(net.sf.tweety.logics.commons.syntax.Predicate newer)
        Specified by:
        setPredicate in interface net.sf.tweety.logics.commons.syntax.interfaces.Atom
      • getName

        public String getName()
        Specified by:
        getName in interface net.sf.tweety.logics.commons.syntax.interfaces.Atom