Пример #1
0
 //[TestMethod]
 public void StreamRead()
 {
     PlEngine.SetStreamReader(Sread);
     // NOTE: read/1 needs a dot ('.') at the end
     PlQuery.PlCall("assert( (test_read(A) :- read(A)) )");
     PlTerm t = PlQuery.PlCallQuery("test_read(A)");
     //     Assert.AreEqual(ref_string_read, t.ToString() + ".");
 }
Пример #2
0
        public static void SetupProlog2()
        {
            try
            {
#if USE_IKVM
                if (!JplDisabled)
                {
                    JPL.setNativeLibraryDir(SwiHomeDir + "/bin");
                    try
                    {
                        JPL.loadNativeLibrary();
                    }
                    catch (Exception e)
                    {
                        WriteException(e);
                        JplDisabled = true;
                    }
                    if (!JplDisabled)
                    {
                        SafelyRun(() => jpl.fli.Prolog.initialise());
                    }
                }
                SafelyRun(TestClassLoader);
#endif
                //if (IsPLWin) return;
                try
                {
                    if (!PlEngine.IsInitialized)
                    {
                        String[] param = { "-q" }; // suppressing informational and banner messages
                        PlEngine.Initialize(param);
                    }
                    if (IsPLWin)
                    {
                        return;
                    }
                    if (!PlEngine.IsStreamFunctionReadModified)
                    {
                        PlEngine.SetStreamReader(Sread);
                    }
                    PlQuery.PlCall("nl.");
                }
                catch (Exception e)
                {
                    WriteException(e);
                    PlCsDisabled = true;
                }
                //                PlAssert("jpl:jvm_ready");
                //                PlAssert("module_transparent(jvm_ready)");
            }
            catch (Exception exception)
            {
                WriteException(exception);
                return;
            }
        }