Ejemplo n.º 1
0
        public void AssertLast()
        {
            ArrayList       p  = new ArrayList();
            HaltInstruction hi = new HaltInstruction();

            p.Add(hi);

            AMProgram program = new AMProgram();

            program.Initialize(p);

            program.AssertLast("male", 1, p);
            program.AssertLast("male", 1, p);


            ProgramClause male1 = program["male/1"];
            ProgramClause male2 = male1.NextPredicate;

            Assert.AreEqual(male1.Name, "male");
            Assert.AreEqual(male1.Arity, 1);
            Assert.AreEqual(male1.Instruction.Name(), "try_me_else");

            Assert.AreEqual(male2.Name, "male%1/1");
            Assert.AreEqual(male2.Arity, 1);
            Assert.AreEqual(male2.Instruction.Name(), "trust_me");
        }