docs
This commit is contained in:
parent
40096b3fdc
commit
2d55f41ef6
@ -33,6 +33,7 @@ static char SccsId[] = "%W% %G%";
|
||||
|
||||
|
||||
/** @defgroup Internal_Database Internal Data Base
|
||||
|
||||
@ingroup builtins
|
||||
@{
|
||||
|
||||
|
12
os/iopreds.c
12
os/iopreds.c
@ -1239,7 +1239,8 @@ static Int do_open(Term file_name, Term t2, Term tlist USES_REGS) {
|
||||
char io_mode[8];
|
||||
file_name = Deref(file_name);
|
||||
if (IsVarTerm(file_name)) {
|
||||
Yap_ThrowError(INSTANTIATION_ERROR, file_name, "while opening a list of options");
|
||||
Yap_ThrowError(INSTANTIATION_ERROR, file_name,
|
||||
"while opening a list of options");
|
||||
}
|
||||
// open mode
|
||||
if (IsVarTerm(t2)) {
|
||||
@ -1583,6 +1584,7 @@ int Yap_OpenStream(Term tin, const char *io_mode, Term user_name,
|
||||
vfsp->open(vfsp, fname, io_mode, sno)) {
|
||||
// read, write, append
|
||||
user_name = st->user_name;
|
||||
st->vfs = vfsp;
|
||||
UNLOCK(st->streamlock);
|
||||
} else {
|
||||
st->file = fopen(fname, io_mode);
|
||||
@ -1761,8 +1763,8 @@ int Yap_CheckTextStream__(const char *file, const char *f, int line, Term arg,
|
||||
return sno;
|
||||
}
|
||||
|
||||
int Yap_CheckTextWriteStream__(const char *file, const char *f, int line, Term arg,
|
||||
const char *msg) {
|
||||
int Yap_CheckTextWriteStream__(const char *file, const char *f, int line,
|
||||
Term arg, const char *msg) {
|
||||
int sno, kind = Output_Stream_f;
|
||||
if ((sno = CheckStream__(file, f, line, arg, kind, msg)) < 0)
|
||||
return -1;
|
||||
@ -1779,8 +1781,8 @@ int Yap_CheckTextWriteStream__(const char *file, const char *f, int line, Term a
|
||||
return sno;
|
||||
}
|
||||
|
||||
int Yap_CheckTextReadStream__(const char *file, const char *f, int line, Term arg,
|
||||
const char *msg) {
|
||||
int Yap_CheckTextReadStream__(const char *file, const char *f, int line,
|
||||
Term arg, const char *msg) {
|
||||
int sno, kind = Input_Stream_f;
|
||||
if ((sno = CheckStream__(file, f, line, arg, kind, msg)) < 0)
|
||||
return -1;
|
||||
|
@ -10,8 +10,7 @@ YAP_Term TermErrStream, TermOutStream;
|
||||
|
||||
static unsigned char *outbuf, *errbuf;
|
||||
|
||||
static void pyflush( StreamDesc *st)
|
||||
{
|
||||
static void pyflush(StreamDesc *st) {
|
||||
#if 0
|
||||
st->u.w_irl.ptr[0] = '\0';
|
||||
fprintf(stderr,"%s\n", st->u.w_irl.buf);
|
||||
@ -25,7 +24,6 @@ static void pyflush( StreamDesc *st)
|
||||
python_release_GIL(tg);
|
||||
st->u.w_irl.ptr = st->u.w_irl.buf;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
static int py_putc(int sno, int ch) {
|
||||
@ -96,9 +94,7 @@ static void *py_open(VFS_t *me, const char *name, const char *io_mode,
|
||||
// } else if (strcmp(name, "input") == 0) {
|
||||
//pystream = PyObject_Call(pystream, PyTuple_New(0), NULL);
|
||||
} else */
|
||||
{
|
||||
st->user_name = YAP_MkAtomTerm(st->name);
|
||||
}
|
||||
{ st->user_name = YAP_MkAtomTerm(st->name); }
|
||||
st->u.private_data = pystream;
|
||||
st->vfs = me;
|
||||
st->file = NULL;
|
||||
@ -106,7 +102,6 @@ static void *py_open(VFS_t *me, const char *name, const char *io_mode,
|
||||
return st;
|
||||
}
|
||||
|
||||
|
||||
static void py_flush(int sno) {
|
||||
StreamDesc *s = YAP_GetStreamFromId(sno);
|
||||
term_t tg = python_acquire_GIL();
|
||||
@ -116,7 +111,6 @@ static void py_flush(int sno) {
|
||||
python_release_GIL(tg);
|
||||
}
|
||||
|
||||
|
||||
static bool py_close(int sno) {
|
||||
StreamDesc *st = YAP_RepStreamFromId(sno);
|
||||
if (st->status & (Output_Stream_f | Append_Stream_f))
|
||||
@ -137,10 +131,11 @@ static bool getLine(int inp) {
|
||||
term_t ctk = python_acquire_GIL();
|
||||
Py_ssize_t size;
|
||||
PyObject *prompt = PyUnicode_FromString("?- "),
|
||||
*msg = PyUnicode_FromString(" **input** ");
|
||||
*msg = PyUnicode_FromString(" **input** "),
|
||||
*o = PyObject_GetAttrString(rl_iostream->u.private_data, "read");
|
||||
/* window of vulnerability opened */
|
||||
myrl_line = PyUnicode_AsUTF8AndSize(PyObject_CallFunctionObjArgs(
|
||||
rl_instream->u.private_data, msg, prompt, NULL), &size);
|
||||
myrl_line = PyUnicode_AsUTF8AndSize(
|
||||
PyObject_CallFunctionObjArgs(o, msg, prompt, NULL), &size);
|
||||
python_release_GIL(ctk);
|
||||
rl_instream->u.irl.ptr = rl_instream->u.irl.buf =
|
||||
(const unsigned char *)malloc(size);
|
||||
|
@ -26,13 +26,13 @@
|
||||
jupyter_query(Caller, Cell, Line ) :-
|
||||
jupyter_cell(Caller, Cell, Line).
|
||||
|
||||
jupyter_cell(_Caller, Cell, _) :-
|
||||
jupyter_cell(_Caller, Cell, _Line) :-
|
||||
jupyter_consult(Cell), %stack_dump,
|
||||
fail.
|
||||
jupyter_cell( _Caller, _, '' ) :- !.
|
||||
jupyter_cell( _Caller, _, Line ) :-
|
||||
blank( Line ),
|
||||
!.
|
||||
jupyter_cell( _Caller, _, '' ) :- !.
|
||||
jupyter_cell( Caller, _, Line ) :-
|
||||
Self := Caller.query,
|
||||
python_query(Self,Line).
|
||||
@ -54,19 +54,13 @@ jupyter_consult(Text) :-
|
||||
jupyter_consult(Cell) :-
|
||||
% Name = 'Inp',
|
||||
% stream_property(Stream, file_name(Name) ),
|
||||
setup_call_cleanup(
|
||||
% setup_call_cleanup(
|
||||
open_mem_read_stream( Cell, Stream),
|
||||
load_files(user:'jupyter cell',[stream(Stream)]),
|
||||
close(Stream)
|
||||
).
|
||||
load_files(user:'jupyter cell',[stream(Stream)]).
|
||||
|
||||
blank(Text) :-
|
||||
atom_codes(Text, L),
|
||||
maplist( blankc, L).
|
||||
|
||||
blankc(' ').
|
||||
blankc('\n').
|
||||
blankc('\t').
|
||||
maplist( code_type(space), L).
|
||||
|
||||
:- dynamic cell_stream/1.
|
||||
|
||||
|
@ -36,6 +36,7 @@
|
||||
|
||||
/** @defgroup CompilerAnalysis Internal Clause Rewriting
|
||||
@ingroup YAPCompilerSettings
|
||||
@{
|
||||
|
||||
YAP supports several clause optimisation mechanisms, that
|
||||
are designed to improve execution of arithmetic
|
||||
@ -59,7 +60,6 @@
|
||||
|
||||
*/
|
||||
|
||||
%% @{
|
||||
|
||||
/** @pred expand_exprs(- _O_,+ _N_)
|
||||
Control term expansion during compilation.
|
||||
|
@ -15,14 +15,13 @@
|
||||
* *
|
||||
*************************************************************************/
|
||||
|
||||
%% @{
|
||||
|
||||
/**
|
||||
@file arithpreds.yap
|
||||
|
||||
@addtogroup arithmetic_preds
|
||||
|
||||
|
||||
@{
|
||||
*/
|
||||
|
||||
:- system_module(arithmetic_predicates, [
|
||||
|
@ -26,7 +26,7 @@
|
||||
|
||||
/**
|
||||
* @addtogroup Predicates_on_Atoms
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @pred atom_concat(+ As, ? A)
|
||||
|
@ -19,11 +19,11 @@
|
||||
@file boot.yap
|
||||
@brief YAP bootstrap
|
||||
|
||||
@{
|
||||
|
||||
@addtogroup TopLevel Top-Level and Boot Predicates
|
||||
|
||||
@ingroup builtins
|
||||
@{
|
||||
|
||||
|
||||
*/
|
||||
|
@ -3,6 +3,7 @@
|
||||
@short utilities
|
||||
|
||||
@addtogroup Internal_Database
|
||||
@{
|
||||
*/
|
||||
|
||||
/** @pred recordaifnot(+ _K_, _T_,- _R_)
|
||||
@ -41,3 +42,4 @@ recordzifnot(K,T,R) :-
|
||||
recordzifnot(K,T,R) :-
|
||||
recordz(K,T,R).
|
||||
|
||||
%% @}
|
||||
|
@ -21,7 +21,6 @@
|
||||
|
||||
@addtogroup YAPControl Control Predicates
|
||||
@ingroup builtins
|
||||
|
||||
@{
|
||||
|
||||
*/
|
||||
|
@ -39,10 +39,10 @@ implementation.
|
||||
|
||||
*/
|
||||
|
||||
%% @{
|
||||
|
||||
/** @defgroup Call_Counting Counting Calls
|
||||
/**
|
||||
@defgroup Call_Counting Counting Calls
|
||||
@ingroup Profiling
|
||||
@{
|
||||
|
||||
Predicates compiled with YAP's flag call_counting set to
|
||||
`on` update counters on the numbers of calls and of
|
||||
|
@ -22,12 +22,11 @@
|
||||
'$syntax_check_multiple'/2,
|
||||
'$syntax_check_single_var'/2]).
|
||||
|
||||
%% @{
|
||||
|
||||
/**
|
||||
|
||||
@defgroup YAPStyle Checker
|
||||
@ingroup YAPCompilerSettings
|
||||
@{
|
||||
|
||||
YAP implements a style-checker thay currently verifies whether:
|
||||
|
||||
|
@ -83,11 +83,9 @@
|
||||
|
||||
@addtogroup YAPControl
|
||||
@ingroup builtins
|
||||
|
||||
@{
|
||||
*/
|
||||
|
||||
%% @{
|
||||
|
||||
/** @pred forall(: _Cond_,: _Action_)
|
||||
|
||||
|
||||
|
@ -30,10 +30,9 @@
|
||||
%%
|
||||
% @defgroup YAPBigLoad Loading Large Tables
|
||||
% @ingroup YAPConsulting
|
||||
%
|
||||
% @{
|
||||
% @brief Fast and Exo Loading
|
||||
%
|
||||
% @{
|
||||
|
||||
/*!
|
||||
* @pred load_mega_clause( +Stream ) is detail
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
/**
|
||||
@defgroup Deb_Interaction Interacting with the debugger
|
||||
@{
|
||||
@ingroup YAPProgramming
|
||||
|
||||
Debugging with YAP is similar to debugging with C-Prolog. Both systems
|
||||
@ -237,6 +238,8 @@ be lost.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
|
||||
spy
|
||||
|
@ -18,6 +18,7 @@
|
||||
/**
|
||||
|
||||
@defgroup DepthLimited Depth Limited Search
|
||||
@{
|
||||
@ingroup extensions
|
||||
|
||||
YAP implements various extensions to the default Prolog search. One of
|
||||
@ -27,9 +28,12 @@ the most iseful s restricting the maximum search depth.
|
||||
:-
|
||||
system_module( '$_depth_bound', [depth_bound_call/2], []).
|
||||
|
||||
%depth_bound_call(A,D) :-
|
||||
%write(depth_bound_call(A,D)), nl, fail.
|
||||
%% @pred depth_bound_call(A,D)
|
||||
%
|
||||
% CallError _A_ with maximum stack_el depth_reduction _B_.
|
||||
%
|
||||
depth_bound_call(A,D) :-
|
||||
'$execute_under_depth_limit'(A,D).
|
||||
|
||||
|
||||
%% @}
|
||||
|
@ -23,6 +23,7 @@
|
||||
*
|
||||
* @brief Extended Abstract Machine
|
||||
* @defgroup EAM Extended Abstract Machine
|
||||
* @{
|
||||
* @ingroup extensions
|
||||
*
|
||||
*
|
||||
@ -54,3 +55,5 @@ eamconsult(File):- eam, eam, %fails if eam is disable
|
||||
assert((user:term_expansion((A :- B),(A :- C)):- eamtrans(B,C))),
|
||||
eam, ( consult(File) ; true), eam,
|
||||
abolish(user:term_expansion,2).
|
||||
|
||||
%% @}
|
||||
|
@ -32,6 +32,7 @@
|
||||
code_location/3]).
|
||||
|
||||
/**
|
||||
* @namespace yap_hacks
|
||||
*
|
||||
* @defgroup Hacks Low-level access
|
||||
* @ingroup builtins
|
||||
|
@ -25,26 +25,26 @@
|
||||
*/
|
||||
|
||||
|
||||
:- system_module( '$_listing', [listing/0,
|
||||
/*:- system_module( '$_listing', [listing/0,
|
||||
listing/1,
|
||||
portray_clause/1,
|
||||
portray_clause/2], []).
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup Listing List predicates in a module
|
||||
* @{
|
||||
* @defgroup listingGroup List predicates in a module
|
||||
*
|
||||
* @ingroup builtins
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
:- use_system_module( '$_errors', ['$do_error'/2]).
|
||||
|
||||
:- use_system_module( '$_preds', ['$clause'/4,
|
||||
'$current_predicate'/4]).
|
||||
|
||||
/* listing : Listing clauses in the database
|
||||
|
||||
/** @brief listing : Listing clauses in the database
|
||||
*
|
||||
*/
|
||||
|
||||
/** @pred listing
|
||||
@ -347,3 +347,5 @@ portray_clause(Clause) :-
|
||||
'$list_transform'(L,M).
|
||||
'$list_transform'([_|L],M) :-
|
||||
'$list_transform'(L,M).
|
||||
|
||||
%% @}
|
||||
|
Reference in New Issue
Block a user