manual
This commit is contained in:
parent
4deb28e4c6
commit
6741d961b3
@ -4,7 +4,7 @@ Loading and Oganising YAP Programs {#consult}
|
|||||||
Next, we present the main predicates and directives available to load
|
Next, we present the main predicates and directives available to load
|
||||||
files and to control the Prolog environment.
|
files and to control the Prolog environment.
|
||||||
|
|
||||||
+ @subpage YAPModules
|
+ @subpage modules.md
|
||||||
|
|
||||||
+ @ref YAPConsulting
|
+ @ref YAPConsulting
|
||||||
|
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
The YAP Module system {#YAPModules}
|
The YAP Module system
|
||||||
======================
|
======================
|
||||||
|
|
||||||
|
[TOC]
|
||||||
|
|
||||||
The YAP module system is based on the Quintus/SISCtus module
|
The YAP module system is based on the Quintus/SISCtus module
|
||||||
system ˜\cite quintus . In this design, modules are named collections of predicates,
|
system ˜\cite quintus . In this design, modules are named collections of predicates,
|
||||||
@ -39,7 +40,7 @@ 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
|
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`.
|
the type-in module permanently by using the built-in `module/1`.
|
||||||
|
|
||||||
\subsection Explicit Naming
|
#### Explicit Naming {#ExplicitNaming}
|
||||||
|
|
||||||
The module system allows one to _explicitly_ specify the source mode for
|
The module system allows one to _explicitly_ specify the source mode for
|
||||||
a clause by prefixing a clause with its module, say:
|
a clause by prefixing a clause with its module, say:
|
||||||
@ -168,7 +169,7 @@ YAP will execute as follows:
|
|||||||
% consulting .../b.pl...
|
% consulting .../b.pl...
|
||||||
% consulted .../b.pl in module b, 0 msec 0 bytes
|
% consulted .../b.pl in module b, 0 msec 0 bytes
|
||||||
% consulted .../a.pl in module a, 1 msec 0 bytes
|
% consulted .../a.pl in module a, 1 msec 0 bytes
|
||||||
true.
|
true.
|
||||||
?- a(X).
|
?- a(X).
|
||||||
X = 1 ? ;
|
X = 1 ? ;
|
||||||
X = 1.
|
X = 1.
|
||||||
@ -227,6 +228,8 @@ X = 2 ? ;
|
|||||||
|
|
||||||
The state of the module system after this error is undefined.
|
The state of the module system after this error is undefined.
|
||||||
|
|
||||||
|
### BuiltIn predicates {#ModuleBuiltins)
|
||||||
|
|
||||||
@\pred module(+ M:atom,+ L:list ) is directive
|
@\pred module(+ M:atom,+ L:list ) is directive
|
||||||
the current file defines module _M_ with exports _L_. The list may include
|
the current file defines module _M_ with exports _L_. The list may include
|
||||||
|
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
Running YAP {#run}
|
|
||||||
|
|
||||||
|
Running YAP {#run}
|
||||||
===========
|
===========
|
||||||
|
|
||||||
We next describe how to invoke YAP in Unix systems.
|
We next describe how to invoke YAP in Unix systems.
|
||||||
|
|
||||||
@subsection Running_YAP_Interactively Running YAP Interactively
|
[TOC]
|
||||||
@section
|
|
||||||
|
### Running YAP Interactively {#Running_YAP_Interactively}
|
||||||
|
|
||||||
|
|
||||||
Most often you will want to use YAP in interactive mode. Assuming that
|
Most often you will want to use YAP in interactive mode. Assuming that
|
||||||
YAP is in the user's search path, the top-level can be invoked under
|
YAP is in the user's search path, the top-level can be invoked under
|
||||||
Unix with the following command:
|
Unix with the following command:
|
||||||
@ -89,12 +94,11 @@ YAP always tries to find saved states from the current directory
|
|||||||
first. If it cannot it will use the environment variable YAPLIBDIR, if
|
first. If it cannot it will use the environment variable YAPLIBDIR, if
|
||||||
defined, or search the default library directory.
|
defined, or search the default library directory.
|
||||||
|
|
||||||
+
|
|
||||||
YAP will try to find library files from the YAPSHAREDIR/library
|
YAP will try to find library files from the YAPSHAREDIR/library
|
||||||
directory.
|
directory.
|
||||||
|
|
||||||
|
### Running Prolog Files {#Running_Prolog_Files}
|
||||||
@section Running_Prolog_Files Running Prolog Files
|
|
||||||
|
|
||||||
YAP can also be used to run Prolog files as scripts, at least in
|
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
|
Unix-like environments. A simple example is shown next (do not forget
|
||||||
|
Reference in New Issue
Block a user