Did you know ... | Search Documentation: |
Title for pldoc(default) |
[Sep 13 2017]
[Sep 12 2017]
set_prolog_flag(browser, Command-fg)
to run the browser
as a foreground job. Samer Abdallah.[Sep 10 2017]
[Sep 8 2017]
[Sep 6 2017]
prolog
, so we can say requires(prolog >= '7.5.14')
.[Aug 31 2017]
[Sep 4 2017]
-fprofile-correction
.
We choose to disable threads while generating profile info using
`--nosignals`.[Sep 2 2017]
[Sep 1 2017]
[Aug 31 2017]
[Aug 30 2017]
attr = NULL
[Aug 29 2017]
[Aug 28 2017]
endReconsult()
when loading QLF files so that consulted
clauses are finalized[Aug 24 2017]
last_modified_generation(-Gen)
property.[Aug 23 2017]
last_modified_generation(-Gen)
to
support caching.pthread_mutex_timedlock()
and/or pthread_timedjoin_np()
.[Aug 22 2017]
[Aug 21 2017]
[Aug 19 2017]
hasClausesDefenition()
: avoid relying on LD->gen_reload
and simply scan the clause list. Do not use the environment frame
generation as this can be bogus.[Aug 18 2017]
thread(s)
.expand(true)
. Issue#265[Aug 17 2017]
[Aug 16 2017]
[Aug 17 2017]
[Aug 16 2017]
[Aug 15 2017]
[Aug 14 2017]
[Aug 11 2017]
[Aug 7 2017]
[Aug 11 2017]
[Aug 9 2017]
trace_gc
flag is active, printing the AGC completion
message returned from pl_garbage_collect()
before resetting the active
flag, thus preventing further AGC.swipl
is the first
on the executable search PATH. Wouter Beek.[Aug 7 2017]
[Aug 6 2017]
[Aug 4 2017]
[Aug 3 2017]
[Aug 2 2017]
backtrace()
actually works. Not (always) the case
on OpenBSD.[Aug 1 2017]
[Jul 31 2017]
[Jul 28 2017]
[Jul 16 2017]
[Jul 11 2017]
[Jul 10 2017]
[Jul 7 2017]
[Jul 6 2017]
[Jul 4 2017]
file_name_extension(+Base, '', -Full)
should not add a
"." to Base.[Jul 3 2017]
clearThreadTablingData()
before
cleanupAtoms()
. Still dubious to call the cleanup handlers of atoms
during Prolog shutdown as they may depend on each other.[Jul 2 2017]
[Jun 30 2017]
foreign(save)
if there are
multiple directories in the foreign
search path (e.g., if there
are packs). Nicos Angelopoulos.[Jun 29 2017]
For example, previously:
?- 2^X+ R #= 1000, R #>= 0. 2^X#=_1250, _1250 in inf..1000, _1250+R#=1000, R in 0..sup.
Now:
?- 2^X+ R #= 1000, R #>= 0. X in inf..9, 2^X#=_8836, _8836 in inf..1000, _8836+R#=1000, R in 0..sup.
[Jun 28 2017]
[Jun 25 2017]
A new binding must not be dragged outside of disjunctions, since the code may look for example like this:
i(X) :- ( X #= 3 ; X #= 4 ).
In fact, this would previously not even compile, and instead raise:
put_attr/3: Uninstantiated argument expected, found 3 (1-st argument)
already during goal expansion.
This commit fixes this issue, and still rewrites CLP(FD) expressions as far as possible already at compilation time.
For example:
n(X) :- X #= 1+3.
This is now compiled to (note that 1+3 is evaluated to 4):
?- listing(n/1). %@ n(A) :- %@ ( integer(A) %@ -> A=:=4 %@ ; var(A) %@ -> A=4 %@ ; B=4, %@ clpfd:clpfd_equal(A, B) %@ ).
Ideally, it should be compiled to:
n(4).
[Jun 24 2017]
builtin_popcountll()
to compute popcount for `small'
integers.[Jun 23 2017]
[Jun 22 2017]
[Jun 20 2017]
[Jun 19 2017]
[Jun 18 2017]
[Jun 16 2017]
cleanClauseIndexes()
should be locked with
addClauseToIndexes()
. May cause incorrect results as well
as crashes.[Jun 15 2017]
am
/pm
in some locales.[Jun 14 2017]
[Jun 11 2017]
[Jun 10 2017]
[Jun 9 2017]
toplevel_goal
to inspect and modify the toplevel
inside the initialization.initialization(G, main)
should use the last according
to the docs.[Jun 8 2017]
main(Argv)
without calling halt/0,1.
This enhances interaction with :- initialization(main,
main)
.[Jun 7 2017]
[Jun 6 2017]
[Jun 4 2017]
This approach uses the Github API to retrieve the tags i.o. scraping the HTML.
[Jun 6 2017]
[Jun 5 2017]
[Jun 3 2017]
[Jun 2 2017]
[Jun 1 2017]
[May 31 2017]
predicate_property(Head, indexed(Indexes))
now uses a list
of arguments for which the hash is generated.[May 30 2017]
bestHash()
return 1-based arguments for consistencybestHash()
[May 31 2017]
[May 30 2017]
[May 23 2017]
[May 22 2017]
[May 19 2017]
printMessage()
printMessage()
propagate exceptions.[May 21 2017]
[May 19 2017]
[May 18 2017]
[May 17 2017]
[May 18 2017]
[May 17 2017]
[May 16 2017]
[May 15 2017]
[May 14 2017]
expand(true)
may be multi.[May 12 2017]
[May 11 2017]
[May 10 2017]
parentheses_term_position(_, _, _)
.considerClauseGC()
while clause GC is
running. This patch also makes considerClauseGC()
return early if
clause GC kicks in while it is being considered.assert_fail()
.[May 9 2017]
assert_fail()
.[May 7 2017]
?- transpose([[a],[b,c]], Ts). Ts = [[a, b]].
Now:
?- transpose([[a],[b,c]], Ts). false.
Note that we had previously, and still have now:
?- transpose([[a,b],[c]], Ts). false.
Thus, transpose/2 would previously succeed only for some ragged matrices, and now fails consistently if the matrix is ragged.
User programs are unlikely to be affected (for the worse) by this change. Still, if you encounter a case where the previous behaviour is more desirable, please let me know. Note that transpose/2 also fails for such cases in SICStus Prolog, where it ships in library(lists).
[May 2 2017]
[Apr 30 2017]
[Apr 28 2017]
error_ambiguous_stream_pair
is set to true
. Eventually that will become default, but I fear
too much code will break.checkAtoms()
[Apr 26 2017]
[Apr 25 2017]
downstream
and added additional
assert()
statements.assert()
to check stream references.[Apr 24 2017]
[Apr 23 2017]
[Apr 21 2017]
[Apr 19 2017]
[Apr 14 2017]
[Apr 12 2017]
c(A, B, Rel) :- compare(Rel, A, B).
Sample query and answer, previously:
?- partition(c(a), [a,b,c], Ss, [], Gs). true.
Now:
?- partition(c(a), [a,b,c], Ss, [], Gs). false.
Note that the signature allows this usage mode!
[Apr 11 2017]
prolog
type in xpce. Birgit Elbl.representation_error(continuation)
error if we
cannot capture the continuation. This shouldn't happen, but a normal
Prolog exception makes locating easier and is less drastic.prolog_load_context(stream, S)
and :- encoding(Enc)
when
compiling from a stream.set_stream(S, record_position(true))
now resets the position
and documents this behaviour.[Apr 9 2017]
write_errors(+How)
, which can be used to ask
a stream (typically user_error
) to ignore write errors.[Apr 1 2017]
[Mar 28 2017]
[Mar 25 2017]
[Mar 23 2017]
[Mar 20 2017]
[Mar 17 2017]
[Mar 16 2017]
duplicate_key(+Key)
dict error term.[Mar 13 2017]
[Mar 11 2017]
[Mar 9 2017]
[Mar 2 2017]
xos_fopen()
: wrong overflow check (cannot harm
Prolog code).[Feb 28 2017]
[Feb 27 2017]
[Feb 26 2017]
[Feb 25 2017]
[Feb 20 2017]
[Feb 19 2017]
unprotected
, which is executed first.[Feb 17 2017]
[Feb 15 2017]
[Feb 13 2017]
[Feb 10 2017]
[Feb 9 2017]
[Feb 8 2017]
dumb
. Fixed ediprolog interaction.[Feb 7 2017]
[Feb 6 2017]
It also seems to be the case that a tree with more than one entry for a given key is an invalid tree (and is rejected by is_rbtree/1).
Taking these together, we can conclude that the old rb_lookupall/3 was redundant, since there should only ever be one value for a given key whether or not that key contains variables. Instead, rb_lookup/3 should be used. I've taken the possibly drastic step of removing rb_lookupall/3 completely, but another option would be to leave it in but deprecated and with dire warnings.
Also, the old rb_in/3 was diverting to lookup/3 for nonvariable keys.
This was giving incorrect behaviour for partially instantiated keys,
since the tree may contain several keys that unify with the given term.
My initial fix was to replace the nonvar(Key)
with a \+ground(Test)
.
However, further consideration has lead me to remove that clause of
rb_in/3 entirely. The reasoning behind this is:
In further support of this change, this is exactly what assoc:gen_assoc/3 does, leaving get_assoc/3 the job of doing O(log N) lookups. Also, assoc:ord_list_to_assoc also prevents the creation of duplicate keys.
[Feb 5 2017]
[Feb 4 2017]
For example, consider commit b380cad24cbe5102a549bfb8f7406e34a2b99e1a in the SSL package, where Pow #= Signature^Exponent mod Modulus is used to verify a certificate's signature with the CLP(FD) constraint (#=)/2.
If the arguments are sufficiently instantiated, this constraint is now
automatically compiled to Pow is powm(Signature,Exponent,Modulus)
,
making the query run ca. 30 000 times faster. This also works if
we write
the constraint as Signature^Exponent mod Modulus #= Pow, which may be
more natural to Prolog programmers with a strong mathematical
background.
Integer constraints of the form A^B mod M also occur in DH key exchange, which is used to ensure forward secrecy in (HTTPS) web applications.
[Feb 3 2017]
[Feb 2 2017]
[Feb 1 2017]
[Jan 23 2017]
[Jan 22 2017]
[Apr 23 2017]
[Sep 10 2017]
[Sep 10 2017]
[Aug 15 2017]
exclude(+Patterns)
option.[Jul 14 2017]
[Jun 15 2017]
[Sep 10 2017]
[Aug 3 2017]
[Jun 24 2017]
[Aug 11 2017]
gc
thread in fork/1[Aug 3 2017]
[Aug 2 2017]
[Jul 27 2017]
[Jul 4 2017]
[Jul 2 2017]
[Jun 18 2017]
directory_file_path(-,+,+)
returns directory with
trailing '/'. Paul Singleton.[May 18 2017]
[May 17 2017]
[May 12 2017]
[Apr 28 2017]
[Jul 22 2017]
[Sep 10 2017]
[Sep 7 2017]
[Aug 29 2017]
http_handler(prefix(...),
...)
. This was deprecated for a long time. Use prefix
in the
option list.[Aug 24 2017]
[Aug 14 2017]
[Jun 29 2017]
[Jun 28 2017]
Future SWI-Prolog versions will likewise enable default ciphers that are deemed secure at the time of the respective release, and at the same time ensure compatibility with all but the most exotic or outdated devices.
Note that obsolete ciphers must be disabled to reliably prevent protocol downgrade attacks.
[Jun 27 2017]
[May 21 2017]
[Jun 14 2017]
[Jun 10 2017]
[Jun 7 2017]
library(http/http_unix_daemonm)
now registers the
application entry point as http_daemon/0. Code should remove their :-
initialization(http_daemon).
to profit from this change. Old code
should run unmodified though.[May 22 2017]
[Apr 28 2017]
[Apr 26 2017]
[Apr 24 2017]
[Apr 18 2017]
ping
message.[Apr 14 2017]
[Apr 12 2017]
[Apr 11 2017]
Restart=on-failure
in the systemd
demo script to
restart if the server is halted with status != 0 which happens e.g.,
if the service looses stderr
.[Apr 10 2017]
[Apr 8 2017]
user_error
the server is terminated with status 2
. This problem
may happen if Prolog is launched by service manager that reads the
Prolog output from stderr
and the monitoring process is restarted.
Not doing anything is not an option as we will loose all server
threads, eventually starving the server. Ignoring will probably
become an alternative, but this needs to implemented elsewhere.[Mar 21 2017]
[Mar 20 2017]
[Mar 16 2017]
[Mar 14 2017]
gc(When)
. If set to
active
, sessions are actively collected soon after their timeout.[Mar 4 2017]
semidet
instead of det
.[Mar 3 2017]
as(As)
defaults to atom
and this
predicate now supports chars
.[Sep 10 2017]
[Sep 4 2017]
[Aug 30 2017]
pthread_cond_signal()
was called without the mutex locked.
This also turns out to be why pthread-win32 failed: apparently
pthread_cond_signal()
itself cannot be called without the associated
lock held. Windows version still uses Event based implementation,
but now a bit smarter and closer to the POSIX code.pthread_cond_signal()
deadlocks.
The new implementation uses Windows Events for the Windows version.
This probably also improves performance. Note that SWI-Prolog uses
its own condition variable emulation for performance reasons.[Jun 27 2017]
[Sep 4 2017]
[Aug 15 2017]
[Aug 11 2017]
[Aug 3 2017]
[Sep 10 2017]
[May 18 2017]
[Sep 10 2017]
[Aug 10 2017]
[Aug 8 2017]
[Jun 1 2017]
[Sep 10 2017]
[Jul 6 2017]
[Jun 16 2017]
[May 12 2017]
[May 2 2017]
beforeunload
to kill all running Pengines.[Apr 11 2017]
[Apr 2 2017]
abort_query
exception as well
as I/O errors preventing the abort from being send at all.[Apr 1 2017]
[Mar 23 2017]
[Mar 22 2017]
success(Pengine, Answer,
Time, More)
to success(Pengine, Answer, Projection, Time, More)
and
the VarNames argument has been removed from write_result/4
and event_to_json/4 (both now accepting 3 arguments). This largely
simplifies the design. In addition, it provides Pengines access
to the actual variable names inside a query and the possibility to
control the projection variables (in the future).
Code that defines additional output formats, such as writing CSV files, must be changed. Most typical usage of Pengines should not be affected.
[Mar 20 2017]
ask(query)
available to the
pengine using the global variable '$variable_names'. This can be
used in goal_expansion/2 hooks and possible for debugging aids.[Sep 13 2017]
[Sep 12 2017]
[Sep 11 2017]
[Sep 10 2017]
[Aug 29 2017]
[Aug 19 2017]
[Jul 14 2017]
[Jul 12 2017]
[Jul 9 2017]
[Jun 24 2017]
[Jun 22 2017]
[Jun 18 2017]
[Jun 15 2017]
[Jun 10 2017]
[Mar 9 2017]
[Sep 10 2017]
[Sep 9 2017]
[Sep 12 2017]
[Aug 3 2017]
[Sep 10 2017]
[Sep 4 2017]
[Jul 27 2017]
rdf_statistics(graphs(Count))
to properly handle destroyed
graphs.[Jun 29 2017]
[Jun 20 2017]
[Jun 18 2017]
[Apr 24 2017]
[Mar 29 2017]
rdf_list(-)
would not enumerate more than one RDF list.[Jan 24 2017]
[Jun 15 2017]
[Jun 13 2017]
[Jun 11 2017]
[May 22 2017]
[May 21 2017]
[Apr 28 2017]
[Apr 24 2017]
[Apr 3 2017]
[Mar 29 2017]
[Mar 28 2017]
[Mar 27 2017]
[Feb 16 2017]
stream(Stream)
term.[Feb 9 2017]
[Feb 4 2017]
[May 11 2017]
[Apr 28 2017]
[Apr 26 2017]
[Sep 11 2017]
[Sep 10 2017]
All hash predicates, and rsa_verify/4 and rsa_sign/4 are affected.
To make interoperability and compatibility possible, the affected predicates all yield the actual algorithm that was used if the pertaining option is present and the algorithm is a logical variable.
[Sep 9 2017]
The primary purpose of this change is to signal that security is being taken seriously here, and to do everything that is possible to prevent future users from relying on insecure algorithms (however unlikely that may be, since most will explicitly specify a secure algorithm).
The new default of sha256 is also in alignment with what the hash predicates such as crypto_data_hash/3 produce by default.
?- phrase(utf8_codes([255]), Cs). %@ Cs = [195, 191].
[Sep 2 2017]
[Aug 21 2017]
evp_encrypt/6 evp_decrypt/6
They are now called, respectively:
crypto_data_encrypt/6 crypto_data_decrypt/6
Only the names have changed, so please simply replace any calls.
This change serves the following purposes:
First, it puts these predicates into the crypto_... namespace that is adhered to also by most other predicates of library(crypto). This is also nice because the rather cryptic "evp_" prefix is OpenSSL-specific and makes very little sense to Prolog application programmers.
Second, it paves the way for naturally named additional predicates that work incrementally. These new predicates will be called crypto_encryption_context/5, crypto_data_cipher_context/4 etc.
I expect almost no impact on existing applications from this change:
The two evp_... predicates were added less than one year ago to then library(ssl). However, these predicates were not really usable without cryptographically secure random numbers, and those were only made available one month ago. In the future, these predicates and especially the incremental versions will become much more important to encrypt large volumes of data.
[Aug 13 2017]
[Aug 11 2017]
[Aug 9 2017]
[Aug 8 2017]
[Aug 6 2017]
[Jul 31 2017]
For security reasons, it is highly recommended that you use crypto_password_hash/2 instead of crypt/2. This lets you store the hashes of user passwords in a reasonably secure way.
[Jul 29 2017]
seq(1)
for
compatibility with OpenBSD.[Jul 4 2017]
?- crypto_n_random_bytes(16, Bs), atom_codes(IV, Bs), evp_encrypt("this is some inp", 'aes-128-cbc', "sixteenbyteofkey", IV, CipherText, [padding(none)]), evp_decrypt(CipherText, 'aes-128-cbc', "sixteenbyteofkey", IV, RecoveredText, [padding(block)]). %@ ERROR: SSL(06065064) EVP_DecryptFinal_ex: bad decrypt
?- evp_encrypt("this is some input", 'aes-128-cbc', "sixteenbyteofkey", "sixteenbytesofiv", CipherText, [padding(none)]). %@ ERROR: SSL(0607F08A) EVP_EncryptFinal_ex: data not multiple of block length %@ ERROR: In: %@ ERROR: [8] crypto:evp_encrypt("this is some input",'aes-128-cbc',"sixteenbyteofkey","sixteenbytesofiv",_10414,[padding(none)]) %@ ERROR: [7] <user>
[Jul 3 2017]
[Jul 2 2017]
In fact, too many similarly named entities made navigating the code harder than necessary and also quite a bit longer.
In case you are affected too, instead of:
ssl_set_sni_hook(SSL0, Goal, SSL)
please use:
ssl_set_options(SSL0, SSL, [sni_hook(Goal)]).
ssl_set_options/3 is the much more general interface predicate for tweaking contexts, fully subsuming ssl_set_sni_hook/3 and also other predicates that would otherwise have to be introduced to set various SSL parameters.
Usage examples of this new predicate include:
-) disabling specific protocol versions -) setting elliptic curves for key exchange -) enforcing client authentication via certificates -) etc.
For example, to disable SSLv3, you can add the following definition to your server:
http:ssl_server_create_hook(SSL0, SSL, _) :- ssl_set_options(SSL0, SSL, [disable_ssl_methods([sslv3])]).
This is of course only necessary for old versions of OpenSSL, since SSLv3 is disabled in all versions that are still supported (>= 1.0.2).
[Jul 1 2017]
disable_ssl_methods(+List)
: raise type errors on illegal
input, use a long
and warn in debug mode if setting fails.[Jun 29 2017]
[Jun 26 2017]
[Jun 25 2017]
[Jun 23 2017]
[Jun 20 2017]
[Jun 19 2017]
For reasoning about Bitcoin addresses with library(crypto), check out:
https://www.metalevel.at/bitcoinolog/
Sample use of scalar multiplication over elliptic curves:
?- crypto_name_curve(secp256k1, C), crypto_curve_generator(C, G), crypto_curve_scalar_mult(C, 5, G, P).
Yielding:
%@ C = <crypto_curve>(secp256k1, 0x21e8a90), %@ G = point(55066263022277343669578718895168534326250603453777594175500187360389116729240, 32670510020758816978083085130507043184471273380659243275938904335757337482424), %@ P = point(21505829891763648114329055987619236494102133314575206970830385799158076338148, 98003708678762621233683240503080860129026887322874138805529884920309963580118).
[Jun 18 2017]
?- length(_, L), garbage_collect, crypto_context_new(Context, [algorithm(sha256)]), false.
17 2017]
This can be more than an order of magnitude faster than doing it in Prolog.
For example, consider the following Prolog implementation, using the extended Euclidean algorithm:
multiplicative_inverse_modulo_p(X, P, Y) :- eea(X, P, _, _, Y), R #= X*Y mod P, zcompare(C, 1, R), must_be_one(C, X, P, Y). must_be_one(=, _, _, _). must_be_one(>, X, P, Y) :- throw(multiplicative_inverse_modulo_p(X,P,Y)). must_be_one(<, X, P, Y) :- throw(multiplicative_inverse_modulo_p(X,P,Y)). eea(I, J, G, S, T) :- State0 = state(1,0,0,1), eea_loop(I, J, State0, G, S, T). eea_loop(I, J, State0, G, S, T) :- zcompare(C, 0, J), eea_(C, I, J, State0, G, S, T). eea_(=, I, _, state(_,_,U,V), I, U, V). eea_(<, I0, J0, state(S0,T0,U0,V0), I, U, V) :- Q #= I0 // J0, R #= I0 mod J0, S1 #= U0 - (Q*S0), T1 #= V0 - (Q*T0), eea_loop(J0, R, state(S1,T1,S0,T0), I, U, V).
We now have, using the Prolog implementation:
?- time((between(1,1000,_), multiplicative_inverse_modulo_p(65341020041517633956166170261014086368942546761318486551877808671514674964848, 115792089237316195423570985008687907853269984665640564039457584007908834671663, I),false)). %@ % 14,921,002 inferences, 1.133 CPU in 1.133 seconds (100% CPU, 13173595 Lips) %@ false.
And using the new crypto_modular_inverse/3:
?- time((between(1,1000,_), crypto_modular_inverse(65341020041517633956166170261014086368942546761318486551877808671514674964848, 115792089237316195423570985008687907853269984665640564039457584007908834671663, I),false)). %@ % 326,205 inferences, 0.079 CPU in 0.079 seconds (100% CPU, 4116844 Lips) %@ false.
[Jun 16 2017]
[Jun 15 2017]
[Jun 9 2017]
[Jun 3 2017]
OpenSSL 1.1.0 and later versions do not need this initialisation.
[Apr 25 2017]
ssl_close()
more readable[Apr 24 2017]
ssl_close()
: return -1 on errors of underlying functions.[Sep 10 2017]
[Aug 2 2017]
[Sep 10 2017]
[Sep 10 2017]
[Aug 21 2017]
[Aug 15 2017]
[Jun 25 2017]
[Jun 12 2017]
[Jun 5 2017]
[May 14 2017]
?-
manpce.
on some window managers. As a result, frame->geometry
no longer accepts negative X coordinates.[May 10 2017]
regex->for_all
: use end of match if match is not at start
OR not empty instead of `AND not empty'.[Apr 26 2017]
[Sep 10 2017]