Class LdoArgument

java.lang.Object
org.tweetyproject.arg.dung.ldo.syntax.LdoFormula
org.tweetyproject.arg.dung.ldo.syntax.LdoArgument
All Implemented Interfaces:
Comparable<LdoArgument>, Formula, Atom, ClassicalFormula, Conjunctable, Disjunctable, Invertable, ProbabilityAware, SimpleLogicalFormula

public class LdoArgument extends LdoFormula implements Atom, Comparable<LdoArgument>
This class represents an argument in ldo.
Author:
Matthias Thimm, Tim Janus
  • Constructor Details

    • LdoArgument

      public LdoArgument()
      Default-Ctor for dynamic instantiation
    • LdoArgument

      public LdoArgument(String name)
      Creates a new proposition of the given name.
      Parameters:
      name - the name of the proposition.
    • LdoArgument

      public LdoArgument(LdoArgument other)
      Parameters:
      other - other
  • Method Details

    • getArgument

      public Argument getArgument()
      Returns an argument representation (in Dung-style) of this LdoArgument.
      Returns:
      an argument representation (in Dung-style) of this LdoArgument.
    • getName

      public String getName()
      Specified by:
      getName in interface Atom
      Returns:
      the name of this proposition.
    • getPredicate

      public PlPredicate getPredicate()
      Specified by:
      getPredicate in interface Atom
      Returns:
      the predicate of the atom
    • getPredicates

      public Set<PlPredicate> getPredicates()
      Description copied from interface: SimpleLogicalFormula
      Processes the set of all predicates which appear in this formula
      Specified by:
      getPredicates in interface SimpleLogicalFormula
      Specified by:
      getPredicates in class LdoFormula
      Returns:
      all predicates that appear in this formula
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getSignature

      public DungSignature getSignature()
      Description copied from interface: Formula
      Returns the signature of the language of this formula.
      Specified by:
      getSignature in interface Formula
      Overrides:
      getSignature in class LdoFormula
      Returns:
      the signature of the language of this formula.
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface SimpleLogicalFormula
      Specified by:
      hashCode in class LdoFormula
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface SimpleLogicalFormula
      Specified by:
      equals in class LdoFormula
    • clone

      public LdoArgument clone()
      Description copied from interface: SimpleLogicalFormula
      Creates a deep copy of this formula
      Specified by:
      clone in interface SimpleLogicalFormula
      Specified by:
      clone in class LdoFormula
      Returns:
      the cloned formula
    • addArgument

      public void addArgument(Term<?> arg)
      Description copied from interface: Atom
      Adds an argument to the atom's argument list
      Specified by:
      addArgument in interface Atom
      Parameters:
      arg - The next argument
    • getArguments

      public List<? extends Term<?>> getArguments()
      Specified by:
      getArguments in interface Atom
      Returns:
      A list containing all the arguments of this specific atom
    • isComplete

      public boolean isComplete()
      Specified by:
      isComplete in interface Atom
      Returns:
      true if the size of the argument list is equal to the arity of the predicate
    • getAtoms

      public Set<LdoArgument> getAtoms()
      Description copied from interface: SimpleLogicalFormula
      Processes the set of all atoms which appear in this formula
      Specified by:
      getAtoms in interface SimpleLogicalFormula
      Specified by:
      getAtoms in class LdoFormula
      Returns:
      The set of all atoms
    • isLiteral

      public boolean isLiteral()
      Specified by:
      isLiteral in interface SimpleLogicalFormula
      Overrides:
      isLiteral in class LdoFormula
      Returns:
      true if the formula represents a literal in the language or false otherwise
    • getLiterals

      public Set<LdoFormula> getLiterals()
      Description copied from class: LdoFormula
      Returns all literals, i.e. all formulas of the form "a" or "!a" where "a" is a proposition, that appear in this formula.
      Specified by:
      getLiterals in class LdoFormula
      Returns:
      all literals appearing in this formula.
    • setPredicate

      public Atom.RETURN_SET_PREDICATE setPredicate(Predicate predicate)
      Description copied from interface: Atom
      Changes the predicate of the atom. Given an old Predicate po and a new predicate pn with their list of arguments types at(po) and at(pn) and the arguments of this Atom: arg(this) this method distinguishes between three cases: 1. The predicate only differ in the names, returning RSP_SUCCESS 2. The old predicates argument types is a sub-list of the new argument types then the method returns RSP_INCOMPLETE and the atoms isComplete() method returns false 3. The new predicates argument types is a sub-list of the old argument types then the method returns RSP_TRUNCATED and the arguments of this atom are truncated too and isComplete() returns true. 4. The old and new predicates' argument types differ then the list of arguments of the atom get cleared and isComplete() returns false.
      Specified by:
      setPredicate in interface Atom
      Parameters:
      predicate - some predicate
      Returns:
      Depends on the cases described above: 1. RSP_SUCCESS 2. RSP_INCOMPLETE 3. RSP_TRUNCATED 4. RSP_CLEARED
    • compareTo

      public int compareTo(LdoArgument o)
      Specified by:
      compareTo in interface Comparable<LdoArgument>