public class Atom
implements Serializable, Clonable, Comparable<Atom>
Class for the definition an Atom. Atom managing all the functions for atoms.
private long atomId private java.lang.String atomName private java.util.ArrayList<Term> terms
public Atom (java.lang.String atomName, java.util.Arraylist<Term> terms)
Constructor for an atom with terms.
Called by:
Parameters:
public Atom (java.lang.String atomDef)
Constructor for an atom starting from the string version of the atom.
Called by:
Parameters:
public static Atom applySubstiution (Atom atom, java.util.HashMap<Term,Term> substitution)
Apply to an atom some substitutions.
Parameters:
Returns:
static Atom freeze (Atom atom, java.util.ArrayList<Term> freezingVars, boolean semantics)
Parameters:
Returns:
static Atom freeze (Atom atom, java.util.ArrayList<Term> freezingVars)
Parameters:
Returns:
static Atom groundAtom (Atom A)
Generate the ground version of an atom
Parameters:
Returns:
public Atom iterateAtom (Atom atom, java.util.ArrayList<Term> distinguised, ILambda<Term,Term> changeDist, ILambda<Term,Term> changeOther)
Parameters:
Returns:
public Atom parseAtom (java.lang.String atomDef)
Create the Atom type from a string version of it
Parameters:
Returns:
public static java.util.ArrayList<Atom> parseAtoms (java.util.ArrayList<java.lang.String> arrAtomStr) throws ContextException
Create a list of Atom from a list of string definition of atoms (defined has: relation:attr1,attr2
)
Parameters:
Returns:
Throws:
public static java.util.ArrayList<Atom> parseAtoms (java.lang.String Atoms) throws ContextException
Parses the string contains list of atoms separated by comma (e.g.: classes(Level,Code,'humanities'), pupil(Name,Level,Code)
) and create the respective Atom class
Parameters:
Returns:
Throws:
public int getArity ()
Calculate the arity of the atom
Returns:
public java.util.ArrayList<Term> getConstants()
Gives all constants that occur in the atom
Returns:
public java.util.ArrayList<Term> getVariables()
Gives all variables that occur in the atom
Returns:
public static boolean isContainingTerm (Term term)
Check if the Atom contains a term.
Parameters:
Returns:
public void replaceTerm(java.lang.String oldTerm, java.lang.String newTerm)
Replace term with a new string (if old string is found in the atom).
Parameters:
@Override public boolean equals (Object o)
Implementation for checking the equality for Atom
Returns:
@Override public String toString ()
Implementation for converting in String format Atom.
Returns:
public long getAtomId() public void setAtomId(long atomId) public java.lang.String getAtomName() public void setAtomName(java.lang.StringString atomName) public java.util.StringArrayList<Term> getTerms() public void setTerms(java.util.ArrayList<Term> terms)