Esempio n. 1
0
        public override Predicate exec(Prolog engine)
        {
            Term      a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15, a16;
            Predicate p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12;

            a1 = engine.aregs[1].Dereference();
            a2 = engine.aregs[2].Dereference();
            a3 = engine.aregs[3].Dereference();
            a4 = engine.aregs[4].Dereference();
            a5 = engine.aregs[5].Dereference();
            a6 = engine.aregs[6].Dereference();
            a7 = engine.aregs[7].Dereference();
            a8 = engine.aregs[8].Dereference();
            a9 = engine.aregs[9].Dereference();
            Predicate cont = engine.cont;

            a10 = engine.makeVariable();
            Term[] h2 = { a6 };
            a11 = new StructureTerm(f1, h2);
            Term[] h4 = { a7 };
            a12 = new StructureTerm(f3, h4);
            Term[] h6 = { a8 };
            a13 = new StructureTerm(f5, h6);
            Term[] h7 = { a4 };
            a14 = new StructureTerm(f5, h7);
            Term[] h8 = { a5 };
            a15 = new StructureTerm(f1, h8);
            Term[] h9 = { a5 };
            a16 = new StructureTerm(f5, h9);
            p1  = new Predicates.dollar_cut_1(a10, cont);
            p2  = new Predicates.CrearMuros_2(a9, a3, p1);
            p3  = new Predicates.dollar_multi_3(a1, a2, a9, p2);
            p4  = new Predicates.Assert_1(a16, p3);
            p5  = new Predicates.Assert_1(a15, p4);
            p6  = new Predicates.Assert_1(a14, p5);
            p7  = new Predicates.dollar_dummy__189511930__2_4(a1, a2, a4, a5, p6);
            p8  = new Predicates.CrearCaminoAux_4(a1, a2, a4, a5, p7);
            p9  = new Predicates.AgregarAdyacentes_2(a1, a2, p8);
            p10 = new Predicates.Retractall_1(a13, p9);
            p11 = new Predicates.Retractall_1(a12, p10);
            p12 = new Predicates.Retractall_1(a11, p11);
            return(new Predicates.dollar_getLevel_1(a10, p12));
        }
Esempio n. 2
0
        public override Predicate exec(Prolog engine)
        {
            Term      a1, a2, a3, a4, a5, a6, a7, a8, a9, a10;
            Predicate p1, p2, p3, p4;

            a1 = engine.aregs[1].Dereference();
            a2 = engine.aregs[2].Dereference();
            a3 = engine.aregs[3].Dereference();
            a4 = engine.aregs[4].Dereference();
            a5 = engine.aregs[5].Dereference();
            a6 = engine.aregs[6].Dereference();
            a7 = engine.aregs[7].Dereference();
            a8 = engine.aregs[8].Dereference();
            a9 = engine.aregs[9].Dereference();
            Predicate cont = engine.cont;

            a10 = engine.makeVariable();
            p1  = new Predicates.dollar_cut_1(a10, cont);
            p2  = new Predicates.dollar_is_2(a4, a9, p1);
            p3  = new Predicates.dollar_is_2(a3, a8, p2);
            p4  = new Predicates.CrearCaminoAux_4(a1, a2, a8, a9, p3);
            return(new Predicates.dollar_getLevel_1(a10, p4));
        }