Beispiel #1
0
        public override Predicate exec( Prolog engine )
        {
            Term a1, a2, a3, a4, a5, a6, a7, a8, a9;
            Predicate p1, p2, p3, p4, p5;
            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();
            Predicate cont = engine.cont;

            if ( !s1.Unify(a4, engine.trail) ) return engine.fail();
            if ( !s1.Unify(a5, engine.trail) ) return engine.fail();
            a6 = engine.makeVariable();
            a8 = engine.makeVariable();
            a7 = new ListTerm(a8, engine.makeVariable());
            Term[] h3 = {a1, a2, a3};
            a9 = new StructureTerm(f2, h3);
            p1 = new Predicates.dollar_cut_1(a6, cont);
            p2 = new Predicates.Assert_1(a9, p1);
            p3 = new Predicates.Free_Line_3(a1, a2, a3, p2);
            p4 = new Predicates.dollar_dummyLogic__4_2(a3, a8, p3);
            p5 = new Predicates.Available_Indexs_1(a7, p4);
            return new Predicates.dollar_getLevel_1(a6, p5);
        }
Beispiel #2
0
        public override Predicate exec( Prolog engine )
        {
            Term a1, a2, a3, a4, a5, a6, a7;
            Predicate p1, p2, p3;
            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();
            Predicate cont = engine.cont;

            if ( !s1.Unify(a3, engine.trail) ) return engine.fail();
            if ( !s2.Unify(a4, engine.trail) ) return engine.fail();
            if ( !s2.Unify(a5, engine.trail) ) return engine.fail();
            a6 = engine.makeVariable();
            Term[] h4 = {a1, a2, s1};
            a7 = new StructureTerm(f3, h4);
            p1 = new Predicates.dollar_cut_1(a6, cont);
            p2 = new Predicates.Assert_1(a7, p1);
            p3 = new Predicates.Free_Line_3(a1, a2, s1, p2);
            return new Predicates.dollar_getLevel_1(a6, p3);
        }