コード例 #1
0
        public override Predicate exec(Prolog engine)
        {
            engine.setB0();
            Term      a1, a2, a3, a4, a5;
            Predicate p1, p2, p3, p4, p5;

            a1 = arg1.Dereference();
            a2 = arg2.Dereference();
            a3 = arg3.Dereference();

            a4 = engine.makeVariable();
            a5 = engine.makeVariable();
            p1 = new Predicates.dollar_toInteger_2(a5, a3, cont);
            p2 = new Predicates.dollar_multi_3(a1, a4, a5, p1);
            p3 = new Predicates.dollar_floatQuotient_3(a2, s2, a4, p2);
            p4 = new Predicates.dollar_lessOrEqual_2(a2, s2, p3);
            p5 = new Predicates.dollar_greaterOrEqual_2(a2, s1, p4);
            return(new Predicates.dollar_greaterThan_2(a1, s1, p5));
        }
コード例 #2
0
        public override Predicate exec(Prolog engine)
        {
            engine.setB0();
            Term      a1, a2, a3, a4, a5, a6, a7;
            Predicate p1, p2, p3, p4, p5, p6, p7;

            a1 = arg1.Dereference();
            a2 = arg2.Dereference();
            a3 = arg3.Dereference();

            a4 = engine.makeVariable();
            a5 = engine.makeVariable();
            a6 = engine.makeVariable();
            a7 = engine.makeVariable();
            p1 = new Predicates.dollar_plus_3(a1, a7, a3, cont);
            p2 = new Predicates.dollar_toInteger_2(a6, a7, p1);
            p3 = new Predicates.dollar_multi_3(s1, a5, a6, p2);
            p4 = new Predicates.dollar_minus_3(a2, a1, a5, p3);
            p5 = new Predicates.dollar_cut_1(a4, p4);
            p6 = new Predicates.dollar_integer_1(a2, p5);
            p7 = new Predicates.dollar_integer_1(a1, p6);
            return(new Predicates.dollar_getLevel_1(a4, p7));
        }