Merge ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap
This commit is contained in:
commit
8196666cdc
1
C/init.c
1
C/init.c
@ -984,6 +984,7 @@ void Yap_InitCPredBack_(const char *Name, arity_t Arity, arity_t Extra,
|
|||||||
|
|
||||||
static void InitStdPreds(struct yap_boot_params *yapi)
|
static void InitStdPreds(struct yap_boot_params *yapi)
|
||||||
{
|
{
|
||||||
|
CurrentModule = PROLOG_MODULE;
|
||||||
Yap_InitCPreds();
|
Yap_InitCPreds();
|
||||||
Yap_InitBackCPreds();
|
Yap_InitBackCPreds();
|
||||||
BACKUP_MACHINE_REGS();
|
BACKUP_MACHINE_REGS();
|
||||||
|
2
C/text.c
2
C/text.c
@ -557,11 +557,9 @@ unsigned char *Yap_readText(seq_tv_t *inp USES_REGS) {
|
|||||||
POPRET( (char*)latin2utf8(inp));
|
POPRET( (char*)latin2utf8(inp));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inp->enc == ENC_ISO_UTF8) {
|
|
||||||
pop_text_stack(lvl);
|
pop_text_stack(lvl);
|
||||||
return inp->val.c;
|
return inp->val.c;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (inp->type & YAP_STRING_WCHARS) {
|
if (inp->type & YAP_STRING_WCHARS) {
|
||||||
// printf("%S\n",inp->val.w);
|
// printf("%S\n",inp->val.w);
|
||||||
POPRET( (char *)wchar2utf8(inp) );
|
POPRET( (char *)wchar2utf8(inp) );
|
||||||
|
67
CXX/yapi.cpp
67
CXX/yapi.cpp
@ -125,6 +125,7 @@ YAPAtomTerm::YAPAtomTerm(char s[]) { // build string
|
|||||||
|
|
||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
seq_tv_t inp, out;
|
seq_tv_t inp, out;
|
||||||
|
inp.enc = LOCAL_encoding;
|
||||||
inp.val.c = s;
|
inp.val.c = s;
|
||||||
inp.type = YAP_STRING_CHARS;
|
inp.type = YAP_STRING_CHARS;
|
||||||
out.type = YAP_STRING_ATOM;
|
out.type = YAP_STRING_ATOM;
|
||||||
@ -142,6 +143,7 @@ YAPAtomTerm::YAPAtomTerm(char *s, size_t len) { // build string
|
|||||||
seq_tv_t inp, out;
|
seq_tv_t inp, out;
|
||||||
inp.val.c = s;
|
inp.val.c = s;
|
||||||
inp.type = YAP_STRING_CHARS;
|
inp.type = YAP_STRING_CHARS;
|
||||||
|
inp.enc = LOCAL_encoding;
|
||||||
out.type = YAP_STRING_ATOM | YAP_STRING_NCHARS | YAP_STRING_TRUNC;
|
out.type = YAP_STRING_ATOM | YAP_STRING_NCHARS | YAP_STRING_TRUNC;
|
||||||
out.max = len;
|
out.max = len;
|
||||||
if (Yap_CVT_Text(&inp, &out PASS_REGS))
|
if (Yap_CVT_Text(&inp, &out PASS_REGS))
|
||||||
@ -253,7 +255,19 @@ YAPApplTerm::YAPApplTerm(YAPFunctor f, YAPTerm ts[]) {
|
|||||||
RECOVER_H();
|
RECOVER_H();
|
||||||
}
|
}
|
||||||
|
|
||||||
YAPApplTerm::YAPApplTerm(std::string f, std::vector<YAPTerm> ts) {
|
YAPApplTerm::YAPApplTerm(const std::string f, std::vector<Term> ts) {
|
||||||
|
BACKUP_H();
|
||||||
|
arity_t arity = ts.size();
|
||||||
|
Functor ff = Yap_MkFunctor(Yap_LookupAtom(f.c_str()), arity);
|
||||||
|
Term o = Yap_MkNewApplTerm(ff, arity);
|
||||||
|
Term *tt = RepAppl(o) + 1;
|
||||||
|
for (arity_t i = 0; i < arity; i++)
|
||||||
|
tt[i] = ts[i];
|
||||||
|
mk(o);
|
||||||
|
RECOVER_H();
|
||||||
|
}
|
||||||
|
|
||||||
|
YAPApplTerm::YAPApplTerm(const std::string f, std::vector<YAPTerm> ts) {
|
||||||
BACKUP_H();
|
BACKUP_H();
|
||||||
arity_t arity = ts.size();
|
arity_t arity = ts.size();
|
||||||
Functor ff = Yap_MkFunctor(Yap_LookupAtom(f.c_str()), arity);
|
Functor ff = Yap_MkFunctor(Yap_LookupAtom(f.c_str()), arity);
|
||||||
@ -262,6 +276,57 @@ YAPApplTerm::YAPApplTerm(std::string f, std::vector<YAPTerm> ts) {
|
|||||||
for (arity_t i = 0; i < arity; i++)
|
for (arity_t i = 0; i < arity; i++)
|
||||||
tt[i] = ts[i].term();
|
tt[i] = ts[i].term();
|
||||||
mk(o);
|
mk(o);
|
||||||
|
RECOVER_H();
|
||||||
|
}
|
||||||
|
|
||||||
|
YAPApplTerm::YAPApplTerm(const std::string f, YAPTerm a1) {
|
||||||
|
BACKUP_H();
|
||||||
|
arity_t arity = 1;
|
||||||
|
Functor ff = Yap_MkFunctor(Yap_LookupAtom(f.c_str()), arity);
|
||||||
|
Term o = Yap_MkNewApplTerm(ff, arity);
|
||||||
|
Term *tt = RepAppl(o) + 1;
|
||||||
|
tt[0] = a1.term();
|
||||||
|
mk(o);
|
||||||
|
RECOVER_H();
|
||||||
|
}
|
||||||
|
|
||||||
|
YAPApplTerm::YAPApplTerm(const std::string f, YAPTerm a1, YAPTerm a2) {
|
||||||
|
BACKUP_H();
|
||||||
|
arity_t arity = 2;
|
||||||
|
Functor ff = Yap_MkFunctor(Yap_LookupAtom(f.c_str()), arity);
|
||||||
|
Term o = Yap_MkNewApplTerm(ff, arity);
|
||||||
|
Term *tt = RepAppl(o) + 1;
|
||||||
|
tt[0] = a1.term();
|
||||||
|
tt[1] = a2.term();
|
||||||
|
mk(o);
|
||||||
|
RECOVER_H();
|
||||||
|
}
|
||||||
|
|
||||||
|
YAPApplTerm::YAPApplTerm(const std::string f, YAPTerm a1, YAPTerm a2, YAPTerm a3) {
|
||||||
|
BACKUP_H();
|
||||||
|
arity_t arity = 3;
|
||||||
|
Functor ff = Yap_MkFunctor(Yap_LookupAtom(f.c_str()), arity);
|
||||||
|
Term o = Yap_MkNewApplTerm(ff, arity);
|
||||||
|
Term *tt = RepAppl(o) + 1;
|
||||||
|
tt[0] = a1.term();
|
||||||
|
tt[2] = a2.term();
|
||||||
|
tt[3] = a3.term();
|
||||||
|
mk(o);
|
||||||
|
RECOVER_H();
|
||||||
|
}
|
||||||
|
|
||||||
|
YAPApplTerm::YAPApplTerm(const std::string f, YAPTerm a1, YAPTerm a2, YAPTerm a3, YAPTerm a4) {
|
||||||
|
BACKUP_H();
|
||||||
|
arity_t arity = 4;
|
||||||
|
Functor ff = Yap_MkFunctor(Yap_LookupAtom(f.c_str()), arity);
|
||||||
|
Term o = Yap_MkNewApplTerm(ff, arity);
|
||||||
|
Term *tt = RepAppl(o) + 1;
|
||||||
|
tt[0] = a1.term();
|
||||||
|
tt[2] = a2.term();
|
||||||
|
tt[3] = a3.term();
|
||||||
|
tt[4] = a4.term();
|
||||||
|
mk(o);
|
||||||
|
RECOVER_H();
|
||||||
}
|
}
|
||||||
|
|
||||||
YAPApplTerm::YAPApplTerm(YAPFunctor f) : YAPTerm() {
|
YAPApplTerm::YAPApplTerm(YAPFunctor f) : YAPTerm() {
|
||||||
|
@ -307,10 +307,15 @@ public:
|
|||||||
mk(Yap_MkNewApplTerm(Yap_MkFunctor(Yap_LookupAtom(s.c_str()), arity),
|
mk(Yap_MkNewApplTerm(Yap_MkFunctor(Yap_LookupAtom(s.c_str()), arity),
|
||||||
arity));
|
arity));
|
||||||
};
|
};
|
||||||
|
YAPApplTerm(const std::string s, std::vector<Term> ts);
|
||||||
YAPApplTerm(const std::string s, std::vector<YAPTerm> ts);
|
YAPApplTerm(const std::string s, std::vector<YAPTerm> ts);
|
||||||
YAPApplTerm(YAPFunctor f);
|
YAPApplTerm(YAPFunctor f);
|
||||||
inline Functor functor() { return FunctorOfTerm(gt()); }
|
inline Functor functor() { return FunctorOfTerm(gt()); }
|
||||||
inline YAPFunctor getFunctor() { return YAPFunctor(FunctorOfTerm(gt())); }
|
inline YAPFunctor getFunctor() { return YAPFunctor(FunctorOfTerm(gt())); }
|
||||||
|
YAPApplTerm(const std::string f, YAPTerm a1);
|
||||||
|
YAPApplTerm(const std::string f, YAPTerm a1, YAPTerm a2);
|
||||||
|
YAPApplTerm(const std::string f, YAPTerm a1, YAPTerm a2, YAPTerm a3);
|
||||||
|
YAPApplTerm(const std::string f, YAPTerm a1, YAPTerm a2, YAPTerm a3, YAPTerm a4);
|
||||||
|
|
||||||
Term getArg(arity_t i) {
|
Term getArg(arity_t i) {
|
||||||
BACKUP_MACHINE_REGS();
|
BACKUP_MACHINE_REGS();
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
site_name: 'YAP'
|
site_name: 'YAP'
|
||||||
theme: 'readthedocs'
|
theme: 'readthedocs'
|
||||||
markdown_extensions:
|
markdown_extensions:
|
||||||
|
- smarty
|
||||||
|
- toc:
|
||||||
|
permalink: True
|
||||||
|
- sane_lists
|
||||||
use_directory_urls: false
|
use_directory_urls: false
|
||||||
plugins:
|
plugins:
|
||||||
- search
|
- search
|
||||||
|
@ -835,11 +835,6 @@ static parser_state_t initParser(Term opts, FEnv *fe, REnv *re, int inp_stream,
|
|||||||
LOCAL_ErrorMessage = NULL;
|
LOCAL_ErrorMessage = NULL;
|
||||||
fe->old_TR = TR;
|
fe->old_TR = TR;
|
||||||
LOCAL_Error_TYPE = YAP_NO_ERROR;
|
LOCAL_Error_TYPE = YAP_NO_ERROR;
|
||||||
__android_log_print(ANDROID_LOG_INFO, "YAPDroid ", " open %s, %d",
|
|
||||||
CurrentModule == 0
|
|
||||||
? "prolog"
|
|
||||||
: RepAtom(AtomOfTerm(CurrentModule))->StrOfAE,
|
|
||||||
inp_stream);
|
|
||||||
LOCAL_SourceFileName = GLOBAL_Stream[inp_stream].name;
|
LOCAL_SourceFileName = GLOBAL_Stream[inp_stream].name;
|
||||||
LOCAL_eot_before_eof = false;
|
LOCAL_eot_before_eof = false;
|
||||||
fe->tpos = StreamPosition(inp_stream);
|
fe->tpos = StreamPosition(inp_stream);
|
||||||
|
@ -1551,11 +1551,7 @@ FILE *Yap_FileDescriptorFromStream(Term t) {
|
|||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void Yap_InitBackIO(void)
|
||||||
|
|
||||||
Yap_InitBackIO (
|
|
||||||
|
|
||||||
void)
|
|
||||||
{
|
{
|
||||||
Yap_InitCPredBack("stream_property", 2, 2, stream_property,
|
Yap_InitCPredBack("stream_property", 2, 2, stream_property,
|
||||||
cont_stream_property, SafePredFlag | SyncPredFlag);
|
cont_stream_property, SafePredFlag | SyncPredFlag);
|
||||||
|
@ -15,12 +15,15 @@
|
|||||||
* *
|
* *
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
#include "Yap.h"
|
#include "Yap.h"
|
||||||
#ifdef USE_MYDDAS
|
|
||||||
|
|
||||||
#include "Yatom.h"
|
#include "Yatom.h"
|
||||||
#include "cut_c.h"
|
|
||||||
#include "myddas.h"
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef USE_MYDDAS
|
||||||
|
|
||||||
|
#include "myddas.h"
|
||||||
|
|
||||||
#ifdef MYDDAS_STATS
|
#ifdef MYDDAS_STATS
|
||||||
#include "myddas_statistics.h"
|
#include "myddas_statistics.h"
|
||||||
#endif
|
#endif
|
||||||
@ -678,30 +681,17 @@ void Yap_MYDDAS_delete_all_myddas_structs(void) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
void init_myddas(void) {
|
void init_myddas(void) {
|
||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
|
if (myddas_initialised)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#if USE_MYDDAS
|
||||||
Term cm=CurrentModule;
|
Term cm=CurrentModule;
|
||||||
CurrentModule = USER_MODULE;
|
CurrentModule = USER_MODULE;
|
||||||
if (myddas_initialised)
|
|
||||||
return;
|
|
||||||
#ifdef __ANDROID__
|
|
||||||
init_sqlite3();
|
|
||||||
#endif
|
|
||||||
#if defined MYDDAS_ODBC
|
|
||||||
Yap_InitBackMYDDAS_ODBCPreds();
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#if defined MYDDAS_ODBC
|
|
||||||
Yap_InitMYDDAS_ODBCPreds();
|
|
||||||
#endif
|
|
||||||
#if defined USE_MYDDAS
|
|
||||||
Yap_InitMYDDAS_SharedPreds();
|
|
||||||
#endif
|
|
||||||
#if defined MYDDAS_TOP_LEVEL && \
|
|
||||||
defined MYDDAS_MYSQL // && defined HAVE_LIBREADLINE
|
|
||||||
Yap_InitMYDDAS_TopLevelPreds();
|
|
||||||
#endif
|
|
||||||
#if USE_MYDDAS
|
|
||||||
#define stringify(X) _stringify(X)
|
#define stringify(X) _stringify(X)
|
||||||
#define _stringify(X) #X
|
#define _stringify(X) #X
|
||||||
Yap_REGS.MYDDAS_GLOBAL_POINTER = NULL;
|
Yap_REGS.MYDDAS_GLOBAL_POINTER = NULL;
|
||||||
@ -709,12 +699,25 @@ void init_myddas(void) {
|
|||||||
MkAtomTerm(Yap_LookupAtom(stringify(MYDDAS_VERSION))));
|
MkAtomTerm(Yap_LookupAtom(stringify(MYDDAS_VERSION))));
|
||||||
Yap_HaltRegisterHook((HaltHookFunc)Yap_MYDDAS_delete_all_myddas_structs,
|
Yap_HaltRegisterHook((HaltHookFunc)Yap_MYDDAS_delete_all_myddas_structs,
|
||||||
NULL);
|
NULL);
|
||||||
|
Yap_InitMYDDAS_SharedPreds();
|
||||||
|
Yap_InitBackMYDDAS_SharedPreds();
|
||||||
#undef stringify
|
#undef stringify
|
||||||
#undef _stringify
|
#undef _stringify
|
||||||
Yap_MYDDAS_delete_all_myddas_structs();
|
Yap_MYDDAS_delete_all_myddas_structs();
|
||||||
|
#if defined MYDDAS_ODBC
|
||||||
|
Yap_InitBackMYDDAS_ODBCPreds();
|
||||||
|
Yap_InitMYDDAS_ODBCPreds();
|
||||||
|
#endif
|
||||||
|
#if defined MYDDAS_TOP_LEVEL && \
|
||||||
|
defined MYDDAS_MYSQL // && defined HAVE_LIBREADLINE
|
||||||
|
Yap_InitMYDDAS_TopLevelPreds();
|
||||||
#endif
|
#endif
|
||||||
c_db_initialize_myddas(PASS_REGS1);
|
c_db_initialize_myddas(PASS_REGS1);
|
||||||
myddas_initialised = TRUE;
|
#ifdef __ANDROID__
|
||||||
|
init_sqlite3();
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
myddas_initialised = true;
|
||||||
CurrentModule = cm;
|
CurrentModule = cm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
:- yap_flag(single_var_warnings,on).
|
:- yap_flag(single_var_warnings,on).
|
||||||
|
:- yap_flag(write_strings,on).
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SWITCH(Contype, G) \
|
#define SWITCH(Contype, G) \
|
||||||
@ -181,7 +182,7 @@
|
|||||||
member/2
|
member/2
|
||||||
]).
|
]).
|
||||||
|
|
||||||
:- set(verbose,silent).
|
:- set_prolog_flag(verbose,silent).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -331,7 +332,7 @@ db_stats(Protocol,List):-
|
|||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
% db_stats_time(+,-)
|
% db_stats_time(+,-)
|
||||||
% Reference is C pointer (memory reference)
|
% Reference is C puuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uuuuu;ointer (memory reference)
|
||||||
%
|
%
|
||||||
db_stats_time(Reference,Time):-
|
db_stats_time(Reference,Time):-
|
||||||
'$error_checks'(db_stats_time(Reference,Time)),
|
'$error_checks'(db_stats_time(Reference,Time)),
|
||||||
@ -449,7 +450,6 @@ db_assert(Connection,PredName):-
|
|||||||
'$error_checks'(db_insert2(Connection,PredName,Code)),
|
'$error_checks'(db_insert2(Connection,PredName,Code)),
|
||||||
'$get_values_for_insert'(Code,ValuesList,RelName),
|
'$get_values_for_insert'(Code,ValuesList,RelName),
|
||||||
'$make_atom'(['INSERT INTO `',RelName,'` VALUES '|ValuesList],SQL),
|
'$make_atom'(['INSERT INTO `',RelName,'` VALUES '|ValuesList],SQL),
|
||||||
|
|
||||||
get_value(Connection,Con),
|
get_value(Connection,Con),
|
||||||
c_db_connection_type(Con,ConType),
|
c_db_connection_type(Con,ConType),
|
||||||
'$write_or_not'(SQL),
|
'$write_or_not'(SQL),
|
||||||
@ -685,17 +685,18 @@ db_describe(Connection,Y,Z) :-
|
|||||||
|
|
||||||
db_datalog_show_tables :-
|
db_datalog_show_tables :-
|
||||||
db_datalog_show_tables(myddas).
|
db_datalog_show_tables(myddas).
|
||||||
|
db_show_tables :-
|
||||||
|
'$error_checks'(db_datalog_show_tables),
|
||||||
|
get_value(myddas,Con),
|
||||||
|
c_db_connection_type(Con,DBMS),
|
||||||
|
DBMS:datalog_show_tables.
|
||||||
|
|
||||||
db_datalog_show_tables(Connection) :-
|
db_datalog_show_tables(Connection) :-
|
||||||
'$error_checks'(db_datalog_show_tables(Connection) ),
|
'$error_checks'(db_datalog_show_tables(Connection) ),
|
||||||
get_value(Connection,Con),
|
get_value(Connection,Con),
|
||||||
c_db_connection_type(Con,DBMS),
|
c_db_connection_type(Con,DBMS),
|
||||||
switch( DBMS, datalog_show_tables(Connection) ).
|
switch( DBMS, datalog_show_tables(Connection) ).
|
||||||
|
|
||||||
db_datalog_show_tables :-
|
|
||||||
'$error_checks'(db_datalog_show_tables),
|
|
||||||
get_value(myddas,Con),
|
|
||||||
c_db_connection_type(Con,DBMS),
|
|
||||||
DBMS:datalog_show_tables.
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@pred db_show_tables(+,?).
|
@pred db_show_tables(+,?).
|
||||||
|
@ -230,7 +230,7 @@ db_abolish(PredName,Arity):-
|
|||||||
%
|
%
|
||||||
db_listing:-
|
db_listing:-
|
||||||
c_db_connection(Con),
|
c_db_connection(Con),
|
||||||
c_db_preds_conn(Con,Module,Name,Arity),
|
user:c_db_preds_conn(Con,Module,Name,Arity),
|
||||||
listing(Module:Name/Arity),
|
listing(Module:Name/Arity),
|
||||||
fail.
|
fail.
|
||||||
db_listing.
|
db_listing.
|
||||||
@ -243,15 +243,15 @@ db_listing.
|
|||||||
%
|
%
|
||||||
db_listing(Module:Name/Arity):-!,
|
db_listing(Module:Name/Arity):-!,
|
||||||
c_db_connection(Con),
|
c_db_connection(Con),
|
||||||
c_db_preds_conn(Con,Module,Name,Arity),
|
user:c_db_preds_conn(Con,Module,Name,Arity),
|
||||||
listing(Module:Name/Arity).
|
listing(Module:Name/Arity).
|
||||||
db_listing(Name/Arity):-!,
|
db_listing(Name/Arity):-!,
|
||||||
c_db_connection(Con),
|
c_db_connection(Con),
|
||||||
c_db_preds_conn(Con,Module,Name,Arity),
|
user:c_db_preds_conn(Con,Module,Name,Arity),
|
||||||
listing(Module:Name/Arity).
|
listing(Module:Name/Arity).
|
||||||
db_listing(Name):-
|
db_listing(Name):-
|
||||||
c_db_connection(Con),
|
c_db_connection(Con),
|
||||||
c_db_preds_conn(Con,Module,Name,Arity),
|
user:c_db_preds_conn(Con,Module,Name,Arity),
|
||||||
listing(Module:Name/Arity).
|
listing(Module:Name/Arity).
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
@ -260,13 +260,12 @@ db_listing(Name):-
|
|||||||
%
|
%
|
||||||
table_arity( Con, ConType, RelationName, Arity ) :-
|
table_arity( Con, ConType, RelationName, Arity ) :-
|
||||||
c_db_connection_type(Con,ConType),
|
c_db_connection_type(Con,ConType),
|
||||||
writeln( ConType ),
|
|
||||||
% get relation arity
|
% get relation arity
|
||||||
( ConType == mysql ->
|
( ConType == mysql ->
|
||||||
c_db_my_number_of_fields(RelationName,Con,Arity)
|
c_db_my_number_of_fields(RelationName,Con,Arity)
|
||||||
;
|
;
|
||||||
ConType == postgres ->
|
ConType == postgres ->
|
||||||
c_postgres_number_of_fields(RelationName,Con,Arity)
|
c_postgres_number_of_fields(RelationName,Con,Arit)
|
||||||
;
|
;
|
||||||
ConType == odbc ->
|
ConType == odbc ->
|
||||||
c_odbc_number_of_fields(RelationName,Con,Arity)
|
c_odbc_number_of_fields(RelationName,Con,Arity)
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#define NAME() 'YAPodbc'
|
#define NAME() 'YAPodbc'
|
||||||
#define MODULE() user
|
#define MODULE() user
|
||||||
#define INIT() init_odbc
|
#define INIT() init_odbc
|
||||||
#elif defined( postgres )
|
#elif defined( postrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrs )
|
||||||
#undef postgres
|
#undef postgres
|
||||||
#define DBMS(x) postgres_##x
|
#define DBMS(x) postgres_##x
|
||||||
#define c_DBMS(x) c_postgres_##x
|
#define c_DBMS(x) c_postgres_##x
|
||||||
@ -101,7 +101,6 @@ DBMS(result_set)(store_result):-
|
|||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
% DBMS(db_datalog_describe)/2
|
% DBMS(db_datalog_describe)/2
|
||||||
%
|
%
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
:- stop_low_level_trace.
|
|
||||||
|
|
||||||
|
|
||||||
:- use_module(library(lists)).
|
:- use_module(library(lists)).
|
||||||
@ -14,10 +13,22 @@ main_ :-
|
|||||||
fail.
|
fail.
|
||||||
main_ .
|
main_ .
|
||||||
|
|
||||||
|
:- if( yap_flag(android,true) ).
|
||||||
|
init :-
|
||||||
|
db_open(sqlite3, '/data/user/0/pt.up.yap/files/chinook.db', _, _),
|
||||||
|
!,
|
||||||
|
writeln('chinook has landed').
|
||||||
|
|
||||||
|
init :-
|
||||||
|
catch(db_open(sqlite3,'chinook.db',_,_), _, fail),
|
||||||
|
% db_open(sqlite3, 'chinook.db', _, _),
|
||||||
|
writeln('chinook has landed').
|
||||||
|
:- else.
|
||||||
init :-
|
init :-
|
||||||
db_open(sqlite3, '/data/user/0/pt.up.yap.yapdroid/files/Yap/chinook.db', _, _),
|
db_open(sqlite3, '/data/user/0/pt.up.yap.yapdroid/files/Yap/chinook.db', _, _),
|
||||||
% db_open(sqlite3, 'chinook.db', _, _),
|
% db_open(sqlite3, 'chinook.db', _, _),
|
||||||
writeln('chinook has landed').
|
writeln('chinook has landed').
|
||||||
|
:-endif.
|
||||||
|
|
||||||
go :-
|
go :-
|
||||||
writeln(('db_import')),
|
writeln(('db_import')),
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
#define PASS_REGS
|
#define PASS_REGS
|
||||||
#define USES_REGS
|
#define USES_REGS
|
||||||
|
|
||||||
|
#include "Yap.h"
|
||||||
|
|
||||||
//@{
|
//@{
|
||||||
|
|
||||||
/** @brief Prolog to Python library
|
/** @brief Prolog to Python library
|
||||||
|
@ -591,7 +591,7 @@ static int python_import(term_t mname, term_t mod) {
|
|||||||
const char *sn, *as = NULL;
|
const char *sn, *as = NULL;
|
||||||
Term t = Deref(ARG1), sm;
|
Term t = Deref(ARG1), sm;
|
||||||
if (IsApplTerm(t)) {
|
if (IsApplTerm(t)) {
|
||||||
Functor f = FunctorOfTerm(t);
|
Functor f = (Functor)*RepAppl(t);
|
||||||
if (f != FunctorAs)
|
if (f != FunctorAs)
|
||||||
return false;
|
return false;
|
||||||
do_as = true;
|
do_as = true;
|
||||||
|
@ -54,7 +54,6 @@ endif()
|
|||||||
COMMAND ${SWIG_EXECUTABLE} -c++ -python -O -py3 -module "yap" -addextern -I${CMAKE_SOURCE_DIR}/H -I${CMAKE_SOURCE_DIR}/H/generated -I${CMAKE_SOURCE_DIR}/include
|
COMMAND ${SWIG_EXECUTABLE} -c++ -python -O -py3 -module "yap" -addextern -I${CMAKE_SOURCE_DIR}/H -I${CMAKE_SOURCE_DIR}/H/generated -I${CMAKE_SOURCE_DIR}/include
|
||||||
-I${CMAKE_SOURCE_DIR}/OPTYap -I${CMAKE_SOURCE_DIR}/os -I${CMAKE_SOURCE_DIR}/utf8proc -I.././.. -I${CMAKE_SOURCE_DIR}/CXX -I${CMAKE_SOURCE_DIR}/packages/python
|
-I${CMAKE_SOURCE_DIR}/OPTYap -I${CMAKE_SOURCE_DIR}/os -I${CMAKE_SOURCE_DIR}/utf8proc -I.././.. -I${CMAKE_SOURCE_DIR}/CXX -I${CMAKE_SOURCE_DIR}/packages/python
|
||||||
-outdir ${CMAKE_CURRENT_BINARY_DIR}/yap4py -I${GMP_INCLUDE_DIRS} -DX_API="" -o ${CMAKE_CURRENT_BINARY_DIR}/yap4py/yap_wrap.cxx -oh ${CMAKE_CURRENT_BINARY_DIR}/yap4py/yap_wrap.hh ${SWIG_SOURCES}
|
-outdir ${CMAKE_CURRENT_BINARY_DIR}/yap4py -I${GMP_INCLUDE_DIRS} -DX_API="" -o ${CMAKE_CURRENT_BINARY_DIR}/yap4py/yap_wrap.cxx -oh ${CMAKE_CURRENT_BINARY_DIR}/yap4py/yap_wrap.hh ${SWIG_SOURCES}
|
||||||
COMMAND ${PYTHON_EXECUTABLE} setup.py sdist ${bdist}
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
DEPENDS ${SWIG_SOURCES} Py4YAP YAP++ yap4py/yapi.cpp YAP4PY_PY
|
DEPENDS ${SWIG_SOURCES} Py4YAP YAP++ yap4py/yapi.cpp YAP4PY_PY
|
||||||
)
|
)
|
||||||
@ -70,7 +69,9 @@ endif()
|
|||||||
DEPENDS ${PYTHON_SOURCES}
|
DEPENDS ${PYTHON_SOURCES}
|
||||||
)
|
)
|
||||||
|
|
||||||
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pip install ${PYTHON_USER_INSTALL} --ignore-installed .
|
install(CODE "execute_process(
|
||||||
|
COMMAND ${PYTHON_EXECUTABLE} setup.py sdist ${bdist}
|
||||||
|
COMMAND ${PYTHON_EXECUTABLE} -m pip install ${PYTHON_USER_INSTALL} --ignore-installed .
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})"
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})"
|
||||||
DEPENDS Py4YAP ${CMAKE_BINARY_DIR}/${YAP_STARTUP} ${YAP_INSTALL_DLLDIR} )
|
DEPENDS Py4YAP ${CMAKE_BINARY_DIR}/${YAP_STARTUP} ${YAP_INSTALL_DLLDIR} )
|
||||||
|
|
||||||
|
@ -84,8 +84,8 @@ native_sources = ["yap4py/yap_wrap.cxx","yap4py/yapi.cpp"]
|
|||||||
|
|
||||||
|
|
||||||
extensions = [Extension('_yap', native_sources,
|
extensions = [Extension('_yap', native_sources,
|
||||||
define_macros=[('MAJOR_VERSION', '1'),
|
define_macros=[('MAJOR_VERSION', '@YAP_MAJOR_VERSION@'),
|
||||||
('MINOR_VERSION', '0'),
|
('MINOR_VERSION', '@YAP_MINOR_VERSION@'),
|
||||||
('_YAP_NOT_INSTALLED_', '1'),
|
('_YAP_NOT_INSTALLED_', '1'),
|
||||||
('YAP_PYTHON', '1'),
|
('YAP_PYTHON', '1'),
|
||||||
('PYTHONSWIG', '1'),
|
('PYTHONSWIG', '1'),
|
||||||
@ -104,7 +104,7 @@ extensions = [Extension('_yap', native_sources,
|
|||||||
'${CMAKE_SOURCE_DIR}/os',
|
'${CMAKE_SOURCE_DIR}/os',
|
||||||
'${CMAKE_SOURCE_DIR}/utf8proc',
|
'${CMAKE_SOURCE_DIR}/utf8proc',
|
||||||
'${CMAKE_SOURCE_DIR}/packages/python',
|
'${CMAKE_SOURCE_DIR}/packages/python',
|
||||||
'../../..',
|
'${CMAKE_BINARY_DIR}',
|
||||||
'${CMAKE_SOURCE_DIR}/CXX' ]
|
'${CMAKE_SOURCE_DIR}/CXX' ]
|
||||||
)]
|
)]
|
||||||
|
|
||||||
|
@ -185,7 +185,6 @@ yap_ipython/sphinxext/ipython_console_highlighting.py
|
|||||||
yap_ipython/sphinxext/ipython_directive.py
|
yap_ipython/sphinxext/ipython_directive.py
|
||||||
yap_ipython/nbformat.py
|
yap_ipython/nbformat.py
|
||||||
yap_ipython/paths.py
|
yap_ipython/paths.py
|
||||||
yap_ipython/_version.py
|
|
||||||
yap_ipython/nbconvert.py
|
yap_ipython/nbconvert.py
|
||||||
yap_ipython/qt.py
|
yap_ipython/qt.py
|
||||||
yap_ipython/html.py
|
yap_ipython/html.py
|
||||||
@ -413,23 +412,12 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/kerne
|
|||||||
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/kernel.js
|
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/kernel.js
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/meta.js
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/misc/editors/meta.js ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/
|
|
||||||
DEPENDS ${CMAKE_SOURCE_DIR}/misc/editors/meta.js
|
|
||||||
)
|
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/prolog.js
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/prolog.js
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/misc/editors/yap.js ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/prolog.js
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/misc/editors/yap.js ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/prolog.js
|
||||||
DEPENDS ${CMAKE_SOURCE_DIR}/misc/editors/yap.js
|
DEPENDS ${CMAKE_SOURCE_DIR}/misc/editors/yap.js
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/mode.js
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/misc/editors/mode.js ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/
|
|
||||||
DEPENDS ${CMAKE_SOURCE_DIR}/misc/editors/mode.js
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
foreach(f ${FILES})
|
foreach(f ${FILES})
|
||||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${f}
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${f}
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${f} ${CMAKE_CURRENT_BINARY_DIR}/${f}
|
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/${f} ${CMAKE_CURRENT_BINARY_DIR}/${f}
|
||||||
@ -441,13 +429,13 @@ endforeach()
|
|||||||
|
|
||||||
|
|
||||||
add_custom_target(YAP_KERNEL ALL
|
add_custom_target(YAP_KERNEL ALL
|
||||||
COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} build sdist bdist
|
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/logo-32x32.png ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/logo-64x64.png ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/kernel.js ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/meta.js ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/prolog.js ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/mode.js ${OUTS} YAP4PY
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/logo-32x32.png ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/logo-64x64.png ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/kernel.js ${CMAKE_CURRENT_BINARY_DIR}/yap_kernel/resources/prolog.js ${OUTS} YAP4PY
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
install(CODE "execute_process(
|
install(CODE "execute_process(
|
||||||
|
COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} build sdist bdist
|
||||||
COMMAND ${PYTHON_EXECUTABLE} -m pip install ${PYTHON_USER_INSTALL} --ignore-installed --no-deps .
|
COMMAND ${PYTHON_EXECUTABLE} -m pip install ${PYTHON_USER_INSTALL} --ignore-installed --no-deps .
|
||||||
COMMAND ${PYTHON_EXECUTABLE} -m yap_kernel.kernelspec
|
COMMAND ${PYTHON_EXECUTABLE} -m yap_kernel.kernelspec
|
||||||
ERROR_VARIABLE setupErr
|
ERROR_VARIABLE setupErr
|
||||||
|
@ -36,12 +36,12 @@ DEPENDS pllibpl ${pl_os_library}
|
|||||||
)
|
)
|
||||||
|
|
||||||
add_custom_command (OUTPUT ${CMAKE_SWIG_OUTPUT}/swig_streamer.cpp
|
add_custom_command (OUTPUT ${CMAKE_SWIG_OUTPUT}/swig_streamer.cpp
|
||||||
COMMAND ${SWIG_EXECUTABLE} -c++ -java -package ${SWIG_MODULE_NAME} -outdir ${CMAKE_SWIG_OUTDIR} -addextern -I${CMAKE_CURRENT_SOURCE_DIR} -o ${CMAKE_SWIG_OUTPUT}/swig_streamer.cpp -oh ${CMAKE_SWIG_OUTPUT}/swig_streamer.hh streamer.i
|
COMMAND ${SWIG_EXECUTABLE} -c++ -java -package ${SWIG_MODULE_NAME} -O -outdir ${CMAKE_SWIG_OUTDIR} -addextern -I${CMAKE_CURRENT_SOURCE_DIR} -o ${CMAKE_SWIG_OUTPUT}/swig_streamer.cpp -oh ${CMAKE_SWIG_OUTPUT}/swig_streamer.hh streamer.i
|
||||||
DEPENDS streamer.i
|
DEPENDS streamer.i
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_command (OUTPUT ${CMAKE_SWIG_OUTPUT}/yap_swig.cpp
|
add_custom_command (OUTPUT ${CMAKE_SWIG_OUTPUT}/yap_swig.cpp
|
||||||
COMMAND ${SWIG_EXECUTABLE} -c++ -java -package ${SWIG_MODULE_NAME} -outdir ${CMAKE_SWIG_OUTDIR} -addextern -I${CMAKE_SOURCE_DIR}/CXX -I${CMAKE_SOURCE_DIR}/include -I${CMAKE_SOURCE_DIR}/H -I${CMAKE_SOURCE_DIR}/os -I${CMAKE_SOURCE_DIR}/OPTYap -I${CMAKE_BINARY_DIR} -I${GMP_INCLUDE_DIRS} -DX_API="" -o ${CMAKE_SWIG_OUTPUT}/yap_swig.cpp -oh ${CMAKE_SWIG_OUTPUT}/yap_swig.hh ${SWIG_SOURCES}
|
COMMAND ${SWIG_EXECUTABLE} -c++ -java -package ${SWIG_MODULE_NAME} -O -outdir ${CMAKE_SWIG_OUTDIR} -addextern -I${CMAKE_SOURCE_DIR}/CXX -I${CMAKE_SOURCE_DIR}/include -I${CMAKE_SOURCE_DIR}/H -I${CMAKE_SOURCE_DIR}/os -I${CMAKE_SOURCE_DIR}/OPTYap -I${CMAKE_BINARY_DIR} -I${GMP_INCLUDE_DIRS} -DX_API="" -o ${CMAKE_SWIG_OUTPUT}/yap_swig.cpp -oh ${CMAKE_SWIG_OUTPUT}/yap_swig.hh ${SWIG_SOURCES}
|
||||||
DEPENDS pllibos ${SWIG_SOURCES} YAP++)
|
DEPENDS pllibos ${SWIG_SOURCES} YAP++)
|
||||||
|
|
||||||
|
|
||||||
|
@ -124,6 +124,19 @@ YAPError = _yap.YAPError
|
|||||||
|
|
||||||
%typecheck(0) YAPTerm { $1 = !PyUnicode_Check($input); }
|
%typecheck(0) YAPTerm { $1 = !PyUnicode_Check($input); }
|
||||||
|
|
||||||
|
%exception {
|
||||||
|
try {
|
||||||
|
$action
|
||||||
|
} catch (const std::out_of_range& e) {
|
||||||
|
SWIG_exception(SWIG_IndexError, e.what());
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
SWIG_exception(SWIG_RuntimeError, e.what());
|
||||||
|
} catch (...) {
|
||||||
|
SWIG_exception(SWIG_RuntimeError, "unknown exception");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
%typemap(in) arity_t { (jlong)($input); }
|
%typemap(in) arity_t { (jlong)($input); }
|
||||||
@ -139,19 +152,6 @@ YAPError = _yap.YAPError
|
|||||||
// Language independent exception handler
|
// Language independent exception handler
|
||||||
// simplified version
|
// simplified version
|
||||||
%include <exception.i>
|
%include <exception.i>
|
||||||
|
|
||||||
%exception {
|
|
||||||
try {
|
|
||||||
$action
|
|
||||||
} catch (const std::out_of_range& e) {
|
|
||||||
SWIG_exception(SWIG_IndexError, e.what());
|
|
||||||
} catch (const std::exception& e) {
|
|
||||||
SWIG_exception(SWIG_RuntimeError, e.what());
|
|
||||||
} catch (...) {
|
|
||||||
SWIG_exception(SWIG_RuntimeError, "unknown exception");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -351,8 +351,9 @@ static void
|
|||||||
};
|
};
|
||||||
|
|
||||||
%init %{
|
%init %{
|
||||||
|
#ifdef SWIGYTHON
|
||||||
PyObject * pYAPError = PyErr_NewException("_yap.YAPError", NULL, NULL);
|
PyObject * pYAPError = PyErr_NewException("_yap.YAPError", NULL, NULL);
|
||||||
Py_INCREF(pYAPError);
|
Py_INCREF(pYAPError);
|
||||||
PyModule_AddObject(m, "YAPError", pYAPError);
|
PyModule_AddObject(m, "YAPError", pYAPError);
|
||||||
|
#endif
|
||||||
%}
|
%}
|
||||||
|
@ -478,4 +478,8 @@ If this hook preodicate succeeds it must instantiate the _Action_ argument to t
|
|||||||
:- ensure_loaded('../pl/pathconf.yap').
|
:- ensure_loaded('../pl/pathconf.yap').
|
||||||
|
|
||||||
:- yap_flag(user:unknown,error).
|
:- yap_flag(user:unknown,error).
|
||||||
|
|
||||||
|
:- ensure_loaded('../android.yap').
|
||||||
|
|
||||||
|
|
||||||
%% @}
|
%% @}
|
||||||
|
@ -293,7 +293,7 @@ abolish(X0) :-
|
|||||||
'$old_abolish'(X,M).
|
'$old_abolish'(X,M).
|
||||||
|
|
||||||
'$new_abolish'(V,M) :- var(V), !,
|
'$new_abolish'(V,M) :- var(V), !,
|
||||||
'$abolish_all'(M).
|
'$abolish_all_in_module'(M).
|
||||||
'$new_abolish'(A/V,M) :- atom(A), var(V), !,
|
'$new_abolish'(A/V,M) :- atom(A), var(V), !,
|
||||||
'$abolish_all_atoms'(A,M).
|
'$abolish_all_atoms'(A,M).
|
||||||
'$new_abolish'(Na//Ar1, M) :-
|
'$new_abolish'(Na//Ar1, M) :-
|
||||||
@ -313,12 +313,12 @@ abolish(X0) :-
|
|||||||
'$new_abolish'(T, M) :-
|
'$new_abolish'(T, M) :-
|
||||||
'$do_error'(type_error(predicate_indicator,T),abolish(M:T)).
|
'$do_error'(type_error(predicate_indicator,T),abolish(M:T)).
|
||||||
|
|
||||||
'$abolish_all'(M) :-
|
'$abolish_all_in_module'(M) :-
|
||||||
'$current_predicate'(Na, M, S, _),
|
'$current_predicate'(Na, M, S, _),
|
||||||
functor(S, Na, Ar),
|
functor(S, Na, Ar),
|
||||||
'$new_abolish'(Na/Ar, M),
|
'$new_abolish'(Na/Ar, M),
|
||||||
fail.
|
fail.
|
||||||
'$abolish_all'(_).
|
'$abolish_all_in_module'(_).
|
||||||
|
|
||||||
'$abolish_all_atoms'(Na, M) :-
|
'$abolish_all_atoms'(Na, M) :-
|
||||||
'$current_predicate'(Na,M,S,_),
|
'$current_predicate'(Na,M,S,_),
|
||||||
@ -817,3 +817,4 @@ clause_property(ClauseRef, predicate(PredicateIndicator)) :-
|
|||||||
/**
|
/**
|
||||||
@}
|
@}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user