public override Predicate exec( Prolog engine )
 {
     engine.aregs[1] = arg1;
     engine.aregs[2] = arg2;
     engine.cont = cont;
     return call( engine );
 }
Exemple #2
0
 public override Predicate exec( Prolog engine )
 {
     engine.SetEntryCode( EntryCodeType, this );
     engine.aregs[1] = arg1;
     engine.aregs[2] = arg2;
     engine.cont = cont;
     return call( engine );
 }
Exemple #3
0
        public override Predicate exec( Prolog engine )
        {
            engine.setB0();
            Term a1, a2;
            Predicate p1;
            a1 = arg1.Dereference();
            a2 = arg2.Dereference();

            p1 = new Predicates.Include_Position_1(a2, cont);
            return new Predicates.Include_Index_1(a1, p1);
        }
Exemple #4
0
        public override Predicate exec(Prolog engine)
        {
            engine.setB0();
            Term a1, a2;
            Predicate p1;
            a1 = arg1.Dereference();

            a2 = engine.makeVariable();
            p1 = new Predicates.Belong_2(a1, a2, cont);
            return new Predicates.Available_Indexs_1(a2, p1);
        }
Exemple #5
0
 public virtual Predicate call( Prolog engine )
 {
     engine.setB0();
     return engine.switch_on_term(
                            Team_1_var,
                            dollar_fail_0,
                            Team_1_var,
                            dollar_fail_0,
                            dollar_fail_0
                            );
 }
Exemple #6
0
        public override Predicate exec( Prolog engine )
        {
            engine.setB0();
            Term a1, a2, a3;
            Predicate p1;
            a1 = arg1.Dereference();

            Term[] h2 = {a1};
            a2 = new StructureTerm(f1, h2);
            a3 = engine.makeVariable();
            p1 = new Predicates.dollar_call_1(a3, cont);
            return new Predicates.Clause_2(a2, a3, p1);
        }
Exemple #7
0
        public override Predicate exec( Prolog engine )
        {
            engine.setB0();
            Term a1, a2;
            Predicate p1;

            Term[] h2 = {engine.makeVariable()};
            a1 = new StructureTerm(f1, h2);
            Term[] h4 = {engine.makeVariable()};
            a2 = new StructureTerm(f3, h4);
            p1 = new Predicates.Retractall_1(a2, cont);
            return new Predicates.Retractall_1(a1, p1);
        }
Exemple #8
0
 PrologMachine Execute(Prolog.Program program, Query query)
 {
     try
     {
         var machine = PrologMachine.Create(program, query);
         machine.ExecutionComplete += CodeExecuted;
         var result = machine.RunToSuccess();
         Console.WriteLine(Enum.GetName(typeof(ExecutionResults), result));
         return machine;
     }
     catch (Exception ex)
     {
         Console.WriteLine("Error, got exception: {0}", ex.Message);
         return null;
     }
 }
Exemple #9
0
        public override Predicate exec( Prolog engine )
        {
            engine.setB0();
            Term a1, a2, a3, a4, a5;
            Predicate p1, p2, p3;
            a1 = arg1.Dereference();

            a2 = engine.makeVariable();
            a3 = engine.makeVariable();
            a4 = engine.makeVariable();
            a5 = engine.makeVariable();
            p1 = new Predicates.dollar_minus_3(a5, s1, a1, cont);
            p2 = new Predicates.dollar_plus_3(a3, a4, a5, p1);
            p3 = new Predicates.dollar_multi_3(s1, a2, a4, p2);
            return new Predicates.Square_2(a2, a3, p3);
        }
Exemple #10
0
        public override Predicate exec( Prolog engine )
        {
            engine.setB0();
            Term a1, a2, a3, a4;
            Predicate p1, p2, p3, p4, p5, p6;
            a1 = arg1.Dereference();
            a2 = arg2.Dereference();

            a3 = engine.makeVariable();
            a4 = engine.makeVariable();
            p1 = new Predicates.Line_3(a4, a1, s2, cont);
            p2 = new Predicates.dollar_plus_3(a2, s2, a4, p1);
            p3 = new Predicates.Line_3(a2, a1, s2, p2);
            p4 = new Predicates.Line_3(a3, a2, s1, p3);
            p5 = new Predicates.dollar_plus_3(a1, s2, a3, p4);
            p6 = new Predicates.Line_3(a1, a2, s1, p5);
            return new Predicates.Include_Ind_Pos_2(a1, a2, p6);
        }
 public void CreateFact(string functor, Prolog.PrologEngine.BaseTerm[] args)
 {
 }
 public void SetStringStyle(Prolog.PrologEngine.BaseTerm t)
 {
 }
 public virtual Predicate call( Prolog engine )
 {
     engine.setB0();
     return engine.jtry(dollar_dummyLogic__4_2_1, dollar_dummyLogic__4_2_sub_1);
 }
        public override Predicate exec( Prolog engine )
        {
            Term a1, a2, a3, a4;
            Predicate p1, p2, p3;
            a1 = engine.aregs[1].Dereference();
            a2 = engine.aregs[2].Dereference();
            Predicate cont = engine.cont;

            if ( !s1.Unify(a1, engine.trail) ) return engine.fail();
            a3 = engine.makeVariable();
            a4 = engine.makeVariable();
            p1 = new Predicates.dollar_cut_1(a3, cont);
            p2 = new Predicates.dollar_arithEqual_2(a4, s3, p1);
            p3 = new Predicates.dollar_remainder_3(a2, s2, a4, p2);
            return new Predicates.dollar_getLevel_1(a3, p3);
        }
