Class AssociativeFolFormula

  • All Implemented Interfaces:
    Iterable<net.sf.tweety.logics.commons.syntax.RelationalFormula>, Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>, List<net.sf.tweety.logics.commons.syntax.RelationalFormula>, net.sf.tweety.commons.Formula, net.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport.AssociativeSupportBridge, net.sf.tweety.logics.commons.syntax.interfaces.AssociativeFormula<net.sf.tweety.logics.commons.syntax.RelationalFormula>, 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
    Direct Known Subclasses:
    Conjunction, Disjunction

    public abstract class AssociativeFolFormula
    extends FolFormula
    implements net.sf.tweety.logics.commons.syntax.interfaces.AssociativeFormula<net.sf.tweety.logics.commons.syntax.RelationalFormula>, net.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport.AssociativeSupportBridge
    This class captures the common functionalities first order associative formulas like conjunction, disjunction, etc.
    Author:
    Matthias Thimm, Tim Janus
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected net.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport<net.sf.tweety.logics.commons.syntax.RelationalFormula> support
      This helper class implements most of the common functionality of an associative formula, so the implementation can delegate the method calls to the support class.
    • Constructor Summary

      Constructors 
      Constructor Description
      AssociativeFolFormula()
      Creates a new (empty) associative formula.
      AssociativeFolFormula​(Collection<? extends net.sf.tweety.logics.commons.syntax.RelationalFormula> formulas)
      Creates a new associative formula with the given inner formulas.
      AssociativeFolFormula​(net.sf.tweety.logics.commons.syntax.RelationalFormula first, net.sf.tweety.logics.commons.syntax.RelationalFormula second)
      Creates a new associative formula with the two given formulae
    • Field Detail

      • support

        protected net.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport<net.sf.tweety.logics.commons.syntax.RelationalFormula> support
        This helper class implements most of the common functionality of an associative formula, so the implementation can delegate the method calls to the support class.
    • Constructor Detail

      • AssociativeFolFormula

        public AssociativeFolFormula()
        Creates a new (empty) associative formula.
      • AssociativeFolFormula

        public AssociativeFolFormula​(net.sf.tweety.logics.commons.syntax.RelationalFormula first,
                                     net.sf.tweety.logics.commons.syntax.RelationalFormula second)
        Creates a new associative formula with the two given formulae
        Parameters:
        first - a relational formula.
        second - a relational formula.
      • AssociativeFolFormula

        public AssociativeFolFormula​(Collection<? extends net.sf.tweety.logics.commons.syntax.RelationalFormula> formulas)
        Creates a new associative formula with the given inner formulas.
        Parameters:
        formulas - a collection of formulas.
    • Method Detail

      • createEmptySignature

        public net.sf.tweety.commons.Signature createEmptySignature()
        Specified by:
        createEmptySignature in interface net.sf.tweety.logics.commons.syntax.AssociativeFormulaSupport.AssociativeSupportBridge
      • getFunctors

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

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

        public Set<net.sf.tweety.logics.commons.syntax.Variable> getUnboundVariables()
        Specified by:
        getUnboundVariables in interface net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
      • 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
      • isLiteral

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

        public Set<net.sf.tweety.logics.commons.syntax.Variable> getQuantifierVariables()
        Specified by:
        getQuantifierVariables in interface net.sf.tweety.logics.commons.syntax.interfaces.QuantifiedFormula
        Overrides:
        getQuantifierVariables in class FolFormula
      • getFormulas

        public List<net.sf.tweety.logics.commons.syntax.RelationalFormula> getFormulas()
        Specified by:
        getFormulas in interface net.sf.tweety.logics.commons.syntax.interfaces.AssociativeFormula<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • getFormulas

        public <C extends net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula> Set<C> getFormulas​(Class<C> cls)
        Specified by:
        getFormulas in interface net.sf.tweety.logics.commons.syntax.interfaces.AssociativeFormula<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • 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
      • 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
      • getPredicates

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

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

        public AssociativeFolFormula substitute​(Map<? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>,​? extends net.sf.tweety.logics.commons.syntax.interfaces.Term<?>> termMap)
        Specified by:
        substitute in interface net.sf.tweety.logics.commons.syntax.interfaces.ComplexLogicalFormula
        Overrides:
        substitute in class net.sf.tweety.logics.commons.syntax.RelationalFormula
      • toString

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

        public int hashCode()
        Specified by:
        hashCode in interface Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        hashCode in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        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 Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        equals in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        equals in interface net.sf.tweety.logics.commons.syntax.interfaces.SimpleLogicalFormula
        Overrides:
        equals in class Object
      • add

        public boolean add​(net.sf.tweety.logics.commons.syntax.RelationalFormula e)
        Specified by:
        add in interface Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        add in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • addAll

        public boolean addAll​(Collection<? extends net.sf.tweety.logics.commons.syntax.RelationalFormula> c)
        Specified by:
        addAll in interface Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        addAll in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • clear

        public void clear()
        Specified by:
        clear in interface Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        clear in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • contains

        public boolean contains​(Object o)
        Specified by:
        contains in interface Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        contains in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • containsAll

        public boolean containsAll​(Collection<?> c)
        Specified by:
        containsAll in interface Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        containsAll in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        isEmpty in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • iterator

        public Iterator<net.sf.tweety.logics.commons.syntax.RelationalFormula> iterator()
        Specified by:
        iterator in interface Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        iterator in interface Iterable<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        iterator in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • remove

        public boolean remove​(Object o)
        Specified by:
        remove in interface Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        remove in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • removeAll

        public boolean removeAll​(Collection<?> c)
        Specified by:
        removeAll in interface Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        removeAll in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • retainAll

        public boolean retainAll​(Collection<?> c)
        Specified by:
        retainAll in interface Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        retainAll in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • size

        public int size()
        Specified by:
        size in interface Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        size in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • toArray

        public Object[] toArray()
        Specified by:
        toArray in interface Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        toArray in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • toArray

        public <T> T[] toArray​(T[] a)
        Specified by:
        toArray in interface Collection<net.sf.tweety.logics.commons.syntax.RelationalFormula>
        Specified by:
        toArray in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • add

        public void add​(int index,
                        net.sf.tweety.logics.commons.syntax.RelationalFormula element)
        Specified by:
        add in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • addAll

        public boolean addAll​(int index,
                              Collection<? extends net.sf.tweety.logics.commons.syntax.RelationalFormula> c)
        Specified by:
        addAll in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • get

        public net.sf.tweety.logics.commons.syntax.RelationalFormula get​(int index)
        Specified by:
        get in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • indexOf

        public int indexOf​(Object o)
        Specified by:
        indexOf in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • lastIndexOf

        public int lastIndexOf​(Object o)
        Specified by:
        lastIndexOf in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • listIterator

        public ListIterator<net.sf.tweety.logics.commons.syntax.RelationalFormula> listIterator()
        Specified by:
        listIterator in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • listIterator

        public ListIterator<net.sf.tweety.logics.commons.syntax.RelationalFormula> listIterator​(int index)
        Specified by:
        listIterator in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • remove

        public net.sf.tweety.logics.commons.syntax.RelationalFormula remove​(int index)
        Specified by:
        remove in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • set

        public net.sf.tweety.logics.commons.syntax.RelationalFormula set​(int index,
                                                                         net.sf.tweety.logics.commons.syntax.RelationalFormula element)
        Specified by:
        set in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>
      • subList

        public List<net.sf.tweety.logics.commons.syntax.RelationalFormula> subList​(int fromIndex,
                                                                                   int toIndex)
        Specified by:
        subList in interface List<net.sf.tweety.logics.commons.syntax.RelationalFormula>