-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME
37 lines (27 loc) · 777 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
c++ wrapper around the c API for gprolog.
Build and run example with:
> make example
> ./example
Example use of wrapper API:
query q1;
q1.add(
call { []() -> void {
const auto nil_at = mk_atom( nil {} );
cout << "try write nil" << endl;
int res = oneSoln {"write",{ mk_term(nil_at)}} (true);
}}
).add(
call { []() -> void {
int res;
const auto nil_at = mk_atom( nil {} );
oneSoln mycall("length", {
mk_term(nil_at), mk_term(variable{})
});
res = mycall(true);
oneSoln writeArg("write", { mycall.arg(1) } );
res = writeArg(true);
}}
);
program p {};
p.add(q1);
p();