fix in numbervrs≈
This commit is contained in:
parent
337bf7b136
commit
cb5dc1313a
4175
C/utilpreds.c
4175
C/utilpreds.c
File diff suppressed because it is too large
Load Diff
@ -5,15 +5,16 @@ add_lib(jplYap jpl.h jpl.c hacks.h)
|
||||
include_directories (${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2} ${JAVA_AWT_PATH} )
|
||||
|
||||
|
||||
get_filename_component ( JAVA_AWT_DIR ${JAVA_AWT_LIBRARY} DIRECTORY)
|
||||
get_filename_component ( JAVA_JNI_DIR ${JAVA_JVM_LIBRARY} DIRECTORY)
|
||||
list(APPEND CMAKE_INSTALL_RPATH ${JAVA_AWT_DIR};${JAVA_JNI_DIR})
|
||||
|
||||
if (APPLE)
|
||||
set(CMAKE_MACOSX_RPATH 1)
|
||||
get_filename_component ( JAVA_AWT_DIR ${JAVA_AWT_LIBRARY} DIRECTORY)
|
||||
get_filename_component ( JAVA_JNI_DIR ${JAVA_JVM_LIBRARY} DIRECTORY)
|
||||
find_library (JLI jli ${JAVA_AWT_DIR}/jli)
|
||||
find_library (JAL JavaApplicationLauncher FRAMEWORK ONLY PATH /System/Library/PrivateFrameworks)
|
||||
find_library (JL JavaLaunching FRAMEWORK ONLY PATH /System/Library/PrivateFrameworks)
|
||||
SET(CMAKE_INSTALL_RPATH "${JAVA_AWT_DIR}/jli")
|
||||
list(APPEND CMAKE_INSTALL_RPATH ${JAVA_AWT_DIR}/jli)
|
||||
target_link_libraries(jplYap libYap ${JL} ${JAL} -L${JAVA_AWT_DIR}/jli -ljli )
|
||||
else()
|
||||
target_link_libraries(jplYap libYap ${JAVA_JVM_LIBRARY})
|
||||
|
@ -115,7 +115,7 @@ db_import(Connection,RelationName,PredName0) :-
|
||||
functor(P,PredName,Arity),
|
||||
P=..[PredName|LA],
|
||||
%build PredName clause
|
||||
table_access_predicate( ConType, Con, Arity, P, LA, Modulelisting, Assert ),
|
||||
table_access_predicate( ConType, Con, Arity, P, LA, Module, Assert ),
|
||||
assert_static(Module:Assert),
|
||||
c_db_add_preds(PredName,Arity,Module,Con).
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
@ -158,7 +158,7 @@ db_view(Connection,PredName,DbGoal) :-
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% db_insert/3
|
||||
% @pred db_insert/3
|
||||
%
|
||||
%
|
||||
db_insert(RelationName,PredName) :-
|
||||
@ -238,9 +238,9 @@ db_listing.
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% db_listing.
|
||||
%
|
||||
%
|
||||
%% @pred db_listing(+PredIndicator)
|
||||
%%
|
||||
%% describe a table's data.
|
||||
db_listing(Module:Name/Arity):-!,
|
||||
c_db_connection(Con),
|
||||
user:c_db_preds_conn(Con,Module,Name,Arity),
|
||||
@ -253,11 +253,10 @@ db_listing(Name):-
|
||||
c_db_connection(Con),
|
||||
user:c_db_preds_conn(Con,Module,Name,Arity),
|
||||
listing(Module:Name/Arity).
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
% table_arity :- number of columns in a relation.
|
||||
%
|
||||
% %
|
||||
table_arity( Con, ConType, RelationName, Arity ) :-
|
||||
c_db_connection_type(Con,ConType),
|
||||
% get relation arity
|
||||
@ -273,6 +272,8 @@ table_arity( Con, ConType, RelationName, Arity ) :-
|
||||
c_sqlite3_number_of_fields(RelationName,Con,Arity))
|
||||
.
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
% major attributes types.
|
||||
table_attributes( mysql, Con, RelationName, TypesList ) :-
|
||||
c_db_my_get_attributes_types(RelationName,Con,TypesList).
|
||||
@ -290,27 +291,29 @@ table_attributes( sqlite3, Con, RelationName, TypesList ) :-
|
||||
|
||||
|
||||
table_access_predicate( mysql, Con, Arity, P, LA, M,
|
||||
( P :- user:(myddas_util_predicates:'$copy_term_nv'(P,[],G,_),
|
||||
M:( P :- myddas_util_predicates:'$copy_term_nv'(P,[],G,_),
|
||||
myddas_prolog2sql:translate(G,G,Code),
|
||||
queries_atom(Code,FinalSQL),
|
||||
user:queries_atom(Code,FinalSQL),
|
||||
db_my_result_set(Mode),
|
||||
myddas_util_predicates:'$write_or_not'(FinalSQL),
|
||||
c_db_my_query(FinalSQL,ResultSet,Con,Mode,_),
|
||||
user:c_db_my_query(FinalSQL,ResultSet,Con,Mode,_),
|
||||
!,
|
||||
c_db_my_row(ResultSet,Arity,LA) ))).
|
||||
user:c_db_my_row(ResultSet,Arity,LA)
|
||||
)).
|
||||
|
||||
table_access_predicate( postgres, Con, Arity, P, LA, _M,
|
||||
( P :- myddas_util_predicates:'$copy_term_nv'(P,[],G,_),
|
||||
myddas_prolog2sql:translate(M:G,M:G,Code),
|
||||
myddas_prolog2sql:queries_atom(Code,FinalSQL),
|
||||
myddas_postgres:postgres_result_set(Mode),
|
||||
myddas_util_predicates:'$write_or_not'(FinalSQL),
|
||||
c_postgres_query(FinalSQL,ResultSet,Con,Mode,_),
|
||||
!,
|
||||
c_postgsres_row(ResultSet,Arity,LA) ))).
|
||||
table_access_predicate( postgres, Con, Arity, P, LA, M,
|
||||
M:( P :- myddas_util_predicates:'$copy_term_nv'(P,[],G,_),
|
||||
myddas_prolog2sql:translate(M:G,M:G,Code),
|
||||
myddas_prolog2sql:queries_atom(Code,FinalSQL),
|
||||
myddas_postgres:postgres_result_set(Mode),
|
||||
myddas_util_predicates:'$write_or_not'(FinalSQL),
|
||||
c_postgres_query(FinalSQL,ResultSet,Con,Mode,_),
|
||||
!,
|
||||
c_postgres_row(ResultSet,Arity,LA) )
|
||||
).
|
||||
|
||||
table_access_predicate( sqlite3, Con, Arity, P, LA, M,
|
||||
( P :- (myddas_util_predicates:'$copy_term_nv'(P,[],G,_),
|
||||
M:( P :- (myddas_util_predicates:'$copy_term_nv'(P,[],G,_),
|
||||
myddas_prolog2sql:translate(G,G,Code),
|
||||
myddas_prolog2sql:queries_atom(Code,FinalSQL),
|
||||
myddas_sqlite3:sqlite3_result_set(Mode),
|
||||
@ -321,7 +324,7 @@ table_access_predicate( sqlite3, Con, Arity, P, LA, M,
|
||||
) )).
|
||||
|
||||
table_access_predicate( odbc, Con, Arity, P, LA, M,
|
||||
( P :- M:(myddas_util_predicates:'$copy_term_nv'(P,[],G,_),
|
||||
M:( P :- (myddas_util_predicates:'$copy_term_nv'(P,[],G,_),
|
||||
myddas_prolog2sql:translate(G,G,Code),
|
||||
myddas_prolog2sql:queries_atom(Code,FinalSQL),
|
||||
myddas_odbc:odbc_result_set(Mode),
|
||||
@ -331,6 +334,8 @@ table_access_predicate( odbc, Con, Arity, P, LA, M,
|
||||
myddas_odbc:c_odbc_row(ResultSet,Arity,LA)
|
||||
) )).
|
||||
|
||||
|
||||
|
||||
table_insert( mysql, Con, RelationName, TypesList, Predicate, LA,
|
||||
( Predicate :- myddas_assert_predicates:
|
||||
( '$get_values_for_insert'(TypesList,LA,ValuesList),
|
||||
|
@ -502,7 +502,7 @@ class YAPCompleter(Completer):
|
||||
self.matches = []
|
||||
prolog_res = self.shell.yapeng.mgoal(completions(text, self), "user",True)
|
||||
return text, self.matches
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -602,12 +602,12 @@ class YAPRun(InteractiveShell):
|
||||
return self.result
|
||||
|
||||
|
||||
|
||||
|
||||
def _yrun_cell(self, raw_cell, store_history=True, silent=False,
|
||||
shell_futures=True):
|
||||
"""Run a complete IPython cell.
|
||||
-
|
||||
Parameters
|
||||
"""Run a complete IPython cell.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
raw_cell : str
|
||||
The code (including IPython code such as
|
||||
@ -630,9 +630,8 @@ class YAPRun(InteractiveShell):
|
||||
Returns
|
||||
|
||||
-------
|
||||
|
||||
`self.result : :class:`Executionself.result`
|
||||
"""
|
||||
`self.result : :class:`Executionself.result`
|
||||
"""
|
||||
|
||||
# construct a query from a one-line string
|
||||
# q is opaque to Python
|
||||
@ -647,7 +646,6 @@ class YAPRun(InteractiveShell):
|
||||
# launch the query
|
||||
cell = raw_cell # cell has to exist so it can be stored/logged
|
||||
|
||||
|
||||
info = interactiveshell.ExecutionInfo(
|
||||
raw_cell, store_history, silent, shell_futures)
|
||||
|
||||
@ -738,7 +736,7 @@ class YAPRun(InteractiveShell):
|
||||
# trace=1,
|
||||
# count=0)
|
||||
#
|
||||
|
||||
|
||||
# def f(self, cell, state):
|
||||
# state = self.jupyter_query( cell )
|
||||
|
||||
@ -830,5 +828,5 @@ class YAPRun(InteractiveShell):
|
||||
(query, _,loop, sols) = self.clean_end(query)
|
||||
return (program, query, loop, sols)
|
||||
|
||||
# global
|
||||
#globals = {}
|
||||
# global
|
||||
#globals = {}
|
||||
|
Reference in New Issue
Block a user