Implementation of the Prolog engine in Obj-C projects

I am looking for a lightweight Prolog engine that will be built into an Obj-C application for Mac OSX.
Java has several excellent implementations with the required characteristics: deployment, lightness, dynamic configuration, integration with Java, and ease of interaction. Can you recommend something like this in C / C ++?


After several searches, I found YAProlog and read here , it seems that it can be used as a library for calling from other programs. But (stupid questions):

  • I am inexperienced with UNIX and I don’t know exactly how to create the libyap.a file with these YAP manual commands ...
  • Is it possible to copy libyap.a into an Xcode project and use it?
+3
source share
1 answer

GPrologsupports Mac OS X (Darwin) and the installer for Mac OS X Leopard is installed. And here you can read how to call gprolog from C (read also this ). Then, instead of using, gplcyou can use it gcc, provided that you add the correct parameters for the binding, which may be a bit of the “tricks” you can find; so you can create object files with gplcand then glue everything together ...

About YAP:

1) Usually a package with autoconf compiles simply with the following "sequence" of commands

./configure
make

make install , . dir ARCH (ARCH.?) (, ../configure ./configure).

configure script , . , , LIBDIR YAPLIBDIR.

, tarball (.tar.gz ), , , tar -xzf Yap-5.1.3.tar.gz, GNU/Linux, tar Mac OS X...

./configure --help , , , .

( ;))

mkdir ARCH.  # I would put GNUlinux, or maybe
             # the name must be exactly this?
cd ARCH.
../configure

... , . Makefile,

#
# where YAP should look for binary libraries
#
LIBDIR=$(EROOTDIR)/lib
YAPLIBDIR=$(EROOTDIR)/lib/Yap

Makefile libYap.a. , make ( , , , GNU/Linux ), libYap.a , "root" ()

make install

install target ( install_unix ) $(INSTALL_DATA) -m 755 libYap.a $(DESTDIR)$(LIBDIR), , .a , , lib ( , . )

2) , , , "", "" make install, , "" " lib.

+3

Source: https://habr.com/ru/post/1754585/


All Articles