Bug#924083: unblock: swi-prolog/8.0.2+dfsg-1
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
Please unblock package swi-prolog
Currently there is 8.0.1+dfsg-1 in testing and 8.0.2+dfsg-1 in
unstable. These are two versions of SWI-Prolog current stable branch,
upstream's branch 8.1.X is development branch. There are no API
changes or any incompatibilities between 8.0.1 and 8.0.2, only bug
fixes. Also there are no new features or anything like that. I'd like
to stress that there are somewhat lots of bugs, which were fixed in
8.0.2, including crashes and buffer overruns (that is, bugs possibly
affecting security). You may check changes in git log of upstream git
repository [upstream] (changes between 8.0.1 and 8.0.2 start from
1e7c2e9a8283dcd4b56bb98512b45f601a628d5e commit).
[upstream] https://github.com/SWI-Prolog/swipl/
Please, find the debdiff attached. It is big, but a part of it is due
to documentation generation when upstream releases a new version.
Sorry for inconvenience.
With regards,
Lev Lamberov
unblock swi-prolog/8.0.2+dfsg-1
-- System Information:
Debian Release: buster/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 4.19.0-2-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=ru_RU.UTF-8, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8), LANGUAGE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
diff -Nru swi-prolog-8.0.1+dfsg/boot/init.pl swi-prolog-8.0.2+dfsg/boot/init.pl
--- swi-prolog-8.0.1+dfsg/boot/init.pl 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/boot/init.pl 2019-03-05 16:53:38.000000000 +0500
@@ -168,6 +168,8 @@
'$hide'(Pred) :-
'$set_predicate_attribute'(Pred, trace, false).
+:- '$iso'(((dynamic)/1, (multifile)/1, (discontiguous)/1)).
+
/********************************
* CALLING, CONTROL *
@@ -3588,6 +3590,12 @@
'$convert_option_value'(integer, String, Value) :-
( number_string(Value, String)
-> true
+ ; sub_string(String, 0, _, 1, SubString),
+ sub_string(String, _, 1, 0, Suffix0),
+ downcase_atom(Suffix0, Suffix),
+ number_string(Number, SubString),
+ '$suffix_multiplier'(Suffix, Multiplier)
+ -> Value is Number * Multiplier
; '$domain_error'(integer, String)
).
'$convert_option_value'(callable, String, Value) :-
@@ -3601,6 +3609,11 @@
'$convert_option_value'(ground, String, Value) :-
atom_string(Value, String).
+'$suffix_multiplier'(b, 1).
+'$suffix_multiplier'(k, 1024).
+'$suffix_multiplier'(m, 1024 * 1024).
+'$suffix_multiplier'(g, 1024 * 1024 * 1024).
+
/*******************************
* TYPE SUPPORT *
diff -Nru swi-prolog-8.0.1+dfsg/boot/messages.pl swi-prolog-8.0.2+dfsg/boot/messages.pl
--- swi-prolog-8.0.1+dfsg/boot/messages.pl 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/boot/messages.pl 2019-03-05 16:53:38.000000000 +0500
@@ -762,26 +762,6 @@
* GC *
*******************************/
-prolog_message(gc(start)) -->
- thread_context,
- [ 'GC: ', flush ].
-prolog_message(gc(done(G, T, Time, UG, UT, RG, RT))) -->
- [ at_same_line,
- 'gained ~D+~D in ~3f sec; used ~D+~D; free ~D+~D'-
- [G, T, Time, UG, UT, RG, RT]
- ].
-prolog_message(shift_stacks(start(_L,_G,_T))) -->
- thread_context,
- [ 'Stack-shift: ', flush ].
-prolog_message(shift_stacks(done(Time, L, G, T))) -->
- { LKB is L//1024,
- GKB is G//1024,
- TKB is T//1024
- },
- [ at_same_line,
- 'local: ~DKB, global: ~DKB, trail: ~DKB bytes (~2f sec)'-
- [LKB, GKB, TKB, Time]
- ].
prolog_message(agc(start)) -->
thread_context,
[ 'AGC: ', flush ].
diff -Nru swi-prolog-8.0.1+dfsg/boot/tabling.pl swi-prolog-8.0.2+dfsg/boot/tabling.pl
--- swi-prolog-8.0.1+dfsg/boot/tabling.pl 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/boot/tabling.pl 2019-03-05 16:53:38.000000000 +0500
@@ -333,6 +333,7 @@
{ atom(Name), integer(Arity), Arity >= 0,
!,
functor(Head, Name, Arity),
+ check_undefined(Name/Arity),
atom_concat(Name, ' tabled', WrapName),
Head =.. [Name|Args],
WrappedHead =.. [WrapName|Args],
@@ -350,6 +351,7 @@
!,
functor(ModeDirectedSpec, Name, Arity),
functor(Head, Name, Arity),
+ check_undefined(Name/Arity),
atom_concat(Name, ' tabled', WrapName),
Head =.. [Name|Args],
WrappedHead =.. [WrapName|Args],
@@ -373,6 +375,20 @@
{ '$type_error'(table_desclaration, TableSpec)
}.
+%! check_undefined(+PI)
+%
+% Verify the predicate has no clauses when the :- table is declared.
+%
+% @tbd: future versions may rename the existing predicate.
+
+check_undefined(Name/Arity) :-
+ functor(Head, Name, Arity),
+ prolog_load_context(module, Module),
+ clause(Module:Head, _),
+ !,
+ '$permission_error'(table, procedure, Name/Arity).
+check_undefined(_).
+
%! mode_check(+Moded, -TestCode)
%
% Enforce the output arguments of a mode-directed tabled predicate to
diff -Nru swi-prolog-8.0.1+dfsg/cmake/AlignOf.cmake swi-prolog-8.0.2+dfsg/cmake/AlignOf.cmake
--- swi-prolog-8.0.1+dfsg/cmake/AlignOf.cmake 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/cmake/AlignOf.cmake 2019-03-05 16:53:38.000000000 +0500
@@ -25,9 +25,9 @@
REGEX "^DOUBLE_ALIGNMENT=${alignof_pat_regex}" LIMIT_COUNT 1)
# Extract alignments from patterns and assign them to the variables
- string(REGEX MATCH "${alignof_pat_regex}$" int64_alignment ${alignof_int64_pat})
- string(REGEX MATCH "${alignof_pat_regex}$" double_alignment ${alignof_double_pat})
- string(REGEX MATCH "${alignof_pat_regex}$" voidp_alignment ${alignof_voidp_pat})
+ string(REGEX MATCH "${alignof_pat_regex}$" int64_alignment "${alignof_int64_pat}")
+ string(REGEX MATCH "${alignof_pat_regex}$" double_alignment "${alignof_double_pat}")
+ string(REGEX MATCH "${alignof_pat_regex}$" voidp_alignment "${alignof_voidp_pat}")
# Cache the results
set(${VAR_ALIGNOF_INT64_T} ${int64_alignment} CACHE STRING "Alignment of int64_t")
diff -Nru swi-prolog-8.0.1+dfsg/cmake/CheckAlignment.c swi-prolog-8.0.2+dfsg/cmake/CheckAlignment.c
--- swi-prolog-8.0.1+dfsg/cmake/CheckAlignment.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/cmake/CheckAlignment.c 2019-03-05 16:53:38.000000000 +0500
@@ -23,11 +23,12 @@
int prevent_optimization(unsigned char*p, int size) {
unsigned char *d;
+ int i;
//Prevent optimizer from eliminating the constants in main()
unsigned char dummy[size];
d = dummy;
- for (int i = 0; i < size; ++i) {
+ for (i = 0; i < size; ++i) {
*d++ = *p++;
}
return dummy[size-1];
diff -Nru swi-prolog-8.0.1+dfsg/cmake/CheckEnv.cmake swi-prolog-8.0.2+dfsg/cmake/CheckEnv.cmake
--- swi-prolog-8.0.1+dfsg/cmake/CheckEnv.cmake 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/cmake/CheckEnv.cmake 2019-03-05 16:53:38.000000000 +0500
@@ -1,42 +1,43 @@
function(conflicting_var name)
message(WARNING
- "-- $${name} is set to $ENV{${name}}\n"
+ "-- Environment variable ${name} is set to $ENV{${name}}\n"
+ "This suggests that the variable is referring to a existing installation of SWI-Prolog. "
"This may conflict with building SWI-Prolog as this may cause the "
- "build process to use components from an older installed version "
+ "build process to use components from such (older) installed version "
"of SWI-Prolog. Make sure to remove this environment from the "
"environment before building the system.")
endfunction()
if(CMAKE_EXECUTABLE_FORMAT STREQUAL "ELF" AND
- NOT x"$ENV{LD_PRELOAD}" STREQUAL x AND
- "$ENV{LD_PRELOAD}" MATCHES swipl)
+ DEFINED ENV{LD_PRELOAD} AND
+ "$ENV{LD_PRELOAD}" MATCHES swipl|swi-prolog)
conflicting_var(LD_PRELOAD)
endif()
if(UNIX)
if(APPLE)
- if(NOT x"$ENV{DYLD_LIBRARY_PATH}" STREQUAL x AND
- "$ENV{DYLD_LIBRARY_PATH}" MATCHES swipl)
+ if(DEFINED ENV{DYLD_LIBRARY_PATH} AND
+ "$ENV{DYLD_LIBRARY_PATH}" MATCHES swipl|swi-prolog)
conflicting_var(DYLD_LIBRARY_PATH)
endif()
else()
- if(NOT x"$ENV{LD_LIBRARY_PATH}" STREQUAL x AND
- "$ENV{LD_LIBRARY_PATH}" MATCHES swipl)
- conflicting_var(DYLD_LIBRARY_PATH)
+ if(DEFINED ENV{LD_LIBRARY_PATH} AND
+ "$ENV{LD_LIBRARY_PATH}" MATCHES swipl|swi-prolog)
+ conflicting_var(LD_LIBRARY_PATH)
endif()
endif()
elseif(WIN32)
- if(NOT x"$ENV{PATH}" STREQUAL x AND
- "$ENV{PATH}" MATCHES swipl)
+ if(DEFINED ENV{PATH} AND
+ "$ENV{PATH}" MATCHES swipl|swi-prolog)
conflicting_var(PATH)
endif()
endif()
-if(NOT x"$ENV{SWI_HOME_DIR}" STREQUAL x AND
- IS_DIRECTORY "$ENV{SWIPL}")
+if(DEFINED ENV{SWI_HOME_DIR} AND
+ IS_DIRECTORY "$ENV{SWI_HOME_DIR}")
conflicting_var(SWI_HOME_DIR)
endif()
-if(NOT "$ENV{SWIPL}" STREQUAL x AND
+if(DEFINED ENV{SWIPL} AND
IS_DIRECTORY "$ENV{SWIPL}")
conflicting_var(SWIPL)
endif()
diff -Nru swi-prolog-8.0.1+dfsg/cmake/EmscriptenTargets.cmake swi-prolog-8.0.2+dfsg/cmake/EmscriptenTargets.cmake
--- swi-prolog-8.0.1+dfsg/cmake/EmscriptenTargets.cmake 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/cmake/EmscriptenTargets.cmake 2019-03-05 16:53:38.000000000 +0500
@@ -31,7 +31,6 @@
-s WASM=1
-s MODULARIZE=1
-s EXPORT_NAME=SWIPL
- -s BINARYEN_METHOD='native-wasm'
-s BINARYEN_TRAP_MODE=clamp
-s NO_EXIT_RUNTIME=0
-s EXPORTED_FUNCTIONS=@${CMAKE_SOURCE_DIR}/src/wasm/exports.json
diff -Nru swi-prolog-8.0.1+dfsg/cmake/Pack.cmake swi-prolog-8.0.2+dfsg/cmake/Pack.cmake
--- swi-prolog-8.0.1+dfsg/cmake/Pack.cmake 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/cmake/Pack.cmake 2019-03-05 16:53:38.000000000 +0500
@@ -56,7 +56,27 @@
endif()
endif()
+# see https://crascit.com/2015/08/07/cmake_cpack_nsis_shortcuts_with_parameters/
+
if(WIN32)
+ set(CPACK_NSIS_CREATE_ICONS_EXTRA "")
+
+ function(createShortCut name exe options desktop)
+ set(CPACK_NSIS_CREATE_ICONS_EXTRA
+ "${CPACK_NSIS_CREATE_ICONS_EXTRA}\n CreateShortCut '$SMPROGRAMS\\\\$STARTMENU_FOLDER\\\\${name}.lnk' '$INSTDIR\\\\bin\\\\${exe}.exe' '${options}'")
+ set(CPACK_NSIS_DELETE_ICONS_EXTRA
+ "${CPACK_NSIS_DELETE_ICONS_EXTRA}\n Delete '$SMPROGRAMS\\\\$START_MENU\\\\${name}.lnk'")
+ if(desktop)
+ set(CPACK_NSIS_CREATE_ICONS_EXTRA
+ "${CPACK_NSIS_CREATE_ICONS_EXTRA}\n StrCmp '$INSTALL_DESKTOP' '1' 0 +2\n CreateShortCut '$DESKTOP\\\\${name}.lnk' '$INSTDIR\\\\bin\\\\${exe}.exe' '${options}'")
+ set(CPACK_NSIS_DELETE_ICONS_EXTRA
+ "${CPACK_NSIS_DELETE_ICONS_EXTRA}\n Delete '$DESKTOP\\\\${name}.lnk'")
+ endif()
+
+ set(CPACK_NSIS_CREATE_ICONS_EXTRA "${CPACK_NSIS_CREATE_ICONS_EXTRA}" PARENT_SCOPE)
+ set(CPACK_NSIS_DELETE_ICONS_EXTRA "${CPACK_NSIS_DELETE_ICONS_EXTRA}" PARENT_SCOPE)
+ endfunction()
+
set(CPACK_PACKAGE_INSTALL_DIRECTORY swipl)
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
@@ -64,8 +84,9 @@
set(CPACK_NSIS_DISPLAY_NAME "SWI-Prolog ${CPACK_PACKAGE_VERSION}")
set(CPACK_NSIS_URL_INFO_ABOUT "http://swi-prolog.org")
set(CPACK_NSIS_INSTALLED_ICON_NAME bin\\\\swipl-win.exe)
-# does not work
-# set(CPACK_NSIS_DEFINES " !define MUI_STARTMENUPAGE_DEFAULTFOLDER \\\"SWI-Prolog\\\"")
+
+ createShortCut("SWI-Prolog" "swipl-win" "--win_app" ON)
+ createShortCut("SWI-Prolog (console)" "swipl" "" OFF)
endif()
set(CPACK_PACKAGE_FILE_NAME
diff -Nru swi-prolog-8.0.1+dfsg/cmake/port/Darwin.cmake swi-prolog-8.0.2+dfsg/cmake/port/Darwin.cmake
--- swi-prolog-8.0.1+dfsg/cmake/port/Darwin.cmake 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/cmake/port/Darwin.cmake 2019-03-05 16:53:38.000000000 +0500
@@ -46,6 +46,10 @@
if(BUILD_MACOS_BUNDLE)
set(MACOS_APP "SWI-Prolog")
+ set(X11_ROOT /opt/X11)
+ set(Freetype_ROOT /opt/X11)
+ set(FontConfig_ROOT /opt/X11)
+
find_package(Qt5 COMPONENTS Widgets REQUIRED)
get_target_property(uic_location Qt5::uic IMPORTED_LOCATION)
diff -Nru swi-prolog-8.0.1+dfsg/cmake/port/Emscripten.cmake swi-prolog-8.0.2+dfsg/cmake/port/Emscripten.cmake
--- swi-prolog-8.0.1+dfsg/cmake/port/Emscripten.cmake 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/cmake/port/Emscripten.cmake 2019-03-05 16:53:38.000000000 +0500
@@ -1,3 +1,8 @@
# We could set set linker flags for all excutables if we
# could override them for the browser binary.
#set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -s ASSERTIONS=2 -s NODERAWFS=1 -s EXIT_RUNTIME=1")
+
+# AlignOf.cmake doesn't work for Emscripten
+set(ALIGNOF_INT64_T 8 CACHE STRING "Alignment for int64_t")
+set(ALIGNOF_VOIDP ${SIZEOF_VOIDP} CACHE STRING "Alignment for pointers")
+set(ALIGNOF_DOUBLE 8 CACHE STRING "Alignment for double")
diff -Nru swi-prolog-8.0.1+dfsg/cmake/Ports.cmake swi-prolog-8.0.2+dfsg/cmake/Ports.cmake
--- swi-prolog-8.0.1+dfsg/cmake/Ports.cmake 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/cmake/Ports.cmake 2019-03-05 16:53:38.000000000 +0500
@@ -93,8 +93,9 @@
set(PROG_SWIPL_FOR_BOOT $<TARGET_FILE:swipl>)
endif()
else()
- set(PROG_SWIPL $<TARGET_FILE:swipl>
+ set(PROG_SWIPL_TARGET_FILE $<TARGET_FILE:swipl>
CACHE STRING "SWI-Prolog executable to perform build tasks")
+ set(PROG_SWIPL ${CMAKE_CROSSCOMPILING_EMULATOR} ${PROG_SWIPL_TARGET_FILE})
set(PROG_SWIPL_FOR_BOOT ${PROG_SWIPL})
endif()
else(CMAKE_CROSSCOMPILING)
diff -Nru swi-prolog-8.0.1+dfsg/CMakeLists.txt swi-prolog-8.0.2+dfsg/CMakeLists.txt
--- swi-prolog-8.0.1+dfsg/CMakeLists.txt 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/CMakeLists.txt 2019-03-05 16:53:38.000000000 +0500
@@ -3,6 +3,7 @@
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_POLICY_DEFAULT_CMP0075 NEW)
+set(CMAKE_POLICY_DEFAULT_CMP0074 NEW)
option(MULTI_THREADED
"Enable multiple Prolog threads"
diff -Nru swi-prolog-8.0.1+dfsg/CMAKE.md swi-prolog-8.0.2+dfsg/CMAKE.md
--- swi-prolog-8.0.1+dfsg/CMAKE.md 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/CMAKE.md 2019-03-05 16:53:38.000000000 +0500
@@ -34,12 +34,17 @@
### Getting the source
-The source imay be downloaded as a tar ball from
-http://www.swi-prolog.org or downloaded using git. The git sequencen is:
+The source may be downloaded as a tar ball from
+http://www.swi-prolog.org or downloaded using git. The git sequence is:
git clone https://github.com/SWI-Prolog/swipl-devel.git
+ cd swipl-devel
git submodule update --init
+If not all modules are needed, one can clone/update particular ones as follows:
+
+ git submodule update --init packages/jpl packages/clib packages/sgml
+
### Building from source
@@ -79,8 +84,26 @@
The default build type is `RelWithDebInfo`. Alternatives may be selected
using e.g.,
- cmake -DCMAKE_BUILD_TYPE=Debug
- cmake -DCMAKE_BUILD_TYPE=Release
+ cmake -DCMAKE_BUILD_TYPE=Debug -G Ninja ..
+ cmake -DCMAKE_BUILD_TYPE=Release -G Ninja ..
+
+## Install location
+
+To install in a particular location, use `-DCMAKE_INSTALL_PREFIX:PATH=/path/to/install`. For example, this will build SWI to be installed in `/usr/local/swipl-git` and will not include the documentation (see below for other customization options):
+
+ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/swipl-git -DINSTALL_DOCUMENTATION=OFF ..
+
+After `sudo make install`, SWI will be located in `/usr/local/swipl-git`. Next adapt environment variables `SWI_HOME_DIR` and `LD_LIBRARY_PATH` to point to the new compiled and installed SWI system:
+
+ export SWI_HOME_DIR=/usr/local/swipl-git/lib/swipl/
+ export LD_LIBRARY_PATH=/usr/local/swipl-git/lib/swipl/lib/x86_64-linux/:$LD_LIBRARY_PATH
+
+Finally, you can run it:
+
+ /usr/local/swipl-git/bin/swipl
+
+_NOTE:_ if there is already an installed SWI (e.g., the one coming with a Linux distribution), running `swipl` will run the new installed system pointed by `SWI_HOME_DIR`.
+
## Customizing SWI-Prolog
@@ -350,4 +373,13 @@
## Issues
- - Provide a FindSWIPL.cmake?
+- Provide a FindSWIPL.cmake?
+- Problem compiling SWI when another SWI is installed already and you
+ have environment variables set to facilitate e.g., embedding in Java.
+ The variable names and possibly conflicting values depend on the OS.
+ See [issue](https://github.com/SWI-Prolog/swipl-devel/issues/435)
+
+
+
+
+
diff -Nru swi-prolog-8.0.1+dfsg/debian/changelog swi-prolog-8.0.2+dfsg/debian/changelog
--- swi-prolog-8.0.1+dfsg/debian/changelog 2019-01-27 11:40:22.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/debian/changelog 2019-03-09 10:26:08.000000000 +0500
@@ -1,3 +1,11 @@
+swi-prolog (8.0.2+dfsg-1) unstable; urgency=medium
+
+ * New upstream stable version 8.0.2+dfsg
+ * Refresh patches
+ * d/copyright: Bump copyright years
+
+ -- Lev Lamberov <dogsleg@debian.org> Sat, 09 Mar 2019 10:26:08 +0500
+
swi-prolog (8.0.1+dfsg-1) unstable; urgency=medium
* New upstream stable version 8.0.1+dfsg
diff -Nru swi-prolog-8.0.1+dfsg/debian/copyright swi-prolog-8.0.2+dfsg/debian/copyright
--- swi-prolog-8.0.1+dfsg/debian/copyright 2019-01-27 11:40:22.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/debian/copyright 2019-03-09 10:26:08.000000000 +0500
@@ -187,7 +187,7 @@
(C) 2006 Gerardo Curiel <gcuriel@debianvenezuela.org>
(C) 2007-2011 Chris Lamb <lamby@debian.org>
(C) 2011-2015 Eugeniy Meshcheryakov <eugen@debian.org>
- (C) 2016-2018 Lev Lamberov <dogsleg@debian.org>
+ (C) 2016-2019 Lev Lamberov <dogsleg@debian.org>
License: GPL-2+
License: Beerware
diff -Nru swi-prolog-8.0.1+dfsg/debian/patches/no_extra_documentation.diff swi-prolog-8.0.2+dfsg/debian/patches/no_extra_documentation.diff
--- swi-prolog-8.0.1+dfsg/debian/patches/no_extra_documentation.diff 2019-01-27 11:40:22.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/debian/patches/no_extra_documentation.diff 2019-03-09 10:26:08.000000000 +0500
@@ -5,7 +5,7 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
-@@ -135,7 +135,7 @@ set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME
+@@ -147,7 +147,7 @@ set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME
# Add the core Prolog system
add_subdirectory(src)
diff -Nru swi-prolog-8.0.1+dfsg/library/prolog_colour.pl swi-prolog-8.0.2+dfsg/library/prolog_colour.pl
--- swi-prolog-8.0.1+dfsg/library/prolog_colour.pl 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/library/prolog_colour.pl 2019-03-05 16:53:38.000000000 +0500
@@ -3,8 +3,9 @@
Author: Jan Wielemaker
E-mail: J.Wielemaker@vu.nl
WWW: http://www.swi-prolog.org/projects/xpce/
- Copyright (c) 2011-2018, University of Amsterdam
+ Copyright (c) 2011-2019, University of Amsterdam
VU University Amsterdam
+ CWI, Amsterdam
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -1717,17 +1718,19 @@
[ MP,
term_position(_,_,FF,FT,ArgPos)
])) :-
+ compound(Head),
!,
colourise_module(M, TB, MP),
colour_item(functor, TB, QF-QT),
colour_item(goal(extern(M),Head), TB, FF-FT),
- Head =.. [_|Args],
+ compound_name_arguments(Head, _, Args),
colourise_meta_decls(Args, Extra, TB, ArgPos).
colourise_meta_declaration(Head, Extra, TB, term_position(_,_,FF,FT,ArgPos)) :-
+ compound(Head),
!,
goal_classification(TB, Head, [], Class),
colour_item(goal(Class, Head), TB, FF-FT),
- Head =.. [_|Args],
+ compound_name_arguments(Head, _, Args),
colourise_meta_decls(Args, Extra, TB, ArgPos).
colourise_meta_declaration([H|T], Extra, TB, list_position(LF,LT,[HP],TP)) :-
!,
diff -Nru swi-prolog-8.0.1+dfsg/library/prolog_pack.pl swi-prolog-8.0.2+dfsg/library/prolog_pack.pl
--- swi-prolog-8.0.1+dfsg/library/prolog_pack.pl 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/library/prolog_pack.pl 2019-03-05 16:53:38.000000000 +0500
@@ -1439,9 +1439,23 @@
).
pack_remove_forced(Pack) :-
- '$pack_detach'(Pack, BaseDir),
+ catch('$pack_detach'(Pack, BaseDir),
+ error(existence_error(pack, Pack), _),
+ fail),
+ !,
print_message(informational, pack(remove(BaseDir))),
delete_directory_and_contents(BaseDir).
+pack_remove_forced(Pack) :-
+ directory_file_path(Pack, 'pack.pl', PackFile),
+ absolute_file_name(pack(PackFile), PackPath,
+ [ access(read),
+ file_errors(fail)
+ ]),
+ !,
+ file_directory_name(PackPath, BaseDir),
+ delete_directory_and_contents(BaseDir).
+pack_remove_forced(Pack) :-
+ print_message(informational, error(existence_error(pack, Pack),_)).
confirm_remove(Pack, Deps, Delete) :-
print_message(warning, pack(depends(Pack, Deps))),
diff -Nru swi-prolog-8.0.1+dfsg/library/qsave.pl swi-prolog-8.0.2+dfsg/library/qsave.pl
--- swi-prolog-8.0.1+dfsg/library/qsave.pl 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/library/qsave.pl 2019-03-05 16:53:38.000000000 +0500
@@ -284,7 +284,8 @@
save_toplevel_goal(Out, _Default, Options) :-
option(toplevel(Goal), Options),
!,
- format(Out, 'toplevel=~q~n', [Goal]).
+ unqualify_reserved_goal(Goal, Goal1),
+ format(Out, 'toplevel=~q~n', [Goal1]).
save_toplevel_goal(Out, _Default, _Options) :-
'$cmd_option_val'(toplevel, Toplevel),
Toplevel \== default,
@@ -293,6 +294,10 @@
save_toplevel_goal(Out, Default, _Options) :-
format(Out, 'toplevel=~q~n', [Default]).
+unqualify_reserved_goal(_:prolog, prolog) :- !.
+unqualify_reserved_goal(_:default, default) :- !.
+unqualify_reserved_goal(Goal, Goal).
+
/*******************************
* RESOURCES *
diff -Nru swi-prolog-8.0.1+dfsg/library/sandbox.pl swi-prolog-8.0.2+dfsg/library/sandbox.pl
--- swi-prolog-8.0.1+dfsg/library/sandbox.pl 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/library/sandbox.pl 2019-03-05 16:53:38.000000000 +0500
@@ -3,7 +3,8 @@
Author: Jan Wielemaker
E-mail: J.Wielemaker@vu.nl
WWW: http://www.swi-prolog.org
- Copyright (c) 2013-2016, VU University Amsterdam
+ Copyright (c) 2013-2019, VU University Amsterdam
+ CWI, Amsterdam
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -538,6 +539,8 @@
safe_primitive(=\=(_,_)).
safe_primitive(=<(_,_)).
safe_primitive(<(_,_)).
+safe_primitive(system:nth_integer_root_and_remainder(_,_,_,_)).
+
% term-handling
safe_primitive(arg(_,_,_)).
safe_primitive(system:setarg(_,_,_)).
@@ -702,6 +705,8 @@
safe_primitive(system:nb_getval(_,_)).
safe_primitive('$syspreds':nb_setval(Var,_)) :-
safe_global_var(Var).
+safe_primitive(system:nb_linkval(Var,_)) :-
+ safe_global_var(Var).
safe_primitive(system:nb_current(_,_)).
% database
safe_primitive(system:assert(X)) :-
diff -Nru swi-prolog-8.0.1+dfsg/man/main.doc swi-prolog-8.0.2+dfsg/man/main.doc
--- swi-prolog-8.0.1+dfsg/man/main.doc 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/man/main.doc 2019-03-05 16:53:38.000000000 +0500
@@ -59,9 +59,9 @@
\newcommand{\vmajor}{8}
\newcommand{\vminor}{0}
-\newcommand{\vpatch}{1}
+\newcommand{\vpatch}{2}
\newcommand{\vtag}{}
-\newcommand{\vmonth}{January}
+\newcommand{\vmonth}{March}
\newcommand{\vyear}{2019}
#ifdef BOOK
diff -Nru swi-prolog-8.0.1+dfsg/man/overview.doc swi-prolog-8.0.2+dfsg/man/overview.doc
--- swi-prolog-8.0.1+dfsg/man/overview.doc 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/man/overview.doc 2019-03-05 16:53:38.000000000 +0500
@@ -2549,7 +2549,7 @@
and class names\footnote{Samer Abdallah suggested this feature based on
experience with non-Prolog users using the RDF library.} and the R
interface for specifying functions or variables that start with an
-uppercase character. Lexical databases were part of the terms start with
+uppercase character. Lexical databases where part of the terms start with
an uppercase letter is another category were the readability of the code
improves using this option.
diff -Nru swi-prolog-8.0.1+dfsg/man/runtime.doc swi-prolog-8.0.2+dfsg/man/runtime.doc
--- swi-prolog-8.0.1+dfsg/man/runtime.doc 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/man/runtime.doc 2019-03-05 16:53:38.000000000 +0500
@@ -109,10 +109,13 @@
\begin{description}
\termitem{stack_limit}{+Bytes}
Sets default stack limit for the new process. See the command line
-option \cmdlineoption{--stack-limit} and the Prolog flag
+option \cmdlineoption{--stack_limit} and the Prolog flag
\prologflag{stack_limit}.
\termitem{goal}{:Callable}
Initialization goal for the new executable (see \cmdlineoption{-g}).
+Two values have special meaning: \const{prolog} starts the Prolog
+toplevel and \const{default} runs halt/0 if there are initialization
+goals and the prolog/0 toplevel otherwise.
\termitem{toplevel}{:Callable}
Top-level goal for the new executable (see \cmdlineoption{-t}). Similar
to initialization/2 using \const{main}, the default toplevel is to enter
diff -Nru swi-prolog-8.0.1+dfsg/packages/archive/archive.pl swi-prolog-8.0.2+dfsg/packages/archive/archive.pl
--- swi-prolog-8.0.1+dfsg/packages/archive/archive.pl 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/archive/archive.pl 2019-01-29 19:39:57.000000000 +0500
@@ -3,7 +3,7 @@
Author: Jan Wielemaker and Matt Lilley
E-mail: J.Wielemaker@cs.vu.nl
WWW: http://www.swi-prolog.org
- Copyright (c) 2012-2018, VU University Amsterdam
+ Copyright (c) 2012-2019, VU University Amsterdam
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -45,19 +45,23 @@
archive_extract/3, % +Archive, +Dir, +Options
archive_entries/2, % +Archive, -Entries
- archive_data_stream/3 % +Archive, -DataStream, +Options
+ archive_data_stream/3, % +Archive, -DataStream, +Options
+ archive_foldl/4 % :Goal, +Archive, +State0, -State
]).
:- use_module(library(error)).
:- use_module(library(lists)).
:- use_module(library(option)).
:- use_module(library(filesex)).
+:- meta_predicate
+ archive_foldl(4, +, +, -).
+
/** <module> Access several archive formats
This library uses _libarchive_ to access a variety of archive formats.
The following example lists the entries in an archive:
- ==
+ ```
list_archive(File) :-
archive_open(File, Archive, []),
repeat,
@@ -67,9 +71,24 @@
; !,
archive_close(Archive)
).
- ==
+ ```
+
+Here is another example which counts the files in the archive and prints
+file type information. It uses archive_foldl/4, a higher level
+predicate:
+
+ ```
+ print_entry(Path, Handle, Cnt0, Cnt1) :-
+ archive_header_property(Handle, filetype(Type)),
+ format('File ~w is of type ~w~n', [Path, Type]),
+ Cnt1 is Cnt0 + 1.
+
+ list_archive(File) :-
+ archive_foldl(print_entry, File, 0, FileCount),
+ format('We have ~w files', [FileCount]).
+ ```
-@see http://code.google.com/p/libarchive/
+@see https://github.com/libarchive/libarchive/
*/
:- use_foreign_library(foreign(archive4pl)).
@@ -551,3 +570,29 @@
entry_name('.', Name, Name) :- !.
entry_name(Base, Name, EntryName) :-
directory_file_path(Base, EntryName, Name).
+
+%! archive_foldl(:Goal, +Archive, +State0, -State).
+%
+% Operates like foldl/4 but for the entries in the archive. For each
+% member of the archive, Goal called as `call(:Goal, +Path, +Handle,
+% +S0, -S1). Here, `S0` is current state of the _accumulator_
+% (starting with State0) and `S1` is the next state of the
+% accumulator, producing State after the last member of the archive.
+%
+% @see archive_header_property/2, archive_open/4.
+%
+% @arg Archive File name or stream to be given to archive_open/[3,4].
+
+archive_foldl(Goal, Archive, State0, State) :-
+ setup_call_cleanup(
+ archive_open(Archive, Handle, [close_parent(true)]),
+ archive_foldl_(Goal, Handle, State0, State),
+ archive_close(Handle)
+ ).
+
+archive_foldl_(Goal, Handle, State0, State) :-
+ ( archive_next_header(Handle, Path)
+ -> call(Goal, Path, Handle, State0, State1),
+ archive_foldl_(Goal, Handle, State1, State)
+ ; State = State0
+ ).
diff -Nru swi-prolog-8.0.1+dfsg/packages/clib/filesex.pl swi-prolog-8.0.2+dfsg/packages/clib/filesex.pl
--- swi-prolog-8.0.1+dfsg/packages/clib/filesex.pl 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/clib/filesex.pl 2019-01-28 18:16:10.000000000 +0500
@@ -514,7 +514,7 @@
% a plain `Mode`, which adds new permissions, revokes permissions or
% sets the exact permissions. `Mode` itself is an integer, a POSIX
% mode name or a list of POSIX mode names. Defines names are `suid`,
-% `sgid`, `svtx` and the all names defined by the regular expression
+% `sgid`, `svtx` and all names defined by the regular expression
% =|[ugo]*[rwx]*|=. Specifying none of "ugo" is the same as specifying
% all of them. For example, to make a file executable for the owner
% (user) and group, we can use:
diff -Nru swi-prolog-8.0.1+dfsg/packages/http/http_header.pl swi-prolog-8.0.2+dfsg/packages/http/http_header.pl
--- swi-prolog-8.0.1+dfsg/packages/http/http_header.pl 2019-01-25 20:33:06.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/http/http_header.pl 2019-02-12 14:52:05.000000000 +0500
@@ -2451,8 +2451,7 @@
%
% True if input represents a valid Cookie option. Officially, all
% cookie options use the syntax <name>=<value>, except for
-% =secure=. M$ decided to extend this to include at least
-% =httponly= (only the Gods know what it means).
+% =Secure= and =HttpOnly=.
%
% @param Option Term of the form Name=Value
% @bug Incorrectly accepts options without = for M$ compatibility.
diff -Nru swi-prolog-8.0.1+dfsg/packages/http/json.md swi-prolog-8.0.2+dfsg/packages/http/json.md
--- swi-prolog-8.0.1+dfsg/packages/http/json.md 2019-01-25 20:33:06.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/http/json.md 2019-02-12 14:52:05.000000000 +0500
@@ -1,4 +1,4 @@
----+ [jsonsupport] Supporting JSON
+# Supporting JSON {#jsonsupport}
From http://json.org, "
JSON (JavaScript Object Notation) is a lightweight data-interchange
@@ -11,20 +11,38 @@
many others. These properties make JSON an ideal data-interchange
language."
-JSON is interesting to Prolog because using AJAX web technology we can
-easily created web-enabled user interfaces where we implement the server
-side using the SWI-Prolog HTTP services provided by this package.
-The interface consists of three libraries:
+Although JSON is nowadays used a lot outside the context of web
+applications, SWI-Prolog's support for JSON started life as part of the
+HTTP package. SWI-Prolog supports two Prolog representations for JSON
+terms. The first and oldest map JSON objects to a term
+json(PropertyList) and use the `@` functor to disambiguate e.g. `null`
+from the string `"null"`, leading to `@(null)`. As of SWI-Prolog version
+7, JSON objects may be represented using _dict_ objects and JSON strings
+using Prolog strings. Predicates following this convention are suffixed
+with ``_dict``, e.g. json_read_dict/2. For example, given the JSON document
+
+ { "name": "Bob", "children": ["Mary", "John"], "age":42, "married": true }
+
+we get either (using json_read/2):
+
+ json([name='Bob', children=['Mary', 'John'], age=42, married= @(true)]).
+
+or (using json_read_dict/2):
+
+ _{age:42, children:["Mary", "John"], married:true, name:"Bob"}
+
+
+The SWI-Prolog JSON interface consists of three libraries:
* library(http/json) provides support for the core JSON object
- serialization.
+ serialization and parsing.
* library(http/json_convert) converts between the primary
representation of JSON terms in Prolog and more application
oriented Prolog terms. E.g. point(X,Y) vs. object([x=X,y=Y]).
* library(http/http_json) hooks the conversion libraries into
the HTTP client and server libraries.
- [[json.pl]]
- [[json_convert.pl]]
- [[http_json.pl]]
+ [[library(http/json)]]
+ [[library(http/json_convert)]]
+ [[library(http/http_json)]]
diff -Nru swi-prolog-8.0.1+dfsg/packages/http/json.pl swi-prolog-8.0.2+dfsg/packages/http/json.pl
--- swi-prolog-8.0.1+dfsg/packages/http/json.pl 2019-01-25 20:33:06.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/http/json.pl 2019-02-12 14:52:05.000000000 +0500
@@ -3,7 +3,7 @@
Author: Jan Wielemaker
E-mail: J.Wielemaker@vu.nl
WWW: http://www.swi-prolog.org
- Copyright (c) 2007-2018, University of Amsterdam
+ Copyright (c) 2007-2019, University of Amsterdam
VU University Amsterdam
CWI, Amsterdam
All rights reserved.
@@ -895,6 +895,8 @@
% Default the atom `true`.
% * false(+FalseTerm)
% Default the atom `false`
+% * end_of_file(+ErrorOrTerm)
+% Action on reading end-of-file. See json_read/3 for details.
% * value_string_as(+Type)
% Prolog type used for strings used as value. Default
% is `string`. The alternative is `atom`, producing a
diff -Nru swi-prolog-8.0.1+dfsg/packages/jpl/CMakeLists.txt swi-prolog-8.0.2+dfsg/packages/jpl/CMakeLists.txt
--- swi-prolog-8.0.1+dfsg/packages/jpl/CMakeLists.txt 2019-01-17 20:28:26.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/jpl/CMakeLists.txt 2019-02-12 14:53:23.000000000 +0500
@@ -151,6 +151,7 @@
swipl_examples(FILES ${EXPL} SUBDIR prolog)
swipl_examples(DIRECTORIES ${EXJAVA} SUBDIR java)
+swipl_examples(FILES examples/java/env.sh SUBDIR java)
################
# Documentation
diff -Nru swi-prolog-8.0.1+dfsg/packages/jpl/docs/JavaApiOverview.md swi-prolog-8.0.2+dfsg/packages/jpl/docs/JavaApiOverview.md
--- swi-prolog-8.0.1+dfsg/packages/jpl/docs/JavaApiOverview.md 2019-01-17 20:28:26.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/jpl/docs/JavaApiOverview.md 2019-02-12 14:53:23.000000000 +0500
@@ -383,9 +383,18 @@
JPL 7.4.0-alpha
```
-## Gotchas
+## Gotchas
-### Arg indexing
+### Variables are named
+
+Instances of `org.jpl7.Variable` have names, and bindings are retrieved by name, e.g.
+
+```
+Map m = org.jpl7.Query.oneSolution("statistics(heap, X)");
+long heapsize = m.get("X");
+```
+
+### Argument numbering
The `Term[]` args of a `Compound` are indexed (like all Java arrays) from zero, whereas in Prolog the args of a structure are conventionally numbered from one.
diff -Nru swi-prolog-8.0.1+dfsg/packages/jpl/docs/_layouts/default.html swi-prolog-8.0.2+dfsg/packages/jpl/docs/_layouts/default.html
--- swi-prolog-8.0.1+dfsg/packages/jpl/docs/_layouts/default.html 2019-01-17 20:28:26.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/jpl/docs/_layouts/default.html 2019-02-12 14:53:23.000000000 +0500
@@ -390,7 +390,8 @@
<li class="level3 navJavaApiOverview"><div onclick="scrollToId('debugging')">Debugging</div></li>
<li class="level3 navJavaApiOverview"><div onclick="scrollToId('version-information')">Version information</div></li>
<li class="level3 navJavaApiOverview"><div onclick="scrollToId('gotchas')">Gotchas</div></li>
- <li class="level4 navJavaApiOverview"><div onclick="scrollToId('arg-indexing')">Arg indexing</div></li>
+ <li class="level4 navJavaApiOverview"><div onclick="scrollToId('variables-are-named')">Variables are named</div></li>
+ <li class="level4 navJavaApiOverview"><div onclick="scrollToId('argument-numbering')">Argument numbering</div></li>
<li class="level4 navJavaApiOverview"><div onclick="scrollToId('representing-null')">Representing @(null)</div></li>
<li class="level4 navJavaApiOverview"><div onclick="scrollToId('all-solutions-of-a-query-with-no-solutions')">All solutions of a Query with no solutions</div></li>
<!--
diff -Nru swi-prolog-8.0.1+dfsg/packages/jpl/docs/PrologApiOverview.md swi-prolog-8.0.2+dfsg/packages/jpl/docs/PrologApiOverview.md
--- swi-prolog-8.0.1+dfsg/packages/jpl/docs/PrologApiOverview.md 2019-01-17 20:28:26.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/jpl/docs/PrologApiOverview.md 2019-02-12 14:53:23.000000000 +0500
@@ -1,9 +1,9 @@
# Prolog API - Overview
The Prolog API comprises Prolog library predicates which support:
- * creating instances (objects) of Java classes (built-in and user-defined);
- * calling methods of Java objects (and static methods of classes), perhaps returning values or object references; and
- * getting and setting the values of fields of Java objects and classes.
+* creating instances (objects) of Java classes (built-in and user-defined);
+* calling methods of Java objects (and static methods of classes), perhaps returning values or object references; and
+* getting and setting the values of fields of Java objects and classes.
## Introduction
@@ -326,6 +326,22 @@
Unfortunately it is far from trivial to support the Java naming in JPL. Thanks go to Timo Baumann and Sebastian Godelet for their input on this issue.
+### Instantiating a non-static member class
+
+If you need to create an instance of a non-static member class, you must explicitly pass (a reference to) an instance of its parent class as an additional (first) argument of any of its constructors. Java source syntax hides this, but reflection shows that every constructor (implicit or explicit) has this extra argument.
+
+```java
+public class Parent {
+ public class Child {
+ }
+}
+```
+
+```prolog
+jpl_new('Parent', [], P),
+jpl_new('Parent$Child', [P], C).
+```
+
### Enums are static nested classes
Given
diff -Nru swi-prolog-8.0.1+dfsg/packages/jpl/docs/PrologApiReference.md swi-prolog-8.0.2+dfsg/packages/jpl/docs/PrologApiReference.md
--- swi-prolog-8.0.1+dfsg/packages/jpl/docs/PrologApiReference.md 2019-01-17 20:28:26.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/jpl/docs/PrologApiReference.md 2019-02-12 14:53:23.000000000 +0500
@@ -7,9 +7,9 @@
Create a new Java object.
*X* can be:
-* an atomic classname, e.g. `'java.lang.String'` (or `'Ljava.lang.String;'`)
+* an atomic classname, e.g. `'java.util.Date'`
* a suitable type, i.e. any `class(_,_)`, `array(_)` or primitive type (e.g. `byte`) but not `null` or `void
-* an atomic descriptor, e.g. `'[I'`
+* an atomic descriptor, e.g. `'[I'` or `'[Ljava.lang.String;'`
* a class object, i.e. an object whose type is `class([java,lang],['Class'])`
*Args* is typically a list of datums (values or jrefs) to be passed to the appropriate constructor.
diff -Nru swi-prolog-8.0.1+dfsg/packages/jpl/examples/java/env.sh swi-prolog-8.0.2+dfsg/packages/jpl/examples/java/env.sh
--- swi-prolog-8.0.1+dfsg/packages/jpl/examples/java/env.sh 2019-01-17 20:28:26.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/jpl/examples/java/env.sh 2019-02-12 14:53:23.000000000 +0500
@@ -58,17 +58,34 @@
# Setup the environment
################################################################
-eval `$PL -dump-runtime-variables`
+eval `$PL --dump-runtime-variables`
PLLIBDIR="$PLBASE/lib/$PLARCH"
if [ -z "$JPLJAR" ]; then
- JPLJAR="$PLBASE/lib/jpl.jar"
+ if [ -f "$PLBASE/lib/jpl.jar" ]; then
+ JPLJAR="$PLBASE/lib/jpl.jar"
+ elif [ -f "$PLBASE/../packages/jpl/src/java/jpl.jar" ]; then
+ JPLJAR="$PLBASE/../packages/jpl/src/java/jpl.jar"
+ else
+ echo "ERROR: Cannot find jpl.jar (PLBASE=$PLBASE)"
+ exit 1
+ fi
+fi
+
+JPL_LIBRARY_PATH="$PLLIBDIR"
+if [ ! -f "$PLLIBDIR/libjpl.$PLSOEXT" ]; then
+ if [ -f "$PLBASE/../packages/jpl/libjpl.$PLSOEXT" ]; then
+ JPL_LIBRARY_PATH="$PLLIBDIR:$PLBASE/../packages/jpl"
+ else
+ echo "ERROR: Cannot find libjpl.$PLSOEXT"
+ exit 1
+ fi
fi
if [ -z "$LD_LIBRARY_PATH" ]; then
- LD_LIBRARY_PATH="$PLLIBDIR";
+ LD_LIBRARY_PATH="$JPL_LIBRARY_PATH";
else
- LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PLLIBDIR"
+ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$JPL_LIBRARY_PATH"
fi
if [ -z "$CLASSPATH" ]; then
@@ -77,6 +94,8 @@
CLASSPATH=".:$JPLJAR:$CLASSPATH"
fi
+echo CLASSPATH=$CLASSPATH
+echo LD_LIBRARY_PATH=$LD_LIBRARY_PATH
export LD_LIBRARY_PATH CLASSPATH
################################################################
@@ -114,7 +133,7 @@
echo "JPL demo: $1"
echo ""
- java -Djava.library.path=$PLLIBDIR $*
+ java -Djava.library.path=$JPL_LIBRARY_PATH $*
fi
}
diff -Nru swi-prolog-8.0.1+dfsg/packages/pengines/pengines_io.pl swi-prolog-8.0.2+dfsg/packages/pengines/pengines_io.pl
--- swi-prolog-8.0.1+dfsg/packages/pengines/pengines_io.pl 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/pengines/pengines_io.pl 2019-03-04 14:29:01.000000000 +0500
@@ -3,7 +3,7 @@
Author: Jan Wielemaker
E-mail: J.Wielemaker@vu.nl
WWW: http://www.swi-prolog.org
- Copyright (c) 2014-2018, VU University Amsterdam
+ Copyright (c) 2014-2019, VU University Amsterdam
CWI, Amsterdam
All rights reserved.
@@ -76,7 +76,9 @@
:- if(exists_source(library(prolog_stream))).
:- use_module(library(prolog_stream)).
:- endif.
+
:- html_meta send_html(html).
+:- public send_html/1.
:- meta_predicate
pengine_format(+,:).
diff -Nru swi-prolog-8.0.1+dfsg/packages/pengines/pengines.pl swi-prolog-8.0.2+dfsg/packages/pengines/pengines.pl
--- swi-prolog-8.0.1+dfsg/packages/pengines/pengines.pl 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/pengines/pengines.pl 2019-03-04 14:29:01.000000000 +0500
@@ -2586,6 +2586,8 @@
output_result(Format, Event) :-
arg(1, Event, Pengine),
thread_self(Thread),
+ cors_enable, % contingent on http:cors setting
+ disable_client_cache,
setup_call_cleanup(
asserta(pengine_replying(Pengine, Thread), Ref),
catch(output_result(Format, Event, _{}),
@@ -2593,6 +2595,9 @@
true),
erase(Ref)).
+output_result(Lang, Event, Dict) :-
+ write_result(Lang, Event, Dict),
+ !.
output_result(prolog, Event, _) :-
!,
format('Content-type: text/x-prolog; charset=UTF-8~n~n'),
@@ -2604,16 +2609,11 @@
portray_goal(portray_blob),
nl(true)
]).
-output_result(Lang, Event, Dict) :-
- write_result(Lang, Event, Dict),
- !.
output_result(Lang, Event, _) :-
json_lang(Lang),
!,
( event_term_to_json_data(Event, JSON, Lang)
- -> cors_enable,
- disable_client_cache,
- reply_json(JSON)
+ -> reply_json(JSON)
; assertion(event_term_to_json_data(Event, _, Lang))
).
output_result(Lang, _Event, _) :- % FIXME: allow for non-JSON format
diff -Nru swi-prolog-8.0.1+dfsg/packages/pengines/web/js/pengines.js swi-prolog-8.0.2+dfsg/packages/pengines/web/js/pengines.js
--- swi-prolog-8.0.1+dfsg/packages/pengines/web/js/pengines.js 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/pengines/web/js/pengines.js 2019-03-04 14:29:01.000000000 +0500
@@ -95,6 +95,14 @@
}
}
+ // initialize network support in browser
+ if (typeof Pengine.network === "undefined") {
+ Pengine.network = $; // assume jQuery initialized by now
+ $(window).on("beforeunload", function() {
+ Pengine.destroy_all();
+ });
+ }
+
// create instance
this.options = fillDefaultOptions(options);
this.id = null;
@@ -678,10 +686,4 @@
var najax = require('najax');
Pengine.network = najax;
Pengine.network.ajax = najax;
-} else {
- Pengine.network = $;
- // Browser
- $(window).on("beforeunload", function() {
- Pengine.destroy_all();
- });
}
diff -Nru swi-prolog-8.0.1+dfsg/packages/pldoc/doc_html.pl swi-prolog-8.0.2+dfsg/packages/pldoc/doc_html.pl
--- swi-prolog-8.0.1+dfsg/packages/pldoc/doc_html.pl 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/pldoc/doc_html.pl 2019-02-10 21:28:10.000000000 +0500
@@ -366,7 +366,17 @@
module_info(File, ModuleOptions, Options),
file_info(Objs0, Objs1, FileOptions, ModuleOptions),
doc_hide_private(Objs1, ObjectsSelf, ModuleOptions),
- include_reexported(ObjectsSelf, Objects, File, FileOptions).
+ include_reexported(ObjectsSelf, Objects1, File, FileOptions),
+ remove_doc_duplicates(Objects1, Objects, []).
+
+remove_doc_duplicates([], [], _).
+remove_doc_duplicates([H|T0], [H|T], Seen) :-
+ H = doc(_, _, Comment),
+ \+ memberchk(Comment, Seen),
+ !,
+ remove_doc_duplicates(T0, T, [Comment|Seen]).
+remove_doc_duplicates([_|T0], T, Seen) :-
+ remove_doc_duplicates(T0, T, Seen).
include_reexported(SelfObjects, Objects, File, Options) :-
option(include_reexported(true), Options),
diff -Nru swi-prolog-8.0.1+dfsg/packages/pldoc/doc_man.pl swi-prolog-8.0.2+dfsg/packages/pldoc/doc_man.pl
--- swi-prolog-8.0.1+dfsg/packages/pldoc/doc_man.pl 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/pldoc/doc_man.pl 2019-02-10 21:28:10.000000000 +0500
@@ -463,7 +463,9 @@
% Tranform the Name/Arity, etc strings as received from the HTTP
% into a term. Must return unique results.
-object_spec(Spec, Spec).
+object_spec(Spec, Spec) :-
+ compound(Spec),
+ !.
object_spec(Atom, Spec) :-
catch(atom_to_term(Atom, Spec, _), _, fail),
!,
diff -Nru swi-prolog-8.0.1+dfsg/packages/pldoc/doc_search.pl swi-prolog-8.0.2+dfsg/packages/pldoc/doc_search.pl
--- swi-prolog-8.0.1+dfsg/packages/pldoc/doc_search.pl 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/pldoc/doc_search.pl 2019-02-10 21:28:10.000000000 +0500
@@ -921,6 +921,12 @@
char_type(Token, punct).
+identifier_match_quality(Identifier, Identifier, 1) :-
+ !.
+identifier_match_quality(For, Identifier, Q) :-
+ dwim_match(For, Identifier, _),
+ !,
+ Q = 0.8.
identifier_match_quality(For, Identifier, Q) :-
identifier_parts(Identifier, Parts),
Parts \== [],
diff -Nru swi-prolog-8.0.1+dfsg/packages/pldoc/doc_wiki.pl swi-prolog-8.0.2+dfsg/packages/pldoc/doc_wiki.pl
--- swi-prolog-8.0.1+dfsg/packages/pldoc/doc_wiki.pl 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/pldoc/doc_wiki.pl 2019-02-10 21:28:10.000000000 +0500
@@ -1357,6 +1357,23 @@
['.'], file_extension(Extension),
!,
{ atomic_list_concat([S1|List], '/', FileBase) }.
+file_name(FileBase, Extension) -->
+ [w(Alias), '('],
+ { once(user:file_search_path(Alias, _)) },
+ segment(S1),
+ segments(List),
+ [')'],
+ !,
+ { atomic_list_concat([S1|List], '/', Base),
+ Spec =.. [Alias,Base],
+ absolute_file_name(Spec, Path,
+ [ access(read),
+ extensions([pl]),
+ file_type(prolog)
+ ]),
+ file_name_extension(FileBase, Extension, Path)
+ }.
+
segment(..) -->
['.','.'],
diff -Nru swi-prolog-8.0.1+dfsg/packages/semweb/doc/rdfdb.md swi-prolog-8.0.2+dfsg/packages/semweb/doc/rdfdb.md
--- swi-prolog-8.0.1+dfsg/packages/semweb/doc/rdfdb.md 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/semweb/doc/rdfdb.md 2019-02-25 22:41:36.000000000 +0500
@@ -5,7 +5,7 @@
origin of the triple.
The actual storage is provided by the _|foreign language (C)|_ module.
-Using a dedicated C-based implementation we can reduced memory usage and
+Using a dedicated C-based implementation we can reduce memory usage and
improve indexing capabilities, for example by providing a dedicated
index to support entailment over =|rdfs:subPropertyOf|=. Currently the
following indexes are provided (S=subject, P=predicate, O=object,
@@ -13,11 +13,11 @@
* S, P, O, SP, PO, SPO, G, SG, PG
- * Predicates connect by *|rdfs:subPropertyOf|* are combined
+ * Predicates connected by *|rdfs:subPropertyOf|* are combined
in a _|predicate cloud|_. The system causes multiple
predicates in the cloud to share the same hash. The cloud
maintains a 2-dimensional array that expresses the
- closure of all rdfs:subPropertyOf relations. This
+ closure of all =|rdfs:subPropertyOf|= relations. This
index supports rdf_has/3 to query a property and all its
children efficiently.
@@ -149,7 +149,7 @@
## Literal matching and indexing {#semweb-literals}
-Literal values are ordered and indexed using a _|skip list|_ The aim of
+Literal values are ordered and indexed using a _|skip list|_. The aim of
this index is threefold.
* Unlike hash-tables, binary trees allow for efficient
@@ -175,7 +175,7 @@
Currently the total order of literals is first based on the type of
literal using the ordering _|numeric < string < term|_ Numeric values
(integer and float) are ordered by value, integers preceed floats if
-they represent the same value. strings are sorted alphabetically after
+they represent the same value. Strings are sorted alphabetically after
case-mapping and diacritic removal as described above. If they match
equal, uppercase preceeds lowercase and diacritics are ordered on their
unicode value. If they still compare equal literals without any
@@ -193,7 +193,7 @@
The predicates below form an experimental interface to provide more
reasoning inside the kernel of the rdb_db engine. Note that =symetric=,
=inverse_of= and =transitive= are not yet supported by the rest of the
-engine. Alo note that there is no relation to defined RDF properties.
+engine. Also note that there is no relation to defined RDF properties.
Properties that have no triples are not reported by this predicate,
while predicates that are involved in triples do not need to be defined
as an instance of rdf:Property.
diff -Nru swi-prolog-8.0.1+dfsg/packages/semweb/rdf11.pl swi-prolog-8.0.2+dfsg/packages/semweb/rdf11.pl
--- swi-prolog-8.0.1+dfsg/packages/semweb/rdf11.pl 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/semweb/rdf11.pl 2019-02-25 22:41:36.000000000 +0500
@@ -424,7 +424,7 @@
%
% If both S and O are given, these predicates are `semidet`. The
% number of steps D is minimal because the implementation uses
-% _breath first_ search.
+% _breadth first_ search.
rdf_reachable(S,P,O) :-
pre_object(O,O0),
@@ -1485,7 +1485,7 @@
%! rdf_term(?Term) is nondet.
%
-% True if Term appears in the RDF database. Term is either an iri,
+% True if Term appears in the RDF database. Term is either an IRI,
% literal or blank node and may appear in any position of any
% triple. If Term is ground, it is pre-processed as the object
% argument of rdf_assert/3 and the predicate is _semidet_.
@@ -1597,7 +1597,7 @@
%! rdf_object(?O) is nondet.
%
-% True when O is a currently known object, i.e. it appeasr in the
+% True when O is a currently known object, i.e. it appears in the
% object position of some visible triple. If Term is ground, it is
% pre-processed as the object argument of rdf_assert/3 and the
% predicate is _semidet_.
@@ -1755,7 +1755,7 @@
%
% Success of this goal does not imply that the name is
% well-formed or that it is present in the database (see
-% rdf_name/1) for that).
+% rdf_name/1 for that).
rdf_is_name(T) :- rdf_is_iri(T), !.
rdf_is_name(T) :- rdf_is_literal(T).
@@ -1767,7 +1767,7 @@
%
% Success of this goal does not imply that the object term in
% well-formed or that it is present in the database (see
-% rdf_object/1) for that).
+% rdf_object/1 for that).
%
% Since any RDF term can appear in the object position, this is
% equaivalent to rdf_is_term/1.
@@ -1781,7 +1781,7 @@
% True if Term can appear in the predicate position of a triple.
%
% Success of this goal does not imply that the predicate term is
-% present in the database (see rdf_predicate/1) for that).
+% present in the database (see rdf_predicate/1 for that).
%
% Since only IRIs can appear in the predicate position, this is
% equivalent to rdf_is_iri/1.
@@ -1796,7 +1796,7 @@
% Only blank nodes and IRIs can appear in the subject position.
%
% Success of this goal does not imply that the subject term is
-% present in the database (see rdf_subject/1) for that).
+% present in the database (see rdf_subject/1 for that).
%
% Since blank nodes are represented by atoms that start with
% `_:` and an IRIs are atoms as well, this is equivalent to
@@ -1810,7 +1810,7 @@
% either an IRI, a blank node or an RDF literal.
%
% Success of this goal does not imply that the RDF term is
-% present in the database (see rdf_term/1) for that).
+% present in the database (see rdf_term/1 for that).
rdf_is_term(N) :- rdf_is_subject(N), !.
rdf_is_term(N) :- rdf_is_literal(N).
diff -Nru swi-prolog-8.0.1+dfsg/packages/semweb/rdf_db.pl swi-prolog-8.0.2+dfsg/packages/semweb/rdf_db.pl
--- swi-prolog-8.0.1+dfsg/packages/semweb/rdf_db.pl 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/semweb/rdf_db.pl 2019-02-25 22:41:36.000000000 +0500
@@ -287,7 +287,7 @@
%! rdf_equal(?Resource1, ?Resource2)
%
-% Simple equality test to exploit goal-expansion
+% Simple equality test to exploit goal-expansion.
rdf_equal(Resource, Resource).
@@ -307,7 +307,7 @@
% True if Lang matches Pattern. This implements XML language
% matching conform RFC 4647. Both Lang and Pattern are
% dash-separated strings of identifiers or (for Pattern) the
-% wildcart *. Identifiers are matched case-insensitive and a *
+% wildcard *. Identifiers are matched case-insensitive and a *
% matches any number of identifiers. A short pattern is the same
% as *.
@@ -376,11 +376,11 @@
% literals.
%
% * ge(+Literal)
-% Match any literal that is equal or larger then Literal in the
+% Match any literal that is equal or larger than Literal in the
% ordered set of literals.
%
% * gt(+Literal)
-% Match any literal that is larger then Literal in the ordered set
+% Match any literal that is larger than Literal in the ordered set
% of literals.
%
% * eq(+Literal)
@@ -388,11 +388,11 @@
% of literals.
%
% * le(+Literal)
-% Match any literal that is equal or smaller then Literal in the
+% Match any literal that is equal or smaller than Literal in the
% ordered set of literals.
%
% * lt(+Literal)
-% Match any literal that is smaller then Literal in the ordered set
+% Match any literal that is smaller than Literal in the ordered set
% of literals.
%
% * between(+Literal1, +Literal2)
@@ -443,7 +443,7 @@
% repecting the symetric(true) or inverse_of(P2) properties.
%
% If used with either Subject or Object unbound, it first returns
-% the origin, followed by the reachable nodes in breath-first
+% the origin, followed by the reachable nodes in breadth-first
% search-order. The implementation internally looks one solution
% ahead and succeeds deterministically on the last solution. This
% predicate never generates the same node twice and is robust
@@ -836,7 +836,7 @@
% Obtain statistics on the RDF database. Defined statistics are:
%
% * graphs(-Count)
-% Number of named graphs
+% Number of named graphs.
%
% * triples(-Count)
% Total number of triples in the database. This is the number
@@ -987,7 +987,7 @@
% * rdf_object_branch_factor(-Float)
% Unify Float with the average number of triples associated with
% each unique value for the object-side of this relation. In
-% addition to the comments with the subject_branch_factor
+% addition to the comments with the =rdf_subject_branch_factor=
% property, uniqueness of the object value is computed from the
% hash key rather than the actual values.
%
@@ -1361,7 +1361,7 @@
% Named graph in which to load the data. It is *not* allowed
% to load two sources into the same named graph. If Graph is
% unbound, it is unified to the graph into which the data is
-% loaded. The default graph is a =file://= URL when loading
+% loaded. The default graph is a =|file://|= URL when loading
% a file or, if the specification is a URL, its normalized
% version without the optional _|#fragment|_.
%
@@ -1998,7 +1998,7 @@
% The graph is loaded from the Source (a URL)
% * source_last_modified(?Time)
% Time is the last-modified timestamp of Source at the moment
-% that the graph was loaded from Source.
+% the graph was loaded from Source.
% * triples(Count)
% True when Count is the number of triples in Graph.
%
@@ -2104,13 +2104,13 @@
% Save only triples associated to the given named Graph.
%
% * anon(Bool)
-% If false (default true) do not save blank nodes that do
+% If =false= (default =true=) do not save blank nodes that do
% not appear (indirectly) as object of a named resource.
%
% * base_uri(URI)
% BaseURI used. If present, all URIs that can be
% represented relative to this base are written using
-% their shorthand. See also =write_xml_base= option
+% their shorthand. See also =write_xml_base= option.
%
% * convert_typed_literal(:Convertor)
% Call Convertor(-Type, -Content, +RDFObject), providing
@@ -2118,10 +2118,10 @@
% the RDF parser.
%
% * document_language(+Lang)
-% Initial xml:lang saved with rdf:RDF element
+% Initial =|xml:lang|= saved with rdf:RDF element.
%
% * encoding(Encoding)
-% Encoding for the output. Either utf8 or iso_latin_1
+% Encoding for the output. Either utf8 or iso_latin_1.
%
% * inline(+Bool)
% If =true= (default =false=), inline resources when
@@ -2129,7 +2129,7 @@
% are handled this way.
%
% * namespaces(+List)
-% Explicitely specify saved namespace declarations. See
+% Explicitly specify saved namespace declarations. See
% rdf_save_header/2 option namespaces for details.
%
% * sorted(+Boolean)
diff -Nru swi-prolog-8.0.1+dfsg/packages/semweb/rdf_prefixes.pl swi-prolog-8.0.2+dfsg/packages/semweb/rdf_prefixes.pl
--- swi-prolog-8.0.1+dfsg/packages/semweb/rdf_prefixes.pl 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/semweb/rdf_prefixes.pl 2019-02-25 22:41:36.000000000 +0500
@@ -180,7 +180,7 @@
% Register Prefix as an abbreviation for URI. Options:
%
% * force(Boolean)
-% If =true=, Replace existing namespace alias. Please note
+% If =true=, replace existing namespace alias. Please note
% that replacing a namespace is dangerous as namespaces
% affect preprocessing. Make sure all code that depends on
% a namespace is compiled after changing the registration.
@@ -267,7 +267,7 @@
%! rdf_current_ns(:Prefix, ?URI) is nondet.
%
-% @deprecated. Use rdf_current_prefix/2.
+% @deprecated Use rdf_current_prefix/2.
rdf_current_ns(Prefix, URI) :-
rdf_current_prefix(Prefix, URI).
@@ -277,7 +277,7 @@
%
% Register an RDF prefix.
%
-% @deprecated. Use rdf_register_prefix/2 or rdf_register_prefix/3.
+% @deprecated Use rdf_register_prefix/2 or rdf_register_prefix/3.
rdf_register_ns(Prefix, URI) :-
rdf_register_prefix(Prefix, URI).
diff -Nru swi-prolog-8.0.1+dfsg/packages/semweb/semweb.doc swi-prolog-8.0.2+dfsg/packages/semweb/semweb.doc
--- swi-prolog-8.0.1+dfsg/packages/semweb/semweb.doc 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/semweb/semweb.doc 2019-02-25 22:41:36.000000000 +0500
@@ -36,14 +36,14 @@
persistent storage. This package is the core of a ready-to-run platform
for developing Semantic Web applications named
\href{http://cliopatria.swi-prolog.org}{ClioPatria}, which is distributed
-seperately. The SWI-Prolog RDF store is amoung the most memory efficient
+seperately. The SWI-Prolog RDF store is among the most memory efficient
main-memory stores for
RDF\footnote{\url{http://cliopatria.swi-prolog.org/help/source/doc/home/vnc/prolog/src/ClioPatria/web/help/memusage.txt}}
Version~3 of the RDF library enhances concurrent use of the library by
allowing for lock-free reading and writing using short-held locks. It
provides Prolog compatible \jargon{logical update view} on the triple
-store and isolation using \jargon{transactions} and jargon{snapshots}.
+store and isolation using \jargon{transactions} and \jargon{snapshots}.
This version of the library provides near real-time modification and
querying of RDF graphs, making it particularly interesting for handling
streaming RDF and graph manipulation tasks.
diff -Nru swi-prolog-8.0.1+dfsg/packages/sgml/parser.c swi-prolog-8.0.2+dfsg/packages/sgml/parser.c
--- swi-prolog-8.0.1+dfsg/packages/sgml/parser.c 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/sgml/parser.c 2019-02-14 19:20:59.000000000 +0500
@@ -4600,7 +4600,6 @@
rval = TRUE;
break;
case S_CMT:
- case S_CMT1:
case S_CMTE0:
case S_CMTE1:
case S_DECLCMT0:
@@ -5277,7 +5276,7 @@
}
case S_CMTO: /* Seen <!- */
{ if ( f[CF_CMT] == chr ) /* - */
- { p->state = S_CMT1;
+ { p->state = S_CMT;
return TRUE;
} else
{ add_cdata(p, f[CF_MDO1]);
@@ -5288,10 +5287,6 @@
return TRUE;
}
}
- case S_CMT1: /* <!-- */
- { p->state = S_CMT;
- return TRUE;
- }
case S_CMT:
{ if ( f[CF_CMT] == chr )
p->state = S_CMTE0; /* <!--...- */
diff -Nru swi-prolog-8.0.1+dfsg/packages/sgml/parser.h swi-prolog-8.0.2+dfsg/packages/sgml/parser.h
--- swi-prolog-8.0.1+dfsg/packages/sgml/parser.h 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/sgml/parser.h 2019-02-14 19:20:59.000000000 +0500
@@ -109,7 +109,6 @@
S_DECLCMT, /* Seen <...-- */
S_DECLCMTE0, /* Seen <...--..- */
S_CMTO, /* Seen <!- */
- S_CMT1, /* Seen <!-- */
S_CMT, /* Seen <!--X... */
S_CMTE0, /* Seem <!--...- */
S_CMTE1, /* Seem <!--...-- */
diff -Nru swi-prolog-8.0.1+dfsg/packages/sgml/xpath.pl swi-prolog-8.0.2+dfsg/packages/sgml/xpath.pl
--- swi-prolog-8.0.1+dfsg/packages/sgml/xpath.pl 2019-01-17 19:57:11.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/sgml/xpath.pl 2019-02-14 19:20:59.000000000 +0500
@@ -3,8 +3,9 @@
Author: Jan Wielemaker
E-mail: J.Wielemaker@vu.nl
WWW: http://www.swi-prolog.org
- Copyright (c) 2009-2016, University of Amsterdam
+ Copyright (c) 2009-2019, University of Amsterdam
VU University Amsterdam
+ CWI, Amsterdam
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -125,6 +126,9 @@
% Evaluate to the content of the element (a list)
% $ =text= :
% Evaluates to all text from the sub-tree as an atom
+% $ `text(As)` :
+% Evaluates to all text from the sub-tree according to
+% `As`, which is either `atom` or `string`.
% $ =normalize_space= :
% As =text=, but uses normalize_space/2 to normalise
% white-space in the output
@@ -434,14 +438,17 @@
element_content(Element, Value).
xpath_function(text, DOM, Text) :- % text
!,
- text_of_dom(DOM, Text).
+ text_of_dom(DOM, atom, Text).
+xpath_function(text(As), DOM, Text) :- % text(As)
+ !,
+ text_of_dom(DOM, As, Text).
xpath_function(normalize_space, DOM, Text) :- % normalize_space
!,
- text_of_dom(DOM, Text0),
+ text_of_dom(DOM, string, Text0),
normalize_space(atom(Text), Text0).
xpath_function(number, DOM, Number) :- % number
!,
- text_of_dom(DOM, Text0),
+ text_of_dom(DOM, string, Text0),
normalize_space(string(Text), Text0),
catch(xsd_number_string(Number, Text), _, fail).
xpath_function(@Name, element(_, Attrs, _), Value) :- % @Name
@@ -459,6 +466,7 @@
xpath_function(self).
xpath_function(content).
xpath_function(text).
+xpath_function(text(_)).
xpath_function(normalize_space).
xpath_function(number).
xpath_function(@_).
@@ -554,13 +562,18 @@
val_or_function(Value, _, Value).
-%! text_of_dom(+DOM, -Text:atom) is det.
+%! text_of_dom(+DOM, +As, -Text:atom) is det.
%
% Text is the joined textual content of DOM.
-text_of_dom(DOM, Text) :-
+text_of_dom(DOM, As, Text) :-
phrase(text_of(DOM), Tokens),
- atomic_list_concat(Tokens, Text).
+ ( As == atom
+ -> atomic_list_concat(Tokens, Text)
+ ; As == string
+ -> atomics_to_string(Tokens, Text)
+ ; must_be(oneof([atom,string]), As)
+ ).
text_of(element(_,_,Content)) -->
text_of_list(Content).
@@ -582,5 +595,11 @@
!,
text_of_list(Content).
text_of_1(Data) -->
- { assertion(atom(Data)) },
+ { assertion(atom_or_string(Data)) },
[Data].
+
+atom_or_string(Data) :-
+ ( atom(Data)
+ -> true
+ ; string(Data)
+ ).
diff -Nru swi-prolog-8.0.1+dfsg/packages/swipl-win/CMakeLists.txt swi-prolog-8.0.2+dfsg/packages/swipl-win/CMakeLists.txt
--- swi-prolog-8.0.1+dfsg/packages/swipl-win/CMakeLists.txt 2018-10-26 17:09:23.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/swipl-win/CMakeLists.txt 2019-02-08 17:37:19.000000000 +0500
@@ -13,18 +13,21 @@
if(Qt5Widgets_FOUND)
+set(PLWIN_RESOURCES
+ swipl-win.qrc)
+
+qt5_add_resources(SWIPL_RES_SOURCES ${PLWIN_RESOURCES})
+
set(PLWIN_SRC main.cpp SwiPrologEngine.cpp Swipl_IO.cpp Preferences.cpp
pqMainWindow.cpp pqConsole.cpp FlushOutputEvents.cpp ConsoleEdit.cpp
- Completion.cpp swipl_win.cpp ParenMatching.cpp)
-
-set(PLWIN_MOC
- qrc_swipl-win.cpp
- moc_SwiPrologEngine.cpp moc_Swipl_IO.cpp moc_Preferences.cpp
- moc_pqMainWindow.cpp moc_ConsoleEdit.cpp moc_swipl_win.cpp
- moc_ParenMatching.cpp)
+ Completion.cpp swipl_win.cpp ParenMatching.cpp ${SWIPL_RES_SOURCES})
set(QT_DEFINES)
+if(MULTI_THREADED)
+list(APPEND QT_DEFINES -D_REENTRANT)
+endif()
+
# provide appropriate linking mode for
# static compilation of pqConsole source files
list(APPEND QT_DEFINES -DPQCONSOLE_STATIC)
diff -Nru swi-prolog-8.0.1+dfsg/packages/swipl-win/ConsoleEdit.cpp swi-prolog-8.0.2+dfsg/packages/swipl-win/ConsoleEdit.cpp
--- swi-prolog-8.0.1+dfsg/packages/swipl-win/ConsoleEdit.cpp 2018-10-26 17:09:23.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/swipl-win/ConsoleEdit.cpp 2019-02-08 17:37:19.000000000 +0500
@@ -708,6 +708,15 @@
setReadOnly(false);
viewport()->setCursor(Qt::IBeamCursor);
}
+
+ if (pmatched.size()) {
+ pmatched.format_both(c);
+ pmatched = ParenMatching::range();
+ }
+
+ ParenMatching pm(c);
+ if (pm)
+ (pmatched = pm.positions).format_both(c, pmatched.bold());
}
/** check if line content is appropriate, then highlight or open editor on it */
diff -Nru swi-prolog-8.0.1+dfsg/packages/swipl-win/ConsoleEdit.h swi-prolog-8.0.2+dfsg/packages/swipl-win/ConsoleEdit.h
--- swi-prolog-8.0.1+dfsg/packages/swipl-win/ConsoleEdit.h 2018-10-26 17:09:23.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/swipl-win/ConsoleEdit.h 2019-02-08 17:37:19.000000000 +0500
@@ -50,6 +50,7 @@
#include "SwiPrologEngine.h"
#include "Completion.h"
+#include "ParenMatching.h"
#include <QElapsedTimer>
@@ -244,6 +245,11 @@
/** relax selection check requirement */
QElapsedTimer sel_check_timing;
+protected:
+
+ /** keep last matched pair */
+ ParenMatching::range pmatched;
+
public slots:
/** display different cursor where editing available */
diff -Nru swi-prolog-8.0.1+dfsg/packages/swipl-win/pqConsole.cpp swi-prolog-8.0.2+dfsg/packages/swipl-win/pqConsole.cpp
--- swi-prolog-8.0.1+dfsg/packages/swipl-win/pqConsole.cpp 2018-10-26 17:09:23.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/swipl-win/pqConsole.cpp 2019-02-08 17:37:19.000000000 +0500
@@ -731,7 +731,9 @@
ConsoleEdit::exec_sync s;
c->exec_func([&]() {
Preferences p;
+ qDebug() << "Opening font dialog";
QFont font = QFontDialog::getFont(&ok, p.console_font, c);
+ qDebug() << "ok = " << ok << "font = " << font;
if (ok)
c->setFont(p.console_font = font);
s.go();
diff -Nru swi-prolog-8.0.1+dfsg/packages/swipl-win/Preferences.cpp swi-prolog-8.0.2+dfsg/packages/swipl-win/Preferences.cpp
--- swi-prolog-8.0.1+dfsg/packages/swipl-win/Preferences.cpp 2018-10-26 17:09:23.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/packages/swipl-win/Preferences.cpp 2019-02-08 17:37:19.000000000 +0500
@@ -47,7 +47,8 @@
*/
Preferences::Preferences(QObject *parent) :
QSettings("SWI-Prolog", "pqConsole", parent)
-{
+{ qDebug() << "Loading preferences from " << fileName();
+
console_font = value("console_font", QFont("courier", 12)).value<QFont>();
wrapMode = static_cast<ConsoleEditBase::LineWrapMode>(value("wrapMode", ConsoleEditBase::WidgetWidth).toInt());
diff -Nru swi-prolog-8.0.1+dfsg/scripts/mkchangelog swi-prolog-8.0.2+dfsg/scripts/mkchangelog
--- swi-prolog-8.0.1+dfsg/scripts/mkchangelog 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/scripts/mkchangelog 2019-03-05 16:53:38.000000000 +0500
@@ -9,10 +9,9 @@
modules=true
quiet=false
moduleoptions=
-[ -z "$wiki" ] && wiki=false
-[ -z "$level" ] && level=+
+[ -z "$level" ] && level="="
-export wiki level
+export level
help()
{ echo "Usage: `basename $0` option ... [version][..version] [path ...]"
@@ -45,7 +44,6 @@
shift
;;
--wiki)
- wiki=true
shift
;;
--nomodules)
@@ -123,15 +121,10 @@
header ()
{ hdr="$*"
- if [ "$wiki" = true ]; then
- echo ---$level $hdr
- else
- hdr="$*"
- eq=`echo $hdr | sed 's/./=/g'`
- echo $eq
- echo $hdr
- echo $eq
- fi
+ hdr="$*"
+ eq=`echo $hdr | sed "s/./$level/g"`
+ echo $hdr
+ echo $eq
echo
}
@@ -183,7 +176,7 @@
}
if [ "$modules" = true ]; then
- level="$level+"
+ level="-"
echo
diff -Nru swi-prolog-8.0.1+dfsg/scripts/pgo-compile.sh swi-prolog-8.0.2+dfsg/scripts/pgo-compile.sh
--- swi-prolog-8.0.1+dfsg/scripts/pgo-compile.sh 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/scripts/pgo-compile.sh 2019-03-05 16:53:38.000000000 +0500
@@ -1,15 +1,16 @@
CMAKE_COMMAND=cmake
PGO_DIR=PGO-data
-PGO_PROGRAM=../bench/run.pl
+SRC_DIR="$(dirname "$(dirname "$0")")"
+PGO_PROGRAM="${SRC_DIR}/bench/run.pl"
if [ "$1" = "--off" ]; then
${CMAKE_COMMAND} -E echo "PGO: disabling"
- ${CMAKE_COMMAND} -DPROFILE_GUIDED_OPTIMIZATION=OFF -G Ninja ..
+ ${CMAKE_COMMAND} -DPROFILE_GUIDED_OPTIMIZATION=OFF -G Ninja ${SRC_DIR}
${CMAKE_COMMAND} -E remove_directory ${PGO_DIR}
ninja -t clean libswipl
${CMAKE_COMMAND} -E echo "PGO: run ninja to complete rebuild"
else
- ${CMAKE_COMMAND} -DPROFILE_GUIDED_OPTIMIZATION=GENERATE -G Ninja ..
+ ${CMAKE_COMMAND} -DPROFILE_GUIDED_OPTIMIZATION=GENERATE -G Ninja ${SRC_DIR}
ninja -t clean libswipl
${CMAKE_COMMAND} -E echo "PGO: Compiling instrumented version"
ninja prolog_products
@@ -24,7 +25,7 @@
${SWIPL} -f none --no-threads ${PGO_PROGRAM}
- ${CMAKE_COMMAND} -DPROFILE_GUIDED_OPTIMIZATION=USE -G Ninja ..
+ ${CMAKE_COMMAND} -DPROFILE_GUIDED_OPTIMIZATION=USE -G Ninja ${SRC_DIR}
ninja -t clean libswipl
${CMAKE_COMMAND} -E echo "PGO: Compiling optimized core"
ninja prolog_products
diff -Nru swi-prolog-8.0.1+dfsg/src/minizip/ioapi.h swi-prolog-8.0.2+dfsg/src/minizip/ioapi.h
--- swi-prolog-8.0.1+dfsg/src/minizip/ioapi.h 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/minizip/ioapi.h 2019-03-05 16:53:38.000000000 +0500
@@ -50,7 +50,8 @@
#define ftello64 ftell
#define fseeko64 fseek
#else
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) \
+ || defined(__HAIKU__)
#define fopen64 fopen
#define ftello64 ftello
#define fseeko64 fseeko
diff -Nru swi-prolog-8.0.1+dfsg/src/os/pl-buffer.c swi-prolog-8.0.2+dfsg/src/os/pl-buffer.c
--- swi-prolog-8.0.1+dfsg/src/os/pl-buffer.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/os/pl-buffer.c 2019-03-05 16:53:38.000000000 +0500
@@ -40,7 +40,7 @@
size_t top = b->top - b->base;
char *new;
- if ( b->max - b->top >= (int)minfree )
+ if ( b->max - b->top >= minfree )
return TRUE;
if ( sz < 512 )
diff -Nru swi-prolog-8.0.1+dfsg/src/os/pl-text.c swi-prolog-8.0.2+dfsg/src/os/pl-text.c
--- swi-prolog-8.0.1+dfsg/src/os/pl-text.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/os/pl-text.c 2019-03-05 16:53:38.000000000 +0500
@@ -397,7 +397,9 @@
int
PL_unify_text(term_t term, term_t tail, PL_chars_t *text, int type)
-{ switch(type)
+{ GET_LD
+
+ switch(type)
{ case PL_ATOM:
{ atom_t a = textToAtom(text);
@@ -426,15 +428,13 @@
if ( text->length == 0 )
{ if ( tail )
- { GET_LD
- PL_put_term(tail, term);
+ { PL_put_term(tail, term);
return TRUE;
} else
{ return PL_unify_nil(term);
}
} else
- { GET_LD
- term_t l = PL_new_term_ref();
+ { term_t l = PL_new_term_ref();
Word p0, p;
switch(text->encoding)
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-alloc.c swi-prolog-8.0.2+dfsg/src/pl-alloc.c
--- swi-prolog-8.0.1+dfsg/src/pl-alloc.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-alloc.c 2019-03-05 16:53:38.000000000 +0500
@@ -193,8 +193,9 @@
{ linger_list *c = allocHeapOrHalt(sizeof(*c));
linger_list *o;
- c->object = object;
- c->unalloc = unalloc;
+ c->generation = global_generation();
+ c->object = object;
+ c->unalloc = unalloc;
do
{ o = *list;
@@ -203,13 +204,21 @@
}
void
-free_lingering(linger_list *list)
-{ linger_list *n;
+free_lingering(linger_list **list, gen_t generation)
+{ linger_list **p = list;
+ linger_list *c = *list;
- for(; list; list=n)
- { n = list->next;
- (*list->unalloc)(list->object);
- freeHeap(list, sizeof(*list));
+ while ( c )
+ { if ( c->generation < generation )
+ { while ( !COMPARE_AND_SWAP(p, c, c->next) )
+ { p = &(*p)->next;
+ }
+ (*c->unalloc)(c->object);
+ freeHeap(c, sizeof(*c));
+ } else
+ { p = &(*p)->next;
+ }
+ c = *p;
}
}
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-alloc.h swi-prolog-8.0.2+dfsg/src/pl-alloc.h
--- swi-prolog-8.0.1+dfsg/src/pl-alloc.h 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-alloc.h 2019-03-05 16:53:38.000000000 +0500
@@ -77,12 +77,13 @@
typedef struct linger_list
{ struct linger_list *next; /* Next lingering object */
+ gen_t generation; /* Linger generation */
void *object; /* The lingering data */
void (*unalloc)(void* obj); /* actually free the object */
} linger_list;
COMMON(void) linger(linger_list** list, void (*unalloc)(void *), void *object);
-COMMON(void) free_lingering(linger_list *list);
+COMMON(void) free_lingering(linger_list **list, gen_t generation);
/*******************************
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-arith.c swi-prolog-8.0.2+dfsg/src/pl-arith.c
--- swi-prolog-8.0.1+dfsg/src/pl-arith.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-arith.c 2019-03-05 16:53:38.000000000 +0500
@@ -1059,6 +1059,8 @@
fail;
#endif
case V_FLOAT:
+ if ( !check_float(n->value.f) )
+ return FALSE;
if ( (flags & TOINT_CONVERT_FLOAT) )
{ if ( double_in_int64_range(n->value.f) )
{ int64_t l = (int64_t)n->value.f;
@@ -2261,7 +2263,10 @@
promoteToMPQNumber(r);
succeed;
case V_FLOAT:
- { double e0 = n1->value.f, p0 = 0.0, q0 = 1.0;
+ { if ( !check_float(n1->value.f) )
+ return FALSE;
+
+ double e0 = n1->value.f, p0 = 0.0, q0 = 1.0;
double e1 = -1.0, p1 = 1.0, q1 = 0.0;
double d;
@@ -2906,7 +2911,9 @@
}
#endif
case V_FLOAT:
- { if ( n1->value.f <= PLMAXINT && n1->value.f >= PLMININT )
+ { if ( !check_float(n1->value.f) )
+ return FALSE;
+ if ( n1->value.f <= PLMAXINT && n1->value.f >= PLMININT )
{ if ( n1->value.f > 0 )
{ r->value.i = (int64_t)(n1->value.f + 0.5);
if ( r->value.i < 0 ) /* Why can this happen? */
@@ -2969,7 +2976,8 @@
succeed;
#endif
case V_FLOAT:
- {
+ { if ( !check_float(n1->value.f) )
+ return FALSE;
#ifdef HAVE_FLOOR
r->type = V_FLOAT;
r->value.f = floor(n1->value.f);
@@ -3022,30 +3030,31 @@
succeed;
#endif
case V_FLOAT:
- {
+ { if ( !check_float(n1->value.f) )
+ return FALSE;
#ifdef HAVE_CEIL
- r->type = V_FLOAT;
- r->value.f = ceil(n1->value.f);
- if ( !toIntegerNumber(r, TOINT_CONVERT_FLOAT|TOINT_TRUNCATE) )
- { return PL_error("ceil", 1, NULL, ERR_EVALUATION, ATOM_int_overflow);
- }
+ r->type = V_FLOAT;
+ r->value.f = ceil(n1->value.f);
+ if ( !toIntegerNumber(r, TOINT_CONVERT_FLOAT|TOINT_TRUNCATE) )
+ { return PL_error("ceil", 1, NULL, ERR_EVALUATION, ATOM_int_overflow);
+ }
#else /*HAVE_CEIL*/
- if ( n1->value.f > (double)PLMININT && n1->value.f < (double)PLMAXINT )
- { r->value.i = (int64_t)n1->value.f;
- if ( (double)r->value.i < n1->value.f )
- r->value.i++;
- r->type = V_INTEGER;
- } else
- {
-#ifdef O_GMP
- r->type = V_MPZ;
- mpz_init_set_d(r->value.mpz, n1->value.f);
- if ( mpz_get_d(r->value.mpz) < n1->value.f )
- mpz_add_ui(r->value.mpz, r->value.mpz, 1L);
+ if ( n1->value.f > (double)PLMININT && n1->value.f < (double)PLMAXINT )
+ { r->value.i = (int64_t)n1->value.f;
+ if ( (double)r->value.i < n1->value.f )
+ r->value.i++;
+ r->type = V_INTEGER;
+ } else
+ {
+#ifdef O_GMP
+ r->type = V_MPZ;
+ mpz_init_set_d(r->value.mpz, n1->value.f);
+ if ( mpz_get_d(r->value.mpz) < n1->value.f )
+ mpz_add_ui(r->value.mpz, r->value.mpz, 1L);
#else
- return PL_error("ceil", 1, NULL, ERR_EVALUATION, ATOM_int_overflow);
+ return PL_error("ceil", 1, NULL, ERR_EVALUATION, ATOM_int_overflow);
#endif
- }
+ }
#endif /*HAVE_CEIL*/
}
}
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-fli.c swi-prolog-8.0.2+dfsg/src/pl-fli.c
--- swi-prolog-8.0.1+dfsg/src/pl-fli.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-fli.c 2019-03-05 16:53:38.000000000 +0500
@@ -3785,6 +3785,8 @@
* ATOMIC (INTERNAL) *
*******************************/
+#undef _PL_unify_atomic
+
PL_atomic_t
_PL_get_atomic(term_t t)
{ GET_LD
@@ -3805,6 +3807,8 @@
setHandle(t, a);
}
+#define _PL_unify_atomic(t, a) PL_unify_atom__LD(t, a PASS_LD)
+
/*******************************
* BLOBS *
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-gc.c swi-prolog-8.0.2+dfsg/src/pl-gc.c
--- swi-prolog-8.0.1+dfsg/src/pl-gc.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-gc.c 2019-03-05 16:53:38.000000000 +0500
@@ -3994,11 +3994,7 @@
#endif
if ( verbose )
- { if ( !printMessage(ATOM_informational,
- PL_FUNCTOR_CHARS, "gc", 1,
- PL_CHARS, "start") )
- return FALSE;
- }
+ Sdprintf("%% GC: ");
get_vmi_state(LD->query, &state);
safeLTop = lTop;
@@ -4130,18 +4126,11 @@
#endif
leaveGC(PASS_LD1);
- if ( verbose &&
- !printMessage(ATOM_informational,
- PL_FUNCTOR_CHARS, "gc", 1,
- PL_FUNCTOR_CHARS, "done", 7,
- PL_INTPTR, ggar,
- PL_INTPTR, tgar,
- PL_DOUBLE, (double)t,
- PL_INTPTR, usedStack(global),
- PL_INTPTR, usedStack(trail),
- PL_INTPTR, roomStack(global),
- PL_INTPTR, roomStack(trail)) )
- return FALSE;
+ if ( verbose )
+ Sdprintf("gained (g+t) %zd+%zd in %.3f sec; used %zd+%zd; free %zd+%zd\n",
+ ggar, tgar, (double)t,
+ usedStack(global), usedStack(trail),
+ roomStack(global), roomStack(trail));
return shiftTightStacks();
}
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-incl.h swi-prolog-8.0.2+dfsg/src/pl-incl.h
--- swi-prolog-8.0.1+dfsg/src/pl-incl.h 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-incl.h 2019-03-05 16:53:38.000000000 +0500
@@ -244,7 +244,7 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
#ifndef __unix__
-#if defined(_AIX) || defined(__APPLE__) || defined(__unix) || defined(__BEOS__) || defined(__NetBSD__)
+#if defined(_AIX) || defined(__APPLE__) || defined(__unix) || defined(__BEOS__) || defined(__NetBSD__) || defined(__HAIKU__)
#define __unix__ 1
#endif
#endif
@@ -932,12 +932,14 @@
#define FR_SKIPPED (0x0002) /* We have skipped on this frame */
#define FR_MARKED (0x0004) /* GC */
#define FR_MARKED_PRED (0x0008) /* GC predicates/clauses */
-#define FR_WATCHED (0x0010) /* GUI debugger */
+#define FR_DEBUG (0x0010) /* GUI debugger */
#define FR_CATCHED (0x0020) /* Frame caught an exception */
#define FR_INBOX (0x0040) /* Inside box (for REDO in built-in) */
#define FR_CONTEXT (0x0080) /* fr->context is set */
-#define FR_CLEANUP (0x0100) /* setup_call_cleanup/4: marked for cleanup */
+#define FR_CLEANUP (0x0100) /* setup_call_cleanup/4 */
#define FR_INRESET (0x0200) /* Continuations: inside reset/3 */
+#define FR_WATCHED (FR_CLEANUP|FR_DEBUG)
+
#define FR_MAGIC_MASK (0xfffff000)
#define FR_MAGIC_MASK2 (0xffff0000)
#define FR_MAGIC (0x549d5000)
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-init.c swi-prolog-8.0.2+dfsg/src/pl-init.c
--- swi-prolog-8.0.1+dfsg/src/pl-init.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-init.c 2019-03-05 16:53:38.000000000 +0500
@@ -340,7 +340,9 @@
if ( str_number((unsigned char *)s, &q, &n, FALSE) == NUM_OK &&
intNumber(&n) )
{ switch((int)*q)
- { case 'k':
+ { case 0:
+ return (size_t)n.value.i;
+ case 'k':
case 'K':
return (size_t)n.value.i K;
case 'm':
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-ldpass.h swi-prolog-8.0.2+dfsg/src/pl-ldpass.h
--- swi-prolog-8.0.1+dfsg/src/pl-ldpass.h 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-ldpass.h 2019-03-05 16:53:38.000000000 +0500
@@ -3,7 +3,8 @@
Author: Jan Wielemaker
E-mail: J.Wielemaker@vu.nl
WWW: http://www.swi-prolog.org
- Copyright (c) 2010-2016, University of Amsterdam
+ Copyright (c) 2010-2019, University of Amsterdam
+ CWI, Amsterdam
All rights reserved.
Redistribution and use in source and binary forms, with or without
@@ -101,6 +102,7 @@
#define PL_put_term(t1, t2) PL_put_term__LD(t1, t2 PASS_LD)
#define PL_get_functor(t, f) PL_get_functor__LD(t, f PASS_LD)
#define PL_unify_atom(t, a) PL_unify_atom__LD(t, a PASS_LD)
+#define _PL_unify_atomic(t, a) PL_unify_atom__LD(t, a PASS_LD)
#define PL_unify_pointer(t, p) PL_unify_pointer__LD(t, p PASS_LD)
#define PL_is_variable(t) PL_is_variable__LD(t PASS_LD)
#define PL_is_atomic(t) PL_is_atomic__LD(t PASS_LD)
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-pro.c swi-prolog-8.0.2+dfsg/src/pl-pro.c
--- swi-prolog-8.0.1+dfsg/src/pl-pro.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-pro.c 2019-03-05 16:53:38.000000000 +0500
@@ -347,6 +347,12 @@
fail;
}
+ /* Quick check for '$sig_atomic'(true) resulting from the call_cleanup
+ * series
+ */
+ if ( fd == FUNCTOR_true0 )
+ return TRUE;
+
proc = resolveProcedure(fd, module);
{ int arity = arityFunctor(fd);
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-proc.c swi-prolog-8.0.2+dfsg/src/pl-proc.c
--- swi-prolog-8.0.1+dfsg/src/pl-proc.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-proc.c 2019-03-05 16:53:38.000000000 +0500
@@ -1467,16 +1467,9 @@
static void
freeLingeringDefinition(Definition def, DirtyDefInfo ddi)
-{ linger_list *c;
-
- do
- { if ( !(c=def->lingering) )
- return;
- if ( ddi->oldest_generation != GEN_MAX )
- return;
- } while( !COMPARE_AND_SWAP(&def->lingering, c, NULL) );
-
- free_lingering(c);
+{ gen_t gen = ddi->oldest_generation == GEN_MAX ? global_generation()
+ : ddi->oldest_generation;
+ free_lingering(&def->lingering, gen);
}
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-rec.c swi-prolog-8.0.2+dfsg/src/pl-rec.c
--- swi-prolog-8.0.1+dfsg/src/pl-rec.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-rec.c 2019-03-05 16:53:38.000000000 +0500
@@ -3,7 +3,7 @@
Author: Jan Wielemaker
E-mail: J.Wielemaker@vu.nl
WWW: http://www.swi-prolog.org
- Copyright (c) 1985-2017, University of Amsterdam
+ Copyright (c) 1985-2010, University of Amsterdam
VU University Amsterdam
All rights reserved.
@@ -1917,12 +1917,12 @@
bool
unifyKey(term_t key, word val)
-{ if ( isAtom(val) || isTaggedInt(val) )
+{ GET_LD
+
+ if ( isAtom(val) || isTaggedInt(val) )
{ return _PL_unify_atomic(key, val);
} else
- { GET_LD
-
- return PL_unify_functor(key, (functor_t) val);
+ { return PL_unify_functor(key, (functor_t) val);
}
}
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-setup.c swi-prolog-8.0.2+dfsg/src/pl-setup.c
--- swi-prolog-8.0.1+dfsg/src/pl-setup.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-setup.c 2019-03-05 16:53:38.000000000 +0500
@@ -1213,8 +1213,7 @@
{ unprepareSignal(sign);
} else if ( a == ATOM_throw )
{ sh = prepareSignal(sign);
- set(sh, PLSIG_THROW);
- clear(sh, PLSIG_SYNC);
+ set(sh, PLSIG_THROW|PLSIG_SYNC);
sh->handler = NULL;
sh->predicate = NULL;
} else
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-thread.c swi-prolog-8.0.2+dfsg/src/pl-thread.c
--- swi-prolog-8.0.1+dfsg/src/pl-thread.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-thread.c 2019-03-05 16:53:38.000000000 +0500
@@ -5334,7 +5334,7 @@
(attr->flags & PL_THREAD_NOT_DETACHED) == 0;
info->open_count = 1;
- copy_local_data(ldnew, ldmain, attr->max_queue_size);
+ copy_local_data(ldnew, ldmain, attr ? attr->max_queue_size : 0);
if ( !initialise_thread(info) )
{ free_thread_info(info);
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-trace.c swi-prolog-8.0.2+dfsg/src/pl-trace.c
--- swi-prolog-8.0.1+dfsg/src/pl-trace.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-trace.c 2019-03-05 16:53:38.000000000 +0500
@@ -1580,11 +1580,6 @@
resetTracer(void)
{ GET_LD
-#if defined(O_INTERRUPT) && defined(SIGINT)
- if ( truePrologFlag(PLFLAG_SIGNALS) )
- PL_signal(SIGINT, interruptHandler);
-#endif
-
debugstatus.tracing = FALSE;
debugstatus.debugging = DBG_OFF;
debugstatus.suspendTrace = 0;
@@ -1762,6 +1757,11 @@
EXCEPTION_PORT;
debugstatus.showContext = FALSE;
+#if defined(O_INTERRUPT) && defined(SIGINT)
+ if ( truePrologFlag(PLFLAG_SIGNALS) )
+ PL_signal(SIGINT, interruptHandler);
+#endif
+
resetTracer();
}
@@ -2097,7 +2097,7 @@
if ( !PL_strip_module(value, &m, value) )
return FALSE;
- set(fr, FR_WATCHED); /* explicit call to do this? */
+ set(fr, FR_DEBUG); /* explicit call to do this? */
if ( key == ATOM_argument && arity == 1 )
{ term_t arg = PL_new_term_ref();
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-trie.c swi-prolog-8.0.2+dfsg/src/pl-trie.c
--- swi-prolog-8.0.1+dfsg/src/pl-trie.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-trie.c 2019-03-05 16:53:38.000000000 +0500
@@ -1242,39 +1242,61 @@
trie_node *child;
size_t gsize;
unsigned int nvars;
- struct trie_choice *next;
- struct trie_choice *prev;
} trie_choice;
typedef struct
-{ trie_choice *head; /* head of trie nodes */
- trie_choice *tail; /* tail of trie nodes */
- trie *trie; /* trie we operate on */
+{ trie *trie; /* trie we operate on */
+ int allocated;
+ tmp_buffer choicepoints; /* Stack of trie state choicepoints */
} trie_gen_state;
static void
-clear_trie_state(trie_gen_state *state)
-{ trie_choice *ch, *next;
+init_trie_state(trie_gen_state *state, trie *trie)
+{ state->trie = trie;
+ state->allocated = FALSE;
+ initBuffer(&state->choicepoints);
+}
+
- for(ch=state->head; ch; ch=next)
- { next = ch->next;
+#define base_choice(state) baseBuffer(&state->choicepoints, trie_choice)
+#define top_choice(state) topBuffer(&state->choicepoints, trie_choice)
+
+
+static void
+clear_trie_state(trie_gen_state *state)
+{ trie_choice *chp = base_choice(state);
+ trie_choice *top = top_choice(state);
- if ( ch->choice.table )
- freeTableEnum(ch->choice.table);
- PL_free(ch);
+ for(; chp < top; chp++)
+ { if ( chp->choice.table )
+ freeTableEnum(chp->choice.table);
}
+ discardBuffer(&state->choicepoints);
+
release_trie(state->trie);
+
+ if ( state->allocated )
+ freeForeignState(state, sizeof(*state));
}
trie_choice *
add_choice(trie_gen_state *state, trie_node *node)
-{ trie_choice *ch = PL_malloc(sizeof(*ch));
- trie_children children = node->children;
- size_t gsize = state->tail ? state->tail->gsize : 0;
- unsigned int nvars = state->tail ? state->tail->nvars : 0;
+{ trie_children children = node->children;
+ trie_choice *ch = allocFromBuffer(&state->choicepoints, sizeof(*ch));
+ size_t gsize;
+ unsigned int nvars;
+
+ if ( ch > base_choice(state) )
+ { trie_choice *prev = ch-1;
+ gsize = prev->gsize;
+ nvars = prev->nvars;
+ } else
+ { gsize = 0;
+ nvars = 0;
+ }
if ( children.any )
{ switch( children.any->type )
@@ -1314,14 +1336,6 @@
ch->gsize = gsize;
ch->nvars = nvars;
- ch->next = NULL;
- ch->prev = state->tail;
- if ( state->tail )
- state->tail->next = ch;
- else
- state->head = ch;
- state->tail = ch;
-
return ch;
}
@@ -1336,23 +1350,6 @@
}
-static trie_choice *
-previous_choice(trie_gen_state *state)
-{ trie_choice *ch = state->tail;
-
- if ( ch->choice.table )
- freeTableEnum(ch->choice.table);
- state->tail = ch->prev;
- if ( state->tail )
- state->tail->next = NULL;
- else
- state->head = NULL;
- PL_free(ch);
-
- return state->tail;
-}
-
-
static int
advance_node(trie_choice *ch)
{ if ( ch->choice.table )
@@ -1372,12 +1369,16 @@
static int
next_choice(trie_gen_state *state)
-{ trie_choice *ch;
+{ trie_choice *btm = base_choice(state);
+ trie_choice *ch = top_choice(state)-1;
- for( ch = state->tail; ch; ch = previous_choice(state) )
+ while(ch >= btm)
{ if ( advance_node(ch) &&
descent_node(state, ch) )
return TRUE;
+
+ state->choicepoints.top = (char*)ch;
+ ch--;
}
return FALSE;
@@ -1387,26 +1388,24 @@
static int
put_trie_path(term_t term, Word value, trie_gen_state *gstate ARG_LD)
{ int rc = TRUE;
- trie_choice *ch;
build_state bstate;
+ trie_choice *lch = top_choice(gstate)-1;
if ( init_build_state(&bstate,
gstate->trie,
- gstate->tail->gsize,
- gstate->tail->nvars+1 PASS_LD) )
- {
+ lch->gsize,
+ lch->nvars+1 PASS_LD) )
+ { trie_choice *ch = base_choice(gstate);
+ trie_choice *top = top_choice(gstate);
#ifndef NDEBUG
- Word gok = gTop + gstate->tail->gsize;
+ Word gok = gTop + lch->gsize;
#endif
- for( ch = gstate->head; ch; ch = ch->next )
+ for( ; ch < top; ch++ )
{ if ( !eval_key(&bstate, ch->key PASS_LD) )
{ rc = FALSE;
break;
}
- if ( !ch->next )
- { *value = ch->child->value;
- }
}
clear_build_state(&bstate);
@@ -1415,6 +1414,7 @@
gTop = bstate.gp;
*valTermRef(term) = bstate.result;
DEBUG(CHK_SECURE, PL_check_data(term));
+ *value = ch[-1].child->value;
}
} else
rc = FALSE;
@@ -1437,12 +1437,10 @@
{ trie *trie;
if ( get_trie(A1, &trie) )
- { state = &state_buf;
- memset(state, 0, sizeof(*state));
-
- if ( trie->root.children.any )
+ { if ( trie->root.children.any )
{ acquire_trie(trie);
- state->trie = trie;
+ state = &state_buf;
+ init_trie_state(state, trie);
if ( !descent_node(state, add_choice(state, &trie->root)) &&
!next_choice(state) )
{ clear_trie_state(state);
@@ -1459,7 +1457,6 @@
case FRG_CUTTED:
state = CTX_PTR;
clear_trie_state(state);
- freeForeignState(state, sizeof(*state));
return TRUE;
default:
assert(0);
@@ -1469,16 +1466,32 @@
key = PL_new_term_ref();
fid = PL_open_foreign_frame();
- for( ; state->head; next_choice(state) )
+ for( ; !isEmptyBuffer(&state->choicepoints); next_choice(state) )
{ if ( !put_trie_path(key, &value, state PASS_LD) )
{ PL_close_foreign_frame(fid);
return FALSE; /* resource error */
}
if ( PL_unify(A2, key) && unify_value(A3, value PASS_LD) )
{ if ( next_choice(state) )
- { if ( state == &state_buf )
- { state = allocForeignState(sizeof(*state));
- memcpy(state, &state_buf, sizeof(*state));
+ { if ( !state->allocated )
+ { trie_gen_state *nstate = allocForeignState(sizeof(*state));
+ TmpBuffer nchp = &nstate->choicepoints;
+ TmpBuffer ochp = &state->choicepoints;
+
+ nstate->trie = state->trie;
+ nstate->allocated = TRUE;
+ if ( ochp->base == ochp->static_buffer )
+ { size_t bytes = ochp->top - ochp->base;
+ initBuffer(nchp);
+ nchp->top = nchp->base + bytes;
+ memcpy(nchp->base, ochp->base, bytes);
+ } else
+ { nchp->base = ochp->base;
+ nchp->top = ochp->top;
+ nchp->max = ochp->max;
+ }
+
+ state = nstate;
}
PL_close_foreign_frame(fid);
ForeignRedoPtr(state);
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-vmi.c swi-prolog-8.0.2+dfsg/src/pl-vmi.c
--- swi-prolog-8.0.1+dfsg/src/pl-vmi.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-vmi.c 2019-03-05 16:53:38.000000000 +0500
@@ -4154,7 +4154,7 @@
THROW_EXCEPTION;
newChoice(CHP_CATCH, FR PASS_LD);
- set(FR, FR_WATCHED|FR_CLEANUP);
+ set(FR, FR_CLEANUP);
/* = B_VAR1 */
*argFrameP(lTop, 0) = linkVal(argFrameP(FR, 1));
@@ -4338,9 +4338,6 @@
{ int rc;
SAVE_REGISTERS(qid);
- exceptionUnwindGC();
- LOAD_REGISTERS(qid);
- SAVE_REGISTERS(qid);
rc = exception_hook(qid, consTermRef(FR), catchfr_ref PASS_LD);
LOAD_REGISTERS(qid);
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-wam.c swi-prolog-8.0.2+dfsg/src/pl-wam.c
--- swi-prolog-8.0.1+dfsg/src/pl-wam.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-wam.c 2019-03-05 16:53:38.000000000 +0500
@@ -671,7 +671,10 @@
fr = (LocalFrame)valTermRef(fref);
}
- return callEventHook(PLEV_FRAMEFINISHED, fr);
+ if ( true(fr, FR_DEBUG) )
+ return callEventHook(PLEV_FRAMEFINISHED, fr);
+
+ return TRUE;
}
@@ -1592,14 +1595,17 @@
setVar(*valTermRef(LD->exception.pending));
}
- LD->stacks.global.gced_size = 0;
- LD->stacks.trail.gced_size = 0;
+ if ( outofstack && outofstack->gc )
+ { LD->stacks.global.gced_size = 0;
+ LD->stacks.trail.gced_size = 0;
+ }
if ( !considerGarbageCollect((Stack)NULL) )
{ trimStacks((outofstack != NULL) PASS_LD);
- } else if ( outofstack != NULL )
+ } else
{ trimStacks(FALSE PASS_LD); /* just re-enable the spare stacks */
- LD->trim_stack_requested = TRUE; /* next time with resize */
+ if ( outofstack != NULL )
+ LD->trim_stack_requested = TRUE; /* next time with resize */
}
LD->exception.processing = FALSE;
diff -Nru swi-prolog-8.0.1+dfsg/src/pl-zip.c swi-prolog-8.0.2+dfsg/src/pl-zip.c
--- swi-prolog-8.0.1+dfsg/src/pl-zip.c 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/pl-zip.c 2019-03-05 16:53:38.000000000 +0500
@@ -447,6 +447,7 @@
close_zipper(zipper *z)
{ zipFile zf;
unzFile uzf;
+ char *path;
int rc = 0;
if ( (zf=z->writer) )
@@ -456,15 +457,19 @@
{ z->reader = NULL;
rc = unzClose(uzf);
}
- if ( z->path )
- { free((char*)z->path);
- z->path = NULL;
+ if ( (path=(char*)z->path) )
+ { z->path = NULL;
+ free(path);
}
if ( z->input.any )
{ switch(z->input_type)
{ case ZIP_STREAM:
if ( true(z, ZIP_CLOSE_STREAM_ON_CLOSE) )
- Sclose(z->input.stream);
+ { IOSTREAM *in = z->input.stream;
+
+ z->input.stream = NULL;
+ Sclose(in);
+ }
break;
default:
break;
Двоичные файлы /tmp/cgV2MI9gU_/swi-prolog-8.0.1+dfsg/src/swipl.ico и /tmp/uMQEvAhSaE/swi-prolog-8.0.2+dfsg/src/swipl.ico различаются
diff -Nru swi-prolog-8.0.1+dfsg/src/SWI-Prolog.h swi-prolog-8.0.2+dfsg/src/SWI-Prolog.h
--- swi-prolog-8.0.1+dfsg/src/SWI-Prolog.h 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/SWI-Prolog.h 2019-03-05 16:53:38.000000000 +0500
@@ -68,7 +68,7 @@
/* PLVERSION_TAG: a string, normally "", but for example "rc1" */
#ifndef PLVERSION
-#define PLVERSION 80001
+#define PLVERSION 80002
#endif
#ifndef PLVERSION_TAG
#define PLVERSION_TAG ""
diff -Nru swi-prolog-8.0.1+dfsg/src/Tests/library/test_tabling.pl swi-prolog-8.0.2+dfsg/src/Tests/library/test_tabling.pl
--- swi-prolog-8.0.1+dfsg/src/Tests/library/test_tabling.pl 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/src/Tests/library/test_tabling.pl 2019-03-05 16:53:38.000000000 +0500
@@ -1200,20 +1200,20 @@
:- begin_tests(mode_components1, [cleanup(abolish_all_tables)]).
:- table
- p(lattice(orp/3)),
- s(lattice(ors/3)).
+ p2(lattice(orp/3)),
+ s2(lattice(ors/3)).
orp(A,B,A+B).
ors(A,B,A-B).
-p(A) :-
- s(A).
+p2(A) :-
+ s2(A).
-s(1).
-s(2).
+s2(1).
+s2(2).
test(component, [A == (1-2), nondet]) :-
- p(A).
+ p2(A).
:- end_tests(mode_components1).
diff -Nru swi-prolog-8.0.1+dfsg/VERSION swi-prolog-8.0.2+dfsg/VERSION
--- swi-prolog-8.0.1+dfsg/VERSION 2019-01-25 20:43:37.000000000 +0500
+++ swi-prolog-8.0.2+dfsg/VERSION 2019-03-05 16:53:38.000000000 +0500
@@ -1 +1 @@
-8.0.1
+8.0.2
Reply to: