Axiom.Runtime.AMProgram.IsDefined C# (CSharp) Method

IsDefined() public method

public IsDefined ( string label ) : bool
label string
return bool
        public bool IsDefined(string label)
        {
            return _labels.ContainsKey(label);
        }

Usage Example

        /// <summary>
        /// Call a predicate that takes no arguments
        /// </summary>
        /// <param name="predicateName">predicate name only.</param>
        /// <returns>success or failure</returns>
        public bool Call(string predicateName)
        {
            AMProgram program = (AMProgram)_program;

            AMInstructionSet iset = new AMInstructionSet();

            if (!program.IsDefined(predicateName + "/0"))
            {
                return(false);
            }

            // Add the call instruction
            program.P = new ProgramNode(iset.CreateInstruction("call", predicateName, "0"));

            program.AddProgramNode(program.P);

            // Add the halt insturction
            program.AddInstruction(iset.CreateInstruction("halt"));

            // Execute the program
            Transition();

            return(!_fail);
        }
All Usage Examples Of Axiom.Runtime.AMProgram::IsDefined