TAP (Thick Ada-Prolog bindings) Version 0.2 Alexander Kopilovitch aek@acm.org, aek@vib.usr.pu.ru ******************************************************************************** * This is the readme.1st for the TAP (Thick Ada-Prolog bindings) distribution * ******************************************************************************** The TAP bindings provide an opportunity to use Prolog in conjunction with Ada. Specificaly, the TAP bindings wrap the Amzi Logic Server API into Ada95 packages, making possible to use Prolog queries in Ada programs, and to use Ada subroutines as the external predicates for a Prolog program. These TAP bindings are "thick" in that sense that they aren't an immediate translation between the Ada subroutine calls and Logic Server API, but provide an additional layer, which exposes more conventional view on the Prolog workings. This version of the TAP bindings is 0.2, and it assumes GNAT compiler (version 3.13p or 3.14p) for Ada side, and Amzi Logic Server (version 6.2, from the build 6.2.10) for Prolog side. Here is the list of files included in this version of the TAP distribution. 0. (root) readme.1st -- this file build-all.bat -- builds all binary files for the bindinds as well as ready-to-run samples and tests from the sources clean.bat -- cleans the distribution after build - deletes all diles that were possibly built by build-all.bat or produced by run-all.bat run-all.but -- runs all samples and tests (after build-all) relnotes -- Release Notes copyright -- Copyright Notice lesser.txt -- GNU Lesser General Public License tap.html -- text similar to the above, but in HTML form, and with references to some particular files in the distribution instead of full list you are reading now 1. Documentation Directory: Documentation manual.html -- TAP Manual, that is, combined Reference and User Guide tutorial.html -- TAP Tutorial generators.html -- this text describes the implementation of generators in TAP 2. Bindings themselves - the specs and link/run-time components 2.1. Ada specs for the bindings: Directory: Specs 2.1.1. Principal specs: Prolog.ads -- provides core functionality, always needed Prolog-Library.ads -- needed for Logical Server Extentions 2.1.2. Additional specs: Prolog-Lists.ads -- facilitates usage of the Prolog lists Prolog-Unification.ads -- permits direct use of the Unify function Prolog-Synonyms.ads -- provides Prolog-style renamings 2.1.3. Generic package body Prolog-Library.adb -- initialization of a Logical Server Extention 2.2. Link-time and run-time components: Directory: Bin AdaLSX.def -- definition file for building a Logic Server Extension arun.exe -- starter for Prolog main program; it may be built from -- the source (in Sources\Run), but included here in the -- executable form also, for those who do not have MSVC -- compiler installed Directory: Lib empty directory (for *.o and *.ali files, which should be built from the sources using either command file build-all.bat from the root directory or command file build.bat from Sources\Ada directory) 3. Sources Directory: Sources\Ada 3.1. Specs for the private child packages: Prolog-Logic_Server.ads -- thin bindings for Logic Server Prolog-Checkout.ads -- return code analysis 3.2. TAP package bodies: Prolog.adb -- core functionality Prolog-Checkout.adb -- return code analysis Prolog-Lists.ads -- for the Prolog lists facilities Prolog-Unification.adb -- for general unification facility Strings_Relaxed.adb -- facilitates dealings with a mixture of Fixed and -- Unbounded Strings 3.3. Build command file for the TAP library build.bat -- builds *.o and *.ali Directory: Sources\ImportAmziDLL 3.4. Import library build stuff: amzi.def -- definition file for libamzi.a build.bat -- builds libamzi.a 3.5. Starter for a Prolog main program: Directory: Sources\Run taprun.cpp -- addition to arun.cpp from Amzi Logic Server distribution (#includes the latter) build.bat -- builds arun.exe in ..\..\Bin 4. Sample code (for the Tutorial) Directory: Samples Dinner_Services.ads -- sample predicate library spec Dinner_Services.adb -- sample predicate library body Dinner_Supply.ads -- part of the sample predicate library Dinner.pro -- sample Prolog program Dinner.cfg -- sample configuration file example.adb -- sample Ada program example.pro -- sample Prolog program build.bat -- builds example1.adb, example2.adb, example1.exe, example2.exe, Dinner.dll, Dinner.plm, Dinner.xpl runXPL.bat -- runs Dinner.xpl sample program a_dinner.adb -- sample Ada program a_build.bat -- builds a_dinner.exe p_dinner.pro -- sample Prolog program p_build.bat -- builds p_dinner.xpl p_run.bat -- runs p_dinner.xpl 5. Several tests, that may be also used as samples Directory: Tests 5.1. Test for simple backtracking (generators) Directory: Tests\Test-Backtracking Test1.ads Test1.adb Test.pro test.cfg build.bat -- builds Test1.dll, Test.plm, Test.xpl runXPL.bat -- runs Test.xpl test program 5.2. Test for reenterable generators in LSX Directory: Tests\Test-Generators-LSX GTest1.ads GTest1.adb GTest2.ads GTest2.adb Test.adb Test.pro test.cfg build.bat -- builds Test1.dll, Test2.dll, Test.plm, Test.xpl runXPL.bat -- runs Test.xpl test program 5.3. Test for predicate's instances (Generator_Reenterable kind) Directory: Tests\Test-Instances Test1.ads Test1.adb Test2.ads Test2.adb Test.pro test.cfg build.bat -- builds Test1.dll, Test2.dll, Test.plm, Test.xpl runXPL.bat -- runs Test.xpl test program 5.4. Test for the lists in the predicate's parameters Directory: Tests\Test-Lists Test1.ads Test1.adb Test.pro test.cfg build.bat -- builds Test1.dll, Test.plm, Test.xpl runXPL.bat -- runs Test.xpl test program 5.5. Test for the Remove subroutine Directory: Tests\Test-Retract Test.adb Test.pro facts.pro test.cfg build.bat -- builds test.exe, Test.plm, Test.xpl 5.6. Test for synonyms Directory: Tests\Test-Synonyms Test.adb Test.pro build.bat -- builds test.exe, Test.plm, Test.xpl 5.7. Test for unification Directory: Tests\Test-Unify Test.adb UTest.adb UTest.ads Test.pro test.cfg build.bat -- builds test.exe, Test.plm, Test.xpl ------------------------------------------------------------------------------- After successful build the following files should (additionally) appear in the corresponding directories: Directory: Bin libamzi.a -- static link library Directory: Lib prolog.ali prolog.o prolog-checkout.ali prolog-checkout.o prolog-library.ali prolog-library.o prolog-logic_server.ali prolog-logic_server.o prolog-lists.ali prolog-lists.o prolog-unification.ali prolog-unification.o Directory: Samples example1.adb example2.adb example1.exe example2.exe Dinner.dll Dinner.plm Dinner.xpl Directory: Tests\Test-Backtracking Test1.dll Test.plm Test.xpl Directory: Tests\Test-Generators-LSX GTest1.dll GTest2.dll test.exe Test.plm Test.xpl Directory: Tests\Test-Instances Test1.dll Test2.dll Test.plm Test.xpl Directory: Tests\Test-Lists Test1.dll Test.plm Test.xpl Directory: Tests\Test-Retract test.exe Test.plm Test.xpl Directory: Tests\Test-Synonyms test.exe Test.plm Test.xpl Directory: Tests\Test-Unify test.exe Test.plm Test.xpl *** End of readme.1st file ***