Exemple #1
0
 public static IEnumerable<bool> protect_call_result(object G, object R)
 {
     {
         Variable B = new Variable();
         YP.Catch catchGoal1 = new YP.Catch(new Functor2(Atom.a("call_result", Atom.a("")), G, R), getDeclaringClass());
         foreach (bool l2 in catchGoal1)
         {
             yield return false;
         }
         foreach (bool l2 in catchGoal1.unifyExceptionOrThrow(B))
         {
             foreach (bool l3 in extract_error(B, R))
             {
                 yield return false;
             }
         }
     }
 }
Exemple #2
0
 public static IEnumerable<bool> exists(object arg1)
 {
     {
         Variable P = new Variable();
         Variable I = new Variable();
         Variable List = new Variable();
         Variable G = new Variable();
         Variable x5 = new Variable();
         foreach (bool l2 in YP.unify(arg1, new Functor2("/", P, I)))
         {
             foreach (bool l3 in make_list(I, List))
             {
                 foreach (bool l4 in YP.univ(G, new ListPair(P, List)))
                 {
                     YP.set_prolog_flag(Atom.a("unknown"), Atom.a("fail"));
                     YP.Catch catchGoal1 = new YP.Catch(new Functor1("call", G), getDeclaringClass());
                     foreach (bool l5 in catchGoal1)
                     {
                         foreach (bool l6 in reset_flags())
                         {
                             yield return true;
                             yield break;
                         }
                     }
                     foreach (bool l5 in catchGoal1.unifyExceptionOrThrow(x5))
                     {
                         foreach (bool l6 in reset_flags())
                         {
                             yield return true;
                             yield break;
                         }
                     }
                 }
             }
         }
     }
     {
         Variable P = new Variable();
         Variable I = new Variable();
         foreach (bool l2 in YP.unify(arg1, new Functor2("/", P, I)))
         {
             YP.write(Atom.a("Predicate: "));
             YP.write(new Functor2("/", P, I));
             YP.write(Atom.a(" not implemented"));
             YP.nl();
             foreach (bool l3 in reset_flags())
             {
                 yield return false;
             }
         }
     }
 }