Skip to content

c++ wrappers around the gprolog c API to improve type safety. WIP

Notifications You must be signed in to change notification settings

arranstewart/gprolog_wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();

About

c++ wrappers around the gprolog c API to improve type safety. WIP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published