edu.udo.cs.ie.cowbots.elpParser.dlp
Class DLPAtom

Package class diagram package DLPAtom
java.lang.Object
  extended by edu.udo.cs.ie.cowbots.logic.ELPAtom
      extended by edu.udo.cs.ie.cowbots.elpParser.dlp.DLPAtom
All Implemented Interfaces:
DLPLiteral, ELPLiteral

public class DLPAtom
extends ELPAtom
implements DLPLiteral

this class extends ELPAtom

See Also:
ELPAtom

Field Summary
private  Predicate predicate
           
private  DLPTermList tl
           
 
Constructor Summary
DLPAtom(DLPAtom other)
          default copy constructor
DLPAtom(Predicate p, DLPTermList ts)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int getArtiy()
           
 DLPAtom getAtom()
          returns the atom of this literal
 DLPLiteral getLiteral()
          returns a possibly nested literal, or the object itself if this literal is not (strict or default) negated.
 java.lang.String getPredicate()
          returns the predicate symbol of this atom
 java.lang.String getTerm(int i)
          returns a term at a given index
 int getTermArity()
          returns the arity of term
 java.lang.String[] getTerms()
           
 java.lang.String getType()
          returns the predicate symbol and the arity.
 boolean isArithmetic()
          deprecated, use isPredicate instead !
 boolean isAtom()
           
 boolean isDefaultNegated()
           
 boolean isStrictNegated()
           
 boolean LitIsAfact(boolean b)
          returns the atom of this literal
 void setTerms(DLPAtom other)
           
 java.lang.String toString()
          translates the atom into a human readable string.
 
Methods inherited from class edu.udo.cs.ie.cowbots.logic.ELPAtom
Aggregate, Aggregate, Equal, getArity, getTermAsInt, Gtr, GtrEq, hashCode, instantiate, Int, isPredicate, Less, LessEq, Mul, Plus, setTerm, setTerms, UnEq
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.udo.cs.ie.cowbots.logic.ELPLiteral
isPredicate
 

Field Detail

predicate

private Predicate predicate

tl

private DLPTermList tl
Constructor Detail

DLPAtom

public DLPAtom(Predicate p,
               DLPTermList ts)

DLPAtom

public DLPAtom(DLPAtom other)
default copy constructor

Method Detail

getPredicate

public java.lang.String getPredicate()
returns the predicate symbol of this atom

Overrides:
getPredicate in class ELPAtom
Returns:
predicate symbol String

getTermArity

public int getTermArity()
returns the arity of term

Returns:
arity Integer

getArtiy

public int getArtiy()

getTerm

public java.lang.String getTerm(int i)
returns a term at a given index

Overrides:
getTerm in class ELPAtom
Parameters:
i - term index i Integer
Returns:
term i Integer

setTerms

public void setTerms(DLPAtom other)

getTerms

public java.lang.String[] getTerms()
Overrides:
getTerms in class ELPAtom

getType

public java.lang.String getType()
returns the predicate symbol and the arity.

Overrides:
getType in class ELPAtom
Returns:
string composed of predicate name, followed by "/" and arity String

toString

public java.lang.String toString()
translates the atom into a human readable string. the output conforms datalog syntax

Overrides:
toString in class ELPAtom

isAtom

public boolean isAtom()
Specified by:
isAtom in interface ELPLiteral
Overrides:
isAtom in class ELPAtom
Returns:
true if this literal is an atom

isDefaultNegated

public boolean isDefaultNegated()
Specified by:
isDefaultNegated in interface ELPLiteral
Overrides:
isDefaultNegated in class ELPAtom
Returns:
true if this literal is default negated

isStrictNegated

public boolean isStrictNegated()
Specified by:
isStrictNegated in interface ELPLiteral
Overrides:
isStrictNegated in class ELPAtom
Returns:
true if this literal is strictly negated

getLiteral

public DLPLiteral getLiteral()
Description copied from interface: ELPLiteral
returns a possibly nested literal, or the object itself if this literal is not (strict or default) negated.

Specified by:
getLiteral in interface ELPLiteral
Overrides:
getLiteral in class ELPAtom
Returns:
nested literal

getAtom

public DLPAtom getAtom()
Description copied from interface: ELPLiteral
returns the atom of this literal

Specified by:
getAtom in interface ELPLiteral
Overrides:
getAtom in class ELPAtom
Returns:
atom

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class ELPAtom

isArithmetic

public boolean isArithmetic()
Description copied from interface: ELPLiteral
deprecated, use isPredicate instead !

Specified by:
isArithmetic in interface ELPLiteral
Overrides:
isArithmetic in class ELPAtom
Returns:
true if this objects models an arithmetic expression

LitIsAfact

public boolean LitIsAfact(boolean b)
Description copied from interface: DLPLiteral
returns the atom of this literal

Specified by:
LitIsAfact in interface DLPLiteral
Parameters:
b - if this literal is a fact or not Boolean *