Exemple #15
0
 public virtual Predicate call( Prolog engine )
 {
     engine.setB0();
     return engine.jtry(Check_Next_Free_3_1, Check_Next_Free_3_sub_1);
 }
        public override Predicate exec( Prolog engine )
        {
            Term a1, a2;
            a1 = engine.aregs[1].Dereference();
            a2 = engine.aregs[2].Dereference();
            Predicate cont = engine.cont;

            if ( !s1.Unify(a1, engine.trail) ) return engine.fail();
            return cont;
        }
 public override Predicate exec(Prolog engine)
 {
     return(engine.trust(ObtenerArregloTrofeoAux_2_2));
 }
Exemple #18
0
 public override Predicate exec(Prolog engine)
 {
     return(engine.trust(dollar_dummy__189511930__24_1_2));
 }
Exemple #19
0
 public override Predicate exec(Prolog engine)
 {
     return(engine.trust(Concatenar_Valor_3_2));
 }
 public virtual Predicate call(Prolog engine)
 {
     engine.setB0();
     return(engine.jtry(ObtenerArregloTrofeoAux_2_1, ObtenerArregloTrofeoAux_2_sub_1));
 }
Exemple #21
0
 public override Predicate exec(Prolog engine)
 {
     return(engine.jtry(Concatenar_Valor_3_1, Concatenar_Valor_3_var_1));
 }
Exemple #22
0
 public override Predicate exec(Prolog engine)
 {
     engine.aregs[1] = arg1;
     engine.cont     = cont;
     return(call(engine));
 }
Exemple #23
0
 public override Predicate exec(Prolog engine)
 {
     return(engine.cont);
 }
 public PrologEngine(Prolog.BasicIo io)
 {
 }
 public override Predicate exec(Prolog engine)
 {
     return(engine.trust(Verificar_Adyacencias_2_2));
 }
 public override Predicate exec(Prolog engine)
 {
     return(engine.jtry(Concatenar_Arreglos_3_1, Concatenar_Arreglos_3_con_1));
 }
Exemple #27
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);
        }
Exemple #28
0
 public override Predicate exec( Prolog engine )
 {
     return engine.trust(Check_Next_Free_3_2);
 }
Exemple #29
0
 public override Predicate exec( Prolog engine )
 {
     return engine.retry(GoSmart_5_5, GoSmart_5_sub_5);
 }
Exemple #30
0
        public override Predicate exec( Prolog engine )
        {
            Term a1, a2, a3, a4, a5;
            Predicate p1, p2, p3, p4;
            a1 = engine.aregs[1].Dereference();
            a2 = engine.aregs[2].Dereference();
            a3 = engine.aregs[3].Dereference();
            Predicate cont = engine.cont;

            a4 = engine.makeVariable();
            Term[] h2 = {a1, a2, a3};
            a5 = new StructureTerm(f1, h2);
            p1 = new Predicates.dollar_fail_0(cont);
            p2 = new Predicates.dollar_cut_1(a4, p1);
            p3 = new Predicates.Retract_1(a5, p2);
            p4 = new Predicates.Free_Close_Line_4(engine.makeVariable(), engine.makeVariable(), engine.makeVariable(), engine.makeVariable(), p3);
            return new Predicates.dollar_getLevel_1(a4, p4);
        }
