fix Malloc over/underflow

remove trash
This commit is contained in:
Vitor Santos Costa 2018-06-18 10:25:17 +01:00
parent fd4f53a899
commit c092d0f62b
23 changed files with 115 additions and 3756 deletions

View File

@ -717,12 +717,15 @@ static Int number_chars(USES_REGS1) {
pop_text_stack(l);
return Yap_unify(ARG1, tf);
}
pop_text_stack(l);
LOCAL_ActiveError->errorRawTerm = 0;
Yap_ThrowExistingError();
return false;
}
pop_text_stack(l);
return true;
}

View File

@ -862,6 +862,7 @@ yamop *Yap_Error__(bool throw, const char *file, const char *function,
// reset_error_description();
if (!throw) {
Yap_JumpToEnv();
pop_text_stack(LOCAL_MallocDepth+1);
}
LOCAL_PrologMode = UserMode;
return P;

View File

@ -1423,11 +1423,12 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) {
Int OldBorder = LOCAL_CBorder;
// yap_error_descriptor_t *err_info= LOCAL_ActiveError;
LOCAL_CBorder = LCL0 - ENV;
LOCAL_MallocDepth = AllocLevel();
yhandle_t sls = Yap_CurrentSlot();
sigjmp_buf signew, *sighold = LOCAL_RestartEnv;
LOCAL_RestartEnv = &signew;
int i = AllocLevel();
volatile int i = AllocLevel();
if /* top &&*/ ((lval = sigsetjmp(signew, 1)) != 0) {
switch (lval) {
case 1: { /* restart */
@ -1458,7 +1459,7 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) {
*/
/* reset the registers so that we don't have trash in abstract
* machine */
pop_text_stack(i);
pop_text_stack(i+1);
Yap_set_fpu_exceptions(
getAtomicGlobalPrologFlag(ARITHMETIC_EXCEPTIONS_FLAG));
P = (yamop *)FAILCODE;
@ -1467,7 +1468,7 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) {
} break;
case 3: { /* saved state */
// LOCAL_ActiveError = err_info;
pop_text_stack(i);
pop_text_stack(i+1);
LOCAL_CBorder = OldBorder;
LOCAL_RestartEnv = sighold;
LOCAL_PrologMode = UserMode;
@ -1481,7 +1482,7 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) {
// LOCAL_ActiveError = err_info;
while (B) {
LOCAL_ActiveError->errorNo = ABORT_EVENT;
pop_text_stack(i);
pop_text_stack(i+1);
Yap_CloseSlots(sls);
Yap_JumpToEnv();
}
@ -1489,7 +1490,7 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) {
P = (yamop *)FAILCODE;
LOCAL_RestartEnv = sighold;
Yap_CloseSlots(sls);
pop_text_stack(i);
pop_text_stack(i+1);
return false;
break;
case 5:
@ -1512,13 +1513,15 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) {
(CELL *)(B->cp_b) > LCL0 - LOCAL_CBorder) {
LOCAL_RestartEnv = sighold;
LOCAL_CBorder = OldBorder;
return false;
pop_text_stack(i+1);
return false;
}
P = FAILCODE;
}
}
YENV = ASP;
YENV[E_CB] = Unsigned(B);
pop_text_stack(i+1);
out = Yap_absmi(0);
/* make sure we don't leave a FAIL signal hanging around */
Yap_get_signal(YAP_FAIL_SIGNAL);
@ -1526,6 +1529,7 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) {
CalculateStackGap(PASS_REGS1);
LOCAL_CBorder = OldBorder;
LOCAL_RestartEnv = sighold;
pop_text_stack(i+1);
return out;
}
@ -2114,6 +2118,7 @@ static Int jump_env(USES_REGS1) {
LCL0 - (CELL *)B > LOCAL_CBorder) {
// we're failing up to the top layer
}
pop_text_stack(LOCAL_MallocDepth+1);
return out;
}

View File

