This commit is contained in:
Vitor Santos Costa
2018-05-01 23:25:58 +01:00
parent 44ac70d3ab
commit ef04b30d66
56 changed files with 2229 additions and 2422 deletions

View File

@@ -1,7 +1,9 @@
Downloading and Installing YAP {#INSTALL}
===========================
Installing YAP {#INSTALL}
++++++++
This text includes instructions to download and install YAP.
[TOC]
### Downloading YAP {#Download}
@@ -24,7 +26,7 @@ The first argument is the repository, the last argument is the (optional) target
There are a variety of graphical interfaces to `git`, including GitHub's own [GitHub Desktop](https://desktop.github.com/) that supports Microsoft Windows and Apple OSX. A list with GUI applications, editor integration, and much more can be found at the [git Wiki](https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools),
#### Download Options
### Download Options
It may be useful to know:
@@ -40,7 +42,6 @@ It may be useful to know:
these documents.
### Compiling YAP {#CompilingYAP}
-------------
YAP-6.3.4 is a [cmake](www.cmake.org) based
system. We use `cmake` because it supports mosts popular software, can
@@ -48,7 +49,7 @@ generate Makefiles, Ninja, Apple's XCode, VisualStudio and ANdroid
Studio, and because it includes packaging suppport, The steps required
to install core YAP under `cmake`:
##### `C/C++` compiler
#### The compiler
*Status as of early 2017*
@@ -65,7 +66,7 @@ to install core YAP under `cmake`:
YAP compiles cleanly under cross-compilers, and we have used the
crosss-compilation system [mxe](http://mxe.cc/) system with good results.
##### `cmake`
### cmake
All Linux and BSD distributions include `cmake`, so
does [Homebrew](https://brew.sh/)
@@ -80,7 +81,7 @@ the [CMake site](https://www.cmake.org).
If you have an older Linux you may need to compile from source,
available at GitHub.
##### Ensure that you have other necessary packages installed:
### Ensure that you have other necessary packages installed:
+ YAP requires [gmp]{https://gmplib.org/} for infinite precision
integer and rational. Please ensure the development pacakage
@@ -101,7 +102,7 @@ available at GitHub.
+ make sure to install Python-3, and not Python-2,
##### Compile and Install
### Compile and Install
1: Create a directory, say `Build` and `cd` to the directory (`cd Build`).
*YAP should not be compiled at its rootxo directory, some packages do not allow for that.
@@ -115,15 +116,14 @@ available at GitHub.
5: If you feel satisfied with the result, do `make install`.
* In most systems you will need to be superuser in order to do `make install` and `make info` on the standard directories.
Tuning the Functionality of YAP
-------------------------------
### Tuning the Functionality of YAP
By default, YAP supports tabling, depth first search, and most features found in
modern Prologs. In some cases, you may want to suport extra features, or reduce system size.
`cmake`provides an graphical interface for doing so. From the commmand line, a typical example could be:
~~~~~
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~ /users/vsc/src/yap
Cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~ /users/vsc/src/yap
~~~~~
The first argument says that this is a release, compiled with full optimisation. The second argument says YAP should install under the ~ drectory. In this case, YAP will add the binaries to /users/vsc/bin, include files to `/users/vsc/include/Yap`, Prolog files to `/users/vsc/share/Yap`, and ay DLL to `/users/vsc/lib/Yap`.
@@ -177,7 +177,7 @@ You can also use `xcodebuild` from the command line.
Bext follow instructions to fully compile YAP:
#### Compilation Notes for OSX/Brew
### Compilation Notes for OSX/Brew
Next follows a detailed description of a full install of YAP, including all the packages that YAP can use:
@@ -210,7 +210,7 @@ brew install cudd
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl ..
~~~~~
#### Compilation Notes for Android
### Compilation Notes for Android
Next we present the compilation process for Android. The environment is an OSX, but steps
should be similar for Linux machines. We assume you have downloaded both the Android NDK and the Android SDK.

View File

@@ -1,5 +1,5 @@
Attributed Variables and Co-Routining {#attributes}
=======================================
### Attributed Variables and Co-Routining {#attributes}
@ingroup extensions
@@ -26,15 +26,9 @@ work with. Most packages included in YAP that use attributed
variables, such as CHR, CLP(FD), and CLP(QR), rely on the SWI-Prolog
awi interface.
+ @ref SICS_attributes
+ @ref sicsatts
+ @ref New_Style_Attribute_Declarations
+ @ref CohYroutining
+ @ref AttributeVariables_Builtins
[TOC]
### SICStus Style attribute declarations. {#SICS_attributes}
#### SICStus Style attribute declarations. {#SICS_attributes}
The YAP library `atts` implements attribute variables in the style of
SICStus Prolog. Attributed variables work as follows:
@@ -279,7 +273,7 @@ Module:get_atts/2`.
@}
@{
### hProlog and SWI-Prolog style Attribute Declarations {#New_Style_Attribute_Declarations}
#### hProlog and SWI-Prolog style Attribute Declarations {#New_Style_Attribute_Declarations}
The following documentation is taken from the SWI-Prolog manual.
@@ -351,7 +345,7 @@ v put_attr(Y, domain, Domain),
@{
### Co-routining {#CohYroutining}
#### Co-routining {#CohYroutining}
Prolog uses a simple left-to-right flow of control. It is sometimes
convenient to change this control so that goals will only execute when

View File

@@ -1,4 +1,5 @@
@defgroup builtins YAP Core Built-ins
YAP Core Built-ins {#builtins}
==================
@brief This chapter describes the core built-in predicates that control the execution of
Prolog programs, provide fundamental functionality such as termm manipulation or arithmetic, and support interaction with external
@@ -13,3 +14,49 @@ notation will be used:
argument" - the argument is read, not written, and it cannot be a free variable at the time of the call;
+ a preceding minus sign will denote an "output argument";
+ an argument with no preceding symbol can be used in both ways.
+ @ref AbsoluteFileName
+ @ref CompilerAnalysis
+ @ref New_Style_Attribute_Declarations
+ @ref YAPControl
+ @ref Profiling
+ @ref Call_Counting
+ @ref YAPConsulting
+ @ref YAPReadFiles
+ @ref ModPreds
+ @ref Conditional_Compilation
+ @ref YAPBigLoad
+ @ref Deb_Interaction
+ @ref DepthLimited
+ @ref Dialects
+ @ref Directives
+ @ref EAM
+ @ref SWI-error
+ @ref YAPErrorHandler
+ @ref CompiledExpression
+ @ref YAPFlags
+ @ref Grammars
+ @ref Hacks
+ @ref Listing
+ @ref LoadForeign
+ @ref Messages
+ @ref YAPMetaPredicates
+ @ref ModuleBuiltins
+ @ref YAPOS
+ @ref pathconf
+ @ref YAPPredDecls
+ @ref Database
+ @ref The_Count_Profiler
+ @ref QLY
+ @ref Sets
+ @ref Deb_Preds
+ @ref Statistics
+ @ref Tabling
+ @ref Threads
+ @ref TopLevel
+ @ref Undefined_Procedures
+ @ref MixBag
+ @ref InputOutput
+ @ref IO_Sockets
+ @ref ypp

View File

@@ -1,24 +0,0 @@
YAP Core Built-ins {#core}
=================
This chapter describes the core predicates that control the execution of
Prolog programs, provide fundamental functionality such as termm manipulation or arithmetic, and support interaction with external
resources, Many of the predicates described here have been standardised by the ISO. The standartised subset of Prolog also known as ISO-Prolog.
In the description of the arguments of predicates the following
notation will be used:
+ a preceding plus sign will denote an argument as an "input
argument" - it cannot be a free variable at the time of the call;
+ a preceding minus sign will denote an "output argument";
+ an argument with no preceding symbol can be used in both ways.
@copydoc builtins
@{
@defgroup builtins YAP Core Builtins:
@}

View File

@@ -1,8 +1,62 @@
@page Library YAP Library
YAP Prolog Library {#library}
===================
the library_directory path (set by the
`LIBDIR` variable in the Makefile for YAP). Several files in the
library are originally from the public-domain Edinburgh Prolog library.
@tableofcontents
+ @ref apply_stub
+ @ref apply_macros
+ @ref args
+ @ref Association_Lists
+ @ref sicsatts
+ @ref avl
+ @ref bhash
+ @ref block_diagram
+ @ref c_alarms
+ @ref charsio
+ @ref clauses
+ @ref cleanup
+ @ref dbqueues
+ @ref dbusage
+ @ref dgraphs
+ @ref exo_interval
+ @ref flags
+ @ref gensym
+ @ref yap_hacks
+ @ref heaps
+ @ref lam_mpi
+ @ref line_utils
+ @ref swi_listing
+ @ref Log2MD
+ @ref mapargs
+ @ref maplist
+ @ref matlab
+ @ref matrix
+ @ref nb
+ @ref ordsets
+ @ref parameters
+ @ref queues
+ @ref random
+ @ref Pseudo_Random
+ @ref rbtrees
+ @ref readutil
+ @ref regexp
+ @ref rltrees
+ @ref Splay_Trees
+ @ref operating_system_support
+ @ref Terms
+ @ref timeout
+ @ref trees
+ @ref tries
+ @ref ugraphs
+ @ref undgraphs
+ @ref varnumbers
+ @ref wdgraphs
+ @ref wgraphs
+ @ref wundgraphs

View File

@@ -1,4 +1,5 @@
@defgroup load_files Loading and Organising YAP Programs
Loading and Organising YAP Programs {#load_files}
====================================
@brief Next, we present the main predicates and directives available to load
files and to control the Prolog environment.

View File

@@ -1,5 +1,5 @@
### The YAP Module system {#YAPModules}
The YAP Module system {#YAPModules}
=======================
The YAP module system is based on the Quintus/SISCtus module
system ˜\cite quintus . In this design, modules are named collections of predicates,
@@ -38,6 +38,8 @@ the module/2 declaration.This declaration sets the source module when
it starts consulting a file, and resets it at the end. One can set
the type-in module permanently by using the built-in `module/1`.
[TOC]
#### Explicit Naming {#ExplicitNaming}
The module system allows one to _explicitly_ specify the source mode for

View File

@@ -1,13 +1,13 @@
#### Running YAP {#run}
## Running YAP {#run}
We next describe how to invoke YAP in Unix systems.
[TOC]
##### Running YAP Interactively {#Running_YAP_Interactively}
### Running YAP Interactively {#Running_YAP_Interactively}
Most often you will want to use YAP in interactive mode. Assuming that
@@ -104,7 +104,7 @@ YAP can also be used to run Prolog files as scripts, at least in
Unix-like environments. A simple example is shown next (do not forget
that the shell comments are very important):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
#!/usr/local/bin/yap -L --
#
# Hello World script file using YAP
@@ -113,7 +113,7 @@ that the shell comments are very important):
:- write('Hello World'), nl.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
The `#!` characters specify that the script should call the binary
file YAP. Notice that many systems will require the complete path to the
@@ -147,7 +147,7 @@ Notice that the `--` is required so that the shell passes the extra
arguments to YAP. As an example, consider the following script
`dump_args`:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
#!/usr/bin/yap -L --
#.
@@ -158,13 +158,13 @@ main( [H|T] ) :-
:- unix( argv(AllArgs) ), main( AllArgs ).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
If you this run this script with the arguments:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
./dump_args -s 10000
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
the script will start an YAP process with stack size `10MB`, and
the list of arguments to the process will be empty.
@@ -172,7 +172,7 @@ Often one wants to run the script as any other program, and for this it
is convenient to ignore arguments to YAP. This is possible by using
`L --` as in the next version of `dump_args`:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
#!/usr/bin/yap -L --
main( [] ).
@@ -182,13 +182,13 @@ main( [H|T] ) :-
:- unix( argv(AllArgs) ), main( AllArgs ).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
The `--` indicates the next arguments are not for YAP. Instead,
they must be sent directly to the argv built-in. Hence, running
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
./dump_args test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~
will write `test` on the standard output.

View File

@@ -67,9 +67,9 @@ assert/1, clause/1 and retract/1 are used. First
predicates which will change during execution should be declared as
`dynamic` by using commands like:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~
:- dynamic f/n.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~
where `f` is the predicate name and n is the arity of the
predicate. Note that several such predicates can be declared in a
@@ -174,12 +174,9 @@ standard.
The following incompatibilities between YAP and the ISO standard are
known to still exist (please check Ulrich Neumerkel's page for more details):
<ul>
<li>Currently, YAP does not handle overflow errors in integer
+ Currently, YAP does not handle overflow errors in integer
operations, and handles floating-point errors only in some
architectures. Otherwise, YAP follows IEEE arithmetic.
<ul>
Please inform the authors on other incompatibilities that may still
exist.