documenetation .

This commit is contained in:
Vítor Santos Costa 2014-05-14 10:01:11 +01:00
parent 503b2b93f9
commit 596768a56b
8 changed files with 434 additions and 355 deletions

View File

@ -191,11 +191,7 @@ BEAM_is(void)
#endif #endif
/** /**
@class is_2 @pred is( X:number, + Y:ground) is det
@anchor is_2
@brief evaluation of arithmetic expressions
<b>? _X_:number is + _Y_:ground is det</b>
This predicate succeeds iff the result of evaluating the expression This predicate succeeds iff the result of evaluating the expression
_Y_ unifies with _X_. This is the predicate normally used to _Y_ unifies with _X_. This is the predicate normally used to
@ -228,11 +224,7 @@ p_is( USES_REGS1 )
} }
/** /**
@class isnan_1 @pred isnan(? X:float) is det
@anchor isnan_1
@brief True if _X_ is not a number
<b> isnan(? _X_:float) is det</b>
Interface to the IEE754 `isnan` test. Interface to the IEE754 `isnan` test.
*/ */
@ -266,11 +258,7 @@ p_isnan( USES_REGS1 )
} }
/** /**
@class isinf_1 @pred isinf(? X:float) is det</b>
@anchor isinf_1
@brief True if _X_ is infinity
<b> isnan(? _X_:float) is det</b>
Interface to the IEE754 `isinf` test. Interface to the IEE754 `isinf` test.
*/ */
@ -305,11 +293,7 @@ p_isinf( USES_REGS1 )
} }
/** /**
@class logsum_3 @pred logsum(+ Log1:float, + Log2:float, - Out:float ) is det
@anchor logsum_3
@brief sum of two logarithms
<b> logsum(+ _Log1_, + _Log2_, - _Out_ ) is det </b>
True if _Log1_ is the logarithm of the positive number _A1_, True if _Log1_ is the logarithm of the positive number _A1_,
_Log2_ is the logarithm of the positive number _A2_, and _Log2_ is the logarithm of the positive number _A2_, and
@ -413,6 +397,22 @@ Yap_ArithError(yap_error_number type, Term where, char *format,...)
return 0L; return 0L;
} }
/**
@{
@pred between(+ Low:int, + High:int, ? Value:int) is nondet
_Low_ and _High_ are integers, _High_ \>= _Low_. If
_Value_ is an integer, _Low_ =\< _Value_
=\< _High_. When _Value_ is a variable it is successively
bound to all integers between _Low_ and _High_. If
_High_ is inf or infinite between/3 is true iff
_Value_ \>= _Low_, a feature that is particularly interesting
for generating integers from a certain value.
*/
static Int cont_between( USES_REGS1 ) static Int cont_between( USES_REGS1 )
{ {
Term t1 = EXTRA_CBACK_ARG(3,1); Term t1 = EXTRA_CBACK_ARG(3,1);
@ -447,25 +447,6 @@ static Int cont_between( USES_REGS1 )
} }
} }
/**
@class between_3
@anchor between_3
@brief sequence of numbers
between(+ _Low_:int, + _High_:int, ? _Value_:int) is nondet
_Low_ and _High_ are integers, _High_ \>= _Low_. If
_Value_ is an integer, _Low_ =\< _Value_
=\< _High_. When _Value_ is a variable it is successively
bound to all integers between _Low_ and _High_. If
_High_ is inf or infinite [between/3](@ref between_3) is true iff
_Value_ \>= _Low_, a feature that is particularly interesting
for generating integers from a certain value.
@}
*/
static Int static Int
init_between( USES_REGS1 ) init_between( USES_REGS1 )
{ {
@ -561,6 +542,12 @@ init_between( USES_REGS1 )
return cont_between( PASS_REGS1 ); return cont_between( PASS_REGS1 );
} }
/**
*
* @}
*
* @}
*/
void void
Yap_InitEval(void) Yap_InitEval(void)
{ {

View File

@ -367,9 +367,8 @@ class YAPParams;
*/ */
class YAPEngine { class YAPEngine {
public: public:
YAPEngine(YAPParams const& params); YAPEngine(YAPParams const& params); /// construct a new engine
query( char *s ) { return new Query( s ); } YAPQuery *query( char *s ) { return new YAPQuery( s ); } /// build a query on the engine
atom( char *s ) { return new Query( s ); }
}; };
/** /**

File diff suppressed because it is too large Load Diff

View File

@ -10,7 +10,7 @@
:- initialization(main). :- initialization(main).
:- dynamic val/2, item/2, last_node/2, indent/1. :- dynamic val/2, item/2, last_node/2, indent/1, pred/4.
get_arg( Inp, Out ) :- get_arg( Inp, Out ) :-
unix( argv( [Inp, Out] ) ), !. unix( argv( [Inp, Out] ) ), !.
@ -69,7 +69,8 @@ scan_file( Inp ) :-
item( Item0 , ItLines ), item( Item0 , ItLines ),
atom_string(A2, Item0), atom_string(A2, Item0),
cvt_slash( Pred, Key ), cvt_slash( Pred, Key ),
assert_static( pred( A1, Key, A2, Inp:ItLines ) ), \+ pred(_, Key, _, _ ),
assert( pred( A1, Key, A2, Inp:ItLines ) ),
fail fail
; ;
% look for predicates % look for predicates
@ -601,8 +602,8 @@ simplify( [0'q,0'Q|L]) --> "=", !,
simplify(L). simplify(L).
simplify( [0'q,0'U|L]) --> "?", !, simplify( [0'q,0'U|L]) --> "?", !,
simplify(L). simplify(L).
simplify( [] ) --> "/", !. simplify( [] ) --> "/",
% simplify(L). number, !.
simplify( [0's,0'S|L]) --> "<", !, simplify( [0's,0'S|L]) --> "<", !,
simplify(L). simplify(L).
simplify( [0'u,0'U|L]) --> "\v", !, simplify( [0'u,0'U|L]) --> "\v", !,
@ -627,6 +628,11 @@ simplify( L) --> [_], !,
simplify(L). simplify(L).
simplify( []) --> []. simplify( []) --> [].
number --> [].
number --> [C],
{ C >= "0" , C =< "9" },
number.
first_word(Line, Word, Rest) :- first_word(Line, Word, Rest) :-
jmp_blanks( Line, Line2 ), jmp_blanks( Line, Line2 ),

View File

@ -7615,8 +7615,6 @@ You can see the available SQL Modes at the MySQL homepage at
@ifplaintext @ifplaintext
Please have a look at @subpage RealPage
@copydoc real @copydoc real
@end ifplaintext @end ifplaintext

View File

@ -14,6 +14,14 @@
* * * *
* * * *
*************************************************************************/ *************************************************************************/
/**
*
* @file blobs.c
*
* @addtogroup swi-c-interface
*
* @{
*/
#include <Yap.h> #include <Yap.h>
#include <Yatom.h> #include <Yatom.h>
@ -248,3 +256,7 @@ Yap_install_blobs(void)
{ {
} }
/**
* @}
*/

View File

@ -5,13 +5,15 @@
* Email: steve.moyle@comlab.ox.ac.uk * Email: steve.moyle@comlab.ox.ac.uk
* Date: 21 January 2002 * Date: 21 January 2002
* Copyright (c) 2002 Steve Moyle. All rights reserved. * Copyright (c) 2002-2014 Vitor Santos Costa from an original version by Steve Moyle. All rights reserved.
*/ */
/** /**
* *
* @daddtogroup swi-c-interface * @file swi.c
*
* @addtogroup swi-c-interface
* *
* @{ * @{
*/ */
@ -3254,6 +3256,7 @@ int WINAPI win_yap2swi(HANDLE hinst, DWORD reason, LPVOID reserved)
#endif #endif
/** /**
* @{ * @}
* @}
*/ */

View File

@ -13,11 +13,21 @@
@defgroup swi-c-interface SWI-Prolog Foreign Language Interface @defgroup swi-c-interface SWI-Prolog Foreign Language Interface
Support for file name resolution through absolute_file_name/3 and *
friends. These utility built-ins describe a list of directories that * @tableofcontents
are used by load_files/2 to search. They include pre-compiled paths *
plus user-defined directories, directories based on environment * A reimplementation of Jan Wielemaker's SWI-Prolog C-language interface, it supports
variables and registry information to search for files. * most of the functionality in the original implementation. It allows for:
*
* - Term Construction, Access, and Unification
* - Manipulation of Atoms, Strings, Lists of Codes and Lists of Atoms
* - Query evaluation
* - Thread and Prolog engine management
* - Data-Base Access
*
* In this interface, all Prolog data known by C is referenced through term references (term_t), hence
* Prolog has all the information necessary to perform its memory management without special precautions
* from the C programmer.
@{ @{
@ -85,3 +95,7 @@ FunctorToSWIFunctor(Functor at)
} }
#define isDefinedProcedure(pred) TRUE // TBD #define isDefinedProcedure(pred) TRUE // TBD
/**
@}
*/