Merge branch 'master' of ssh://ssh.dcc.fc.up.pt:31064/home/vsc/yap

This commit is contained in:
Vitor Santos Costa 2019-02-15 13:51:22 +00:00
commit 1bd2f0338c
3 changed files with 6 additions and 5 deletions

View File

@ -1403,10 +1403,10 @@ static Int create_entry(Term t, Int i, Int j, cl_connector * q, Int max) {
} else if (IsApplTerm(t)) { } else if (IsApplTerm(t)) {
Int me; Int me;
h = (CELL)FunctorOfTerm(t); h = (CELL)FunctorOfTerm(t);
n = ArityOfFunctor((Functor)h);
if (IsExtensionFunctor((Functor)h)) { if (IsExtensionFunctor((Functor)h)) {
return -1; return -1;
} }
n = ArityOfFunctor((Functor)h);
if (IsAtomTerm(h) && if (IsAtomTerm(h) &&
(me = t_ref((cl_connector*)AtomOfTerm(h),q,max)) >= 0) { (me = t_ref((cl_connector*)AtomOfTerm(h),q,max)) >= 0) {
return me; return me;
@ -1447,6 +1447,7 @@ Int cp_link(Term t, Int i, Int j, cl_connector * q, Int max, CELL * tailp) {
if (IsVarTerm(ref)) { if (IsVarTerm(ref)) {
q[i].copy[j] = ref; q[i].copy[j] = ref;
} else if (i == 0){ } else if (i == 0){
Term p = TermNil; Term p = TermNil;
Term v = UNFOLD_LOOP(ref,&p); Term v = UNFOLD_LOOP(ref,&p);
q[i].reference = HeadOfTerm(p); q[i].reference = HeadOfTerm(p);
@ -1457,6 +1458,7 @@ Int cp_link(Term t, Int i, Int j, cl_connector * q, Int max, CELL * tailp) {
q[i].copy[j] = v; q[i].copy[j] = v;
q[me].parent[0] = v; q[me].parent[0] = v;
q[i].reference = v; q[i].reference = v;
} }
return max; return max;
} }
@ -1480,6 +1482,7 @@ Term Yap_BreakCycles(Term inp, UInt arity, Term * listp USES_REGS) {
return t; return t;
} else { } else {
// initialization // initialization
fprintf(stderr,"C i=%ld,%ld %lx\n", i, 0, q[i].copy[0]); }
qlen = create_entry(Deref(t), i, 0, q, qlen); qlen = create_entry(Deref(t), i, 0, q, qlen);
while(i<qlen) { while(i<qlen) {
arity_t n, j; arity_t n, j;

View File

@ -89,14 +89,12 @@ set(
ex/learning/train.yap ex/learning/train.yap
) )
IF (WITH_HORUS)
include(CheckCXXCompilerFlag) include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11) CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11) if(COMPILER_SUPPORTS_CXX11)
add_subDIRECTORY (horus) add_subDIRECTORY (horus)
endif() endif()
ENDIF()
install(FILES install(FILES
${CLPBN_TOP} ${CLPBN_TOP}

View File

@ -68,7 +68,7 @@ if (CMAKE_MAJOR_VERSION GREATER 2)
install(TARGETS horus HorusCli install(TARGETS horus HorusCli
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} RUNTIME DESTINATION ${YAP_INSTALL_LIBDIR}
LIBRARY DESTINATION ${YAP_INSTALL_LIBDIR} LIBRARY DESTINATION ${YAP_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${YAP_INSTALL_LIBDIR} ARCHIVE DESTINATION ${YAP_INSTALL_LIBDIR}
) )