Swi-cs-pl - A CSharp class library to connect .NET languages with SWI-Prolog
PlQuery Constructor (module, name, termV)
SwiPlCs interfaceSbsSW.SwiPlCsPlQueryPlQuery(String, String, PlTermV)
locating the predicate in the named module.
Declaration Syntax
C#Visual BasicVisual C++F#
public PlQuery(
	string module,
	string name,
	PlTermV termV
)
Public Sub New ( 
	module As String,
	name As String,
	termV As PlTermV
)
public:
PlQuery(
	String^ module, 
	String^ name, 
	PlTermV termV
)
new : 
        module : string * 
        name : string * 
        termV : PlTermV -> PlQuery
Parameters
module (String)
locating the predicate in the named module.
name (String)
the name of the predicate
termV (PlTermV)
the argument vector containing the parameters
Examples

This sample shows a query with a compound term as an argument.

 Copy imageCopy
public void PlCallQueryCompound_termv()
{
    string[] mm = { "aa1", "aa2", "aa3" };
    build_pred();   // create: test(comp(X,Y)) :- member(Z,[1,2,3]), atomic_list_concat([X,Z],Y).
    PlTerm var1 = PlTerm.PlVar();
    PlTerm comp = PlTerm.PlCompound("comp", new PlTerm("aa"), var1);
    using (PlQuery q = new PlQuery("test", new PlTermV(comp)))
    {
        int i = 0;
        foreach (PlTermV s in q.Solutions)
        {
            Assert.AreEqual(mm[i++].ToString(), var1.ToString());
            Assert.AreEqual(comp.ToString(), s[0].ToString());
        }
    }
}

Assembly: SwiPlCs (Module: SwiPlCs.dll) Version: 1.1.60601.0 (1.1.60601.0)