This is an old revision of the document!
====== Atom ====== ''**public class Atom**'' \\ ''**implements Serializable, Clonable, Comparable<Atom>**''\\ Class for the definition an Atom. Atom managing all the functions for atoms.\\ ===== Class Attributes ===== <code java> private long atomId private java.lang.String atomName private java.util.ArrayList<Term> terms </code> ===== Class Constructor ===== ==== Atom ==== <code java> public Atom (java.lang.String atomName, java.util.Arraylist<Term> terms) </code> Constructor for an atom with terms.\\ //Called by:// * it.unibz.inf.magik.web.SessionControl * it.unibz.inf.magik.core.QueryMinimizer * it.unibz.inf.magik.additional.InvolvedVariableDetector * it.unibz.inf.magik.core.ProgramGenerator * it.unibz.inf.magik.core.Preprocessor * it.unibz.inf.magik.test.TestAtomClass * it.unibz.inf.magik.test.TestTCQCReasonerBlackWhiteExample * it.unibz.inf.magik.test.TestTCQCReasonerPlainCompanyEx * it.unibz.inf.magik.test.TestTCQCReasonerPlainSchoolEx * it.unibz.inf.magik.test.TestTermClass **Parameters:** * atomName - name of the atom * terms - list of terms involved in the atom ---- ==== Atom ==== <code java> public Atom (java.lang.String atomDef) </code> Constructor for an atom starting from the string version of the atom.\\ //Called by:// * it.unibz.inf.magik.core.ProgramGenerator * it.unibz.inf.magik.test.TestAtomClass * it.unibz.inf.magik.test.UnificationTest **Parameters:** * atomDef - a string that contains a definition of an atom ===== Class Methods ===== ==== applySubstitution ==== <code java> public static Atom applySubstiution (Atom atom, java.util.HashMap<Term,Term> substitution) </code> Apply to an atom some substitutions.\\ **Parameters:** * atom - original atom * substitution - terms that has to be substitute **Returns:** * atom with substitutions ---- ==== freeze ==== <code java> static Atom freeze (Atom atom, java.util.ArrayList<Term> freezingVars, boolean semantics) </code> **Parameters:** * atom - original atom * freezingVars - terms that has to be freezed * semantics - **Returns:** * atom with some freezed terms ---- ==== freeze ==== <code java> static Atom freeze (Atom atom, java.util.ArrayList<Term> freezingVars) </code> **Parameters:** * atom - original atom * freezingVars - terms that has to be freezed **Returns:** * atom with some freezed terms ---- ==== groundAtom ==== <code java> static Atom groundAtom (Atom A) </code> Generate the ground version of an atom **Parameters:** * A - atom **Returns:** * grounded version of the atom A ---- ==== iterateAtom ==== <code java> public Atom iterateAtom (Atom atom, java.util.ArrayList<Term> distinguised, ILambda<Term,Term> changeDist, ILambda<Term,Term> changeOther) </code> **Parameters:** * atom - atom that we want to iterate * distinguised - * changeDist - * changeOther - **Returns:** * iterated atom ---- ==== parseAtom ==== <code java> public Atom parseAtom (java.lang.String atomDef) </code> Create the Atom type from a string version of it **Parameters:** * atomDef - string definition of an atom **Returns:** * atom converted in Atom type ---- ==== parseAtoms ==== <code java> public java.util.ArrayList<Atom> parseAtoms (java.util.ArrayList<java.lang.String> arrAtomStr) throws ContextException </code> Create a list of Atom from a list of string definition of atoms (defined has: ''relation:attr1,attr2'') **Parameters:** * arrAtomStr - list of string definition of atom **Returns:** * list of Atom **Throws:** * ContextException ---- ==== parseAtoms ==== <code java> public java.util.ArrayList<Atom> parseAtoms (java.util.ArrayList<java.lang.String> arrAtomStr) throws ContextException </code> Create a list of Atom from a list of string definition of atoms (defined has: ''relation:attr1,attr2'') **Parameters:** * arrAtomStr - list of string definition of atom **Returns:** * list of Atom **Throws:** * ContextException ---- ==== isVariable ==== <code java> public static boolean isVariable () </code> Check if the term is a variable.\\ **Returns:** * //true//, if the term is a variable, //false// otherwise ---- ==== isConstant ==== <code java> public static boolean isConstant () </code> Check if the term is a constant.\\ **Returns:** * //true//, if the term is a constant, //false// otherwise ----