Exemple #31
0
 public override Predicate exec( Prolog engine )
 {
     return engine.trust(GoSmart_5_6);
 }
 public override Predicate exec( Prolog engine )
 {
     return engine.trust(dollar_dummyLogic__4_2_2);
 }
 public override Predicate exec(Prolog engine)
 {
     return(engine.trust(Concatenar_Arreglos_3_3));
 }
 public override Predicate exec(Prolog engine)
 {
     return(engine.retry(Concatenar_Arreglos_3_2, Concatenar_Arreglos_3_var_2));
 }
 public override Predicate exec( Prolog engine )
 {
     return engine.cont;
 }
        public override Predicate exec(Prolog engine)
        {
            Term a1, a2, a3, a4, a5, a6, a7, a8, a9;

            a1 = engine.aregs[1].Dereference();
            a2 = engine.aregs[2].Dereference();
            a3 = engine.aregs[3].Dereference();
            Predicate cont = engine.cont;

            if (a1.IsList())
            {
                a4 = ((ListTerm)a1).car;
                a5 = ((ListTerm)a1).cdr;
            }
            else if (a1.IsVariable())
            {
                a4 = engine.makeVariable();
                a5 = engine.makeVariable();
                if (!a1.Unify(new ListTerm(a4, a5), engine.trail))
                {
                    return(engine.fail());
                }
            }
            else
            {
                return(engine.fail());
            }
            if (a2.IsList())
            {
                a6 = ((ListTerm)a2).car;
                a7 = ((ListTerm)a2).cdr;
            }
            else if (a2.IsVariable())
            {
                a6 = engine.makeVariable();
                a7 = engine.makeVariable();
                if (!a2.Unify(new ListTerm(a6, a7), engine.trail))
                {
                    return(engine.fail());
                }
            }
            else
            {
                return(engine.fail());
            }
            if (a3.IsList())
            {
                if (!a4.Unify(((ListTerm)a3).car, engine.trail))
                {
                    return(engine.fail());
                }
                a8 = ((ListTerm)a3).cdr;
            }
            else if (a3.IsVariable())
            {
                a8 = engine.makeVariable();
                if (!a3.Unify(new ListTerm(a4, a8), engine.trail))
                {
                    return(engine.fail());
                }
            }
            else
            {
                return(engine.fail());
            }
            a9 = new ListTerm(a6, a7);
            engine.aregs[1] = a5;
            engine.aregs[2] = a9;
            engine.aregs[3] = a8;
            engine.cont     = cont;
            return(engine.GetEntryCode(EntryCodeType).call(engine));
        }
        public override Predicate exec( Prolog engine )
        {
            Term a1, a2, a3, a4, a5;
            Predicate p1, p2, p3;
            a1 = engine.aregs[1].Dereference();
            a2 = engine.aregs[2].Dereference();
            a3 = engine.aregs[3].Dereference();
            a4 = engine.aregs[4].Dereference();
            Predicate cont = engine.cont;

            a5 = engine.makeVariable();
            p1 = new Predicates.dollar_fail_0(cont);
            p2 = new Predicates.dollar_cut_1(a5, p1);
            p3 = new Predicates.Free_Close_Line_4(a1, a2, a3, a4, p2);
            return new Predicates.dollar_getLevel_1(a5, p3);
        }
 public void ReportSingletons(Prolog.PrologEngine.ClauseNode c, int lineNo, ref bool firstReport)
 {
 }
 public override Predicate exec(Prolog engine)
 {
     return(engine.jtry(Verificar_Adyacencias_2_1, Verificar_Adyacencias_2_var_1));
 }
 public void SetVariable(Prolog.PrologEngine.BaseTerm t, string s)
 {
 }
Exemple #41
0
 public override Predicate exec(Prolog engine)
 {
     return(engine.retry(dollar_dummy__189511930__4_3_3, dollar_dummy__189511930__4_3_sub_3));
 }
Exemple #42
0
 public Document(Prolog prolog)
 {
     this.Prolog = prolog;
 }
Exemple #43
0
        public override Predicate exec( Prolog engine )
        {
            Term a1, a2, a3;
            a1 = engine.aregs[1].Dereference();
            a2 = engine.aregs[2].Dereference();
            a3 = engine.aregs[3].Dereference();
            Predicate cont = engine.cont;

            return new Predicates.dollar_dummyLogic__0_4(engine.makeVariable(), engine.makeVariable(), engine.makeVariable(), engine.makeVariable(), cont);
        }
Exemple #44
0
 public virtual Predicate call( Prolog engine )
 {
     engine.setB0();
     return engine.jtry(GoSmart_5_1, GoSmart_5_sub_1);
 }
Exemple #45
0
 public virtual Predicate call(Prolog engine)
 {
     engine.setB0();
     return(engine.jtry(dollar_dummy__189511930__24_1_1, dollar_dummy__189511930__24_1_sub_1));
 }