@ -305,7 +305,7 @@ static void *codes2buf(Term t0, void *b0, bool *get_codes USES_REGS) {
if (!IsVarTerm(t)) {
if (t != TermNil) {
Yap_ThrowError(TYPE_ERROR_LIST, t0, "scanning list of codes");
Yap_ThrowError(TYPE_ERROR_LIST, t, "scanning list of codes");
return NULL;
}
}
@ -508,6 +508,7 @@ unsigned char *Yap_readText(seq_tv_t *inp USES_REGS) {
s = Malloc(2 * MaxTmp(PASS_REGS1));
if (snprintf(s, MaxTmp(PASS_REGS1) - 1, Int_FORMAT,
IntegerOfTerm(inp->val.t)) < 0) {
pop_text_stack(lvl);
AUX_ERROR(inp->val.t, 2 * MaxTmp(PASS_REGS1), s, char);
}
return pop_output_text_stack(lvl, s);
@ -527,6 +528,7 @@ unsigned char *Yap_readText(seq_tv_t *inp USES_REGS) {
char *s;
s = Malloc(MaxTmp());
if (!Yap_mpz_to_string(Yap_BigIntOfTerm(inp->val.t), s, MaxTmp() - 1, 10)) {
pop_text_stack(lvl);
AUX_ERROR(inp->val.t, MaxTmp(PASS_REGS1), s, char);
}
return inp->val.uc = pop_output_text_stack(lvl, s);
@ -766,7 +768,7 @@ void *write_buffer(unsigned char *s0, seq_tv_t *out USES_REGS) {
pop_text_stack(l);
return NULL;
}
out->val.c = pop_output_text_stack__(l, out->val.c);
out->val.c = pop_output_text_stack(l, out->val.c);
return out->val.c;
}

View File

@ -319,7 +319,6 @@ set(libpl ${YAP_INSTALL_PLDIR})
# include( Model )
include(cudd )
include(java )
set(pl_library "" CACHE INTERNAL "prolog library files")
set(pl_os_library "" CACHE INTERNAL "prolog os files")
@ -374,8 +373,8 @@ endif()
set(YAP_FOUND ON)
set(YAP_MAJOR_VERSION 6)
set(YAP_MINOR_VERSION 3)
set(YAP_PATCH_VERSION 5)
set(YAP_MINOR_VERSION 4)
set(YAP_PATCH_VERSION 0)
set(YAP_FULL_VERSION
${YAP_MAJOR_VERSION}.${YAP_MINOR_VERSION}.${YAP_PATCH_VERSION})
@ -780,6 +779,71 @@ endif ()
add_subDIRECTORY(packages/real)
option(WITH_JAVA "Try to use Java (currently Java 6,7,8)" ON)
if (WITH_JAVA)
#detect java setup, as it is shared between different installations.
find_package(Java COMPONENTS Runtime Development)
# find_package(Java COMPONENTS Development)
# find_package(Java COMPONENTS Runtime)
#find_package(JavaLibs)
if (Java_Development_FOUND)
set (STD_CMAKE_FIND_FRAMEWORK ${CMAKE_FIND_FRAMEWORK})
set (CMAKE_FIND_FRAMEWORK LAST) # CMake will find the Java returned by /usr/libexec/java_home.
find_package(JNI)
set (CMAKE_FIND_FRAMEWORK ${STD_CMAKE_FIND_FRAMEWORK})
if (NOT JNI_FOUND)
set (JAVA_HOME ${JAVA_INCLUDE_PATH}/..)
endif()
if (JNI_FOUND)
include(UseJava)
#
# Java_JAVA_EXECUTABLE = the full path to the Java runtime
# Java_JAVAC_EXECUTABLE = the full path to the Java compiler
# Java_JAVAH_EXECUTABLE = the full path to the Java header generator
# Java_JAVADOC_EXECUTABLE = the full path to the Java documention generator
# Java_IDLJ_EXECUTABLE = the full path to the Java idl compiler
# Java_JAR_EXECUTABLE = the full path to the Java archiver
# Java_JARSIGNER_EXECUTABLE = the full path to the Java jar signer
# Java_VERSION_STRING = Version of java found, eg. 1.6.0_12
# Java_VERSION_MAJOR = The major version of the package found.
# Java_VERSION_MINOR = The minor version of the package found.
# Java_VERSION_PATCH = The patch version of the package found.
# Java_VERSION_TWEAK = The tweak version of the package found (after '_')
# Java_VERSION = This is set to: $major.$minor.$patch(.$tweak)
#
# The Java_ADDITIONAL_VERSIONS variable can be used to specify a list
# of version numbers that should be taken into account when searching
# for Java. You need to set this variable before calling
# find_package(JavaLibs).
#
#macro_optional_find_package(JNI ON)
# JNI_INCLUDE_DIRS = the include dirs to use
# JNI_LIBRARIES = the libraries to use
# JNI_FOUND = TRUE if JNI headers and libraries were found.
# JAVA_AWT_LIBRARY = the path to the jawt library
# JAVA_JVM_LIBRARY = the path to the jvm library
# JAVA_INCLUDE_PATH = the include path to jni.h
# JAVA_INCLUDE_PATH2 = the include path to jni_md.h
# JAVA_AWT_INCLUDE_PATH = the include path to jawt.h
endif (JNI_FOUND)
endif (Java_Development_FOUND)
endif(WITH_JAVA)
add_subDIRECTORY(packages/jpl)
add_subDIRECTORY(packages/bdd)

View File

@ -121,6 +121,7 @@ LOCAL_INIT(Int, LastGcTime, 0L);
LOCAL_INIT(Int, LastSSTime, 0L);
LOCAL_INIT(CELL *, OpenArray, NULL);
/* in a single gc */
LOCAL_INIT(int, MallocDepth, 0L);
LOCAL_INIT(Int, total_marked, 0L);
LOCAL_INIT(Int, total_oldies, 0L);
LOCAL_INIT(struct choicept *, current_B, NULL);

View File

@ -1,126 +0,0 @@
// play nice
#ifndef HAVE_PYTHON
/* #undef HAVE_PYTHON */
#endif
#if HAVE_PYTHON
#include <Python.h>
#endif
/* Define if you have libreadline */
#ifndef HAVE_LIBREADLINE
#define HAVE_LIBREADLINE CACHE;YES;BOOL;Readline works.
#endif
/* Define to 1 if you have the <readline/history.h> header file. */
#ifndef HAVE_READLINE_HISTORY_H
#define HAVE_READLINE_HISTORY_H 1
#endif
/* Define to 1 if you have the <readline/readline.h> header file. */
#ifndef HAVE_READLINE_READLINE_H
#define HAVE_READLINE_READLINE_H 1
#endif
#if defined(HAVE_READLINE_READLINE_H) && defined(HAVE_LIBREADLINE)
#define USE_READLINE 1
#endif
/* Define to 1 if you have the declaration of `rl_catch_signals ', and to 0 if
you don't. */
#ifndef HAVE_DECL_RL_CATCH_SIGNALS_
#define HAVE_DECL_RL_CATCH_SIGNALS 1
#endif
/* Define to 1 if you have the declaration of `rl_done ', and to 0 if you
don't. */
#ifndef HAVE_DECL_RL_DONE_
/* #undef HAVE_DECL_RL_DONE_ */
#endif
/* Define to 1 if you have the declaration of `rl_event_hook', and to 0 if you
don't. */
#ifndef HAVE_DECL_RL_EVENT_HOOK
/* #undef HAVE_DECL_RL_EVENT_HOOK */
#endif
/* Define to 1 if you have the declaration of `rl_readline_state', and to 0 if
you don't. */
#ifndef HAVE_DECL_RL_READLINE_STATE
/* #undef HAVE_DECL_RL_READLINE_STATE */
#endif
/* Define to 1 if you have the `rl_begin_undo_group' function. */
#ifndef HAVE_RL_BEGIN_UNDO_GROUP
#define HAVE_RL_BEGIN_UNDO_GROUP 1
#endif
/* Define to 1 if you have the `rl_clear_pending_input' function. */
#ifndef HAVE_RL_CLEAR_PENDING_INPUT
#define HAVE_RL_CLEAR_PENDING_INPUT 1
#endif
/* Define to 1 if the system has the type `rl_completion_entry_function'). */
#ifndef HAVE_RL_COMPLETION_ENTRY_FUNCTION
/* #undef HAVE_RL_COMPLETION_ENTRY_FUNCTION */
#endif
/* Define to 1 if the system has the type `rl_completion_func_t'. */
#ifndef HAVE_RL_COMPLETION_FUNC_T
/* #undef HAVE_RL_COMPLETION_FUNC_T */
#endif
/* Define to 1 if you have the `rl_completion_matches' function. */
#ifndef HAVE_RL_COMPLETION_MATCHES
/* #undef HAVE_RL_COMPLETION_MATCHES */
#endif
/* Define to 1 if you have the `rl_discard_argument' function. */
#ifndef HAVE_RL_DISCARD_ARGUMENT
#define HAVE_RL_DISCARD_ARGUMENT 1
#endif
/* Define to 1 if you have the `rl_done' variable. */
#ifndef HAVE_RL_DONE
#define HAVE_RL_DONE
#endif
/* Define to 1 if you have the `rl_filename_completion_function' function. */
#ifndef HAVE_RL_FILENAME_COMPLETION_FUNCTION
#define HAVE_RL_FILENAME_COMPLETION_FUNCTION
#endif
/* Define to 1 if you have the `rl_free_line_state' function. */
#ifndef HAVE_RL_FREE_LINE_STATE
#define HAVE_RL_FREE_LINE_STATE 1
#endif
/* Define to 1 if the system has the type `rl_hook_func_t'. */
#ifndef HAVE_RL_HOOK_FUNC_T
/* #undef HAVE_RL_HOOK_FUNC_T */
#endif
/* Define to 1 if you have the `rl_insert_close' function. */
#ifndef HAVE_RL_INSERT_CLOSE
#define HAVE_RL_INSERT_CLOSE 1
#endif
/* Define to 1 if you have the `rl_reset_after_signal' function. */
#ifndef HAVE_RL_RESET_AFTER_SIGNAL
#define HAVE_RL_RESET_AFTER_SIGNAL 1
#endif
/* Define to 1 if you have the `rl_set_keyboard_input_timeout' function. */
#ifndef HAVE_RL_SET_KEYBOARD_INPUT_TIMEOUT
#define HAVE_RL_SET_KEYBOARD_INPUT_TIMEOUT 1
#endif
/* Define to 1 if you have the `rl_set_prompt' function. */
#ifndef HAVE_RL_SET_PROMPT
#define HAVE_RL_SET_PROMPT 1
#endif
/* Define to 1 if you have the `rl_set_signals' function. */
#ifndef HAVE_RL_SET_SIGNALS
#define HAVE_RL_SET_SIGNALS 1
#endif

View File

@ -1,62 +0,0 @@
option(WITH_JAVA "Try to use Java (currently Java 6,7,8)" ON)
if (WITH_JAVA)
#detect java setup, as it is shared between different installations.
find_package(Java 1.8 COMPONENTS Runtime Development)
# find_package(Java COMPONENTS Development)
# find_package(Java COMPONENTS Runtime)
#find_package(JavaLibs)
if (Java_Development_FOUND)
find_package(JNI)
if (NOT JNI_FOUND)
set (JAVA_HOME ${JAVA_INCLUDE_PATH}/..)
endif()
find_package(JNI)
if (JNI_FOUND)
include(UseJava)
#
# Java_JAVA_EXECUTABLE = the full path to the Java runtime
# Java_JAVAC_EXECUTABLE = the full path to the Java compiler
# Java_JAVAH_EXECUTABLE = the full path to the Java header generator
# Java_JAVADOC_EXECUTABLE = the full path to the Java documention generator
# Java_IDLJ_EXECUTABLE = the full path to the Java idl compiler
# Java_JAR_EXECUTABLE = the full path to the Java archiver
# Java_JARSIGNER_EXECUTABLE = the full path to the Java jar signer
# Java_VERSION_STRING = Version of java found, eg. 1.6.0_12
# Java_VERSION_MAJOR = The major version of the package found.
# Java_VERSION_MINOR = The minor version of the package found.
# Java_VERSION_PATCH = The patch version of the package found.
# Java_VERSION_TWEAK = The tweak version of the package found (after '_')
# Java_VERSION = This is set to: $major.$minor.$patch(.$tweak)
#
# The Java_ADDITIONAL_VERSIONS variable can be used to specify a list
# of version numbers that should be taken into account when searching
# for Java. You need to set this variable before calling
# find_package(JavaLibs).
#
#macro_optional_find_package(JNI ON)
# JNI_INCLUDE_DIRS = the include dirs to use
# JNI_LIBRARIES = the libraries to use
# JNI_FOUND = TRUE if JNI headers and libraries were found.
# JAVA_AWT_LIBRARY = the path to the jawt library
# JAVA_JVM_LIBRARY = the path to the jvm library
# JAVA_INCLUDE_PATH = the include path to jni.h
# JAVA_INCLUDE_PATH2 = the include path to jni_md.h
# JAVA_AWT_INCLUDE_PATH = the include path to jawt.h
endif (JNI_FOUND)
endif (Java_Development_FOUND)
endif(WITH_JAVA)

View File

File diff suppressed because it is too large Load Diff

14
kernel
View File

@ -1,14 +0,0 @@
mkdir tmp_k
cd tmp_k
cp -a ~/github/ipykernel/* .
for i in *py */*py */*/*py; do
sed -i '.bk' -e 's/ipkernel/yapkernel/g' $i
sed -i '.bk' -e 's/ipykernel/yap_kernel/g' $i
sed -i '.bk' -e 's/IPKernelApp/YAP_KernelApp/g' $i
sed -i '.bk' -e 's/IPythonKernel/YAPKernel/g' $i
sed -i '.bk' -e 's/IPKernel/YAPKernel/g' $i
done
mv ipykernel yap_kernel
mv ipykernel_launcher.py yap_kernel_launcher.py
mv yap_kernel/ipkernel.py yap_kernel/yapkernel.py

57
l
View File

@ -1,57 +0,0 @@
Attempting to finalize metadata for yap4py
INFO:conda_build.metadata:Attempting to finalize metadata for yap4py
Traceback (most recent call last):
File "/home/vsc/anaconda3/bin/conda-build", line 11, in <module>
sys.exit(main())
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda_build/cli/main_build.py", line 388, in main
execute(sys.argv[1:])
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda_build/cli/main_build.py", line 379, in execute
verify=args.verify)
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda_build/api.py", line 185, in build
need_source_download=need_source_download, config=config, variants=variants)
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda_build/build.py", line 1774, in build_tree
notest=notest,
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda_build/build.py", line 882, in build
output_metas = expand_outputs([(m, need_source_download, need_reparse_in_env)])
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda_build/render.py", line 553, in expand_outputs
for (output_dict, m) in _m.get_output_metadata_set(permit_unsatisfiable_variants=False):
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda_build/metadata.py", line 1767, in get_output_metadata_set
permit_unsatisfiable_variants=permit_unsatisfiable_variants)
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda_build/metadata.py", line 640, in finalize_outputs_pass
fm = finalize_metadata(om, permit_unsatisfiable_variants=permit_unsatisfiable_variants)
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda_build/render.py", line 290, in finalize_metadata
permit_unsatisfiable_variants=permit_unsatisfiable_variants)
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda_build/render.py", line 113, in get_env_dependencies
channel_urls=tuple(m.config.channel_urls))
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda_build/environ.py", line 683, in get_install_actions
actions = install_actions(prefix, index, specs, force=True)
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda/plan.py", line 461, in install_actions
update_deps, pinned)
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda/plan.py", line 631, in get_actions_for_dists
pkgs = r.install(specs, installed, update_deps=update_deps)
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda/resolve.py", line 813, in install
pkgs = self.solve(specs, returnall=returnall)
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda/resolve.py", line 853, in solve
reduced_index = self.get_reduced_index(specs)
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda/resolve.py", line 437, in get_reduced_index
found = filter_group([s])
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda/resolve.py", line 417, in filter_group
res = filter_group(set(deps))
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda/resolve.py", line 417, in filter_group
res = filter_group(set(deps))
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda/resolve.py", line 417, in filter_group
res = filter_group(set(deps))
[Previous line repeated 1 more times]
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda/resolve.py", line 391, in filter_group
for ms in self.ms_depends(fkey)))
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda/resolve.py", line 391, in <genexpr>
for ms in self.ms_depends(fkey)))
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda/resolve.py", line 390, in <genexpr>
all(any(filter.get(f2, True) for f2 in self.find_matches(ms))
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda/models/dist.py", line 242, in __hash__
return hash(self.__key__())
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda/models/dist.py", line 223, in __key__
return self.channel, self.dist_name, self.with_features_depends
File "/home/vsc/anaconda3/lib/python3.6/site-packages/conda/_vendor/auxlib/entity.py", line 417, in __get__
return self.unbox(instance, instance_type, val)
KeyboardInterrupt

View File

@ -1,37 +0,0 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "pt.up.yap.app"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
cmake {
// cFlags "-DTEST_C_FLAG1" "-DTEST_C_FLAG2"
// cppFlags "-DTEST_CPP_FLAG2" "-DTEST_CPP_FLAG2"
abiFilters "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support:support-annotations:23.4.0'
}

View File

@ -1,113 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id=":lib" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" type="JAVA_MODULE" version="4">
<component name="FacetManager">
<facet type="android-gradle" name="Android-Gradle">
<configuration>
<option name="GRADLE_PROJECT_PATH" value=":lib" />
</configuration>
</facet>
<facet type="android" name="Android">
<configuration>
<option name="SELECTED_BUILD_VARIANT" value="debug" />
<option name="SELECTED_TEST_ARTIFACT" value="_android_test_" />
<option name="ASSEMBLE_TASK_NAME" value="assembleDebug" />
<option name="COMPILE_JAVA_TASK_NAME" value="compileDebugSources" />
<afterSyncTasks>
<task>generateDebugSources</task>
</afterSyncTasks>
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/androidTest/debug" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/debug/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/testDebug/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/res" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/assets" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/main/aidl" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/jni" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/rs" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/shaders" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/androidTest/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/res" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/assets" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/aidl" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support.test.espresso/espresso-core/2.2.2/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support.test.espresso/espresso-idling-resource/2.2.2/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support.test/exposed-instrumentation-api-publish/0.5/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support.test/rules/0.5/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support.test/runner/0.5/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/23.4.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.4.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-v4/23.4.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/exploded-aar/com.android.support/support-vector-drawable/23.4.0/jars" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
</content>
<orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" scope="TEST" name="espresso-core-2.2.2" level="project" />
<orderEntry type="library" exported="" name="support-annotations-23.4.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="runner-0.5" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="exposed-instrumentation-api-publish-0.5" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="espresso-idling-resource-2.2.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="rules-0.5" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-library-1.3" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="javax.annotation-api-1.2" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="javax.inject-1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-integration-1.3" level="project" />
<orderEntry type="library" exported="" name="animated-vector-drawable-23.4.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="javawriter-2.1.1" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="hamcrest-core-1.3" level="project" />
<orderEntry type="library" exported="" name="support-v4-23.4.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="junit-4.12" level="project" />
<orderEntry type="library" exported="" name="support-vector-drawable-23.4.0" level="project" />
<orderEntry type="library" exported="" scope="TEST" name="jsr305-2.0.1" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-23.4.0" level="project" />
</component>
</module>

View File

@ -401,6 +401,7 @@ static Int doformat(volatile Term otail, volatile Term oargs,
*HR++ = oargs;
*HR++ = otail;
if (!Yap_growheap(FALSE, LOCAL_Error_Size, NULL)) {
pop_text_stack(l);
Yap_Error(RESOURCE_ERROR_HEAP, otail, "format/2");
return false;
}
@ -428,6 +429,7 @@ static Int doformat(volatile Term otail, volatile Term oargs,
return false;
}
if (IsVarTerm(args)) {
pop_text_stack(l);
format_clean_up(sno0, sno, finfo);
Yap_Error(INSTANTIATION_ERROR, args, "format/2");
return FALSE;
@ -437,16 +439,19 @@ static Int doformat(volatile Term otail, volatile Term oargs,
args = ArgOfTerm(2, args);
if (IsVarTerm(fmod)) {
format_clean_up(sno0, sno, finfo);
pop_text_stack(l);
Yap_Error(INSTANTIATION_ERROR, fmod, "format/2");
return false;
}
if (!IsAtomTerm(fmod)) {
format_clean_up(sno0, sno, finfo);
pop_text_stack(l);
Yap_Error(TYPE_ERROR_ATOM, fmod, "format/2");
return false;
}
if (IsVarTerm(args)) {
format_clean_up(sno0, sno, finfo);
pop_text_stack(l);
Yap_Error(INSTANTIATION_ERROR, args, "format/2");
return FALSE;
}
@ -460,6 +465,7 @@ static Int doformat(volatile Term otail, volatile Term oargs,
if (tnum == FORMAT_COPY_ARGS_ERROR ||
tnum == FORMAT_COPY_ARGS_OVERFLOW) {
format_clean_up(sno0, sno, finfo);
pop_text_stack(l);
return false;
}
else if (tnum == tsz ) {
@ -484,6 +490,7 @@ static Int doformat(volatile Term otail, volatile Term oargs,
fstr = NULL;
format_clean_up(sno, sno0, finfo);
pop_text_stack(l);
return false;
}
GLOBAL_Stream[sno].status |= CloseOnException_Stream_f;
@ -801,6 +808,7 @@ static Int doformat(volatile Term otail, volatile Term oargs,
if (!alloc_fstr)
fstr = NULL;
format_clean_up(sno, sno0, finfo);
pop_text_stack(l);
return false;
}
ARG1 = Yap_GetFromHandle(s1);
@ -837,6 +845,7 @@ static Int doformat(volatile Term otail, volatile Term oargs,
targs = NULL;
}
format_clean_up(sno, sno0, finfo);
pop_text_stack(l);
Yap_RaiseException();
return false;
}
@ -973,6 +982,7 @@ static Int doformat(volatile Term otail, volatile Term oargs,
}
format_clean_up(sno, sno0, finfo);
LOCAL_Error_TYPE = YAP_NO_ERROR;
pop_text_stack(l);
return false;
}
}
@ -997,6 +1007,7 @@ static Int doformat(volatile Term otail, volatile Term oargs,
fstr = NULL;
targs = NULL;
format_clean_up(sno, sno0, finfo);
pop_text_stack(l);
return true;
}

View File

@ -1,5 +1,5 @@
all:
python code-generator.py
python3 code-generator.py
clean:
-rm -f *~ *.pyc

View File

@ -625,13 +625,13 @@ class YAPEnumProlog(object):
t = sp[1].rstrip(">")
for x in self.ENUM:
print("is_%s_('%s')." % (t, x))
print()
print("\n")
for x in self.ENUM:
print("is_%s_('%s','%s')." % (t, x, x))
print()
print("\n")
print("is_%s(X,Y) :- nonvar(X), is_%s_(X,Y)." % (t,t))
print("is_%s(X) :- is_%s_(X,_)." % (t,t))
print()
print("\n")
class YAPEnumPrologGenerator(object):

View File

@ -4504,12 +4504,15 @@ location( java_root, _, Home) :-
location(java_root, _, JRE) :-
% OS well-known
member(Root, [
/System/Library/Frameworks/JavaVM.framework/Versions/A/JavaV '/usr/lib',
'/usr/local/lib',
'/opt/lib',
'/Library/Java/JavaVirtualMachines',
'/System/Library/Frameworks'
]),
'/Library/Java/JavaVirtualMachines',
'/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation',
'/System/Library/PrivateFrameworks/JavaLaunching.framework/Versions/A/JavaLaunching',
'/System/Library/Frameworks/JavaVM.framework/Versions/A/Java',
'/usr/lib',
'/usr/local/lib',
'/opt/lib',
'/System/Library/Frameworks'
]),
exists_directory(Root),
jdk_jre( Root, JRE).

View File

@ -1,10 +1,11 @@
set(CMAKE_MACOSX_RPATH 1)
# set(CMAKE_MACOSX_RPATH 1)
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
add_lib(jplYap jpl.h jpl.c hacks.h)
include_directories (${JAVA_INCLUDE_DIRS} ${JNI_INCLUDE_DIRS} )
include_directories (${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2} ${JAVA_AWT_PATH} )
target_link_libraries(jplYap libYap ${JNI_LIBRARIES} ${JAVA_LIBRARIES})
target_link_libraries(jplYap libYap ${JAVA_JVM_LIBRARY} ${JAVA_AWT_LIBRARY})
set_target_properties(jplYap PROPERTIES
OUTPUT_NAME jpl

View File

View File

1
x.py
View File

@ -1 +0,0 @@
import yap_kernel

0
x.yap
View File